/* Generated by Cython 3.2.8 */

/* BEGIN: Cython Metadata
{
    "distutils": {
        "depends": [
            "opengl/SnapPyfont.h",
            "opengl/opengl.h"
        ],
        "include_dirs": [
            "opengl"
        ],
        "name": "CyOpenGL",
        "sources": [
            "opengl/CyOpenGL.pyx"
        ]
    },
    "module_name": "CyOpenGL"
}
END: Cython Metadata */

#ifndef PY_SSIZE_T_CLEAN
#define PY_SSIZE_T_CLEAN
#endif /* PY_SSIZE_T_CLEAN */
/* InitLimitedAPI */
#if defined(Py_LIMITED_API)
  #if !defined(CYTHON_LIMITED_API)
  #define CYTHON_LIMITED_API 1
  #endif
#elif defined(CYTHON_LIMITED_API)
  #ifdef _MSC_VER
  #pragma message ("Limited API usage is enabled with 'CYTHON_LIMITED_API' but 'Py_LIMITED_API' does not define a Python target version. Consider setting 'Py_LIMITED_API' instead.")
  #else
  #warning Limited API usage is enabled with 'CYTHON_LIMITED_API' but 'Py_LIMITED_API' does not define a Python target version. Consider setting 'Py_LIMITED_API' instead.
  #endif
#endif

#include "Python.h"
#ifndef Py_PYTHON_H
    #error Python headers needed to compile C extensions, please install development version of Python.
#elif PY_VERSION_HEX < 0x03080000
    #error Cython requires Python 3.8+.
#else
#define __PYX_ABI_VERSION "3_2_8"
#define CYTHON_HEX_VERSION 0x030208F0
#define CYTHON_FUTURE_DIVISION 1
/* CModulePreamble */
#include <stddef.h>
#ifndef offsetof
  #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
#endif
#if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS)
  #ifndef __stdcall
    #define __stdcall
  #endif
  #ifndef __cdecl
    #define __cdecl
  #endif
  #ifndef __fastcall
    #define __fastcall
  #endif
#endif
#ifndef DL_IMPORT
  #define DL_IMPORT(t) t
#endif
#ifndef DL_EXPORT
  #define DL_EXPORT(t) t
#endif
#define __PYX_COMMA ,
#ifndef PY_LONG_LONG
  #define PY_LONG_LONG LONG_LONG
#endif
#ifndef Py_HUGE_VAL
  #define Py_HUGE_VAL HUGE_VAL
#endif
#define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX
#if defined(GRAALVM_PYTHON)
  /* For very preliminary testing purposes. Most variables are set the same as PyPy.
     The existence of this section does not imply that anything works or is even tested */
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #define CYTHON_COMPILING_IN_LIMITED_API 0
  #define CYTHON_COMPILING_IN_GRAAL 1
  #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
  #undef CYTHON_USE_TYPE_SLOTS
  #define CYTHON_USE_TYPE_SLOTS 0
  #undef CYTHON_USE_TYPE_SPECS
  #define CYTHON_USE_TYPE_SPECS 0
  #undef CYTHON_USE_PYTYPE_LOOKUP
  #define CYTHON_USE_PYTYPE_LOOKUP 0
  #undef CYTHON_USE_PYLIST_INTERNALS
  #define CYTHON_USE_PYLIST_INTERNALS 0
  #undef CYTHON_USE_UNICODE_INTERNALS
  #define CYTHON_USE_UNICODE_INTERNALS 0
  #undef CYTHON_USE_UNICODE_WRITER
  #define CYTHON_USE_UNICODE_WRITER 0
  #undef CYTHON_USE_PYLONG_INTERNALS
  #define CYTHON_USE_PYLONG_INTERNALS 0
  #undef CYTHON_AVOID_BORROWED_REFS
  #define CYTHON_AVOID_BORROWED_REFS 1
  #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
  #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
  #undef CYTHON_ASSUME_SAFE_MACROS
  #define CYTHON_ASSUME_SAFE_MACROS 0
  #undef CYTHON_ASSUME_SAFE_SIZE
  #define CYTHON_ASSUME_SAFE_SIZE 0
  #undef CYTHON_UNPACK_METHODS
  #define CYTHON_UNPACK_METHODS 0
  #undef CYTHON_FAST_THREAD_STATE
  #define CYTHON_FAST_THREAD_STATE 0
  #undef CYTHON_FAST_GIL
  #define CYTHON_FAST_GIL 0
  #undef CYTHON_METH_FASTCALL
  #define CYTHON_METH_FASTCALL 0
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #ifndef CYTHON_PEP487_INIT_SUBCLASS
    #define CYTHON_PEP487_INIT_SUBCLASS 1
  #endif
  #undef CYTHON_PEP489_MULTI_PHASE_INIT
  #define CYTHON_PEP489_MULTI_PHASE_INIT 1
  #undef CYTHON_USE_MODULE_STATE
  #define CYTHON_USE_MODULE_STATE 0
  #undef CYTHON_USE_SYS_MONITORING
  #define CYTHON_USE_SYS_MONITORING 0
  #undef CYTHON_USE_TP_FINALIZE
  #define CYTHON_USE_TP_FINALIZE 0
  #undef CYTHON_USE_AM_SEND
  #define CYTHON_USE_AM_SEND 0
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 1
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
    #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
  #endif
  #undef CYTHON_USE_FREELISTS
  #define CYTHON_USE_FREELISTS 0
  #undef CYTHON_IMMORTAL_CONSTANTS
  #define CYTHON_IMMORTAL_CONSTANTS 0
#elif defined(PYPY_VERSION)
  #define CYTHON_COMPILING_IN_PYPY 1
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #define CYTHON_COMPILING_IN_LIMITED_API 0
  #define CYTHON_COMPILING_IN_GRAAL 0
  #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
  #undef CYTHON_USE_TYPE_SLOTS
  #define CYTHON_USE_TYPE_SLOTS 1
  #ifndef CYTHON_USE_TYPE_SPECS
    #define CYTHON_USE_TYPE_SPECS 0
  #endif
  #undef CYTHON_USE_PYTYPE_LOOKUP
  #define CYTHON_USE_PYTYPE_LOOKUP 0
  #undef CYTHON_USE_PYLIST_INTERNALS
  #define CYTHON_USE_PYLIST_INTERNALS 0
  #undef CYTHON_USE_UNICODE_INTERNALS
  #define CYTHON_USE_UNICODE_INTERNALS 0
  #undef CYTHON_USE_UNICODE_WRITER
  #define CYTHON_USE_UNICODE_WRITER 0
  #undef CYTHON_USE_PYLONG_INTERNALS
  #define CYTHON_USE_PYLONG_INTERNALS 0
  #undef CYTHON_AVOID_BORROWED_REFS
  #define CYTHON_AVOID_BORROWED_REFS 1
  #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
  #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1
  #undef CYTHON_ASSUME_SAFE_MACROS
  #define CYTHON_ASSUME_SAFE_MACROS 0
  #ifndef CYTHON_ASSUME_SAFE_SIZE
    #define CYTHON_ASSUME_SAFE_SIZE 1
  #endif
  #undef CYTHON_UNPACK_METHODS
  #define CYTHON_UNPACK_METHODS 0
  #undef CYTHON_FAST_THREAD_STATE
  #define CYTHON_FAST_THREAD_STATE 0
  #undef CYTHON_FAST_GIL
  #define CYTHON_FAST_GIL 0
  #undef CYTHON_METH_FASTCALL
  #define CYTHON_METH_FASTCALL 0
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #ifndef CYTHON_PEP487_INIT_SUBCLASS
    #define CYTHON_PEP487_INIT_SUBCLASS 1
  #endif
  #if PY_VERSION_HEX < 0x03090000
    #undef CYTHON_PEP489_MULTI_PHASE_INIT
    #define CYTHON_PEP489_MULTI_PHASE_INIT 0
  #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT)
    #define CYTHON_PEP489_MULTI_PHASE_INIT 1
  #endif
  #undef CYTHON_USE_MODULE_STATE
  #define CYTHON_USE_MODULE_STATE 0
  #undef CYTHON_USE_SYS_MONITORING
  #define CYTHON_USE_SYS_MONITORING 0
  #ifndef CYTHON_USE_TP_FINALIZE
    #define CYTHON_USE_TP_FINALIZE (PYPY_VERSION_NUM >= 0x07030C00)
  #endif
  #undef CYTHON_USE_AM_SEND
  #define CYTHON_USE_AM_SEND 0
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 0
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
    #define CYTHON_UPDATE_DESCRIPTOR_DOC (PYPY_VERSION_NUM >= 0x07031100)
  #endif
  #undef CYTHON_USE_FREELISTS
  #define CYTHON_USE_FREELISTS 0
  #undef CYTHON_IMMORTAL_CONSTANTS
  #define CYTHON_IMMORTAL_CONSTANTS 0
#elif defined(CYTHON_LIMITED_API)
  #ifdef Py_LIMITED_API
    #undef __PYX_LIMITED_VERSION_HEX
    #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API
  #endif
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #define CYTHON_COMPILING_IN_LIMITED_API 1
  #define CYTHON_COMPILING_IN_GRAAL 0
  #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
  #undef CYTHON_USE_TYPE_SLOTS
  #define CYTHON_USE_TYPE_SLOTS 0
  #undef CYTHON_USE_TYPE_SPECS
  #define CYTHON_USE_TYPE_SPECS 1
  #undef CYTHON_USE_PYTYPE_LOOKUP
  #define CYTHON_USE_PYTYPE_LOOKUP 0
  #undef CYTHON_USE_PYLIST_INTERNALS
  #define CYTHON_USE_PYLIST_INTERNALS 0
  #undef CYTHON_USE_UNICODE_INTERNALS
  #define CYTHON_USE_UNICODE_INTERNALS 0
  #ifndef CYTHON_USE_UNICODE_WRITER
    #define CYTHON_USE_UNICODE_WRITER 0
  #endif
  #undef CYTHON_USE_PYLONG_INTERNALS
  #define CYTHON_USE_PYLONG_INTERNALS 0
  #ifndef CYTHON_AVOID_BORROWED_REFS
    #define CYTHON_AVOID_BORROWED_REFS 0
  #endif
  #ifndef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
    #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
  #endif
  #undef CYTHON_ASSUME_SAFE_MACROS
  #define CYTHON_ASSUME_SAFE_MACROS 0
  #undef CYTHON_ASSUME_SAFE_SIZE
  #define CYTHON_ASSUME_SAFE_SIZE 0
  #undef CYTHON_UNPACK_METHODS
  #define CYTHON_UNPACK_METHODS 0
  #undef CYTHON_FAST_THREAD_STATE
  #define CYTHON_FAST_THREAD_STATE 0
  #undef CYTHON_FAST_GIL
  #define CYTHON_FAST_GIL 0
  #undef CYTHON_METH_FASTCALL
  #define CYTHON_METH_FASTCALL (__PYX_LIMITED_VERSION_HEX >= 0x030C0000)
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #ifndef CYTHON_PEP487_INIT_SUBCLASS
    #define CYTHON_PEP487_INIT_SUBCLASS 1
  #endif
  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
    #define CYTHON_PEP489_MULTI_PHASE_INIT 1
  #endif
  #ifndef CYTHON_USE_MODULE_STATE
    #define CYTHON_USE_MODULE_STATE 0
  #endif
  #undef CYTHON_USE_SYS_MONITORING
  #define CYTHON_USE_SYS_MONITORING 0
  #ifndef CYTHON_USE_TP_FINALIZE
    #define CYTHON_USE_TP_FINALIZE 0
  #endif
  #ifndef CYTHON_USE_AM_SEND
    #define CYTHON_USE_AM_SEND (__PYX_LIMITED_VERSION_HEX >= 0x030A0000)
  #endif
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 0
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
    #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
  #endif
  #ifndef CYTHON_USE_FREELISTS
  #define CYTHON_USE_FREELISTS 1
  #endif
  #undef CYTHON_IMMORTAL_CONSTANTS
  #define CYTHON_IMMORTAL_CONSTANTS 0
#else
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_CPYTHON 1
  #define CYTHON_COMPILING_IN_LIMITED_API 0
  #define CYTHON_COMPILING_IN_GRAAL 0
  #ifdef Py_GIL_DISABLED
    #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 1
  #else
    #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
  #endif
  #if PY_VERSION_HEX < 0x030A0000
    #undef CYTHON_USE_TYPE_SLOTS
    #define CYTHON_USE_TYPE_SLOTS 1
  #elif !defined(CYTHON_USE_TYPE_SLOTS)
    #define CYTHON_USE_TYPE_SLOTS 1
  #endif
  #ifndef CYTHON_USE_TYPE_SPECS
    #define CYTHON_USE_TYPE_SPECS 0
  #endif
  #ifndef CYTHON_USE_PYTYPE_LOOKUP
    #define CYTHON_USE_PYTYPE_LOOKUP 1
  #endif
  #ifndef CYTHON_USE_PYLONG_INTERNALS
    #define CYTHON_USE_PYLONG_INTERNALS 1
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    #undef CYTHON_USE_PYLIST_INTERNALS
    #define CYTHON_USE_PYLIST_INTERNALS 0
  #elif !defined(CYTHON_USE_PYLIST_INTERNALS)
    #define CYTHON_USE_PYLIST_INTERNALS 1
  #endif
  #ifndef CYTHON_USE_UNICODE_INTERNALS
    #define CYTHON_USE_UNICODE_INTERNALS 1
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING || PY_VERSION_HEX >= 0x030B00A2
    #undef CYTHON_USE_UNICODE_WRITER
    #define CYTHON_USE_UNICODE_WRITER 0
  #elif !defined(CYTHON_USE_UNICODE_WRITER)
    #define CYTHON_USE_UNICODE_WRITER 1
  #endif
  #ifndef CYTHON_AVOID_BORROWED_REFS
    #define CYTHON_AVOID_BORROWED_REFS 0
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
    #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1
  #elif !defined(CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS)
    #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
  #endif
  #ifndef CYTHON_ASSUME_SAFE_MACROS
    #define CYTHON_ASSUME_SAFE_MACROS 1
  #endif
  #ifndef CYTHON_ASSUME_SAFE_SIZE
    #define CYTHON_ASSUME_SAFE_SIZE 1
  #endif
  #ifndef CYTHON_UNPACK_METHODS
    #define CYTHON_UNPACK_METHODS 1
  #endif
  #ifndef CYTHON_FAST_THREAD_STATE
    #define CYTHON_FAST_THREAD_STATE 1
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    #undef CYTHON_FAST_GIL
    #define CYTHON_FAST_GIL 0
  #elif !defined(CYTHON_FAST_GIL)
    #define CYTHON_FAST_GIL (PY_VERSION_HEX < 0x030C00A6)
  #endif
  #ifndef CYTHON_METH_FASTCALL
    #define CYTHON_METH_FASTCALL 1
  #endif
  #ifndef CYTHON_FAST_PYCALL
    #define CYTHON_FAST_PYCALL 1
  #endif
  #ifndef CYTHON_PEP487_INIT_SUBCLASS
    #define CYTHON_PEP487_INIT_SUBCLASS 1
  #endif
  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
    #define CYTHON_PEP489_MULTI_PHASE_INIT 1
  #endif
  #ifndef CYTHON_USE_MODULE_STATE
    #define CYTHON_USE_MODULE_STATE 0
  #endif
  #ifndef CYTHON_USE_SYS_MONITORING
    #define CYTHON_USE_SYS_MONITORING (PY_VERSION_HEX >= 0x030d00B1)
  #endif
  #ifndef CYTHON_USE_TP_FINALIZE
    #define CYTHON_USE_TP_FINALIZE 1
  #endif
  #ifndef CYTHON_USE_AM_SEND
    #define CYTHON_USE_AM_SEND 1
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    #undef CYTHON_USE_DICT_VERSIONS
    #define CYTHON_USE_DICT_VERSIONS 0
  #elif !defined(CYTHON_USE_DICT_VERSIONS)
    #define CYTHON_USE_DICT_VERSIONS  (PY_VERSION_HEX < 0x030C00A5 && !CYTHON_USE_MODULE_STATE)
  #endif
  #ifndef CYTHON_USE_EXC_INFO_STACK
    #define CYTHON_USE_EXC_INFO_STACK 1
  #endif
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
    #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
  #endif
  #ifndef CYTHON_USE_FREELISTS
    #define CYTHON_USE_FREELISTS (!CYTHON_COMPILING_IN_CPYTHON_FREETHREADING)
  #endif
  #if defined(CYTHON_IMMORTAL_CONSTANTS) && PY_VERSION_HEX < 0x030C0000
    #undef CYTHON_IMMORTAL_CONSTANTS
    #define CYTHON_IMMORTAL_CONSTANTS 0  // definitely won't work
  #elif !defined(CYTHON_IMMORTAL_CONSTANTS)
    #define CYTHON_IMMORTAL_CONSTANTS (PY_VERSION_HEX >= 0x030C0000 && !CYTHON_USE_MODULE_STATE && CYTHON_COMPILING_IN_CPYTHON_FREETHREADING)
  #endif
#endif
#ifndef CYTHON_COMPRESS_STRINGS
  #define CYTHON_COMPRESS_STRINGS 1
#endif
#ifndef CYTHON_FAST_PYCCALL
#define CYTHON_FAST_PYCCALL  CYTHON_FAST_PYCALL
#endif
#ifndef CYTHON_VECTORCALL
#if CYTHON_COMPILING_IN_LIMITED_API
#define CYTHON_VECTORCALL  (__PYX_LIMITED_VERSION_HEX >= 0x030C0000)
#else
#define CYTHON_VECTORCALL  (CYTHON_FAST_PYCCALL)
#endif
#endif
#if CYTHON_USE_PYLONG_INTERNALS
  #undef SHIFT
  #undef BASE
  #undef MASK
  #ifdef SIZEOF_VOID_P
    enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
  #endif
#endif
#ifndef __has_attribute
  #define __has_attribute(x) 0
#endif
#ifndef __has_cpp_attribute
  #define __has_cpp_attribute(x) 0
#endif
#ifndef CYTHON_RESTRICT
  #if defined(__GNUC__)
    #define CYTHON_RESTRICT __restrict__
  #elif defined(_MSC_VER) && _MSC_VER >= 1400
    #define CYTHON_RESTRICT __restrict
  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define CYTHON_RESTRICT restrict
  #else
    #define CYTHON_RESTRICT
  #endif
#endif
#ifndef CYTHON_UNUSED
  #if defined(__cplusplus)
    /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17
     * but leads to warnings with -pedantic, since it is a C++17 feature */
    #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
      #if __has_cpp_attribute(maybe_unused)
        #define CYTHON_UNUSED [[maybe_unused]]
      #endif
    #endif
  #endif
#endif
#ifndef CYTHON_UNUSED
# if defined(__GNUC__)
#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
#     define CYTHON_UNUSED __attribute__ ((__unused__))
#   else
#     define CYTHON_UNUSED
#   endif
# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
#   define CYTHON_UNUSED __attribute__ ((__unused__))
# else
#   define CYTHON_UNUSED
# endif
#endif
#ifndef CYTHON_UNUSED_VAR
#  if defined(__cplusplus)
     template<class T> void CYTHON_UNUSED_VAR( const T& ) { }
#  else
#    define CYTHON_UNUSED_VAR(x) (void)(x)
#  endif
#endif
#ifndef CYTHON_MAYBE_UNUSED_VAR
  #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x)
#endif
#ifndef CYTHON_NCP_UNUSED
# if CYTHON_COMPILING_IN_CPYTHON && !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
#  define CYTHON_NCP_UNUSED
# else
#  define CYTHON_NCP_UNUSED CYTHON_UNUSED
# endif
#endif
#ifndef CYTHON_USE_CPP_STD_MOVE
  #if defined(__cplusplus) && (\
    __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600))
    #define CYTHON_USE_CPP_STD_MOVE 1
  #else
    #define CYTHON_USE_CPP_STD_MOVE 0
  #endif
#endif
#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
#include <stdint.h>
typedef uintptr_t  __pyx_uintptr_t;
#ifndef CYTHON_FALLTHROUGH
  #if defined(__cplusplus)
    /* for clang __has_cpp_attribute(fallthrough) is true even before C++17
     * but leads to warnings with -pedantic, since it is a C++17 feature */
    #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
      #if __has_cpp_attribute(fallthrough)
        #define CYTHON_FALLTHROUGH [[fallthrough]]
      #endif
    #endif
    #ifndef CYTHON_FALLTHROUGH
      #if __has_cpp_attribute(clang::fallthrough)
        #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
      #elif __has_cpp_attribute(gnu::fallthrough)
        #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
      #endif
    #endif
  #endif
  #ifndef CYTHON_FALLTHROUGH
    #if __has_attribute(fallthrough)
      #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
    #else
      #define CYTHON_FALLTHROUGH
    #endif
  #endif
  #if defined(__clang__) && defined(__apple_build_version__)
    #if __apple_build_version__ < 7000000
      #undef  CYTHON_FALLTHROUGH
      #define CYTHON_FALLTHROUGH
    #endif
  #endif
#endif
#ifndef Py_UNREACHABLE
  #define Py_UNREACHABLE()  assert(0); abort()
#endif
#ifdef __cplusplus
  template <typename T>
  struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);};
  #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL<type>::value)
#else
  #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0)
#endif
#if CYTHON_COMPILING_IN_PYPY == 1
  #define __PYX_NEED_TP_PRINT_SLOT  (PY_VERSION_HEX < 0x030A0000)
#else
  #define __PYX_NEED_TP_PRINT_SLOT  (PY_VERSION_HEX < 0x03090000)
#endif
#define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer))

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

/* PythonCompatibility */
#define __PYX_BUILD_PY_SSIZE_T "n"
#define CYTHON_FORMAT_SSIZE_T "z"
#define __Pyx_BUILTIN_MODULE_NAME "builtins"
#define __Pyx_DefaultClassType PyType_Type
#if CYTHON_COMPILING_IN_LIMITED_API
    #ifndef CO_OPTIMIZED
    static int CO_OPTIMIZED;
    #endif
    #ifndef CO_NEWLOCALS
    static int CO_NEWLOCALS;
    #endif
    #ifndef CO_VARARGS
    static int CO_VARARGS;
    #endif
    #ifndef CO_VARKEYWORDS
    static int CO_VARKEYWORDS;
    #endif
    #ifndef CO_ASYNC_GENERATOR
    static int CO_ASYNC_GENERATOR;
    #endif
    #ifndef CO_GENERATOR
    static int CO_GENERATOR;
    #endif
    #ifndef CO_COROUTINE
    static int CO_COROUTINE;
    #endif
#else
    #ifndef CO_COROUTINE
      #define CO_COROUTINE 0x80
    #endif
    #ifndef CO_ASYNC_GENERATOR
      #define CO_ASYNC_GENERATOR 0x200
    #endif
#endif
static int __Pyx_init_co_variables(void);
#if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE)
  #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type)
#else
  #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type))
#endif
#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is)
  #define __Pyx_Py_Is(x, y)  Py_Is(x, y)
#else
  #define __Pyx_Py_Is(x, y) ((x) == (y))
#endif
#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone)
  #define __Pyx_Py_IsNone(ob) Py_IsNone(ob)
#else
  #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None)
#endif
#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue)
  #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob)
#else
  #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True)
#endif
#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse)
  #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob)
#else
  #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False)
#endif
#define __Pyx_NoneAsNull(obj)  (__Pyx_Py_IsNone(obj) ? NULL : (obj))
#if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY
  #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o)
#else
  #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o)
#endif
#ifndef Py_TPFLAGS_CHECKTYPES
  #define Py_TPFLAGS_CHECKTYPES 0
#endif
#ifndef Py_TPFLAGS_HAVE_INDEX
  #define Py_TPFLAGS_HAVE_INDEX 0
#endif
#ifndef Py_TPFLAGS_HAVE_NEWBUFFER
  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif
#ifndef Py_TPFLAGS_HAVE_FINALIZE
  #define Py_TPFLAGS_HAVE_FINALIZE 0
#endif
#ifndef Py_TPFLAGS_SEQUENCE
  #define Py_TPFLAGS_SEQUENCE 0
#endif
#ifndef Py_TPFLAGS_MAPPING
  #define Py_TPFLAGS_MAPPING 0
#endif
#ifndef Py_TPFLAGS_IMMUTABLETYPE
  #define Py_TPFLAGS_IMMUTABLETYPE (1UL << 8)
#endif
#ifndef Py_TPFLAGS_DISALLOW_INSTANTIATION
  #define Py_TPFLAGS_DISALLOW_INSTANTIATION (1UL << 7)
#endif
#ifndef METH_STACKLESS
  #define METH_STACKLESS 0
#endif
#ifndef METH_FASTCALL
  #ifndef METH_FASTCALL
     #define METH_FASTCALL 0x80
  #endif
  typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
  typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
                                                          Py_ssize_t nargs, PyObject *kwnames);
#else
  #if PY_VERSION_HEX >= 0x030d00A4
  #  define __Pyx_PyCFunctionFast PyCFunctionFast
  #  define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords
  #else
  #  define __Pyx_PyCFunctionFast _PyCFunctionFast
  #  define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
  #endif
#endif
#if CYTHON_METH_FASTCALL
  #define __Pyx_METH_FASTCALL METH_FASTCALL
  #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast
  #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords
#else
  #define __Pyx_METH_FASTCALL METH_VARARGS
  #define __Pyx_PyCFunction_FastCall PyCFunction
  #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords
#endif
#if CYTHON_VECTORCALL
  #define __pyx_vectorcallfunc vectorcallfunc
  #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET  PY_VECTORCALL_ARGUMENTS_OFFSET
  #define __Pyx_PyVectorcall_NARGS(n)  PyVectorcall_NARGS((size_t)(n))
#else
  #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET  0
  #define __Pyx_PyVectorcall_NARGS(n)  ((Py_ssize_t)(n))
#endif
#if PY_VERSION_HEX >= 0x030900B1
#define __Pyx_PyCFunction_CheckExact(func)  PyCFunction_CheckExact(func)
#else
#define __Pyx_PyCFunction_CheckExact(func)  PyCFunction_Check(func)
#endif
#define __Pyx_CyOrPyCFunction_Check(func)  PyCFunction_Check(func)
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func)  (((PyCFunctionObject*)(func))->m_ml->ml_meth)
#elif !CYTHON_COMPILING_IN_LIMITED_API
#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func)  PyCFunction_GET_FUNCTION(func)
#endif
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_CyOrPyCFunction_GET_FLAGS(func)  (((PyCFunctionObject*)(func))->m_ml->ml_flags)
static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) {
    return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self;
}
#endif
static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void (*cfunc)(void)) {
#if CYTHON_COMPILING_IN_LIMITED_API
    return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
#else
    return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
#endif
}
#define __Pyx_IsSameCFunction(func, cfunc)   __Pyx__IsSameCFunction(func, cfunc)
#if PY_VERSION_HEX < 0x03090000 || (CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000)
  #define __Pyx_PyType_FromModuleAndSpec(m, s, b)  ((void)m, PyType_FromSpecWithBases(s, b))
  typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *);
#else
  #define __Pyx_PyType_FromModuleAndSpec(m, s, b)  PyType_FromModuleAndSpec(m, s, b)
  #define __Pyx_PyCMethod  PyCMethod
#endif
#ifndef METH_METHOD
  #define METH_METHOD 0x200
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
  #define PyObject_Malloc(s)   PyMem_Malloc(s)
  #define PyObject_Free(p)     PyMem_Free(p)
  #define PyObject_Realloc(p)  PyMem_Realloc(p)
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno)
#elif CYTHON_COMPILING_IN_GRAAL && defined(GRAALPY_VERSION_NUM) && GRAALPY_VERSION_NUM > 0x19000000
  #define __Pyx_PyCode_HasFreeVars(co)  (PyCode_GetNumFree(co) > 0)
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) GraalPyFrame_SetLineNumber((frame), (lineno))
#elif CYTHON_COMPILING_IN_GRAAL
  #define __Pyx_PyCode_HasFreeVars(co)  (PyCode_GetNumFree(co) > 0)
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) _PyFrame_SetLineNumber((frame), (lineno))
#else
  #define __Pyx_PyCode_HasFreeVars(co)  (PyCode_GetNumFree(co) > 0)
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno)  (frame)->f_lineno = (lineno)
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
  #define __Pyx_PyThreadState_Current PyThreadState_Get()
#elif !CYTHON_FAST_THREAD_STATE
  #define __Pyx_PyThreadState_Current PyThreadState_GET()
#elif PY_VERSION_HEX >= 0x030d00A1
  #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked()
#else
  #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
#endif
#if CYTHON_USE_MODULE_STATE
static CYTHON_INLINE void *__Pyx__PyModule_GetState(PyObject *op)
{
    void *result;
    result = PyModule_GetState(op);
    if (!result)
        Py_FatalError("Couldn't find the module state");
    return result;
}
#define __Pyx_PyModule_GetState(o) (__pyx_mstatetype *)__Pyx__PyModule_GetState(o)
#else
#define __Pyx_PyModule_GetState(op) ((void)op,__pyx_mstate_global)
#endif
#define __Pyx_PyObject_GetSlot(obj, name, func_ctype)  __Pyx_PyType_GetSlot(Py_TYPE((PyObject *) obj), name, func_ctype)
#define __Pyx_PyObject_TryGetSlot(obj, name, func_ctype) __Pyx_PyType_TryGetSlot(Py_TYPE(obj), name, func_ctype)
#define __Pyx_PyObject_GetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_GetSubSlot(Py_TYPE(obj), sub, name, func_ctype)
#define __Pyx_PyObject_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSubSlot(Py_TYPE(obj), sub, name, func_ctype)
#if CYTHON_USE_TYPE_SLOTS
  #define __Pyx_PyType_GetSlot(type, name, func_ctype)  ((type)->name)
  #define __Pyx_PyType_TryGetSlot(type, name, func_ctype) __Pyx_PyType_GetSlot(type, name, func_ctype)
  #define __Pyx_PyType_GetSubSlot(type, sub, name, func_ctype) (((type)->sub) ? ((type)->sub->name) : NULL)
  #define __Pyx_PyType_TryGetSubSlot(type, sub, name, func_ctype) __Pyx_PyType_GetSubSlot(type, sub, name, func_ctype)
#else
  #define __Pyx_PyType_GetSlot(type, name, func_ctype)  ((func_ctype) PyType_GetSlot((type), Py_##name))
  #define __Pyx_PyType_TryGetSlot(type, name, func_ctype)\
    ((__PYX_LIMITED_VERSION_HEX >= 0x030A0000 ||\
     (PyType_GetFlags(type) & Py_TPFLAGS_HEAPTYPE) || __Pyx_get_runtime_version() >= 0x030A0000) ?\
     __Pyx_PyType_GetSlot(type, name, func_ctype) : NULL)
  #define __Pyx_PyType_GetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_GetSlot(obj, name, func_ctype)
  #define __Pyx_PyType_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSlot(obj, name, func_ctype)
#endif
#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
#define __Pyx_PyDict_NewPresized(n)  ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
#else
#define __Pyx_PyDict_NewPresized(n)  PyDict_New()
#endif
#define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
#define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_UNICODE_INTERNALS
#define __Pyx_PyDict_GetItemStrWithError(dict, name)  _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) {
    PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name);
    if (res == NULL) PyErr_Clear();
    return res;
}
#elif !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000
#define __Pyx_PyDict_GetItemStrWithError  PyDict_GetItemWithError
#define __Pyx_PyDict_GetItemStr           PyDict_GetItem
#else
static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) {
#if CYTHON_COMPILING_IN_PYPY
    return PyDict_GetItem(dict, name);
#else
    PyDictEntry *ep;
    PyDictObject *mp = (PyDictObject*) dict;
    long hash = ((PyStringObject *) name)->ob_shash;
    assert(hash != -1);
    ep = (mp->ma_lookup)(mp, name, hash);
    if (ep == NULL) {
        return NULL;
    }
    return ep->me_value;
#endif
}
#define __Pyx_PyDict_GetItemStr           PyDict_GetItem
#endif
#if CYTHON_USE_TYPE_SLOTS
  #define __Pyx_PyType_GetFlags(tp)   (((PyTypeObject *)tp)->tp_flags)
  #define __Pyx_PyType_HasFeature(type, feature)  ((__Pyx_PyType_GetFlags(type) & (feature)) != 0)
#else
  #define __Pyx_PyType_GetFlags(tp)   (PyType_GetFlags((PyTypeObject *)tp))
  #define __Pyx_PyType_HasFeature(type, feature)  PyType_HasFeature(type, feature)
#endif
#define __Pyx_PyObject_GetIterNextFunc(iterator)  __Pyx_PyObject_GetSlot(iterator, tp_iternext, iternextfunc)
#if CYTHON_USE_TYPE_SPECS
#define __Pyx_PyHeapTypeObject_GC_Del(obj)  {\
    PyTypeObject *type = Py_TYPE((PyObject*)obj);\
    assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\
    PyObject_GC_Del(obj);\
    Py_DECREF(type);\
}
#else
#define __Pyx_PyHeapTypeObject_GC_Del(obj)  PyObject_GC_Del(obj)
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
  #define __Pyx_PyUnicode_READY(op)       (0)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i)
  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   ((void)u, 1114111U)
  #define __Pyx_PyUnicode_KIND(u)         ((void)u, (0))
  #define __Pyx_PyUnicode_DATA(u)         ((void*)u)
  #define __Pyx_PyUnicode_READ(k, d, i)   ((void)k, PyUnicode_ReadChar((PyObject*)(d), i))
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GetLength(u))
#else
  #if PY_VERSION_HEX >= 0x030C0000
    #define __Pyx_PyUnicode_READY(op)       (0)
  #else
    #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ?\
                                                0 : _PyUnicode_Ready((PyObject *)(op)))
  #endif
  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   PyUnicode_MAX_CHAR_VALUE(u)
  #define __Pyx_PyUnicode_KIND(u)         ((int)PyUnicode_KIND(u))
  #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
  #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
  #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  PyUnicode_WRITE(k, d, i, (Py_UCS4) ch)
  #if PY_VERSION_HEX >= 0x030C0000
    #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GET_LENGTH(u))
  #else
    #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
    #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
    #else
    #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
    #endif
  #endif
#endif
#if CYTHON_COMPILING_IN_PYPY
  #define __Pyx_PyUnicode_Concat(a, b)      PyNumber_Add(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  PyNumber_Add(a, b)
#else
  #define __Pyx_PyUnicode_Concat(a, b)      PyUnicode_Concat(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
      PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
#endif
#if CYTHON_COMPILING_IN_PYPY
  #if !defined(PyUnicode_DecodeUnicodeEscape)
    #define PyUnicode_DecodeUnicodeEscape(s, size, errors)  PyUnicode_Decode(s, size, "unicode_escape", errors)
  #endif
  #if !defined(PyUnicode_Contains)
    #define PyUnicode_Contains(u, s)  PySequence_Contains(u, s)
  #endif
  #if !defined(PyByteArray_Check)
    #define PyByteArray_Check(obj)  PyObject_TypeCheck(obj, &PyByteArray_Type)
  #endif
  #if !defined(PyObject_Format)
    #define PyObject_Format(obj, fmt)  PyObject_CallMethod(obj, "__format__", "O", fmt)
  #endif
#endif
#define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  #define __Pyx_PySequence_ListKeepNew(obj)\
    (likely(PyList_CheckExact(obj) && PyUnstable_Object_IsUniquelyReferenced(obj)) ? __Pyx_NewRef(obj) : PySequence_List(obj))
#elif CYTHON_COMPILING_IN_CPYTHON
  #define __Pyx_PySequence_ListKeepNew(obj)\
    (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj))
#else
  #define __Pyx_PySequence_ListKeepNew(obj)  PySequence_List(obj)
#endif
#ifndef PySet_CheckExact
  #define PySet_CheckExact(obj)        __Pyx_IS_TYPE(obj, &PySet_Type)
#endif
#if PY_VERSION_HEX >= 0x030900A4
  #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
  #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
#else
  #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
  #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
#endif
enum __Pyx_ReferenceSharing {
  __Pyx_ReferenceSharing_DefinitelyUnique, // We created it so we know it's unshared - no need to check
  __Pyx_ReferenceSharing_OwnStrongReference,
  __Pyx_ReferenceSharing_FunctionArgument,
  __Pyx_ReferenceSharing_SharedReference, // Never trust it to be unshared because it's a global or similar
};
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && PY_VERSION_HEX >= 0x030E0000
#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing)\
    (sharing == __Pyx_ReferenceSharing_DefinitelyUnique ? 1 :\
      (sharing == __Pyx_ReferenceSharing_FunctionArgument ? PyUnstable_Object_IsUniqueReferencedTemporary(o) :\
      (sharing == __Pyx_ReferenceSharing_OwnStrongReference ? PyUnstable_Object_IsUniquelyReferenced(o) : 0)))
#elif (CYTHON_COMPILING_IN_CPYTHON && !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING) || CYTHON_COMPILING_IN_LIMITED_API
#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing) (((void)sharing), Py_REFCNT(o) == 1)
#else
#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing) (((void)o), ((void)sharing), 0)
#endif
#if CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
  #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
    #define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i)
  #elif CYTHON_COMPILING_IN_LIMITED_API || !CYTHON_ASSUME_SAFE_MACROS
    #define __Pyx_PyList_GetItemRef(o, i) (likely((i) >= 0) ? PySequence_GetItem(o, i) : (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
  #else
    #define __Pyx_PyList_GetItemRef(o, i) PySequence_ITEM(o, i)
  #endif
#elif CYTHON_COMPILING_IN_LIMITED_API || !CYTHON_ASSUME_SAFE_MACROS
  #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
    #define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i)
  #else
    #define __Pyx_PyList_GetItemRef(o, i) __Pyx_XNewRef(PyList_GetItem(o, i))
  #endif
#else
  #define __Pyx_PyList_GetItemRef(o, i) __Pyx_NewRef(PyList_GET_ITEM(o, i))
#endif
#if CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS && !CYTHON_COMPILING_IN_LIMITED_API && CYTHON_ASSUME_SAFE_MACROS
  #define __Pyx_PyList_GetItemRefFast(o, i, unsafe_shared) (__Pyx_IS_UNIQUELY_REFERENCED(o, unsafe_shared) ?\
    __Pyx_NewRef(PyList_GET_ITEM(o, i)) : __Pyx_PyList_GetItemRef(o, i))
#else
  #define __Pyx_PyList_GetItemRefFast(o, i, unsafe_shared) __Pyx_PyList_GetItemRef(o, i)
#endif
#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
#define __Pyx_PyDict_GetItemRef(dict, key, result) PyDict_GetItemRef(dict, key, result)
#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) {
  *result = PyObject_GetItem(dict, key);
  if (*result == NULL) {
    if (PyErr_ExceptionMatches(PyExc_KeyError)) {
      PyErr_Clear();
      return 0;
    }
    return -1;
  }
  return 1;
}
#else
static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) {
  *result = PyDict_GetItemWithError(dict, key);
  if (*result == NULL) {
    return PyErr_Occurred() ? -1 : 0;
  }
  Py_INCREF(*result);
  return 1;
}
#endif
#if defined(CYTHON_DEBUG_VISIT_CONST) && CYTHON_DEBUG_VISIT_CONST
  #define __Pyx_VISIT_CONST(obj)  Py_VISIT(obj)
#else
  #define __Pyx_VISIT_CONST(obj)
#endif
#if CYTHON_ASSUME_SAFE_MACROS
  #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i)
  #define __Pyx_PySequence_SIZE(seq)  Py_SIZE(seq)
  #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0))
  #define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GET_ITEM(o, i)
  #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0))
  #define __Pyx_PyList_GET_ITEM(o, i) PyList_GET_ITEM(o, i)
#else
  #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i)
  #define __Pyx_PySequence_SIZE(seq)  PySequence_Size(seq)
  #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v)
  #define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GetItem(o, i)
  #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v)
  #define __Pyx_PyList_GET_ITEM(o, i) PyList_GetItem(o, i)
#endif
#if CYTHON_ASSUME_SAFE_SIZE
  #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o)
  #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o)
  #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o)
  #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o)
  #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o)
  #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GET_LENGTH(o)
#else
  #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o)
  #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o)
  #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o)
  #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o)
  #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o)
  #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GetLength(o)
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_InternFromString)
  #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
#endif
#define __Pyx_PyLong_FromHash_t PyLong_FromSsize_t
#define __Pyx_PyLong_AsHash_t   __Pyx_PyIndex_AsSsize_t
#if __PYX_LIMITED_VERSION_HEX >= 0x030A0000
    #define __Pyx_PySendResult PySendResult
#else
    typedef enum {
        PYGEN_RETURN = 0,
        PYGEN_ERROR = -1,
        PYGEN_NEXT = 1,
    } __Pyx_PySendResult;
#endif
#if CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX < 0x030A00A3
  typedef __Pyx_PySendResult (*__Pyx_pyiter_sendfunc)(PyObject *iter, PyObject *value, PyObject **result);
#else
  #define __Pyx_pyiter_sendfunc sendfunc
#endif
#if !CYTHON_USE_AM_SEND
#define __PYX_HAS_PY_AM_SEND 0
#elif __PYX_LIMITED_VERSION_HEX >= 0x030A0000
#define __PYX_HAS_PY_AM_SEND 1
#else
#define __PYX_HAS_PY_AM_SEND 2  // our own backported implementation
#endif
#if __PYX_HAS_PY_AM_SEND < 2
    #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
#else
    typedef struct {
        unaryfunc am_await;
        unaryfunc am_aiter;
        unaryfunc am_anext;
        __Pyx_pyiter_sendfunc am_send;
    } __Pyx_PyAsyncMethodsStruct;
    #define __Pyx_SlotTpAsAsync(s) ((PyAsyncMethods*)(s))
#endif
#if CYTHON_USE_AM_SEND && PY_VERSION_HEX < 0x030A00F0
    #define __Pyx_TPFLAGS_HAVE_AM_SEND (1UL << 21)
#else
    #define __Pyx_TPFLAGS_HAVE_AM_SEND (0)
#endif
#if PY_VERSION_HEX >= 0x03090000
#define __Pyx_PyInterpreterState_Get() PyInterpreterState_Get()
#else
#define __Pyx_PyInterpreterState_Get() PyThreadState_Get()->interp
#endif
#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030A0000
#ifdef __cplusplus
extern "C"
#endif
PyAPI_FUNC(void *) PyMem_Calloc(size_t nelem, size_t elsize);
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
static int __Pyx_init_co_variable(PyObject *inspect, const char* name, int *write_to) {
    int value;
    PyObject *py_value = PyObject_GetAttrString(inspect, name);
    if (!py_value) return 0;
    value = (int) PyLong_AsLong(py_value);
    Py_DECREF(py_value);
    *write_to = value;
    return value != -1 || !PyErr_Occurred();
}
static int __Pyx_init_co_variables(void) {
    PyObject *inspect;
    int result;
    inspect = PyImport_ImportModule("inspect");
    result =
#if !defined(CO_OPTIMIZED)
        __Pyx_init_co_variable(inspect, "CO_OPTIMIZED", &CO_OPTIMIZED) &&
#endif
#if !defined(CO_NEWLOCALS)
        __Pyx_init_co_variable(inspect, "CO_NEWLOCALS", &CO_NEWLOCALS) &&
#endif
#if !defined(CO_VARARGS)
        __Pyx_init_co_variable(inspect, "CO_VARARGS", &CO_VARARGS) &&
#endif
#if !defined(CO_VARKEYWORDS)
        __Pyx_init_co_variable(inspect, "CO_VARKEYWORDS", &CO_VARKEYWORDS) &&
#endif
#if !defined(CO_ASYNC_GENERATOR)
        __Pyx_init_co_variable(inspect, "CO_ASYNC_GENERATOR", &CO_ASYNC_GENERATOR) &&
#endif
#if !defined(CO_GENERATOR)
        __Pyx_init_co_variable(inspect, "CO_GENERATOR", &CO_GENERATOR) &&
#endif
#if !defined(CO_COROUTINE)
        __Pyx_init_co_variable(inspect, "CO_COROUTINE", &CO_COROUTINE) &&
#endif
        1;
    Py_DECREF(inspect);
    return result ? 0 : -1;
}
#else
static int __Pyx_init_co_variables(void) {
    return 0;  // It's a limited API-only feature
}
#endif

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

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

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

#define __PYX_HAVE__CyOpenGL
#define __PYX_HAVE_API__CyOpenGL
/* Early includes */
#include "opengl.h"

    #define CHECK_GLEW_FOR_FUNCTION(name) if (!name) { return #name; }

    /* Check that GLEW set the gl function pointers */
    char * checkGlewForLegacyOpenGL()
    {
    #ifdef USE_GLEW
        GLenum err = glewInit();
        if (err != 0) {
            return "glewInit failed";
        }

        CHECK_GLEW_FOR_FUNCTION(glMatrixMode);
        CHECK_GLEW_FOR_FUNCTION(glLoadIdentity);
        CHECK_GLEW_FOR_FUNCTION(glOrtho);
        CHECK_GLEW_FOR_FUNCTION(glFrustum);
        CHECK_GLEW_FOR_FUNCTION(glPushMatrix);
        CHECK_GLEW_FOR_FUNCTION(glPopMatrix);
        CHECK_GLEW_FOR_FUNCTION(glTranslatef);
        CHECK_GLEW_FOR_FUNCTION(glRotatef);
        CHECK_GLEW_FOR_FUNCTION(glMultMatrixd);
        CHECK_GLEW_FOR_FUNCTION(glBegin);
        CHECK_GLEW_FOR_FUNCTION(glEnd);
        CHECK_GLEW_FOR_FUNCTION(glNormal3f);
        CHECK_GLEW_FOR_FUNCTION(glVertex3f);
        CHECK_GLEW_FOR_FUNCTION(glColor4fv);
        CHECK_GLEW_FOR_FUNCTION(glNewList);
        CHECK_GLEW_FOR_FUNCTION(glEndList);
        CHECK_GLEW_FOR_FUNCTION(glIsList);
        CHECK_GLEW_FOR_FUNCTION(glCallList);
        CHECK_GLEW_FOR_FUNCTION(glDeleteLists);
        CHECK_GLEW_FOR_FUNCTION(glMaterialf);
        CHECK_GLEW_FOR_FUNCTION(glMaterialfv);
        CHECK_GLEW_FOR_FUNCTION(glColorMaterial);
        CHECK_GLEW_FOR_FUNCTION(glShadeModel);
        CHECK_GLEW_FOR_FUNCTION(glLightModeli);
        CHECK_GLEW_FOR_FUNCTION(glLightModelf);
        CHECK_GLEW_FOR_FUNCTION(glLightModelfv);
        CHECK_GLEW_FOR_FUNCTION(glLightf);
        CHECK_GLEW_FOR_FUNCTION(glLightfv);
        CHECK_GLEW_FOR_FUNCTION(glLineWidth);
        CHECK_GLEW_FOR_FUNCTION(glLineStipple);
        CHECK_GLEW_FOR_FUNCTION(glRasterPos2f);
        CHECK_GLEW_FOR_FUNCTION(glRasterPos3f);
        CHECK_GLEW_FOR_FUNCTION(glBitmap);
        CHECK_GLEW_FOR_FUNCTION(glDrawPixels);
        CHECK_GLEW_FOR_FUNCTION(glGetFloatv);
        CHECK_GLEW_FOR_FUNCTION(glGetDoublev);
        CHECK_GLEW_FOR_FUNCTION(glBlendFunc);
        CHECK_GLEW_FOR_FUNCTION(glFrontFace);
        
        CHECK_GLEW_FOR_FUNCTION(glNormalPointer);
        CHECK_GLEW_FOR_FUNCTION(glVertexPointer);
        CHECK_GLEW_FOR_FUNCTION(glEnableClientState);
        CHECK_GLEW_FOR_FUNCTION(glDrawElements);

        CHECK_GLEW_FOR_FUNCTION(glViewport);
        CHECK_GLEW_FOR_FUNCTION(glClear);
        CHECK_GLEW_FOR_FUNCTION(glClearColor);
        CHECK_GLEW_FOR_FUNCTION(glGetString);
        CHECK_GLEW_FOR_FUNCTION(glGetError);
        CHECK_GLEW_FOR_FUNCTION(glEnable);
        CHECK_GLEW_FOR_FUNCTION(glDisable);
    #endif

        return NULL;
    }

    /* Check that GLEW set the gl function pointers */
    char * checkGlewForModernOpenGL()
    {
    #ifdef USE_GLEW
        GLenum err = glewInit();
        if (err != 0) {
            return "glewInit failed";
        }

        CHECK_GLEW_FOR_FUNCTION(glCreateShader);
        CHECK_GLEW_FOR_FUNCTION(glAttachShader);
        CHECK_GLEW_FOR_FUNCTION(glShaderSource);
        CHECK_GLEW_FOR_FUNCTION(glCompileShader);
        CHECK_GLEW_FOR_FUNCTION(glGetProgramiv);
        CHECK_GLEW_FOR_FUNCTION(glGetShaderiv);
        CHECK_GLEW_FOR_FUNCTION(glGetProgramInfoLog);
        CHECK_GLEW_FOR_FUNCTION(glGetShaderInfoLog);
        CHECK_GLEW_FOR_FUNCTION(glLinkProgram);
        CHECK_GLEW_FOR_FUNCTION(glUseProgram);
        CHECK_GLEW_FOR_FUNCTION(glDeleteShader);
        CHECK_GLEW_FOR_FUNCTION(glDeleteProgram);

        CHECK_GLEW_FOR_FUNCTION(glGetUniformLocation);
        CHECK_GLEW_FOR_FUNCTION(glUniform1i);
        CHECK_GLEW_FOR_FUNCTION(glUniform1f);
        CHECK_GLEW_FOR_FUNCTION(glUniform2i);
        CHECK_GLEW_FOR_FUNCTION(glUniform2f);
        CHECK_GLEW_FOR_FUNCTION(glUniform3i);
        CHECK_GLEW_FOR_FUNCTION(glUniform3f);
        CHECK_GLEW_FOR_FUNCTION(glUniform4i);
        CHECK_GLEW_FOR_FUNCTION(glUniform4f);
        CHECK_GLEW_FOR_FUNCTION(glUniform1iv);
        CHECK_GLEW_FOR_FUNCTION(glUniform1fv);
        CHECK_GLEW_FOR_FUNCTION(glUniform2iv);
        CHECK_GLEW_FOR_FUNCTION(glUniform2fv);
        CHECK_GLEW_FOR_FUNCTION(glUniform3iv);
        CHECK_GLEW_FOR_FUNCTION(glUniform3fv);
        CHECK_GLEW_FOR_FUNCTION(glUniform4iv);
        CHECK_GLEW_FOR_FUNCTION(glUniform4fv);
        CHECK_GLEW_FOR_FUNCTION(glUniformMatrix2fv);
        CHECK_GLEW_FOR_FUNCTION(glUniformMatrix4fv);
        CHECK_GLEW_FOR_FUNCTION(glUniformMatrix2x3fv);
        CHECK_GLEW_FOR_FUNCTION(glUniformMatrix3x2fv);
        
        CHECK_GLEW_FOR_FUNCTION(glGetUniformBlockIndex);
        CHECK_GLEW_FOR_FUNCTION(glUniformBlockBinding);
        CHECK_GLEW_FOR_FUNCTION(glBindBufferBase);
        
        CHECK_GLEW_FOR_FUNCTION(glGenVertexArrays);
        CHECK_GLEW_FOR_FUNCTION(glBindVertexArray);
        CHECK_GLEW_FOR_FUNCTION(glGenBuffers);
        CHECK_GLEW_FOR_FUNCTION(glBindBuffer);
        CHECK_GLEW_FOR_FUNCTION(glBufferData);
        CHECK_GLEW_FOR_FUNCTION(glVertexAttribPointer);
        CHECK_GLEW_FOR_FUNCTION(glDeleteBuffers);
        CHECK_GLEW_FOR_FUNCTION(glDeleteVertexArrays);
        CHECK_GLEW_FOR_FUNCTION(glDrawArrays);

        CHECK_GLEW_FOR_FUNCTION(glViewport);
        CHECK_GLEW_FOR_FUNCTION(glClear);
        CHECK_GLEW_FOR_FUNCTION(glClearColor);
        CHECK_GLEW_FOR_FUNCTION(glGetString);
        CHECK_GLEW_FOR_FUNCTION(glGetError);
        CHECK_GLEW_FOR_FUNCTION(glEnable);
        CHECK_GLEW_FOR_FUNCTION(glDisable);
        CHECK_GLEW_FOR_FUNCTION(glReadPixels);

        CHECK_GLEW_FOR_FUNCTION(glGenTextures);
        CHECK_GLEW_FOR_FUNCTION(glBindTexture);
        CHECK_GLEW_FOR_FUNCTION(glActiveTexture);
        CHECK_GLEW_FOR_FUNCTION(glDeleteTextures);

        CHECK_GLEW_FOR_FUNCTION(glGenFramebuffers);
        CHECK_GLEW_FOR_FUNCTION(glBindFramebuffer);
        CHECK_GLEW_FOR_FUNCTION(glFramebufferTexture2D);
        CHECK_GLEW_FOR_FUNCTION(glCheckFramebufferStatus);
        CHECK_GLEW_FOR_FUNCTION(glDeleteFramebuffers);

    #endif
        return NULL;
    }

    
#include "SnapPyfont.h"
#include <string.h>
#include <stdio.h>

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

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

    static CYTHON_INLINE int
    __Pyx_CAPI_PyList_Clear(PyObject *list)
    {
        return PyList_SetSlice(list, 0, PY_SSIZE_T_MAX, NULL);
    }
    #else
    #define __Pyx_CAPI_PyList_Extend PyList_Extend
    #define __Pyx_CAPI_PyList_Clear PyList_Clear
    #endif
    

    #if PY_MAJOR_VERSION >= 3
      #define __Pyx_PyFloat_FromString(obj)  PyFloat_FromString(obj)
    #else
      #define __Pyx_PyFloat_FromString(obj)  PyFloat_FromString(obj, NULL)
    #endif
    
#include <stddef.h>

    #if PY_MAJOR_VERSION <= 2
    #define PyDict_GetItemWithError _PyDict_GetItemWithError
    #endif

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

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

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

    #if (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030600) && !defined(PyContextVar_Get)
    #define PyContextVar_Get(var, d, v)         ((d) ?             ((void)(var), Py_INCREF(d), (v)[0] = (d), 0) :             ((v)[0] = NULL, 0)         )
    #endif
    

    #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API
    #ifdef _MSC_VER
    #pragma message ("This module uses CPython specific internals of 'array.array', which are not available in PyPy or the limited API.")
    #else
    #warning This module uses CPython specific internals of 'array.array', which are not available in PyPy or the limited API.
    #endif
    #endif
    
#include <stdlib.h>
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */

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

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


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


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

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

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

static const char* const __pyx_f[] = {
  "opengl/CyOpenGL.pyx",
  "opengl/common/error.pyx",
  "opengl/legacy/meshed_surface.pyx",
  "opengl/legacy/poincare_polygon.pyx",
  "opengl/legacy/horoball_group.pyx",
  "opengl/legacy/raw_openGL_widget.pyx",
  "opengl/modern/image_based_texture.pyx",
  "carray.from_py",
  "cpython/contextvars.pxd",
  "array.pxd",
  "opengl/common/string.pyx",
  "opengl/vector3.pyx",
  "opengl/legacy/object.pyx",
  "opengl/legacy/wireframe_sphere.pyx",
  "opengl/legacy/triangle_mesh.pyx",
  "opengl/legacy/poincare_triangle.pyx",
  "opengl/legacy/klein_polygon.pyx",
  "opengl/legacy/hyperbolic_polyhedron.pyx",
  "opengl/legacy/colorizer.pyx",
  "opengl/legacy/horosphere.pyx",
  "opengl/legacy/parallelogram.pyx",
  "opengl/legacy/edge_set.pyx",
  "opengl/legacy/triangulation_edge_set.pyx",
  "opengl/legacy/label.pyx",
  "opengl/legacy/label_set.pyx",
  "opengl/legacy/horoball_scene.pyx",
  "opengl/legacy/perspectiveWidget.pyx",
  "opengl/legacy/orthoWidget.pyx",
  "opengl/modern/data_based_texture.pyx",
  "opengl/modern/uniform_buffer_object.pyx",
  "opengl/modern/glsl_program.pyx",
  "opengl/modern/vertex_buffer.pyx",
  "opengl/modern/simple_image_shader_widget.pyx",
  "opengl/modern/glsl_perspective_view.pyx",
  "opengl/modern/glsl_perspective_widget.pyx",
  "opengl/modern/triangle.pyx",
  "opengl/legacy/ford_edge_set.pyx",
  "cpython/type.pxd",
  "cpython/bool.pxd",
  "cpython/complex.pxd",
  "opengl/legacy/lighting.pyx",
};
/* #### Code section: utility_code_proto_before_types ### */
/* Atomics.proto (used by UnpackUnboundCMethod) */
#include <pythread.h>
#ifndef CYTHON_ATOMICS
    #define CYTHON_ATOMICS 1
#endif
#define __PYX_CYTHON_ATOMICS_ENABLED() CYTHON_ATOMICS
#define __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
#define __pyx_atomic_int_type int
#define __pyx_nonatomic_int_type int
#if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\
                        (__STDC_VERSION__ >= 201112L) &&\
                        !defined(__STDC_NO_ATOMICS__))
    #include <stdatomic.h>
#elif CYTHON_ATOMICS && (defined(__cplusplus) && (\
                    (__cplusplus >= 201103L) ||\
                    (defined(_MSC_VER) && _MSC_VER >= 1700)))
    #include <atomic>
#endif
#if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\
                        (__STDC_VERSION__ >= 201112L) &&\
                        !defined(__STDC_NO_ATOMICS__) &&\
                       ATOMIC_INT_LOCK_FREE == 2)
    #undef __pyx_atomic_int_type
    #define __pyx_atomic_int_type atomic_int
    #define __pyx_atomic_ptr_type atomic_uintptr_t
    #define __pyx_nonatomic_ptr_type uintptr_t
    #define __pyx_atomic_incr_relaxed(value) atomic_fetch_add_explicit(value, 1, memory_order_relaxed)
    #define __pyx_atomic_incr_acq_rel(value) atomic_fetch_add_explicit(value, 1, memory_order_acq_rel)
    #define __pyx_atomic_decr_acq_rel(value) atomic_fetch_sub_explicit(value, 1, memory_order_acq_rel)
    #define __pyx_atomic_sub(value, arg) atomic_fetch_sub(value, arg)
    #define __pyx_atomic_int_cmp_exchange(value, expected, desired) atomic_compare_exchange_strong(value, expected, desired)
    #define __pyx_atomic_load(value) atomic_load(value)
    #define __pyx_atomic_store(value, new_value) atomic_store(value, new_value)
    #define __pyx_atomic_pointer_load_relaxed(value) atomic_load_explicit(value, memory_order_relaxed)
    #define __pyx_atomic_pointer_load_acquire(value) atomic_load_explicit(value, memory_order_acquire)
    #define __pyx_atomic_pointer_exchange(value, new_value) atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value)
    #define __pyx_atomic_pointer_cmp_exchange(value, expected, desired) atomic_compare_exchange_strong(value, expected, desired)
    #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER)
        #pragma message ("Using standard C atomics")
    #elif defined(__PYX_DEBUG_ATOMICS)
        #warning "Using standard C atomics"
    #endif
#elif CYTHON_ATOMICS && (defined(__cplusplus) && (\
                    (__cplusplus >= 201103L) ||\
\
                    (defined(_MSC_VER) && _MSC_VER >= 1700)) &&\
                    ATOMIC_INT_LOCK_FREE == 2)
    #undef __pyx_atomic_int_type
    #define __pyx_atomic_int_type std::atomic_int
    #define __pyx_atomic_ptr_type std::atomic_uintptr_t
    #define __pyx_nonatomic_ptr_type uintptr_t
    #define __pyx_atomic_incr_relaxed(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_relaxed)
    #define __pyx_atomic_incr_acq_rel(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_acq_rel)
    #define __pyx_atomic_decr_acq_rel(value) std::atomic_fetch_sub_explicit(value, 1, std::memory_order_acq_rel)
    #define __pyx_atomic_sub(value, arg) std::atomic_fetch_sub(value, arg)
    #define __pyx_atomic_int_cmp_exchange(value, expected, desired) std::atomic_compare_exchange_strong(value, expected, desired)
    #define __pyx_atomic_load(value) std::atomic_load(value)
    #define __pyx_atomic_store(value, new_value) std::atomic_store(value, new_value)
    #define __pyx_atomic_pointer_load_relaxed(value) std::atomic_load_explicit(value, std::memory_order_relaxed)
    #define __pyx_atomic_pointer_load_acquire(value) std::atomic_load_explicit(value, std::memory_order_acquire)
    #define __pyx_atomic_pointer_exchange(value, new_value) std::atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value)
    #define __pyx_atomic_pointer_cmp_exchange(value, expected, desired) std::atomic_compare_exchange_strong(value, expected, desired)
    #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER)
        #pragma message ("Using standard C++ atomics")
    #elif defined(__PYX_DEBUG_ATOMICS)
        #warning "Using standard C++ atomics"
    #endif
#elif CYTHON_ATOMICS && (__GNUC__ >= 5 || (__GNUC__ == 4 &&\
                    (__GNUC_MINOR__ > 1 ||\
                    (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ >= 2))))
    #define __pyx_atomic_ptr_type void*
    #define __pyx_nonatomic_ptr_type void*
    #define __pyx_atomic_incr_relaxed(value) __sync_fetch_and_add(value, 1)
    #define __pyx_atomic_incr_acq_rel(value) __sync_fetch_and_add(value, 1)
    #define __pyx_atomic_decr_acq_rel(value) __sync_fetch_and_sub(value, 1)
    #define __pyx_atomic_sub(value, arg) __sync_fetch_and_sub(value, arg)
    static CYTHON_INLINE int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) {
        __pyx_nonatomic_int_type old = __sync_val_compare_and_swap(value, *expected, desired);
        int result = old == *expected;
        *expected = old;
        return result;
    }
    #define __pyx_atomic_load(value) __sync_fetch_and_add(value, 0)
    #define __pyx_atomic_store(value, new_value) __sync_lock_test_and_set(value, new_value)
    #define __pyx_atomic_pointer_load_relaxed(value) __sync_fetch_and_add(value, 0)
    #define __pyx_atomic_pointer_load_acquire(value) __sync_fetch_and_add(value, 0)
    #define __pyx_atomic_pointer_exchange(value, new_value) __sync_lock_test_and_set(value, (__pyx_atomic_ptr_type)new_value)
    static CYTHON_INLINE int __pyx_atomic_pointer_cmp_exchange(__pyx_atomic_ptr_type* value, __pyx_nonatomic_ptr_type* expected, __pyx_nonatomic_ptr_type desired) {
        __pyx_nonatomic_ptr_type old = __sync_val_compare_and_swap(value, *expected, desired);
        int result = old == *expected;
        *expected = old;
        return result;
    }
    #ifdef __PYX_DEBUG_ATOMICS
        #warning "Using GNU atomics"
    #endif
#elif CYTHON_ATOMICS && defined(_MSC_VER)
    #include <intrin.h>
    #undef __pyx_atomic_int_type
    #define __pyx_atomic_int_type long
    #define __pyx_atomic_ptr_type void*
    #undef __pyx_nonatomic_int_type
    #define __pyx_nonatomic_int_type long
    #define __pyx_nonatomic_ptr_type void*
    #pragma intrinsic (_InterlockedExchangeAdd, _InterlockedExchange, _InterlockedCompareExchange, _InterlockedCompareExchangePointer, _InterlockedExchangePointer)
    #define __pyx_atomic_incr_relaxed(value) _InterlockedExchangeAdd(value, 1)
    #define __pyx_atomic_incr_acq_rel(value) _InterlockedExchangeAdd(value, 1)
    #define __pyx_atomic_decr_acq_rel(value) _InterlockedExchangeAdd(value, -1)
    #define __pyx_atomic_sub(value, arg) _InterlockedExchangeAdd(value, -arg)
    static CYTHON_INLINE int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) {
        __pyx_nonatomic_int_type old = _InterlockedCompareExchange(value, desired, *expected);
        int result = old == *expected;
        *expected = old;
        return result;
    }
    #define __pyx_atomic_load(value) _InterlockedExchangeAdd(value, 0)
    #define __pyx_atomic_store(value, new_value) _InterlockedExchange(value, new_value)
    #define __pyx_atomic_pointer_load_relaxed(value) *(void * volatile *)value
    #define __pyx_atomic_pointer_load_acquire(value) _InterlockedCompareExchangePointer(value, 0, 0)
    #define __pyx_atomic_pointer_exchange(value, new_value) _InterlockedExchangePointer(value, (__pyx_atomic_ptr_type)new_value)
    static CYTHON_INLINE int __pyx_atomic_pointer_cmp_exchange(__pyx_atomic_ptr_type* value, __pyx_nonatomic_ptr_type* expected, __pyx_nonatomic_ptr_type desired) {
        __pyx_atomic_ptr_type old = _InterlockedCompareExchangePointer(value, desired, *expected);
        int result = old == *expected;
        *expected = old;
        return result;
    }
    #ifdef __PYX_DEBUG_ATOMICS
        #pragma message ("Using MSVC atomics")
    #endif
#else
    #undef CYTHON_ATOMICS
    #define CYTHON_ATOMICS 0
    #ifdef __PYX_DEBUG_ATOMICS
        #warning "Not using atomics"
    #endif
#endif

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

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

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

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

/* IncludeStructmemberH.proto (used by FixUpExtensionType) */
#include <structmember.h>

/* BufferFormatStructs.proto */
struct __Pyx_StructField_;
#define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
typedef struct {
  const char* name;
  const struct __Pyx_StructField_* fields;
  size_t size;
  size_t arraysize[8];
  int ndim;
  char typegroup;
  char is_unsigned;
  int flags;
} __Pyx_TypeInfo;
typedef struct __Pyx_StructField_ {
  const __Pyx_TypeInfo* type;
  const char* name;
  size_t offset;
} __Pyx_StructField;
typedef struct {
  const __Pyx_StructField* field;
  size_t parent_offset;
} __Pyx_BufFmt_StackElem;
typedef struct {
  __Pyx_StructField root;
  __Pyx_BufFmt_StackElem* head;
  size_t fmt_offset;
  size_t new_count, enc_count;
  size_t struct_alignment;
  int is_complex;
  char enc_type;
  char new_packmode;
  char enc_packmode;
  char is_valid_array;
} __Pyx_BufFmt_Context;

/* MemviewSliceStruct.proto */
struct __pyx_memoryview_obj;
typedef struct {
  struct __pyx_memoryview_obj *memview;
  char *data;
  Py_ssize_t shape[8];
  Py_ssize_t strides[8];
  Py_ssize_t suboffsets[8];
} __Pyx_memviewslice;
#define __Pyx_MemoryView_Len(m)  (m.shape[0])
#define __Pyx_MEMVIEW_DIRECT   1
#define __Pyx_MEMVIEW_PTR      2
#define __Pyx_MEMVIEW_FULL     4
#define __Pyx_MEMVIEW_CONTIG   8
#define __Pyx_MEMVIEW_STRIDED  16
#define __Pyx_MEMVIEW_FOLLOW   32
#define __Pyx_IS_C_CONTIG 1
#define __Pyx_IS_F_CONTIG 2
#define __Pyx_MEMSLICE_INIT  { 0, 0, { 0 }, { 0 }, { 0 } }
#if CYTHON_ATOMICS
    #define __pyx_add_acquisition_count(memview)\
             __pyx_atomic_incr_relaxed(__pyx_get_slice_count_pointer(memview))
    #define __pyx_sub_acquisition_count(memview)\
            __pyx_atomic_decr_acq_rel(__pyx_get_slice_count_pointer(memview))
#else
    #define __pyx_add_acquisition_count(memview)\
            __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
    #define __pyx_sub_acquisition_count(memview)\
            __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
#endif

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

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

/*--- Type declarations ---*/
#ifndef _ARRAYARRAY_H
struct arrayobject;
typedef struct arrayobject arrayobject;
#endif
struct __pyx_obj_8CyOpenGL_vector3;
struct __pyx_obj_8CyOpenGL_GLobject;
struct __pyx_obj_8CyOpenGL_WireframeSphere;
struct __pyx_obj_8CyOpenGL_MeshedSurface;
struct __pyx_obj_8CyOpenGL_PoincareTriangle;
struct __pyx_obj_8CyOpenGL_PoincarePolygon;
struct __pyx_obj_8CyOpenGL_KleinPolygon;
struct __pyx_obj_8CyOpenGL_Colorizer;
struct __pyx_obj_8CyOpenGL_Horosphere;
struct __pyx_obj_8CyOpenGL_HoroballGroup;
struct __pyx_obj_8CyOpenGL_Parallelogram;
struct __pyx_obj_8CyOpenGL_EdgeSet;
struct __pyx_obj_8CyOpenGL_FordEdgeSet;
struct __pyx_obj_8CyOpenGL_TriangulationEdgeSet;
struct __pyx_obj_8CyOpenGL_Label;
struct __pyx_obj_8CyOpenGL_LabelSet;
struct __pyx_obj_8CyOpenGL_HoroballScene;
struct __pyx_obj_8CyOpenGL_DataBasedTexture;
struct __pyx_obj_8CyOpenGL_UniformBufferObject;
struct __pyx_obj_8CyOpenGL_GLSLProgram;
struct __pyx_obj_8CyOpenGL_VertexBuffer;
struct __pyx_obj_8CyOpenGL_GLSLPerspectiveView;
struct __pyx_obj_8CyOpenGL_Triangle;
struct __pyx_defaults;
struct __pyx_obj_8CyOpenGL___pyx_scope_struct__draw;
struct __pyx_obj_8CyOpenGL___pyx_scope_struct_1_genexpr;
struct __pyx_array_obj;
struct __pyx_MemviewEnum_obj;
struct __pyx_memoryview_obj;
struct __pyx_memoryviewslice_obj;
struct __pyx_opt_args_7cpython_11contextvars_get_value;
struct __pyx_opt_args_7cpython_11contextvars_get_value_no_default;

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

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

/* "opengl/vector3.pyx":1
 * cdef class vector3:             # <<<<<<<<<<<<<<
 *     """
 *     A simple real 3-dimensional vector which supports addition,
*/
struct __pyx_obj_8CyOpenGL_vector3 {
  PyObject_HEAD
  double x;
  double y;
  double z;
  double norm_squared;
  double norm;
};


/* "opengl/legacy/object.pyx":1
 * cdef class GLobject:             # <<<<<<<<<<<<<<
 *     """
 *     Base class for the objects in our OpenGL scene.  Think of a
*/
struct __pyx_obj_8CyOpenGL_GLobject {
  PyObject_HEAD
  struct __pyx_vtabstruct_8CyOpenGL_GLobject *__pyx_vtab;
  GLfloat color[4];
  GLfloat front_specular[4];
  GLfloat back_specular[4];
  GLfloat emission[4];
  GLfloat front_shininess;
  GLfloat back_shininess;
  GLuint list_id;
  PyObject *togl_widget;
};


/* "opengl/legacy/wireframe_sphere.pyx":1
 * cdef class WireframeSphere(GLobject):             # <<<<<<<<<<<<<<
 *     """
 *     A wireframe sphere.
*/
struct __pyx_obj_8CyOpenGL_WireframeSphere {
  struct __pyx_obj_8CyOpenGL_GLobject __pyx_base;
};


/* "opengl/legacy/meshed_surface.pyx":2
 * 
 * cdef class MeshedSurface(GLobject):             # <<<<<<<<<<<<<<
 *     """
 *     An object made out of a triangular mesh. See the subclass
*/
struct __pyx_obj_8CyOpenGL_MeshedSurface {
  struct __pyx_obj_8CyOpenGL_GLobject __pyx_base;
  PyObject *vertices;
  PyObject *normals;
  PyObject *triangles;
  PyObject *count;
  GLfloat *nv_array;
  GLushort *indices;
};


/* "opengl/legacy/poincare_triangle.pyx":1
 * cdef class PoincareTriangle(MeshedSurface):             # <<<<<<<<<<<<<<
 *     """
 *     A geodesic triangle in the Poincare model.  The geometric
*/
struct __pyx_obj_8CyOpenGL_PoincareTriangle {
  struct __pyx_obj_8CyOpenGL_MeshedSurface __pyx_base;
  PyObject *center;
  PyObject *mesh;
  PyObject *original_vertices;
};


/* "opengl/legacy/poincare_polygon.pyx":1
 * cdef class PoincarePolygon(GLobject):             # <<<<<<<<<<<<<<
 *     """
 *     A geodesic polygon in the Poincare model. The geometric parameters
*/
struct __pyx_obj_8CyOpenGL_PoincarePolygon {
  struct __pyx_obj_8CyOpenGL_GLobject __pyx_base;
  PyObject *vertices;
  PyObject *center;
  PyObject *triangles;
};


/* "opengl/legacy/klein_polygon.pyx":1
 * cdef class KleinPolygon(GLobject):             # <<<<<<<<<<<<<<
 *     """
 *     A geodesic polygon in the Klein model. The geometric parameters
*/
struct __pyx_obj_8CyOpenGL_KleinPolygon {
  struct __pyx_obj_8CyOpenGL_GLobject __pyx_base;
  PyObject *vertices;
  PyObject *closest;
};


/* "opengl/legacy/colorizer.pyx":1
 * cdef class Colorizer:             # <<<<<<<<<<<<<<
 *     """
 *     Callable class which returns a color when passed an index.
*/
struct __pyx_obj_8CyOpenGL_Colorizer {
  PyObject_HEAD
  struct __pyx_vtabstruct_8CyOpenGL_Colorizer *__pyx_vtab;
  int base_hue[6];
  double lightness;
  double saturation;
  double alpha;
};


/* "opengl/legacy/horosphere.pyx":1
 * cdef class Horosphere(MeshedSurface):             # <<<<<<<<<<<<<<
 *     """
 *     A horosphere.
*/
struct __pyx_obj_8CyOpenGL_Horosphere {
  struct __pyx_obj_8CyOpenGL_MeshedSurface __pyx_base;
  GLdouble radius;
  GLint stacks;
  GLint slices;
};


/* "opengl/legacy/horoball_group.pyx":1
 * cdef class HoroballGroup(GLobject):             # <<<<<<<<<<<<<<
 *     """
 *     A fundamental set of horoballs for a single cusp.  The paremeters
*/
struct __pyx_obj_8CyOpenGL_HoroballGroup {
  struct __pyx_obj_8CyOpenGL_GLobject __pyx_base;
  PyObject *horoballs;
  PyObject *meridian;
  PyObject *longitude;
  PyObject *keys;
  PyObject *centers;
  PyObject *spheres;
  double cutoff;
  PyObject *original_indices;
};


/* "opengl/legacy/parallelogram.pyx":1
 * cdef class Parallelogram(GLobject):             # <<<<<<<<<<<<<<
 *     """
 *     A parallelogram on the xy-plane centered at (0,0). The geometric
*/
struct __pyx_obj_8CyOpenGL_Parallelogram {
  struct __pyx_obj_8CyOpenGL_GLobject __pyx_base;
};


/* "opengl/legacy/edge_set.pyx":1
 * cdef class EdgeSet(GLobject):             # <<<<<<<<<<<<<<
 *     """
 *     Base class for collections of segments to be drawn into a
*/
struct __pyx_obj_8CyOpenGL_EdgeSet {
  struct __pyx_obj_8CyOpenGL_GLobject __pyx_base;
  PyObject *segments;
  PyObject *longitude;
  PyObject *meridian;
  PyObject *stipple;
};


/* "opengl/legacy/ford_edge_set.pyx":1
 * cdef class FordEdgeSet(EdgeSet):             # <<<<<<<<<<<<<<
 *     """
 *     A fundamental set of edges for the component of the Ford domain
*/
struct __pyx_obj_8CyOpenGL_FordEdgeSet {
  struct __pyx_obj_8CyOpenGL_EdgeSet __pyx_base;
};


/* "opengl/legacy/triangulation_edge_set.pyx":1
 * cdef class TriangulationEdgeSet(EdgeSet):             # <<<<<<<<<<<<<<
 *     """
 *     A fundamental set of edges for the 1-skeleton of the canonical
*/
struct __pyx_obj_8CyOpenGL_TriangulationEdgeSet {
  struct __pyx_obj_8CyOpenGL_EdgeSet __pyx_base;
};


/* "opengl/legacy/label.pyx":1
 * cdef class Label:             # <<<<<<<<<<<<<<
 *     """
 *     A numeric label drawn onto a GL image using a SnapPy glyph.
*/
struct __pyx_obj_8CyOpenGL_Label {
  PyObject_HEAD
  struct __pyx_vtabstruct_8CyOpenGL_Label *__pyx_vtab;
  GLfloat x;
  GLfloat y;
  PyObject *codes;
};


/* "opengl/legacy/label_set.pyx":1
 * cdef class LabelSet(GLobject):             # <<<<<<<<<<<<<<
 *     """
 *     A set of edge and vertex labels in the SnapPy font.
*/
struct __pyx_obj_8CyOpenGL_LabelSet {
  struct __pyx_obj_8CyOpenGL_GLobject __pyx_base;
  PyObject *segments;
  PyObject *vertices;
  PyObject *longitude;
  PyObject *meridian;
  PyObject *codes;
  SnapPy_glyph *glyph;
  GLfloat pix;
  GLfloat x;
  GLfloat y;
  int width;
  int height;
};


/* "opengl/legacy/horoball_scene.pyx":1
 * cdef class HoroballScene:             # <<<<<<<<<<<<<<
 *     """
 *     A family of translations of a Horoball Group which fill the
*/
struct __pyx_obj_8CyOpenGL_HoroballScene {
  PyObject_HEAD
  struct __pyx_vtabstruct_8CyOpenGL_HoroballScene *__pyx_vtab;
  PyObject *nbhd;
  PyObject *meridian;
  PyObject *longitude;
  PyObject *offset;
  PyObject *flipped;
  PyObject *cusp_view;
  PyObject *light_Ford;
  PyObject *dark_Ford;
  PyObject *light_tri;
  PyObject *dark_tri;
  PyObject *pgram;
  PyObject *labels;
  PyObject *shifts;
  PyObject *pgram_var;
  PyObject *Ford_var;
  PyObject *tri_var;
  PyObject *horo_var;
  PyObject *label_var;
  GLfloat Xangle;
  GLfloat Yangle;
  double cutoff;
  int which_cusp;
  PyObject *togl_widget;
};


/* "opengl/modern/data_based_texture.pyx":1
 * cdef class DataBasedTexture:             # <<<<<<<<<<<<<<
 *     cdef GLuint _textureName
 * 
*/
struct __pyx_obj_8CyOpenGL_DataBasedTexture {
  PyObject_HEAD
  GLuint _textureName;
};


/* "opengl/modern/uniform_buffer_object.pyx":13
 *     return floats
 * 
 * cdef class UniformBufferObject:             # <<<<<<<<<<<<<<
 *     cdef size_t _buffer_size
 *     cdef char * _buffer
*/
struct __pyx_obj_8CyOpenGL_UniformBufferObject {
  PyObject_HEAD
  size_t _buffer_size;
  char *_buffer;
  GLuint _uniform_buffer_object;
  PyObject *_name_to_offset;
};


/* "opengl/modern/glsl_program.pyx":63
 *     return False
 * 
 * cdef class GLSLProgram:             # <<<<<<<<<<<<<<
 *     """
 *     A Cython class representing a GLSL program.  Given GLSL source for a
*/
struct __pyx_obj_8CyOpenGL_GLSLProgram {
  PyObject_HEAD
  GLuint _vertex_shader;
  GLuint _fragment_shader;
  GLuint _glsl_program;
  GLuint _width;
  GLuint _height;
  int _is_valid;
  PyObject *_name_to_uniform_block;
};


/* "opengl/modern/vertex_buffer.pyx":1
 * cdef class VertexBuffer:             # <<<<<<<<<<<<<<
 *     """
 *     Encapsulates a vertex array and vertex buffer object.
*/
struct __pyx_obj_8CyOpenGL_VertexBuffer {
  PyObject_HEAD
  GLuint _vao;
  GLuint _vbo;
  unsigned int _dimension;
};


/* "opengl/modern/glsl_perspective_view.pyx":34
 *             matrix[i + 4*j] = 1.0 if i == j else 0.0
 * 
 * cdef class GLSLPerspectiveView:             # <<<<<<<<<<<<<<
 *     """
 *     Mixin class to create a perspective view using GLSL.  An object of
*/
struct __pyx_obj_8CyOpenGL_GLSLPerspectiveView {
  PyObject_HEAD
  struct __pyx_vtabstruct_8CyOpenGL_GLSLPerspectiveView *__pyx_vtab;
  GLfloat _rotation[16];
  GLfloat _model_view[16];
  GLfloat _projection[16];
  GLfloat _mvp[16];
  GLfloat _vertical_fov;
  GLfloat _near;
  GLfloat _far;
  GLfloat _distance;
  GLfloat _center[3];
};


/* "opengl/modern/triangle.pyx":1
 * cdef class Triangle:             # <<<<<<<<<<<<<<
 *     """
 *     A triangle with given vertices.
*/
struct __pyx_obj_8CyOpenGL_Triangle {
  PyObject_HEAD
  PyObject *_gl_widget;
  PyObject *_program;
  PyObject *_vertex_buffer;
};


/* "opengl/legacy/raw_openGL_widget.pyx":19
 *     current_widget = None
 * 
 *     def __init__(self, parent, cnf={}, **kw):             # <<<<<<<<<<<<<<
 *         """
 *         Create an OpenGL widget, arguments are passed down to
*/
struct __pyx_defaults {
  PyObject_HEAD
  PyObject *arg0;
};


/* "opengl/legacy/wireframe_sphere.pyx":6
 *     """
 * 
 *     def draw(self, GLfloat radius, GLint slices, GLint stacks):             # <<<<<<<<<<<<<<
 *         assert slices % 2 == 0 and stacks % 2 == 0
 *         self.set_material()
*/
struct __pyx_obj_8CyOpenGL___pyx_scope_struct__draw {
  PyObject_HEAD
  PyObject *__pyx_v_r;
};


/* "opengl/legacy/horoball_scene.pyx":52
 *             self.which_cusp = which_cusp
 *         self.meridian, self.longitude = (
 *             complex(z) for z in self.nbhd.translations(self.which_cusp))             # <<<<<<<<<<<<<<
 *         self.cusp_view = HoroballGroup(
 *             self.nbhd.horoballs(self.cutoff, which_cusp, full_list),
*/
struct __pyx_obj_8CyOpenGL___pyx_scope_struct_1_genexpr {
  PyObject_HEAD
  PyObject *__pyx_genexpr_arg_0;
  PyObject *__pyx_v_z;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "View.MemoryView":118
 * 
 * 
 * @cython.collection_type("sequence")             # <<<<<<<<<<<<<<
 * @cname("__pyx_array")
 * cdef class array:
*/
struct __pyx_array_obj {
  PyObject_HEAD
  struct __pyx_vtabstruct_array *__pyx_vtab;
  char *data;
  Py_ssize_t len;
  char *format;
  int ndim;
  Py_ssize_t *_shape;
  Py_ssize_t *_strides;
  Py_ssize_t itemsize;
  PyObject *mode;
  PyObject *_format;
  void (*callback_free_data)(void *);
  int free_data;
  int dtype_is_object;
};


/* "View.MemoryView":307
 * 
 * 
 * @cname('__pyx_MemviewEnum')             # <<<<<<<<<<<<<<
 * cdef class Enum(object):
 *     cdef object name
*/
struct __pyx_MemviewEnum_obj {
  PyObject_HEAD
  PyObject *name;
};


/* "View.MemoryView":342
 * 
 * 
 * @cname('__pyx_memoryview')             # <<<<<<<<<<<<<<
 * cdef class memoryview:
 * 
*/
struct __pyx_memoryview_obj {
  PyObject_HEAD
  struct __pyx_vtabstruct_memoryview *__pyx_vtab;
  PyObject *obj;
  PyObject *_size;
  void *_unused;
  PyThread_type_lock lock;
  __pyx_atomic_int_type acquisition_count;
  Py_buffer view;
  int flags;
  int dtype_is_object;
  __Pyx_TypeInfo const *typeinfo;
};


/* "View.MemoryView":856
 * 
 * 
 * @cython.collection_type("sequence")             # <<<<<<<<<<<<<<
 * @cname('__pyx_memoryviewslice')
 * cdef class _memoryviewslice(memoryview):
*/
struct __pyx_memoryviewslice_obj {
  struct __pyx_memoryview_obj __pyx_base;
  __Pyx_memviewslice from_slice;
  PyObject *from_object;
  PyObject *(*to_object_func)(char *);
  int (*to_dtype_func)(char *, PyObject *);
};



/* "opengl/legacy/object.pyx":1
 * cdef class GLobject:             # <<<<<<<<<<<<<<
 *     """
 *     Base class for the objects in our OpenGL scene.  Think of a
*/

struct __pyx_vtabstruct_8CyOpenGL_GLobject {
  PyObject *(*set_material)(struct __pyx_obj_8CyOpenGL_GLobject *);
  PyObject *(*display)(struct __pyx_obj_8CyOpenGL_GLobject *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_8CyOpenGL_GLobject *__pyx_vtabptr_8CyOpenGL_GLobject;


/* "opengl/legacy/wireframe_sphere.pyx":1
 * cdef class WireframeSphere(GLobject):             # <<<<<<<<<<<<<<
 *     """
 *     A wireframe sphere.
*/

struct __pyx_vtabstruct_8CyOpenGL_WireframeSphere {
  struct __pyx_vtabstruct_8CyOpenGL_GLobject __pyx_base;
};
static struct __pyx_vtabstruct_8CyOpenGL_WireframeSphere *__pyx_vtabptr_8CyOpenGL_WireframeSphere;


/* "opengl/legacy/meshed_surface.pyx":2
 * 
 * cdef class MeshedSurface(GLobject):             # <<<<<<<<<<<<<<
 *     """
 *     An object made out of a triangular mesh. See the subclass
*/

struct __pyx_vtabstruct_8CyOpenGL_MeshedSurface {
  struct __pyx_vtabstruct_8CyOpenGL_GLobject __pyx_base;
};
static struct __pyx_vtabstruct_8CyOpenGL_MeshedSurface *__pyx_vtabptr_8CyOpenGL_MeshedSurface;


/* "opengl/legacy/poincare_triangle.pyx":1
 * cdef class PoincareTriangle(MeshedSurface):             # <<<<<<<<<<<<<<
 *     """
 *     A geodesic triangle in the Poincare model.  The geometric
*/

struct __pyx_vtabstruct_8CyOpenGL_PoincareTriangle {
  struct __pyx_vtabstruct_8CyOpenGL_MeshedSurface __pyx_base;
};
static struct __pyx_vtabstruct_8CyOpenGL_PoincareTriangle *__pyx_vtabptr_8CyOpenGL_PoincareTriangle;


/* "opengl/legacy/poincare_polygon.pyx":1
 * cdef class PoincarePolygon(GLobject):             # <<<<<<<<<<<<<<
 *     """
 *     A geodesic polygon in the Poincare model. The geometric parameters
*/

struct __pyx_vtabstruct_8CyOpenGL_PoincarePolygon {
  struct __pyx_vtabstruct_8CyOpenGL_GLobject __pyx_base;
  PyObject *(*triangulate)(struct __pyx_obj_8CyOpenGL_PoincarePolygon *);
};
static struct __pyx_vtabstruct_8CyOpenGL_PoincarePolygon *__pyx_vtabptr_8CyOpenGL_PoincarePolygon;


/* "opengl/legacy/klein_polygon.pyx":1
 * cdef class KleinPolygon(GLobject):             # <<<<<<<<<<<<<<
 *     """
 *     A geodesic polygon in the Klein model. The geometric parameters
*/

struct __pyx_vtabstruct_8CyOpenGL_KleinPolygon {
  struct __pyx_vtabstruct_8CyOpenGL_GLobject __pyx_base;
};
static struct __pyx_vtabstruct_8CyOpenGL_KleinPolygon *__pyx_vtabptr_8CyOpenGL_KleinPolygon;


/* "opengl/legacy/colorizer.pyx":1
 * cdef class Colorizer:             # <<<<<<<<<<<<<<
 *     """
 *     Callable class which returns a color when passed an index.
*/

struct __pyx_vtabstruct_8CyOpenGL_Colorizer {
  double (*index_to_hue)(struct __pyx_obj_8CyOpenGL_Colorizer *, int);
  PyObject *(*hls_to_rgb)(struct __pyx_obj_8CyOpenGL_Colorizer *, double, double, double);
  PyObject *(*hls_interp)(struct __pyx_obj_8CyOpenGL_Colorizer *, double, double, double);
};
static struct __pyx_vtabstruct_8CyOpenGL_Colorizer *__pyx_vtabptr_8CyOpenGL_Colorizer;


/* "opengl/legacy/horosphere.pyx":1
 * cdef class Horosphere(MeshedSurface):             # <<<<<<<<<<<<<<
 *     """
 *     A horosphere.
*/

struct __pyx_vtabstruct_8CyOpenGL_Horosphere {
  struct __pyx_vtabstruct_8CyOpenGL_MeshedSurface __pyx_base;
  PyObject *(*build_vertices_and_normals)(struct __pyx_obj_8CyOpenGL_Horosphere *);
  PyObject *(*build_triangles)(struct __pyx_obj_8CyOpenGL_Horosphere *);
};
static struct __pyx_vtabstruct_8CyOpenGL_Horosphere *__pyx_vtabptr_8CyOpenGL_Horosphere;


/* "opengl/legacy/horoball_group.pyx":1
 * cdef class HoroballGroup(GLobject):             # <<<<<<<<<<<<<<
 *     """
 *     A fundamental set of horoballs for a single cusp.  The paremeters
*/

struct __pyx_vtabstruct_8CyOpenGL_HoroballGroup {
  struct __pyx_vtabstruct_8CyOpenGL_GLobject __pyx_base;
  PyObject *(*build_spheres)(struct __pyx_obj_8CyOpenGL_HoroballGroup *);
};
static struct __pyx_vtabstruct_8CyOpenGL_HoroballGroup *__pyx_vtabptr_8CyOpenGL_HoroballGroup;


/* "opengl/legacy/parallelogram.pyx":1
 * cdef class Parallelogram(GLobject):             # <<<<<<<<<<<<<<
 *     """
 *     A parallelogram on the xy-plane centered at (0,0). The geometric
*/

struct __pyx_vtabstruct_8CyOpenGL_Parallelogram {
  struct __pyx_vtabstruct_8CyOpenGL_GLobject __pyx_base;
};
static struct __pyx_vtabstruct_8CyOpenGL_Parallelogram *__pyx_vtabptr_8CyOpenGL_Parallelogram;


/* "opengl/legacy/edge_set.pyx":1
 * cdef class EdgeSet(GLobject):             # <<<<<<<<<<<<<<
 *     """
 *     Base class for collections of segments to be drawn into a
*/

struct __pyx_vtabstruct_8CyOpenGL_EdgeSet {
  struct __pyx_vtabstruct_8CyOpenGL_GLobject __pyx_base;
  PyObject *(*set_dark_color)(struct __pyx_obj_8CyOpenGL_EdgeSet *);
  PyObject *(*set_light_color)(struct __pyx_obj_8CyOpenGL_EdgeSet *);
};
static struct __pyx_vtabstruct_8CyOpenGL_EdgeSet *__pyx_vtabptr_8CyOpenGL_EdgeSet;


/* "opengl/legacy/ford_edge_set.pyx":1
 * cdef class FordEdgeSet(EdgeSet):             # <<<<<<<<<<<<<<
 *     """
 *     A fundamental set of edges for the component of the Ford domain
*/

struct __pyx_vtabstruct_8CyOpenGL_FordEdgeSet {
  struct __pyx_vtabstruct_8CyOpenGL_EdgeSet __pyx_base;
};
static struct __pyx_vtabstruct_8CyOpenGL_FordEdgeSet *__pyx_vtabptr_8CyOpenGL_FordEdgeSet;


/* "opengl/legacy/triangulation_edge_set.pyx":1
 * cdef class TriangulationEdgeSet(EdgeSet):             # <<<<<<<<<<<<<<
 *     """
 *     A fundamental set of edges for the 1-skeleton of the canonical
*/

struct __pyx_vtabstruct_8CyOpenGL_TriangulationEdgeSet {
  struct __pyx_vtabstruct_8CyOpenGL_EdgeSet __pyx_base;
};
static struct __pyx_vtabstruct_8CyOpenGL_TriangulationEdgeSet *__pyx_vtabptr_8CyOpenGL_TriangulationEdgeSet;


/* "opengl/legacy/label.pyx":1
 * cdef class Label:             # <<<<<<<<<<<<<<
 *     """
 *     A numeric label drawn onto a GL image using a SnapPy glyph.
*/

struct __pyx_vtabstruct_8CyOpenGL_Label {
  PyObject *(*get_shape)(struct __pyx_obj_8CyOpenGL_Label *);
};
static struct __pyx_vtabstruct_8CyOpenGL_Label *__pyx_vtabptr_8CyOpenGL_Label;


/* "opengl/legacy/label_set.pyx":1
 * cdef class LabelSet(GLobject):             # <<<<<<<<<<<<<<
 *     """
 *     A set of edge and vertex labels in the SnapPy font.
*/

struct __pyx_vtabstruct_8CyOpenGL_LabelSet {
  struct __pyx_vtabstruct_8CyOpenGL_GLobject __pyx_base;
};
static struct __pyx_vtabstruct_8CyOpenGL_LabelSet *__pyx_vtabptr_8CyOpenGL_LabelSet;


/* "opengl/legacy/horoball_scene.pyx":1
 * cdef class HoroballScene:             # <<<<<<<<<<<<<<
 *     """
 *     A family of translations of a Horoball Group which fill the
*/

struct __pyx_vtabstruct_8CyOpenGL_HoroballScene {
  PyObject *(*build_shifts)(struct __pyx_obj_8CyOpenGL_HoroballScene *, PyObject *, PyObject *);
  PyObject *(*right_top)(struct __pyx_obj_8CyOpenGL_HoroballScene *);
  PyObject *(*gl_compile)(struct __pyx_obj_8CyOpenGL_HoroballScene *);
  PyObject *(*draw_segments)(struct __pyx_obj_8CyOpenGL_HoroballScene *, PyObject *, PyObject *);
};
static struct __pyx_vtabstruct_8CyOpenGL_HoroballScene *__pyx_vtabptr_8CyOpenGL_HoroballScene;


/* "opengl/modern/glsl_perspective_view.pyx":34
 *             matrix[i + 4*j] = 1.0 if i == j else 0.0
 * 
 * cdef class GLSLPerspectiveView:             # <<<<<<<<<<<<<<
 *     """
 *     Mixin class to create a perspective view using GLSL.  An object of
*/

struct __pyx_vtabstruct_8CyOpenGL_GLSLPerspectiveView {
  PyObject *(*compute_mvp)(struct __pyx_obj_8CyOpenGL_GLSLPerspectiveView *, PyObject *, PyObject *);
  PyObject *(*translate)(struct __pyx_obj_8CyOpenGL_GLSLPerspectiveView *, GLfloat, GLfloat, GLfloat, int __pyx_skip_dispatch);
  PyObject *(*rotate)(struct __pyx_obj_8CyOpenGL_GLSLPerspectiveView *, GLfloat, GLfloat, GLfloat, GLfloat, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_8CyOpenGL_GLSLPerspectiveView *__pyx_vtabptr_8CyOpenGL_GLSLPerspectiveView;


/* "View.MemoryView":118
 * 
 * 
 * @cython.collection_type("sequence")             # <<<<<<<<<<<<<<
 * @cname("__pyx_array")
 * cdef class array:
*/

struct __pyx_vtabstruct_array {
  PyObject *(*get_memview)(struct __pyx_array_obj *);
};
static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;


/* "View.MemoryView":342
 * 
 * 
 * @cname('__pyx_memoryview')             # <<<<<<<<<<<<<<
 * cdef class memoryview:
 * 
*/

struct __pyx_vtabstruct_memoryview {
  char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *);
  PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *);
  PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
  PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *);
  PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
  PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *);
  PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *);
  PyObject *(*_get_base)(struct __pyx_memoryview_obj *);
};
static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;


/* "View.MemoryView":856
 * 
 * 
 * @cython.collection_type("sequence")             # <<<<<<<<<<<<<<
 * @cname('__pyx_memoryviewslice')
 * cdef class _memoryviewslice(memoryview):
*/

struct __pyx_vtabstruct__memoryviewslice {
  struct __pyx_vtabstruct_memoryview __pyx_base;
};
static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
/* #### Code section: utility_code_proto ### */

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

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

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

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

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

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

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

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

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

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

/* PyOverflowError_Check.proto */
#define __Pyx_PyExc_OverflowError_Check(obj)  __Pyx_TypeCheck(obj, PyExc_OverflowError)

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

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

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

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

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

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

/* fastcall.proto */
#if CYTHON_AVOID_BORROWED_REFS
    #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_PySequence_ITEM(args, i)
#elif CYTHON_ASSUME_SAFE_MACROS
    #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_NewRef(__Pyx_PyTuple_GET_ITEM(args, i))
#else
    #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_XNewRef(PyTuple_GetItem(args, i))
#endif
#define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds)
#define __Pyx_KwValues_VARARGS(args, nargs) NULL
#define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s)
#define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw)
#if CYTHON_METH_FASTCALL
    #define __Pyx_ArgRef_FASTCALL(args, i) __Pyx_NewRef(args[i])
    #define __Pyx_NumKwargs_FASTCALL(kwds) __Pyx_PyTuple_GET_SIZE(kwds)
    #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs))
    static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API
    CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues);
  #else
    #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw)
  #endif
#else
    #define __Pyx_ArgRef_FASTCALL __Pyx_ArgRef_VARARGS
    #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS
    #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS
    #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS
    #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS
#endif
#define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop)
#if CYTHON_METH_FASTCALL || (CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(args + start, stop - start)
#else
#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop)
#endif

/* py_dict_items.proto (used by OwnedDictNext) */
static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d);

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/* ArgTypeTestFunc.export */
static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);

/* ArgTypeTest.proto */
#define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
    ((likely(__Pyx_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None)))) ? 1 :\
        __Pyx__ArgTypeTest(obj, type, name, exact))

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

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

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

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

/* PyMemoryError_Check.proto */
#define __Pyx_PyExc_MemoryError_Check(obj)  __Pyx_TypeCheck(obj, PyExc_MemoryError)

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

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

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

/* IncludeStdlibH.proto (used by CIntToPyUnicode) */
#include <stdlib.h>

/* CIntToPyUnicode.proto */
#define __Pyx_PyUnicode_From_int(value, width, padding_char, format_char) (\
    ((format_char) == ('c')) ?\
        __Pyx_uchar___Pyx_PyUnicode_From_int(value, width, padding_char) :\
        __Pyx____Pyx_PyUnicode_From_int(value, width, padding_char, format_char)\
    )
static CYTHON_INLINE PyObject* __Pyx_uchar___Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char);
static CYTHON_INLINE PyObject* __Pyx____Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char, char format_char);

/* CIntToPyUnicode.proto */
#define __Pyx_PyUnicode_From_Py_ssize_t(value, width, padding_char, format_char) (\
    ((format_char) == ('c')) ?\
        __Pyx_uchar___Pyx_PyUnicode_From_Py_ssize_t(value, width, padding_char) :\
        __Pyx____Pyx_PyUnicode_From_Py_ssize_t(value, width, padding_char, format_char)\
    )
static CYTHON_INLINE PyObject* __Pyx_uchar___Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char);
static CYTHON_INLINE PyObject* __Pyx____Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char, char format_char);

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

/* PyObjectFormatSimple.proto */
#if CYTHON_COMPILING_IN_PYPY
    #define __Pyx_PyObject_FormatSimple(s, f) (\
        likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
        PyObject_Format(s, f))
#elif CYTHON_USE_TYPE_SLOTS
    #define __Pyx_PyObject_FormatSimple(s, f) (\
        likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
        likely(PyLong_CheckExact(s)) ? PyLong_Type.tp_repr(s) :\
        likely(PyFloat_CheckExact(s)) ? PyFloat_Type.tp_repr(s) :\
        PyObject_Format(s, f))
#else
    #define __Pyx_PyObject_FormatSimple(s, f) (\
        likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
        PyObject_Format(s, f))
#endif

CYTHON_UNUSED static int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/
/* GetAttr.proto */
static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);

/* GetItemInt.proto */
#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck, has_gil, unsafe_shared)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck, unsafe_shared) :\
    (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
               __Pyx_GetItemInt_Generic(o, to_py_func(i))))
#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck, has_gil, unsafe_shared)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck, unsafe_shared) :\
    (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, int unsafe_shared);
#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck, has_gil, unsafe_shared)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck, unsafe_shared) :\
    (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, int unsafe_shared);
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, int unsafe_shared);

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

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

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

/* UnaryNegOverflows.proto */
#define __Pyx_UNARY_NEG_WOULD_OVERFLOW(x)\
        (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))

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

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

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

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

/* PyAssertionError_Check.proto */
#define __Pyx_PyExc_AssertionError_Check(obj)  __Pyx_TypeCheck(obj, PyExc_AssertionError)

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

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

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

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

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

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

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

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

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

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

/* PySequenceMultiply.proto */
#define __Pyx_PySequence_Multiply_Left(mul, seq)  __Pyx_PySequence_Multiply(seq, mul)
#if !CYTHON_USE_TYPE_SLOTS
#define  __Pyx_PySequence_Multiply PySequence_Repeat
#else
static CYTHON_INLINE PyObject* __Pyx_PySequence_Multiply(PyObject *seq, Py_ssize_t mul);
#endif

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

/* PyObjectFormat.proto */
#if CYTHON_USE_UNICODE_WRITER
static PyObject* __Pyx_PyObject_Format(PyObject* s, PyObject* f);
#else
#define __Pyx_PyObject_Format(s, f) PyObject_Format(s, f)
#endif

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

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

/* DivInt[long].proto */
static CYTHON_INLINE long __Pyx_div_long(long, long, int b_is_constant);

/* PyRuntimeError_Check.proto */
#define __Pyx_PyExc_RuntimeError_Check(obj)  __Pyx_TypeCheck(obj, PyExc_RuntimeError)

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

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

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

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

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

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

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

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

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

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

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

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

/* ModInt[long].proto */
static CYTHON_INLINE long __Pyx_mod_long(long, long, int b_is_constant);

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/* PyRange_Check.proto */
#if CYTHON_COMPILING_IN_PYPY && !defined(PyRange_Check)
  #define PyRange_Check(obj)  __Pyx_TypeCheck((obj), &PyRange_Type)
#endif

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

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

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

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

/* PyObjectGetMethod.proto (used by PyObjectCallMethod1) */
#if !(CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000)))
static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method);
#endif

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

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

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

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

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

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

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

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

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

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

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

/* ModFloat[double].proto */
static CYTHON_INLINE double __Pyx_mod_double(double, double, int b_is_constant);

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

/* PyKeyError_Check.proto */
#define __Pyx_PyExc_KeyError_Check(obj)  __Pyx_TypeCheck(obj, PyExc_KeyError)

/* unicode_iter.proto */
static CYTHON_INLINE int __Pyx_init_unicode_iteration(
    PyObject* ustring, Py_ssize_t *length, void** data, int *kind);

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

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

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

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

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

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

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

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

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

/* FloatExceptionCheck.proto */
#define __PYX_CHECK_FLOAT_EXCEPTION(value, error_value)\
    ((error_value) == (error_value) ?\
     (value) == (error_value) :\
     (value) != (value))

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

/* BufferIndexError.proto */
static void __Pyx_RaiseBufferIndexError(int axis);

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

/* SliceObject.proto */
#define __Pyx_PyObject_DelSlice(obj, cstart, cstop, py_start, py_stop, py_slice, has_cstart, has_cstop, wraparound)\
    __Pyx_PyObject_SetSlice(obj, (PyObject*)NULL, cstart, cstop, py_start, py_stop, py_slice, has_cstart, has_cstop, wraparound)
static CYTHON_INLINE int __Pyx_PyObject_SetSlice(
        PyObject* obj, PyObject* value, 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);

/* CIntToPyUnicode.proto */
#define __Pyx_PyUnicode_From_size_t(value, width, padding_char, format_char) (\
    ((format_char) == ('c')) ?\
        __Pyx_uchar___Pyx_PyUnicode_From_size_t(value, width, padding_char) :\
        __Pyx____Pyx_PyUnicode_From_size_t(value, width, padding_char, format_char)\
    )
static CYTHON_INLINE PyObject* __Pyx_uchar___Pyx_PyUnicode_From_size_t(size_t value, Py_ssize_t width, char padding_char);
static CYTHON_INLINE PyObject* __Pyx____Pyx_PyUnicode_From_size_t(size_t value, Py_ssize_t width, char padding_char, char format_char);

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

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

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

/* UnpackTuple2.proto (used by dict_iter) */
static CYTHON_INLINE int __Pyx_unpack_tuple2(
    PyObject* tuple, PyObject** value1, PyObject** value2, int is_tuple, int has_known_size, int decref_tuple);
static CYTHON_INLINE int __Pyx_unpack_tuple2_exact(
    PyObject* tuple, PyObject** value1, PyObject** value2, int decref_tuple);
static int __Pyx_unpack_tuple2_generic(
    PyObject* tuple, PyObject** value1, PyObject** value2, int has_known_size, int decref_tuple);

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

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

/* MergeKeywords.proto */
static int __Pyx_MergeKeywords(PyObject *kwdict, PyObject *source_mapping);

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

/* DeallocKeepAlive.proto */
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
#define __Pyx_DeallocKeepAliveBegin(o) do {\
        _Py_atomic_store_uintptr_relaxed(&(o)->ob_tid, _Py_ThreadId());\
        _Py_atomic_store_uint32_relaxed(&(o)->ob_ref_local, 1);\
        _Py_atomic_store_ssize_relaxed(&(o)->ob_ref_shared, 0);\
    } while (0)
#define __Pyx_DeallocKeepAliveEnd(o)\
        _Py_atomic_store_uint32_relaxed(&(o)->ob_ref_local, 0)
#else
#define __Pyx_DeallocKeepAliveBegin(o) __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1)
#define __Pyx_DeallocKeepAliveEnd(o)   __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1)
#endif

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

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

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

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

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

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

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

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

/* TypeImport.proto */
#ifndef __PYX_HAVE_RT_ImportType_proto_3_2_8
#define __PYX_HAVE_RT_ImportType_proto_3_2_8
#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
#include <stdalign.h>
#endif
#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L
#define __PYX_GET_STRUCT_ALIGNMENT_3_2_8(s) alignof(s)
#else
#define __PYX_GET_STRUCT_ALIGNMENT_3_2_8(s) sizeof(void*)
#endif
enum __Pyx_ImportType_CheckSize_3_2_8 {
   __Pyx_ImportType_CheckSize_Error_3_2_8 = 0,
   __Pyx_ImportType_CheckSize_Warn_3_2_8 = 1,
   __Pyx_ImportType_CheckSize_Ignore_3_2_8 = 2
};
static PyTypeObject *__Pyx_ImportType_3_2_8(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_2_8 check_size);
#endif

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

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

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

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

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

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

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

/* CyFunctionClassCell.proto */
static int __Pyx_CyFunction_InitClassCell(PyObject *cyfunctions, PyObject *classobj);

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

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

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

/* ArrayAPI.proto */
#ifndef _ARRAYARRAY_H
#define _ARRAYARRAY_H
typedef struct arraydescr {
    union {
        char typecode_char;  // pre-3.15
        char typecode_array[3]; // post-3.15
    };
    int itemsize;
    PyObject * (*getitem)(struct arrayobject *, Py_ssize_t);
    int (*setitem)(struct arrayobject *, Py_ssize_t, PyObject *);
#if PY_VERSION_HEX <= 0x030F00a8
    char *formats;
#endif
} arraydescr;
typedef union {
    char *ob_item;
    float *as_floats;
    double *as_doubles;
    int *as_ints;
    unsigned int *as_uints;
    unsigned char *as_uchars;
    signed char *as_schars;
    char *as_chars;
    unsigned long *as_ulongs;
    long *as_longs;
    unsigned long long *as_ulonglongs;
    long long *as_longlongs;
    short *as_shorts;
    unsigned short *as_ushorts;
    #if PY_VERSION_HEX >= 0x030d0000
    Py_DEPRECATED(3.13)
    #endif
        wchar_t *as_pyunicodes;
    void *as_voidptr;
} __Pyx_data_union;
struct arrayobject {
    PyObject_HEAD
    Py_ssize_t ob_size;
    __Pyx_data_union data;
    Py_ssize_t allocated;
    struct arraydescr *ob_descr;
    PyObject *weakreflist;
    int ob_exports;
};
#ifndef NO_NEWARRAY_INLINE
static CYTHON_INLINE PyObject * newarrayobject(PyTypeObject *type, Py_ssize_t size,
    struct arraydescr *descr) {
    arrayobject *op;
    size_t nbytes;
    if (size < 0) {
        PyErr_BadInternalCall();
        return NULL;
    }
    nbytes = size * descr->itemsize;
    if (nbytes / descr->itemsize != (size_t)size) {
        return PyErr_NoMemory();
    }
    op = (arrayobject *) type->tp_alloc(type, 0);
    if (op == NULL) {
        return NULL;
    }
    op->ob_descr = descr;
    op->allocated = size;
    op->weakreflist = NULL;
    __Pyx_SET_SIZE(op, size);
    if (size <= 0) {
        op->data.ob_item = NULL;
    }
    else {
        op->data.ob_item = PyMem_NEW(char, nbytes);
        if (op->data.ob_item == NULL) {
            Py_DECREF(op);
            return PyErr_NoMemory();
        }
    }
    return (PyObject *) op;
}
#else
PyObject* newarrayobject(PyTypeObject *type, Py_ssize_t size,
    struct arraydescr *descr);
#endif
static CYTHON_INLINE __Pyx_data_union __Pyx_PyArray_Data(arrayobject *self) {
#if CYTHON_COMPILING_IN_GRAAL
    __Pyx_data_union data;
    data.ob_item = GraalPyArray_Data((PyObject*)self);
    return data;
#else
    return self->data;
#endif
}
static CYTHON_INLINE int resize(arrayobject *self, Py_ssize_t n) {
#if CYTHON_COMPILING_IN_GRAAL
    return GraalPyArray_Resize((PyObject*)self, n);
#else
    void *items = (void*) self->data.ob_item;
    PyMem_Resize(items, char, (size_t)(n * self->ob_descr->itemsize));
    if (items == NULL) {
        PyErr_NoMemory();
        return -1;
    }
    self->data.ob_item = (char*) items;
    __Pyx_SET_SIZE(self, n);
    self->allocated = n;
    return 0;
#endif
}
static CYTHON_INLINE int resize_smart(arrayobject *self, Py_ssize_t n) {
#if CYTHON_COMPILING_IN_GRAAL
    return GraalPyArray_Resize((PyObject*)self, n);
#else
    void *items = (void*) self->data.ob_item;
    Py_ssize_t newsize;
    if (n < self->allocated && n*4 > self->allocated) {
        __Pyx_SET_SIZE(self, n);
        return 0;
    }
    newsize = n + (n / 2) + 1;
    if (newsize <= n) {
        PyErr_NoMemory();
        return -1;
    }
    PyMem_Resize(items, char, (size_t)(newsize * self->ob_descr->itemsize));
    if (items == NULL) {
        PyErr_NoMemory();
        return -1;
    }
    self->data.ob_item = (char*) items;
    __Pyx_SET_SIZE(self, n);
    self->allocated = newsize;
    return 0;
#endif
}
#endif

/* BufferStructDeclare.proto */
typedef struct {
  Py_ssize_t shape, strides, suboffsets;
} __Pyx_Buf_DimInfo;
typedef struct {
  size_t refcount;
  Py_buffer pybuffer;
} __Pyx_Buffer;
typedef struct {
  __Pyx_Buffer *rcbuffer;
  char *data;
  __Pyx_Buf_DimInfo diminfo[8];
} __Pyx_LocalBuf_ND;

/* MemviewRefcount.proto */
static CYTHON_INLINE int __pyx_add_acquisition_count_locked(
    __pyx_atomic_int_type *acquisition_count, PyThread_type_lock lock);
static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(
    __pyx_atomic_int_type *acquisition_count, PyThread_type_lock lock);
#define __pyx_get_slice_count_pointer(memview) (&memview->acquisition_count)
#define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
#define __PYX_XCLEAR_MEMVIEW(slice, have_gil) __Pyx_XCLEAR_MEMVIEW(slice, have_gil, __LINE__)
static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int);
static CYTHON_INLINE void __Pyx_XCLEAR_MEMVIEW(__Pyx_memviewslice *, int, int);

/* MemviewSliceIsContig.proto */
static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim);

/* OverlappingSlices.proto */
static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
                                __Pyx_memviewslice *slice2,
                                int ndim, size_t itemsize);

/* MemviewSliceInit.proto */
static int __Pyx_init_memviewslice(
                struct __pyx_memoryview_obj *memview,
                int ndim,
                __Pyx_memviewslice *memviewslice,
                int memview_is_new_reference);

/* SliceMemoryviewSlice.proto */
static CYTHON_INLINE int __pyx_memoryview_slice_memviewslice(
        __Pyx_memviewslice *dst,
        Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
        int dim, int new_ndim, int *suboffset_dim,
        Py_ssize_t start, Py_ssize_t stop, Py_ssize_t step,
        int have_start, int have_stop, int have_step,
        int is_slice);

/* IsLittleEndian.proto (used by BufferFormatCheck) */
static CYTHON_INLINE int __Pyx_Is_Little_Endian(void);

/* BufferFormatCheck.proto (used by MemviewSliceValidateAndInit) */
static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts);
static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
                              __Pyx_BufFmt_StackElem* stack,
                              const __Pyx_TypeInfo* type);

/* TypeInfoCompare.proto (used by MemviewSliceValidateAndInit) */
static int __pyx_typeinfo_cmp(const __Pyx_TypeInfo *a, const __Pyx_TypeInfo *b);

/* MemviewSliceValidateAndInit.export */
static int __Pyx_ValidateAndInit_memviewslice(
                int *axes_specs,
                int c_or_f_flag,
                int buf_flags,
                int ndim,
                const __Pyx_TypeInfo *dtype,
                __Pyx_BufFmt_StackElem stack[],
                __Pyx_memviewslice *memviewslice,
                PyObject *original_obj);

/* ObjectToMemviewSlice.proto */
static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_unsigned_char(PyObject *, int writable_flag);

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

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

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

/* MemviewDtypeToObject.proto */
static CYTHON_INLINE PyObject *__pyx_memview_get_unsigned_char(const char *itemp);
static CYTHON_INLINE int __pyx_memview_set_unsigned_char(char *itemp, PyObject *obj);

/* MemviewSliceCopy.proto */
static __Pyx_memviewslice
__pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
                                 const char *mode, int ndim,
                                 size_t sizeof_dtype, int contig_flag,
                                 int dtype_is_object);

/* CIntFromPy.proto */
static CYTHON_INLINE GLint __Pyx_PyLong_As_GLint(PyObject *);

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

/* CIntFromPy.proto */
static CYTHON_INLINE GLuint __Pyx_PyLong_As_GLuint(PyObject *);

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

/* CIntFromPy.proto */
static CYTHON_INLINE GLenum __Pyx_PyLong_As_GLenum(PyObject *);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_GLenum(GLenum value);

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

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_GLuint(GLuint value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_GLint(GLint value);

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

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

/* CIntFromPy.proto */
static CYTHON_INLINE GLushort __Pyx_PyLong_As_GLushort(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE GLsizei __Pyx_PyLong_As_GLsizei(PyObject *);

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

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

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

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

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

/* ObjectAsUCS4.proto */
static Py_UCS4 __Pyx__PyObject_AsPy_UCS4(PyObject*);
static CYTHON_INLINE Py_UCS4 __Pyx_PyObject_AsPy_UCS4(PyObject *x) {
    return (likely(PyUnicode_Check(x)) ? __Pyx_PyUnicode_AsPy_UCS4(x) : __Pyx__PyObject_AsPy_UCS4(x));
}

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

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

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

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

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

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

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

/* CoroutineBase.proto (used by Generator) */
struct __pyx_CoroutineObject;
typedef PyObject *(*__pyx_coroutine_body_t)(struct __pyx_CoroutineObject *, PyThreadState *, PyObject *);
#if CYTHON_USE_EXC_INFO_STACK
#define __Pyx_ExcInfoStruct  _PyErr_StackItem
#else
typedef struct {
    PyObject *exc_type;
    PyObject *exc_value;
    PyObject *exc_traceback;
} __Pyx_ExcInfoStruct;
#endif
typedef struct __pyx_CoroutineObject {
    PyObject_HEAD
    __pyx_coroutine_body_t body;
    PyObject *closure;
    __Pyx_ExcInfoStruct gi_exc_state;
#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
    PyObject *gi_weakreflist;
#endif
    PyObject *classobj;
    PyObject *yieldfrom;
    __Pyx_pyiter_sendfunc yieldfrom_am_send;
    PyObject *gi_name;
    PyObject *gi_qualname;
    PyObject *gi_modulename;
    PyObject *gi_code;
    PyObject *gi_frame;
#if CYTHON_USE_SYS_MONITORING && (CYTHON_PROFILE || CYTHON_TRACE)
    PyMonitoringState __pyx_pymonitoring_state[__Pyx_MonitoringEventTypes_CyGen_count];
    uint64_t __pyx_pymonitoring_version;
#endif
    int resume_label;
    char is_running;
} __pyx_CoroutineObject;
static __pyx_CoroutineObject *__Pyx__Coroutine_New(
    PyTypeObject *type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
    PyObject *name, PyObject *qualname, PyObject *module_name);
static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
            __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
            PyObject *name, PyObject *qualname, PyObject *module_name);
static CYTHON_INLINE void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *self);
static int __Pyx_Coroutine_clear(PyObject *self);
static __Pyx_PySendResult __Pyx_Coroutine_AmSend(PyObject *self, PyObject *value, PyObject **retval);
static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value);
static __Pyx_PySendResult __Pyx_Coroutine_Close(PyObject *self, PyObject **retval);
static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args);
#if CYTHON_USE_EXC_INFO_STACK
#define __Pyx_Coroutine_SwapException(self)
#define __Pyx_Coroutine_ResetAndClearException(self)  __Pyx_Coroutine_ExceptionClear(&(self)->gi_exc_state)
#else
#define __Pyx_Coroutine_SwapException(self) {\
    __Pyx_ExceptionSwap(&(self)->gi_exc_state.exc_type, &(self)->gi_exc_state.exc_value, &(self)->gi_exc_state.exc_traceback);\
    __Pyx_Coroutine_ResetFrameBackpointer(&(self)->gi_exc_state);\
    }
#define __Pyx_Coroutine_ResetAndClearException(self) {\
    __Pyx_ExceptionReset((self)->gi_exc_state.exc_type, (self)->gi_exc_state.exc_value, (self)->gi_exc_state.exc_traceback);\
    (self)->gi_exc_state.exc_type = (self)->gi_exc_state.exc_value = (self)->gi_exc_state.exc_traceback = NULL;\
    }
#endif
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyGen_FetchStopIterationValue(pvalue)\
    __Pyx_PyGen__FetchStopIterationValue(__pyx_tstate, pvalue)
#else
#define __Pyx_PyGen_FetchStopIterationValue(pvalue)\
    __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, pvalue)
#endif
static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *tstate, PyObject **pvalue);
static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state);
static char __Pyx_Coroutine_test_and_set_is_running(__pyx_CoroutineObject *gen);
static void __Pyx_Coroutine_unset_is_running(__pyx_CoroutineObject *gen);
static char __Pyx_Coroutine_get_is_running(__pyx_CoroutineObject *gen);
static PyObject *__Pyx_Coroutine_get_is_running_getter(PyObject *gen, void *closure);
#if __PYX_HAS_PY_AM_SEND == 2
static void __Pyx_SetBackportTypeAmSend(PyTypeObject *type, __Pyx_PyAsyncMethodsStruct *static_amsend_methods, __Pyx_pyiter_sendfunc am_send);
#endif
static PyObject *__Pyx_Coroutine_fail_reduce_ex(PyObject *self, PyObject *arg);

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

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

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

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

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

static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* proto*/
static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj); /* proto*/
static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src); /* proto*/
static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value); /* proto*/
static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto*/
static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
static PyObject *__pyx_memoryview__get_base(struct __pyx_memoryview_obj *__pyx_v_self); /* proto*/
static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
static PyObject *__pyx_memoryviewslice__get_base(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto*/
#if !CYTHON_COMPILING_IN_LIMITED_API
static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4real_real(PyComplexObject *__pyx_v_self); /* proto*/
#endif
#if !CYTHON_COMPILING_IN_LIMITED_API
static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4imag_imag(PyComplexObject *__pyx_v_self); /* proto*/
#endif
static CYTHON_INLINE __Pyx_data_union __pyx_f_7cpython_5array_5array_4data_data(arrayobject *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_8CyOpenGL_8GLobject_set_material(struct __pyx_obj_8CyOpenGL_GLobject *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_8CyOpenGL_8GLobject_display(struct __pyx_obj_8CyOpenGL_GLobject *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_8CyOpenGL_15PoincarePolygon_triangulate(struct __pyx_obj_8CyOpenGL_PoincarePolygon *__pyx_v_self); /* proto*/
static double __pyx_f_8CyOpenGL_9Colorizer_index_to_hue(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_Colorizer *__pyx_v_self, int __pyx_v_index); /* proto*/
static PyObject *__pyx_f_8CyOpenGL_9Colorizer_hls_to_rgb(struct __pyx_obj_8CyOpenGL_Colorizer *__pyx_v_self, double __pyx_v_h, double __pyx_v_l, double __pyx_v_s); /* proto*/
static PyObject *__pyx_f_8CyOpenGL_9Colorizer_hls_interp(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_Colorizer *__pyx_v_self, double __pyx_v_m1, double __pyx_v_m2, double __pyx_v_hue); /* proto*/
static PyObject *__pyx_f_8CyOpenGL_10Horosphere_build_vertices_and_normals(struct __pyx_obj_8CyOpenGL_Horosphere *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_8CyOpenGL_10Horosphere_build_triangles(struct __pyx_obj_8CyOpenGL_Horosphere *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_8CyOpenGL_13HoroballGroup_build_spheres(struct __pyx_obj_8CyOpenGL_HoroballGroup *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_8CyOpenGL_7EdgeSet_set_dark_color(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_EdgeSet *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_8CyOpenGL_7EdgeSet_set_light_color(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_EdgeSet *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_8CyOpenGL_20TriangulationEdgeSet_set_light_color(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_TriangulationEdgeSet *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_8CyOpenGL_5Label_get_shape(struct __pyx_obj_8CyOpenGL_Label *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_8CyOpenGL_13HoroballScene_build_shifts(struct __pyx_obj_8CyOpenGL_HoroballScene *__pyx_v_self, PyObject *__pyx_v_R, PyObject *__pyx_v_T); /* proto*/
static PyObject *__pyx_f_8CyOpenGL_13HoroballScene_right_top(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_HoroballScene *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_8CyOpenGL_13HoroballScene_gl_compile(struct __pyx_obj_8CyOpenGL_HoroballScene *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_8CyOpenGL_13HoroballScene_draw_segments(struct __pyx_obj_8CyOpenGL_HoroballScene *__pyx_v_self, PyObject *__pyx_v_ford_height, PyObject *__pyx_v_pgram_height); /* proto*/
static PyObject *__pyx_f_8CyOpenGL_19GLSLPerspectiveView_compute_mvp(struct __pyx_obj_8CyOpenGL_GLSLPerspectiveView *__pyx_v_self, PyObject *__pyx_v_width, PyObject *__pyx_v_height); /* proto*/
static PyObject *__pyx_f_8CyOpenGL_19GLSLPerspectiveView_translate(struct __pyx_obj_8CyOpenGL_GLSLPerspectiveView *__pyx_v_self, GLfloat __pyx_v_x, GLfloat __pyx_v_y, GLfloat __pyx_v_z, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_8CyOpenGL_19GLSLPerspectiveView_rotate(struct __pyx_obj_8CyOpenGL_GLSLPerspectiveView *__pyx_v_self, GLfloat __pyx_v_theta, GLfloat __pyx_v_x, GLfloat __pyx_v_y, GLfloat __pyx_v_z, int __pyx_skip_dispatch); /* proto*/

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

/* Module declarations from "__builtin__" */

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/* Module declarations from "__builtin__" */

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

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

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

/* Module declarations from "cython.view" */

/* Module declarations from "cython.dataclasses" */

/* Module declarations from "cython" */

/* Module declarations from "__builtin__" */

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/* Module declarations from "cpython" */

/* Module declarations from "array" */

/* Module declarations from "cpython.array" */
static CYTHON_INLINE int __pyx_f_7cpython_5array_extend_buffer(arrayobject *, char *, Py_ssize_t); /*proto*/

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

/* Module declarations from "CyOpenGL" */
static PyObject *__pyx_collections_abc_Sequence = 0;
static PyObject *generic = 0;
static PyObject *strided = 0;
static PyObject *indirect = 0;
static PyObject *contiguous = 0;
static PyObject *indirect_contiguous = 0;
static int __pyx_memoryview_thread_locks_used;
static PyThread_type_lock __pyx_memoryview_thread_locks[8];
static PyObject *__pyx_f_8CyOpenGL_cyglTranslateScene(PyObject *, PyObject *, PyObject *, PyObject *, PyObject *); /*proto*/
static PyObject *__pyx_f_8CyOpenGL_cyglRotateScene(PyObject *, PyObject *, PyObject *, PyObject *, PyObject *); /*proto*/
static GLfloat *__pyx_f_8CyOpenGL__convert_matrices_to_floats(PyObject *, PyObject *, PyObject *, PyObject *); /*proto*/
static PyObject *__pyx_f_8CyOpenGL__compile_shader(GLuint, PyObject *, PyObject *); /*proto*/
static PyObject *__pyx_f_8CyOpenGL__link_program(GLuint, PyObject *); /*proto*/
static PyObject *__pyx_f_8CyOpenGL_mat4_multiply(GLfloat *, GLfloat *, GLfloat *); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_8CyOpenGL_mat4_set_to_identity(GLfloat *); /*proto*/
static int __Pyx_carray_from_py_GLfloat(PyObject *, GLfloat *, Py_ssize_t); /*proto*/
static CYTHON_INLINE PyObject *__Pyx_carray_to_py_GLfloat(GLfloat *, Py_ssize_t); /*proto*/
static CYTHON_INLINE PyObject *__Pyx_carray_to_tuple_GLfloat(GLfloat *, Py_ssize_t); /*proto*/
static int __pyx_array_allocate_buffer(struct __pyx_array_obj *); /*proto*/
static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char const *, char *); /*proto*/
static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo const *); /*proto*/
static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/
static PyObject *_unellipsify(PyObject *, int); /*proto*/
static int assert_direct_dimensions(Py_ssize_t *, int); /*proto*/
static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/
static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/
static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/
static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), int (*)(char *, PyObject *), int); /*proto*/
static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/
static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/
static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/
static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/
static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/
static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/
static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/
static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/
static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/
static int __pyx_memoryview_err_dim(PyObject *, PyObject *, int); /*proto*/
static int __pyx_memoryview_err(PyObject *, PyObject *); /*proto*/
static int __pyx_memoryview_err_no_memory(void); /*proto*/
static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/
static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/
static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/
static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/
static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/
static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *, PyObject *); /*proto*/
/* #### Code section: typeinfo ### */
static const __Pyx_TypeInfo __Pyx_TypeInfo_unsigned_char = { "unsigned char", NULL, sizeof(unsigned char), { 0 }, 0, __PYX_IS_UNSIGNED(unsigned char) ? 'U' : 'I', __PYX_IS_UNSIGNED(unsigned char), 0 };
/* #### Code section: before_global_var ### */
#define __Pyx_MODULE_NAME "CyOpenGL"
extern int __pyx_module_is_main_CyOpenGL;
int __pyx_module_is_main_CyOpenGL = 0;

/* Implementation of "CyOpenGL" */
/* #### Code section: global_var ### */
static PyObject *__pyx_builtin_print;
static PyObject *__pyx_builtin_zip;
static PyObject *__pyx_builtin_sum;
static PyObject *__pyx_builtin_round;
static PyObject *__pyx_builtin_super;
static PyObject *__pyx_builtin_enumerate;
static PyObject *__pyx_builtin___import__;
static PyObject *__pyx_builtin_Ellipsis;
static PyObject *__pyx_builtin_id;
/* #### Code section: string_decls ### */
static const char __pyx_k_c[] = "c";
static const char __pyx_k_name[] = "name";
static const char __pyx_k_fortran[] = "fortran";
static const char __pyx_k_not_enough_values_found_during_a[] = "not enough values found during array assignment, expected %zd, got %zd";
static const char __pyx_k_too_many_values_found_during_arr[] = "too many values found during array assignment, expected %zd";
/* #### Code section: decls ### */
static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer); /* proto */
static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */
static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object); /* proto */
static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */
static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_get_gl_string(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_string); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_2clear_gl_errors(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_4print_gl_errors(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_msg); /* proto */
static int __pyx_pf_8CyOpenGL_7vector3___cinit__(struct __pyx_obj_8CyOpenGL_vector3 *__pyx_v_self, PyObject *__pyx_v_triple); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_7vector3_2__repr__(struct __pyx_obj_8CyOpenGL_vector3 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_7vector3_4__add__(struct __pyx_obj_8CyOpenGL_vector3 *__pyx_v_self, PyObject *__pyx_v_vector); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_7vector3_6__sub__(struct __pyx_obj_8CyOpenGL_vector3 *__pyx_v_self, PyObject *__pyx_v_vector); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_7vector3_8__mul__(struct __pyx_obj_8CyOpenGL_vector3 *__pyx_v_self, PyObject *__pyx_v_scalar); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_7vector3_10__div__(struct __pyx_obj_8CyOpenGL_vector3 *__pyx_v_self, PyObject *__pyx_v_scalar); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_7vector3_12__truediv__(struct __pyx_obj_8CyOpenGL_vector3 *__pyx_v_self, PyObject *__pyx_v_scalar); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_7vector3_1x___get__(struct __pyx_obj_8CyOpenGL_vector3 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_7vector3_1y___get__(struct __pyx_obj_8CyOpenGL_vector3 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_7vector3_1z___get__(struct __pyx_obj_8CyOpenGL_vector3 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_7vector3_12norm_squared___get__(struct __pyx_obj_8CyOpenGL_vector3 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_7vector3_4norm___get__(struct __pyx_obj_8CyOpenGL_vector3 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_6cyglSetStandardLighting(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static int __pyx_pf_8CyOpenGL_8GLobject___cinit__(struct __pyx_obj_8CyOpenGL_GLobject *__pyx_v_self, PyObject *__pyx_v_color, PyObject *__pyx_v_front_specular, PyObject *__pyx_v_back_specular, PyObject *__pyx_v_front_shininess, PyObject *__pyx_v_back_shininess, CYTHON_UNUSED PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_8GLobject_2delete_resource(struct __pyx_obj_8CyOpenGL_GLobject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_8GLobject_4draw(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_GLobject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_8GLobject_6build_display_list(struct __pyx_obj_8CyOpenGL_GLobject *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_8GLobject_8display(struct __pyx_obj_8CyOpenGL_GLobject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_15WireframeSphere_4draw_draw_point(PyObject *__pyx_self, PyObject *__pyx_v_phi, PyObject *__pyx_v_theta); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_15WireframeSphere_draw(struct __pyx_obj_8CyOpenGL_WireframeSphere *__pyx_v_self, GLfloat __pyx_v_radius, GLint __pyx_v_slices, GLint __pyx_v_stacks); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_12TriangleMesh___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_vertices); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_12TriangleMesh_2__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_12TriangleMesh_4__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_n); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_12TriangleMesh_6subdivide(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static void __pyx_pf_8CyOpenGL_13MeshedSurface___dealloc__(struct __pyx_obj_8CyOpenGL_MeshedSurface *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_13MeshedSurface_2build_arrays(struct __pyx_obj_8CyOpenGL_MeshedSurface *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_13MeshedSurface_4draw(struct __pyx_obj_8CyOpenGL_MeshedSurface *__pyx_v_self, PyObject *__pyx_v_use_material); /* proto */
static int __pyx_pf_8CyOpenGL_16PoincareTriangle___init__(struct __pyx_obj_8CyOpenGL_PoincareTriangle *__pyx_v_self, PyObject *__pyx_v_vertices, PyObject *__pyx_v_center, PyObject *__pyx_v_subdivision_depth, CYTHON_UNUSED PyObject *__pyx_v_kwargs); /* proto */
static int __pyx_pf_8CyOpenGL_15PoincarePolygon___init__(struct __pyx_obj_8CyOpenGL_PoincarePolygon *__pyx_v_self, PyObject *__pyx_v_vertices, PyObject *__pyx_v_center, CYTHON_UNUSED PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_15PoincarePolygon_2draw(struct __pyx_obj_8CyOpenGL_PoincarePolygon *__pyx_v_self); /* proto */
static int __pyx_pf_8CyOpenGL_12KleinPolygon___init__(struct __pyx_obj_8CyOpenGL_KleinPolygon *__pyx_v_self, PyObject *__pyx_v_vertices, PyObject *__pyx_v_closest, CYTHON_UNUSED PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_12KleinPolygon_2draw(struct __pyx_obj_8CyOpenGL_KleinPolygon *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_20HyperbolicPolyhedron___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_facedicts, PyObject *__pyx_v_model_var, PyObject *__pyx_v_sphere_var, PyObject *__pyx_v_togl_widget); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_20HyperbolicPolyhedron_2draw(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_args); /* proto */
static int __pyx_pf_8CyOpenGL_9Colorizer___cinit__(struct __pyx_obj_8CyOpenGL_Colorizer *__pyx_v_self); /* proto */
static int __pyx_pf_8CyOpenGL_9Colorizer_2__init__(struct __pyx_obj_8CyOpenGL_Colorizer *__pyx_v_self, PyObject *__pyx_v_lightness, PyObject *__pyx_v_saturation, PyObject *__pyx_v_alpha); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_9Colorizer_4__call__(struct __pyx_obj_8CyOpenGL_Colorizer *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
static int __pyx_pf_8CyOpenGL_10Horosphere___init__(struct __pyx_obj_8CyOpenGL_Horosphere *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_color, PyObject *__pyx_v_radius, CYTHON_UNUSED PyObject *__pyx_v_front_specular, CYTHON_UNUSED PyObject *__pyx_v_back_specular, CYTHON_UNUSED PyObject *__pyx_v_front_shininess, CYTHON_UNUSED PyObject *__pyx_v_back_shininess); /* proto */
static int __pyx_pf_8CyOpenGL_13HoroballGroup___init__(struct __pyx_obj_8CyOpenGL_HoroballGroup *__pyx_v_self, PyObject *__pyx_v_horoballs, PyObject *__pyx_v_indices, PyObject *__pyx_v_meridian, PyObject *__pyx_v_longitude); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_13HoroballGroup_2draw(struct __pyx_obj_8CyOpenGL_HoroballGroup *__pyx_v_self, PyObject *__pyx_v_R, PyObject *__pyx_v_T); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_13Parallelogram_draw(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_Parallelogram *__pyx_v_self, PyObject *__pyx_v_s1, PyObject *__pyx_v_s2); /* proto */
static int __pyx_pf_8CyOpenGL_7EdgeSet___init__(struct __pyx_obj_8CyOpenGL_EdgeSet *__pyx_v_self, PyObject *__pyx_v_segments, PyObject *__pyx_v_longitude, PyObject *__pyx_v_meridian, CYTHON_UNUSED PyObject *__pyx_v_togl_widget); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_7EdgeSet_2draw(struct __pyx_obj_8CyOpenGL_EdgeSet *__pyx_v_self, PyObject *__pyx_v_shifts, PyObject *__pyx_v_dark); /* proto */
static int __pyx_pf_8CyOpenGL_20TriangulationEdgeSet___init__(struct __pyx_obj_8CyOpenGL_TriangulationEdgeSet *__pyx_v_self, PyObject *__pyx_v_triangulation, PyObject *__pyx_v_longitude, PyObject *__pyx_v_meridian, CYTHON_UNUSED PyObject *__pyx_v_togl_widget); /* proto */
static int __pyx_pf_8CyOpenGL_5Label___init__(struct __pyx_obj_8CyOpenGL_Label *__pyx_v_self, PyObject *__pyx_v_position, PyObject *__pyx_v_int_label); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_5Label_2draw(struct __pyx_obj_8CyOpenGL_Label *__pyx_v_self); /* proto */
static int __pyx_pf_8CyOpenGL_8LabelSet___init__(struct __pyx_obj_8CyOpenGL_LabelSet *__pyx_v_self, PyObject *__pyx_v_triangulation, PyObject *__pyx_v_longitude, PyObject *__pyx_v_meridian, CYTHON_UNUSED PyObject *__pyx_v_togl_widget); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_8LabelSet_2draw(struct __pyx_obj_8CyOpenGL_LabelSet *__pyx_v_self, PyObject *__pyx_v_shifts); /* proto */
static int __pyx_pf_8CyOpenGL_13HoroballScene___init__(struct __pyx_obj_8CyOpenGL_HoroballScene *__pyx_v_self, PyObject *__pyx_v_nbhd, PyObject *__pyx_v_pgram_var, PyObject *__pyx_v_Ford_var, PyObject *__pyx_v_tri_var, PyObject *__pyx_v_horo_var, PyObject *__pyx_v_label_var, PyObject *__pyx_v_flipped, PyObject *__pyx_v_cutoff, PyObject *__pyx_v_which_cusp, PyObject *__pyx_v_togl_widget); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_13HoroballScene_2set_cutoff(struct __pyx_obj_8CyOpenGL_HoroballScene *__pyx_v_self, PyObject *__pyx_v_cutoff); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_13HoroballScene_4flip(struct __pyx_obj_8CyOpenGL_HoroballScene *__pyx_v_self, PyObject *__pyx_v_boolean_value); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_13HoroballScene_11build_scene_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_13HoroballScene_6build_scene(struct __pyx_obj_8CyOpenGL_HoroballScene *__pyx_v_self, PyObject *__pyx_v_which_cusp, PyObject *__pyx_v_full_list); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_13HoroballScene_8delete_resource(struct __pyx_obj_8CyOpenGL_HoroballScene *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_13HoroballScene_10translate(struct __pyx_obj_8CyOpenGL_HoroballScene *__pyx_v_self, PyObject *__pyx_v_z); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_13HoroballScene_12draw(struct __pyx_obj_8CyOpenGL_HoroballScene *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_args); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_8__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_15RawOpenGLWidget___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_parent, PyObject *__pyx_v_cnf, PyObject *__pyx_v_kw); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_15RawOpenGLWidget_2make_current(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_15RawOpenGLWidget_4redraw(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_15RawOpenGLWidget_6draw(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_15RawOpenGLWidget_8save_image_window_resolution(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_outfile); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_10__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_23OpenGLPerspectiveWidget___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_master, PyObject *__pyx_v_help, PyObject *__pyx_v_mouse_pick, PyObject *__pyx_v_mouse_rotate, PyObject *__pyx_v_mouse_translate, PyObject *__pyx_v_mouse_scale, PyObject *__pyx_v_fovy, PyObject *__pyx_v_near, PyObject *__pyx_v_far, PyObject *__pyx_v_cnf, PyObject *__pyx_v_kw); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_23OpenGLPerspectiveWidget_2help(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_23OpenGLPerspectiveWidget_4set_background(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_r, PyObject *__pyx_v_g, PyObject *__pyx_v_b); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_23OpenGLPerspectiveWidget_6set_centerpoint(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_z); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_23OpenGLPerspectiveWidget_8set_eyepoint(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_distance); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_23OpenGLPerspectiveWidget_10reset(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_redraw); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_23OpenGLPerspectiveWidget_12tkHandlePick(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_event); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_23OpenGLPerspectiveWidget_14tkRecordMouse(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_event); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_23OpenGLPerspectiveWidget_16StartRotate(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_event); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_23OpenGLPerspectiveWidget_18tkScale(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_event); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_23OpenGLPerspectiveWidget_20zoom(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_23OpenGLPerspectiveWidget_22do_AutoSpin(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_23OpenGLPerspectiveWidget_24tkAutoSpin(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_event); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_23OpenGLPerspectiveWidget_26tkRotate(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_event); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_23OpenGLPerspectiveWidget_28tkTranslate(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_event); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_23OpenGLPerspectiveWidget_30mouse_update(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_event); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_23OpenGLPerspectiveWidget_32draw_impl(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_width, PyObject *__pyx_v_height); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_23OpenGLPerspectiveWidget_34draw_projection_impl(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_23OpenGLPerspectiveWidget_36build_projection(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_width, PyObject *__pyx_v_height); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_23OpenGLPerspectiveWidget_38tkKeyPress(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_event); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_23OpenGLPerspectiveWidget_40tkPrint(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_file); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_17OpenGLOrthoWidget_build_projection(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_width, PyObject *__pyx_v_height, CYTHON_UNUSED PyObject *__pyx_v_t); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_17OpenGLOrthoWidget_2tkTranslate(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_event); /* proto */
static int __pyx_pf_8CyOpenGL_16DataBasedTexture___cinit__(struct __pyx_obj_8CyOpenGL_DataBasedTexture *__pyx_v_self); /* proto */
static int __pyx_pf_8CyOpenGL_16DataBasedTexture_2__init__(struct __pyx_obj_8CyOpenGL_DataBasedTexture *__pyx_v_self, unsigned int __pyx_v_width, unsigned int __pyx_v_height, __Pyx_memviewslice __pyx_v_rgba_data); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_16DataBasedTexture_4bind(struct __pyx_obj_8CyOpenGL_DataBasedTexture *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_16DataBasedTexture_6unbind(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_DataBasedTexture *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_16DataBasedTexture_8delete_resource(struct __pyx_obj_8CyOpenGL_DataBasedTexture *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_17ImageBasedTexture___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_texture_file); /* proto */
static int __pyx_pf_8CyOpenGL_19UniformBufferObject___init__(struct __pyx_obj_8CyOpenGL_UniformBufferObject *__pyx_v_self, PyObject *__pyx_v_buffer_size, PyObject *__pyx_v_name_to_offset); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_19UniformBufferObject_2set(struct __pyx_obj_8CyOpenGL_UniformBufferObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_uniform_type, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_19UniformBufferObject_4commit(struct __pyx_obj_8CyOpenGL_UniformBufferObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_19UniformBufferObject_6bind_block(struct __pyx_obj_8CyOpenGL_UniformBufferObject *__pyx_v_self, GLuint __pyx_v_binding_point); /* proto */
static void __pyx_pf_8CyOpenGL_19UniformBufferObject_8__dealloc__(struct __pyx_obj_8CyOpenGL_UniformBufferObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_19UniformBufferObject_10delete_resource(struct __pyx_obj_8CyOpenGL_UniformBufferObject *__pyx_v_self); /* proto */
static int __pyx_pf_8CyOpenGL_11GLSLProgram___init__(struct __pyx_obj_8CyOpenGL_GLSLProgram *__pyx_v_self, PyObject *__pyx_v_vertex_shader_source, PyObject *__pyx_v_fragment_shader_source, PyObject *__pyx_v_uniform_block_names_sizes_and_offsets, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_11GLSLProgram_2_compile_and_link(struct __pyx_obj_8CyOpenGL_GLSLProgram *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_11GLSLProgram_4is_valid(struct __pyx_obj_8CyOpenGL_GLSLProgram *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_11GLSLProgram_6bind_uniforms(struct __pyx_obj_8CyOpenGL_GLSLProgram *__pyx_v_self, PyObject *__pyx_v_name_to_type_and_value); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_11GLSLProgram_8use_program(struct __pyx_obj_8CyOpenGL_GLSLProgram *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_11GLSLProgram_10delete_resource(struct __pyx_obj_8CyOpenGL_GLSLProgram *__pyx_v_self); /* proto */
static int __pyx_pf_8CyOpenGL_12VertexBuffer___cinit__(struct __pyx_obj_8CyOpenGL_VertexBuffer *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_12VertexBuffer_2bind(struct __pyx_obj_8CyOpenGL_VertexBuffer *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_12VertexBuffer_4load(struct __pyx_obj_8CyOpenGL_VertexBuffer *__pyx_v_self, PyObject *__pyx_v_vertex_data); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_12VertexBuffer_6delete_resource(struct __pyx_obj_8CyOpenGL_VertexBuffer *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_23SimpleImageShaderWidget___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_parent, PyObject *__pyx_v_kw); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_23SimpleImageShaderWidget_2set_textures(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_texture_files); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_12__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_23SimpleImageShaderWidget_4set_fragment_shader_source(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_source, PyObject *__pyx_v_uniform_block_names_sizes_and_offsets); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_23SimpleImageShaderWidget_6render_to_array(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_width, PyObject *__pyx_v_height, PyObject *__pyx_v_as_float); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_23SimpleImageShaderWidget_8save_image(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_width, PyObject *__pyx_v_height, PyObject *__pyx_v_outfile); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_23SimpleImageShaderWidget_10read_depth_value(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_23SimpleImageShaderWidget_12draw_impl(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_width, PyObject *__pyx_v_height, PyObject *__pyx_v_include_depth_value); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_23SimpleImageShaderWidget_14draw(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_23SimpleImageShaderWidget_16get_uniform_bindings(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_view_width, PyObject *__pyx_v_view_height); /* proto */
static int __pyx_pf_8CyOpenGL_19GLSLPerspectiveView___cinit__(struct __pyx_obj_8CyOpenGL_GLSLPerspectiveView *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_19GLSLPerspectiveView_12vertical_fov___get__(struct __pyx_obj_8CyOpenGL_GLSLPerspectiveView *__pyx_v_self); /* proto */
static int __pyx_pf_8CyOpenGL_19GLSLPerspectiveView_12vertical_fov_2__set__(struct __pyx_obj_8CyOpenGL_GLSLPerspectiveView *__pyx_v_self, GLfloat __pyx_v_value); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_19GLSLPerspectiveView_4near___get__(struct __pyx_obj_8CyOpenGL_GLSLPerspectiveView *__pyx_v_self); /* proto */
static int __pyx_pf_8CyOpenGL_19GLSLPerspectiveView_4near_2__set__(struct __pyx_obj_8CyOpenGL_GLSLPerspectiveView *__pyx_v_self, GLfloat __pyx_v_value); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_19GLSLPerspectiveView_3far___get__(struct __pyx_obj_8CyOpenGL_GLSLPerspectiveView *__pyx_v_self); /* proto */
static int __pyx_pf_8CyOpenGL_19GLSLPerspectiveView_3far_2__set__(struct __pyx_obj_8CyOpenGL_GLSLPerspectiveView *__pyx_v_self, GLfloat __pyx_v_value); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_19GLSLPerspectiveView_8distance___get__(struct __pyx_obj_8CyOpenGL_GLSLPerspectiveView *__pyx_v_self); /* proto */
static int __pyx_pf_8CyOpenGL_19GLSLPerspectiveView_8distance_2__set__(struct __pyx_obj_8CyOpenGL_GLSLPerspectiveView *__pyx_v_self, GLfloat __pyx_v_value); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_19GLSLPerspectiveView_6center___get__(struct __pyx_obj_8CyOpenGL_GLSLPerspectiveView *__pyx_v_self); /* proto */
static int __pyx_pf_8CyOpenGL_19GLSLPerspectiveView_6center_2__set__(struct __pyx_obj_8CyOpenGL_GLSLPerspectiveView *__pyx_v_self, PyObject *__pyx_v_vector); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_19GLSLPerspectiveView_2translate(struct __pyx_obj_8CyOpenGL_GLSLPerspectiveView *__pyx_v_self, GLfloat __pyx_v_x, GLfloat __pyx_v_y, GLfloat __pyx_v_z); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_19GLSLPerspectiveView_4rotate(struct __pyx_obj_8CyOpenGL_GLSLPerspectiveView *__pyx_v_self, GLfloat __pyx_v_theta, GLfloat __pyx_v_x, GLfloat __pyx_v_y, GLfloat __pyx_v_z); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_19GLSLPerspectiveView_20get_uniform_bindings_to_py(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_m); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_19GLSLPerspectiveView_6get_uniform_bindings(struct __pyx_obj_8CyOpenGL_GLSLPerspectiveView *__pyx_v_self, PyObject *__pyx_v_view_width, PyObject *__pyx_v_view_height); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_14__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_21GLSLPerspectiveWidget___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_master, CYTHON_UNUSED PyObject *__pyx_v_cnf, PyObject *__pyx_v_kw); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_21GLSLPerspectiveWidget_2add_object(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_21GLSLPerspectiveWidget_4redraw(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_width, PyObject *__pyx_v_height, PyObject *__pyx_v_skip_swap_buffers); /* proto */
static int __pyx_pf_8CyOpenGL_8Triangle___init__(struct __pyx_obj_8CyOpenGL_Triangle *__pyx_v_self, PyObject *__pyx_v_gl_widget, PyObject *__pyx_v_program, PyObject *__pyx_v_vertices); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_8Triangle_2draw(struct __pyx_obj_8CyOpenGL_Triangle *__pyx_v_self, PyObject *__pyx_v_view_width, PyObject *__pyx_v_view_height); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_8Triangle_4delete_resource(struct __pyx_obj_8CyOpenGL_Triangle *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_8Triangle_6get_uniform_bindings(struct __pyx_obj_8CyOpenGL_Triangle *__pyx_v_self, PyObject *__pyx_v_view_width, PyObject *__pyx_v_view_height); /* proto */
static PyObject *__pyx_tp_new_8CyOpenGL_vector3(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8CyOpenGL_GLobject(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8CyOpenGL_WireframeSphere(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8CyOpenGL_MeshedSurface(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8CyOpenGL_PoincareTriangle(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8CyOpenGL_PoincarePolygon(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8CyOpenGL_KleinPolygon(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8CyOpenGL_Colorizer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8CyOpenGL_Horosphere(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8CyOpenGL_HoroballGroup(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8CyOpenGL_Parallelogram(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8CyOpenGL_EdgeSet(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8CyOpenGL_FordEdgeSet(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8CyOpenGL_TriangulationEdgeSet(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8CyOpenGL_Label(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8CyOpenGL_LabelSet(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8CyOpenGL_HoroballScene(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8CyOpenGL_DataBasedTexture(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8CyOpenGL_UniformBufferObject(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8CyOpenGL_GLSLProgram(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8CyOpenGL_VertexBuffer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8CyOpenGL_GLSLPerspectiveView(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8CyOpenGL_Triangle(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8CyOpenGL___pyx_defaults(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8CyOpenGL___pyx_scope_struct__draw(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8CyOpenGL___pyx_scope_struct_1_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
/* #### Code section: late_includes ### */
/* #### Code section: module_state ### */
/* SmallCodeConfig */
#ifndef CYTHON_SMALL_CODE
#if defined(__clang__)
    #define CYTHON_SMALL_CODE
#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
    #define CYTHON_SMALL_CODE __attribute__((cold))
#else
    #define CYTHON_SMALL_CODE
#endif
#endif

typedef struct {
  PyObject *__pyx_d;
  PyObject *__pyx_b;
  PyObject *__pyx_cython_runtime;
  PyObject *__pyx_empty_tuple;
  PyObject *__pyx_empty_bytes;
  PyObject *__pyx_empty_unicode;
  PyTypeObject *__pyx_ptype_7cpython_4type_type;
  PyTypeObject *__pyx_ptype_7cpython_4bool_bool;
  PyTypeObject *__pyx_ptype_7cpython_7complex_complex;
  PyTypeObject *__pyx_ptype_7cpython_5array_array;
  PyObject *__pyx_type_8CyOpenGL_vector3;
  PyObject *__pyx_type_8CyOpenGL_GLobject;
  PyObject *__pyx_type_8CyOpenGL_WireframeSphere;
  PyObject *__pyx_type_8CyOpenGL_MeshedSurface;
  PyObject *__pyx_type_8CyOpenGL_PoincareTriangle;
  PyObject *__pyx_type_8CyOpenGL_PoincarePolygon;
  PyObject *__pyx_type_8CyOpenGL_KleinPolygon;
  PyObject *__pyx_type_8CyOpenGL_Colorizer;
  PyObject *__pyx_type_8CyOpenGL_Horosphere;
  PyObject *__pyx_type_8CyOpenGL_HoroballGroup;
  PyObject *__pyx_type_8CyOpenGL_Parallelogram;
  PyObject *__pyx_type_8CyOpenGL_EdgeSet;
  PyObject *__pyx_type_8CyOpenGL_FordEdgeSet;
  PyObject *__pyx_type_8CyOpenGL_TriangulationEdgeSet;
  PyObject *__pyx_type_8CyOpenGL_Label;
  PyObject *__pyx_type_8CyOpenGL_LabelSet;
  PyObject *__pyx_type_8CyOpenGL_HoroballScene;
  PyObject *__pyx_type_8CyOpenGL_DataBasedTexture;
  PyObject *__pyx_type_8CyOpenGL_UniformBufferObject;
  PyObject *__pyx_type_8CyOpenGL_GLSLProgram;
  PyObject *__pyx_type_8CyOpenGL_VertexBuffer;
  PyObject *__pyx_type_8CyOpenGL_GLSLPerspectiveView;
  PyObject *__pyx_type_8CyOpenGL_Triangle;
  PyObject *__pyx_type_8CyOpenGL___pyx_defaults;
  PyObject *__pyx_type_8CyOpenGL___pyx_scope_struct__draw;
  PyObject *__pyx_type_8CyOpenGL___pyx_scope_struct_1_genexpr;
  PyObject *__pyx_type___pyx_array;
  PyObject *__pyx_type___pyx_MemviewEnum;
  PyObject *__pyx_type___pyx_memoryview;
  PyObject *__pyx_type___pyx_memoryviewslice;
  PyTypeObject *__pyx_ptype_8CyOpenGL_vector3;
  PyTypeObject *__pyx_ptype_8CyOpenGL_GLobject;
  PyTypeObject *__pyx_ptype_8CyOpenGL_WireframeSphere;
  PyTypeObject *__pyx_ptype_8CyOpenGL_MeshedSurface;
  PyTypeObject *__pyx_ptype_8CyOpenGL_PoincareTriangle;
  PyTypeObject *__pyx_ptype_8CyOpenGL_PoincarePolygon;
  PyTypeObject *__pyx_ptype_8CyOpenGL_KleinPolygon;
  PyTypeObject *__pyx_ptype_8CyOpenGL_Colorizer;
  PyTypeObject *__pyx_ptype_8CyOpenGL_Horosphere;
  PyTypeObject *__pyx_ptype_8CyOpenGL_HoroballGroup;
  PyTypeObject *__pyx_ptype_8CyOpenGL_Parallelogram;
  PyTypeObject *__pyx_ptype_8CyOpenGL_EdgeSet;
  PyTypeObject *__pyx_ptype_8CyOpenGL_FordEdgeSet;
  PyTypeObject *__pyx_ptype_8CyOpenGL_TriangulationEdgeSet;
  PyTypeObject *__pyx_ptype_8CyOpenGL_Label;
  PyTypeObject *__pyx_ptype_8CyOpenGL_LabelSet;
  PyTypeObject *__pyx_ptype_8CyOpenGL_HoroballScene;
  PyTypeObject *__pyx_ptype_8CyOpenGL_DataBasedTexture;
  PyTypeObject *__pyx_ptype_8CyOpenGL_UniformBufferObject;
  PyTypeObject *__pyx_ptype_8CyOpenGL_GLSLProgram;
  PyTypeObject *__pyx_ptype_8CyOpenGL_VertexBuffer;
  PyTypeObject *__pyx_ptype_8CyOpenGL_GLSLPerspectiveView;
  PyTypeObject *__pyx_ptype_8CyOpenGL_Triangle;
  PyTypeObject *__pyx_ptype_8CyOpenGL___pyx_defaults;
  PyTypeObject *__pyx_ptype_8CyOpenGL___pyx_scope_struct__draw;
  PyTypeObject *__pyx_ptype_8CyOpenGL___pyx_scope_struct_1_genexpr;
  PyTypeObject *__pyx_array_type;
  PyTypeObject *__pyx_MemviewEnum_type;
  PyTypeObject *__pyx_memoryview_type;
  PyTypeObject *__pyx_memoryviewslice_type;
  __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_get;
  __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_items;
  __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_keys;
  __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_pop;
  __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_values;
  PyObject *__pyx_k__9;
  PyObject *__pyx_k__10;
  PyObject *__pyx_k__11;
  PyObject *__pyx_k__12;
  PyObject *__pyx_k__13;
  PyObject *__pyx_k__14;
  PyObject *__pyx_k__15;
  PyObject *__pyx_slice[1];
  PyObject *__pyx_tuple[17];
  PyObject *__pyx_codeobj_tab[96];
  PyObject *__pyx_string_tab[829];
  PyObject *__pyx_number_tab[36];
/* #### Code section: module_state_contents ### */
/* CommonTypesMetaclass.module_state_decls */
PyTypeObject *__pyx_CommonTypesMetaclassType;

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

/* CythonFunctionShared.module_state_decls */
PyTypeObject *__pyx_CyFunctionType;


#if CYTHON_USE_FREELISTS
struct __pyx_obj_8CyOpenGL___pyx_scope_struct__draw *__pyx_freelist_8CyOpenGL___pyx_scope_struct__draw[8];
int __pyx_freecount_8CyOpenGL___pyx_scope_struct__draw;
#endif

#if CYTHON_USE_FREELISTS
struct __pyx_obj_8CyOpenGL___pyx_scope_struct_1_genexpr *__pyx_freelist_8CyOpenGL___pyx_scope_struct_1_genexpr[8];
int __pyx_freecount_8CyOpenGL___pyx_scope_struct_1_genexpr;
#endif
/* CodeObjectCache.module_state_decls */
struct __Pyx_CodeObjectCache __pyx_code_cache;

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

/* Generator.module_state_decls */
PyTypeObject *__pyx_GeneratorType;

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

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

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

#define __pyx_m (__Pyx_State_FindModule(&__pyx_moduledef))
#else
static __pyx_mstatetype __pyx_mstate_global_static =
#ifdef __cplusplus
    {};
#else
    {0};
#endif
static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_static;
#endif
/* #### Code section: constant_name_defines ### */
#define __pyx_kp_u_ __pyx_string_tab[0]
#define __pyx_kp_u_3_2 __pyx_string_tab[1]
#define __pyx_kp_u_A_hyperbolic_polyhedron_for_dis __pyx_string_tab[2]
#define __pyx_kp_u_A_triangle_which_can_tessellate __pyx_string_tab[3]
#define __pyx_kp_u_A_version_of_the_widget_that_us __pyx_string_tab[4]
#define __pyx_kp_u_A_widget_which_renders_a_collec __pyx_string_tab[5]
#define __pyx_kp_u_An_image_shader_is_a_GLSL_progr __pyx_string_tab[6]
#define __pyx_kp_u_B1_Motion __pyx_string_tab[7]
#define __pyx_kp_u_B2_Motion __pyx_string_tab[8]
#define __pyx_kp_u_B3_Motion __pyx_string_tab[9]
#define __pyx_kp_u_Buffer_view_does_not_expose_stri __pyx_string_tab[10]
#define __pyx_kp_u_ButtonRelease_1 __pyx_string_tab[11]
#define __pyx_kp_u_ButtonRelease_3 __pyx_string_tab[12]
#define __pyx_kp_u_Button_1 __pyx_string_tab[13]
#define __pyx_kp_u_Button_2 __pyx_string_tab[14]
#define __pyx_kp_u_Button_3 __pyx_string_tab[15]
#define __pyx_kp_u_Can_only_create_a_buffer_that_is __pyx_string_tab[16]
#define __pyx_kp_u_Cannot_assign_to_read_only_memor __pyx_string_tab[17]
#define __pyx_kp_u_Cannot_create_writable_memory_vi __pyx_string_tab[18]
#define __pyx_kp_u_Cannot_index_with_type __pyx_string_tab[19]
#define __pyx_kp_u_Cannot_transpose_memoryview_with __pyx_string_tab[20]
#define __pyx_kp_u_Compiling __pyx_string_tab[21]
#define __pyx_kp_u_Control_Button_1 __pyx_string_tab[22]
#define __pyx_kp_u_Control_Button_1_ButtonRelease __pyx_string_tab[23]
#define __pyx_kp_u_Create_an_OpenGL_widget_with_a __pyx_string_tab[24]
#define __pyx_kp_u_Data_for __pyx_string_tab[25]
#define __pyx_kp_u_Dimension_d_is_not_direct __pyx_string_tab[26]
#define __pyx_kp_u_Empty_shape_tuple_for_cython_arr __pyx_string_tab[27]
#define __pyx_kp_u_Error __pyx_string_tab[28]
#define __pyx_kp_u_GLSLProgram___init __pyx_string_tab[29]
#define __pyx_kp_u_GLSL_1_50_s __pyx_string_tab[30]
#define __pyx_kp_u_GL_ENUM_0x_x __pyx_string_tab[31]
#define __pyx_kp_u_GL_strings_not_available_is_ther __pyx_string_tab[32]
#define __pyx_kp_u_Incomplete_framebuffer __pyx_string_tab[33]
#define __pyx_kp_u_Indirect_dimensions_not_supporte __pyx_string_tab[34]
#define __pyx_kp_u_Invalid_GL_string_Must_be_one_of __pyx_string_tab[35]
#define __pyx_kp_u_Invalid_mode_expected_c_or_fortr __pyx_string_tab[36]
#define __pyx_kp_u_Invalid_shape_in_axis __pyx_string_tab[37]
#define __pyx_kp_u_KeyPress __pyx_string_tab[38]
#define __pyx_kp_u_Length_of_rgba_data_not_matching __pyx_string_tab[39]
#define __pyx_kp_u_Linking_GLSL_program_s_failed __pyx_string_tab[40]
#define __pyx_kp_u_MemoryView_of __pyx_string_tab[41]
#define __pyx_kp_u_Missing_gl_function __pyx_string_tab[42]
#define __pyx_kp_u_Most_likely_causes __pyx_string_tab[43]
#define __pyx_kp_u_No_help_is_available __pyx_string_tab[44]
#define __pyx_kp_u_Note_that_Cython_is_deliberately __pyx_string_tab[45]
#define __pyx_kp_u_OpenGL_3_2_s __pyx_string_tab[46]
#define __pyx_kp_u_Out_of_bounds_on_buffer_access_a __pyx_string_tab[47]
#define __pyx_kp_u_Render_to_off_screen_area __pyx_string_tab[48]
#define __pyx_kp_u_Required_version_Your_version __pyx_string_tab[49]
#define __pyx_kp_u_Shift_B1_Motion __pyx_string_tab[50]
#define __pyx_kp_u_Shift_Button_1 __pyx_string_tab[51]
#define __pyx_kp_u_Sorry_this_implementation_was_re __pyx_string_tab[52]
#define __pyx_kp_u_The_triangulation_has_too_many __pyx_string_tab[53]
#define __pyx_kp_u_Unable_to_convert_item_to_object __pyx_string_tab[54]
#define __pyx_kp_u_UniformBufferObject___init __pyx_string_tab[55]
#define __pyx_kp_u_Unsupported_uniform_type __pyx_string_tab[56]
#define __pyx_kp_u_Unsupported_uniform_type_s __pyx_string_tab[57]
#define __pyx_kp_u_Viewer_Help __pyx_string_tab[58]
#define __pyx_kp_u_Warning_could_not_read_texture_s __pyx_string_tab[59]
#define __pyx_kp_u_Widget_with_an_OpenGL_context_a __pyx_string_tab[60]
#define __pyx_kp_u_Your_graphics_card_does_not_sup __pyx_string_tab[61]
#define __pyx_kp_u_Your_graphics_card_probably_doe __pyx_string_tab[62]
#define __pyx_kp_u_Your_graphics_card_probably_doe_2 __pyx_string_tab[63]
#define __pyx_kp_u__16 __pyx_string_tab[64]
#define __pyx_kp_u__2 __pyx_string_tab[65]
#define __pyx_kp_u__3 __pyx_string_tab[66]
#define __pyx_kp_u__4 __pyx_string_tab[67]
#define __pyx_kp_u__5 __pyx_string_tab[68]
#define __pyx_kp_u__6 __pyx_string_tab[69]
#define __pyx_kp_u__7 __pyx_string_tab[70]
#define __pyx_kp_u__8 __pyx_string_tab[71]
#define __pyx_kp_u_add_note __pyx_string_tab[72]
#define __pyx_kp_u_and __pyx_string_tab[73]
#define __pyx_kp_u_at_0x __pyx_string_tab[74]
#define __pyx_kp_u_at_offset __pyx_string_tab[75]
#define __pyx_kp_u_collections_abc __pyx_string_tab[76]
#define __pyx_kp_u_contiguous_and_direct __pyx_string_tab[77]
#define __pyx_kp_u_contiguous_and_indirect __pyx_string_tab[78]
#define __pyx_kp_u_disable __pyx_string_tab[79]
#define __pyx_kp_u_enable __pyx_string_tab[80]
#define __pyx_kp_u_failed __pyx_string_tab[81]
#define __pyx_kp_u_fallback_image_shader __pyx_string_tab[82]
#define __pyx_kp_u_float __pyx_string_tab[83]
#define __pyx_kp_u_for_uniform __pyx_string_tab[84]
#define __pyx_kp_u_gc __pyx_string_tab[85]
#define __pyx_kp_u_given_the_number_of_uniforms_yo __pyx_string_tab[86]
#define __pyx_kp_u_got __pyx_string_tab[87]
#define __pyx_kp_u_got_differing_extents_in_dimensi __pyx_string_tab[88]
#define __pyx_kp_u_image_shader_2 __pyx_string_tab[89]
#define __pyx_kp_u_in __pyx_string_tab[90]
#define __pyx_kp_u_in_uniform_block __pyx_string_tab[91]
#define __pyx_kp_u_infowindow_2 __pyx_string_tab[92]
#define __pyx_kp_u_int __pyx_string_tab[93]
#define __pyx_kp_u_isenabled __pyx_string_tab[94]
#define __pyx_kp_u_itemsize_0_for_cython_array __pyx_string_tab[95]
#define __pyx_kp_u_mat2 __pyx_string_tab[96]
#define __pyx_kp_u_mat2x3 __pyx_string_tab[97]
#define __pyx_kp_u_mat3x2 __pyx_string_tab[98]
#define __pyx_kp_u_mat4 __pyx_string_tab[99]
#define __pyx_kp_u_no_default___reduce___due_to_non __pyx_string_tab[100]
#define __pyx_kp_u_not_fitting_into_uniform_buffer __pyx_string_tab[101]
#define __pyx_kp_u_object __pyx_string_tab[102]
#define __pyx_kp_u_of_length __pyx_string_tab[103]
#define __pyx_kp_u_opengl_common_error_pyx __pyx_string_tab[104]
#define __pyx_kp_u_opengl_common_string_pyx __pyx_string_tab[105]
#define __pyx_kp_u_opengl_legacy_edge_set_pyx __pyx_string_tab[106]
#define __pyx_kp_u_opengl_legacy_horoball_group_pyx __pyx_string_tab[107]
#define __pyx_kp_u_opengl_legacy_horoball_scene_pyx __pyx_string_tab[108]
#define __pyx_kp_u_opengl_legacy_hyperbolic_polyhed __pyx_string_tab[109]
#define __pyx_kp_u_opengl_legacy_klein_polygon_pyx __pyx_string_tab[110]
#define __pyx_kp_u_opengl_legacy_label_pyx __pyx_string_tab[111]
#define __pyx_kp_u_opengl_legacy_label_set_pyx __pyx_string_tab[112]
#define __pyx_kp_u_opengl_legacy_lighting_pyx __pyx_string_tab[113]
#define __pyx_kp_u_opengl_legacy_meshed_surface_pyx __pyx_string_tab[114]
#define __pyx_kp_u_opengl_legacy_object_pyx __pyx_string_tab[115]
#define __pyx_kp_u_opengl_legacy_orthoWidget_pyx __pyx_string_tab[116]
#define __pyx_kp_u_opengl_legacy_parallelogram_pyx __pyx_string_tab[117]
#define __pyx_kp_u_opengl_legacy_perspectiveWidget __pyx_string_tab[118]
#define __pyx_kp_u_opengl_legacy_poincare_polygon_p __pyx_string_tab[119]
#define __pyx_kp_u_opengl_legacy_raw_openGL_widget __pyx_string_tab[120]
#define __pyx_kp_u_opengl_legacy_triangle_mesh_pyx __pyx_string_tab[121]
#define __pyx_kp_u_opengl_legacy_wireframe_sphere_p __pyx_string_tab[122]
#define __pyx_kp_u_opengl_modern_data_based_texture __pyx_string_tab[123]
#define __pyx_kp_u_opengl_modern_glsl_perspective_v __pyx_string_tab[124]
#define __pyx_kp_u_opengl_modern_glsl_perspective_w __pyx_string_tab[125]
#define __pyx_kp_u_opengl_modern_glsl_program_pyx __pyx_string_tab[126]
#define __pyx_kp_u_opengl_modern_image_based_textur __pyx_string_tab[127]
#define __pyx_kp_u_opengl_modern_simple_image_shade __pyx_string_tab[128]
#define __pyx_kp_u_opengl_modern_triangle_pyx __pyx_string_tab[129]
#define __pyx_kp_u_opengl_modern_uniform_buffer_obj __pyx_string_tab[130]
#define __pyx_kp_u_opengl_modern_vertex_buffer_pyx __pyx_string_tab[131]
#define __pyx_kp_u_opengl_vector3_pyx __pyx_string_tab[132]
#define __pyx_kp_u_s __pyx_string_tab[133]
#define __pyx_kp_u_shader __pyx_string_tab[134]
#define __pyx_kp_u_strided_and_direct __pyx_string_tab[135]
#define __pyx_kp_u_strided_and_direct_or_indirect __pyx_string_tab[136]
#define __pyx_kp_u_strided_and_indirect __pyx_string_tab[137]
#define __pyx_kp_u_unable_to_allocate_array_data __pyx_string_tab[138]
#define __pyx_kp_u_unable_to_allocate_shape_and_str __pyx_string_tab[139]
#define __pyx_kp_u_uniform_blocks __pyx_string_tab[140]
#define __pyx_kp_u_vec2_2 __pyx_string_tab[141]
#define __pyx_kp_u_vec3 __pyx_string_tab[142]
#define __pyx_kp_u_vec4 __pyx_string_tab[143]
#define __pyx_kp_u_vector3_0_1_2_0_0_1_0_2_0 __pyx_string_tab[144]
#define __pyx_kp_u_vector3___repr___line_14 __pyx_string_tab[145]
#define __pyx_n_u_ASCII __pyx_string_tab[146]
#define __pyx_n_u_B __pyx_string_tab[147]
#define __pyx_n_u_Colorizer __pyx_string_tab[148]
#define __pyx_n_u_CyOpenGL __pyx_string_tab[149]
#define __pyx_n_u_DataBasedTexture __pyx_string_tab[150]
#define __pyx_n_u_DataBasedTexture_bind __pyx_string_tab[151]
#define __pyx_n_u_DataBasedTexture_delete_resource __pyx_string_tab[152]
#define __pyx_n_u_DataBasedTexture_unbind __pyx_string_tab[153]
#define __pyx_n_u_EdgeSet __pyx_string_tab[154]
#define __pyx_n_u_EdgeSet_draw __pyx_string_tab[155]
#define __pyx_n_u_Ellipsis __pyx_string_tab[156]
#define __pyx_n_u_FordEdgeSet __pyx_string_tab[157]
#define __pyx_n_u_Ford_domain __pyx_string_tab[158]
#define __pyx_n_u_Ford_var __pyx_string_tab[159]
#define __pyx_n_u_GLCanvas __pyx_string_tab[160]
#define __pyx_n_u_GLSLPerspectiveView __pyx_string_tab[161]
#define __pyx_n_u_GLSLPerspectiveView_get_uniform __pyx_string_tab[162]
#define __pyx_n_u_GLSLPerspectiveView_rotate __pyx_string_tab[163]
#define __pyx_n_u_GLSLPerspectiveView_translate __pyx_string_tab[164]
#define __pyx_n_u_GLSLPerspectiveWidget __pyx_string_tab[165]
#define __pyx_n_u_GLSLPerspectiveWidget___init __pyx_string_tab[166]
#define __pyx_n_u_GLSLPerspectiveWidget_add_object __pyx_string_tab[167]
#define __pyx_n_u_GLSLPerspectiveWidget_redraw __pyx_string_tab[168]
#define __pyx_n_u_GLSLProgram __pyx_string_tab[169]
#define __pyx_n_u_GLSLProgram__compile_and_link __pyx_string_tab[170]
#define __pyx_n_u_GLSLProgram_bind_uniforms __pyx_string_tab[171]
#define __pyx_n_u_GLSLProgram_delete_resource __pyx_string_tab[172]
#define __pyx_n_u_GLSLProgram_is_valid __pyx_string_tab[173]
#define __pyx_n_u_GLSLProgram_use_program __pyx_string_tab[174]
#define __pyx_n_u_GL_EXTENSIONS __pyx_string_tab[175]
#define __pyx_n_u_GL_INVALID_ENUM __pyx_string_tab[176]
#define __pyx_n_u_GL_INVALID_FRAMEBUFFER_OPERATION __pyx_string_tab[177]
#define __pyx_n_u_GL_INVALID_OPERATION __pyx_string_tab[178]
#define __pyx_n_u_GL_INVALID_VALUE __pyx_string_tab[179]
#define __pyx_n_u_GL_RENDERER __pyx_string_tab[180]
#define __pyx_n_u_GL_SHADING_LANGUAGE_VERSION __pyx_string_tab[181]
#define __pyx_n_u_GL_VENDOR __pyx_string_tab[182]
#define __pyx_n_u_GL_VERSION __pyx_string_tab[183]
#define __pyx_n_u_GLobject __pyx_string_tab[184]
#define __pyx_n_u_GLobject_build_display_list __pyx_string_tab[185]
#define __pyx_n_u_GLobject_delete_resource __pyx_string_tab[186]
#define __pyx_n_u_GLobject_display __pyx_string_tab[187]
#define __pyx_n_u_GLobject_draw __pyx_string_tab[188]
#define __pyx_n_u_GetColor __pyx_string_tab[189]
#define __pyx_n_u_HoroballGroup __pyx_string_tab[190]
#define __pyx_n_u_HoroballGroup_draw __pyx_string_tab[191]
#define __pyx_n_u_HoroballScene __pyx_string_tab[192]
#define __pyx_n_u_HoroballScene_build_scene __pyx_string_tab[193]
#define __pyx_n_u_HoroballScene_delete_resource __pyx_string_tab[194]
#define __pyx_n_u_HoroballScene_draw __pyx_string_tab[195]
#define __pyx_n_u_HoroballScene_flip __pyx_string_tab[196]
#define __pyx_n_u_HoroballScene_set_cutoff __pyx_string_tab[197]
#define __pyx_n_u_HoroballScene_translate __pyx_string_tab[198]
#define __pyx_n_u_Horosphere __pyx_string_tab[199]
#define __pyx_n_u_HyperbolicPolyhedron __pyx_string_tab[200]
#define __pyx_n_u_HyperbolicPolyhedron___init __pyx_string_tab[201]
#define __pyx_n_u_HyperbolicPolyhedron_draw __pyx_string_tab[202]
#define __pyx_n_u_ImageBasedTexture __pyx_string_tab[203]
#define __pyx_n_u_ImageBasedTexture___init __pyx_string_tab[204]
#define __pyx_n_u_InfoWindow __pyx_string_tab[205]
#define __pyx_n_u_Klein __pyx_string_tab[206]
#define __pyx_n_u_KleinPolygon __pyx_string_tab[207]
#define __pyx_n_u_KleinPolygon_draw __pyx_string_tab[208]
#define __pyx_n_u_Klein_faces __pyx_string_tab[209]
#define __pyx_n_u_L __pyx_string_tab[210]
#define __pyx_n_u_Label __pyx_string_tab[211]
#define __pyx_n_u_LabelSet __pyx_string_tab[212]
#define __pyx_n_u_LabelSet_draw __pyx_string_tab[213]
#define __pyx_n_u_Label_draw __pyx_string_tab[214]
#define __pyx_n_u_M __pyx_string_tab[215]
#define __pyx_n_u_MVPMatrix __pyx_string_tab[216]
#define __pyx_n_u_M_max __pyx_string_tab[217]
#define __pyx_n_u_M_min __pyx_string_tab[218]
#define __pyx_n_u_MeshedSurface __pyx_string_tab[219]
#define __pyx_n_u_MeshedSurface_build_arrays __pyx_string_tab[220]
#define __pyx_n_u_MeshedSurface_draw __pyx_string_tab[221]
#define __pyx_n_u_ModelViewMatrix __pyx_string_tab[222]
#define __pyx_n_u_N __pyx_string_tab[223]
#define __pyx_n_u_NV __pyx_string_tab[224]
#define __pyx_n_u_NVsize __pyx_string_tab[225]
#define __pyx_n_u_N_max __pyx_string_tab[226]
#define __pyx_n_u_N_min __pyx_string_tab[227]
#define __pyx_n_u_OpenGLOrthoWidget __pyx_string_tab[228]
#define __pyx_n_u_OpenGLOrthoWidget_build_projecti __pyx_string_tab[229]
#define __pyx_n_u_OpenGLOrthoWidget_tkTranslate __pyx_string_tab[230]
#define __pyx_n_u_OpenGLPerspectiveWidget __pyx_string_tab[231]
#define __pyx_n_u_OpenGLPerspectiveWidget_StartRot __pyx_string_tab[232]
#define __pyx_n_u_OpenGLPerspectiveWidget___init __pyx_string_tab[233]
#define __pyx_n_u_OpenGLPerspectiveWidget_build_pr __pyx_string_tab[234]
#define __pyx_n_u_OpenGLPerspectiveWidget_do_AutoS __pyx_string_tab[235]
#define __pyx_n_u_OpenGLPerspectiveWidget_draw_imp __pyx_string_tab[236]
#define __pyx_n_u_OpenGLPerspectiveWidget_draw_pro __pyx_string_tab[237]
#define __pyx_n_u_OpenGLPerspectiveWidget_help __pyx_string_tab[238]
#define __pyx_n_u_OpenGLPerspectiveWidget_mouse_up __pyx_string_tab[239]
#define __pyx_n_u_OpenGLPerspectiveWidget_reset __pyx_string_tab[240]
#define __pyx_n_u_OpenGLPerspectiveWidget_set_back __pyx_string_tab[241]
#define __pyx_n_u_OpenGLPerspectiveWidget_set_cent __pyx_string_tab[242]
#define __pyx_n_u_OpenGLPerspectiveWidget_set_eyep __pyx_string_tab[243]
#define __pyx_n_u_OpenGLPerspectiveWidget_tkAutoSp __pyx_string_tab[244]
#define __pyx_n_u_OpenGLPerspectiveWidget_tkHandle __pyx_string_tab[245]
#define __pyx_n_u_OpenGLPerspectiveWidget_tkKeyPre __pyx_string_tab[246]
#define __pyx_n_u_OpenGLPerspectiveWidget_tkPrint __pyx_string_tab[247]
#define __pyx_n_u_OpenGLPerspectiveWidget_tkRecord __pyx_string_tab[248]
#define __pyx_n_u_OpenGLPerspectiveWidget_tkRotate __pyx_string_tab[249]
#define __pyx_n_u_OpenGLPerspectiveWidget_tkScale __pyx_string_tab[250]
#define __pyx_n_u_OpenGLPerspectiveWidget_tkTransl __pyx_string_tab[251]
#define __pyx_n_u_OpenGLPerspectiveWidget_zoom __pyx_string_tab[252]
#define __pyx_n_u_P1 __pyx_string_tab[253]
#define __pyx_n_u_P2 __pyx_string_tab[254]
#define __pyx_n_u_Parallelogram __pyx_string_tab[255]
#define __pyx_n_u_Parallelogram_draw __pyx_string_tab[256]
#define __pyx_n_u_Poincare __pyx_string_tab[257]
#define __pyx_n_u_PoincarePolygon __pyx_string_tab[258]
#define __pyx_n_u_PoincarePolygon_draw __pyx_string_tab[259]
#define __pyx_n_u_PoincareTriangle __pyx_string_tab[260]
#define __pyx_n_u_Poincare_faces __pyx_string_tab[261]
#define __pyx_n_u_ProjectionMatrix __pyx_string_tab[262]
#define __pyx_n_u_Pyx_PyDict_NextRef __pyx_string_tab[263]
#define __pyx_n_u_R __pyx_string_tab[264]
#define __pyx_n_u_RawOpenGLWidget __pyx_string_tab[265]
#define __pyx_n_u_RawOpenGLWidget___init __pyx_string_tab[266]
#define __pyx_n_u_RawOpenGLWidget_draw __pyx_string_tab[267]
#define __pyx_n_u_RawOpenGLWidget_make_current __pyx_string_tab[268]
#define __pyx_n_u_RawOpenGLWidget_redraw __pyx_string_tab[269]
#define __pyx_n_u_RawOpenGLWidget_save_image_windo __pyx_string_tab[270]
#define __pyx_n_u_Reader __pyx_string_tab[271]
#define __pyx_n_u_S_infinity __pyx_string_tab[272]
#define __pyx_n_u_Sequence __pyx_string_tab[273]
#define __pyx_n_u_SimpleImageShaderWidget __pyx_string_tab[274]
#define __pyx_n_u_SimpleImageShaderWidget___init __pyx_string_tab[275]
#define __pyx_n_u_SimpleImageShaderWidget_draw __pyx_string_tab[276]
#define __pyx_n_u_SimpleImageShaderWidget_draw_imp __pyx_string_tab[277]
#define __pyx_n_u_SimpleImageShaderWidget_get_unif __pyx_string_tab[278]
#define __pyx_n_u_SimpleImageShaderWidget_read_dep __pyx_string_tab[279]
#define __pyx_n_u_SimpleImageShaderWidget_render_t __pyx_string_tab[280]
#define __pyx_n_u_SimpleImageShaderWidget_save_ima __pyx_string_tab[281]
#define __pyx_n_u_SimpleImageShaderWidget_set_frag __pyx_string_tab[282]
#define __pyx_n_u_SimpleImageShaderWidget_set_text __pyx_string_tab[283]
#define __pyx_n_u_StartRotate __pyx_string_tab[284]
#define __pyx_n_u_T __pyx_string_tab[285]
#define __pyx_n_u_Triangle __pyx_string_tab[286]
#define __pyx_n_u_TriangleMesh __pyx_string_tab[287]
#define __pyx_n_u_TriangleMesh___getitem __pyx_string_tab[288]
#define __pyx_n_u_TriangleMesh___init __pyx_string_tab[289]
#define __pyx_n_u_TriangleMesh___repr __pyx_string_tab[290]
#define __pyx_n_u_TriangleMesh_subdivide __pyx_string_tab[291]
#define __pyx_n_u_Triangle_delete_resource __pyx_string_tab[292]
#define __pyx_n_u_Triangle_draw __pyx_string_tab[293]
#define __pyx_n_u_Triangle_get_uniform_bindings __pyx_string_tab[294]
#define __pyx_n_u_TriangulationEdgeSet __pyx_string_tab[295]
#define __pyx_n_u_Tsize __pyx_string_tab[296]
#define __pyx_n_u_UniformBufferObject __pyx_string_tab[297]
#define __pyx_n_u_UniformBufferObject_bind_block __pyx_string_tab[298]
#define __pyx_n_u_UniformBufferObject_commit __pyx_string_tab[299]
#define __pyx_n_u_UniformBufferObject_delete_resou __pyx_string_tab[300]
#define __pyx_n_u_UniformBufferObject_set __pyx_string_tab[301]
#define __pyx_n_u_V __pyx_string_tab[302]
#define __pyx_n_u_VertexBuffer __pyx_string_tab[303]
#define __pyx_n_u_VertexBuffer_bind __pyx_string_tab[304]
#define __pyx_n_u_VertexBuffer_delete_resource __pyx_string_tab[305]
#define __pyx_n_u_VertexBuffer_load __pyx_string_tab[306]
#define __pyx_n_u_View_MemoryView __pyx_string_tab[307]
#define __pyx_n_u_WireframeSphere __pyx_string_tab[308]
#define __pyx_n_u_WireframeSphere_draw __pyx_string_tab[309]
#define __pyx_n_u_Writer __pyx_string_tab[310]
#define __pyx_n_u_Xangle __pyx_string_tab[311]
#define __pyx_n_u_Yangle __pyx_string_tab[312]
#define __pyx_n_u_abc __pyx_string_tab[313]
#define __pyx_n_u_add_object __pyx_string_tab[314]
#define __pyx_n_u_after __pyx_string_tab[315]
#define __pyx_n_u_allocate_buffer __pyx_string_tab[316]
#define __pyx_n_u_alpha __pyx_string_tab[317]
#define __pyx_n_u_ambient __pyx_string_tab[318]
#define __pyx_n_u_annotate __pyx_string_tab[319]
#define __pyx_n_u_append __pyx_string_tab[320]
#define __pyx_n_u_args __pyx_string_tab[321]
#define __pyx_n_u_array_type __pyx_string_tab[322]
#define __pyx_n_u_asRGBA8 __pyx_string_tab[323]
#define __pyx_n_u_as_float __pyx_string_tab[324]
#define __pyx_n_u_ascii __pyx_string_tab[325]
#define __pyx_n_u_aspect __pyx_string_tab[326]
#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[327]
#define __pyx_n_u_autospin __pyx_string_tab[328]
#define __pyx_n_u_autospin_allowed __pyx_string_tab[329]
#define __pyx_n_u_b __pyx_string_tab[330]
#define __pyx_n_u_b_back __pyx_string_tab[331]
#define __pyx_n_u_back_shininess __pyx_string_tab[332]
#define __pyx_n_u_back_specular __pyx_string_tab[333]
#define __pyx_n_u_base __pyx_string_tab[334]
#define __pyx_n_u_bind __pyx_string_tab[335]
#define __pyx_n_u_bind_block __pyx_string_tab[336]
#define __pyx_n_u_bind_uniforms __pyx_string_tab[337]
#define __pyx_n_u_binding_point __pyx_string_tab[338]
#define __pyx_n_u_bitdepth __pyx_string_tab[339]
#define __pyx_n_u_block_index __pyx_string_tab[340]
#define __pyx_n_u_block_name __pyx_string_tab[341]
#define __pyx_n_u_block_size __pyx_string_tab[342]
#define __pyx_n_u_bool __pyx_string_tab[343]
#define __pyx_n_u_boolean_value __pyx_string_tab[344]
#define __pyx_n_u_buffer_object __pyx_string_tab[345]
#define __pyx_n_u_buffer_size __pyx_string_tab[346]
#define __pyx_n_u_build_arrays __pyx_string_tab[347]
#define __pyx_n_u_build_display_list __pyx_string_tab[348]
#define __pyx_n_u_build_projection __pyx_string_tab[349]
#define __pyx_n_u_build_scene __pyx_string_tab[350]
#define __pyx_n_u_build_scene_locals_genexpr __pyx_string_tab[351]
#define __pyx_n_u_c __pyx_string_tab[352]
#define __pyx_n_u_c_array __pyx_string_tab[353]
#define __pyx_n_u_ceil __pyx_string_tab[354]
#define __pyx_n_u_center __pyx_string_tab[355]
#define __pyx_n_u_class __pyx_string_tab[356]
#define __pyx_n_u_class_getitem __pyx_string_tab[357]
#define __pyx_n_u_clear_gl_errors __pyx_string_tab[358]
#define __pyx_n_u_cline_in_traceback __pyx_string_tab[359]
#define __pyx_n_u_close __pyx_string_tab[360]
#define __pyx_n_u_closest __pyx_string_tab[361]
#define __pyx_n_u_cnf __pyx_string_tab[362]
#define __pyx_n_u_color __pyx_string_tab[363]
#define __pyx_n_u_color_texture __pyx_string_tab[364]
#define __pyx_n_u_color_texture_type __pyx_string_tab[365]
#define __pyx_n_u_colorsys __pyx_string_tab[366]
#define __pyx_n_u_commit __pyx_string_tab[367]
#define __pyx_n_u_compile_and_link __pyx_string_tab[368]
#define __pyx_n_u_config __pyx_string_tab[369]
#define __pyx_n_u_conjugate __pyx_string_tab[370]
#define __pyx_n_u_cos __pyx_string_tab[371]
#define __pyx_n_u_count __pyx_string_tab[372]
#define __pyx_n_u_current_widget __pyx_string_tab[373]
#define __pyx_n_u_cursor __pyx_string_tab[374]
#define __pyx_n_u_cutoff __pyx_string_tab[375]
#define __pyx_n_u_cyglSetStandardLighting __pyx_string_tab[376]
#define __pyx_n_u_d __pyx_string_tab[377]
#define __pyx_n_u_dark __pyx_string_tab[378]
#define __pyx_n_u_darwin __pyx_string_tab[379]
#define __pyx_n_u_data __pyx_string_tab[380]
#define __pyx_n_u_delete_resource __pyx_string_tab[381]
#define __pyx_n_u_delta_t __pyx_string_tab[382]
#define __pyx_n_u_depth __pyx_string_tab[383]
#define __pyx_n_u_depth_texture __pyx_string_tab[384]
#define __pyx_n_u_dict __pyx_string_tab[385]
#define __pyx_n_u_dict_2 __pyx_string_tab[386]
#define __pyx_n_u_disp __pyx_string_tab[387]
#define __pyx_n_u_display __pyx_string_tab[388]
#define __pyx_n_u_distance __pyx_string_tab[389]
#define __pyx_n_u_div __pyx_string_tab[390]
#define __pyx_n_u_do_AutoSpin __pyx_string_tab[391]
#define __pyx_n_u_doc __pyx_string_tab[392]
#define __pyx_n_u_dphi __pyx_string_tab[393]
#define __pyx_n_u_draw __pyx_string_tab[394]
#define __pyx_n_u_draw_impl __pyx_string_tab[395]
#define __pyx_n_u_draw_locals_draw_point __pyx_string_tab[396]
#define __pyx_n_u_draw_point __pyx_string_tab[397]
#define __pyx_n_u_draw_projection_impl __pyx_string_tab[398]
#define __pyx_n_u_dtheta __pyx_string_tab[399]
#define __pyx_n_u_dtype_is_object __pyx_string_tab[400]
#define __pyx_n_u_e __pyx_string_tab[401]
#define __pyx_n_u_encode __pyx_string_tab[402]
#define __pyx_n_u_endpoints __pyx_string_tab[403]
#define __pyx_n_u_enumerate __pyx_string_tab[404]
#define __pyx_n_u_err __pyx_string_tab[405]
#define __pyx_n_u_error __pyx_string_tab[406]
#define __pyx_n_u_event __pyx_string_tab[407]
#define __pyx_n_u_f __pyx_string_tab[408]
#define __pyx_n_u_face __pyx_string_tab[409]
#define __pyx_n_u_face_specular __pyx_string_tab[410]
#define __pyx_n_u_facedicts __pyx_string_tab[411]
#define __pyx_n_u_far __pyx_string_tab[412]
#define __pyx_n_u_fbo __pyx_string_tab[413]
#define __pyx_n_u_file __pyx_string_tab[414]
#define __pyx_n_u_flags __pyx_string_tab[415]
#define __pyx_n_u_fleur __pyx_string_tab[416]
#define __pyx_n_u_flip __pyx_string_tab[417]
#define __pyx_n_u_flipped __pyx_string_tab[418]
#define __pyx_n_u_float_2 __pyx_string_tab[419]
#define __pyx_n_u_float_array __pyx_string_tab[420]
#define __pyx_n_u_floats __pyx_string_tab[421]
#define __pyx_n_u_floor __pyx_string_tab[422]
#define __pyx_n_u_format __pyx_string_tab[423]
#define __pyx_n_u_fortran __pyx_string_tab[424]
#define __pyx_n_u_fovy __pyx_string_tab[425]
#define __pyx_n_u_fragment __pyx_string_tab[426]
#define __pyx_n_u_fragment_shader_source __pyx_string_tab[427]
#define __pyx_n_u_front_shininess __pyx_string_tab[428]
#define __pyx_n_u_front_specular __pyx_string_tab[429]
#define __pyx_n_u_full_list __pyx_string_tab[430]
#define __pyx_n_u_func __pyx_string_tab[431]
#define __pyx_n_u_g __pyx_string_tab[432]
#define __pyx_n_u_g_back __pyx_string_tab[433]
#define __pyx_n_u_genexpr __pyx_string_tab[434]
#define __pyx_n_u_get __pyx_string_tab[435]
#define __pyx_n_u_get_gl_string __pyx_string_tab[436]
#define __pyx_n_u_get_uniform_bindings __pyx_string_tab[437]
#define __pyx_n_u_get_uniform_bindings_locals_to_p __pyx_string_tab[438]
#define __pyx_n_u_getitem __pyx_string_tab[439]
#define __pyx_n_u_getstate __pyx_string_tab[440]
#define __pyx_n_u_glBindVertexArray __pyx_string_tab[441]
#define __pyx_n_u_glCompileShader __pyx_string_tab[442]
#define __pyx_n_u_glEnableVertexAttribArray __pyx_string_tab[443]
#define __pyx_n_u_glGenBuffers __pyx_string_tab[444]
#define __pyx_n_u_glGenVertexArrays __pyx_string_tab[445]
#define __pyx_n_u_glLinkProgram __pyx_string_tab[446]
#define __pyx_n_u_glVertexAttribPointer __pyx_string_tab[447]
#define __pyx_n_u_gl_string_enums __pyx_string_tab[448]
#define __pyx_n_u_gl_widget __pyx_string_tab[449]
#define __pyx_n_u_glyph __pyx_string_tab[450]
#define __pyx_n_u_greyscale __pyx_string_tab[451]
#define __pyx_n_u_h __pyx_string_tab[452]
#define __pyx_n_u_hand __pyx_string_tab[453]
#define __pyx_n_u_height __pyx_string_tab[454]
#define __pyx_n_u_help __pyx_string_tab[455]
#define __pyx_n_u_help_text __pyx_string_tab[456]
#define __pyx_n_u_hls_to_rgb __pyx_string_tab[457]
#define __pyx_n_u_horo_var __pyx_string_tab[458]
#define __pyx_n_u_horoballs __pyx_string_tab[459]
#define __pyx_n_u_hue __pyx_string_tab[460]
#define __pyx_n_u_i __pyx_string_tab[461]
#define __pyx_n_u_id __pyx_string_tab[462]
#define __pyx_n_u_imag __pyx_string_tab[463]
#define __pyx_n_u_image_shader __pyx_string_tab[464]
#define __pyx_n_u_import __pyx_string_tab[465]
#define __pyx_n_u_include_depth_value __pyx_string_tab[466]
#define __pyx_n_u_index __pyx_string_tab[467]
#define __pyx_n_u_indices __pyx_string_tab[468]
#define __pyx_n_u_info __pyx_string_tab[469]
#define __pyx_n_u_infowindow __pyx_string_tab[470]
#define __pyx_n_u_init __pyx_string_tab[471]
#define __pyx_n_u_initialised __pyx_string_tab[472]
#define __pyx_n_u_initialized __pyx_string_tab[473]
#define __pyx_n_u_int_2 __pyx_string_tab[474]
#define __pyx_n_u_int_array __pyx_string_tab[475]
#define __pyx_n_u_int_label __pyx_string_tab[476]
#define __pyx_n_u_integers __pyx_string_tab[477]
#define __pyx_n_u_is_coroutine __pyx_string_tab[478]
#define __pyx_n_u_is_valid __pyx_string_tab[479]
#define __pyx_n_u_items __pyx_string_tab[480]
#define __pyx_n_u_itemsize __pyx_string_tab[481]
#define __pyx_n_u_ivec2 __pyx_string_tab[482]
#define __pyx_n_u_j __pyx_string_tab[483]
#define __pyx_n_u_k __pyx_string_tab[484]
#define __pyx_n_u_key __pyx_string_tab[485]
#define __pyx_n_u_key_action __pyx_string_tab[486]
#define __pyx_n_u_keys __pyx_string_tab[487]
#define __pyx_n_u_keysym __pyx_string_tab[488]
#define __pyx_n_u_kw __pyx_string_tab[489]
#define __pyx_n_u_kwargs __pyx_string_tab[490]
#define __pyx_n_u_l __pyx_string_tab[491]
#define __pyx_n_u_label __pyx_string_tab[492]
#define __pyx_n_u_label_height __pyx_string_tab[493]
#define __pyx_n_u_label_var __pyx_string_tab[494]
#define __pyx_n_u_labels __pyx_string_tab[495]
#define __pyx_n_u_lightdiffuse __pyx_string_tab[496]
#define __pyx_n_u_lightness __pyx_string_tab[497]
#define __pyx_n_u_lightposition0 __pyx_string_tab[498]
#define __pyx_n_u_lightposition1 __pyx_string_tab[499]
#define __pyx_n_u_lightspecular __pyx_string_tab[500]
#define __pyx_n_u_list_id __pyx_string_tab[501]
#define __pyx_n_u_load __pyx_string_tab[502]
#define __pyx_n_u_loc __pyx_string_tab[503]
#define __pyx_n_u_longitude __pyx_string_tab[504]
#define __pyx_n_u_m __pyx_string_tab[505]
#define __pyx_n_u_main __pyx_string_tab[506]
#define __pyx_n_u_make_current __pyx_string_tab[507]
#define __pyx_n_u_master __pyx_string_tab[508]
#define __pyx_n_u_mat4_2 __pyx_string_tab[509]
#define __pyx_n_u_math __pyx_string_tab[510]
#define __pyx_n_u_memview __pyx_string_tab[511]
#define __pyx_n_u_meridian __pyx_string_tab[512]
#define __pyx_n_u_metaclass __pyx_string_tab[513]
#define __pyx_n_u_missing_gl_function __pyx_string_tab[514]
#define __pyx_n_u_mode __pyx_string_tab[515]
#define __pyx_n_u_model __pyx_string_tab[516]
#define __pyx_n_u_model_var __pyx_string_tab[517]
#define __pyx_n_u_module __pyx_string_tab[518]
#define __pyx_n_u_mouse_pick __pyx_string_tab[519]
#define __pyx_n_u_mouse_rotate __pyx_string_tab[520]
#define __pyx_n_u_mouse_scale __pyx_string_tab[521]
#define __pyx_n_u_mouse_translate __pyx_string_tab[522]
#define __pyx_n_u_mouse_update __pyx_string_tab[523]
#define __pyx_n_u_mro_entries __pyx_string_tab[524]
#define __pyx_n_u_msg __pyx_string_tab[525]
#define __pyx_n_u_n __pyx_string_tab[526]
#define __pyx_n_u_name __pyx_string_tab[527]
#define __pyx_n_u_name_2 __pyx_string_tab[528]
#define __pyx_n_u_name_parts __pyx_string_tab[529]
#define __pyx_n_u_name_to_offset __pyx_string_tab[530]
#define __pyx_n_u_name_to_type_and_value __pyx_string_tab[531]
#define __pyx_n_u_nbhd __pyx_string_tab[532]
#define __pyx_n_u_ndim __pyx_string_tab[533]
#define __pyx_n_u_near __pyx_string_tab[534]
#define __pyx_n_u_new __pyx_string_tab[535]
#define __pyx_n_u_new_triangles __pyx_string_tab[536]
#define __pyx_n_u_next __pyx_string_tab[537]
#define __pyx_n_u_norm __pyx_string_tab[538]
#define __pyx_n_u_norm_squared __pyx_string_tab[539]
#define __pyx_n_u_num_bytes __pyx_string_tab[540]
#define __pyx_n_u_num_cusps __pyx_string_tab[541]
#define __pyx_n_u_obj __pyx_string_tab[542]
#define __pyx_n_u_objX __pyx_string_tab[543]
#define __pyx_n_u_objY __pyx_string_tab[544]
#define __pyx_n_u_objZ __pyx_string_tab[545]
#define __pyx_n_u_object_2 __pyx_string_tab[546]
#define __pyx_n_u_objects __pyx_string_tab[547]
#define __pyx_n_u_offset __pyx_string_tab[548]
#define __pyx_n_u_old_widget __pyx_string_tab[549]
#define __pyx_n_u_original_index __pyx_string_tab[550]
#define __pyx_n_u_os __pyx_string_tab[551]
#define __pyx_n_u_outfile __pyx_string_tab[552]
#define __pyx_n_u_p __pyx_string_tab[553]
#define __pyx_n_u_pack __pyx_string_tab[554]
#define __pyx_n_u_parent __pyx_string_tab[555]
#define __pyx_n_u_pgram_var __pyx_string_tab[556]
#define __pyx_n_u_phi __pyx_string_tab[557]
#define __pyx_n_u_pi __pyx_string_tab[558]
#define __pyx_n_u_pick __pyx_string_tab[559]
#define __pyx_n_u_platform __pyx_string_tab[560]
#define __pyx_n_u_png __pyx_string_tab[561]
#define __pyx_n_u_pop __pyx_string_tab[562]
#define __pyx_n_u_position __pyx_string_tab[563]
#define __pyx_n_u_prepare __pyx_string_tab[564]
#define __pyx_n_u_print __pyx_string_tab[565]
#define __pyx_n_u_print_gl_errors __pyx_string_tab[566]
#define __pyx_n_u_profile __pyx_string_tab[567]
#define __pyx_n_u_program __pyx_string_tab[568]
#define __pyx_n_u_proj __pyx_string_tab[569]
#define __pyx_n_u_pyx_checksum __pyx_string_tab[570]
#define __pyx_n_u_pyx_state __pyx_string_tab[571]
#define __pyx_n_u_pyx_type __pyx_string_tab[572]
#define __pyx_n_u_pyx_unpickle_Enum __pyx_string_tab[573]
#define __pyx_n_u_pyx_vtable __pyx_string_tab[574]
#define __pyx_n_u_qualname __pyx_string_tab[575]
#define __pyx_n_u_r __pyx_string_tab[576]
#define __pyx_n_u_r_back __pyx_string_tab[577]
#define __pyx_n_u_radius __pyx_string_tab[578]
#define __pyx_n_u_random __pyx_string_tab[579]
#define __pyx_n_u_read_depth_value __pyx_string_tab[580]
#define __pyx_n_u_real __pyx_string_tab[581]
#define __pyx_n_u_redraw __pyx_string_tab[582]
#define __pyx_n_u_reduce __pyx_string_tab[583]
#define __pyx_n_u_reduce_cython __pyx_string_tab[584]
#define __pyx_n_u_reduce_ex __pyx_string_tab[585]
#define __pyx_n_u_register __pyx_string_tab[586]
#define __pyx_n_u_render_to_array __pyx_string_tab[587]
#define __pyx_n_u_report_gl_errors __pyx_string_tab[588]
#define __pyx_n_u_report_time_callback __pyx_string_tab[589]
#define __pyx_n_u_repr __pyx_string_tab[590]
#define __pyx_n_u_reset __pyx_string_tab[591]
#define __pyx_n_u_rgba_data __pyx_string_tab[592]
#define __pyx_n_u_right __pyx_string_tab[593]
#define __pyx_n_u_root __pyx_string_tab[594]
#define __pyx_n_u_rotate __pyx_string_tab[595]
#define __pyx_n_u_round __pyx_string_tab[596]
#define __pyx_n_u_row __pyx_string_tab[597]
#define __pyx_n_u_rows __pyx_string_tab[598]
#define __pyx_n_u_s1 __pyx_string_tab[599]
#define __pyx_n_u_s2 __pyx_string_tab[600]
#define __pyx_n_u_saturation __pyx_string_tab[601]
#define __pyx_n_u_save_image __pyx_string_tab[602]
#define __pyx_n_u_save_image_window_resolution __pyx_string_tab[603]
#define __pyx_n_u_scalar __pyx_string_tab[604]
#define __pyx_n_u_scale __pyx_string_tab[605]
#define __pyx_n_u_segments __pyx_string_tab[606]
#define __pyx_n_u_self __pyx_string_tab[607]
#define __pyx_n_u_send __pyx_string_tab[608]
#define __pyx_n_u_set __pyx_string_tab[609]
#define __pyx_n_u_set_background __pyx_string_tab[610]
#define __pyx_n_u_set_centerpoint __pyx_string_tab[611]
#define __pyx_n_u_set_cutoff __pyx_string_tab[612]
#define __pyx_n_u_set_eyepoint __pyx_string_tab[613]
#define __pyx_n_u_set_fragment_shader_source __pyx_string_tab[614]
#define __pyx_n_u_set_name __pyx_string_tab[615]
#define __pyx_n_u_set_textures __pyx_string_tab[616]
#define __pyx_n_u_setdefault __pyx_string_tab[617]
#define __pyx_n_u_setstate __pyx_string_tab[618]
#define __pyx_n_u_setstate_cython __pyx_string_tab[619]
#define __pyx_n_u_shape __pyx_string_tab[620]
#define __pyx_n_u_shifts __pyx_string_tab[621]
#define __pyx_n_u_sin __pyx_string_tab[622]
#define __pyx_n_u_size __pyx_string_tab[623]
#define __pyx_n_u_skip_swap_buffers __pyx_string_tab[624]
#define __pyx_n_u_slices __pyx_string_tab[625]
#define __pyx_n_u_source __pyx_string_tab[626]
#define __pyx_n_u_sphere __pyx_string_tab[627]
#define __pyx_n_u_sphere_var __pyx_string_tab[628]
#define __pyx_n_u_split __pyx_string_tab[629]
#define __pyx_n_u_sqrt __pyx_string_tab[630]
#define __pyx_n_u_stacks __pyx_string_tab[631]
#define __pyx_n_u_start __pyx_string_tab[632]
#define __pyx_n_u_start_time __pyx_string_tab[633]
#define __pyx_n_u_step __pyx_string_tab[634]
#define __pyx_n_u_stop __pyx_string_tab[635]
#define __pyx_n_u_str __pyx_string_tab[636]
#define __pyx_n_u_stride __pyx_string_tab[637]
#define __pyx_n_u_string __pyx_string_tab[638]
#define __pyx_n_u_struct __pyx_string_tab[639]
#define __pyx_n_u_subdivide __pyx_string_tab[640]
#define __pyx_n_u_subdivision_depth __pyx_string_tab[641]
#define __pyx_n_u_sum __pyx_string_tab[642]
#define __pyx_n_u_super __pyx_string_tab[643]
#define __pyx_n_u_swap_buffers __pyx_string_tab[644]
#define __pyx_n_u_sys __pyx_string_tab[645]
#define __pyx_n_u_t __pyx_string_tab[646]
#define __pyx_n_u_tan __pyx_string_tab[647]
#define __pyx_n_u_test __pyx_string_tab[648]
#define __pyx_n_u_texture __pyx_string_tab[649]
#define __pyx_n_u_texture_file __pyx_string_tab[650]
#define __pyx_n_u_texture_files __pyx_string_tab[651]
#define __pyx_n_u_textures __pyx_string_tab[652]
#define __pyx_n_u_theta __pyx_string_tab[653]
#define __pyx_n_u_throw __pyx_string_tab[654]
#define __pyx_n_u_time __pyx_string_tab[655]
#define __pyx_n_u_tkAutoSpin __pyx_string_tab[656]
#define __pyx_n_u_tkHandlePick __pyx_string_tab[657]
#define __pyx_n_u_tkKeyPress __pyx_string_tab[658]
#define __pyx_n_u_tkPrint __pyx_string_tab[659]
#define __pyx_n_u_tkRecordMouse __pyx_string_tab[660]
#define __pyx_n_u_tkRotate __pyx_string_tab[661]
#define __pyx_n_u_tkScale __pyx_string_tab[662]
#define __pyx_n_u_tkTranslate __pyx_string_tab[663]
#define __pyx_n_u_tkinter_gl __pyx_string_tab[664]
#define __pyx_n_u_tmouse __pyx_string_tab[665]
#define __pyx_n_u_to_py __pyx_string_tab[666]
#define __pyx_n_u_togl_widget __pyx_string_tab[667]
#define __pyx_n_u_top __pyx_string_tab[668]
#define __pyx_n_u_translate __pyx_string_tab[669]
#define __pyx_n_u_translations __pyx_string_tab[670]
#define __pyx_n_u_tri_var __pyx_string_tab[671]
#define __pyx_n_u_triangle __pyx_string_tab[672]
#define __pyx_n_u_triangles __pyx_string_tab[673]
#define __pyx_n_u_triangulation __pyx_string_tab[674]
#define __pyx_n_u_triple __pyx_string_tab[675]
#define __pyx_n_u_unbind __pyx_string_tab[676]
#define __pyx_n_u_undefined __pyx_string_tab[677]
#define __pyx_n_u_uniform __pyx_string_tab[678]
#define __pyx_n_u_uniform_block __pyx_string_tab[679]
#define __pyx_n_u_uniform_block_names_sizes_and_of __pyx_string_tab[680]
#define __pyx_n_u_uniform_name __pyx_string_tab[681]
#define __pyx_n_u_uniform_type __pyx_string_tab[682]
#define __pyx_n_u_unnamed __pyx_string_tab[683]
#define __pyx_n_u_unpack __pyx_string_tab[684]
#define __pyx_n_u_update __pyx_string_tab[685]
#define __pyx_n_u_update_idletasks __pyx_string_tab[686]
#define __pyx_n_u_use_material __pyx_string_tab[687]
#define __pyx_n_u_use_program __pyx_string_tab[688]
#define __pyx_n_u_ux __pyx_string_tab[689]
#define __pyx_n_u_value __pyx_string_tab[690]
#define __pyx_n_u_values __pyx_string_tab[691]
#define __pyx_n_u_vec2 __pyx_string_tab[692]
#define __pyx_n_u_vector3 __pyx_string_tab[693]
#define __pyx_n_u_vector3___div __pyx_string_tab[694]
#define __pyx_n_u_vertex __pyx_string_tab[695]
#define __pyx_n_u_vertex_buffer __pyx_string_tab[696]
#define __pyx_n_u_vertex_data __pyx_string_tab[697]
#define __pyx_n_u_vertex_shader_source __pyx_string_tab[698]
#define __pyx_n_u_vertices __pyx_string_tab[699]
#define __pyx_n_u_verts __pyx_string_tab[700]
#define __pyx_n_u_view __pyx_string_tab[701]
#define __pyx_n_u_view_height __pyx_string_tab[702]
#define __pyx_n_u_view_width __pyx_string_tab[703]
#define __pyx_n_u_viewer_help __pyx_string_tab[704]
#define __pyx_n_u_viewportSize __pyx_string_tab[705]
#define __pyx_n_u_vx __pyx_string_tab[706]
#define __pyx_n_u_vy __pyx_string_tab[707]
#define __pyx_n_u_w __pyx_string_tab[708]
#define __pyx_n_u_which_cusp __pyx_string_tab[709]
#define __pyx_n_u_width __pyx_string_tab[710]
#define __pyx_n_u_winfo_height __pyx_string_tab[711]
#define __pyx_n_u_winfo_width __pyx_string_tab[712]
#define __pyx_n_u_write __pyx_string_tab[713]
#define __pyx_n_u_writer __pyx_string_tab[714]
#define __pyx_n_u_x __pyx_string_tab[715]
#define __pyx_n_u_xcenter __pyx_string_tab[716]
#define __pyx_n_u_xmax __pyx_string_tab[717]
#define __pyx_n_u_xmouse __pyx_string_tab[718]
#define __pyx_n_u_xn __pyx_string_tab[719]
#define __pyx_n_u_xy __pyx_string_tab[720]
#define __pyx_n_u_y __pyx_string_tab[721]
#define __pyx_n_u_ycenter __pyx_string_tab[722]
#define __pyx_n_u_ymax __pyx_string_tab[723]
#define __pyx_n_u_ymouse __pyx_string_tab[724]
#define __pyx_n_u_yn __pyx_string_tab[725]
#define __pyx_n_u_yz __pyx_string_tab[726]
#define __pyx_n_u_z __pyx_string_tab[727]
#define __pyx_n_u_zcenter __pyx_string_tab[728]
#define __pyx_n_u_zip __pyx_string_tab[729]
#define __pyx_n_u_zoom __pyx_string_tab[730]
#define __pyx_n_u_zx __pyx_string_tab[731]
#define __pyx_kp_b_iso88591_1 __pyx_string_tab[732]
#define __pyx_kp_b_iso88591_1A_4q_AQ_Q_1_q_CuA_1AT_2Qat1_WD __pyx_string_tab[733]
#define __pyx_kp_b_iso88591_1_Ry_HA_A_M_6a_1_1_1 __pyx_string_tab[734]
#define __pyx_kp_b_iso88591_1_y_xt6_9AQ_M_Kq __pyx_string_tab[735]
#define __pyx_kp_b_iso88591_2RuAQar_2Rt4uE_e1A __pyx_string_tab[736]
#define __pyx_kp_b_iso88591_5Q_4vS_T_1_d_q_T_Q_c_Q_a_Kt1_M __pyx_string_tab[737]
#define __pyx_kp_b_iso88591_9_M_IQ_Ja_Qe5_Q_q_a_N_e5_9_uE_6 __pyx_string_tab[738]
#define __pyx_kp_b_iso88591_A __pyx_string_tab[739]
#define __pyx_kp_b_iso88591_AKL_M_Kq_4A_1 __pyx_string_tab[740]
#define __pyx_kp_b_iso88591_AV6_q_uE_5_U_1E_e1_1E_vQ_AQ_AQ __pyx_string_tab[741]
#define __pyx_kp_b_iso88591_A_1A_uE_q_Bb_AQ_1G1G1_Q_1G1G1_Q __pyx_string_tab[742]
#define __pyx_kp_b_iso88591_A_1E_4t1_q __pyx_string_tab[743]
#define __pyx_kp_b_iso88591_A_3at_Qa_L_q_CuCq_Kt1_at2Qd_AU_4 __pyx_string_tab[744]
#define __pyx_kp_b_iso88591_A_3c_AT_it9A_q_Ba_QgQ_AQ_A_1 __pyx_string_tab[745]
#define __pyx_kp_b_iso88591_A_3c_AU_uA_q_Ba_Jd_q_q_4q_Q __pyx_string_tab[746]
#define __pyx_kp_b_iso88591_A_3d_j_IQd_iq_D __pyx_string_tab[747]
#define __pyx_kp_b_iso88591_A_3fG3gQm81_y_2Rr_Cwiq_2Rr_b_Rr __pyx_string_tab[748]
#define __pyx_kp_b_iso88591_A_4_Q_4q_1_T_S_Ye1A_Bc_r_YfAT_S __pyx_string_tab[749]
#define __pyx_kp_b_iso88591_A_4_Rr_A_at4q_Q __pyx_string_tab[750]
#define __pyx_kp_b_iso88591_A_4_at_4F_1_4_at_6fA_1_at_4q_at __pyx_string_tab[751]
#define __pyx_kp_b_iso88591_A_4q_Q __pyx_string_tab[752]
#define __pyx_kp_b_iso88591_A_4q_U_3c_1_1A_AQ_Qa_4_IQ_iq_A_1 __pyx_string_tab[753]
#define __pyx_kp_b_iso88591_A_4t1_q_G_A_q_V1A_Rq_s_s_4q_7waq __pyx_string_tab[754]
#define __pyx_kp_b_iso88591_A_4vS_A_4q_avQ_1_auA_1_4y_A_WG4w __pyx_string_tab[755]
#define __pyx_kp_b_iso88591_A_6_L __pyx_string_tab[756]
#define __pyx_kp_b_iso88591_A_6a_Ja_y_xwa_M_O1_3j_1_q_q_q_q __pyx_string_tab[757]
#define __pyx_kp_b_iso88591_A_7_6_AQ __pyx_string_tab[758]
#define __pyx_kp_b_iso88591_A_81D_Q_at1 __pyx_string_tab[759]
#define __pyx_kp_b_iso88591_A_AT __pyx_string_tab[760]
#define __pyx_kp_b_iso88591_A_AT_A __pyx_string_tab[761]
#define __pyx_kp_b_iso88591_A_A_A_2Q_1HAQhaq_1HAQir_1AZq_1HA __pyx_string_tab[762]
#define __pyx_kp_b_iso88591_A_A_A_AQ_Q __pyx_string_tab[763]
#define __pyx_kp_b_iso88591_A_A_M_Jaxt_q_M_M __pyx_string_tab[764]
#define __pyx_kp_b_iso88591_A_D_L_A_s_a_1A_1Cr_3aq_1Cr_3aq_1 __pyx_string_tab[765]
#define __pyx_kp_b_iso88591_A_D_XQ_M_q_1D_Qa_E_Q_aq_AT_Q __pyx_string_tab[766]
#define __pyx_kp_b_iso88591_A_E_AQ_L_c_2Qa_G1 __pyx_string_tab[767]
#define __pyx_kp_b_iso88591_A_E_E_Bd_L_Jb_G1_N_1 __pyx_string_tab[768]
#define __pyx_kp_b_iso88591_A_E_YgT_T_1_G4q_T_haq_4vT_q_A_AS __pyx_string_tab[769]
#define __pyx_kp_b_iso88591_A_F_a_6_A_A_HA_3a_A_HA_4wd_81 __pyx_string_tab[770]
#define __pyx_kp_b_iso88591_A_G1_N_1 __pyx_string_tab[771]
#define __pyx_kp_b_iso88591_A_HG1A __pyx_string_tab[772]
#define __pyx_kp_b_iso88591_A_I_I_1_Ql_O5_A_3a __pyx_string_tab[773]
#define __pyx_kp_b_iso88591_A_J_a_K_q_J_a_J_a_I_Q_G_1 __pyx_string_tab[774]
#define __pyx_kp_b_iso88591_A_Ja __pyx_string_tab[775]
#define __pyx_kp_b_iso88591_A_Ja_Ja_Ja_G1 __pyx_string_tab[776]
#define __pyx_kp_b_iso88591_A_Kq __pyx_string_tab[777]
#define __pyx_kp_b_iso88591_A_Kq_Kq_Kq_G1 __pyx_string_tab[778]
#define __pyx_kp_b_iso88591_A_KuF_D_IT_j_T_d_q __pyx_string_tab[779]
#define __pyx_kp_b_iso88591_A_Kz_1A_1_E_81 __pyx_string_tab[780]
#define __pyx_kp_b_iso88591_A_L_6_Bc_1_M_Jawa_M_4q_1A __pyx_string_tab[781]
#define __pyx_kp_b_iso88591_A_L_G1 __pyx_string_tab[782]
#define __pyx_kp_b_iso88591_A_L_M_2Rq __pyx_string_tab[783]
#define __pyx_kp_b_iso88591_A_L_M_AQ_a_1_q __pyx_string_tab[784]
#define __pyx_kp_b_iso88591_A_L_M_Jawa_Q_AS_r_Cq_q_wa __pyx_string_tab[785]
#define __pyx_kp_b_iso88591_A_L_M_Jaxq_vQa_AYb_Q_AS_7_E_2Q_r __pyx_string_tab[786]
#define __pyx_kp_b_iso88591_A_L_N_1 __pyx_string_tab[787]
#define __pyx_kp_b_iso88591_A_L_Q_q_A_Qd_at1 __pyx_string_tab[788]
#define __pyx_kp_b_iso88591_A_M __pyx_string_tab[789]
#define __pyx_kp_b_iso88591_A_M_6_d_t4y_A_G1_N_1 __pyx_string_tab[790]
#define __pyx_kp_b_iso88591_A_M_Jd_U_Rt1_Jd_U_Rt1_q_Jd_D_IT __pyx_string_tab[791]
#define __pyx_kp_b_iso88591_A_M_Kt1_1_L_A_a_1A_Q_A_Qa __pyx_string_tab[792]
#define __pyx_kp_b_iso88591_A_M_L_A_E_q __pyx_string_tab[793]
#define __pyx_kp_b_iso88591_A_M_avQe1A_fD_t1_AQ_a_uBc_e1Baq __pyx_string_tab[794]
#define __pyx_kp_b_iso88591_A_M_q_Jd_D_IT_G1_4q_at4q __pyx_string_tab[795]
#define __pyx_kp_b_iso88591_A_N_Qk_Bd_b_1A_6_Yaq_E_at1_l_Bb __pyx_string_tab[796]
#define __pyx_kp_b_iso88591_A_O_1_I_Q __pyx_string_tab[797]
#define __pyx_kp_b_iso88591_A_Q __pyx_string_tab[798]
#define __pyx_kp_b_iso88591_A_Qa_1_1A_wd_b_D_iq_c_Q_T_A_U_1 __pyx_string_tab[799]
#define __pyx_kp_b_iso88591_A_Qd_d_y_Ja_Cs_Qe1Cq_as_E_Q_Kq_v __pyx_string_tab[800]
#define __pyx_kp_b_iso88591_A_Qe5_CuA_1AT_2Qat1_WD_q_4_a_IQ __pyx_string_tab[801]
#define __pyx_kp_b_iso88591_A_QoQ __pyx_string_tab[802]
#define __pyx_kp_b_iso88591_A_QoT __pyx_string_tab[803]
#define __pyx_kp_b_iso88591_A_R_A __pyx_string_tab[804]
#define __pyx_kp_b_iso88591_A_Ry_1_l_O5_3e1Be1Cq_Kq_1_L_A_M __pyx_string_tab[805]
#define __pyx_kp_b_iso88591_A_T_8_q_at1_at1_q_A_a_Q_a __pyx_string_tab[806]
#define __pyx_kp_b_iso88591_A__A_4q_M_4y_HAT_3a_j_q __pyx_string_tab[807]
#define __pyx_kp_b_iso88591_A_a_E_ar_A_1A_QfAQa_Qaq_aq_Qaq_a __pyx_string_tab[808]
#define __pyx_kp_b_iso88591_A_i_1 __pyx_string_tab[809]
#define __pyx_kp_b_iso88591_A_q_1D_AS_Q_HA_HA __pyx_string_tab[810]
#define __pyx_kp_b_iso88591_A_q_1D_a __pyx_string_tab[811]
#define __pyx_kp_b_iso88591_A_q_a_q_A_d_q_Qc_Q_b_A_q __pyx_string_tab[812]
#define __pyx_kp_b_iso88591_A_s_4q __pyx_string_tab[813]
#define __pyx_kp_b_iso88591_A_t1 __pyx_string_tab[814]
#define __pyx_kp_b_iso88591_A_t_1G1_2Q_r_Qb_AQc_1_U_q_r_T_G1 __pyx_string_tab[815]
#define __pyx_kp_b_iso88591_A_t_31L __pyx_string_tab[816]
#define __pyx_kp_b_iso88591_A_waq_Baxt2Qhd_AQ __pyx_string_tab[817]
#define __pyx_kp_b_iso88591_A_wb_Rt7_Bc_M_A_A_a_e5_2Qa_r_E_a __pyx_string_tab[818]
#define __pyx_kp_b_iso88591_Cs __pyx_string_tab[819]
#define __pyx_kp_b_iso88591_Q_M_1_Qc_QoQ_A_A_WA_q_q_Qc_QoQ __pyx_string_tab[820]
#define __pyx_kp_b_iso88591_Q_q_a_q_t_aq_l_wgQ_j_4Bd_q_2T_f __pyx_string_tab[821]
#define __pyx_kp_b_iso88591_a_avQe1A_d_q_1A_M_AQ_a_4q_AQ_Qa __pyx_string_tab[822]
#define __pyx_kp_b_iso88591_j_4s_4s_A_A_A_r_Q_Q __pyx_string_tab[823]
#define __pyx_kp_b_iso88591_q_1_5T_q_Qa_8_IQa_1A_1A_AQ_1_Q __pyx_string_tab[824]
#define __pyx_kp_b_iso88591_s_c_as_83at1Cq_1A_as_Q_aq_AQc_1 __pyx_string_tab[825]
#define __pyx_kp_b_version_150_Note_that_GLSL_ES_3 __pyx_string_tab[826]
#define __pyx_kp_b_version_150_out_vec4_out_FragCo __pyx_string_tab[827]
#define __pyx_n_b_O __pyx_string_tab[828]
#define __pyx_float__2 __pyx_number_tab[0]
#define __pyx_float_0_ __pyx_number_tab[1]
#define __pyx_float_1_ __pyx_number_tab[2]
#define __pyx_float_0_0 __pyx_number_tab[3]
#define __pyx_float_0_1 __pyx_number_tab[4]
#define __pyx_float_0_3 __pyx_number_tab[5]
#define __pyx_float_0_5 __pyx_number_tab[6]
#define __pyx_float_0_6 __pyx_number_tab[7]
#define __pyx_float_0_8 __pyx_number_tab[8]
#define __pyx_float_0_9 __pyx_number_tab[9]
#define __pyx_float_1_0 __pyx_number_tab[10]
#define __pyx_float_neg_2_0 __pyx_number_tab[11]
#define __pyx_float_2_0 __pyx_number_tab[12]
#define __pyx_float_neg_2_2 __pyx_number_tab[13]
#define __pyx_float_2_2 __pyx_number_tab[14]
#define __pyx_float_0_01 __pyx_number_tab[15]
#define __pyx_float_0_05 __pyx_number_tab[16]
#define __pyx_float_10_0 __pyx_number_tab[17]
#define __pyx_float_30_0 __pyx_number_tab[18]
#define __pyx_float_50_0 __pyx_number_tab[19]
#define __pyx_float_100_0 __pyx_number_tab[20]
#define __pyx_float_360_0 __pyx_number_tab[21]
#define __pyx_int_0 __pyx_number_tab[22]
#define __pyx_int_neg_1 __pyx_number_tab[23]
#define __pyx_int_1 __pyx_number_tab[24]
#define __pyx_int_2 __pyx_number_tab[25]
#define __pyx_int_3 __pyx_number_tab[26]
#define __pyx_int_4 __pyx_number_tab[27]
#define __pyx_int_5 __pyx_number_tab[28]
#define __pyx_int_6 __pyx_number_tab[29]
#define __pyx_int_8 __pyx_number_tab[30]
#define __pyx_int_10 __pyx_number_tab[31]
#define __pyx_int_30 __pyx_number_tab[32]
#define __pyx_int_60 __pyx_number_tab[33]
#define __pyx_int_100 __pyx_number_tab[34]
#define __pyx_int_136983863 __pyx_number_tab[35]
/* #### Code section: module_state_clear ### */
#if CYTHON_USE_MODULE_STATE
static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) {
  __pyx_mstatetype *clear_module_state = __Pyx_PyModule_GetState(m);
  if (!clear_module_state) return 0;
  Py_CLEAR(clear_module_state->__pyx_d);
  Py_CLEAR(clear_module_state->__pyx_b);
  Py_CLEAR(clear_module_state->__pyx_cython_runtime);
  Py_CLEAR(clear_module_state->__pyx_empty_tuple);
  Py_CLEAR(clear_module_state->__pyx_empty_bytes);
  Py_CLEAR(clear_module_state->__pyx_empty_unicode);
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  __Pyx_State_RemoveModule(NULL);
  #endif
  Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4type_type);
  Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4bool_bool);
  Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_7complex_complex);
  Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_5array_array);
  Py_CLEAR(clear_module_state->__pyx_ptype_8CyOpenGL_vector3);
  Py_CLEAR(clear_module_state->__pyx_type_8CyOpenGL_vector3);
  Py_CLEAR(clear_module_state->__pyx_ptype_8CyOpenGL_GLobject);
  Py_CLEAR(clear_module_state->__pyx_type_8CyOpenGL_GLobject);
  Py_CLEAR(clear_module_state->__pyx_ptype_8CyOpenGL_WireframeSphere);
  Py_CLEAR(clear_module_state->__pyx_type_8CyOpenGL_WireframeSphere);
  Py_CLEAR(clear_module_state->__pyx_ptype_8CyOpenGL_MeshedSurface);
  Py_CLEAR(clear_module_state->__pyx_type_8CyOpenGL_MeshedSurface);
  Py_CLEAR(clear_module_state->__pyx_ptype_8CyOpenGL_PoincareTriangle);
  Py_CLEAR(clear_module_state->__pyx_type_8CyOpenGL_PoincareTriangle);
  Py_CLEAR(clear_module_state->__pyx_ptype_8CyOpenGL_PoincarePolygon);
  Py_CLEAR(clear_module_state->__pyx_type_8CyOpenGL_PoincarePolygon);
  Py_CLEAR(clear_module_state->__pyx_ptype_8CyOpenGL_KleinPolygon);
  Py_CLEAR(clear_module_state->__pyx_type_8CyOpenGL_KleinPolygon);
  Py_CLEAR(clear_module_state->__pyx_ptype_8CyOpenGL_Colorizer);
  Py_CLEAR(clear_module_state->__pyx_type_8CyOpenGL_Colorizer);
  Py_CLEAR(clear_module_state->__pyx_ptype_8CyOpenGL_Horosphere);
  Py_CLEAR(clear_module_state->__pyx_type_8CyOpenGL_Horosphere);
  Py_CLEAR(clear_module_state->__pyx_ptype_8CyOpenGL_HoroballGroup);
  Py_CLEAR(clear_module_state->__pyx_type_8CyOpenGL_HoroballGroup);
  Py_CLEAR(clear_module_state->__pyx_ptype_8CyOpenGL_Parallelogram);
  Py_CLEAR(clear_module_state->__pyx_type_8CyOpenGL_Parallelogram);
  Py_CLEAR(clear_module_state->__pyx_ptype_8CyOpenGL_EdgeSet);
  Py_CLEAR(clear_module_state->__pyx_type_8CyOpenGL_EdgeSet);
  Py_CLEAR(clear_module_state->__pyx_ptype_8CyOpenGL_FordEdgeSet);
  Py_CLEAR(clear_module_state->__pyx_type_8CyOpenGL_FordEdgeSet);
  Py_CLEAR(clear_module_state->__pyx_ptype_8CyOpenGL_TriangulationEdgeSet);
  Py_CLEAR(clear_module_state->__pyx_type_8CyOpenGL_TriangulationEdgeSet);
  Py_CLEAR(clear_module_state->__pyx_ptype_8CyOpenGL_Label);
  Py_CLEAR(clear_module_state->__pyx_type_8CyOpenGL_Label);
  Py_CLEAR(clear_module_state->__pyx_ptype_8CyOpenGL_LabelSet);
  Py_CLEAR(clear_module_state->__pyx_type_8CyOpenGL_LabelSet);
  Py_CLEAR(clear_module_state->__pyx_ptype_8CyOpenGL_HoroballScene);
  Py_CLEAR(clear_module_state->__pyx_type_8CyOpenGL_HoroballScene);
  Py_CLEAR(clear_module_state->__pyx_ptype_8CyOpenGL_DataBasedTexture);
  Py_CLEAR(clear_module_state->__pyx_type_8CyOpenGL_DataBasedTexture);
  Py_CLEAR(clear_module_state->__pyx_ptype_8CyOpenGL_UniformBufferObject);
  Py_CLEAR(clear_module_state->__pyx_type_8CyOpenGL_UniformBufferObject);
  Py_CLEAR(clear_module_state->__pyx_ptype_8CyOpenGL_GLSLProgram);
  Py_CLEAR(clear_module_state->__pyx_type_8CyOpenGL_GLSLProgram);
  Py_CLEAR(clear_module_state->__pyx_ptype_8CyOpenGL_VertexBuffer);
  Py_CLEAR(clear_module_state->__pyx_type_8CyOpenGL_VertexBuffer);
  Py_CLEAR(clear_module_state->__pyx_ptype_8CyOpenGL_GLSLPerspectiveView);
  Py_CLEAR(clear_module_state->__pyx_type_8CyOpenGL_GLSLPerspectiveView);
  Py_CLEAR(clear_module_state->__pyx_ptype_8CyOpenGL_Triangle);
  Py_CLEAR(clear_module_state->__pyx_type_8CyOpenGL_Triangle);
  Py_CLEAR(clear_module_state->__pyx_ptype_8CyOpenGL___pyx_defaults);
  Py_CLEAR(clear_module_state->__pyx_type_8CyOpenGL___pyx_defaults);
  Py_CLEAR(clear_module_state->__pyx_ptype_8CyOpenGL___pyx_scope_struct__draw);
  Py_CLEAR(clear_module_state->__pyx_type_8CyOpenGL___pyx_scope_struct__draw);
  Py_CLEAR(clear_module_state->__pyx_ptype_8CyOpenGL___pyx_scope_struct_1_genexpr);
  Py_CLEAR(clear_module_state->__pyx_type_8CyOpenGL___pyx_scope_struct_1_genexpr);
  Py_CLEAR(clear_module_state->__pyx_array_type);
  Py_CLEAR(clear_module_state->__pyx_type___pyx_array);
  Py_CLEAR(clear_module_state->__pyx_MemviewEnum_type);
  Py_CLEAR(clear_module_state->__pyx_type___pyx_MemviewEnum);
  Py_CLEAR(clear_module_state->__pyx_memoryview_type);
  Py_CLEAR(clear_module_state->__pyx_type___pyx_memoryview);
  Py_CLEAR(clear_module_state->__pyx_memoryviewslice_type);
  Py_CLEAR(clear_module_state->__pyx_type___pyx_memoryviewslice);
  Py_CLEAR(clear_module_state->__pyx_k__9);
  Py_CLEAR(clear_module_state->__pyx_k__10);
  Py_CLEAR(clear_module_state->__pyx_k__11);
  Py_CLEAR(clear_module_state->__pyx_k__12);
  Py_CLEAR(clear_module_state->__pyx_k__13);
  Py_CLEAR(clear_module_state->__pyx_k__14);
  Py_CLEAR(clear_module_state->__pyx_k__15);
  for (int i=0; i<1; ++i) { Py_CLEAR(clear_module_state->__pyx_slice[i]); }
  for (int i=0; i<17; ++i) { Py_CLEAR(clear_module_state->__pyx_tuple[i]); }
  for (int i=0; i<96; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); }
  for (int i=0; i<829; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); }
  for (int i=0; i<36; ++i) { Py_CLEAR(clear_module_state->__pyx_number_tab[i]); }
/* #### Code section: module_state_clear_contents ### */
/* CommonTypesMetaclass.module_state_clear */
Py_CLEAR(clear_module_state->__pyx_CommonTypesMetaclassType);

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

/* Generator.module_state_clear */
Py_CLEAR(clear_module_state->__pyx_GeneratorType);

/* #### Code section: module_state_clear_end ### */
return 0;
}
#endif
/* #### Code section: module_state_traverse ### */
#if CYTHON_USE_MODULE_STATE
static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) {
  __pyx_mstatetype *traverse_module_state = __Pyx_PyModule_GetState(m);
  if (!traverse_module_state) return 0;
  Py_VISIT(traverse_module_state->__pyx_d);
  Py_VISIT(traverse_module_state->__pyx_b);
  Py_VISIT(traverse_module_state->__pyx_cython_runtime);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_tuple);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_bytes);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_unicode);
  Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4type_type);
  Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4bool_bool);
  Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_7complex_complex);
  Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_5array_array);
  Py_VISIT(traverse_module_state->__pyx_ptype_8CyOpenGL_vector3);
  Py_VISIT(traverse_module_state->__pyx_type_8CyOpenGL_vector3);
  Py_VISIT(traverse_module_state->__pyx_ptype_8CyOpenGL_GLobject);
  Py_VISIT(traverse_module_state->__pyx_type_8CyOpenGL_GLobject);
  Py_VISIT(traverse_module_state->__pyx_ptype_8CyOpenGL_WireframeSphere);
  Py_VISIT(traverse_module_state->__pyx_type_8CyOpenGL_WireframeSphere);
  Py_VISIT(traverse_module_state->__pyx_ptype_8CyOpenGL_MeshedSurface);
  Py_VISIT(traverse_module_state->__pyx_type_8CyOpenGL_MeshedSurface);
  Py_VISIT(traverse_module_state->__pyx_ptype_8CyOpenGL_PoincareTriangle);
  Py_VISIT(traverse_module_state->__pyx_type_8CyOpenGL_PoincareTriangle);
  Py_VISIT(traverse_module_state->__pyx_ptype_8CyOpenGL_PoincarePolygon);
  Py_VISIT(traverse_module_state->__pyx_type_8CyOpenGL_PoincarePolygon);
  Py_VISIT(traverse_module_state->__pyx_ptype_8CyOpenGL_KleinPolygon);
  Py_VISIT(traverse_module_state->__pyx_type_8CyOpenGL_KleinPolygon);
  Py_VISIT(traverse_module_state->__pyx_ptype_8CyOpenGL_Colorizer);
  Py_VISIT(traverse_module_state->__pyx_type_8CyOpenGL_Colorizer);
  Py_VISIT(traverse_module_state->__pyx_ptype_8CyOpenGL_Horosphere);
  Py_VISIT(traverse_module_state->__pyx_type_8CyOpenGL_Horosphere);
  Py_VISIT(traverse_module_state->__pyx_ptype_8CyOpenGL_HoroballGroup);
  Py_VISIT(traverse_module_state->__pyx_type_8CyOpenGL_HoroballGroup);
  Py_VISIT(traverse_module_state->__pyx_ptype_8CyOpenGL_Parallelogram);
  Py_VISIT(traverse_module_state->__pyx_type_8CyOpenGL_Parallelogram);
  Py_VISIT(traverse_module_state->__pyx_ptype_8CyOpenGL_EdgeSet);
  Py_VISIT(traverse_module_state->__pyx_type_8CyOpenGL_EdgeSet);
  Py_VISIT(traverse_module_state->__pyx_ptype_8CyOpenGL_FordEdgeSet);
  Py_VISIT(traverse_module_state->__pyx_type_8CyOpenGL_FordEdgeSet);
  Py_VISIT(traverse_module_state->__pyx_ptype_8CyOpenGL_TriangulationEdgeSet);
  Py_VISIT(traverse_module_state->__pyx_type_8CyOpenGL_TriangulationEdgeSet);
  Py_VISIT(traverse_module_state->__pyx_ptype_8CyOpenGL_Label);
  Py_VISIT(traverse_module_state->__pyx_type_8CyOpenGL_Label);
  Py_VISIT(traverse_module_state->__pyx_ptype_8CyOpenGL_LabelSet);
  Py_VISIT(traverse_module_state->__pyx_type_8CyOpenGL_LabelSet);
  Py_VISIT(traverse_module_state->__pyx_ptype_8CyOpenGL_HoroballScene);
  Py_VISIT(traverse_module_state->__pyx_type_8CyOpenGL_HoroballScene);
  Py_VISIT(traverse_module_state->__pyx_ptype_8CyOpenGL_DataBasedTexture);
  Py_VISIT(traverse_module_state->__pyx_type_8CyOpenGL_DataBasedTexture);
  Py_VISIT(traverse_module_state->__pyx_ptype_8CyOpenGL_UniformBufferObject);
  Py_VISIT(traverse_module_state->__pyx_type_8CyOpenGL_UniformBufferObject);
  Py_VISIT(traverse_module_state->__pyx_ptype_8CyOpenGL_GLSLProgram);
  Py_VISIT(traverse_module_state->__pyx_type_8CyOpenGL_GLSLProgram);
  Py_VISIT(traverse_module_state->__pyx_ptype_8CyOpenGL_VertexBuffer);
  Py_VISIT(traverse_module_state->__pyx_type_8CyOpenGL_VertexBuffer);
  Py_VISIT(traverse_module_state->__pyx_ptype_8CyOpenGL_GLSLPerspectiveView);
  Py_VISIT(traverse_module_state->__pyx_type_8CyOpenGL_GLSLPerspectiveView);
  Py_VISIT(traverse_module_state->__pyx_ptype_8CyOpenGL_Triangle);
  Py_VISIT(traverse_module_state->__pyx_type_8CyOpenGL_Triangle);
  Py_VISIT(traverse_module_state->__pyx_ptype_8CyOpenGL___pyx_defaults);
  Py_VISIT(traverse_module_state->__pyx_type_8CyOpenGL___pyx_defaults);
  Py_VISIT(traverse_module_state->__pyx_ptype_8CyOpenGL___pyx_scope_struct__draw);
  Py_VISIT(traverse_module_state->__pyx_type_8CyOpenGL___pyx_scope_struct__draw);
  Py_VISIT(traverse_module_state->__pyx_ptype_8CyOpenGL___pyx_scope_struct_1_genexpr);
  Py_VISIT(traverse_module_state->__pyx_type_8CyOpenGL___pyx_scope_struct_1_genexpr);
  Py_VISIT(traverse_module_state->__pyx_array_type);
  Py_VISIT(traverse_module_state->__pyx_type___pyx_array);
  Py_VISIT(traverse_module_state->__pyx_MemviewEnum_type);
  Py_VISIT(traverse_module_state->__pyx_type___pyx_MemviewEnum);
  Py_VISIT(traverse_module_state->__pyx_memoryview_type);
  Py_VISIT(traverse_module_state->__pyx_type___pyx_memoryview);
  Py_VISIT(traverse_module_state->__pyx_memoryviewslice_type);
  Py_VISIT(traverse_module_state->__pyx_type___pyx_memoryviewslice);
  Py_VISIT(traverse_module_state->__pyx_k__9);
  Py_VISIT(traverse_module_state->__pyx_k__10);
  Py_VISIT(traverse_module_state->__pyx_k__11);
  Py_VISIT(traverse_module_state->__pyx_k__12);
  Py_VISIT(traverse_module_state->__pyx_k__13);
  Py_VISIT(traverse_module_state->__pyx_k__14);
  Py_VISIT(traverse_module_state->__pyx_k__15);
  for (int i=0; i<1; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_slice[i]); }
  for (int i=0; i<17; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_tuple[i]); }
  for (int i=0; i<96; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); }
  for (int i=0; i<829; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); }
  for (int i=0; i<36; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_number_tab[i]); }
/* #### Code section: module_state_traverse_contents ### */
/* CommonTypesMetaclass.module_state_traverse */
Py_VISIT(traverse_module_state->__pyx_CommonTypesMetaclassType);

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

/* Generator.module_state_traverse */
Py_VISIT(traverse_module_state->__pyx_GeneratorType);

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

/* "carray.from_py":78
 *     object PyErr_Format(exc, const char *format, ...)
 * 
 * @cname("__Pyx_carray_from_py_GLfloat")             # <<<<<<<<<<<<<<
 * cdef int __Pyx_carray_from_py_GLfloat(object o, base_type *v, Py_ssize_t length) except -1:
 *     cdef Py_ssize_t i = length
*/

static int __Pyx_carray_from_py_GLfloat(PyObject *__pyx_v_o, GLfloat *__pyx_v_v, Py_ssize_t __pyx_v_length) {
  Py_ssize_t __pyx_v_i;
  PyObject *__pyx_v_item = NULL;
  int __pyx_r;
  __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;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  PyObject *__pyx_t_10 = NULL;
  GLfloat __pyx_t_11;
  char const *__pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_carray_from_py_GLfloat", 0);

  /* "carray.from_py":80
 * @cname("__Pyx_carray_from_py_GLfloat")
 * cdef int __Pyx_carray_from_py_GLfloat(object o, base_type *v, Py_ssize_t length) except -1:
 *     cdef Py_ssize_t i = length             # <<<<<<<<<<<<<<
 *     try:
 *         i = len(o)
*/
  __pyx_v_i = __pyx_v_length;

  /* "carray.from_py":81
 * cdef int __Pyx_carray_from_py_GLfloat(object o, base_type *v, Py_ssize_t length) except -1:
 *     cdef Py_ssize_t i = length
 *     try:             # <<<<<<<<<<<<<<
 *         i = len(o)
 *     except (TypeError, OverflowError):
*/
  {
    __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:*/ {

      /* "carray.from_py":82
 *     cdef Py_ssize_t i = length
 *     try:
 *         i = len(o)             # <<<<<<<<<<<<<<
 *     except (TypeError, OverflowError):
 *         pass
*/
      __pyx_t_4 = PyObject_Length(__pyx_v_o); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(7, 82, __pyx_L3_error)
      __pyx_v_i = __pyx_t_4;

      /* "carray.from_py":81
 * cdef int __Pyx_carray_from_py_GLfloat(object o, base_type *v, Py_ssize_t length) except -1:
 *     cdef Py_ssize_t i = length
 *     try:             # <<<<<<<<<<<<<<
 *         i = len(o)
 *     except (TypeError, OverflowError):
*/
    }
    __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:;

    /* "carray.from_py":83
 *     try:
 *         i = len(o)
 *     except (TypeError, OverflowError):             # <<<<<<<<<<<<<<
 *         pass
 *     if i == length:
*/
    __pyx_t_5 = __Pyx_PyErr_ExceptionMatches2(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), ((PyObject *)(((PyTypeObject*)PyExc_OverflowError))));
    if (__pyx_t_5) {
      __Pyx_ErrRestore(0,0,0);
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;

    /* "carray.from_py":81
 * cdef int __Pyx_carray_from_py_GLfloat(object o, base_type *v, Py_ssize_t length) except -1:
 *     cdef Py_ssize_t i = length
 *     try:             # <<<<<<<<<<<<<<
 *         i = len(o)
 *     except (TypeError, OverflowError):
*/
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "carray.from_py":85
 *     except (TypeError, OverflowError):
 *         pass
 *     if i == length:             # <<<<<<<<<<<<<<
 *         for i, item in enumerate(o):
 *             if i >= length:
*/
  __pyx_t_6 = (__pyx_v_i == __pyx_v_length);
  if (__pyx_t_6) {

    /* "carray.from_py":86
 *         pass
 *     if i == length:
 *         for i, item in enumerate(o):             # <<<<<<<<<<<<<<
 *             if i >= length:
 *                 break
*/
    __pyx_t_4 = 0;
    if (likely(PyList_CheckExact(__pyx_v_o)) || PyTuple_CheckExact(__pyx_v_o)) {
      __pyx_t_7 = __pyx_v_o; __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_o); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 86, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(7, 86, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_9)) {
        if (likely(PyList_CheckExact(__pyx_t_7))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_7);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(7, 86, __pyx_L1_error)
            #endif
            if (__pyx_t_8 >= __pyx_temp) break;
          }
          __pyx_t_10 = __Pyx_PyList_GetItemRefFast(__pyx_t_7, __pyx_t_8, __Pyx_ReferenceSharing_OwnStrongReference);
          ++__pyx_t_8;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_7);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(7, 86, __pyx_L1_error)
            #endif
            if (__pyx_t_8 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_10 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_8));
          #else
          __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_8);
          #endif
          ++__pyx_t_8;
        }
        if (unlikely(!__pyx_t_10)) __PYX_ERR(7, 86, __pyx_L1_error)
      } else {
        __pyx_t_10 = __pyx_t_9(__pyx_t_7);
        if (unlikely(!__pyx_t_10)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(7, 86, __pyx_L1_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_10);
      __pyx_t_10 = 0;
      __pyx_v_i = __pyx_t_4;
      __pyx_t_4 = (__pyx_t_4 + 1);

      /* "carray.from_py":87
 *     if i == length:
 *         for i, item in enumerate(o):
 *             if i >= length:             # <<<<<<<<<<<<<<
 *                 break
 *             v[i] = item
*/
      __pyx_t_6 = (__pyx_v_i >= __pyx_v_length);
      if (__pyx_t_6) {

        /* "carray.from_py":88
 *         for i, item in enumerate(o):
 *             if i >= length:
 *                 break             # <<<<<<<<<<<<<<
 *             v[i] = item
 *         else:
*/
        goto __pyx_L13_break;

        /* "carray.from_py":87
 *     if i == length:
 *         for i, item in enumerate(o):
 *             if i >= length:             # <<<<<<<<<<<<<<
 *                 break
 *             v[i] = item
*/
      }

      /* "carray.from_py":89
 *             if i >= length:
 *                 break
 *             v[i] = item             # <<<<<<<<<<<<<<
 *         else:
 *             i += 1  # convert index to length
*/
      __pyx_t_11 = __Pyx_PyFloat_AsFloat(__pyx_v_item); if (unlikely((__pyx_t_11 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(7, 89, __pyx_L1_error)
      (__pyx_v_v[__pyx_v_i]) = __pyx_t_11;

      /* "carray.from_py":86
 *         pass
 *     if i == length:
 *         for i, item in enumerate(o):             # <<<<<<<<<<<<<<
 *             if i >= length:
 *                 break
*/
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    goto __pyx_L15_for_else;
    __pyx_L13_break:;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    goto __pyx_L16_for_end;
    /*else*/ {
      __pyx_L15_for_else:;

      /* "carray.from_py":91
 *             v[i] = item
 *         else:
 *             i += 1  # convert index to length             # <<<<<<<<<<<<<<
 *             if i == length:
 *                 return 0
*/
      __pyx_v_i = (__pyx_v_i + 1);

      /* "carray.from_py":92
 *         else:
 *             i += 1  # convert index to length
 *             if i == length:             # <<<<<<<<<<<<<<
 *                 return 0
 * 
*/
      __pyx_t_6 = (__pyx_v_i == __pyx_v_length);
      if (__pyx_t_6) {

        /* "carray.from_py":93
 *             i += 1  # convert index to length
 *             if i == length:
 *                 return 0             # <<<<<<<<<<<<<<
 * 
 *     PyErr_Format(
*/
        __pyx_r = 0;
        goto __pyx_L0;

        /* "carray.from_py":92
 *         else:
 *             i += 1  # convert index to length
 *             if i == length:             # <<<<<<<<<<<<<<
 *                 return 0
 * 
*/
      }
    }
    __pyx_L16_for_end:;

    /* "carray.from_py":85
 *     except (TypeError, OverflowError):
 *         pass
 *     if i == length:             # <<<<<<<<<<<<<<
 *         for i, item in enumerate(o):
 *             if i >= length:
*/
  }

  /* "carray.from_py":98
 *         IndexError,
 *         ("too many values found during array assignment, expected %zd"
 *          if i >= length else             # <<<<<<<<<<<<<<
 *          "not enough values found during array assignment, expected %zd, got %zd"),
 *         length, i)
*/
  __pyx_t_6 = (__pyx_v_i >= __pyx_v_length);
  if (__pyx_t_6) {
    __pyx_t_12 = __pyx_k_too_many_values_found_during_arr;
  } else {
    __pyx_t_12 = __pyx_k_not_enough_values_found_during_a;
  }

  /* "carray.from_py":95
 *                 return 0
 * 
 *     PyErr_Format(             # <<<<<<<<<<<<<<
 *         IndexError,
 *         ("too many values found during array assignment, expected %zd"
*/
  __pyx_t_7 = PyErr_Format(((PyObject *)(((PyTypeObject*)PyExc_IndexError))), __pyx_t_12, __pyx_v_length, __pyx_v_i); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 95, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "carray.from_py":78
 *     object PyErr_Format(exc, const char *format, ...)
 * 
 * @cname("__Pyx_carray_from_py_GLfloat")             # <<<<<<<<<<<<<<
 * cdef int __Pyx_carray_from_py_GLfloat(object o, base_type *v, Py_ssize_t length) except -1:
 *     cdef Py_ssize_t i = length
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("carray.from_py.__Pyx_carray_from_py_GLfloat", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_item);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "carray.to_py":113
 * 
 * 
 * @cname("__Pyx_carray_to_py_GLfloat")             # <<<<<<<<<<<<<<
 * cdef inline list __Pyx_carray_to_py_GLfloat(base_type *v, Py_ssize_t length):
 *     cdef Py_ssize_t i
*/

static CYTHON_INLINE PyObject *__Pyx_carray_to_py_GLfloat(GLfloat *__pyx_v_v, Py_ssize_t __pyx_v_length) {
  Py_ssize_t __pyx_v_i;
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_v_l = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_carray_to_py_GLfloat", 0);

  /* "carray.to_py":117
 *     cdef Py_ssize_t i
 *     cdef object value
 *     l = PyList_New(length)             # <<<<<<<<<<<<<<
 *     for i in range(length):
 *         value = v[<size_t> i]
*/
  __pyx_t_1 = PyList_New(__pyx_v_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_l = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "carray.to_py":118
 *     cdef object value
 *     l = PyList_New(length)
 *     for i in range(length):             # <<<<<<<<<<<<<<
 *         value = v[<size_t> i]
 *         Py_INCREF(value)
*/
  __pyx_t_2 = __pyx_v_length;
  __pyx_t_3 = __pyx_t_2;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;

    /* "carray.to_py":119
 *     l = PyList_New(length)
 *     for i in range(length):
 *         value = v[<size_t> i]             # <<<<<<<<<<<<<<
 *         Py_INCREF(value)
 *         __Pyx_PyList_SET_ITEM(l, i, value)
*/
    __pyx_t_1 = PyFloat_FromDouble((__pyx_v_v[((size_t)__pyx_v_i)])); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 119, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "carray.to_py":120
 *     for i in range(length):
 *         value = v[<size_t> i]
 *         Py_INCREF(value)             # <<<<<<<<<<<<<<
 *         __Pyx_PyList_SET_ITEM(l, i, value)
 *     return l
*/
    Py_INCREF(__pyx_v_value);

    /* "carray.to_py":121
 *         value = v[<size_t> i]
 *         Py_INCREF(value)
 *         __Pyx_PyList_SET_ITEM(l, i, value)             # <<<<<<<<<<<<<<
 *     return l
 * 
*/
    __pyx_t_5 = __Pyx_PyList_SET_ITEM(__pyx_v_l, __pyx_v_i, __pyx_v_value); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(7, 121, __pyx_L1_error)
  }

  /* "carray.to_py":122
 *         Py_INCREF(value)
 *         __Pyx_PyList_SET_ITEM(l, i, value)
 *     return l             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_l);
  __pyx_r = __pyx_v_l;
  goto __pyx_L0;

  /* "carray.to_py":113
 * 
 * 
 * @cname("__Pyx_carray_to_py_GLfloat")             # <<<<<<<<<<<<<<
 * cdef inline list __Pyx_carray_to_py_GLfloat(base_type *v, Py_ssize_t length):
 *     cdef Py_ssize_t i
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("carray.to_py.__Pyx_carray_to_py_GLfloat", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XDECREF(__pyx_v_l);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "carray.to_py":125
 * 
 * 
 * @cname("__Pyx_carray_to_tuple_GLfloat")             # <<<<<<<<<<<<<<
 * cdef inline tuple __Pyx_carray_to_tuple_GLfloat(base_type *v, Py_ssize_t length):
 *     cdef Py_ssize_t i
*/

static CYTHON_INLINE PyObject *__Pyx_carray_to_tuple_GLfloat(GLfloat *__pyx_v_v, Py_ssize_t __pyx_v_length) {
  Py_ssize_t __pyx_v_i;
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_v_t = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_carray_to_tuple_GLfloat", 0);

  /* "carray.to_py":129
 *     cdef Py_ssize_t i
 *     cdef object value
 *     t = PyTuple_New(length)             # <<<<<<<<<<<<<<
 *     for i in range(length):
 *         value = v[<size_t> i]
*/
  __pyx_t_1 = PyTuple_New(__pyx_v_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_t = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "carray.to_py":130
 *     cdef object value
 *     t = PyTuple_New(length)
 *     for i in range(length):             # <<<<<<<<<<<<<<
 *         value = v[<size_t> i]
 *         Py_INCREF(value)
*/
  __pyx_t_2 = __pyx_v_length;
  __pyx_t_3 = __pyx_t_2;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;

    /* "carray.to_py":131
 *     t = PyTuple_New(length)
 *     for i in range(length):
 *         value = v[<size_t> i]             # <<<<<<<<<<<<<<
 *         Py_INCREF(value)
 *         __Pyx_PyTuple_SET_ITEM(t, i, value)
*/
    __pyx_t_1 = PyFloat_FromDouble((__pyx_v_v[((size_t)__pyx_v_i)])); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 131, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "carray.to_py":132
 *     for i in range(length):
 *         value = v[<size_t> i]
 *         Py_INCREF(value)             # <<<<<<<<<<<<<<
 *         __Pyx_PyTuple_SET_ITEM(t, i, value)
 *     return t
*/
    Py_INCREF(__pyx_v_value);

    /* "carray.to_py":133
 *         value = v[<size_t> i]
 *         Py_INCREF(value)
 *         __Pyx_PyTuple_SET_ITEM(t, i, value)             # <<<<<<<<<<<<<<
 *     return t
*/
    __pyx_t_5 = __Pyx_PyTuple_SET_ITEM(__pyx_v_t, __pyx_v_i, __pyx_v_value); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(7, 133, __pyx_L1_error)
  }

  /* "carray.to_py":134
 *         Py_INCREF(value)
 *         __Pyx_PyTuple_SET_ITEM(t, i, value)
 *     return t             # <<<<<<<<<<<<<<
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_t);
  __pyx_r = __pyx_v_t;
  goto __pyx_L0;

  /* "carray.to_py":125
 * 
 * 
 * @cname("__Pyx_carray_to_tuple_GLfloat")             # <<<<<<<<<<<<<<
 * cdef inline tuple __Pyx_carray_to_tuple_GLfloat(base_type *v, Py_ssize_t length):
 *     cdef Py_ssize_t i
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("carray.to_py.__Pyx_carray_to_tuple_GLfloat", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XDECREF(__pyx_v_t);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":137
 *         cdef bint dtype_is_object
 * 
 *     def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,             # <<<<<<<<<<<<<<
 *                   mode="c", bint allocate_buffer=True):
 * 
*/

/* Python wrapper */
static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_shape = 0;
  Py_ssize_t __pyx_v_itemsize;
  PyObject *__pyx_v_format = 0;
  PyObject *__pyx_v_mode = 0;
  int __pyx_v_allocate_buffer;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[5] = {0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_shape,&__pyx_mstate_global->__pyx_n_u_itemsize,&__pyx_mstate_global->__pyx_n_u_format,&__pyx_mstate_global->__pyx_n_u_mode,&__pyx_mstate_global->__pyx_n_u_allocate_buffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(7, 137, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_VARARGS(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(7, 137, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_VARARGS(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(7, 137, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(7, 137, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(7, 137, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(7, 137, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__cinit__", 0) < (0)) __PYX_ERR(7, 137, __pyx_L3_error)
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_c));
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, i); __PYX_ERR(7, 137, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_VARARGS(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(7, 137, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_VARARGS(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(7, 137, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(7, 137, __pyx_L3_error)
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(7, 137, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(7, 137, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_c));
    }
    __pyx_v_shape = ((PyObject*)values[0]);
    __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(7, 137, __pyx_L3_error)
    __pyx_v_format = values[2];
    __pyx_v_mode = values[3];
    if (values[4]) {
      __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(7, 138, __pyx_L3_error)
    } else {

      /* "View.MemoryView":138
 * 
 *     def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,
 *                   mode="c", bint allocate_buffer=True):             # <<<<<<<<<<<<<<
 * 
 *         cdef int idx
*/
      __pyx_v_allocate_buffer = ((int)1);
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, __pyx_nargs); __PYX_ERR(7, 137, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(7, 137, __pyx_L1_error)
  if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
    PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(7, 137, __pyx_L1_error)
  }
  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer);

  /* "View.MemoryView":137
 *         cdef bint dtype_is_object
 * 
 *     def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,             # <<<<<<<<<<<<<<
 *                   mode="c", bint allocate_buffer=True):
 * 
*/

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

static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer) {
  int __pyx_v_idx;
  Py_ssize_t __pyx_v_dim;
  char __pyx_v_order;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  char *__pyx_t_7;
  int __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11[5];
  PyObject *__pyx_t_12 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__cinit__", 0);
  __Pyx_INCREF(__pyx_v_format);

  /* "View.MemoryView":143
 *         cdef Py_ssize_t dim
 * 
 *         self.ndim = <int> len(shape)             # <<<<<<<<<<<<<<
 *         self.itemsize = itemsize
 * 
*/
  if (unlikely(__pyx_v_shape == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(7, 143, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(7, 143, __pyx_L1_error)
  __pyx_v_self->ndim = ((int)__pyx_t_1);

  /* "View.MemoryView":144
 * 
 *         self.ndim = <int> len(shape)
 *         self.itemsize = itemsize             # <<<<<<<<<<<<<<
 * 
 *         if not self.ndim:
*/
  __pyx_v_self->itemsize = __pyx_v_itemsize;

  /* "View.MemoryView":146
 *         self.itemsize = itemsize
 * 
 *         if not self.ndim:             # <<<<<<<<<<<<<<
 *             raise ValueError, "Empty shape tuple for cython.array"
 * 
*/
  __pyx_t_2 = (!(__pyx_v_self->ndim != 0));
  if (unlikely(__pyx_t_2)) {

    /* "View.MemoryView":147
 * 
 *         if not self.ndim:
 *             raise ValueError, "Empty shape tuple for cython.array"             # <<<<<<<<<<<<<<
 * 
 *         if itemsize <= 0:
*/
    __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_ValueError))), __pyx_mstate_global->__pyx_kp_u_Empty_shape_tuple_for_cython_arr, 0, 0);
    __PYX_ERR(7, 147, __pyx_L1_error)

    /* "View.MemoryView":146
 *         self.itemsize = itemsize
 * 
 *         if not self.ndim:             # <<<<<<<<<<<<<<
 *             raise ValueError, "Empty shape tuple for cython.array"
 * 
*/
  }

  /* "View.MemoryView":149
 *             raise ValueError, "Empty shape tuple for cython.array"
 * 
 *         if itemsize <= 0:             # <<<<<<<<<<<<<<
 *             raise ValueError, "itemsize <= 0 for cython.array"
 * 
*/
  __pyx_t_2 = (__pyx_v_itemsize <= 0);
  if (unlikely(__pyx_t_2)) {

    /* "View.MemoryView":150
 * 
 *         if itemsize <= 0:
 *             raise ValueError, "itemsize <= 0 for cython.array"             # <<<<<<<<<<<<<<
 * 
 *         if not isinstance(format, bytes):
*/
    __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_ValueError))), __pyx_mstate_global->__pyx_kp_u_itemsize_0_for_cython_array, 0, 0);
    __PYX_ERR(7, 150, __pyx_L1_error)

    /* "View.MemoryView":149
 *             raise ValueError, "Empty shape tuple for cython.array"
 * 
 *         if itemsize <= 0:             # <<<<<<<<<<<<<<
 *             raise ValueError, "itemsize <= 0 for cython.array"
 * 
*/
  }

  /* "View.MemoryView":152
 *             raise ValueError, "itemsize <= 0 for cython.array"
 * 
 *         if not isinstance(format, bytes):             # <<<<<<<<<<<<<<
 *             format = format.encode('ASCII')
 *         self._format = format  # keep a reference to the byte string
*/
  __pyx_t_2 = PyBytes_Check(__pyx_v_format); 
  __pyx_t_3 = (!__pyx_t_2);
  if (__pyx_t_3) {

    /* "View.MemoryView":153
 * 
 *         if not isinstance(format, bytes):
 *             format = format.encode('ASCII')             # <<<<<<<<<<<<<<
 *         self._format = format  # keep a reference to the byte string
 *         self.format = self._format
*/
    __pyx_t_5 = __pyx_v_format;
    __Pyx_INCREF(__pyx_t_5);
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ASCII};
      __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_encode, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 153, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "View.MemoryView":152
 *             raise ValueError, "itemsize <= 0 for cython.array"
 * 
 *         if not isinstance(format, bytes):             # <<<<<<<<<<<<<<
 *             format = format.encode('ASCII')
 *         self._format = format  # keep a reference to the byte string
*/
  }

  /* "View.MemoryView":154
 *         if not isinstance(format, bytes):
 *             format = format.encode('ASCII')
 *         self._format = format  # keep a reference to the byte string             # <<<<<<<<<<<<<<
 *         self.format = self._format
 * 
*/
  __pyx_t_4 = __pyx_v_format;
  __Pyx_INCREF(__pyx_t_4);
  if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_4))) __PYX_ERR(7, 154, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_4);
  __Pyx_GOTREF(__pyx_v_self->_format);
  __Pyx_DECREF(__pyx_v_self->_format);
  __pyx_v_self->_format = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "View.MemoryView":155
 *             format = format.encode('ASCII')
 *         self._format = format  # keep a reference to the byte string
 *         self.format = self._format             # <<<<<<<<<<<<<<
 * 
 * 
*/
  if (unlikely(__pyx_v_self->_format == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
    __PYX_ERR(7, 155, __pyx_L1_error)
  }
  __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(7, 155, __pyx_L1_error)
  __pyx_v_self->format = __pyx_t_7;

  /* "View.MemoryView":158
 * 
 * 
 *         self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2)             # <<<<<<<<<<<<<<
 *         self._strides = self._shape + self.ndim
 * 
*/
  __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));

  /* "View.MemoryView":159
 * 
 *         self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2)
 *         self._strides = self._shape + self.ndim             # <<<<<<<<<<<<<<
 * 
 *         if not self._shape:
*/
  __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);

  /* "View.MemoryView":161
 *         self._strides = self._shape + self.ndim
 * 
 *         if not self._shape:             # <<<<<<<<<<<<<<
 *             raise MemoryError, "unable to allocate shape and strides."
 * 
*/
  __pyx_t_3 = (!(__pyx_v_self->_shape != 0));
  if (unlikely(__pyx_t_3)) {

    /* "View.MemoryView":162
 * 
 *         if not self._shape:
 *             raise MemoryError, "unable to allocate shape and strides."             # <<<<<<<<<<<<<<
 * 
 * 
*/
    __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_MemoryError))), __pyx_mstate_global->__pyx_kp_u_unable_to_allocate_shape_and_str, 0, 0);
    __PYX_ERR(7, 162, __pyx_L1_error)

    /* "View.MemoryView":161
 *         self._strides = self._shape + self.ndim
 * 
 *         if not self._shape:             # <<<<<<<<<<<<<<
 *             raise MemoryError, "unable to allocate shape and strides."
 * 
*/
  }

  /* "View.MemoryView":165
 * 
 * 
 *         for idx, dim in enumerate(shape):             # <<<<<<<<<<<<<<
 *             if dim <= 0:
 *                 raise ValueError, f"Invalid shape in axis {idx}: {dim}."
*/
  __pyx_t_8 = 0;
  __pyx_t_4 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_4);
  __pyx_t_1 = 0;
  for (;;) {
    {
      Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4);
      #if !CYTHON_ASSUME_SAFE_SIZE
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(7, 165, __pyx_L1_error)
      #endif
      if (__pyx_t_1 >= __pyx_temp) break;
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_5 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_1));
    #else
    __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_1);
    #endif
    ++__pyx_t_1;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 165, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(7, 165, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_dim = __pyx_t_9;
    __pyx_v_idx = __pyx_t_8;
    __pyx_t_8 = (__pyx_t_8 + 1);

    /* "View.MemoryView":166
 * 
 *         for idx, dim in enumerate(shape):
 *             if dim <= 0:             # <<<<<<<<<<<<<<
 *                 raise ValueError, f"Invalid shape in axis {idx}: {dim}."
 *             self._shape[idx] = dim
*/
    __pyx_t_3 = (__pyx_v_dim <= 0);
    if (unlikely(__pyx_t_3)) {

      /* "View.MemoryView":167
 *         for idx, dim in enumerate(shape):
 *             if dim <= 0:
 *                 raise ValueError, f"Invalid shape in axis {idx}: {dim}."             # <<<<<<<<<<<<<<
 *             self._shape[idx] = dim
 * 
*/
      __pyx_t_5 = __Pyx_PyUnicode_From_int(__pyx_v_idx, 0, ' ', 'd'); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 167, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_10 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_dim, 0, ' ', 'd'); if (unlikely(!__pyx_t_10)) __PYX_ERR(7, 167, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_11[0] = __pyx_mstate_global->__pyx_kp_u_Invalid_shape_in_axis;
      __pyx_t_11[1] = __pyx_t_5;
      __pyx_t_11[2] = __pyx_mstate_global->__pyx_kp_u_;
      __pyx_t_11[3] = __pyx_t_10;
      __pyx_t_11[4] = __pyx_mstate_global->__pyx_kp_u__2;
      __pyx_t_12 = __Pyx_PyUnicode_Join(__pyx_t_11, 5, 22 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5) + 2 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10) + 1, 127);
      if (unlikely(!__pyx_t_12)) __PYX_ERR(7, 167, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_ValueError))), __pyx_t_12, 0, 0);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __PYX_ERR(7, 167, __pyx_L1_error)

      /* "View.MemoryView":166
 * 
 *         for idx, dim in enumerate(shape):
 *             if dim <= 0:             # <<<<<<<<<<<<<<
 *                 raise ValueError, f"Invalid shape in axis {idx}: {dim}."
 *             self._shape[idx] = dim
*/
    }

    /* "View.MemoryView":168
 *             if dim <= 0:
 *                 raise ValueError, f"Invalid shape in axis {idx}: {dim}."
 *             self._shape[idx] = dim             # <<<<<<<<<<<<<<
 * 
 *         cdef char order
*/
    (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;

    /* "View.MemoryView":165
 * 
 * 
 *         for idx, dim in enumerate(shape):             # <<<<<<<<<<<<<<
 *             if dim <= 0:
 *                 raise ValueError, f"Invalid shape in axis {idx}: {dim}."
*/
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "View.MemoryView":171
 * 
 *         cdef char order
 *         if mode == 'c':             # <<<<<<<<<<<<<<
 *             order = b'C'
 *             self.mode = u'c'
*/
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_mode, __pyx_mstate_global->__pyx_n_u_c, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(7, 171, __pyx_L1_error)
  if (__pyx_t_3) {

    /* "View.MemoryView":172
 *         cdef char order
 *         if mode == 'c':
 *             order = b'C'             # <<<<<<<<<<<<<<
 *             self.mode = u'c'
 *         elif mode == 'fortran':
*/
    __pyx_v_order = 'C';

    /* "View.MemoryView":173
 *         if mode == 'c':
 *             order = b'C'
 *             self.mode = u'c'             # <<<<<<<<<<<<<<
 *         elif mode == 'fortran':
 *             order = b'F'
*/
    __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_c);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_c);
    __Pyx_GOTREF(__pyx_v_self->mode);
    __Pyx_DECREF(__pyx_v_self->mode);
    __pyx_v_self->mode = __pyx_mstate_global->__pyx_n_u_c;

    /* "View.MemoryView":171
 * 
 *         cdef char order
 *         if mode == 'c':             # <<<<<<<<<<<<<<
 *             order = b'C'
 *             self.mode = u'c'
*/
    goto __pyx_L11;
  }

  /* "View.MemoryView":174
 *             order = b'C'
 *             self.mode = u'c'
 *         elif mode == 'fortran':             # <<<<<<<<<<<<<<
 *             order = b'F'
 *             self.mode = u'fortran'
*/
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_mode, __pyx_mstate_global->__pyx_n_u_fortran, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(7, 174, __pyx_L1_error)
  if (likely(__pyx_t_3)) {

    /* "View.MemoryView":175
 *             self.mode = u'c'
 *         elif mode == 'fortran':
 *             order = b'F'             # <<<<<<<<<<<<<<
 *             self.mode = u'fortran'
 *         else:
*/
    __pyx_v_order = 'F';

    /* "View.MemoryView":176
 *         elif mode == 'fortran':
 *             order = b'F'
 *             self.mode = u'fortran'             # <<<<<<<<<<<<<<
 *         else:
 *             raise ValueError, f"Invalid mode, expected 'c' or 'fortran', got {mode}"
*/
    __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_fortran);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_fortran);
    __Pyx_GOTREF(__pyx_v_self->mode);
    __Pyx_DECREF(__pyx_v_self->mode);
    __pyx_v_self->mode = __pyx_mstate_global->__pyx_n_u_fortran;

    /* "View.MemoryView":174
 *             order = b'C'
 *             self.mode = u'c'
 *         elif mode == 'fortran':             # <<<<<<<<<<<<<<
 *             order = b'F'
 *             self.mode = u'fortran'
*/
    goto __pyx_L11;
  }

  /* "View.MemoryView":178
 *             self.mode = u'fortran'
 *         else:
 *             raise ValueError, f"Invalid mode, expected 'c' or 'fortran', got {mode}"             # <<<<<<<<<<<<<<
 * 
 *         self.len = fill_contig_strides_array(self._shape, self._strides, itemsize, self.ndim, order)
*/
  /*else*/ {
    __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_v_mode, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 178, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_12 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Invalid_mode_expected_c_or_fortr, __pyx_t_4); if (unlikely(!__pyx_t_12)) __PYX_ERR(7, 178, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_ValueError))), __pyx_t_12, 0, 0);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __PYX_ERR(7, 178, __pyx_L1_error)
  }
  __pyx_L11:;

  /* "View.MemoryView":180
 *             raise ValueError, f"Invalid mode, expected 'c' or 'fortran', got {mode}"
 * 
 *         self.len = fill_contig_strides_array(self._shape, self._strides, itemsize, self.ndim, order)             # <<<<<<<<<<<<<<
 * 
 *         self.free_data = allocate_buffer
*/
  __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order);

  /* "View.MemoryView":182
 *         self.len = fill_contig_strides_array(self._shape, self._strides, itemsize, self.ndim, order)
 * 
 *         self.free_data = allocate_buffer             # <<<<<<<<<<<<<<
 *         self.dtype_is_object = format == b'O'
 * 
*/
  __pyx_v_self->free_data = __pyx_v_allocate_buffer;

  /* "View.MemoryView":183
 * 
 *         self.free_data = allocate_buffer
 *         self.dtype_is_object = format == b'O'             # <<<<<<<<<<<<<<
 * 
 *         if allocate_buffer:
*/
  __pyx_t_12 = PyObject_RichCompare(__pyx_v_format, __pyx_mstate_global->__pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) __PYX_ERR(7, 183, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(7, 183, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_v_self->dtype_is_object = __pyx_t_3;

  /* "View.MemoryView":185
 *         self.dtype_is_object = format == b'O'
 * 
 *         if allocate_buffer:             # <<<<<<<<<<<<<<
 *             _allocate_buffer(self)
 * 
*/
  if (__pyx_v_allocate_buffer) {

    /* "View.MemoryView":186
 * 
 *         if allocate_buffer:
 *             _allocate_buffer(self)             # <<<<<<<<<<<<<<
 * 
 *     @cname('getbuffer')
*/
    __pyx_t_8 = __pyx_array_allocate_buffer(__pyx_v_self); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(7, 186, __pyx_L1_error)

    /* "View.MemoryView":185
 *         self.dtype_is_object = format == b'O'
 * 
 *         if allocate_buffer:             # <<<<<<<<<<<<<<
 *             _allocate_buffer(self)
 * 
*/
  }

  /* "View.MemoryView":137
 *         cdef bint dtype_is_object
 * 
 *     def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,             # <<<<<<<<<<<<<<
 *                   mode="c", bint allocate_buffer=True):
 * 
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_format);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":188
 *             _allocate_buffer(self)
 * 
 *     @cname('getbuffer')             # <<<<<<<<<<<<<<
 *     def __getbuffer__(self, Py_buffer *info, int flags):
 *         cdef int bufmode = -1
*/

/* Python wrapper */
CYTHON_UNUSED static int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
CYTHON_UNUSED static int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(((struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));

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

static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
  int __pyx_v_bufmode;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  char *__pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  Py_ssize_t *__pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  if (unlikely(__pyx_v_info == NULL)) {
    PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
    return -1;
  }
  __Pyx_RefNannySetupContext("__getbuffer__", 0);
  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(__pyx_v_info->obj);

  /* "View.MemoryView":190
 *     @cname('getbuffer')
 *     def __getbuffer__(self, Py_buffer *info, int flags):
 *         cdef int bufmode = -1             # <<<<<<<<<<<<<<
 *         if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS):
 *             if self.mode == u"c":
*/
  __pyx_v_bufmode = -1;

  /* "View.MemoryView":191
 *     def __getbuffer__(self, Py_buffer *info, int flags):
 *         cdef int bufmode = -1
 *         if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS):             # <<<<<<<<<<<<<<
 *             if self.mode == u"c":
 *                 bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
*/
  __pyx_t_1 = ((__pyx_v_flags & ((PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS) | PyBUF_ANY_CONTIGUOUS)) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":192
 *         cdef int bufmode = -1
 *         if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS):
 *             if self.mode == u"c":             # <<<<<<<<<<<<<<
 *                 bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
 *             elif self.mode == u"fortran":
*/
    __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_mstate_global->__pyx_n_u_c, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(7, 192, __pyx_L1_error)
    if (__pyx_t_1) {

      /* "View.MemoryView":193
 *         if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS):
 *             if self.mode == u"c":
 *                 bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS             # <<<<<<<<<<<<<<
 *             elif self.mode == u"fortran":
 *                 bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
*/
      __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);

      /* "View.MemoryView":192
 *         cdef int bufmode = -1
 *         if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS):
 *             if self.mode == u"c":             # <<<<<<<<<<<<<<
 *                 bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
 *             elif self.mode == u"fortran":
*/
      goto __pyx_L4;
    }

    /* "View.MemoryView":194
 *             if self.mode == u"c":
 *                 bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
 *             elif self.mode == u"fortran":             # <<<<<<<<<<<<<<
 *                 bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
 *             if not (flags & bufmode):
*/
    __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_mstate_global->__pyx_n_u_fortran, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(7, 194, __pyx_L1_error)
    if (__pyx_t_1) {

      /* "View.MemoryView":195
 *                 bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
 *             elif self.mode == u"fortran":
 *                 bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS             # <<<<<<<<<<<<<<
 *             if not (flags & bufmode):
 *                 raise ValueError, "Can only create a buffer that is contiguous in memory."
*/
      __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);

      /* "View.MemoryView":194
 *             if self.mode == u"c":
 *                 bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
 *             elif self.mode == u"fortran":             # <<<<<<<<<<<<<<
 *                 bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
 *             if not (flags & bufmode):
*/
    }
    __pyx_L4:;

    /* "View.MemoryView":196
 *             elif self.mode == u"fortran":
 *                 bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
 *             if not (flags & bufmode):             # <<<<<<<<<<<<<<
 *                 raise ValueError, "Can only create a buffer that is contiguous in memory."
 *         info.buf = self.data
*/
    __pyx_t_1 = (!((__pyx_v_flags & __pyx_v_bufmode) != 0));
    if (unlikely(__pyx_t_1)) {

      /* "View.MemoryView":197
 *                 bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
 *             if not (flags & bufmode):
 *                 raise ValueError, "Can only create a buffer that is contiguous in memory."             # <<<<<<<<<<<<<<
 *         info.buf = self.data
 *         info.len = self.len
*/
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_ValueError))), __pyx_mstate_global->__pyx_kp_u_Can_only_create_a_buffer_that_is, 0, 0);
      __PYX_ERR(7, 197, __pyx_L1_error)

      /* "View.MemoryView":196
 *             elif self.mode == u"fortran":
 *                 bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
 *             if not (flags & bufmode):             # <<<<<<<<<<<<<<
 *                 raise ValueError, "Can only create a buffer that is contiguous in memory."
 *         info.buf = self.data
*/
    }

    /* "View.MemoryView":191
 *     def __getbuffer__(self, Py_buffer *info, int flags):
 *         cdef int bufmode = -1
 *         if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS):             # <<<<<<<<<<<<<<
 *             if self.mode == u"c":
 *                 bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
*/
  }

  /* "View.MemoryView":198
 *             if not (flags & bufmode):
 *                 raise ValueError, "Can only create a buffer that is contiguous in memory."
 *         info.buf = self.data             # <<<<<<<<<<<<<<
 *         info.len = self.len
 * 
*/
  __pyx_t_2 = __pyx_v_self->data;
  __pyx_v_info->buf = __pyx_t_2;

  /* "View.MemoryView":199
 *                 raise ValueError, "Can only create a buffer that is contiguous in memory."
 *         info.buf = self.data
 *         info.len = self.len             # <<<<<<<<<<<<<<
 * 
 *         if flags & PyBUF_STRIDES:
*/
  __pyx_t_3 = __pyx_v_self->len;
  __pyx_v_info->len = __pyx_t_3;

  /* "View.MemoryView":201
 *         info.len = self.len
 * 
 *         if flags & PyBUF_STRIDES:             # <<<<<<<<<<<<<<
 *             info.ndim = self.ndim
 *             info.shape = self._shape
*/
  __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":202
 * 
 *         if flags & PyBUF_STRIDES:
 *             info.ndim = self.ndim             # <<<<<<<<<<<<<<
 *             info.shape = self._shape
 *             info.strides = self._strides
*/
    __pyx_t_4 = __pyx_v_self->ndim;
    __pyx_v_info->ndim = __pyx_t_4;

    /* "View.MemoryView":203
 *         if flags & PyBUF_STRIDES:
 *             info.ndim = self.ndim
 *             info.shape = self._shape             # <<<<<<<<<<<<<<
 *             info.strides = self._strides
 *         else:
*/
    __pyx_t_5 = __pyx_v_self->_shape;
    __pyx_v_info->shape = __pyx_t_5;

    /* "View.MemoryView":204
 *             info.ndim = self.ndim
 *             info.shape = self._shape
 *             info.strides = self._strides             # <<<<<<<<<<<<<<
 *         else:
 *             info.ndim = 1
*/
    __pyx_t_5 = __pyx_v_self->_strides;
    __pyx_v_info->strides = __pyx_t_5;

    /* "View.MemoryView":201
 *         info.len = self.len
 * 
 *         if flags & PyBUF_STRIDES:             # <<<<<<<<<<<<<<
 *             info.ndim = self.ndim
 *             info.shape = self._shape
*/
    goto __pyx_L6;
  }

  /* "View.MemoryView":206
 *             info.strides = self._strides
 *         else:
 *             info.ndim = 1             # <<<<<<<<<<<<<<
 *             info.shape = &self.len if flags & PyBUF_ND else NULL
 *             info.strides = NULL
*/
  /*else*/ {
    __pyx_v_info->ndim = 1;

    /* "View.MemoryView":207
 *         else:
 *             info.ndim = 1
 *             info.shape = &self.len if flags & PyBUF_ND else NULL             # <<<<<<<<<<<<<<
 *             info.strides = NULL
 * 
*/
    __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
    if (__pyx_t_1) {
      __pyx_t_5 = (&__pyx_v_self->len);
    } else {
      __pyx_t_5 = NULL;
    }
    __pyx_v_info->shape = __pyx_t_5;

    /* "View.MemoryView":208
 *             info.ndim = 1
 *             info.shape = &self.len if flags & PyBUF_ND else NULL
 *             info.strides = NULL             # <<<<<<<<<<<<<<
 * 
 *         info.suboffsets = NULL
*/
    __pyx_v_info->strides = NULL;
  }
  __pyx_L6:;

  /* "View.MemoryView":210
 *             info.strides = NULL
 * 
 *         info.suboffsets = NULL             # <<<<<<<<<<<<<<
 *         info.itemsize = self.itemsize
 *         info.readonly = 0
*/
  __pyx_v_info->suboffsets = NULL;

  /* "View.MemoryView":211
 * 
 *         info.suboffsets = NULL
 *         info.itemsize = self.itemsize             # <<<<<<<<<<<<<<
 *         info.readonly = 0
 *         info.format = self.format if flags & PyBUF_FORMAT else NULL
*/
  __pyx_t_3 = __pyx_v_self->itemsize;
  __pyx_v_info->itemsize = __pyx_t_3;

  /* "View.MemoryView":212
 *         info.suboffsets = NULL
 *         info.itemsize = self.itemsize
 *         info.readonly = 0             # <<<<<<<<<<<<<<
 *         info.format = self.format if flags & PyBUF_FORMAT else NULL
 *         info.obj = self
*/
  __pyx_v_info->readonly = 0;

  /* "View.MemoryView":213
 *         info.itemsize = self.itemsize
 *         info.readonly = 0
 *         info.format = self.format if flags & PyBUF_FORMAT else NULL             # <<<<<<<<<<<<<<
 *         info.obj = self
 * 
*/
  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
  if (__pyx_t_1) {
    __pyx_t_2 = __pyx_v_self->format;
  } else {
    __pyx_t_2 = NULL;
  }
  __pyx_v_info->format = __pyx_t_2;

  /* "View.MemoryView":214
 *         info.readonly = 0
 *         info.format = self.format if flags & PyBUF_FORMAT else NULL
 *         info.obj = self             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(array self):
*/
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self);
  __Pyx_GOTREF(__pyx_v_info->obj);
  __Pyx_DECREF(__pyx_v_info->obj);
  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);

  /* "View.MemoryView":188
 *             _allocate_buffer(self)
 * 
 *     @cname('getbuffer')             # <<<<<<<<<<<<<<
 *     def __getbuffer__(self, Py_buffer *info, int flags):
 *         cdef int bufmode = -1
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  if (__pyx_v_info->obj != NULL) {
    __Pyx_GOTREF(__pyx_v_info->obj);
    __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
  }
  goto __pyx_L2;
  __pyx_L0:;
  if (__pyx_v_info->obj == Py_None) {
    __Pyx_GOTREF(__pyx_v_info->obj);
    __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
  }
  __pyx_L2:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":216
 *         info.obj = self
 * 
 *     def __dealloc__(array self):             # <<<<<<<<<<<<<<
 *         if self.callback_free_data != NULL:
 *             self.callback_free_data(self.data)
*/

/* Python wrapper */
static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self));

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

static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) {
  int __pyx_t_1;
  int __pyx_t_2;

  /* "View.MemoryView":217
 * 
 *     def __dealloc__(array self):
 *         if self.callback_free_data != NULL:             # <<<<<<<<<<<<<<
 *             self.callback_free_data(self.data)
 *         elif self.free_data and self.data is not NULL:
*/
  __pyx_t_1 = (__pyx_v_self->callback_free_data != NULL);
  if (__pyx_t_1) {

    /* "View.MemoryView":218
 *     def __dealloc__(array self):
 *         if self.callback_free_data != NULL:
 *             self.callback_free_data(self.data)             # <<<<<<<<<<<<<<
 *         elif self.free_data and self.data is not NULL:
 *             if self.dtype_is_object:
*/
    __pyx_v_self->callback_free_data(__pyx_v_self->data);

    /* "View.MemoryView":217
 * 
 *     def __dealloc__(array self):
 *         if self.callback_free_data != NULL:             # <<<<<<<<<<<<<<
 *             self.callback_free_data(self.data)
 *         elif self.free_data and self.data is not NULL:
*/
    goto __pyx_L3;
  }

  /* "View.MemoryView":219
 *         if self.callback_free_data != NULL:
 *             self.callback_free_data(self.data)
 *         elif self.free_data and self.data is not NULL:             # <<<<<<<<<<<<<<
 *             if self.dtype_is_object:
 *                 refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
*/
  if (__pyx_v_self->free_data) {
  } else {
    __pyx_t_1 = __pyx_v_self->free_data;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_self->data != NULL);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "View.MemoryView":220
 *             self.callback_free_data(self.data)
 *         elif self.free_data and self.data is not NULL:
 *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
 *                 refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
 *             free(self.data)
*/
    if (__pyx_v_self->dtype_is_object) {

      /* "View.MemoryView":221
 *         elif self.free_data and self.data is not NULL:
 *             if self.dtype_is_object:
 *                 refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)             # <<<<<<<<<<<<<<
 *             free(self.data)
 *         PyObject_Free(self._shape)
*/
      __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);

      /* "View.MemoryView":220
 *             self.callback_free_data(self.data)
 *         elif self.free_data and self.data is not NULL:
 *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
 *                 refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
 *             free(self.data)
*/
    }

    /* "View.MemoryView":222
 *             if self.dtype_is_object:
 *                 refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
 *             free(self.data)             # <<<<<<<<<<<<<<
 *         PyObject_Free(self._shape)
 * 
*/
    free(__pyx_v_self->data);

    /* "View.MemoryView":219
 *         if self.callback_free_data != NULL:
 *             self.callback_free_data(self.data)
 *         elif self.free_data and self.data is not NULL:             # <<<<<<<<<<<<<<
 *             if self.dtype_is_object:
 *                 refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
*/
  }
  __pyx_L3:;

  /* "View.MemoryView":223
 *                 refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
 *             free(self.data)
 *         PyObject_Free(self._shape)             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  PyObject_Free(__pyx_v_self->_shape);

  /* "View.MemoryView":216
 *         info.obj = self
 * 
 *     def __dealloc__(array self):             # <<<<<<<<<<<<<<
 *         if self.callback_free_data != NULL:
 *             self.callback_free_data(self.data)
*/

  /* function exit code */
}

/* "View.MemoryView":225
 *         PyObject_Free(self._shape)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def memview(self):
 *         return self.get_memview()
*/

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

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

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

  /* "View.MemoryView":227
 *     @property
 *     def memview(self):
 *         return self.get_memview()             # <<<<<<<<<<<<<<
 * 
 *     @cname('get_memview')
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 227, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":225
 *         PyObject_Free(self._shape)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def memview(self):
 *         return self.get_memview()
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":229
 *         return self.get_memview()
 * 
 *     @cname('get_memview')             # <<<<<<<<<<<<<<
 *     cdef get_memview(self):
 *         flags =  PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
*/

static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) {
  int __pyx_v_flags;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_memview", 0);

  /* "View.MemoryView":231
 *     @cname('get_memview')
 *     cdef get_memview(self):
 *         flags =  PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE             # <<<<<<<<<<<<<<
 *         return  memoryview(self, flags, self.dtype_is_object)
 * 
*/
  __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);

  /* "View.MemoryView":232
 *     cdef get_memview(self):
 *         flags =  PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
 *         return  memoryview(self, flags, self.dtype_is_object)             # <<<<<<<<<<<<<<
 * 
 *     def __len__(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 232, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 232, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = 1;
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_2, ((PyObject *)__pyx_v_self), __pyx_t_3, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_memoryview_type, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 232, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_r = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":229
 *         return self.get_memview()
 * 
 *     @cname('get_memview')             # <<<<<<<<<<<<<<
 *     cdef get_memview(self):
 *         flags =  PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
*/

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

/* "View.MemoryView":234
 *         return  memoryview(self, flags, self.dtype_is_object)
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return self._shape[0]
 * 
*/

/* Python wrapper */
static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self); /*proto*/
static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((struct __pyx_array_obj *)__pyx_v_self));

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

static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self) {
  Py_ssize_t __pyx_r;

  /* "View.MemoryView":235
 * 
 *     def __len__(self):
 *         return self._shape[0]             # <<<<<<<<<<<<<<
 * 
 *     def __getattr__(self, attr):
*/
  __pyx_r = (__pyx_v_self->_shape[0]);
  goto __pyx_L0;

  /* "View.MemoryView":234
 *         return  memoryview(self, flags, self.dtype_is_object)
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return self._shape[0]
 * 
*/

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

/* "View.MemoryView":237
 *         return self._shape[0]
 * 
 *     def __getattr__(self, attr):             # <<<<<<<<<<<<<<
 *         return getattr(self.memview, attr)
 * 
*/

/* Python wrapper */
static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /*proto*/
static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));

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

static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getattr__", 0);

  /* "View.MemoryView":238
 * 
 *     def __getattr__(self, attr):
 *         return getattr(self.memview, attr)             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, item):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 238, __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;

  /* "View.MemoryView":237
 *         return self._shape[0]
 * 
 *     def __getattr__(self, attr):             # <<<<<<<<<<<<<<
 *         return getattr(self.memview, attr)
 * 
*/

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

/* "View.MemoryView":240
 *         return getattr(self.memview, attr)
 * 
 *     def __getitem__(self, item):             # <<<<<<<<<<<<<<
 *         return self.memview[item]
 * 
*/

/* Python wrapper */
static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));

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

static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "View.MemoryView":241
 * 
 *     def __getitem__(self, item):
 *         return self.memview[item]             # <<<<<<<<<<<<<<
 * 
 *     def __setitem__(self, item, value):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 241, __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;

  /* "View.MemoryView":240
 *         return getattr(self.memview, attr)
 * 
 *     def __getitem__(self, item):             # <<<<<<<<<<<<<<
 *         return self.memview[item]
 * 
*/

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

/* "View.MemoryView":243
 *         return self.memview[item]
 * 
 *     def __setitem__(self, item, value):             # <<<<<<<<<<<<<<
 *         self.memview[item] = value
 * 
*/

/* Python wrapper */
static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /*proto*/
static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value));

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

static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setitem__", 0);

  /* "View.MemoryView":244
 * 
 *     def __setitem__(self, item, value):
 *         self.memview[item] = value             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 244, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely((PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0))) __PYX_ERR(7, 244, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "View.MemoryView":243
 *         return self.memview[item]
 * 
 *     def __setitem__(self, item, value):             # <<<<<<<<<<<<<<
 *         self.memview[item] = value
 * 
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((struct __pyx_array_obj *)__pyx_v_self));

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

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

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

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("View.MemoryView.array.__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___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(7, 3, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(7, 3, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(7, 3, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(7, 3, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(7, 3, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(7, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v___pyx_state);

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

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

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

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

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

/* "View.MemoryView":253
 *         pass
 * 
 * @cname("__pyx_array_allocate_buffer")             # <<<<<<<<<<<<<<
 * cdef int _allocate_buffer(array self) except -1:
 * 
*/

static int __pyx_array_allocate_buffer(struct __pyx_array_obj *__pyx_v_self) {
  Py_ssize_t __pyx_v_i;
  PyObject **__pyx_v_p;
  int __pyx_r;
  int __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "View.MemoryView":260
 *     cdef PyObject **p
 * 
 *     self.free_data = True             # <<<<<<<<<<<<<<
 *     self.data = <char *>malloc(self.len)
 *     if not self.data:
*/
  __pyx_v_self->free_data = 1;

  /* "View.MemoryView":261
 * 
 *     self.free_data = True
 *     self.data = <char *>malloc(self.len)             # <<<<<<<<<<<<<<
 *     if not self.data:
 *         raise MemoryError, "unable to allocate array data."
*/
  __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len));

  /* "View.MemoryView":262
 *     self.free_data = True
 *     self.data = <char *>malloc(self.len)
 *     if not self.data:             # <<<<<<<<<<<<<<
 *         raise MemoryError, "unable to allocate array data."
 * 
*/
  __pyx_t_1 = (!(__pyx_v_self->data != 0));
  if (unlikely(__pyx_t_1)) {

    /* "View.MemoryView":263
 *     self.data = <char *>malloc(self.len)
 *     if not self.data:
 *         raise MemoryError, "unable to allocate array data."             # <<<<<<<<<<<<<<
 * 
 *     if self.dtype_is_object:
*/
    __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_MemoryError))), __pyx_mstate_global->__pyx_kp_u_unable_to_allocate_array_data, 0, 0);
    __PYX_ERR(7, 263, __pyx_L1_error)

    /* "View.MemoryView":262
 *     self.free_data = True
 *     self.data = <char *>malloc(self.len)
 *     if not self.data:             # <<<<<<<<<<<<<<
 *         raise MemoryError, "unable to allocate array data."
 * 
*/
  }

  /* "View.MemoryView":265
 *         raise MemoryError, "unable to allocate array data."
 * 
 *     if self.dtype_is_object:             # <<<<<<<<<<<<<<
 *         p = <PyObject **> self.data
 *         for i in range(self.len // self.itemsize):
*/
  if (__pyx_v_self->dtype_is_object) {

    /* "View.MemoryView":266
 * 
 *     if self.dtype_is_object:
 *         p = <PyObject **> self.data             # <<<<<<<<<<<<<<
 *         for i in range(self.len // self.itemsize):
 *             p[i] = Py_None
*/
    __pyx_v_p = ((PyObject **)__pyx_v_self->data);

    /* "View.MemoryView":267
 *     if self.dtype_is_object:
 *         p = <PyObject **> self.data
 *         for i in range(self.len // self.itemsize):             # <<<<<<<<<<<<<<
 *             p[i] = Py_None
 *             Py_INCREF(Py_None)
*/
    if (unlikely(__pyx_v_self->itemsize == 0)) {
      PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
      __PYX_ERR(7, 267, __pyx_L1_error)
    }
    else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_self->itemsize == (Py_ssize_t)-1)  && unlikely(__Pyx_UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
      PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
      __PYX_ERR(7, 267, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_self->itemsize, 0);
    __pyx_t_3 = __pyx_t_2;
    for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
      __pyx_v_i = __pyx_t_4;

      /* "View.MemoryView":268
 *         p = <PyObject **> self.data
 *         for i in range(self.len // self.itemsize):
 *             p[i] = Py_None             # <<<<<<<<<<<<<<
 *             Py_INCREF(Py_None)
 *     return 0
*/
      (__pyx_v_p[__pyx_v_i]) = Py_None;

      /* "View.MemoryView":269
 *         for i in range(self.len // self.itemsize):
 *             p[i] = Py_None
 *             Py_INCREF(Py_None)             # <<<<<<<<<<<<<<
 *     return 0
 * 
*/
      Py_INCREF(Py_None);
    }

    /* "View.MemoryView":265
 *         raise MemoryError, "unable to allocate array data."
 * 
 *     if self.dtype_is_object:             # <<<<<<<<<<<<<<
 *         p = <PyObject **> self.data
 *         for i in range(self.len // self.itemsize):
*/
  }

  /* "View.MemoryView":270
 *             p[i] = Py_None
 *             Py_INCREF(Py_None)
 *     return 0             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = 0;
  goto __pyx_L0;

  /* "View.MemoryView":253
 *         pass
 * 
 * @cname("__pyx_array_allocate_buffer")             # <<<<<<<<<<<<<<
 * cdef int _allocate_buffer(array self) except -1:
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("View.MemoryView._allocate_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "View.MemoryView":273
 * 
 * 
 * @cname("__pyx_array_new")             # <<<<<<<<<<<<<<
 * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, const char *c_mode, char *buf):
 *     cdef array result
*/

static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, char *__pyx_v_format, char const *__pyx_v_c_mode, char *__pyx_v_buf) {
  struct __pyx_array_obj *__pyx_v_result = 0;
  PyObject *__pyx_v_mode = 0;
  struct __pyx_array_obj *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("array_cwrapper", 0);

  /* "View.MemoryView":276
 * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, const char *c_mode, char *buf):
 *     cdef array result
 *     cdef str mode = "fortran" if c_mode[0] == b'f' else "c"  # this often comes from a constant C string.             # <<<<<<<<<<<<<<
 * 
 *     if buf is NULL:
*/
  __pyx_t_2 = ((__pyx_v_c_mode[0]) == 'f');
  if (__pyx_t_2) {
    __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_fortran);
    __pyx_t_1 = __pyx_mstate_global->__pyx_n_u_fortran;
  } else {
    __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_c);
    __pyx_t_1 = __pyx_mstate_global->__pyx_n_u_c;
  }
  __pyx_v_mode = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "View.MemoryView":278
 *     cdef str mode = "fortran" if c_mode[0] == b'f' else "c"  # this often comes from a constant C string.
 * 
 *     if buf is NULL:             # <<<<<<<<<<<<<<
 *         result = array.__new__(array, shape, itemsize, format, mode)
 *     else:
*/
  __pyx_t_2 = (__pyx_v_buf == NULL);
  if (__pyx_t_2) {

    /* "View.MemoryView":279
 * 
 *     if buf is NULL:
 *         result = array.__new__(array, shape, itemsize, format, mode)             # <<<<<<<<<<<<<<
 *     else:
 *         result = array.__new__(array, shape, itemsize, format, mode, allocate_buffer=False)
*/
    __pyx_t_1 = PyLong_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 279, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 279, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 279, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_shape);
    __Pyx_GIVEREF(__pyx_v_shape);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_shape) != (0)) __PYX_ERR(7, 279, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1) != (0)) __PYX_ERR(7, 279, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_3);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3) != (0)) __PYX_ERR(7, 279, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_mode);
    __Pyx_GIVEREF(__pyx_v_mode);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_v_mode) != (0)) __PYX_ERR(7, 279, __pyx_L1_error);
    __pyx_t_1 = 0;
    __pyx_t_3 = 0;
    __pyx_t_3 = ((PyObject *)__pyx_tp_new_array(((PyTypeObject *)__pyx_mstate_global->__pyx_array_type), __pyx_t_4, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 279, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "View.MemoryView":278
 *     cdef str mode = "fortran" if c_mode[0] == b'f' else "c"  # this often comes from a constant C string.
 * 
 *     if buf is NULL:             # <<<<<<<<<<<<<<
 *         result = array.__new__(array, shape, itemsize, format, mode)
 *     else:
*/
    goto __pyx_L3;
  }

  /* "View.MemoryView":281
 *         result = array.__new__(array, shape, itemsize, format, mode)
 *     else:
 *         result = array.__new__(array, shape, itemsize, format, mode, allocate_buffer=False)             # <<<<<<<<<<<<<<
 *         result.data = buf
 * 
*/
  /*else*/ {
    __pyx_t_3 = PyLong_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 281, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 281, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 281, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_shape);
    __Pyx_GIVEREF(__pyx_v_shape);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_shape) != (0)) __PYX_ERR(7, 281, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_3);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3) != (0)) __PYX_ERR(7, 281, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_4);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_4) != (0)) __PYX_ERR(7, 281, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_mode);
    __Pyx_GIVEREF(__pyx_v_mode);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_mode) != (0)) __PYX_ERR(7, 281, __pyx_L1_error);
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 281, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_allocate_buffer, Py_False) < (0)) __PYX_ERR(7, 281, __pyx_L1_error)
    __pyx_t_3 = ((PyObject *)__pyx_tp_new_array(((PyTypeObject *)__pyx_mstate_global->__pyx_array_type), __pyx_t_1, __pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 281, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "View.MemoryView":282
 *     else:
 *         result = array.__new__(array, shape, itemsize, format, mode, allocate_buffer=False)
 *         result.data = buf             # <<<<<<<<<<<<<<
 * 
 *     return result
*/
    __pyx_v_result->data = __pyx_v_buf;
  }
  __pyx_L3:;

  /* "View.MemoryView":284
 *         result.data = buf
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "View.MemoryView":273
 * 
 * 
 * @cname("__pyx_array_new")             # <<<<<<<<<<<<<<
 * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, const char *c_mode, char *buf):
 *     cdef array result
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_mode);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":310
 * cdef class Enum(object):
 *     cdef object name
 *     def __init__(self, name):             # <<<<<<<<<<<<<<
 *         self.name = name
 *     def __repr__(self):
*/

/* Python wrapper */
static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_name = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_name,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(7, 310, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(7, 310, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(7, 310, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, i); __PYX_ERR(7, 310, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(7, 310, __pyx_L3_error)
    }
    __pyx_v_name = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(7, 310, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);

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

static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "View.MemoryView":311
 *     cdef object name
 *     def __init__(self, name):
 *         self.name = name             # <<<<<<<<<<<<<<
 *     def __repr__(self):
 *         return self.name
*/
  __Pyx_INCREF(__pyx_v_name);
  __Pyx_GIVEREF(__pyx_v_name);
  __Pyx_GOTREF(__pyx_v_self->name);
  __Pyx_DECREF(__pyx_v_self->name);
  __pyx_v_self->name = __pyx_v_name;

  /* "View.MemoryView":310
 * cdef class Enum(object):
 *     cdef object name
 *     def __init__(self, name):             # <<<<<<<<<<<<<<
 *         self.name = name
 *     def __repr__(self):
*/

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

/* "View.MemoryView":312
 *     def __init__(self, name):
 *         self.name = name
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return self.name
 * 
*/

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

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

static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "View.MemoryView":313
 *         self.name = name
 *     def __repr__(self):
 *         return self.name             # <<<<<<<<<<<<<<
 * 
 * cdef generic = Enum("<strided and direct or indirect>")
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->name);
  __pyx_r = __pyx_v_self->name;
  goto __pyx_L0;

  /* "View.MemoryView":312
 *     def __init__(self, name):
 *         self.name = name
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return self.name
 * 
*/

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

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

/* Python wrapper */
static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));

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

static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__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;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":5
 *     cdef object _dict
 *     cdef bint use_setstate
 *     state = (self.name,)             # <<<<<<<<<<<<<<
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:
*/
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_self->name);
  __Pyx_GIVEREF(__pyx_v_self->name);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name) != (0)) __PYX_ERR(7, 5, __pyx_L1_error);
  __pyx_v_state = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "(tree fragment)":6
 *     cdef bint use_setstate
 *     state = (self.name,)
 *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
 *     if _dict is not None and _dict:
 *         state += (_dict,)
*/
  __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_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.name,)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
*/
  __pyx_t_3 = (__pyx_v__dict != Py_None);
  if (__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v__dict); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(7, 7, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:
 *         state += (_dict,)             # <<<<<<<<<<<<<<
 *         use_setstate = True
 *     else:
*/
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v__dict);
    __Pyx_GIVEREF(__pyx_v__dict);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict) != (0)) __PYX_ERR(7, 8, __pyx_L1_error);
    __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 and _dict:
 *         state += (_dict,)
 *         use_setstate = True             # <<<<<<<<<<<<<<
 *     else:
 *         use_setstate = self.name is not None
*/
    __pyx_v_use_setstate = 1;

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

  /* "(tree fragment)":11
 *         use_setstate = True
 *     else:
 *         use_setstate = self.name is not None             # <<<<<<<<<<<<<<
 *     if use_setstate:
 *         return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state
*/
  /*else*/ {
    __pyx_t_2 = (__pyx_v_self->name != Py_None);
    __pyx_v_use_setstate = __pyx_t_2;
  }
  __pyx_L3:;

  /* "(tree fragment)":12
 *     else:
 *         use_setstate = self.name is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state
 *     else:
*/
  if (__pyx_v_use_setstate) {

    /* "(tree fragment)":13
 *         use_setstate = self.name is not None
 *     if use_setstate:
 *         return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_Enum, (type(self), 0x82a3537, state)
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_Enum); 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))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(7, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_136983863);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_136983863);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_136983863) != (0)) __PYX_ERR(7, 13, __pyx_L1_error);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None) != (0)) __PYX_ERR(7, 13, __pyx_L1_error);
    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_4);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4) != (0)) __PYX_ERR(7, 13, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1) != (0)) __PYX_ERR(7, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state) != (0)) __PYX_ERR(7, 13, __pyx_L1_error);
    __pyx_t_4 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;

    /* "(tree fragment)":12
 *     else:
 *         use_setstate = self.name is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state
 *     else:
*/
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state
 *     else:
 *         return __pyx_unpickle_Enum, (type(self), 0x82a3537, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_Enum__set_state(self, __pyx_state)
*/
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_Enum); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __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))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(7, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_136983863);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_136983863);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_136983863) != (0)) __PYX_ERR(7, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state) != (0)) __PYX_ERR(7, 15, __pyx_L1_error);
    __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_5);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5) != (0)) __PYX_ERR(7, 15, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1) != (0)) __PYX_ERR(7, 15, __pyx_L1_error);
    __pyx_t_5 = 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_5);
  __Pyx_AddTraceback("View.MemoryView.Enum.__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_Enum, (type(self), 0x82a3537, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_Enum__set_state(self, __pyx_state)
*/

/* Python wrapper */
static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(7, 16, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(7, 16, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(7, 16, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(7, 16, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(7, 16, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(7, 16, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v___pyx_state);

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

static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":17
 *         return __pyx_unpickle_Enum, (type(self), 0x82a3537, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_Enum__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
*/
  __pyx_t_1 = __pyx_v___pyx_state;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(7, 17, __pyx_L1_error)
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'");
    __PYX_ERR(7, 17, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_Enum, (type(self), 0x82a3537, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_Enum__set_state(self, __pyx_state)
*/

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

/* "View.MemoryView":356
 *     cdef const __Pyx_TypeInfo *typeinfo
 * 
 *     def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):             # <<<<<<<<<<<<<<
 *         self.obj = obj
 *         self.flags = flags
*/

/* Python wrapper */
static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_obj = 0;
  int __pyx_v_flags;
  int __pyx_v_dtype_is_object;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_obj,&__pyx_mstate_global->__pyx_n_u_flags,&__pyx_mstate_global->__pyx_n_u_dtype_is_object,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(7, 356, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(7, 356, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(7, 356, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(7, 356, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__cinit__", 0) < (0)) __PYX_ERR(7, 356, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, i); __PYX_ERR(7, 356, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(7, 356, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(7, 356, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(7, 356, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_obj = values[0];
    __pyx_v_flags = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(7, 356, __pyx_L3_error)
    if (values[2]) {
      __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(7, 356, __pyx_L3_error)
    } else {
      __pyx_v_dtype_is_object = ((int)0);
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, __pyx_nargs); __PYX_ERR(7, 356, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object);

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

static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "View.MemoryView":357
 * 
 *     def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
 *         self.obj = obj             # <<<<<<<<<<<<<<
 *         self.flags = flags
 *         if type(self) is memoryview or obj is not None:
*/
  __Pyx_INCREF(__pyx_v_obj);
  __Pyx_GIVEREF(__pyx_v_obj);
  __Pyx_GOTREF(__pyx_v_self->obj);
  __Pyx_DECREF(__pyx_v_self->obj);
  __pyx_v_self->obj = __pyx_v_obj;

  /* "View.MemoryView":358
 *     def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
 *         self.obj = obj
 *         self.flags = flags             # <<<<<<<<<<<<<<
 *         if type(self) is memoryview or obj is not None:
 *             PyObject_GetBuffer(obj, &self.view, flags)
*/
  __pyx_v_self->flags = __pyx_v_flags;

  /* "View.MemoryView":359
 *         self.obj = obj
 *         self.flags = flags
 *         if type(self) is memoryview or obj is not None:             # <<<<<<<<<<<<<<
 *             PyObject_GetBuffer(obj, &self.view, flags)
 *             if <PyObject *> self.view.obj == NULL:
*/
  __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_mstate_global->__pyx_memoryview_type));
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_obj != Py_None);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "View.MemoryView":360
 *         self.flags = flags
 *         if type(self) is memoryview or obj is not None:
 *             PyObject_GetBuffer(obj, &self.view, flags)             # <<<<<<<<<<<<<<
 *             if <PyObject *> self.view.obj == NULL:
 *                 (<__pyx_buffer *> &self.view).obj = Py_None
*/
    __pyx_t_3 = PyObject_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(7, 360, __pyx_L1_error)

    /* "View.MemoryView":361
 *         if type(self) is memoryview or obj is not None:
 *             PyObject_GetBuffer(obj, &self.view, flags)
 *             if <PyObject *> self.view.obj == NULL:             # <<<<<<<<<<<<<<
 *                 (<__pyx_buffer *> &self.view).obj = Py_None
 *                 Py_INCREF(Py_None)
*/
    __pyx_t_1 = (((PyObject *)__pyx_v_self->view.obj) == NULL);
    if (__pyx_t_1) {

      /* "View.MemoryView":362
 *             PyObject_GetBuffer(obj, &self.view, flags)
 *             if <PyObject *> self.view.obj == NULL:
 *                 (<__pyx_buffer *> &self.view).obj = Py_None             # <<<<<<<<<<<<<<
 *                 Py_INCREF(Py_None)
 * 
*/
      ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;

      /* "View.MemoryView":363
 *             if <PyObject *> self.view.obj == NULL:
 *                 (<__pyx_buffer *> &self.view).obj = Py_None
 *                 Py_INCREF(Py_None)             # <<<<<<<<<<<<<<
 * 
 *         if not __PYX_CYTHON_ATOMICS_ENABLED():
*/
      Py_INCREF(Py_None);

      /* "View.MemoryView":361
 *         if type(self) is memoryview or obj is not None:
 *             PyObject_GetBuffer(obj, &self.view, flags)
 *             if <PyObject *> self.view.obj == NULL:             # <<<<<<<<<<<<<<
 *                 (<__pyx_buffer *> &self.view).obj = Py_None
 *                 Py_INCREF(Py_None)
*/
    }

    /* "View.MemoryView":359
 *         self.obj = obj
 *         self.flags = flags
 *         if type(self) is memoryview or obj is not None:             # <<<<<<<<<<<<<<
 *             PyObject_GetBuffer(obj, &self.view, flags)
 *             if <PyObject *> self.view.obj == NULL:
*/
  }

  /* "View.MemoryView":365
 *                 Py_INCREF(Py_None)
 * 
 *         if not __PYX_CYTHON_ATOMICS_ENABLED():             # <<<<<<<<<<<<<<
 *             global __pyx_memoryview_thread_locks_used
 *             if (__pyx_memoryview_thread_locks_used < 8 and
*/
  __pyx_t_1 = (!__PYX_CYTHON_ATOMICS_ENABLED());
  if (__pyx_t_1) {

    /* "View.MemoryView":367
 *         if not __PYX_CYTHON_ATOMICS_ENABLED():
 *             global __pyx_memoryview_thread_locks_used
 *             if (__pyx_memoryview_thread_locks_used < 8 and             # <<<<<<<<<<<<<<
 * 
 *                     not __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING()):
*/
    __pyx_t_2 = (__pyx_memoryview_thread_locks_used < 8);
    if (__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L9_bool_binop_done;
    }

    /* "View.MemoryView":369
 *             if (__pyx_memoryview_thread_locks_used < 8 and
 * 
 *                     not __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING()):             # <<<<<<<<<<<<<<
 *                 self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
 *                 __pyx_memoryview_thread_locks_used += 1
*/
    __pyx_t_2 = (!__PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING());
    __pyx_t_1 = __pyx_t_2;
    __pyx_L9_bool_binop_done:;

    /* "View.MemoryView":367
 *         if not __PYX_CYTHON_ATOMICS_ENABLED():
 *             global __pyx_memoryview_thread_locks_used
 *             if (__pyx_memoryview_thread_locks_used < 8 and             # <<<<<<<<<<<<<<
 * 
 *                     not __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING()):
*/
    if (__pyx_t_1) {

      /* "View.MemoryView":370
 * 
 *                     not __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING()):
 *                 self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]             # <<<<<<<<<<<<<<
 *                 __pyx_memoryview_thread_locks_used += 1
 *             if self.lock is NULL:
*/
      __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);

      /* "View.MemoryView":371
 *                     not __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING()):
 *                 self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
 *                 __pyx_memoryview_thread_locks_used += 1             # <<<<<<<<<<<<<<
 *             if self.lock is NULL:
 *                 self.lock = PyThread_allocate_lock()
*/
      __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);

      /* "View.MemoryView":367
 *         if not __PYX_CYTHON_ATOMICS_ENABLED():
 *             global __pyx_memoryview_thread_locks_used
 *             if (__pyx_memoryview_thread_locks_used < 8 and             # <<<<<<<<<<<<<<
 * 
 *                     not __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING()):
*/
    }

    /* "View.MemoryView":372
 *                 self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
 *                 __pyx_memoryview_thread_locks_used += 1
 *             if self.lock is NULL:             # <<<<<<<<<<<<<<
 *                 self.lock = PyThread_allocate_lock()
 *                 if self.lock is NULL:
*/
    __pyx_t_1 = (__pyx_v_self->lock == NULL);
    if (__pyx_t_1) {

      /* "View.MemoryView":373
 *                 __pyx_memoryview_thread_locks_used += 1
 *             if self.lock is NULL:
 *                 self.lock = PyThread_allocate_lock()             # <<<<<<<<<<<<<<
 *                 if self.lock is NULL:
 *                     raise MemoryError
*/
      __pyx_v_self->lock = PyThread_allocate_lock();

      /* "View.MemoryView":374
 *             if self.lock is NULL:
 *                 self.lock = PyThread_allocate_lock()
 *                 if self.lock is NULL:             # <<<<<<<<<<<<<<
 *                     raise MemoryError
 * 
*/
      __pyx_t_1 = (__pyx_v_self->lock == NULL);
      if (unlikely(__pyx_t_1)) {

        /* "View.MemoryView":375
 *                 self.lock = PyThread_allocate_lock()
 *                 if self.lock is NULL:
 *                     raise MemoryError             # <<<<<<<<<<<<<<
 * 
 *         if flags & PyBUF_FORMAT:
*/
        PyErr_NoMemory(); __PYX_ERR(7, 375, __pyx_L1_error)

        /* "View.MemoryView":374
 *             if self.lock is NULL:
 *                 self.lock = PyThread_allocate_lock()
 *                 if self.lock is NULL:             # <<<<<<<<<<<<<<
 *                     raise MemoryError
 * 
*/
      }

      /* "View.MemoryView":372
 *                 self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
 *                 __pyx_memoryview_thread_locks_used += 1
 *             if self.lock is NULL:             # <<<<<<<<<<<<<<
 *                 self.lock = PyThread_allocate_lock()
 *                 if self.lock is NULL:
*/
    }

    /* "View.MemoryView":365
 *                 Py_INCREF(Py_None)
 * 
 *         if not __PYX_CYTHON_ATOMICS_ENABLED():             # <<<<<<<<<<<<<<
 *             global __pyx_memoryview_thread_locks_used
 *             if (__pyx_memoryview_thread_locks_used < 8 and
*/
  }

  /* "View.MemoryView":377
 *                     raise MemoryError
 * 
 *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
 *             self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
 *         else:
*/
  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":378
 * 
 *         if flags & PyBUF_FORMAT:
 *             self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')             # <<<<<<<<<<<<<<
 *         else:
 *             self.dtype_is_object = dtype_is_object
*/
    __pyx_t_2 = ((__pyx_v_self->view.format[0]) == 'O');
    if (__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L14_bool_binop_done;
    }
    __pyx_t_2 = ((__pyx_v_self->view.format[1]) == '\x00');
    __pyx_t_1 = __pyx_t_2;
    __pyx_L14_bool_binop_done:;
    __pyx_v_self->dtype_is_object = __pyx_t_1;

    /* "View.MemoryView":377
 *                     raise MemoryError
 * 
 *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
 *             self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
 *         else:
*/
    goto __pyx_L13;
  }

  /* "View.MemoryView":380
 *             self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
 *         else:
 *             self.dtype_is_object = dtype_is_object             # <<<<<<<<<<<<<<
 * 
 *         with cython.cdivision(True):
*/
  /*else*/ {
    __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
  }
  __pyx_L13:;

  /* "View.MemoryView":383
 * 
 *         with cython.cdivision(True):
 *             assert <Py_intptr_t>(&self.acquisition_count) % sizeof(__pyx_atomic_int_type) == 0             # <<<<<<<<<<<<<<
 *         self.typeinfo = NULL
 * 
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = ((((Py_intptr_t)(&__pyx_v_self->acquisition_count)) % (sizeof(__pyx_atomic_int_type))) == 0);
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(7, 383, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(7, 383, __pyx_L1_error)
  #endif

  /* "View.MemoryView":384
 *         with cython.cdivision(True):
 *             assert <Py_intptr_t>(&self.acquisition_count) % sizeof(__pyx_atomic_int_type) == 0
 *         self.typeinfo = NULL             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(memoryview self):
*/
  __pyx_v_self->typeinfo = NULL;

  /* "View.MemoryView":356
 *     cdef const __Pyx_TypeInfo *typeinfo
 * 
 *     def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):             # <<<<<<<<<<<<<<
 *         self.obj = obj
 *         self.flags = flags
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":386
 *         self.typeinfo = NULL
 * 
 *     def __dealloc__(memoryview self):             # <<<<<<<<<<<<<<
 *         if self.obj is not None:
 *             PyBuffer_Release(&self.view)
*/

/* Python wrapper */
static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self));

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

static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) {
  int __pyx_v_i;
  int __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  PyThread_type_lock __pyx_t_5;
  PyThread_type_lock __pyx_t_6;

  /* "View.MemoryView":387
 * 
 *     def __dealloc__(memoryview self):
 *         if self.obj is not None:             # <<<<<<<<<<<<<<
 *             PyBuffer_Release(&self.view)
 *         elif (<__pyx_buffer *> &self.view).obj == Py_None:
*/
  __pyx_t_1 = (__pyx_v_self->obj != Py_None);
  if (__pyx_t_1) {

    /* "View.MemoryView":388
 *     def __dealloc__(memoryview self):
 *         if self.obj is not None:
 *             PyBuffer_Release(&self.view)             # <<<<<<<<<<<<<<
 *         elif (<__pyx_buffer *> &self.view).obj == Py_None:
 * 
*/
    PyBuffer_Release((&__pyx_v_self->view));

    /* "View.MemoryView":387
 * 
 *     def __dealloc__(memoryview self):
 *         if self.obj is not None:             # <<<<<<<<<<<<<<
 *             PyBuffer_Release(&self.view)
 *         elif (<__pyx_buffer *> &self.view).obj == Py_None:
*/
    goto __pyx_L3;
  }

  /* "View.MemoryView":389
 *         if self.obj is not None:
 *             PyBuffer_Release(&self.view)
 *         elif (<__pyx_buffer *> &self.view).obj == Py_None:             # <<<<<<<<<<<<<<
 * 
 *             (<__pyx_buffer *> &self.view).obj = NULL
*/
  __pyx_t_1 = (((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None);
  if (__pyx_t_1) {

    /* "View.MemoryView":391
 *         elif (<__pyx_buffer *> &self.view).obj == Py_None:
 * 
 *             (<__pyx_buffer *> &self.view).obj = NULL             # <<<<<<<<<<<<<<
 *             Py_DECREF(Py_None)
 * 
*/
    ((Py_buffer *)(&__pyx_v_self->view))->obj = NULL;

    /* "View.MemoryView":392
 * 
 *             (<__pyx_buffer *> &self.view).obj = NULL
 *             Py_DECREF(Py_None)             # <<<<<<<<<<<<<<
 * 
 *         cdef int i
*/
    Py_DECREF(Py_None);

    /* "View.MemoryView":389
 *         if self.obj is not None:
 *             PyBuffer_Release(&self.view)
 *         elif (<__pyx_buffer *> &self.view).obj == Py_None:             # <<<<<<<<<<<<<<
 * 
 *             (<__pyx_buffer *> &self.view).obj = NULL
*/
  }
  __pyx_L3:;

  /* "View.MemoryView":396
 *         cdef int i
 *         global __pyx_memoryview_thread_locks_used
 *         if self.lock != NULL:             # <<<<<<<<<<<<<<
 *             for i in range(0 if __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() else __pyx_memoryview_thread_locks_used):
 *                 if __pyx_memoryview_thread_locks[i] is self.lock:
*/
  __pyx_t_1 = (__pyx_v_self->lock != NULL);
  if (__pyx_t_1) {

    /* "View.MemoryView":397
 *         global __pyx_memoryview_thread_locks_used
 *         if self.lock != NULL:
 *             for i in range(0 if __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() else __pyx_memoryview_thread_locks_used):             # <<<<<<<<<<<<<<
 *                 if __pyx_memoryview_thread_locks[i] is self.lock:
 *                     __pyx_memoryview_thread_locks_used -= 1
*/
    __pyx_t_1 = __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING();
    if (__pyx_t_1) {
      __pyx_t_2 = 0;
    } else {
      __pyx_t_2 = __pyx_memoryview_thread_locks_used;
    }
    __pyx_t_3 = __pyx_t_2;
    for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
      __pyx_v_i = __pyx_t_4;

      /* "View.MemoryView":398
 *         if self.lock != NULL:
 *             for i in range(0 if __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() else __pyx_memoryview_thread_locks_used):
 *                 if __pyx_memoryview_thread_locks[i] is self.lock:             # <<<<<<<<<<<<<<
 *                     __pyx_memoryview_thread_locks_used -= 1
 *                     if i != __pyx_memoryview_thread_locks_used:
*/
      __pyx_t_1 = ((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock);
      if (__pyx_t_1) {

        /* "View.MemoryView":399
 *             for i in range(0 if __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() else __pyx_memoryview_thread_locks_used):
 *                 if __pyx_memoryview_thread_locks[i] is self.lock:
 *                     __pyx_memoryview_thread_locks_used -= 1             # <<<<<<<<<<<<<<
 *                     if i != __pyx_memoryview_thread_locks_used:
 *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
*/
        __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);

        /* "View.MemoryView":400
 *                 if __pyx_memoryview_thread_locks[i] is self.lock:
 *                     __pyx_memoryview_thread_locks_used -= 1
 *                     if i != __pyx_memoryview_thread_locks_used:             # <<<<<<<<<<<<<<
 *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
 *                             __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
*/
        __pyx_t_1 = (__pyx_v_i != __pyx_memoryview_thread_locks_used);
        if (__pyx_t_1) {

          /* "View.MemoryView":402
 *                     if i != __pyx_memoryview_thread_locks_used:
 *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
 *                             __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])             # <<<<<<<<<<<<<<
 *                     break
 *             else:
*/
          __pyx_t_5 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
          __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_v_i]);

          /* "View.MemoryView":401
 *                     __pyx_memoryview_thread_locks_used -= 1
 *                     if i != __pyx_memoryview_thread_locks_used:
 *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (             # <<<<<<<<<<<<<<
 *                             __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
 *                     break
*/
          (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_5;
          (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_6;

          /* "View.MemoryView":400
 *                 if __pyx_memoryview_thread_locks[i] is self.lock:
 *                     __pyx_memoryview_thread_locks_used -= 1
 *                     if i != __pyx_memoryview_thread_locks_used:             # <<<<<<<<<<<<<<
 *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
 *                             __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
*/
        }

        /* "View.MemoryView":403
 *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
 *                             __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
 *                     break             # <<<<<<<<<<<<<<
 *             else:
 *                 PyThread_free_lock(self.lock)
*/
        goto __pyx_L6_break;

        /* "View.MemoryView":398
 *         if self.lock != NULL:
 *             for i in range(0 if __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() else __pyx_memoryview_thread_locks_used):
 *                 if __pyx_memoryview_thread_locks[i] is self.lock:             # <<<<<<<<<<<<<<
 *                     __pyx_memoryview_thread_locks_used -= 1
 *                     if i != __pyx_memoryview_thread_locks_used:
*/
      }
    }
    /*else*/ {

      /* "View.MemoryView":405
 *                     break
 *             else:
 *                 PyThread_free_lock(self.lock)             # <<<<<<<<<<<<<<
 * 
 *     cdef char *get_item_pointer(memoryview self, object index) except NULL:
*/
      PyThread_free_lock(__pyx_v_self->lock);
    }
    __pyx_L6_break:;

    /* "View.MemoryView":396
 *         cdef int i
 *         global __pyx_memoryview_thread_locks_used
 *         if self.lock != NULL:             # <<<<<<<<<<<<<<
 *             for i in range(0 if __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() else __pyx_memoryview_thread_locks_used):
 *                 if __pyx_memoryview_thread_locks[i] is self.lock:
*/
  }

  /* "View.MemoryView":386
 *         self.typeinfo = NULL
 * 
 *     def __dealloc__(memoryview self):             # <<<<<<<<<<<<<<
 *         if self.obj is not None:
 *             PyBuffer_Release(&self.view)
*/

  /* function exit code */
}

/* "View.MemoryView":407
 *                 PyThread_free_lock(self.lock)
 * 
 *     cdef char *get_item_pointer(memoryview self, object index) except NULL:             # <<<<<<<<<<<<<<
 *         cdef Py_ssize_t dim
 *         cdef char *itemp = <char *> self.view.buf
*/

static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
  Py_ssize_t __pyx_v_dim;
  char *__pyx_v_itemp;
  PyObject *__pyx_v_idx = NULL;
  char *__pyx_r;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  char *__pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_item_pointer", 0);

  /* "View.MemoryView":409
 *     cdef char *get_item_pointer(memoryview self, object index) except NULL:
 *         cdef Py_ssize_t dim
 *         cdef char *itemp = <char *> self.view.buf             # <<<<<<<<<<<<<<
 * 
 *         for dim, idx in enumerate(index):
*/
  __pyx_v_itemp = ((char *)__pyx_v_self->view.buf);

  /* "View.MemoryView":411
 *         cdef char *itemp = <char *> self.view.buf
 * 
 *         for dim, idx in enumerate(index):             # <<<<<<<<<<<<<<
 *             itemp = pybuffer_index(&self.view, itemp, idx, dim)
 * 
*/
  __pyx_t_1 = 0;
  if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
    __pyx_t_2 = __pyx_v_index; __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_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 411, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 411, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(7, 411, __pyx_L1_error)
          #endif
          if (__pyx_t_3 >= __pyx_temp) break;
        }
        __pyx_t_5 = __Pyx_PyList_GetItemRefFast(__pyx_t_2, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference);
        ++__pyx_t_3;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(7, 411, __pyx_L1_error)
          #endif
          if (__pyx_t_3 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3));
        #else
        __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3);
        #endif
        ++__pyx_t_3;
      }
      if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 411, __pyx_L1_error)
    } else {
      __pyx_t_5 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_5)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(7, 411, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_v_dim = __pyx_t_1;
    __pyx_t_1 = (__pyx_t_1 + 1);

    /* "View.MemoryView":412
 * 
 *         for dim, idx in enumerate(index):
 *             itemp = pybuffer_index(&self.view, itemp, idx, dim)             # <<<<<<<<<<<<<<
 * 
 *         return itemp
*/
    __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(7, 412, __pyx_L1_error)
    __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == ((void *)NULL))) __PYX_ERR(7, 412, __pyx_L1_error)
    __pyx_v_itemp = __pyx_t_7;

    /* "View.MemoryView":411
 *         cdef char *itemp = <char *> self.view.buf
 * 
 *         for dim, idx in enumerate(index):             # <<<<<<<<<<<<<<
 *             itemp = pybuffer_index(&self.view, itemp, idx, dim)
 * 
*/
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "View.MemoryView":414
 *             itemp = pybuffer_index(&self.view, itemp, idx, dim)
 * 
 *         return itemp             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = __pyx_v_itemp;
  goto __pyx_L0;

  /* "View.MemoryView":407
 *                 PyThread_free_lock(self.lock)
 * 
 *     cdef char *get_item_pointer(memoryview self, object index) except NULL:             # <<<<<<<<<<<<<<
 *         cdef Py_ssize_t dim
 *         cdef char *itemp = <char *> self.view.buf
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_idx);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":417
 * 
 * 
 *     def __getitem__(memoryview self, object index):             # <<<<<<<<<<<<<<
 *         if index is Ellipsis:
 *             return self
*/

/* Python wrapper */
static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));

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

static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
  PyObject *__pyx_v_have_slices = NULL;
  PyObject *__pyx_v_indices = NULL;
  char *__pyx_v_itemp;
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "View.MemoryView":418
 * 
 *     def __getitem__(memoryview self, object index):
 *         if index is Ellipsis:             # <<<<<<<<<<<<<<
 *             return self
 * 
*/
  __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
  if (__pyx_t_1) {

    /* "View.MemoryView":419
 *     def __getitem__(memoryview self, object index):
 *         if index is Ellipsis:
 *             return self             # <<<<<<<<<<<<<<
 * 
 *         have_slices, indices = _unellipsify(index, self.view.ndim)
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_self);
    __pyx_r = ((PyObject *)__pyx_v_self);
    goto __pyx_L0;

    /* "View.MemoryView":418
 * 
 *     def __getitem__(memoryview self, object index):
 *         if index is Ellipsis:             # <<<<<<<<<<<<<<
 *             return self
 * 
*/
  }

  /* "View.MemoryView":421
 *             return self
 * 
 *         have_slices, indices = _unellipsify(index, self.view.ndim)             # <<<<<<<<<<<<<<
 * 
 *         cdef char *itemp
*/
  __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 421, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (likely(__pyx_t_2 != Py_None)) {
    PyObject* sequence = __pyx_t_2;
    Py_ssize_t size = __Pyx_PyTuple_GET_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(7, 421, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
    __Pyx_INCREF(__pyx_t_4);
    #else
    __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 421, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 421, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    #endif
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(7, 421, __pyx_L1_error)
  }
  __pyx_v_have_slices = __pyx_t_3;
  __pyx_t_3 = 0;
  __pyx_v_indices = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "View.MemoryView":424
 * 
 *         cdef char *itemp
 *         if have_slices:             # <<<<<<<<<<<<<<
 *             return memview_slice(self, indices)
 *         else:
*/
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(7, 424, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "View.MemoryView":425
 *         cdef char *itemp
 *         if have_slices:
 *             return memview_slice(self, indices)             # <<<<<<<<<<<<<<
 *         else:
 *             itemp = self.get_item_pointer(indices)
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 425, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "View.MemoryView":424
 * 
 *         cdef char *itemp
 *         if have_slices:             # <<<<<<<<<<<<<<
 *             return memview_slice(self, indices)
 *         else:
*/
  }

  /* "View.MemoryView":427
 *             return memview_slice(self, indices)
 *         else:
 *             itemp = self.get_item_pointer(indices)             # <<<<<<<<<<<<<<
 *             return self.convert_item_to_object(itemp)
 * 
*/
  /*else*/ {
    __pyx_t_5 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_5 == ((void *)NULL))) __PYX_ERR(7, 427, __pyx_L1_error)
    __pyx_v_itemp = __pyx_t_5;

    /* "View.MemoryView":428
 *         else:
 *             itemp = self.get_item_pointer(indices)
 *             return self.convert_item_to_object(itemp)             # <<<<<<<<<<<<<<
 * 
 *     def __setitem__(memoryview self, object index, object value):
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 428, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }

  /* "View.MemoryView":417
 * 
 * 
 *     def __getitem__(memoryview self, object index):             # <<<<<<<<<<<<<<
 *         if index is Ellipsis:
 *             return self
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_have_slices);
  __Pyx_XDECREF(__pyx_v_indices);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":430
 *             return self.convert_item_to_object(itemp)
 * 
 *     def __setitem__(memoryview self, object index, object value):             # <<<<<<<<<<<<<<
 *         if self.view.readonly:
 *             raise TypeError, "Cannot assign to read-only memoryview"
*/

/* Python wrapper */
static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/
static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value));

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

static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
  PyObject *__pyx_v_have_slices = NULL;
  PyObject *__pyx_v_obj = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setitem__", 0);
  __Pyx_INCREF(__pyx_v_index);

  /* "View.MemoryView":431
 * 
 *     def __setitem__(memoryview self, object index, object value):
 *         if self.view.readonly:             # <<<<<<<<<<<<<<
 *             raise TypeError, "Cannot assign to read-only memoryview"
 * 
*/
  if (unlikely(__pyx_v_self->view.readonly)) {

    /* "View.MemoryView":432
 *     def __setitem__(memoryview self, object index, object value):
 *         if self.view.readonly:
 *             raise TypeError, "Cannot assign to read-only memoryview"             # <<<<<<<<<<<<<<
 * 
 *         have_slices, index = _unellipsify(index, self.view.ndim)
*/
    __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_Cannot_assign_to_read_only_memor, 0, 0);
    __PYX_ERR(7, 432, __pyx_L1_error)

    /* "View.MemoryView":431
 * 
 *     def __setitem__(memoryview self, object index, object value):
 *         if self.view.readonly:             # <<<<<<<<<<<<<<
 *             raise TypeError, "Cannot assign to read-only memoryview"
 * 
*/
  }

  /* "View.MemoryView":434
 *             raise TypeError, "Cannot assign to read-only memoryview"
 * 
 *         have_slices, index = _unellipsify(index, self.view.ndim)             # <<<<<<<<<<<<<<
 * 
 *         if have_slices:
*/
  __pyx_t_1 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 434, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (likely(__pyx_t_1 != Py_None)) {
    PyObject* sequence = __pyx_t_1;
    Py_ssize_t size = __Pyx_PyTuple_GET_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(7, 434, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
    __Pyx_INCREF(__pyx_t_3);
    #else
    __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 434, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 434, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(7, 434, __pyx_L1_error)
  }
  __pyx_v_have_slices = __pyx_t_2;
  __pyx_t_2 = 0;
  __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_3);
  __pyx_t_3 = 0;

  /* "View.MemoryView":436
 *         have_slices, index = _unellipsify(index, self.view.ndim)
 * 
 *         if have_slices:             # <<<<<<<<<<<<<<
 *             obj = self.is_slice(value)
 *             if obj is not None:
*/
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(7, 436, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "View.MemoryView":437
 * 
 *         if have_slices:
 *             obj = self.is_slice(value)             # <<<<<<<<<<<<<<
 *             if obj is not None:
 *                 self.setitem_slice_assignment(self[index], obj)
*/
    __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 437, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_obj = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "View.MemoryView":438
 *         if have_slices:
 *             obj = self.is_slice(value)
 *             if obj is not None:             # <<<<<<<<<<<<<<
 *                 self.setitem_slice_assignment(self[index], obj)
 *             else:
*/
    __pyx_t_4 = (__pyx_v_obj != Py_None);
    if (__pyx_t_4) {

      /* "View.MemoryView":439
 *             obj = self.is_slice(value)
 *             if obj is not None:
 *                 self.setitem_slice_assignment(self[index], obj)             # <<<<<<<<<<<<<<
 *             else:
 *                 self.setitem_slice_assign_scalar(self[index], value)
*/
      __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 439, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_1, __pyx_v_obj); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 439, __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;

      /* "View.MemoryView":438
 *         if have_slices:
 *             obj = self.is_slice(value)
 *             if obj is not None:             # <<<<<<<<<<<<<<
 *                 self.setitem_slice_assignment(self[index], obj)
 *             else:
*/
      goto __pyx_L5;
    }

    /* "View.MemoryView":441
 *                 self.setitem_slice_assignment(self[index], obj)
 *             else:
 *                 self.setitem_slice_assign_scalar(self[index], value)             # <<<<<<<<<<<<<<
 *         else:
 *             self.setitem_indexed(index, value)
*/
    /*else*/ {
      __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 441, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_memoryview_type))))) __PYX_ERR(7, 441, __pyx_L1_error)
      __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_3), __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 441, __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;
    }
    __pyx_L5:;

    /* "View.MemoryView":436
 *         have_slices, index = _unellipsify(index, self.view.ndim)
 * 
 *         if have_slices:             # <<<<<<<<<<<<<<
 *             obj = self.is_slice(value)
 *             if obj is not None:
*/
    goto __pyx_L4;
  }

  /* "View.MemoryView":443
 *                 self.setitem_slice_assign_scalar(self[index], value)
 *         else:
 *             self.setitem_indexed(index, value)             # <<<<<<<<<<<<<<
 * 
 *     cdef is_slice(self, obj):
*/
  /*else*/ {
    __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 443, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_L4:;

  /* "View.MemoryView":430
 *             return self.convert_item_to_object(itemp)
 * 
 *     def __setitem__(memoryview self, object index, object value):             # <<<<<<<<<<<<<<
 *         if self.view.readonly:
 *             raise TypeError, "Cannot assign to read-only memoryview"
*/

  /* 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("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_have_slices);
  __Pyx_XDECREF(__pyx_v_obj);
  __Pyx_XDECREF(__pyx_v_index);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":445
 *             self.setitem_indexed(index, value)
 * 
 *     cdef is_slice(self, obj):             # <<<<<<<<<<<<<<
 *         if not isinstance(obj, memoryview):
 *             try:
*/

static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
  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;
  size_t __pyx_t_10;
  int __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_slice", 0);
  __Pyx_INCREF(__pyx_v_obj);

  /* "View.MemoryView":446
 * 
 *     cdef is_slice(self, obj):
 *         if not isinstance(obj, memoryview):             # <<<<<<<<<<<<<<
 *             try:
 *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
*/
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_mstate_global->__pyx_memoryview_type); 
  __pyx_t_2 = (!__pyx_t_1);
  if (__pyx_t_2) {

    /* "View.MemoryView":447
 *     cdef is_slice(self, obj):
 *         if not isinstance(obj, memoryview):
 *             try:             # <<<<<<<<<<<<<<
 *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
 *                                  self.dtype_is_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:*/ {

        /* "View.MemoryView":448
 *         if not isinstance(obj, memoryview):
 *             try:
 *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,             # <<<<<<<<<<<<<<
 *                                  self.dtype_is_object)
 *             except TypeError:
*/
        __pyx_t_7 = NULL;
        __pyx_t_8 = __Pyx_PyLong_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 448, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_8);

        /* "View.MemoryView":449
 *             try:
 *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
 *                                  self.dtype_is_object)             # <<<<<<<<<<<<<<
 *             except TypeError:
 *                 return None
*/
        __pyx_t_9 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_9)) __PYX_ERR(7, 449, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_10 = 1;
        {
          PyObject *__pyx_callargs[4] = {__pyx_t_7, __pyx_v_obj, __pyx_t_8, __pyx_t_9};
          __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_memoryview_type, __pyx_callargs+__pyx_t_10, (4-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 448, __pyx_L4_error)
          __Pyx_GOTREF((PyObject *)__pyx_t_6);
        }
        __Pyx_DECREF_SET(__pyx_v_obj, ((PyObject *)__pyx_t_6));
        __pyx_t_6 = 0;

        /* "View.MemoryView":447
 *     cdef is_slice(self, obj):
 *         if not isinstance(obj, memoryview):
 *             try:             # <<<<<<<<<<<<<<
 *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
 *                                  self.dtype_is_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_L9_try_end;
      __pyx_L4_error:;
      __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;
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

      /* "View.MemoryView":450
 *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
 *                                  self.dtype_is_object)
 *             except TypeError:             # <<<<<<<<<<<<<<
 *                 return None
 * 
*/
      __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_TypeError))));
      if (__pyx_t_11) {
        __Pyx_ErrRestore(0,0,0);

        /* "View.MemoryView":451
 *                                  self.dtype_is_object)
 *             except TypeError:
 *                 return None             # <<<<<<<<<<<<<<
 * 
 *         return obj
*/
        __Pyx_XDECREF(__pyx_r);
        __pyx_r = Py_None; __Pyx_INCREF(Py_None);
        goto __pyx_L7_except_return;
      }
      goto __pyx_L6_except_error;

      /* "View.MemoryView":447
 *     cdef is_slice(self, obj):
 *         if not isinstance(obj, memoryview):
 *             try:             # <<<<<<<<<<<<<<
 *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
 *                                  self.dtype_is_object)
*/
      __pyx_L6_except_error:;
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
      goto __pyx_L1_error;
      __pyx_L7_except_return:;
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
      goto __pyx_L0;
      __pyx_L9_try_end:;
    }

    /* "View.MemoryView":446
 * 
 *     cdef is_slice(self, obj):
 *         if not isinstance(obj, memoryview):             # <<<<<<<<<<<<<<
 *             try:
 *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
*/
  }

  /* "View.MemoryView":453
 *                 return None
 * 
 *         return obj             # <<<<<<<<<<<<<<
 * 
 *     cdef setitem_slice_assignment(self, dst, src):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_obj);
  __pyx_r = __pyx_v_obj;
  goto __pyx_L0;

  /* "View.MemoryView":445
 *             self.setitem_indexed(index, value)
 * 
 *     cdef is_slice(self, obj):             # <<<<<<<<<<<<<<
 *         if not isinstance(obj, memoryview):
 *             try:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_obj);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":455
 *         return obj
 * 
 *     cdef setitem_slice_assignment(self, dst, src):             # <<<<<<<<<<<<<<
 *         cdef __Pyx_memviewslice dst_slice
 *         cdef __Pyx_memviewslice src_slice
*/

static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
  __Pyx_memviewslice __pyx_v_dst_slice;
  __Pyx_memviewslice __pyx_v_src_slice;
  __Pyx_memviewslice __pyx_v_msrc;
  __Pyx_memviewslice __pyx_v_mdst;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_memviewslice *__pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("setitem_slice_assignment", 0);

  /* "View.MemoryView":458
 *         cdef __Pyx_memviewslice dst_slice
 *         cdef __Pyx_memviewslice src_slice
 *         cdef __Pyx_memviewslice msrc = get_slice_from_memview(src, &src_slice)[0]             # <<<<<<<<<<<<<<
 *         cdef __Pyx_memviewslice mdst = get_slice_from_memview(dst, &dst_slice)[0]
 * 
*/
  if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_mstate_global->__pyx_memoryview_type))))) __PYX_ERR(7, 458, __pyx_L1_error)
  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice)); if (unlikely(__pyx_t_1 == ((void *)NULL))) __PYX_ERR(7, 458, __pyx_L1_error)
  __pyx_v_msrc = (__pyx_t_1[0]);

  /* "View.MemoryView":459
 *         cdef __Pyx_memviewslice src_slice
 *         cdef __Pyx_memviewslice msrc = get_slice_from_memview(src, &src_slice)[0]
 *         cdef __Pyx_memviewslice mdst = get_slice_from_memview(dst, &dst_slice)[0]             # <<<<<<<<<<<<<<
 * 
 *         memoryview_copy_contents(msrc, mdst, src.ndim, dst.ndim, self.dtype_is_object)
*/
  if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_mstate_global->__pyx_memoryview_type))))) __PYX_ERR(7, 459, __pyx_L1_error)
  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice)); if (unlikely(__pyx_t_1 == ((void *)NULL))) __PYX_ERR(7, 459, __pyx_L1_error)
  __pyx_v_mdst = (__pyx_t_1[0]);

  /* "View.MemoryView":461
 *         cdef __Pyx_memviewslice mdst = get_slice_from_memview(dst, &dst_slice)[0]
 * 
 *         memoryview_copy_contents(msrc, mdst, src.ndim, dst.ndim, self.dtype_is_object)             # <<<<<<<<<<<<<<
 * 
 *     cdef setitem_slice_assign_scalar(self, memoryview dst, value):
*/
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_mstate_global->__pyx_n_u_ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 461, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(7, 461, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_mstate_global->__pyx_n_u_ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 461, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(7, 461, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_5 = __pyx_memoryview_copy_contents(__pyx_v_msrc, __pyx_v_mdst, __pyx_t_3, __pyx_t_4, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(7, 461, __pyx_L1_error)

  /* "View.MemoryView":455
 *         return obj
 * 
 *     cdef setitem_slice_assignment(self, dst, src):             # <<<<<<<<<<<<<<
 *         cdef __Pyx_memviewslice dst_slice
 *         cdef __Pyx_memviewslice src_slice
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":463
 *         memoryview_copy_contents(msrc, mdst, src.ndim, dst.ndim, self.dtype_is_object)
 * 
 *     cdef setitem_slice_assign_scalar(self, memoryview dst, value):             # <<<<<<<<<<<<<<
 *         cdef int array[128]
 *         cdef void *tmp = NULL
*/

static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value) {
  int __pyx_v_array[128];
  void *__pyx_v_tmp;
  void *__pyx_v_item;
  __Pyx_memviewslice *__pyx_v_dst_slice;
  __Pyx_memviewslice __pyx_v_tmp_slice;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_memviewslice *__pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  char const *__pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 0);

  /* "View.MemoryView":465
 *     cdef setitem_slice_assign_scalar(self, memoryview dst, value):
 *         cdef int array[128]
 *         cdef void *tmp = NULL             # <<<<<<<<<<<<<<
 *         cdef void *item
 * 
*/
  __pyx_v_tmp = NULL;

  /* "View.MemoryView":470
 *         cdef __Pyx_memviewslice *dst_slice
 *         cdef __Pyx_memviewslice tmp_slice
 *         dst_slice = get_slice_from_memview(dst, &tmp_slice)             # <<<<<<<<<<<<<<
 * 
 *         if <size_t>self.view.itemsize > sizeof(array):
*/
  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice)); if (unlikely(__pyx_t_1 == ((void *)NULL))) __PYX_ERR(7, 470, __pyx_L1_error)
  __pyx_v_dst_slice = __pyx_t_1;

  /* "View.MemoryView":472
 *         dst_slice = get_slice_from_memview(dst, &tmp_slice)
 * 
 *         if <size_t>self.view.itemsize > sizeof(array):             # <<<<<<<<<<<<<<
 *             tmp = PyMem_Malloc(self.view.itemsize)
 *             if tmp == NULL:
*/
  __pyx_t_2 = (((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array)));
  if (__pyx_t_2) {

    /* "View.MemoryView":473
 * 
 *         if <size_t>self.view.itemsize > sizeof(array):
 *             tmp = PyMem_Malloc(self.view.itemsize)             # <<<<<<<<<<<<<<
 *             if tmp == NULL:
 *                 raise MemoryError
*/
    __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);

    /* "View.MemoryView":474
 *         if <size_t>self.view.itemsize > sizeof(array):
 *             tmp = PyMem_Malloc(self.view.itemsize)
 *             if tmp == NULL:             # <<<<<<<<<<<<<<
 *                 raise MemoryError
 *             item = tmp
*/
    __pyx_t_2 = (__pyx_v_tmp == NULL);
    if (unlikely(__pyx_t_2)) {

      /* "View.MemoryView":475
 *             tmp = PyMem_Malloc(self.view.itemsize)
 *             if tmp == NULL:
 *                 raise MemoryError             # <<<<<<<<<<<<<<
 *             item = tmp
 *         else:
*/
      PyErr_NoMemory(); __PYX_ERR(7, 475, __pyx_L1_error)

      /* "View.MemoryView":474
 *         if <size_t>self.view.itemsize > sizeof(array):
 *             tmp = PyMem_Malloc(self.view.itemsize)
 *             if tmp == NULL:             # <<<<<<<<<<<<<<
 *                 raise MemoryError
 *             item = tmp
*/
    }

    /* "View.MemoryView":476
 *             if tmp == NULL:
 *                 raise MemoryError
 *             item = tmp             # <<<<<<<<<<<<<<
 *         else:
 *             item = <void *> array
*/
    __pyx_v_item = __pyx_v_tmp;

    /* "View.MemoryView":472
 *         dst_slice = get_slice_from_memview(dst, &tmp_slice)
 * 
 *         if <size_t>self.view.itemsize > sizeof(array):             # <<<<<<<<<<<<<<
 *             tmp = PyMem_Malloc(self.view.itemsize)
 *             if tmp == NULL:
*/
    goto __pyx_L3;
  }

  /* "View.MemoryView":478
 *             item = tmp
 *         else:
 *             item = <void *> array             # <<<<<<<<<<<<<<
 * 
 *         try:
*/
  /*else*/ {
    __pyx_v_item = ((void *)__pyx_v_array);
  }
  __pyx_L3:;

  /* "View.MemoryView":480
 *             item = <void *> array
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             if self.dtype_is_object:
 *                 (<PyObject **> item)[0] = <PyObject *> value
*/
  /*try:*/ {

    /* "View.MemoryView":481
 * 
 *         try:
 *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
 *                 (<PyObject **> item)[0] = <PyObject *> value
 *             else:
*/
    if (__pyx_v_self->dtype_is_object) {

      /* "View.MemoryView":482
 *         try:
 *             if self.dtype_is_object:
 *                 (<PyObject **> item)[0] = <PyObject *> value             # <<<<<<<<<<<<<<
 *             else:
 *                 self.assign_item_from_object(<char *> item, value)
*/
      (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);

      /* "View.MemoryView":481
 * 
 *         try:
 *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
 *                 (<PyObject **> item)[0] = <PyObject *> value
 *             else:
*/
      goto __pyx_L8;
    }

    /* "View.MemoryView":484
 *                 (<PyObject **> item)[0] = <PyObject *> value
 *             else:
 *                 self.assign_item_from_object(<char *> item, value)             # <<<<<<<<<<<<<<
 * 
 * 
*/
    /*else*/ {
      __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 484, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __pyx_L8:;

    /* "View.MemoryView":488
 * 
 * 
 *             if self.view.suboffsets != NULL:             # <<<<<<<<<<<<<<
 *                 assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
 *             slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
*/
    __pyx_t_2 = (__pyx_v_self->view.suboffsets != NULL);
    if (__pyx_t_2) {

      /* "View.MemoryView":489
 * 
 *             if self.view.suboffsets != NULL:
 *                 assert_direct_dimensions(self.view.suboffsets, self.view.ndim)             # <<<<<<<<<<<<<<
 *             slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
 *                                 item, self.dtype_is_object)
*/
      __pyx_t_4 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(7, 489, __pyx_L6_error)

      /* "View.MemoryView":488
 * 
 * 
 *             if self.view.suboffsets != NULL:             # <<<<<<<<<<<<<<
 *                 assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
 *             slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
*/
    }

    /* "View.MemoryView":490
 *             if self.view.suboffsets != NULL:
 *                 assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
 *             slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,             # <<<<<<<<<<<<<<
 *                                 item, self.dtype_is_object)
 *         finally:
*/
    __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object);
  }

  /* "View.MemoryView":493
 *                                 item, self.dtype_is_object)
 *         finally:
 *             PyMem_Free(tmp)             # <<<<<<<<<<<<<<
 * 
 *     cdef setitem_indexed(self, index, value):
*/
  /*finally:*/ {
    /*normal exit:*/{
      PyMem_Free(__pyx_v_tmp);
      goto __pyx_L7;
    }
    __pyx_L6_error:;
    /*exception exit:*/{
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
       __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
      if ( unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
      __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_XGOTREF(__pyx_t_12);
      __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename;
      {
        PyMem_Free(__pyx_v_tmp);
      }
      __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);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
      __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
      __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6;
      goto __pyx_L1_error;
    }
    __pyx_L7:;
  }

  /* "View.MemoryView":463
 *         memoryview_copy_contents(msrc, mdst, src.ndim, dst.ndim, self.dtype_is_object)
 * 
 *     cdef setitem_slice_assign_scalar(self, memoryview dst, value):             # <<<<<<<<<<<<<<
 *         cdef int array[128]
 *         cdef void *tmp = NULL
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":495
 *             PyMem_Free(tmp)
 * 
 *     cdef setitem_indexed(self, index, value):             # <<<<<<<<<<<<<<
 *         cdef char *itemp = self.get_item_pointer(index)
 *         self.assign_item_from_object(itemp, value)
*/

static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
  char *__pyx_v_itemp;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  char *__pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("setitem_indexed", 0);

  /* "View.MemoryView":496
 * 
 *     cdef setitem_indexed(self, index, value):
 *         cdef char *itemp = self.get_item_pointer(index)             # <<<<<<<<<<<<<<
 *         self.assign_item_from_object(itemp, value)
 * 
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == ((void *)NULL))) __PYX_ERR(7, 496, __pyx_L1_error)
  __pyx_v_itemp = __pyx_t_1;

  /* "View.MemoryView":497
 *     cdef setitem_indexed(self, index, value):
 *         cdef char *itemp = self.get_item_pointer(index)
 *         self.assign_item_from_object(itemp, value)             # <<<<<<<<<<<<<<
 * 
 *     cdef convert_item_to_object(self, char *itemp):
*/
  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 497, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "View.MemoryView":495
 *             PyMem_Free(tmp)
 * 
 *     cdef setitem_indexed(self, index, value):             # <<<<<<<<<<<<<<
 *         cdef char *itemp = self.get_item_pointer(index)
 *         self.assign_item_from_object(itemp, value)
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":499
 *         self.assign_item_from_object(itemp, value)
 * 
 *     cdef convert_item_to_object(self, char *itemp):             # <<<<<<<<<<<<<<
 *         """Only used if instantiated manually by the user, or if Cython doesn't
 *         know how to convert the type"""
*/

static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp) {
  PyObject *__pyx_v_struct = NULL;
  PyObject *__pyx_v_bytesitem = 0;
  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;
  size_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("convert_item_to_object", 0);

  /* "View.MemoryView":502
 *         """Only used if instantiated manually by the user, or if Cython doesn't
 *         know how to convert the type"""
 *         import struct             # <<<<<<<<<<<<<<
 *         cdef bytes bytesitem
 * 
*/
  __pyx_t_2 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_struct, 0, 0, NULL, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 502, __pyx_L1_error)
  __pyx_t_1 = __pyx_t_2;
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_struct = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "View.MemoryView":505
 *         cdef bytes bytesitem
 * 
 *         bytesitem = itemp[:self.view.itemsize]             # <<<<<<<<<<<<<<
 *         try:
 *             result = struct.unpack(self.view.format, bytesitem)
*/
  __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 505, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "View.MemoryView":506
 * 
 *         bytesitem = itemp[:self.view.itemsize]
 *         try:             # <<<<<<<<<<<<<<
 *             result = struct.unpack(self.view.format, bytesitem)
 *         except struct.error:
*/
  {
    __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:*/ {

      /* "View.MemoryView":507
 *         bytesitem = itemp[:self.view.itemsize]
 *         try:
 *             result = struct.unpack(self.view.format, bytesitem)             # <<<<<<<<<<<<<<
 *         except struct.error:
 *             raise ValueError, "Unable to convert item to object"
*/
      __pyx_t_5 = __pyx_v_struct;
      __Pyx_INCREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 507, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = 0;
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_t_6, __pyx_v_bytesitem};
        __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_unpack, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 507, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_1);
      }
      __pyx_v_result = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "View.MemoryView":506
 * 
 *         bytesitem = itemp[:self.view.itemsize]
 *         try:             # <<<<<<<<<<<<<<
 *             result = struct.unpack(self.view.format, bytesitem)
 *         except struct.error:
*/
    }

    /* "View.MemoryView":511
 *             raise ValueError, "Unable to convert item to object"
 *         else:
 *             if len(self.view.format) == 1:             # <<<<<<<<<<<<<<
 *                 return result[0]
 *             return result
*/
    /*else:*/ {
      __pyx_t_8 = __Pyx_ssize_strlen(__pyx_v_self->view.format); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(7, 511, __pyx_L5_except_error)
      __pyx_t_9 = (__pyx_t_8 == 1);
      if (__pyx_t_9) {

        /* "View.MemoryView":512
 *         else:
 *             if len(self.view.format) == 1:
 *                 return result[0]             # <<<<<<<<<<<<<<
 *             return result
 * 
*/
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 512, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_r = __pyx_t_1;
        __pyx_t_1 = 0;
        goto __pyx_L6_except_return;

        /* "View.MemoryView":511
 *             raise ValueError, "Unable to convert item to object"
 *         else:
 *             if len(self.view.format) == 1:             # <<<<<<<<<<<<<<
 *                 return result[0]
 *             return result
*/
      }

      /* "View.MemoryView":513
 *             if len(self.view.format) == 1:
 *                 return result[0]
 *             return result             # <<<<<<<<<<<<<<
 * 
 *     cdef assign_item_from_object(self, char *itemp, object value):
*/
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_result);
      __pyx_r = __pyx_v_result;
      goto __pyx_L6_except_return;
    }
    __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;

    /* "View.MemoryView":508
 *         try:
 *             result = struct.unpack(self.view.format, bytesitem)
 *         except struct.error:             # <<<<<<<<<<<<<<
 *             raise ValueError, "Unable to convert item to object"
 *         else:
*/
    __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_6, &__pyx_t_5);
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_mstate_global->__pyx_n_u_error); if (unlikely(!__pyx_t_10)) __PYX_ERR(7, 508, __pyx_L5_except_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_11 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_10);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_ErrRestore(__pyx_t_1, __pyx_t_6, __pyx_t_5);
    __pyx_t_1 = 0; __pyx_t_6 = 0; __pyx_t_5 = 0;
    if (__pyx_t_11) {
      __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_1) < 0) __PYX_ERR(7, 508, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_1);

      /* "View.MemoryView":509
 *             result = struct.unpack(self.view.format, bytesitem)
 *         except struct.error:
 *             raise ValueError, "Unable to convert item to object"             # <<<<<<<<<<<<<<
 *         else:
 *             if len(self.view.format) == 1:
*/
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_ValueError))), __pyx_mstate_global->__pyx_kp_u_Unable_to_convert_item_to_object, 0, 0);
      __PYX_ERR(7, 509, __pyx_L5_except_error)
    }
    goto __pyx_L5_except_error;

    /* "View.MemoryView":506
 * 
 *         bytesitem = itemp[:self.view.itemsize]
 *         try:             # <<<<<<<<<<<<<<
 *             result = struct.unpack(self.view.format, bytesitem)
 *         except struct.error:
*/
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
    goto __pyx_L1_error;
    __pyx_L6_except_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;
  }

  /* "View.MemoryView":499
 *         self.assign_item_from_object(itemp, value)
 * 
 *     cdef convert_item_to_object(self, char *itemp):             # <<<<<<<<<<<<<<
 *         """Only used if instantiated manually by the user, or if Cython doesn't
 *         know how to convert the type"""
*/

  /* 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_10);
  __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_struct);
  __Pyx_XDECREF(__pyx_v_bytesitem);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":515
 *             return result
 * 
 *     cdef assign_item_from_object(self, char *itemp, object value):             # <<<<<<<<<<<<<<
 *         """Only used if instantiated manually by the user, or if Cython doesn't
 *         know how to convert the type"""
*/

static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
  PyObject *__pyx_v_struct = NULL;
  char __pyx_v_c;
  PyObject *__pyx_v_bytesvalue = 0;
  Py_ssize_t __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  char *__pyx_t_10;
  char *__pyx_t_11;
  Py_ssize_t __pyx_t_12;
  char *__pyx_t_13;
  char *__pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("assign_item_from_object", 0);

  /* "View.MemoryView":518
 *         """Only used if instantiated manually by the user, or if Cython doesn't
 *         know how to convert the type"""
 *         import struct             # <<<<<<<<<<<<<<
 *         cdef char c
 *         cdef bytes bytesvalue
*/
  __pyx_t_2 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_struct, 0, 0, NULL, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 518, __pyx_L1_error)
  __pyx_t_1 = __pyx_t_2;
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_struct = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "View.MemoryView":523
 *         cdef Py_ssize_t i
 * 
 *         if isinstance(value, tuple):             # <<<<<<<<<<<<<<
 *             bytesvalue = struct.pack(self.view.format, *value)
 *         else:
*/
  __pyx_t_3 = PyTuple_Check(__pyx_v_value); 
  if (__pyx_t_3) {

    /* "View.MemoryView":524
 * 
 *         if isinstance(value, tuple):
 *             bytesvalue = struct.pack(self.view.format, *value)             # <<<<<<<<<<<<<<
 *         else:
 *             bytesvalue = struct.pack(self.view.format, value)
*/
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_mstate_global->__pyx_n_u_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 524, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 524, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 524, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_4);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4) != (0)) __PYX_ERR(7, 524, __pyx_L1_error);
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 524, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 524, __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 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 524, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_4))) __PYX_ERR(7, 524, __pyx_L1_error)
    __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "View.MemoryView":523
 *         cdef Py_ssize_t i
 * 
 *         if isinstance(value, tuple):             # <<<<<<<<<<<<<<
 *             bytesvalue = struct.pack(self.view.format, *value)
 *         else:
*/
    goto __pyx_L3;
  }

  /* "View.MemoryView":526
 *             bytesvalue = struct.pack(self.view.format, *value)
 *         else:
 *             bytesvalue = struct.pack(self.view.format, value)             # <<<<<<<<<<<<<<
 * 
 *         for i, c in enumerate(bytesvalue):
*/
  /*else*/ {
    __pyx_t_6 = __pyx_v_struct;
    __Pyx_INCREF(__pyx_t_6);
    __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 526, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = 0;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_1, __pyx_v_value};
      __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_pack, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 526, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_4))) __PYX_ERR(7, 526, __pyx_L1_error)
    __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
    __pyx_t_4 = 0;
  }
  __pyx_L3:;

  /* "View.MemoryView":528
 *             bytesvalue = struct.pack(self.view.format, value)
 * 
 *         for i, c in enumerate(bytesvalue):             # <<<<<<<<<<<<<<
 *             itemp[i] = c
 * 
*/
  __pyx_t_8 = 0;
  if (unlikely(__pyx_v_bytesvalue == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable");
    __PYX_ERR(7, 528, __pyx_L1_error)
  }
  __Pyx_INCREF(__pyx_v_bytesvalue);
  __pyx_t_9 = __pyx_v_bytesvalue;
  __pyx_t_11 = __Pyx_PyBytes_AsWritableString(__pyx_t_9); if (unlikely(__pyx_t_11 == ((char *)NULL))) __PYX_ERR(7, 528, __pyx_L1_error)
  __pyx_t_12 = __Pyx_PyBytes_GET_SIZE(__pyx_t_9); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(7, 528, __pyx_L1_error)
  __pyx_t_13 = (__pyx_t_11 + __pyx_t_12);
  for (__pyx_t_14 = __pyx_t_11; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
    __pyx_t_10 = __pyx_t_14;
    __pyx_v_c = (__pyx_t_10[0]);

    /* "View.MemoryView":529
 * 
 *         for i, c in enumerate(bytesvalue):
 *             itemp[i] = c             # <<<<<<<<<<<<<<
 * 
 *     @cname('getbuffer')
*/
    __pyx_v_i = __pyx_t_8;

    /* "View.MemoryView":528
 *             bytesvalue = struct.pack(self.view.format, value)
 * 
 *         for i, c in enumerate(bytesvalue):             # <<<<<<<<<<<<<<
 *             itemp[i] = c
 * 
*/
    __pyx_t_8 = (__pyx_t_8 + 1);

    /* "View.MemoryView":529
 * 
 *         for i, c in enumerate(bytesvalue):
 *             itemp[i] = c             # <<<<<<<<<<<<<<
 * 
 *     @cname('getbuffer')
*/
    (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
  }
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

  /* "View.MemoryView":515
 *             return result
 * 
 *     cdef assign_item_from_object(self, char *itemp, object value):             # <<<<<<<<<<<<<<
 *         """Only used if instantiated manually by the user, or if Cython doesn't
 *         know how to convert the type"""
*/

  /* 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_9);
  __Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_struct);
  __Pyx_XDECREF(__pyx_v_bytesvalue);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":531
 *             itemp[i] = c
 * 
 *     @cname('getbuffer')             # <<<<<<<<<<<<<<
 *     def __getbuffer__(self, Py_buffer *info, int flags):
 *         if flags & PyBUF_WRITABLE and self.view.readonly:
*/

/* Python wrapper */
CYTHON_UNUSED static int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
CYTHON_UNUSED static int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));

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

static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  Py_ssize_t *__pyx_t_3;
  char *__pyx_t_4;
  void *__pyx_t_5;
  int __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  if (unlikely(__pyx_v_info == NULL)) {
    PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
    return -1;
  }
  __Pyx_RefNannySetupContext("__getbuffer__", 0);
  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(__pyx_v_info->obj);

  /* "View.MemoryView":533
 *     @cname('getbuffer')
 *     def __getbuffer__(self, Py_buffer *info, int flags):
 *         if flags & PyBUF_WRITABLE and self.view.readonly:             # <<<<<<<<<<<<<<
 *             raise ValueError, "Cannot create writable memory view from read-only memoryview"
 * 
*/
  __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_1 = __pyx_v_self->view.readonly;
  __pyx_L4_bool_binop_done:;
  if (unlikely(__pyx_t_1)) {

    /* "View.MemoryView":534
 *     def __getbuffer__(self, Py_buffer *info, int flags):
 *         if flags & PyBUF_WRITABLE and self.view.readonly:
 *             raise ValueError, "Cannot create writable memory view from read-only memoryview"             # <<<<<<<<<<<<<<
 * 
 *         if flags & PyBUF_ND:
*/
    __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_ValueError))), __pyx_mstate_global->__pyx_kp_u_Cannot_create_writable_memory_vi, 0, 0);
    __PYX_ERR(7, 534, __pyx_L1_error)

    /* "View.MemoryView":533
 *     @cname('getbuffer')
 *     def __getbuffer__(self, Py_buffer *info, int flags):
 *         if flags & PyBUF_WRITABLE and self.view.readonly:             # <<<<<<<<<<<<<<
 *             raise ValueError, "Cannot create writable memory view from read-only memoryview"
 * 
*/
  }

  /* "View.MemoryView":536
 *             raise ValueError, "Cannot create writable memory view from read-only memoryview"
 * 
 *         if flags & PyBUF_ND:             # <<<<<<<<<<<<<<
 *             info.shape = self.view.shape
 *         else:
*/
  __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":537
 * 
 *         if flags & PyBUF_ND:
 *             info.shape = self.view.shape             # <<<<<<<<<<<<<<
 *         else:
 *             info.shape = NULL
*/
    __pyx_t_3 = __pyx_v_self->view.shape;
    __pyx_v_info->shape = __pyx_t_3;

    /* "View.MemoryView":536
 *             raise ValueError, "Cannot create writable memory view from read-only memoryview"
 * 
 *         if flags & PyBUF_ND:             # <<<<<<<<<<<<<<
 *             info.shape = self.view.shape
 *         else:
*/
    goto __pyx_L6;
  }

  /* "View.MemoryView":539
 *             info.shape = self.view.shape
 *         else:
 *             info.shape = NULL             # <<<<<<<<<<<<<<
 * 
 *         if flags & PyBUF_STRIDES:
*/
  /*else*/ {
    __pyx_v_info->shape = NULL;
  }
  __pyx_L6:;

  /* "View.MemoryView":541
 *             info.shape = NULL
 * 
 *         if flags & PyBUF_STRIDES:             # <<<<<<<<<<<<<<
 *             info.strides = self.view.strides
 *         else:
*/
  __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":542
 * 
 *         if flags & PyBUF_STRIDES:
 *             info.strides = self.view.strides             # <<<<<<<<<<<<<<
 *         else:
 *             info.strides = NULL
*/
    __pyx_t_3 = __pyx_v_self->view.strides;
    __pyx_v_info->strides = __pyx_t_3;

    /* "View.MemoryView":541
 *             info.shape = NULL
 * 
 *         if flags & PyBUF_STRIDES:             # <<<<<<<<<<<<<<
 *             info.strides = self.view.strides
 *         else:
*/
    goto __pyx_L7;
  }

  /* "View.MemoryView":544
 *             info.strides = self.view.strides
 *         else:
 *             info.strides = NULL             # <<<<<<<<<<<<<<
 * 
 *         if flags & PyBUF_INDIRECT:
*/
  /*else*/ {
    __pyx_v_info->strides = NULL;
  }
  __pyx_L7:;

  /* "View.MemoryView":546
 *             info.strides = NULL
 * 
 *         if flags & PyBUF_INDIRECT:             # <<<<<<<<<<<<<<
 *             info.suboffsets = self.view.suboffsets
 *         else:
*/
  __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":547
 * 
 *         if flags & PyBUF_INDIRECT:
 *             info.suboffsets = self.view.suboffsets             # <<<<<<<<<<<<<<
 *         else:
 *             info.suboffsets = NULL
*/
    __pyx_t_3 = __pyx_v_self->view.suboffsets;
    __pyx_v_info->suboffsets = __pyx_t_3;

    /* "View.MemoryView":546
 *             info.strides = NULL
 * 
 *         if flags & PyBUF_INDIRECT:             # <<<<<<<<<<<<<<
 *             info.suboffsets = self.view.suboffsets
 *         else:
*/
    goto __pyx_L8;
  }

  /* "View.MemoryView":549
 *             info.suboffsets = self.view.suboffsets
 *         else:
 *             info.suboffsets = NULL             # <<<<<<<<<<<<<<
 * 
 *         if flags & PyBUF_FORMAT:
*/
  /*else*/ {
    __pyx_v_info->suboffsets = NULL;
  }
  __pyx_L8:;

  /* "View.MemoryView":551
 *             info.suboffsets = NULL
 * 
 *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
 *             info.format = self.view.format
 *         else:
*/
  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":552
 * 
 *         if flags & PyBUF_FORMAT:
 *             info.format = self.view.format             # <<<<<<<<<<<<<<
 *         else:
 *             info.format = NULL
*/
    __pyx_t_4 = __pyx_v_self->view.format;
    __pyx_v_info->format = __pyx_t_4;

    /* "View.MemoryView":551
 *             info.suboffsets = NULL
 * 
 *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
 *             info.format = self.view.format
 *         else:
*/
    goto __pyx_L9;
  }

  /* "View.MemoryView":554
 *             info.format = self.view.format
 *         else:
 *             info.format = NULL             # <<<<<<<<<<<<<<
 * 
 *         info.buf = self.view.buf
*/
  /*else*/ {
    __pyx_v_info->format = NULL;
  }
  __pyx_L9:;

  /* "View.MemoryView":556
 *             info.format = NULL
 * 
 *         info.buf = self.view.buf             # <<<<<<<<<<<<<<
 *         info.ndim = self.view.ndim
 *         info.itemsize = self.view.itemsize
*/
  __pyx_t_5 = __pyx_v_self->view.buf;
  __pyx_v_info->buf = __pyx_t_5;

  /* "View.MemoryView":557
 * 
 *         info.buf = self.view.buf
 *         info.ndim = self.view.ndim             # <<<<<<<<<<<<<<
 *         info.itemsize = self.view.itemsize
 *         info.len = self.view.len
*/
  __pyx_t_6 = __pyx_v_self->view.ndim;
  __pyx_v_info->ndim = __pyx_t_6;

  /* "View.MemoryView":558
 *         info.buf = self.view.buf
 *         info.ndim = self.view.ndim
 *         info.itemsize = self.view.itemsize             # <<<<<<<<<<<<<<
 *         info.len = self.view.len
 *         info.readonly = self.view.readonly
*/
  __pyx_t_7 = __pyx_v_self->view.itemsize;
  __pyx_v_info->itemsize = __pyx_t_7;

  /* "View.MemoryView":559
 *         info.ndim = self.view.ndim
 *         info.itemsize = self.view.itemsize
 *         info.len = self.view.len             # <<<<<<<<<<<<<<
 *         info.readonly = self.view.readonly
 *         info.obj = self
*/
  __pyx_t_7 = __pyx_v_self->view.len;
  __pyx_v_info->len = __pyx_t_7;

  /* "View.MemoryView":560
 *         info.itemsize = self.view.itemsize
 *         info.len = self.view.len
 *         info.readonly = self.view.readonly             # <<<<<<<<<<<<<<
 *         info.obj = self
 * 
*/
  __pyx_t_1 = __pyx_v_self->view.readonly;
  __pyx_v_info->readonly = __pyx_t_1;

  /* "View.MemoryView":561
 *         info.len = self.view.len
 *         info.readonly = self.view.readonly
 *         info.obj = self             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self);
  __Pyx_GOTREF(__pyx_v_info->obj);
  __Pyx_DECREF(__pyx_v_info->obj);
  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);

  /* "View.MemoryView":531
 *             itemp[i] = c
 * 
 *     @cname('getbuffer')             # <<<<<<<<<<<<<<
 *     def __getbuffer__(self, Py_buffer *info, int flags):
 *         if flags & PyBUF_WRITABLE and self.view.readonly:
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  if (__pyx_v_info->obj != NULL) {
    __Pyx_GOTREF(__pyx_v_info->obj);
    __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
  }
  goto __pyx_L2;
  __pyx_L0:;
  if (__pyx_v_info->obj == Py_None) {
    __Pyx_GOTREF(__pyx_v_info->obj);
    __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
  }
  __pyx_L2:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":564
 * 
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def T(self):
 *         cdef _memoryviewslice result = memoryview_copy(self)
*/

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

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

static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
  struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "View.MemoryView":566
 *     @property
 *     def T(self):
 *         cdef _memoryviewslice result = memoryview_copy(self)             # <<<<<<<<<<<<<<
 *         transpose_memslice(&result.from_slice)
 *         return result
*/
  __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 566, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_memoryviewslice_type))))) __PYX_ERR(7, 566, __pyx_L1_error)
  __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "View.MemoryView":567
 *     def T(self):
 *         cdef _memoryviewslice result = memoryview_copy(self)
 *         transpose_memslice(&result.from_slice)             # <<<<<<<<<<<<<<
 *         return result
 * 
*/
  __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(7, 567, __pyx_L1_error)

  /* "View.MemoryView":568
 *         cdef _memoryviewslice result = memoryview_copy(self)
 *         transpose_memslice(&result.from_slice)
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_result);
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "View.MemoryView":564
 * 
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def T(self):
 *         cdef _memoryviewslice result = memoryview_copy(self)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":570
 *         return result
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def base(self):
 *         return self._get_base()
*/

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

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

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

  /* "View.MemoryView":572
 *     @property
 *     def base(self):
 *         return self._get_base()             # <<<<<<<<<<<<<<
 * 
 *     cdef _get_base(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->_get_base(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 572, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":570
 *         return result
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def base(self):
 *         return self._get_base()
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("View.MemoryView.memoryview.base.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":574
 *         return self._get_base()
 * 
 *     cdef _get_base(self):             # <<<<<<<<<<<<<<
 *         return self.obj
 * 
*/

static PyObject *__pyx_memoryview__get_base(struct __pyx_memoryview_obj *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_base", 0);

  /* "View.MemoryView":575
 * 
 *     cdef _get_base(self):
 *         return self.obj             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->obj);
  __pyx_r = __pyx_v_self->obj;
  goto __pyx_L0;

  /* "View.MemoryView":574
 *         return self._get_base()
 * 
 *     cdef _get_base(self):             # <<<<<<<<<<<<<<
 *         return self.obj
 * 
*/

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

/* "View.MemoryView":577
 *         return self.obj
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def shape(self):
 *         return tuple([length for length in self.view.shape[:self.view.ndim]])
*/

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

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

static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
  Py_ssize_t __pyx_7genexpr__pyx_v_length;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t *__pyx_t_2;
  Py_ssize_t *__pyx_t_3;
  Py_ssize_t *__pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "View.MemoryView":579
 *     @property
 *     def shape(self):
 *         return tuple([length for length in self.view.shape[:self.view.ndim]])             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 579, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
    for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
      __pyx_t_2 = __pyx_t_4;
      __pyx_7genexpr__pyx_v_length = (__pyx_t_2[0]);
      __pyx_t_5 = PyLong_FromSsize_t(__pyx_7genexpr__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 579, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(7, 579, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
  } /* exit inner scope */
  __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 579, __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;

  /* "View.MemoryView":577
 *         return self.obj
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def shape(self):
 *         return tuple([length for length in self.view.shape[:self.view.ndim]])
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":581
 *         return tuple([length for length in self.view.shape[:self.view.ndim]])
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def strides(self):
 *         if self.view.strides == NULL:
*/

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

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

static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
  Py_ssize_t __pyx_8genexpr1__pyx_v_stride;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t *__pyx_t_3;
  Py_ssize_t *__pyx_t_4;
  Py_ssize_t *__pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "View.MemoryView":583
 *     @property
 *     def strides(self):
 *         if self.view.strides == NULL:             # <<<<<<<<<<<<<<
 * 
 *             raise ValueError, "Buffer view does not expose strides"
*/
  __pyx_t_1 = (__pyx_v_self->view.strides == NULL);
  if (unlikely(__pyx_t_1)) {

    /* "View.MemoryView":585
 *         if self.view.strides == NULL:
 * 
 *             raise ValueError, "Buffer view does not expose strides"             # <<<<<<<<<<<<<<
 * 
 *         return tuple([stride for stride in self.view.strides[:self.view.ndim]])
*/
    __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_ValueError))), __pyx_mstate_global->__pyx_kp_u_Buffer_view_does_not_expose_stri, 0, 0);
    __PYX_ERR(7, 585, __pyx_L1_error)

    /* "View.MemoryView":583
 *     @property
 *     def strides(self):
 *         if self.view.strides == NULL:             # <<<<<<<<<<<<<<
 * 
 *             raise ValueError, "Buffer view does not expose strides"
*/
  }

  /* "View.MemoryView":587
 *             raise ValueError, "Buffer view does not expose strides"
 * 
 *         return tuple([stride for stride in self.view.strides[:self.view.ndim]])             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  { /* enter inner scope */
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 587, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
    for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
      __pyx_t_3 = __pyx_t_5;
      __pyx_8genexpr1__pyx_v_stride = (__pyx_t_3[0]);
      __pyx_t_6 = PyLong_FromSsize_t(__pyx_8genexpr1__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 587, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(7, 587, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
  } /* exit inner scope */
  __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 587, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":581
 *         return tuple([length for length in self.view.shape[:self.view.ndim]])
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def strides(self):
 *         if self.view.strides == NULL:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":589
 *         return tuple([stride for stride in self.view.strides[:self.view.ndim]])
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def suboffsets(self):
 *         if self.view.suboffsets == NULL:
*/

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

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

static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
  Py_ssize_t __pyx_8genexpr2__pyx_v_suboffset;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t *__pyx_t_3;
  Py_ssize_t *__pyx_t_4;
  Py_ssize_t *__pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "View.MemoryView":591
 *     @property
 *     def suboffsets(self):
 *         if self.view.suboffsets == NULL:             # <<<<<<<<<<<<<<
 *             return (-1,) * self.view.ndim
 * 
*/
  __pyx_t_1 = (__pyx_v_self->view.suboffsets == NULL);
  if (__pyx_t_1) {

    /* "View.MemoryView":592
 *     def suboffsets(self):
 *         if self.view.suboffsets == NULL:
 *             return (-1,) * self.view.ndim             # <<<<<<<<<<<<<<
 * 
 *         return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PySequence_Multiply(__pyx_mstate_global->__pyx_tuple[0], __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 592, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "View.MemoryView":591
 *     @property
 *     def suboffsets(self):
 *         if self.view.suboffsets == NULL:             # <<<<<<<<<<<<<<
 *             return (-1,) * self.view.ndim
 * 
*/
  }

  /* "View.MemoryView":594
 *             return (-1,) * self.view.ndim
 * 
 *         return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  { /* enter inner scope */
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 594, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
    for (__pyx_t_5 = __pyx_v_self->view.suboffsets; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
      __pyx_t_3 = __pyx_t_5;
      __pyx_8genexpr2__pyx_v_suboffset = (__pyx_t_3[0]);
      __pyx_t_6 = PyLong_FromSsize_t(__pyx_8genexpr2__pyx_v_suboffset); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 594, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(7, 594, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
  } /* exit inner scope */
  __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 594, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":589
 *         return tuple([stride for stride in self.view.strides[:self.view.ndim]])
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def suboffsets(self):
 *         if self.view.suboffsets == NULL:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":596
 *         return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def ndim(self):
 *         return self.view.ndim
*/

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

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

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

  /* "View.MemoryView":598
 *     @property
 *     def ndim(self):
 *         return self.view.ndim             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 598, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":596
 *         return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def ndim(self):
 *         return self.view.ndim
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":600
 *         return self.view.ndim
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def itemsize(self):
 *         return self.view.itemsize
*/

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

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

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

  /* "View.MemoryView":602
 *     @property
 *     def itemsize(self):
 *         return self.view.itemsize             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyLong_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 602, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":600
 *         return self.view.ndim
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def itemsize(self):
 *         return self.view.itemsize
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":604
 *         return self.view.itemsize
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def nbytes(self):
 *         return self.size * self.view.itemsize
*/

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

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

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

  /* "View.MemoryView":606
 *     @property
 *     def nbytes(self):
 *         return self.size * self.view.itemsize             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 606, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyLong_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 606, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 606, __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;

  /* "View.MemoryView":604
 *         return self.view.itemsize
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def nbytes(self):
 *         return self.size * self.view.itemsize
*/

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

/* "View.MemoryView":608
 *         return self.size * self.view.itemsize
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def size(self):
 *         if self._size is None:
*/

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

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

static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
  PyObject *__pyx_v_result = NULL;
  PyObject *__pyx_v_length = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  Py_ssize_t *__pyx_t_2;
  Py_ssize_t *__pyx_t_3;
  Py_ssize_t *__pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "View.MemoryView":610
 *     @property
 *     def size(self):
 *         if self._size is None:             # <<<<<<<<<<<<<<
 *             result = 1
 * 
*/
  __pyx_t_1 = (__pyx_v_self->_size == Py_None);
  if (__pyx_t_1) {

    /* "View.MemoryView":611
 *     def size(self):
 *         if self._size is None:
 *             result = 1             # <<<<<<<<<<<<<<
 * 
 *             for length in self.view.shape[:self.view.ndim]:
*/
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1);
    __pyx_v_result = __pyx_mstate_global->__pyx_int_1;

    /* "View.MemoryView":613
 *             result = 1
 * 
 *             for length in self.view.shape[:self.view.ndim]:             # <<<<<<<<<<<<<<
 *                 result *= length
 * 
*/
    __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
    for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
      __pyx_t_2 = __pyx_t_4;
      __pyx_t_5 = PyLong_FromSsize_t((__pyx_t_2[0])); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 613, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "View.MemoryView":614
 * 
 *             for length in self.view.shape[:self.view.ndim]:
 *                 result *= length             # <<<<<<<<<<<<<<
 * 
 *             self._size = result
*/
      __pyx_t_5 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 614, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_5);
      __pyx_t_5 = 0;
    }

    /* "View.MemoryView":616
 *                 result *= length
 * 
 *             self._size = result             # <<<<<<<<<<<<<<
 * 
 *         return self._size
*/
    __Pyx_INCREF(__pyx_v_result);
    __Pyx_GIVEREF(__pyx_v_result);
    __Pyx_GOTREF(__pyx_v_self->_size);
    __Pyx_DECREF(__pyx_v_self->_size);
    __pyx_v_self->_size = __pyx_v_result;

    /* "View.MemoryView":610
 *     @property
 *     def size(self):
 *         if self._size is None:             # <<<<<<<<<<<<<<
 *             result = 1
 * 
*/
  }

  /* "View.MemoryView":618
 *             self._size = result
 * 
 *         return self._size             # <<<<<<<<<<<<<<
 * 
 *     def __len__(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_size);
  __pyx_r = __pyx_v_self->_size;
  goto __pyx_L0;

  /* "View.MemoryView":608
 *         return self.size * self.view.itemsize
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def size(self):
 *         if self._size is None:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_length);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":620
 *         return self._size
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         if self.view.ndim >= 1:
 *             return self.view.shape[0]
*/

/* Python wrapper */
static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self); /*proto*/
static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self));

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

static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  int __pyx_t_1;

  /* "View.MemoryView":621
 * 
 *     def __len__(self):
 *         if self.view.ndim >= 1:             # <<<<<<<<<<<<<<
 *             return self.view.shape[0]
 * 
*/
  __pyx_t_1 = (__pyx_v_self->view.ndim >= 1);
  if (__pyx_t_1) {

    /* "View.MemoryView":622
 *     def __len__(self):
 *         if self.view.ndim >= 1:
 *             return self.view.shape[0]             # <<<<<<<<<<<<<<
 * 
 *         return 0
*/
    __pyx_r = (__pyx_v_self->view.shape[0]);
    goto __pyx_L0;

    /* "View.MemoryView":621
 * 
 *     def __len__(self):
 *         if self.view.ndim >= 1:             # <<<<<<<<<<<<<<
 *             return self.view.shape[0]
 * 
*/
  }

  /* "View.MemoryView":624
 *             return self.view.shape[0]
 * 
 *         return 0             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
*/
  __pyx_r = 0;
  goto __pyx_L0;

  /* "View.MemoryView":620
 *         return self._size
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         if self.view.ndim >= 1:
 *             return self.view.shape[0]
*/

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

/* "View.MemoryView":626
 *         return 0
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
 *                                                id(self))
*/

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

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

static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__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[5];
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "View.MemoryView":627
 * 
 *     def __repr__(self):
 *         return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,             # <<<<<<<<<<<<<<
 *                                                id(self))
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 627, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 627, __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_mstate_global->__pyx_n_u_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 627, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_1), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 627, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "View.MemoryView":628
 *     def __repr__(self):
 *         return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
 *                                                id(self))             # <<<<<<<<<<<<<<
 * 
 *     def __str__(self):
*/
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 628, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_Format(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 628, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4[0] = __pyx_mstate_global->__pyx_kp_u_MemoryView_of;
  __pyx_t_4[1] = __pyx_t_2;
  __pyx_t_4[2] = __pyx_mstate_global->__pyx_kp_u_at_0x;
  __pyx_t_4[3] = __pyx_t_3;
  __pyx_t_4[4] = __pyx_mstate_global->__pyx_kp_u__3;

  /* "View.MemoryView":627
 * 
 *     def __repr__(self):
 *         return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,             # <<<<<<<<<<<<<<
 *                                                id(self))
 * 
*/
  __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_4, 5, 15 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + 6 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3) + 1, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3));
  if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 627, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":626
 *         return 0
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
 *                                                id(self))
*/

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

/* "View.MemoryView":630
 *                                                id(self))
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
 * 
*/

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

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

static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3[3];
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__str__", 0);

  /* "View.MemoryView":631
 * 
 *     def __str__(self):
 *         return "<MemoryView of %r object>" % (self.base.__class__.__name__,)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 631, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 631, __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_mstate_global->__pyx_n_u_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 631, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_1), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 631, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3[0] = __pyx_mstate_global->__pyx_kp_u_MemoryView_of;
  __pyx_t_3[1] = __pyx_t_2;
  __pyx_t_3[2] = __pyx_mstate_global->__pyx_kp_u_object;
  __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, 15 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + 8, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2));
  if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 631, __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;

  /* "View.MemoryView":630
 *                                                id(self))
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
 * 
*/

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

/* "View.MemoryView":634
 * 
 * 
 *     def is_c_contig(self):             # <<<<<<<<<<<<<<
 *         cdef __Pyx_memviewslice *mslice
 *         cdef __Pyx_memviewslice tmp
*/

/* Python wrapper */
static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_c_contig (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("is_c_contig", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("is_c_contig", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));

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

static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
  __Pyx_memviewslice *__pyx_v_mslice;
  __Pyx_memviewslice __pyx_v_tmp;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_memviewslice *__pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_c_contig", 0);

  /* "View.MemoryView":637
 *         cdef __Pyx_memviewslice *mslice
 *         cdef __Pyx_memviewslice tmp
 *         mslice = get_slice_from_memview(self, &tmp)             # <<<<<<<<<<<<<<
 *         return slice_is_contig(mslice[0], 'C', self.view.ndim)
 * 
*/
  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((void *)NULL))) __PYX_ERR(7, 637, __pyx_L1_error)
  __pyx_v_mslice = __pyx_t_1;

  /* "View.MemoryView":638
 *         cdef __Pyx_memviewslice tmp
 *         mslice = get_slice_from_memview(self, &tmp)
 *         return slice_is_contig(mslice[0], 'C', self.view.ndim)             # <<<<<<<<<<<<<<
 * 
 *     def is_f_contig(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 638, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":634
 * 
 * 
 *     def is_c_contig(self):             # <<<<<<<<<<<<<<
 *         cdef __Pyx_memviewslice *mslice
 *         cdef __Pyx_memviewslice tmp
*/

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

/* "View.MemoryView":640
 *         return slice_is_contig(mslice[0], 'C', self.view.ndim)
 * 
 *     def is_f_contig(self):             # <<<<<<<<<<<<<<
 *         cdef __Pyx_memviewslice *mslice
 *         cdef __Pyx_memviewslice tmp
*/

/* Python wrapper */
static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_f_contig (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("is_f_contig", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("is_f_contig", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));

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

static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
  __Pyx_memviewslice *__pyx_v_mslice;
  __Pyx_memviewslice __pyx_v_tmp;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_memviewslice *__pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_f_contig", 0);

  /* "View.MemoryView":643
 *         cdef __Pyx_memviewslice *mslice
 *         cdef __Pyx_memviewslice tmp
 *         mslice = get_slice_from_memview(self, &tmp)             # <<<<<<<<<<<<<<
 *         return slice_is_contig(mslice[0], 'F', self.view.ndim)
 * 
*/
  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((void *)NULL))) __PYX_ERR(7, 643, __pyx_L1_error)
  __pyx_v_mslice = __pyx_t_1;

  /* "View.MemoryView":644
 *         cdef __Pyx_memviewslice tmp
 *         mslice = get_slice_from_memview(self, &tmp)
 *         return slice_is_contig(mslice[0], 'F', self.view.ndim)             # <<<<<<<<<<<<<<
 * 
 *     def copy(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 644, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":640
 *         return slice_is_contig(mslice[0], 'C', self.view.ndim)
 * 
 *     def is_f_contig(self):             # <<<<<<<<<<<<<<
 *         cdef __Pyx_memviewslice *mslice
 *         cdef __Pyx_memviewslice tmp
*/

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

/* "View.MemoryView":646
 *         return slice_is_contig(mslice[0], 'F', self.view.ndim)
 * 
 *     def copy(self):             # <<<<<<<<<<<<<<
 *         cdef __Pyx_memviewslice mslice
 *         cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
*/

/* Python wrapper */
static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("copy (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("copy", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("copy", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self));

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

static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self) {
  __Pyx_memviewslice __pyx_v_mslice;
  int __pyx_v_flags;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_memviewslice __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("copy", 0);

  /* "View.MemoryView":648
 *     def copy(self):
 *         cdef __Pyx_memviewslice mslice
 *         cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS             # <<<<<<<<<<<<<<
 * 
 *         slice_copy(self, &mslice)
*/
  __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));

  /* "View.MemoryView":650
 *         cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
 * 
 *         slice_copy(self, &mslice)             # <<<<<<<<<<<<<<
 *         mslice = slice_copy_contig(&mslice, "c", self.view.ndim,
 *                                    self.view.itemsize,
*/
  __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));

  /* "View.MemoryView":651
 * 
 *         slice_copy(self, &mslice)
 *         mslice = slice_copy_contig(&mslice, "c", self.view.ndim,             # <<<<<<<<<<<<<<
 *                                    self.view.itemsize,
 *                                    flags|PyBUF_C_CONTIGUOUS,
*/
  __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), __pyx_k_c, __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(7, 651, __pyx_L1_error)
  __pyx_v_mslice = __pyx_t_1;

  /* "View.MemoryView":656
 *                                    self.dtype_is_object)
 * 
 *         return memoryview_copy_from_slice(self, &mslice)             # <<<<<<<<<<<<<<
 * 
 *     def copy_fortran(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 656, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":646
 *         return slice_is_contig(mslice[0], 'F', self.view.ndim)
 * 
 *     def copy(self):             # <<<<<<<<<<<<<<
 *         cdef __Pyx_memviewslice mslice
 *         cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
*/

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

/* "View.MemoryView":658
 *         return memoryview_copy_from_slice(self, &mslice)
 * 
 *     def copy_fortran(self):             # <<<<<<<<<<<<<<
 *         cdef __Pyx_memviewslice src, dst
 *         cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
*/

/* Python wrapper */
static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("copy_fortran (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("copy_fortran", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("copy_fortran", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self));

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

static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self) {
  __Pyx_memviewslice __pyx_v_src;
  __Pyx_memviewslice __pyx_v_dst;
  int __pyx_v_flags;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_memviewslice __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("copy_fortran", 0);

  /* "View.MemoryView":660
 *     def copy_fortran(self):
 *         cdef __Pyx_memviewslice src, dst
 *         cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS             # <<<<<<<<<<<<<<
 * 
 *         slice_copy(self, &src)
*/
  __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));

  /* "View.MemoryView":662
 *         cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
 * 
 *         slice_copy(self, &src)             # <<<<<<<<<<<<<<
 *         dst = slice_copy_contig(&src, "fortran", self.view.ndim,
 *                                 self.view.itemsize,
*/
  __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));

  /* "View.MemoryView":663
 * 
 *         slice_copy(self, &src)
 *         dst = slice_copy_contig(&src, "fortran", self.view.ndim,             # <<<<<<<<<<<<<<
 *                                 self.view.itemsize,
 *                                 flags|PyBUF_F_CONTIGUOUS,
*/
  __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), __pyx_k_fortran, __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(7, 663, __pyx_L1_error)
  __pyx_v_dst = __pyx_t_1;

  /* "View.MemoryView":668
 *                                 self.dtype_is_object)
 * 
 *         return memoryview_copy_from_slice(self, &dst)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 668, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":658
 *         return memoryview_copy_from_slice(self, &mslice)
 * 
 *     def copy_fortran(self):             # <<<<<<<<<<<<<<
 *         cdef __Pyx_memviewslice src, dst
 *         cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __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___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self));

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

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

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

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("View.MemoryView.memoryview.__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___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(7, 3, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(7, 3, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(7, 3, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(7, 3, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(7, 3, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(7, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v___pyx_state);

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

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

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

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

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

/* "View.MemoryView":671
 * 
 * 
 * @cname('__pyx_memoryview_new')             # <<<<<<<<<<<<<<
 * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, const __Pyx_TypeInfo *typeinfo):
 *     cdef memoryview result = memoryview(o, flags, dtype_is_object)
*/

static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, int __pyx_v_dtype_is_object, __Pyx_TypeInfo const *__pyx_v_typeinfo) {
  struct __pyx_memoryview_obj *__pyx_v_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("memoryview_cwrapper", 0);

  /* "View.MemoryView":673
 * @cname('__pyx_memoryview_new')
 * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, const __Pyx_TypeInfo *typeinfo):
 *     cdef memoryview result = memoryview(o, flags, dtype_is_object)             # <<<<<<<<<<<<<<
 *     result.typeinfo = typeinfo
 *     return result
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 673, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 673, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = 1;
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_v_o, __pyx_t_3, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_memoryview_type, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 673, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "View.MemoryView":674
 * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, const __Pyx_TypeInfo *typeinfo):
 *     cdef memoryview result = memoryview(o, flags, dtype_is_object)
 *     result.typeinfo = typeinfo             # <<<<<<<<<<<<<<
 *     return result
 * 
*/
  __pyx_v_result->typeinfo = __pyx_v_typeinfo;

  /* "View.MemoryView":675
 *     cdef memoryview result = memoryview(o, flags, dtype_is_object)
 *     result.typeinfo = typeinfo
 *     return result             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_check')
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_result);
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "View.MemoryView":671
 * 
 * 
 * @cname('__pyx_memoryview_new')             # <<<<<<<<<<<<<<
 * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, const __Pyx_TypeInfo *typeinfo):
 *     cdef memoryview result = memoryview(o, flags, dtype_is_object)
*/

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

/* "View.MemoryView":677
 *     return result
 * 
 * @cname('__pyx_memoryview_check')             # <<<<<<<<<<<<<<
 * cdef inline bint memoryview_check(object o) noexcept:
 *     return isinstance(o, memoryview)
*/

static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
  int __pyx_r;
  int __pyx_t_1;

  /* "View.MemoryView":679
 * @cname('__pyx_memoryview_check')
 * cdef inline bint memoryview_check(object o) noexcept:
 *     return isinstance(o, memoryview)             # <<<<<<<<<<<<<<
 * 
 * cdef tuple _unellipsify(object index, int ndim):
*/
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_mstate_global->__pyx_memoryview_type); 
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "View.MemoryView":677
 *     return result
 * 
 * @cname('__pyx_memoryview_check')             # <<<<<<<<<<<<<<
 * cdef inline bint memoryview_check(object o) noexcept:
 *     return isinstance(o, memoryview)
*/

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

/* "View.MemoryView":681
 *     return isinstance(o, memoryview)
 * 
 * cdef tuple _unellipsify(object index, int ndim):             # <<<<<<<<<<<<<<
 *     """
 *     Replace all ellipses with full slices and fill incomplete indices with
*/

static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
  Py_ssize_t __pyx_v_idx;
  PyObject *__pyx_v_tup = NULL;
  PyObject *__pyx_v_result = NULL;
  int __pyx_v_have_slices;
  int __pyx_v_seen_ellipsis;
  PyObject *__pyx_v_item = NULL;
  Py_ssize_t __pyx_v_nslices;
  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;
  Py_ssize_t __pyx_t_5;
  PyObject *__pyx_t_6[3];
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_unellipsify", 0);

  /* "View.MemoryView":687
 *     """
 *     cdef Py_ssize_t idx
 *     tup = <tuple>index if isinstance(index, tuple) else (index,)             # <<<<<<<<<<<<<<
 * 
 *     result = [slice(None)] * ndim
*/
  __pyx_t_2 = PyTuple_Check(__pyx_v_index); 
  if (__pyx_t_2) {
    __Pyx_INCREF(((PyObject*)__pyx_v_index));
    __pyx_t_1 = __pyx_v_index;
  } else {
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 687, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_index);
    __Pyx_GIVEREF(__pyx_v_index);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index) != (0)) __PYX_ERR(7, 687, __pyx_L1_error);
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
  }
  __pyx_v_tup = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "View.MemoryView":689
 *     tup = <tuple>index if isinstance(index, tuple) else (index,)
 * 
 *     result = [slice(None)] * ndim             # <<<<<<<<<<<<<<
 *     have_slices = False
 *     seen_ellipsis = False
*/
  __pyx_t_1 = PyList_New(1 * ((__pyx_v_ndim<0) ? 0:__pyx_v_ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 689, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  { Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < __pyx_v_ndim; __pyx_temp++) {
      __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
      __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_1, __pyx_temp, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(7, 689, __pyx_L1_error);
    }
  }
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "View.MemoryView":690
 * 
 *     result = [slice(None)] * ndim
 *     have_slices = False             # <<<<<<<<<<<<<<
 *     seen_ellipsis = False
 *     idx = 0
*/
  __pyx_v_have_slices = 0;

  /* "View.MemoryView":691
 *     result = [slice(None)] * ndim
 *     have_slices = False
 *     seen_ellipsis = False             # <<<<<<<<<<<<<<
 *     idx = 0
 *     for item in tup:
*/
  __pyx_v_seen_ellipsis = 0;

  /* "View.MemoryView":692
 *     have_slices = False
 *     seen_ellipsis = False
 *     idx = 0             # <<<<<<<<<<<<<<
 *     for item in tup:
 *         if item is Ellipsis:
*/
  __pyx_v_idx = 0;

  /* "View.MemoryView":693
 *     seen_ellipsis = False
 *     idx = 0
 *     for item in tup:             # <<<<<<<<<<<<<<
 *         if item is Ellipsis:
 *             if not seen_ellipsis:
*/
  if (unlikely(__pyx_v_tup == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(7, 693, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_1);
  __pyx_t_4 = 0;
  for (;;) {
    {
      Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
      #if !CYTHON_ASSUME_SAFE_SIZE
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(7, 693, __pyx_L1_error)
      #endif
      if (__pyx_t_4 >= __pyx_temp) break;
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4));
    #else
    __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_4);
    #endif
    ++__pyx_t_4;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 693, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "View.MemoryView":694
 *     idx = 0
 *     for item in tup:
 *         if item is Ellipsis:             # <<<<<<<<<<<<<<
 *             if not seen_ellipsis:
 *                 idx += ndim - len(tup)
*/
    __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
    if (__pyx_t_2) {

      /* "View.MemoryView":695
 *     for item in tup:
 *         if item is Ellipsis:
 *             if not seen_ellipsis:             # <<<<<<<<<<<<<<
 *                 idx += ndim - len(tup)
 *                 seen_ellipsis = True
*/
      __pyx_t_2 = (!__pyx_v_seen_ellipsis);
      if (__pyx_t_2) {

        /* "View.MemoryView":696
 *         if item is Ellipsis:
 *             if not seen_ellipsis:
 *                 idx += ndim - len(tup)             # <<<<<<<<<<<<<<
 *                 seen_ellipsis = True
 *             have_slices = True
*/
        if (unlikely(__pyx_v_tup == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
          __PYX_ERR(7, 696, __pyx_L1_error)
        }
        __pyx_t_5 = __Pyx_PyTuple_GET_SIZE(__pyx_v_tup); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(7, 696, __pyx_L1_error)
        __pyx_v_idx = (__pyx_v_idx + (__pyx_v_ndim - __pyx_t_5));

        /* "View.MemoryView":697
 *             if not seen_ellipsis:
 *                 idx += ndim - len(tup)
 *                 seen_ellipsis = True             # <<<<<<<<<<<<<<
 *             have_slices = True
 *         else:
*/
        __pyx_v_seen_ellipsis = 1;

        /* "View.MemoryView":695
 *     for item in tup:
 *         if item is Ellipsis:
 *             if not seen_ellipsis:             # <<<<<<<<<<<<<<
 *                 idx += ndim - len(tup)
 *                 seen_ellipsis = True
*/
      }

      /* "View.MemoryView":698
 *                 idx += ndim - len(tup)
 *                 seen_ellipsis = True
 *             have_slices = True             # <<<<<<<<<<<<<<
 *         else:
 *             if isinstance(item, slice):
*/
      __pyx_v_have_slices = 1;

      /* "View.MemoryView":694
 *     idx = 0
 *     for item in tup:
 *         if item is Ellipsis:             # <<<<<<<<<<<<<<
 *             if not seen_ellipsis:
 *                 idx += ndim - len(tup)
*/
      goto __pyx_L5;
    }

    /* "View.MemoryView":700
 *             have_slices = True
 *         else:
 *             if isinstance(item, slice):             # <<<<<<<<<<<<<<
 *                 have_slices = True
 *             elif not PyIndex_Check(item):
*/
    /*else*/ {
      __pyx_t_2 = PySlice_Check(__pyx_v_item); 
      if (__pyx_t_2) {

        /* "View.MemoryView":701
 *         else:
 *             if isinstance(item, slice):
 *                 have_slices = True             # <<<<<<<<<<<<<<
 *             elif not PyIndex_Check(item):
 *                 raise TypeError, f"Cannot index with type '{type(item)}'"
*/
        __pyx_v_have_slices = 1;

        /* "View.MemoryView":700
 *             have_slices = True
 *         else:
 *             if isinstance(item, slice):             # <<<<<<<<<<<<<<
 *                 have_slices = True
 *             elif not PyIndex_Check(item):
*/
        goto __pyx_L7;
      }

      /* "View.MemoryView":702
 *             if isinstance(item, slice):
 *                 have_slices = True
 *             elif not PyIndex_Check(item):             # <<<<<<<<<<<<<<
 *                 raise TypeError, f"Cannot index with type '{type(item)}'"
 *             result[idx] = item
*/
      __pyx_t_2 = (!(PyIndex_Check(__pyx_v_item) != 0));
      if (unlikely(__pyx_t_2)) {

        /* "View.MemoryView":703
 *                 have_slices = True
 *             elif not PyIndex_Check(item):
 *                 raise TypeError, f"Cannot index with type '{type(item)}'"             # <<<<<<<<<<<<<<
 *             result[idx] = item
 *         idx += 1
*/
        __pyx_t_3 = __Pyx_PyObject_FormatSimple(((PyObject *)Py_TYPE(__pyx_v_item)), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 703, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_6[0] = __pyx_mstate_global->__pyx_kp_u_Cannot_index_with_type;
        __pyx_t_6[1] = __pyx_t_3;
        __pyx_t_6[2] = __pyx_mstate_global->__pyx_kp_u__4;
        __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_6, 3, 24 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3) + 1, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3));
        if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 703, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_t_7, 0, 0);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __PYX_ERR(7, 703, __pyx_L1_error)

        /* "View.MemoryView":702
 *             if isinstance(item, slice):
 *                 have_slices = True
 *             elif not PyIndex_Check(item):             # <<<<<<<<<<<<<<
 *                 raise TypeError, f"Cannot index with type '{type(item)}'"
 *             result[idx] = item
*/
      }
      __pyx_L7:;

      /* "View.MemoryView":704
 *             elif not PyIndex_Check(item):
 *                 raise TypeError, f"Cannot index with type '{type(item)}'"
 *             result[idx] = item             # <<<<<<<<<<<<<<
 *         idx += 1
 * 
*/
      if (unlikely((__Pyx_SetItemInt(__pyx_v_result, __pyx_v_idx, __pyx_v_item, Py_ssize_t, 1, PyLong_FromSsize_t, 1, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference) < 0))) __PYX_ERR(7, 704, __pyx_L1_error)
    }
    __pyx_L5:;

    /* "View.MemoryView":705
 *                 raise TypeError, f"Cannot index with type '{type(item)}'"
 *             result[idx] = item
 *         idx += 1             # <<<<<<<<<<<<<<
 * 
 *     nslices = ndim - idx
*/
    __pyx_v_idx = (__pyx_v_idx + 1);

    /* "View.MemoryView":693
 *     seen_ellipsis = False
 *     idx = 0
 *     for item in tup:             # <<<<<<<<<<<<<<
 *         if item is Ellipsis:
 *             if not seen_ellipsis:
*/
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "View.MemoryView":707
 *         idx += 1
 * 
 *     nslices = ndim - idx             # <<<<<<<<<<<<<<
 *     return have_slices or nslices, tuple(result)
 * 
*/
  __pyx_v_nslices = (__pyx_v_ndim - __pyx_v_idx);

  /* "View.MemoryView":708
 * 
 *     nslices = ndim - idx
 *     return have_slices or nslices, tuple(result)             # <<<<<<<<<<<<<<
 * 
 * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1:
*/
  __Pyx_XDECREF(__pyx_r);
  if (!__pyx_v_have_slices) {
  } else {
    __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 708, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_1 = __pyx_t_7;
    __pyx_t_7 = 0;
    goto __pyx_L9_bool_binop_done;
  }
  __pyx_t_7 = PyLong_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 708, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_1 = __pyx_t_7;
  __pyx_t_7 = 0;
  __pyx_L9_bool_binop_done:;
  __pyx_t_7 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 708, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 708, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1) != (0)) __PYX_ERR(7, 708, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_7);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_7) != (0)) __PYX_ERR(7, 708, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_t_7 = 0;
  __pyx_r = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":681
 *     return isinstance(o, memoryview)
 * 
 * cdef tuple _unellipsify(object index, int ndim):             # <<<<<<<<<<<<<<
 *     """
 *     Replace all ellipses with full slices and fill incomplete indices with
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_tup);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_item);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":710
 *     return have_slices or nslices, tuple(result)
 * 
 * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1:             # <<<<<<<<<<<<<<
 *     for suboffset in suboffsets[:ndim]:
 *         if suboffset >= 0:
*/

static int assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) {
  Py_ssize_t __pyx_v_suboffset;
  int __pyx_r;
  Py_ssize_t *__pyx_t_1;
  Py_ssize_t *__pyx_t_2;
  Py_ssize_t *__pyx_t_3;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "View.MemoryView":711
 * 
 * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1:
 *     for suboffset in suboffsets[:ndim]:             # <<<<<<<<<<<<<<
 *         if suboffset >= 0:
 *             raise ValueError, "Indirect dimensions not supported"
*/
  __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
  for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
    __pyx_t_1 = __pyx_t_3;
    __pyx_v_suboffset = (__pyx_t_1[0]);

    /* "View.MemoryView":712
 * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1:
 *     for suboffset in suboffsets[:ndim]:
 *         if suboffset >= 0:             # <<<<<<<<<<<<<<
 *             raise ValueError, "Indirect dimensions not supported"
 *     return 0  # return type just used as an error flag
*/
    __pyx_t_4 = (__pyx_v_suboffset >= 0);
    if (unlikely(__pyx_t_4)) {

      /* "View.MemoryView":713
 *     for suboffset in suboffsets[:ndim]:
 *         if suboffset >= 0:
 *             raise ValueError, "Indirect dimensions not supported"             # <<<<<<<<<<<<<<
 *     return 0  # return type just used as an error flag
 * 
*/
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_ValueError))), __pyx_mstate_global->__pyx_kp_u_Indirect_dimensions_not_supporte, 0, 0);
      __PYX_ERR(7, 713, __pyx_L1_error)

      /* "View.MemoryView":712
 * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1:
 *     for suboffset in suboffsets[:ndim]:
 *         if suboffset >= 0:             # <<<<<<<<<<<<<<
 *             raise ValueError, "Indirect dimensions not supported"
 *     return 0  # return type just used as an error flag
*/
    }
  }

  /* "View.MemoryView":714
 *         if suboffset >= 0:
 *             raise ValueError, "Indirect dimensions not supported"
 *     return 0  # return type just used as an error flag             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = 0;
  goto __pyx_L0;

  /* "View.MemoryView":710
 *     return have_slices or nslices, tuple(result)
 * 
 * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1:             # <<<<<<<<<<<<<<
 *     for suboffset in suboffsets[:ndim]:
 *         if suboffset >= 0:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "View.MemoryView":720
 * 
 * 
 * @cname('__pyx_memview_slice')             # <<<<<<<<<<<<<<
 * cdef memoryview memview_slice(memoryview memview, object indices):
 *     cdef int new_ndim = 0, suboffset_dim = -1, dim
*/

static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
  int __pyx_v_new_ndim;
  int __pyx_v_suboffset_dim;
  int __pyx_v_dim;
  __Pyx_memviewslice __pyx_v_src;
  __Pyx_memviewslice __pyx_v_dst;
  __Pyx_memviewslice *__pyx_v_p_src;
  struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
  __Pyx_memviewslice *__pyx_v_p_dst;
  int *__pyx_v_p_suboffset_dim;
  Py_ssize_t __pyx_v_start;
  Py_ssize_t __pyx_v_stop;
  Py_ssize_t __pyx_v_step;
  Py_ssize_t __pyx_v_cindex;
  int __pyx_v_have_start;
  int __pyx_v_have_stop;
  int __pyx_v_have_step;
  PyObject *__pyx_v_index = NULL;
  struct __pyx_memoryview_obj *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  struct __pyx_memoryview_obj *__pyx_t_3;
  char *__pyx_t_4;
  int __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  int __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("memview_slice", 0);

  /* "View.MemoryView":722
 * @cname('__pyx_memview_slice')
 * cdef memoryview memview_slice(memoryview memview, object indices):
 *     cdef int new_ndim = 0, suboffset_dim = -1, dim             # <<<<<<<<<<<<<<
 *     cdef bint negative_step
 *     cdef __Pyx_memviewslice src, dst
*/
  __pyx_v_new_ndim = 0;
  __pyx_v_suboffset_dim = -1;

  /* "View.MemoryView":729
 * 
 * 
 *     memset(&dst, 0, sizeof(dst))             # <<<<<<<<<<<<<<
 * 
 *     cdef _memoryviewslice memviewsliceobj
*/
  (void)(memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst))));

  /* "View.MemoryView":733
 *     cdef _memoryviewslice memviewsliceobj
 * 
 *     assert memview.view.ndim > 0             # <<<<<<<<<<<<<<
 * 
 *     if isinstance(memview, _memoryviewslice):
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = (__pyx_v_memview->view.ndim > 0);
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(7, 733, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(7, 733, __pyx_L1_error)
  #endif

  /* "View.MemoryView":735
 *     assert memview.view.ndim > 0
 * 
 *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
 *         memviewsliceobj = memview
 *         p_src = &memviewsliceobj.from_slice
*/
  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_mstate_global->__pyx_memoryviewslice_type); 
  if (__pyx_t_1) {

    /* "View.MemoryView":736
 * 
 *     if isinstance(memview, _memoryviewslice):
 *         memviewsliceobj = memview             # <<<<<<<<<<<<<<
 *         p_src = &memviewsliceobj.from_slice
 *     else:
*/
    __pyx_t_2 = ((PyObject *)__pyx_v_memview);
    __Pyx_INCREF(__pyx_t_2);
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_memoryviewslice_type))))) __PYX_ERR(7, 736, __pyx_L1_error)
    __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "View.MemoryView":737
 *     if isinstance(memview, _memoryviewslice):
 *         memviewsliceobj = memview
 *         p_src = &memviewsliceobj.from_slice             # <<<<<<<<<<<<<<
 *     else:
 *         slice_copy(memview, &src)
*/
    __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);

    /* "View.MemoryView":735
 *     assert memview.view.ndim > 0
 * 
 *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
 *         memviewsliceobj = memview
 *         p_src = &memviewsliceobj.from_slice
*/
    goto __pyx_L3;
  }

  /* "View.MemoryView":739
 *         p_src = &memviewsliceobj.from_slice
 *     else:
 *         slice_copy(memview, &src)             # <<<<<<<<<<<<<<
 *         p_src = &src
 * 
*/
  /*else*/ {
    __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));

    /* "View.MemoryView":740
 *     else:
 *         slice_copy(memview, &src)
 *         p_src = &src             # <<<<<<<<<<<<<<
 * 
 * 
*/
    __pyx_v_p_src = (&__pyx_v_src);
  }
  __pyx_L3:;

  /* "View.MemoryView":746
 * 
 * 
 *     dst.memview = p_src.memview             # <<<<<<<<<<<<<<
 *     dst.data = p_src.data
 * 
*/
  __pyx_t_3 = __pyx_v_p_src->memview;
  __pyx_v_dst.memview = __pyx_t_3;

  /* "View.MemoryView":747
 * 
 *     dst.memview = p_src.memview
 *     dst.data = p_src.data             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_4 = __pyx_v_p_src->data;
  __pyx_v_dst.data = __pyx_t_4;

  /* "View.MemoryView":752
 * 
 * 
 *     cdef __Pyx_memviewslice *p_dst = &dst             # <<<<<<<<<<<<<<
 *     cdef int *p_suboffset_dim = &suboffset_dim
 *     cdef Py_ssize_t start, stop, step, cindex
*/
  __pyx_v_p_dst = (&__pyx_v_dst);

  /* "View.MemoryView":753
 * 
 *     cdef __Pyx_memviewslice *p_dst = &dst
 *     cdef int *p_suboffset_dim = &suboffset_dim             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t start, stop, step, cindex
 *     cdef bint have_start, have_stop, have_step
*/
  __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);

  /* "View.MemoryView":757
 *     cdef bint have_start, have_stop, have_step
 * 
 *     for dim, index in enumerate(indices):             # <<<<<<<<<<<<<<
 *         if PyIndex_Check(index):
 *             cindex = index
*/
  __pyx_t_5 = 0;
  if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
    __pyx_t_2 = __pyx_v_indices; __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_indices); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 757, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 757, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_7)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(7, 757, __pyx_L1_error)
          #endif
          if (__pyx_t_6 >= __pyx_temp) break;
        }
        __pyx_t_8 = __Pyx_PyList_GetItemRefFast(__pyx_t_2, __pyx_t_6, __Pyx_ReferenceSharing_OwnStrongReference);
        ++__pyx_t_6;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(7, 757, __pyx_L1_error)
          #endif
          if (__pyx_t_6 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_8 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6));
        #else
        __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6);
        #endif
        ++__pyx_t_6;
      }
      if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 757, __pyx_L1_error)
    } else {
      __pyx_t_8 = __pyx_t_7(__pyx_t_2);
      if (unlikely(!__pyx_t_8)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(7, 757, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_8);
    __pyx_t_8 = 0;
    __pyx_v_dim = __pyx_t_5;
    __pyx_t_5 = (__pyx_t_5 + 1);

    /* "View.MemoryView":758
 * 
 *     for dim, index in enumerate(indices):
 *         if PyIndex_Check(index):             # <<<<<<<<<<<<<<
 *             cindex = index
 *             slice_memviewslice(
*/
    __pyx_t_1 = (PyIndex_Check(__pyx_v_index) != 0);
    if (__pyx_t_1) {

      /* "View.MemoryView":759
 *     for dim, index in enumerate(indices):
 *         if PyIndex_Check(index):
 *             cindex = index             # <<<<<<<<<<<<<<
 *             slice_memviewslice(
 *                 p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
*/
      __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(7, 759, __pyx_L1_error)
      __pyx_v_cindex = __pyx_t_9;

      /* "View.MemoryView":760
 *         if PyIndex_Check(index):
 *             cindex = index
 *             slice_memviewslice(             # <<<<<<<<<<<<<<
 *                 p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
 *                 dim, new_ndim, p_suboffset_dim,
*/
      __pyx_t_10 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_cindex, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(7, 760, __pyx_L1_error)

      /* "View.MemoryView":758
 * 
 *     for dim, index in enumerate(indices):
 *         if PyIndex_Check(index):             # <<<<<<<<<<<<<<
 *             cindex = index
 *             slice_memviewslice(
*/
      goto __pyx_L6;
    }

    /* "View.MemoryView":766
 *                 0, 0, 0, # have_{start,stop,step}
 *                 False)
 *         elif index is None:             # <<<<<<<<<<<<<<
 *             p_dst.shape[new_ndim] = 1
 *             p_dst.strides[new_ndim] = 0
*/
    __pyx_t_1 = (__pyx_v_index == Py_None);
    if (__pyx_t_1) {

      /* "View.MemoryView":767
 *                 False)
 *         elif index is None:
 *             p_dst.shape[new_ndim] = 1             # <<<<<<<<<<<<<<
 *             p_dst.strides[new_ndim] = 0
 *             p_dst.suboffsets[new_ndim] = -1
*/
      (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;

      /* "View.MemoryView":768
 *         elif index is None:
 *             p_dst.shape[new_ndim] = 1
 *             p_dst.strides[new_ndim] = 0             # <<<<<<<<<<<<<<
 *             p_dst.suboffsets[new_ndim] = -1
 *             new_ndim += 1
*/
      (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;

      /* "View.MemoryView":769
 *             p_dst.shape[new_ndim] = 1
 *             p_dst.strides[new_ndim] = 0
 *             p_dst.suboffsets[new_ndim] = -1             # <<<<<<<<<<<<<<
 *             new_ndim += 1
 *         else:
*/
      (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;

      /* "View.MemoryView":770
 *             p_dst.strides[new_ndim] = 0
 *             p_dst.suboffsets[new_ndim] = -1
 *             new_ndim += 1             # <<<<<<<<<<<<<<
 *         else:
 *             start = index.start or 0
*/
      __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);

      /* "View.MemoryView":766
 *                 0, 0, 0, # have_{start,stop,step}
 *                 False)
 *         elif index is None:             # <<<<<<<<<<<<<<
 *             p_dst.shape[new_ndim] = 1
 *             p_dst.strides[new_ndim] = 0
*/
      goto __pyx_L6;
    }

    /* "View.MemoryView":772
 *             new_ndim += 1
 *         else:
 *             start = index.start or 0             # <<<<<<<<<<<<<<
 *             stop = index.stop or 0
 *             step = index.step or 0
*/
    /*else*/ {
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_start); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 772, __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(7, 772, __pyx_L1_error)
      if (!__pyx_t_1) {
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      } else {
        __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(7, 772, __pyx_L1_error)
        __pyx_t_9 = __pyx_t_11;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        goto __pyx_L7_bool_binop_done;
      }
      __pyx_t_9 = 0;
      __pyx_L7_bool_binop_done:;
      __pyx_v_start = __pyx_t_9;

      /* "View.MemoryView":773
 *         else:
 *             start = index.start or 0
 *             stop = index.stop or 0             # <<<<<<<<<<<<<<
 *             step = index.step or 0
 * 
*/
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_stop); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 773, __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(7, 773, __pyx_L1_error)
      if (!__pyx_t_1) {
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      } else {
        __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(7, 773, __pyx_L1_error)
        __pyx_t_9 = __pyx_t_11;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        goto __pyx_L9_bool_binop_done;
      }
      __pyx_t_9 = 0;
      __pyx_L9_bool_binop_done:;
      __pyx_v_stop = __pyx_t_9;

      /* "View.MemoryView":774
 *             start = index.start or 0
 *             stop = index.stop or 0
 *             step = index.step or 0             # <<<<<<<<<<<<<<
 * 
 *             have_start = index.start is not None
*/
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_step); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 774, __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(7, 774, __pyx_L1_error)
      if (!__pyx_t_1) {
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      } else {
        __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(7, 774, __pyx_L1_error)
        __pyx_t_9 = __pyx_t_11;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        goto __pyx_L11_bool_binop_done;
      }
      __pyx_t_9 = 0;
      __pyx_L11_bool_binop_done:;
      __pyx_v_step = __pyx_t_9;

      /* "View.MemoryView":776
 *             step = index.step or 0
 * 
 *             have_start = index.start is not None             # <<<<<<<<<<<<<<
 *             have_stop = index.stop is not None
 *             have_step = index.step is not None
*/
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_start); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 776, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_1 = (__pyx_t_8 != Py_None);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_v_have_start = __pyx_t_1;

      /* "View.MemoryView":777
 * 
 *             have_start = index.start is not None
 *             have_stop = index.stop is not None             # <<<<<<<<<<<<<<
 *             have_step = index.step is not None
 * 
*/
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_stop); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 777, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_1 = (__pyx_t_8 != Py_None);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_v_have_stop = __pyx_t_1;

      /* "View.MemoryView":778
 *             have_start = index.start is not None
 *             have_stop = index.stop is not None
 *             have_step = index.step is not None             # <<<<<<<<<<<<<<
 * 
 *             slice_memviewslice(
*/
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_step); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 778, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_1 = (__pyx_t_8 != Py_None);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_v_have_step = __pyx_t_1;

      /* "View.MemoryView":780
 *             have_step = index.step is not None
 * 
 *             slice_memviewslice(             # <<<<<<<<<<<<<<
 *                 p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
 *                 dim, new_ndim, p_suboffset_dim,
*/
      __pyx_t_10 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(7, 780, __pyx_L1_error)

      /* "View.MemoryView":786
 *                 have_start, have_stop, have_step,
 *                 True)
 *             new_ndim += 1             # <<<<<<<<<<<<<<
 * 
 *     if isinstance(memview, _memoryviewslice):
*/
      __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
    }
    __pyx_L6:;

    /* "View.MemoryView":757
 *     cdef bint have_start, have_stop, have_step
 * 
 *     for dim, index in enumerate(indices):             # <<<<<<<<<<<<<<
 *         if PyIndex_Check(index):
 *             cindex = index
*/
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "View.MemoryView":788
 *             new_ndim += 1
 * 
 *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
 *         return memoryview_fromslice(dst, new_ndim,
 *                                     memviewsliceobj.to_object_func,
*/
  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_mstate_global->__pyx_memoryviewslice_type); 
  if (__pyx_t_1) {

    /* "View.MemoryView":789
 * 
 *     if isinstance(memview, _memoryviewslice):
 *         return memoryview_fromslice(dst, new_ndim,             # <<<<<<<<<<<<<<
 *                                     memviewsliceobj.to_object_func,
 *                                     memviewsliceobj.to_dtype_func,
*/
    __Pyx_XDECREF((PyObject *)__pyx_r);

    /* "View.MemoryView":790
 *     if isinstance(memview, _memoryviewslice):
 *         return memoryview_fromslice(dst, new_ndim,
 *                                     memviewsliceobj.to_object_func,             # <<<<<<<<<<<<<<
 *                                     memviewsliceobj.to_dtype_func,
 *                                     memview.dtype_is_object)
*/
    if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(7, 790, __pyx_L1_error) }

    /* "View.MemoryView":791
 *         return memoryview_fromslice(dst, new_ndim,
 *                                     memviewsliceobj.to_object_func,
 *                                     memviewsliceobj.to_dtype_func,             # <<<<<<<<<<<<<<
 *                                     memview.dtype_is_object)
 *     else:
*/
    if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(7, 791, __pyx_L1_error) }

    /* "View.MemoryView":789
 * 
 *     if isinstance(memview, _memoryviewslice):
 *         return memoryview_fromslice(dst, new_ndim,             # <<<<<<<<<<<<<<
 *                                     memviewsliceobj.to_object_func,
 *                                     memviewsliceobj.to_dtype_func,
*/
    __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 789, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_memoryview_type))))) __PYX_ERR(7, 789, __pyx_L1_error)
    __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "View.MemoryView":788
 *             new_ndim += 1
 * 
 *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
 *         return memoryview_fromslice(dst, new_ndim,
 *                                     memviewsliceobj.to_object_func,
*/
  }

  /* "View.MemoryView":794
 *                                     memview.dtype_is_object)
 *     else:
 *         return memoryview_fromslice(dst, new_ndim, NULL, NULL,             # <<<<<<<<<<<<<<
 *                                     memview.dtype_is_object)
 * 
*/
  /*else*/ {
    __Pyx_XDECREF((PyObject *)__pyx_r);

    /* "View.MemoryView":795
 *     else:
 *         return memoryview_fromslice(dst, new_ndim, NULL, NULL,
 *                                     memview.dtype_is_object)             # <<<<<<<<<<<<<<
 * 
 * 
*/
    __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 794, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "View.MemoryView":794
 *                                     memview.dtype_is_object)
 *     else:
 *         return memoryview_fromslice(dst, new_ndim, NULL, NULL,             # <<<<<<<<<<<<<<
 *                                     memview.dtype_is_object)
 * 
*/
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_memoryview_type))))) __PYX_ERR(7, 794, __pyx_L1_error)
    __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }

  /* "View.MemoryView":720
 * 
 * 
 * @cname('__pyx_memview_slice')             # <<<<<<<<<<<<<<
 * cdef memoryview memview_slice(memoryview memview, object indices):
 *     cdef int new_ndim = 0, suboffset_dim = -1, dim
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
  __Pyx_XDECREF(__pyx_v_index);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":801
 * 
 * 
 * @cname('__pyx_pybuffer_index')             # <<<<<<<<<<<<<<
 * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
 *                           Py_ssize_t dim) except NULL:
*/

static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) {
  Py_ssize_t __pyx_v_shape;
  Py_ssize_t __pyx_v_stride;
  Py_ssize_t __pyx_v_suboffset;
  Py_ssize_t __pyx_v_itemsize;
  char *__pyx_v_resultp;
  char *__pyx_r;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4[3];
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("pybuffer_index", 0);

  /* "View.MemoryView":804
 * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
 *                           Py_ssize_t dim) except NULL:
 *     cdef Py_ssize_t shape, stride, suboffset = -1             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t itemsize = view.itemsize
 *     cdef char *resultp
*/
  __pyx_v_suboffset = -1L;

  /* "View.MemoryView":805
 *                           Py_ssize_t dim) except NULL:
 *     cdef Py_ssize_t shape, stride, suboffset = -1
 *     cdef Py_ssize_t itemsize = view.itemsize             # <<<<<<<<<<<<<<
 *     cdef char *resultp
 * 
*/
  __pyx_t_1 = __pyx_v_view->itemsize;
  __pyx_v_itemsize = __pyx_t_1;

  /* "View.MemoryView":808
 *     cdef char *resultp
 * 
 *     if view.ndim == 0:             # <<<<<<<<<<<<<<
 *         shape = view.len // itemsize
 *         stride = itemsize
*/
  __pyx_t_2 = (__pyx_v_view->ndim == 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":809
 * 
 *     if view.ndim == 0:
 *         shape = view.len // itemsize             # <<<<<<<<<<<<<<
 *         stride = itemsize
 *     else:
*/
    if (unlikely(__pyx_v_itemsize == 0)) {
      PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
      __PYX_ERR(7, 809, __pyx_L1_error)
    }
    else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1)  && unlikely(__Pyx_UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
      PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
      __PYX_ERR(7, 809, __pyx_L1_error)
    }
    __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize, 0);

    /* "View.MemoryView":810
 *     if view.ndim == 0:
 *         shape = view.len // itemsize
 *         stride = itemsize             # <<<<<<<<<<<<<<
 *     else:
 *         shape = view.shape[dim]
*/
    __pyx_v_stride = __pyx_v_itemsize;

    /* "View.MemoryView":808
 *     cdef char *resultp
 * 
 *     if view.ndim == 0:             # <<<<<<<<<<<<<<
 *         shape = view.len // itemsize
 *         stride = itemsize
*/
    goto __pyx_L3;
  }

  /* "View.MemoryView":812
 *         stride = itemsize
 *     else:
 *         shape = view.shape[dim]             # <<<<<<<<<<<<<<
 *         stride = view.strides[dim]
 *         if view.suboffsets != NULL:
*/
  /*else*/ {
    __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);

    /* "View.MemoryView":813
 *     else:
 *         shape = view.shape[dim]
 *         stride = view.strides[dim]             # <<<<<<<<<<<<<<
 *         if view.suboffsets != NULL:
 *             suboffset = view.suboffsets[dim]
*/
    __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);

    /* "View.MemoryView":814
 *         shape = view.shape[dim]
 *         stride = view.strides[dim]
 *         if view.suboffsets != NULL:             # <<<<<<<<<<<<<<
 *             suboffset = view.suboffsets[dim]
 * 
*/
    __pyx_t_2 = (__pyx_v_view->suboffsets != NULL);
    if (__pyx_t_2) {

      /* "View.MemoryView":815
 *         stride = view.strides[dim]
 *         if view.suboffsets != NULL:
 *             suboffset = view.suboffsets[dim]             # <<<<<<<<<<<<<<
 * 
 *     if index < 0:
*/
      __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);

      /* "View.MemoryView":814
 *         shape = view.shape[dim]
 *         stride = view.strides[dim]
 *         if view.suboffsets != NULL:             # <<<<<<<<<<<<<<
 *             suboffset = view.suboffsets[dim]
 * 
*/
    }
  }
  __pyx_L3:;

  /* "View.MemoryView":817
 *             suboffset = view.suboffsets[dim]
 * 
 *     if index < 0:             # <<<<<<<<<<<<<<
 *         index += view.shape[dim]
 *         if index < 0:
*/
  __pyx_t_2 = (__pyx_v_index < 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":818
 * 
 *     if index < 0:
 *         index += view.shape[dim]             # <<<<<<<<<<<<<<
 *         if index < 0:
 *             raise IndexError, f"Out of bounds on buffer access (axis {dim})"
*/
    __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));

    /* "View.MemoryView":819
 *     if index < 0:
 *         index += view.shape[dim]
 *         if index < 0:             # <<<<<<<<<<<<<<
 *             raise IndexError, f"Out of bounds on buffer access (axis {dim})"
 * 
*/
    __pyx_t_2 = (__pyx_v_index < 0);
    if (unlikely(__pyx_t_2)) {

      /* "View.MemoryView":820
 *         index += view.shape[dim]
 *         if index < 0:
 *             raise IndexError, f"Out of bounds on buffer access (axis {dim})"             # <<<<<<<<<<<<<<
 * 
 *     if index >= shape:
*/
      __pyx_t_3 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_dim, 0, ' ', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 820, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4[0] = __pyx_mstate_global->__pyx_kp_u_Out_of_bounds_on_buffer_access_a;
      __pyx_t_4[1] = __pyx_t_3;
      __pyx_t_4[2] = __pyx_mstate_global->__pyx_kp_u__5;
      __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_4, 3, 37 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3) + 1, 127);
      if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 820, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_IndexError))), __pyx_t_5, 0, 0);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __PYX_ERR(7, 820, __pyx_L1_error)

      /* "View.MemoryView":819
 *     if index < 0:
 *         index += view.shape[dim]
 *         if index < 0:             # <<<<<<<<<<<<<<
 *             raise IndexError, f"Out of bounds on buffer access (axis {dim})"
 * 
*/
    }

    /* "View.MemoryView":817
 *             suboffset = view.suboffsets[dim]
 * 
 *     if index < 0:             # <<<<<<<<<<<<<<
 *         index += view.shape[dim]
 *         if index < 0:
*/
  }

  /* "View.MemoryView":822
 *             raise IndexError, f"Out of bounds on buffer access (axis {dim})"
 * 
 *     if index >= shape:             # <<<<<<<<<<<<<<
 *         raise IndexError, f"Out of bounds on buffer access (axis {dim})"
 * 
*/
  __pyx_t_2 = (__pyx_v_index >= __pyx_v_shape);
  if (unlikely(__pyx_t_2)) {

    /* "View.MemoryView":823
 * 
 *     if index >= shape:
 *         raise IndexError, f"Out of bounds on buffer access (axis {dim})"             # <<<<<<<<<<<<<<
 * 
 *     resultp = bufp + index * stride
*/
    __pyx_t_5 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_dim, 0, ' ', 'd'); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 823, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4[0] = __pyx_mstate_global->__pyx_kp_u_Out_of_bounds_on_buffer_access_a;
    __pyx_t_4[1] = __pyx_t_5;
    __pyx_t_4[2] = __pyx_mstate_global->__pyx_kp_u__5;
    __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_4, 3, 37 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5) + 1, 127);
    if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 823, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_IndexError))), __pyx_t_3, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(7, 823, __pyx_L1_error)

    /* "View.MemoryView":822
 *             raise IndexError, f"Out of bounds on buffer access (axis {dim})"
 * 
 *     if index >= shape:             # <<<<<<<<<<<<<<
 *         raise IndexError, f"Out of bounds on buffer access (axis {dim})"
 * 
*/
  }

  /* "View.MemoryView":825
 *         raise IndexError, f"Out of bounds on buffer access (axis {dim})"
 * 
 *     resultp = bufp + index * stride             # <<<<<<<<<<<<<<
 *     if suboffset >= 0:
 *         resultp = (<char **> resultp)[0] + suboffset
*/
  __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));

  /* "View.MemoryView":826
 * 
 *     resultp = bufp + index * stride
 *     if suboffset >= 0:             # <<<<<<<<<<<<<<
 *         resultp = (<char **> resultp)[0] + suboffset
 * 
*/
  __pyx_t_2 = (__pyx_v_suboffset >= 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":827
 *     resultp = bufp + index * stride
 *     if suboffset >= 0:
 *         resultp = (<char **> resultp)[0] + suboffset             # <<<<<<<<<<<<<<
 * 
 *     return resultp
*/
    __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);

    /* "View.MemoryView":826
 * 
 *     resultp = bufp + index * stride
 *     if suboffset >= 0:             # <<<<<<<<<<<<<<
 *         resultp = (<char **> resultp)[0] + suboffset
 * 
*/
  }

  /* "View.MemoryView":829
 *         resultp = (<char **> resultp)[0] + suboffset
 * 
 *     return resultp             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = __pyx_v_resultp;
  goto __pyx_L0;

  /* "View.MemoryView":801
 * 
 * 
 * @cname('__pyx_pybuffer_index')             # <<<<<<<<<<<<<<
 * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
 *                           Py_ssize_t dim) except NULL:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":834
 * 
 * 
 * @cname('__pyx_memslice_transpose')             # <<<<<<<<<<<<<<
 * cdef int transpose_memslice(__Pyx_memviewslice *memslice) except -1 nogil:
 *     cdef int ndim = memslice.memview.view.ndim
*/

static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
  int __pyx_v_ndim;
  Py_ssize_t *__pyx_v_shape;
  Py_ssize_t *__pyx_v_strides;
  int __pyx_v_i;
  int __pyx_v_j;
  int __pyx_r;
  int __pyx_t_1;
  Py_ssize_t *__pyx_t_2;
  long __pyx_t_3;
  long __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save;

  /* "View.MemoryView":836
 * @cname('__pyx_memslice_transpose')
 * cdef int transpose_memslice(__Pyx_memviewslice *memslice) except -1 nogil:
 *     cdef int ndim = memslice.memview.view.ndim             # <<<<<<<<<<<<<<
 * 
 *     cdef Py_ssize_t *shape = memslice.shape
*/
  __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
  __pyx_v_ndim = __pyx_t_1;

  /* "View.MemoryView":838
 *     cdef int ndim = memslice.memview.view.ndim
 * 
 *     cdef Py_ssize_t *shape = memslice.shape             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t *strides = memslice.strides
 * 
*/
  __pyx_t_2 = __pyx_v_memslice->shape;
  __pyx_v_shape = __pyx_t_2;

  /* "View.MemoryView":839
 * 
 *     cdef Py_ssize_t *shape = memslice.shape
 *     cdef Py_ssize_t *strides = memslice.strides             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_2 = __pyx_v_memslice->strides;
  __pyx_v_strides = __pyx_t_2;

  /* "View.MemoryView":843
 * 
 *     cdef int i, j
 *     for i in range(ndim // 2):             # <<<<<<<<<<<<<<
 *         j = ndim - 1 - i
 *         strides[i], strides[j] = strides[j], strides[i]
*/
  __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2, 1);
  __pyx_t_4 = __pyx_t_3;
  for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
    __pyx_v_i = __pyx_t_1;

    /* "View.MemoryView":844
 *     cdef int i, j
 *     for i in range(ndim // 2):
 *         j = ndim - 1 - i             # <<<<<<<<<<<<<<
 *         strides[i], strides[j] = strides[j], strides[i]
 *         shape[i], shape[j] = shape[j], shape[i]
*/
    __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);

    /* "View.MemoryView":845
 *     for i in range(ndim // 2):
 *         j = ndim - 1 - i
 *         strides[i], strides[j] = strides[j], strides[i]             # <<<<<<<<<<<<<<
 *         shape[i], shape[j] = shape[j], shape[i]
 * 
*/
    __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
    __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
    (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
    (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;

    /* "View.MemoryView":846
 *         j = ndim - 1 - i
 *         strides[i], strides[j] = strides[j], strides[i]
 *         shape[i], shape[j] = shape[j], shape[i]             # <<<<<<<<<<<<<<
 * 
 *         if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
*/
    __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
    __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
    (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
    (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;

    /* "View.MemoryView":848
 *         shape[i], shape[j] = shape[j], shape[i]
 * 
 *         if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:             # <<<<<<<<<<<<<<
 *             _err(PyExc_ValueError, "Cannot transpose memoryview with indirect dimensions")
 * 
*/
    __pyx_t_8 = ((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0);
    if (!__pyx_t_8) {
    } else {
      __pyx_t_7 = __pyx_t_8;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_8 = ((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0);
    __pyx_t_7 = __pyx_t_8;
    __pyx_L6_bool_binop_done:;
    if (__pyx_t_7) {

      /* "View.MemoryView":849
 * 
 *         if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
 *             _err(PyExc_ValueError, "Cannot transpose memoryview with indirect dimensions")             # <<<<<<<<<<<<<<
 * 
 *     return 0
*/
      __pyx_t_9 = __pyx_memoryview_err(PyExc_ValueError, __pyx_mstate_global->__pyx_kp_u_Cannot_transpose_memoryview_with); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(7, 849, __pyx_L1_error)

      /* "View.MemoryView":848
 *         shape[i], shape[j] = shape[j], shape[i]
 * 
 *         if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:             # <<<<<<<<<<<<<<
 *             _err(PyExc_ValueError, "Cannot transpose memoryview with indirect dimensions")
 * 
*/
    }
  }

  /* "View.MemoryView":851
 *             _err(PyExc_ValueError, "Cannot transpose memoryview with indirect dimensions")
 * 
 *     return 0             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = 0;
  goto __pyx_L0;

  /* "View.MemoryView":834
 * 
 * 
 * @cname('__pyx_memslice_transpose')             # <<<<<<<<<<<<<<
 * cdef int transpose_memslice(__Pyx_memviewslice *memslice) except -1 nogil:
 *     cdef int ndim = memslice.memview.view.ndim
*/

  /* function exit code */
  __pyx_L1_error:;
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  __pyx_L0:;
  return __pyx_r;
}

/* "View.MemoryView":869
 *     cdef int (*to_dtype_func)(char *, object) except 0
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1)
 * 
*/

/* Python wrapper */
static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));

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

static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {

  /* "View.MemoryView":870
 * 
 *     def __dealloc__(self):
 *         __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1)             # <<<<<<<<<<<<<<
 * 
 *     cdef convert_item_to_object(self, char *itemp):
*/
  __PYX_XCLEAR_MEMVIEW((&__pyx_v_self->from_slice), 1);

  /* "View.MemoryView":869
 *     cdef int (*to_dtype_func)(char *, object) except 0
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1)
 * 
*/

  /* function exit code */
}

/* "View.MemoryView":872
 *         __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1)
 * 
 *     cdef convert_item_to_object(self, char *itemp):             # <<<<<<<<<<<<<<
 *         if self.to_object_func != NULL:
 *             return self.to_object_func(itemp)
*/

static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("convert_item_to_object", 0);

  /* "View.MemoryView":873
 * 
 *     cdef convert_item_to_object(self, char *itemp):
 *         if self.to_object_func != NULL:             # <<<<<<<<<<<<<<
 *             return self.to_object_func(itemp)
 *         else:
*/
  __pyx_t_1 = (__pyx_v_self->to_object_func != NULL);
  if (__pyx_t_1) {

    /* "View.MemoryView":874
 *     cdef convert_item_to_object(self, char *itemp):
 *         if self.to_object_func != NULL:
 *             return self.to_object_func(itemp)             # <<<<<<<<<<<<<<
 *         else:
 *             return memoryview.convert_item_to_object(self, itemp)
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 874, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "View.MemoryView":873
 * 
 *     cdef convert_item_to_object(self, char *itemp):
 *         if self.to_object_func != NULL:             # <<<<<<<<<<<<<<
 *             return self.to_object_func(itemp)
 *         else:
*/
  }

  /* "View.MemoryView":876
 *             return self.to_object_func(itemp)
 *         else:
 *             return memoryview.convert_item_to_object(self, itemp)             # <<<<<<<<<<<<<<
 * 
 *     cdef assign_item_from_object(self, char *itemp, object value):
*/
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 876, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }

  /* "View.MemoryView":872
 *         __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1)
 * 
 *     cdef convert_item_to_object(self, char *itemp):             # <<<<<<<<<<<<<<
 *         if self.to_object_func != NULL:
 *             return self.to_object_func(itemp)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":878
 *             return memoryview.convert_item_to_object(self, itemp)
 * 
 *     cdef assign_item_from_object(self, char *itemp, object value):             # <<<<<<<<<<<<<<
 *         if self.to_dtype_func != NULL:
 *             self.to_dtype_func(itemp, value)
*/

static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("assign_item_from_object", 0);

  /* "View.MemoryView":879
 * 
 *     cdef assign_item_from_object(self, char *itemp, object value):
 *         if self.to_dtype_func != NULL:             # <<<<<<<<<<<<<<
 *             self.to_dtype_func(itemp, value)
 *         else:
*/
  __pyx_t_1 = (__pyx_v_self->to_dtype_func != NULL);
  if (__pyx_t_1) {

    /* "View.MemoryView":880
 *     cdef assign_item_from_object(self, char *itemp, object value):
 *         if self.to_dtype_func != NULL:
 *             self.to_dtype_func(itemp, value)             # <<<<<<<<<<<<<<
 *         else:
 *             memoryview.assign_item_from_object(self, itemp, value)
*/
    __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(7, 880, __pyx_L1_error)

    /* "View.MemoryView":879
 * 
 *     cdef assign_item_from_object(self, char *itemp, object value):
 *         if self.to_dtype_func != NULL:             # <<<<<<<<<<<<<<
 *             self.to_dtype_func(itemp, value)
 *         else:
*/
    goto __pyx_L3;
  }

  /* "View.MemoryView":882
 *             self.to_dtype_func(itemp, value)
 *         else:
 *             memoryview.assign_item_from_object(self, itemp, value)             # <<<<<<<<<<<<<<
 * 
 *     cdef _get_base(self):
*/
  /*else*/ {
    __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 882, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_L3:;

  /* "View.MemoryView":878
 *             return memoryview.convert_item_to_object(self, itemp)
 * 
 *     cdef assign_item_from_object(self, char *itemp, object value):             # <<<<<<<<<<<<<<
 *         if self.to_dtype_func != NULL:
 *             self.to_dtype_func(itemp, value)
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":884
 *             memoryview.assign_item_from_object(self, itemp, value)
 * 
 *     cdef _get_base(self):             # <<<<<<<<<<<<<<
 *         return self.from_object
 * 
*/

static PyObject *__pyx_memoryviewslice__get_base(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_base", 0);

  /* "View.MemoryView":885
 * 
 *     cdef _get_base(self):
 *         return self.from_object             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->from_object);
  __pyx_r = __pyx_v_self->from_object;
  goto __pyx_L0;

  /* "View.MemoryView":884
 *             memoryview.assign_item_from_object(self, itemp, value)
 * 
 *     cdef _get_base(self):             # <<<<<<<<<<<<<<
 *         return self.from_object
 * 
*/

  /* 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___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));

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

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

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

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__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___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(7, 3, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(7, 3, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(7, 3, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(7, 3, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(7, 3, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(7, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self), __pyx_v___pyx_state);

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

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

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

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

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

/* "View.MemoryView":904
 *     pass  # ignore failure, it's a minor issue
 * 
 * @cname('__pyx_memoryview_fromslice')             # <<<<<<<<<<<<<<
 * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice,
 *                           int ndim,
*/

static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice, int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(char *), int (*__pyx_v_to_dtype_func)(char *, PyObject *), int __pyx_v_dtype_is_object) {
  struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
  Py_ssize_t __pyx_v_suboffset;
  PyObject *__pyx_v_length = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_TypeInfo const *__pyx_t_4;
  Py_buffer __pyx_t_5;
  Py_ssize_t *__pyx_t_6;
  Py_ssize_t *__pyx_t_7;
  Py_ssize_t *__pyx_t_8;
  Py_ssize_t __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("memoryview_fromslice", 0);

  /* "View.MemoryView":913
 *     cdef _memoryviewslice result
 * 
 *     if <PyObject *> memviewslice.memview == Py_None:             # <<<<<<<<<<<<<<
 *         return None
 * 
*/
  __pyx_t_1 = (((PyObject *)__pyx_v_memviewslice.memview) == Py_None);
  if (__pyx_t_1) {

    /* "View.MemoryView":914
 * 
 *     if <PyObject *> memviewslice.memview == Py_None:
 *         return None             # <<<<<<<<<<<<<<
 * 
 * 
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "View.MemoryView":913
 *     cdef _memoryviewslice result
 * 
 *     if <PyObject *> memviewslice.memview == Py_None:             # <<<<<<<<<<<<<<
 *         return None
 * 
*/
  }

  /* "View.MemoryView":919
 * 
 * 
 *     result = _memoryviewslice.__new__(_memoryviewslice, None, 0, dtype_is_object)             # <<<<<<<<<<<<<<
 * 
 *     result.from_slice = memviewslice
*/
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 919, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 919, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None) != (0)) __PYX_ERR(7, 919, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_0);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(7, 919, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2) != (0)) __PYX_ERR(7, 919, __pyx_L1_error);
  __pyx_t_2 = 0;
  __pyx_t_2 = ((PyObject *)__pyx_tp_new__memoryviewslice(((PyTypeObject *)__pyx_mstate_global->__pyx_memoryviewslice_type), __pyx_t_3, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 919, __pyx_L1_error)
  __Pyx_GOTREF((PyObject *)__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "View.MemoryView":921
 *     result = _memoryviewslice.__new__(_memoryviewslice, None, 0, dtype_is_object)
 * 
 *     result.from_slice = memviewslice             # <<<<<<<<<<<<<<
 *     __PYX_INC_MEMVIEW(&memviewslice, 1)
 * 
*/
  __pyx_v_result->from_slice = __pyx_v_memviewslice;

  /* "View.MemoryView":922
 * 
 *     result.from_slice = memviewslice
 *     __PYX_INC_MEMVIEW(&memviewslice, 1)             # <<<<<<<<<<<<<<
 * 
 *     result.from_object = (<memoryview> memviewslice.memview)._get_base()
*/
  __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);

  /* "View.MemoryView":924
 *     __PYX_INC_MEMVIEW(&memviewslice, 1)
 * 
 *     result.from_object = (<memoryview> memviewslice.memview)._get_base()             # <<<<<<<<<<<<<<
 *     result.typeinfo = memviewslice.memview.typeinfo
 * 
*/
  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->__pyx_vtab)->_get_base(((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 924, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_result->from_object);
  __Pyx_DECREF(__pyx_v_result->from_object);
  __pyx_v_result->from_object = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "View.MemoryView":925
 * 
 *     result.from_object = (<memoryview> memviewslice.memview)._get_base()
 *     result.typeinfo = memviewslice.memview.typeinfo             # <<<<<<<<<<<<<<
 * 
 *     result.view = memviewslice.memview.view
*/
  __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
  __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;

  /* "View.MemoryView":927
 *     result.typeinfo = memviewslice.memview.typeinfo
 * 
 *     result.view = memviewslice.memview.view             # <<<<<<<<<<<<<<
 *     result.view.buf = <void *> memviewslice.data
 *     result.view.ndim = ndim
*/
  __pyx_t_5 = __pyx_v_memviewslice.memview->view;
  __pyx_v_result->__pyx_base.view = __pyx_t_5;

  /* "View.MemoryView":928
 * 
 *     result.view = memviewslice.memview.view
 *     result.view.buf = <void *> memviewslice.data             # <<<<<<<<<<<<<<
 *     result.view.ndim = ndim
 *     (<__pyx_buffer *> &result.view).obj = Py_None
*/
  __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data);

  /* "View.MemoryView":929
 *     result.view = memviewslice.memview.view
 *     result.view.buf = <void *> memviewslice.data
 *     result.view.ndim = ndim             # <<<<<<<<<<<<<<
 *     (<__pyx_buffer *> &result.view).obj = Py_None
 *     Py_INCREF(Py_None)
*/
  __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;

  /* "View.MemoryView":930
 *     result.view.buf = <void *> memviewslice.data
 *     result.view.ndim = ndim
 *     (<__pyx_buffer *> &result.view).obj = Py_None             # <<<<<<<<<<<<<<
 *     Py_INCREF(Py_None)
 * 
*/
  ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;

  /* "View.MemoryView":931
 *     result.view.ndim = ndim
 *     (<__pyx_buffer *> &result.view).obj = Py_None
 *     Py_INCREF(Py_None)             # <<<<<<<<<<<<<<
 * 
 *     if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
*/
  Py_INCREF(Py_None);

  /* "View.MemoryView":933
 *     Py_INCREF(Py_None)
 * 
 *     if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:             # <<<<<<<<<<<<<<
 *         result.flags = PyBUF_RECORDS
 *     else:
*/
  __pyx_t_1 = ((((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":934
 * 
 *     if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
 *         result.flags = PyBUF_RECORDS             # <<<<<<<<<<<<<<
 *     else:
 *         result.flags = PyBUF_RECORDS_RO
*/
    __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;

    /* "View.MemoryView":933
 *     Py_INCREF(Py_None)
 * 
 *     if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:             # <<<<<<<<<<<<<<
 *         result.flags = PyBUF_RECORDS
 *     else:
*/
    goto __pyx_L4;
  }

  /* "View.MemoryView":936
 *         result.flags = PyBUF_RECORDS
 *     else:
 *         result.flags = PyBUF_RECORDS_RO             # <<<<<<<<<<<<<<
 * 
 *     result.view.shape = <Py_ssize_t *> result.from_slice.shape
*/
  /*else*/ {
    __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
  }
  __pyx_L4:;

  /* "View.MemoryView":938
 *         result.flags = PyBUF_RECORDS_RO
 * 
 *     result.view.shape = <Py_ssize_t *> result.from_slice.shape             # <<<<<<<<<<<<<<
 *     result.view.strides = <Py_ssize_t *> result.from_slice.strides
 * 
*/
  __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);

  /* "View.MemoryView":939
 * 
 *     result.view.shape = <Py_ssize_t *> result.from_slice.shape
 *     result.view.strides = <Py_ssize_t *> result.from_slice.strides             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);

  /* "View.MemoryView":942
 * 
 * 
 *     result.view.suboffsets = NULL             # <<<<<<<<<<<<<<
 *     for suboffset in result.from_slice.suboffsets[:ndim]:
 *         if suboffset >= 0:
*/
  __pyx_v_result->__pyx_base.view.suboffsets = NULL;

  /* "View.MemoryView":943
 * 
 *     result.view.suboffsets = NULL
 *     for suboffset in result.from_slice.suboffsets[:ndim]:             # <<<<<<<<<<<<<<
 *         if suboffset >= 0:
 *             result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
*/
  __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
  for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
    __pyx_t_6 = __pyx_t_8;
    __pyx_v_suboffset = (__pyx_t_6[0]);

    /* "View.MemoryView":944
 *     result.view.suboffsets = NULL
 *     for suboffset in result.from_slice.suboffsets[:ndim]:
 *         if suboffset >= 0:             # <<<<<<<<<<<<<<
 *             result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
 *             break
*/
    __pyx_t_1 = (__pyx_v_suboffset >= 0);
    if (__pyx_t_1) {

      /* "View.MemoryView":945
 *     for suboffset in result.from_slice.suboffsets[:ndim]:
 *         if suboffset >= 0:
 *             result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets             # <<<<<<<<<<<<<<
 *             break
 * 
*/
      __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);

      /* "View.MemoryView":946
 *         if suboffset >= 0:
 *             result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
 *             break             # <<<<<<<<<<<<<<
 * 
 *     result.view.len = result.view.itemsize
*/
      goto __pyx_L6_break;

      /* "View.MemoryView":944
 *     result.view.suboffsets = NULL
 *     for suboffset in result.from_slice.suboffsets[:ndim]:
 *         if suboffset >= 0:             # <<<<<<<<<<<<<<
 *             result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
 *             break
*/
    }
  }
  __pyx_L6_break:;

  /* "View.MemoryView":948
 *             break
 * 
 *     result.view.len = result.view.itemsize             # <<<<<<<<<<<<<<
 *     for length in result.view.shape[:ndim]:
 *         result.view.len *= length
*/
  __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
  __pyx_v_result->__pyx_base.view.len = __pyx_t_9;

  /* "View.MemoryView":949
 * 
 *     result.view.len = result.view.itemsize
 *     for length in result.view.shape[:ndim]:             # <<<<<<<<<<<<<<
 *         result.view.len *= length
 * 
*/
  __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
  for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
    __pyx_t_6 = __pyx_t_8;
    __pyx_t_2 = PyLong_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 949, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "View.MemoryView":950
 *     result.view.len = result.view.itemsize
 *     for length in result.view.shape[:ndim]:
 *         result.view.len *= length             # <<<<<<<<<<<<<<
 * 
 *     result.to_object_func = to_object_func
*/
    __pyx_t_2 = PyLong_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 950, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 950, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(7, 950, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
  }

  /* "View.MemoryView":952
 *         result.view.len *= length
 * 
 *     result.to_object_func = to_object_func             # <<<<<<<<<<<<<<
 *     result.to_dtype_func = to_dtype_func
 * 
*/
  __pyx_v_result->to_object_func = __pyx_v_to_object_func;

  /* "View.MemoryView":953
 * 
 *     result.to_object_func = to_object_func
 *     result.to_dtype_func = to_dtype_func             # <<<<<<<<<<<<<<
 * 
 *     return result
*/
  __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;

  /* "View.MemoryView":955
 *     result.to_dtype_func = to_dtype_func
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_get_slice_from_memoryview')
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_result);
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "View.MemoryView":904
 *     pass  # ignore failure, it's a minor issue
 * 
 * @cname('__pyx_memoryview_fromslice')             # <<<<<<<<<<<<<<
 * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice,
 *                           int ndim,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_length);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":957
 *     return result
 * 
 * @cname('__pyx_memoryview_get_slice_from_memoryview')             # <<<<<<<<<<<<<<
 * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview,
 *                                                    __Pyx_memviewslice *mslice) except NULL:
*/

static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
  struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
  __Pyx_memviewslice *__pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_slice_from_memview", 0);

  /* "View.MemoryView":961
 *                                                    __Pyx_memviewslice *mslice) except NULL:
 *     cdef _memoryviewslice obj
 *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
 *         obj = memview
 *         return &obj.from_slice
*/
  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_mstate_global->__pyx_memoryviewslice_type); 
  if (__pyx_t_1) {

    /* "View.MemoryView":962
 *     cdef _memoryviewslice obj
 *     if isinstance(memview, _memoryviewslice):
 *         obj = memview             # <<<<<<<<<<<<<<
 *         return &obj.from_slice
 *     else:
*/
    __pyx_t_2 = ((PyObject *)__pyx_v_memview);
    __Pyx_INCREF(__pyx_t_2);
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_memoryviewslice_type))))) __PYX_ERR(7, 962, __pyx_L1_error)
    __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "View.MemoryView":963
 *     if isinstance(memview, _memoryviewslice):
 *         obj = memview
 *         return &obj.from_slice             # <<<<<<<<<<<<<<
 *     else:
 *         slice_copy(memview, mslice)
*/
    __pyx_r = (&__pyx_v_obj->from_slice);
    goto __pyx_L0;

    /* "View.MemoryView":961
 *                                                    __Pyx_memviewslice *mslice) except NULL:
 *     cdef _memoryviewslice obj
 *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
 *         obj = memview
 *         return &obj.from_slice
*/
  }

  /* "View.MemoryView":965
 *         return &obj.from_slice
 *     else:
 *         slice_copy(memview, mslice)             # <<<<<<<<<<<<<<
 *         return mslice
 * 
*/
  /*else*/ {
    __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);

    /* "View.MemoryView":966
 *     else:
 *         slice_copy(memview, mslice)
 *         return mslice             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_slice_copy')
*/
    __pyx_r = __pyx_v_mslice;
    goto __pyx_L0;
  }

  /* "View.MemoryView":957
 *     return result
 * 
 * @cname('__pyx_memoryview_get_slice_from_memoryview')             # <<<<<<<<<<<<<<
 * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview,
 *                                                    __Pyx_memviewslice *mslice) except NULL:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_obj);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":968
 *         return mslice
 * 
 * @cname('__pyx_memoryview_slice_copy')             # <<<<<<<<<<<<<<
 * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst) noexcept:
 *     cdef int dim
*/

static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
  int __pyx_v_dim;
  Py_ssize_t *__pyx_v_shape;
  Py_ssize_t *__pyx_v_strides;
  Py_ssize_t *__pyx_v_suboffsets;
  Py_ssize_t *__pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  int __pyx_t_6;

  /* "View.MemoryView":973
 *     cdef (Py_ssize_t*) shape, strides, suboffsets
 * 
 *     shape = memview.view.shape             # <<<<<<<<<<<<<<
 *     strides = memview.view.strides
 *     suboffsets = memview.view.suboffsets
*/
  __pyx_t_1 = __pyx_v_memview->view.shape;
  __pyx_v_shape = __pyx_t_1;

  /* "View.MemoryView":974
 * 
 *     shape = memview.view.shape
 *     strides = memview.view.strides             # <<<<<<<<<<<<<<
 *     suboffsets = memview.view.suboffsets
 * 
*/
  __pyx_t_1 = __pyx_v_memview->view.strides;
  __pyx_v_strides = __pyx_t_1;

  /* "View.MemoryView":975
 *     shape = memview.view.shape
 *     strides = memview.view.strides
 *     suboffsets = memview.view.suboffsets             # <<<<<<<<<<<<<<
 * 
 *     dst.memview = <__pyx_memoryview *> memview
*/
  __pyx_t_1 = __pyx_v_memview->view.suboffsets;
  __pyx_v_suboffsets = __pyx_t_1;

  /* "View.MemoryView":977
 *     suboffsets = memview.view.suboffsets
 * 
 *     dst.memview = <__pyx_memoryview *> memview             # <<<<<<<<<<<<<<
 *     dst.data = <char *> memview.view.buf
 * 
*/
  __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview);

  /* "View.MemoryView":978
 * 
 *     dst.memview = <__pyx_memoryview *> memview
 *     dst.data = <char *> memview.view.buf             # <<<<<<<<<<<<<<
 * 
 *     for dim in range(memview.view.ndim):
*/
  __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf);

  /* "View.MemoryView":980
 *     dst.data = <char *> memview.view.buf
 * 
 *     for dim in range(memview.view.ndim):             # <<<<<<<<<<<<<<
 *         dst.shape[dim] = shape[dim]
 *         dst.strides[dim] = strides[dim]
*/
  __pyx_t_2 = __pyx_v_memview->view.ndim;
  __pyx_t_3 = __pyx_t_2;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_dim = __pyx_t_4;

    /* "View.MemoryView":981
 * 
 *     for dim in range(memview.view.ndim):
 *         dst.shape[dim] = shape[dim]             # <<<<<<<<<<<<<<
 *         dst.strides[dim] = strides[dim]
 *         dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
*/
    (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);

    /* "View.MemoryView":982
 *     for dim in range(memview.view.ndim):
 *         dst.shape[dim] = shape[dim]
 *         dst.strides[dim] = strides[dim]             # <<<<<<<<<<<<<<
 *         dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
 * 
*/
    (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);

    /* "View.MemoryView":983
 *         dst.shape[dim] = shape[dim]
 *         dst.strides[dim] = strides[dim]
 *         dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_copy_object')
*/
    __pyx_t_6 = (__pyx_v_suboffsets != 0);
    if (__pyx_t_6) {
      __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
    } else {
      __pyx_t_5 = -1L;
    }
    (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
  }

  /* "View.MemoryView":968
 *         return mslice
 * 
 * @cname('__pyx_memoryview_slice_copy')             # <<<<<<<<<<<<<<
 * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst) noexcept:
 *     cdef int dim
*/

  /* function exit code */
}

/* "View.MemoryView":985
 *         dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
 * 
 * @cname('__pyx_memoryview_copy_object')             # <<<<<<<<<<<<<<
 * cdef memoryview_copy(memoryview memview):
 *     "Create a new memoryview object"
*/

static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx_v_memview) {
  __Pyx_memviewslice __pyx_v_memviewslice;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("memoryview_copy", 0);

  /* "View.MemoryView":989
 *     "Create a new memoryview object"
 *     cdef __Pyx_memviewslice memviewslice
 *     slice_copy(memview, &memviewslice)             # <<<<<<<<<<<<<<
 *     return memoryview_copy_from_slice(memview, &memviewslice)
 * 
*/
  __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));

  /* "View.MemoryView":990
 *     cdef __Pyx_memviewslice memviewslice
 *     slice_copy(memview, &memviewslice)
 *     return memoryview_copy_from_slice(memview, &memviewslice)             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_copy_object_from_slice')
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 990, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":985
 *         dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
 * 
 * @cname('__pyx_memoryview_copy_object')             # <<<<<<<<<<<<<<
 * cdef memoryview_copy(memoryview memview):
 *     "Create a new memoryview object"
*/

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

/* "View.MemoryView":992
 *     return memoryview_copy_from_slice(memview, &memviewslice)
 * 
 * @cname('__pyx_memoryview_copy_object_from_slice')             # <<<<<<<<<<<<<<
 * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice):
 *     """
*/

static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
  PyObject *(*__pyx_v_to_object_func)(char *);
  int (*__pyx_v_to_dtype_func)(char *, PyObject *);
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *(*__pyx_t_2)(char *);
  int (*__pyx_t_3)(char *, PyObject *);
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 0);

  /* "View.MemoryView":1000
 *     cdef int (*to_dtype_func)(char *, object) except 0
 * 
 *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
 *         to_object_func = (<_memoryviewslice> memview).to_object_func
 *         to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
*/
  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_mstate_global->__pyx_memoryviewslice_type); 
  if (__pyx_t_1) {

    /* "View.MemoryView":1001
 * 
 *     if isinstance(memview, _memoryviewslice):
 *         to_object_func = (<_memoryviewslice> memview).to_object_func             # <<<<<<<<<<<<<<
 *         to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
 *     else:
*/
    __pyx_t_2 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
    __pyx_v_to_object_func = __pyx_t_2;

    /* "View.MemoryView":1002
 *     if isinstance(memview, _memoryviewslice):
 *         to_object_func = (<_memoryviewslice> memview).to_object_func
 *         to_dtype_func = (<_memoryviewslice> memview).to_dtype_func             # <<<<<<<<<<<<<<
 *     else:
 *         to_object_func = NULL
*/
    __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
    __pyx_v_to_dtype_func = __pyx_t_3;

    /* "View.MemoryView":1000
 *     cdef int (*to_dtype_func)(char *, object) except 0
 * 
 *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
 *         to_object_func = (<_memoryviewslice> memview).to_object_func
 *         to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
*/
    goto __pyx_L3;
  }

  /* "View.MemoryView":1004
 *         to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
 *     else:
 *         to_object_func = NULL             # <<<<<<<<<<<<<<
 *         to_dtype_func = NULL
 * 
*/
  /*else*/ {
    __pyx_v_to_object_func = NULL;

    /* "View.MemoryView":1005
 *     else:
 *         to_object_func = NULL
 *         to_dtype_func = NULL             # <<<<<<<<<<<<<<
 * 
 *     return memoryview_fromslice(memviewslice[0], memview.view.ndim,
*/
    __pyx_v_to_dtype_func = NULL;
  }
  __pyx_L3:;

  /* "View.MemoryView":1007
 *         to_dtype_func = NULL
 * 
 *     return memoryview_fromslice(memviewslice[0], memview.view.ndim,             # <<<<<<<<<<<<<<
 *                                 to_object_func, to_dtype_func,
 *                                 memview.dtype_is_object)
*/
  __Pyx_XDECREF(__pyx_r);

  /* "View.MemoryView":1009
 *     return memoryview_fromslice(memviewslice[0], memview.view.ndim,
 *                                 to_object_func, to_dtype_func,
 *                                 memview.dtype_is_object)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_4 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 1007, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":992
 *     return memoryview_copy_from_slice(memview, &memviewslice)
 * 
 * @cname('__pyx_memoryview_copy_object_from_slice')             # <<<<<<<<<<<<<<
 * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice):
 *     """
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":1015
 * 
 * 
 * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) noexcept nogil:             # <<<<<<<<<<<<<<
 *     return -arg if arg < 0 else arg
 * 
*/

static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
  Py_ssize_t __pyx_r;
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;

  /* "View.MemoryView":1016
 * 
 * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) noexcept nogil:
 *     return -arg if arg < 0 else arg             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_get_best_slice_order')
*/
  __pyx_t_2 = (__pyx_v_arg < 0);
  if (__pyx_t_2) {
    __pyx_t_1 = (-__pyx_v_arg);
  } else {
    __pyx_t_1 = __pyx_v_arg;
  }
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "View.MemoryView":1015
 * 
 * 
 * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) noexcept nogil:             # <<<<<<<<<<<<<<
 *     return -arg if arg < 0 else arg
 * 
*/

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

/* "View.MemoryView":1018
 *     return -arg if arg < 0 else arg
 * 
 * @cname('__pyx_get_best_slice_order')             # <<<<<<<<<<<<<<
 * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) noexcept nogil:
 *     """
*/

static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) {
  int __pyx_v_i;
  Py_ssize_t __pyx_v_c_stride;
  Py_ssize_t __pyx_v_f_stride;
  char __pyx_r;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;

  /* "View.MemoryView":1024
 *     """
 *     cdef int i
 *     cdef Py_ssize_t c_stride = 0             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t f_stride = 0
 * 
*/
  __pyx_v_c_stride = 0;

  /* "View.MemoryView":1025
 *     cdef int i
 *     cdef Py_ssize_t c_stride = 0
 *     cdef Py_ssize_t f_stride = 0             # <<<<<<<<<<<<<<
 * 
 *     for i in range(ndim - 1, -1, -1):
*/
  __pyx_v_f_stride = 0;

  /* "View.MemoryView":1027
 *     cdef Py_ssize_t f_stride = 0
 * 
 *     for i in range(ndim - 1, -1, -1):             # <<<<<<<<<<<<<<
 *         if mslice.shape[i] > 1:
 *             c_stride = mslice.strides[i]
*/
  for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
    __pyx_v_i = __pyx_t_1;

    /* "View.MemoryView":1028
 * 
 *     for i in range(ndim - 1, -1, -1):
 *         if mslice.shape[i] > 1:             # <<<<<<<<<<<<<<
 *             c_stride = mslice.strides[i]
 *             break
*/
    __pyx_t_2 = ((__pyx_v_mslice->shape[__pyx_v_i]) > 1);
    if (__pyx_t_2) {

      /* "View.MemoryView":1029
 *     for i in range(ndim - 1, -1, -1):
 *         if mslice.shape[i] > 1:
 *             c_stride = mslice.strides[i]             # <<<<<<<<<<<<<<
 *             break
 * 
*/
      __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);

      /* "View.MemoryView":1030
 *         if mslice.shape[i] > 1:
 *             c_stride = mslice.strides[i]
 *             break             # <<<<<<<<<<<<<<
 * 
 *     for i in range(ndim):
*/
      goto __pyx_L4_break;

      /* "View.MemoryView":1028
 * 
 *     for i in range(ndim - 1, -1, -1):
 *         if mslice.shape[i] > 1:             # <<<<<<<<<<<<<<
 *             c_stride = mslice.strides[i]
 *             break
*/
    }
  }
  __pyx_L4_break:;

  /* "View.MemoryView":1032
 *             break
 * 
 *     for i in range(ndim):             # <<<<<<<<<<<<<<
 *         if mslice.shape[i] > 1:
 *             f_stride = mslice.strides[i]
*/
  __pyx_t_1 = __pyx_v_ndim;
  __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;

    /* "View.MemoryView":1033
 * 
 *     for i in range(ndim):
 *         if mslice.shape[i] > 1:             # <<<<<<<<<<<<<<
 *             f_stride = mslice.strides[i]
 *             break
*/
    __pyx_t_2 = ((__pyx_v_mslice->shape[__pyx_v_i]) > 1);
    if (__pyx_t_2) {

      /* "View.MemoryView":1034
 *     for i in range(ndim):
 *         if mslice.shape[i] > 1:
 *             f_stride = mslice.strides[i]             # <<<<<<<<<<<<<<
 *             break
 * 
*/
      __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);

      /* "View.MemoryView":1035
 *         if mslice.shape[i] > 1:
 *             f_stride = mslice.strides[i]
 *             break             # <<<<<<<<<<<<<<
 * 
 *     if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
*/
      goto __pyx_L7_break;

      /* "View.MemoryView":1033
 * 
 *     for i in range(ndim):
 *         if mslice.shape[i] > 1:             # <<<<<<<<<<<<<<
 *             f_stride = mslice.strides[i]
 *             break
*/
    }
  }
  __pyx_L7_break:;

  /* "View.MemoryView":1037
 *             break
 * 
 *     if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):             # <<<<<<<<<<<<<<
 *         return 'C'
 *     else:
*/
  __pyx_t_2 = (abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride));
  if (__pyx_t_2) {

    /* "View.MemoryView":1038
 * 
 *     if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
 *         return 'C'             # <<<<<<<<<<<<<<
 *     else:
 *         return 'F'
*/
    __pyx_r = 'C';
    goto __pyx_L0;

    /* "View.MemoryView":1037
 *             break
 * 
 *     if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):             # <<<<<<<<<<<<<<
 *         return 'C'
 *     else:
*/
  }

  /* "View.MemoryView":1040
 *         return 'C'
 *     else:
 *         return 'F'             # <<<<<<<<<<<<<<
 * 
 * @cython.cdivision(True)
*/
  /*else*/ {
    __pyx_r = 'F';
    goto __pyx_L0;
  }

  /* "View.MemoryView":1018
 *     return -arg if arg < 0 else arg
 * 
 * @cname('__pyx_get_best_slice_order')             # <<<<<<<<<<<<<<
 * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) noexcept nogil:
 *     """
*/

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

/* "View.MemoryView":1042
 *         return 'F'
 * 
 * @cython.cdivision(True)             # <<<<<<<<<<<<<<
 * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides,
 *                                    char *dst_data, Py_ssize_t *dst_strides,
*/

static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides, char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
  CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
  Py_ssize_t __pyx_v_dst_extent;
  Py_ssize_t __pyx_v_src_stride;
  Py_ssize_t __pyx_v_dst_stride;
  int __pyx_t_1;
  int __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;

  /* "View.MemoryView":1050
 * 
 *     cdef Py_ssize_t i
 *     cdef Py_ssize_t src_extent = src_shape[0]             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t dst_extent = dst_shape[0]
 *     cdef Py_ssize_t src_stride = src_strides[0]
*/
  __pyx_v_src_extent = (__pyx_v_src_shape[0]);

  /* "View.MemoryView":1051
 *     cdef Py_ssize_t i
 *     cdef Py_ssize_t src_extent = src_shape[0]
 *     cdef Py_ssize_t dst_extent = dst_shape[0]             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t src_stride = src_strides[0]
 *     cdef Py_ssize_t dst_stride = dst_strides[0]
*/
  __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);

  /* "View.MemoryView":1052
 *     cdef Py_ssize_t src_extent = src_shape[0]
 *     cdef Py_ssize_t dst_extent = dst_shape[0]
 *     cdef Py_ssize_t src_stride = src_strides[0]             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t dst_stride = dst_strides[0]
 * 
*/
  __pyx_v_src_stride = (__pyx_v_src_strides[0]);

  /* "View.MemoryView":1053
 *     cdef Py_ssize_t dst_extent = dst_shape[0]
 *     cdef Py_ssize_t src_stride = src_strides[0]
 *     cdef Py_ssize_t dst_stride = dst_strides[0]             # <<<<<<<<<<<<<<
 * 
 *     if ndim == 1:
*/
  __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);

  /* "View.MemoryView":1055
 *     cdef Py_ssize_t dst_stride = dst_strides[0]
 * 
 *     if ndim == 1:             # <<<<<<<<<<<<<<
 *         if (src_stride > 0 and dst_stride > 0 and
 *                 <size_t> src_stride == itemsize == <size_t> dst_stride):
*/
  __pyx_t_1 = (__pyx_v_ndim == 1);
  if (__pyx_t_1) {

    /* "View.MemoryView":1056
 * 
 *     if ndim == 1:
 *         if (src_stride > 0 and dst_stride > 0 and             # <<<<<<<<<<<<<<
 *                 <size_t> src_stride == itemsize == <size_t> dst_stride):
 *             memcpy(dst_data, src_data, itemsize * dst_extent)
*/
    __pyx_t_2 = (__pyx_v_src_stride > 0);
    if (__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_t_2 = (__pyx_v_dst_stride > 0);
    if (__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L5_bool_binop_done;
    }

    /* "View.MemoryView":1057
 *     if ndim == 1:
 *         if (src_stride > 0 and dst_stride > 0 and
 *                 <size_t> src_stride == itemsize == <size_t> dst_stride):             # <<<<<<<<<<<<<<
 *             memcpy(dst_data, src_data, itemsize * dst_extent)
 *         else:
*/
    __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
    if (__pyx_t_2) {
      __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
    }
    __pyx_t_1 = __pyx_t_2;
    __pyx_L5_bool_binop_done:;

    /* "View.MemoryView":1056
 * 
 *     if ndim == 1:
 *         if (src_stride > 0 and dst_stride > 0 and             # <<<<<<<<<<<<<<
 *                 <size_t> src_stride == itemsize == <size_t> dst_stride):
 *             memcpy(dst_data, src_data, itemsize * dst_extent)
*/
    if (__pyx_t_1) {

      /* "View.MemoryView":1058
 *         if (src_stride > 0 and dst_stride > 0 and
 *                 <size_t> src_stride == itemsize == <size_t> dst_stride):
 *             memcpy(dst_data, src_data, itemsize * dst_extent)             # <<<<<<<<<<<<<<
 *         else:
 *             for i in range(dst_extent):
*/
      (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)));

      /* "View.MemoryView":1056
 * 
 *     if ndim == 1:
 *         if (src_stride > 0 and dst_stride > 0 and             # <<<<<<<<<<<<<<
 *                 <size_t> src_stride == itemsize == <size_t> dst_stride):
 *             memcpy(dst_data, src_data, itemsize * dst_extent)
*/
      goto __pyx_L4;
    }

    /* "View.MemoryView":1060
 *             memcpy(dst_data, src_data, itemsize * dst_extent)
 *         else:
 *             for i in range(dst_extent):             # <<<<<<<<<<<<<<
 *                 memcpy(dst_data, src_data, itemsize)
 *                 src_data += src_stride
*/
    /*else*/ {
      __pyx_t_3 = __pyx_v_dst_extent;
      __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;

        /* "View.MemoryView":1061
 *         else:
 *             for i in range(dst_extent):
 *                 memcpy(dst_data, src_data, itemsize)             # <<<<<<<<<<<<<<
 *                 src_data += src_stride
 *                 dst_data += dst_stride
*/
        (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));

        /* "View.MemoryView":1062
 *             for i in range(dst_extent):
 *                 memcpy(dst_data, src_data, itemsize)
 *                 src_data += src_stride             # <<<<<<<<<<<<<<
 *                 dst_data += dst_stride
 *     else:
*/
        __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);

        /* "View.MemoryView":1063
 *                 memcpy(dst_data, src_data, itemsize)
 *                 src_data += src_stride
 *                 dst_data += dst_stride             # <<<<<<<<<<<<<<
 *     else:
 *         for i in range(dst_extent):
*/
        __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
      }
    }
    __pyx_L4:;

    /* "View.MemoryView":1055
 *     cdef Py_ssize_t dst_stride = dst_strides[0]
 * 
 *     if ndim == 1:             # <<<<<<<<<<<<<<
 *         if (src_stride > 0 and dst_stride > 0 and
 *                 <size_t> src_stride == itemsize == <size_t> dst_stride):
*/
    goto __pyx_L3;
  }

  /* "View.MemoryView":1065
 *                 dst_data += dst_stride
 *     else:
 *         for i in range(dst_extent):             # <<<<<<<<<<<<<<
 *             _copy_strided_to_strided(src_data, src_strides + 1,
 *                                      dst_data, dst_strides + 1,
*/
  /*else*/ {
    __pyx_t_3 = __pyx_v_dst_extent;
    __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;

      /* "View.MemoryView":1066
 *     else:
 *         for i in range(dst_extent):
 *             _copy_strided_to_strided(src_data, src_strides + 1,             # <<<<<<<<<<<<<<
 *                                      dst_data, dst_strides + 1,
 *                                      src_shape + 1, dst_shape + 1,
*/
      _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize);

      /* "View.MemoryView":1070
 *                                      src_shape + 1, dst_shape + 1,
 *                                      ndim - 1, itemsize)
 *             src_data += src_stride             # <<<<<<<<<<<<<<
 *             dst_data += dst_stride
 * 
*/
      __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);

      /* "View.MemoryView":1071
 *                                      ndim - 1, itemsize)
 *             src_data += src_stride
 *             dst_data += dst_stride             # <<<<<<<<<<<<<<
 * 
 * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,
*/
      __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
    }
  }
  __pyx_L3:;

  /* "View.MemoryView":1042
 *         return 'F'
 * 
 * @cython.cdivision(True)             # <<<<<<<<<<<<<<
 * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides,
 *                                    char *dst_data, Py_ssize_t *dst_strides,
*/

  /* function exit code */
}

/* "View.MemoryView":1073
 *             dst_data += dst_stride
 * 
 * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,             # <<<<<<<<<<<<<<
 *                                   __Pyx_memviewslice *dst,
 *                                   int ndim, size_t itemsize) noexcept nogil:
*/

static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize) {

  /* "View.MemoryView":1076
 *                                   __Pyx_memviewslice *dst,
 *                                   int ndim, size_t itemsize) noexcept nogil:
 *     _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides,             # <<<<<<<<<<<<<<
 *                              src.shape, dst.shape, ndim, itemsize)
 * 
*/
  _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize);

  /* "View.MemoryView":1073
 *             dst_data += dst_stride
 * 
 * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,             # <<<<<<<<<<<<<<
 *                                   __Pyx_memviewslice *dst,
 *                                   int ndim, size_t itemsize) noexcept nogil:
*/

  /* function exit code */
}

/* "View.MemoryView":1079
 *                              src.shape, dst.shape, ndim, itemsize)
 * 
 * @cname('__pyx_memoryview_slice_get_size')             # <<<<<<<<<<<<<<
 * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) noexcept nogil:
 *     "Return the size of the memory occupied by the slice in number of bytes"
*/

static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) {
  Py_ssize_t __pyx_v_shape;
  Py_ssize_t __pyx_v_size;
  Py_ssize_t __pyx_r;
  Py_ssize_t __pyx_t_1;
  Py_ssize_t *__pyx_t_2;
  Py_ssize_t *__pyx_t_3;
  Py_ssize_t *__pyx_t_4;

  /* "View.MemoryView":1082
 * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) noexcept nogil:
 *     "Return the size of the memory occupied by the slice in number of bytes"
 *     cdef Py_ssize_t shape, size = src.memview.view.itemsize             # <<<<<<<<<<<<<<
 * 
 *     for shape in src.shape[:ndim]:
*/
  __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
  __pyx_v_size = __pyx_t_1;

  /* "View.MemoryView":1084
 *     cdef Py_ssize_t shape, size = src.memview.view.itemsize
 * 
 *     for shape in src.shape[:ndim]:             # <<<<<<<<<<<<<<
 *         size *= shape
 * 
*/
  __pyx_t_3 = (__pyx_v_src->shape + __pyx_v_ndim);
  for (__pyx_t_4 = __pyx_v_src->shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
    __pyx_t_2 = __pyx_t_4;
    __pyx_v_shape = (__pyx_t_2[0]);

    /* "View.MemoryView":1085
 * 
 *     for shape in src.shape[:ndim]:
 *         size *= shape             # <<<<<<<<<<<<<<
 * 
 *     return size
*/
    __pyx_v_size = (__pyx_v_size * __pyx_v_shape);
  }

  /* "View.MemoryView":1087
 *         size *= shape
 * 
 *     return size             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_fill_contig_strides_array')
*/
  __pyx_r = __pyx_v_size;
  goto __pyx_L0;

  /* "View.MemoryView":1079
 *                              src.shape, dst.shape, ndim, itemsize)
 * 
 * @cname('__pyx_memoryview_slice_get_size')             # <<<<<<<<<<<<<<
 * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) noexcept nogil:
 *     "Return the size of the memory occupied by the slice in number of bytes"
*/

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

/* "View.MemoryView":1089
 *     return size
 * 
 * @cname('__pyx_fill_contig_strides_array')             # <<<<<<<<<<<<<<
 * cdef Py_ssize_t fill_contig_strides_array(
 *                 Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
*/

static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride, int __pyx_v_ndim, char __pyx_v_order) {
  int __pyx_v_idx;
  Py_ssize_t __pyx_r;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;

  /* "View.MemoryView":1099
 *     cdef int idx
 * 
 *     if order == 'F':             # <<<<<<<<<<<<<<
 *         for idx in range(ndim):
 *             strides[idx] = stride
*/
  __pyx_t_1 = (__pyx_v_order == 'F');
  if (__pyx_t_1) {

    /* "View.MemoryView":1100
 * 
 *     if order == 'F':
 *         for idx in range(ndim):             # <<<<<<<<<<<<<<
 *             strides[idx] = stride
 *             stride *= shape[idx]
*/
    __pyx_t_2 = __pyx_v_ndim;
    __pyx_t_3 = __pyx_t_2;
    for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
      __pyx_v_idx = __pyx_t_4;

      /* "View.MemoryView":1101
 *     if order == 'F':
 *         for idx in range(ndim):
 *             strides[idx] = stride             # <<<<<<<<<<<<<<
 *             stride *= shape[idx]
 *     else:
*/
      (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;

      /* "View.MemoryView":1102
 *         for idx in range(ndim):
 *             strides[idx] = stride
 *             stride *= shape[idx]             # <<<<<<<<<<<<<<
 *     else:
 *         for idx in range(ndim - 1, -1, -1):
*/
      __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
    }

    /* "View.MemoryView":1099
 *     cdef int idx
 * 
 *     if order == 'F':             # <<<<<<<<<<<<<<
 *         for idx in range(ndim):
 *             strides[idx] = stride
*/
    goto __pyx_L3;
  }

  /* "View.MemoryView":1104
 *             stride *= shape[idx]
 *     else:
 *         for idx in range(ndim - 1, -1, -1):             # <<<<<<<<<<<<<<
 *             strides[idx] = stride
 *             stride *= shape[idx]
*/
  /*else*/ {
    for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
      __pyx_v_idx = __pyx_t_2;

      /* "View.MemoryView":1105
 *     else:
 *         for idx in range(ndim - 1, -1, -1):
 *             strides[idx] = stride             # <<<<<<<<<<<<<<
 *             stride *= shape[idx]
 * 
*/
      (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;

      /* "View.MemoryView":1106
 *         for idx in range(ndim - 1, -1, -1):
 *             strides[idx] = stride
 *             stride *= shape[idx]             # <<<<<<<<<<<<<<
 * 
 *     return stride
*/
      __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
    }
  }
  __pyx_L3:;

  /* "View.MemoryView":1108
 *             stride *= shape[idx]
 * 
 *     return stride             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_copy_data_to_temp')
*/
  __pyx_r = __pyx_v_stride;
  goto __pyx_L0;

  /* "View.MemoryView":1089
 *     return size
 * 
 * @cname('__pyx_fill_contig_strides_array')             # <<<<<<<<<<<<<<
 * cdef Py_ssize_t fill_contig_strides_array(
 *                 Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
*/

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

/* "View.MemoryView":1110
 *     return stride
 * 
 * @cname('__pyx_memoryview_copy_data_to_temp')             # <<<<<<<<<<<<<<
 * cdef void *copy_data_to_temp(__Pyx_memviewslice *src,
 *                              __Pyx_memviewslice *tmpslice,
*/

static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_tmpslice, char __pyx_v_order, int __pyx_v_ndim) {
  int __pyx_v_i;
  void *__pyx_v_result;
  size_t __pyx_v_itemsize;
  size_t __pyx_v_size;
  void *__pyx_r;
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  struct __pyx_memoryview_obj *__pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save;

  /* "View.MemoryView":1122
 *     cdef void *result
 * 
 *     cdef size_t itemsize = src.memview.view.itemsize             # <<<<<<<<<<<<<<
 *     cdef size_t size = slice_get_size(src, ndim)
 * 
*/
  __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
  __pyx_v_itemsize = __pyx_t_1;

  /* "View.MemoryView":1123
 * 
 *     cdef size_t itemsize = src.memview.view.itemsize
 *     cdef size_t size = slice_get_size(src, ndim)             # <<<<<<<<<<<<<<
 * 
 *     result = malloc(size)
*/
  __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);

  /* "View.MemoryView":1125
 *     cdef size_t size = slice_get_size(src, ndim)
 * 
 *     result = malloc(size)             # <<<<<<<<<<<<<<
 *     if not result:
 *         _err_no_memory()
*/
  __pyx_v_result = malloc(__pyx_v_size);

  /* "View.MemoryView":1126
 * 
 *     result = malloc(size)
 *     if not result:             # <<<<<<<<<<<<<<
 *         _err_no_memory()
 * 
*/
  __pyx_t_2 = (!(__pyx_v_result != 0));
  if (__pyx_t_2) {

    /* "View.MemoryView":1127
 *     result = malloc(size)
 *     if not result:
 *         _err_no_memory()             # <<<<<<<<<<<<<<
 * 
 * 
*/
    __pyx_t_3 = __pyx_memoryview_err_no_memory(); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(7, 1127, __pyx_L1_error)

    /* "View.MemoryView":1126
 * 
 *     result = malloc(size)
 *     if not result:             # <<<<<<<<<<<<<<
 *         _err_no_memory()
 * 
*/
  }

  /* "View.MemoryView":1130
 * 
 * 
 *     tmpslice.data = <char *> result             # <<<<<<<<<<<<<<
 *     tmpslice.memview = src.memview
 *     for i in range(ndim):
*/
  __pyx_v_tmpslice->data = ((char *)__pyx_v_result);

  /* "View.MemoryView":1131
 * 
 *     tmpslice.data = <char *> result
 *     tmpslice.memview = src.memview             # <<<<<<<<<<<<<<
 *     for i in range(ndim):
 *         tmpslice.shape[i] = src.shape[i]
*/
  __pyx_t_4 = __pyx_v_src->memview;
  __pyx_v_tmpslice->memview = __pyx_t_4;

  /* "View.MemoryView":1132
 *     tmpslice.data = <char *> result
 *     tmpslice.memview = src.memview
 *     for i in range(ndim):             # <<<<<<<<<<<<<<
 *         tmpslice.shape[i] = src.shape[i]
 *         tmpslice.suboffsets[i] = -1
*/
  __pyx_t_3 = __pyx_v_ndim;
  __pyx_t_5 = __pyx_t_3;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "View.MemoryView":1133
 *     tmpslice.memview = src.memview
 *     for i in range(ndim):
 *         tmpslice.shape[i] = src.shape[i]             # <<<<<<<<<<<<<<
 *         tmpslice.suboffsets[i] = -1
 * 
*/
    (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);

    /* "View.MemoryView":1134
 *     for i in range(ndim):
 *         tmpslice.shape[i] = src.shape[i]
 *         tmpslice.suboffsets[i] = -1             # <<<<<<<<<<<<<<
 * 
 *     fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, ndim, order)
*/
    (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
  }

  /* "View.MemoryView":1136
 *         tmpslice.suboffsets[i] = -1
 * 
 *     fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, ndim, order)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  (void)(__pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order));

  /* "View.MemoryView":1139
 * 
 * 
 *     for i in range(ndim):             # <<<<<<<<<<<<<<
 *         if tmpslice.shape[i] == 1:
 *             tmpslice.strides[i] = 0
*/
  __pyx_t_3 = __pyx_v_ndim;
  __pyx_t_5 = __pyx_t_3;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "View.MemoryView":1140
 * 
 *     for i in range(ndim):
 *         if tmpslice.shape[i] == 1:             # <<<<<<<<<<<<<<
 *             tmpslice.strides[i] = 0
 * 
*/
    __pyx_t_2 = ((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1);
    if (__pyx_t_2) {

      /* "View.MemoryView":1141
 *     for i in range(ndim):
 *         if tmpslice.shape[i] == 1:
 *             tmpslice.strides[i] = 0             # <<<<<<<<<<<<<<
 * 
 *     if slice_is_contig(src[0], order, ndim):
*/
      (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;

      /* "View.MemoryView":1140
 * 
 *     for i in range(ndim):
 *         if tmpslice.shape[i] == 1:             # <<<<<<<<<<<<<<
 *             tmpslice.strides[i] = 0
 * 
*/
    }
  }

  /* "View.MemoryView":1143
 *             tmpslice.strides[i] = 0
 * 
 *     if slice_is_contig(src[0], order, ndim):             # <<<<<<<<<<<<<<
 *         memcpy(result, src.data, size)
 *     else:
*/
  __pyx_t_2 = __pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim);
  if (__pyx_t_2) {

    /* "View.MemoryView":1144
 * 
 *     if slice_is_contig(src[0], order, ndim):
 *         memcpy(result, src.data, size)             # <<<<<<<<<<<<<<
 *     else:
 *         copy_strided_to_strided(src, tmpslice, ndim, itemsize)
*/
    (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));

    /* "View.MemoryView":1143
 *             tmpslice.strides[i] = 0
 * 
 *     if slice_is_contig(src[0], order, ndim):             # <<<<<<<<<<<<<<
 *         memcpy(result, src.data, size)
 *     else:
*/
    goto __pyx_L9;
  }

  /* "View.MemoryView":1146
 *         memcpy(result, src.data, size)
 *     else:
 *         copy_strided_to_strided(src, tmpslice, ndim, itemsize)             # <<<<<<<<<<<<<<
 * 
 *     return result
*/
  /*else*/ {
    copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
  }
  __pyx_L9:;

  /* "View.MemoryView":1148
 *         copy_strided_to_strided(src, tmpslice, ndim, itemsize)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "View.MemoryView":1110
 *     return stride
 * 
 * @cname('__pyx_memoryview_copy_data_to_temp')             # <<<<<<<<<<<<<<
 * cdef void *copy_data_to_temp(__Pyx_memviewslice *src,
 *                              __Pyx_memviewslice *tmpslice,
*/

  /* function exit code */
  __pyx_L1_error:;
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  __pyx_L0:;
  return __pyx_r;
}

/* "View.MemoryView":1152
 * 
 * 
 * @cname('__pyx_memoryview_err_extents')             # <<<<<<<<<<<<<<
 * cdef int _err_extents(int i, Py_ssize_t extent1,
 *                              Py_ssize_t extent2) except -1 with gil:
*/

static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4[7];
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("_err_extents", 0);

  /* "View.MemoryView":1155
 * cdef int _err_extents(int i, Py_ssize_t extent1,
 *                              Py_ssize_t extent2) except -1 with gil:
 *     raise ValueError, f"got differing extents in dimension {i} (got {extent1} and {extent2})"             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_err_dim')
*/
  __pyx_t_1 = __Pyx_PyUnicode_From_int(__pyx_v_i, 0, ' ', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1155, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_extent1, 0, ' ', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 1155, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_extent2, 0, ' ', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 1155, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4[0] = __pyx_mstate_global->__pyx_kp_u_got_differing_extents_in_dimensi;
  __pyx_t_4[1] = __pyx_t_1;
  __pyx_t_4[2] = __pyx_mstate_global->__pyx_kp_u_got;
  __pyx_t_4[3] = __pyx_t_2;
  __pyx_t_4[4] = __pyx_mstate_global->__pyx_kp_u_and;
  __pyx_t_4[5] = __pyx_t_3;
  __pyx_t_4[6] = __pyx_mstate_global->__pyx_kp_u__5;
  __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_4, 7, 35 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1) + 6 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + 5 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3) + 1, 127);
  if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 1155, __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_Raise(((PyObject *)(((PyTypeObject*)PyExc_ValueError))), __pyx_t_5, 0, 0);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __PYX_ERR(7, 1155, __pyx_L1_error)

  /* "View.MemoryView":1152
 * 
 * 
 * @cname('__pyx_memoryview_err_extents')             # <<<<<<<<<<<<<<
 * cdef int _err_extents(int i, Py_ssize_t extent1,
 *                              Py_ssize_t extent2) except -1 with gil:
*/

  /* 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("View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_RefNannyFinishContext();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "View.MemoryView":1157
 *     raise ValueError, f"got differing extents in dimension {i} (got {extent1} and {extent2})"
 * 
 * @cname('__pyx_memoryview_err_dim')             # <<<<<<<<<<<<<<
 * cdef int _err_dim(PyObject *error, str msg, int dim) except -1 with gil:
 *     raise <object>error, msg % dim
*/

static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, PyObject *__pyx_v_msg, int __pyx_v_dim) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("_err_dim", 0);
  __Pyx_INCREF(__pyx_v_msg);

  /* "View.MemoryView":1159
 * @cname('__pyx_memoryview_err_dim')
 * cdef int _err_dim(PyObject *error, str msg, int dim) except -1 with gil:
 *     raise <object>error, msg % dim             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_err')
*/
  __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1159, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyUnicode_FormatSafe(__pyx_v_msg, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 1159, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_Raise(((PyObject *)__pyx_v_error), __pyx_t_2, 0, 0);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __PYX_ERR(7, 1159, __pyx_L1_error)

  /* "View.MemoryView":1157
 *     raise ValueError, f"got differing extents in dimension {i} (got {extent1} and {extent2})"
 * 
 * @cname('__pyx_memoryview_err_dim')             # <<<<<<<<<<<<<<
 * cdef int _err_dim(PyObject *error, str msg, int dim) except -1 with gil:
 *     raise <object>error, msg % dim
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_XDECREF(__pyx_v_msg);
  __Pyx_RefNannyFinishContext();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "View.MemoryView":1161
 *     raise <object>error, msg % dim
 * 
 * @cname('__pyx_memoryview_err')             # <<<<<<<<<<<<<<
 * cdef int _err(PyObject *error, str msg) except -1 with gil:
 *     raise <object>error, msg
*/

static int __pyx_memoryview_err(PyObject *__pyx_v_error, PyObject *__pyx_v_msg) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("_err", 0);
  __Pyx_INCREF(__pyx_v_msg);

  /* "View.MemoryView":1163
 * @cname('__pyx_memoryview_err')
 * cdef int _err(PyObject *error, str msg) except -1 with gil:
 *     raise <object>error, msg             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_err_no_memory')
*/
  __Pyx_Raise(((PyObject *)__pyx_v_error), __pyx_v_msg, 0, 0);
  __PYX_ERR(7, 1163, __pyx_L1_error)

  /* "View.MemoryView":1161
 *     raise <object>error, msg % dim
 * 
 * @cname('__pyx_memoryview_err')             # <<<<<<<<<<<<<<
 * cdef int _err(PyObject *error, str msg) except -1 with gil:
 *     raise <object>error, msg
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_XDECREF(__pyx_v_msg);
  __Pyx_RefNannyFinishContext();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "View.MemoryView":1165
 *     raise <object>error, msg
 * 
 * @cname('__pyx_memoryview_err_no_memory')             # <<<<<<<<<<<<<<
 * cdef int _err_no_memory() except -1 with gil:
 *     raise MemoryError
*/

static int __pyx_memoryview_err_no_memory(void) {
  int __pyx_r;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();

  /* "View.MemoryView":1167
 * @cname('__pyx_memoryview_err_no_memory')
 * cdef int _err_no_memory() except -1 with gil:
 *     raise MemoryError             # <<<<<<<<<<<<<<
 * 
 * 
*/
  PyErr_NoMemory(); __PYX_ERR(7, 1167, __pyx_L1_error)

  /* "View.MemoryView":1165
 *     raise <object>error, msg
 * 
 * @cname('__pyx_memoryview_err_no_memory')             # <<<<<<<<<<<<<<
 * cdef int _err_no_memory() except -1 with gil:
 *     raise MemoryError
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("View.MemoryView._err_no_memory", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "View.MemoryView":1170
 * 
 * 
 * @cname('__pyx_memoryview_copy_contents')             # <<<<<<<<<<<<<<
 * cdef int memoryview_copy_contents(__Pyx_memviewslice src,
 *                                   __Pyx_memviewslice dst,
*/

static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst, int __pyx_v_src_ndim, int __pyx_v_dst_ndim, int __pyx_v_dtype_is_object) {
  void *__pyx_v_tmpdata;
  size_t __pyx_v_itemsize;
  int __pyx_v_i;
  char __pyx_v_order;
  int __pyx_v_broadcasting;
  int __pyx_v_direct_copy;
  __Pyx_memviewslice __pyx_v_tmp;
  int __pyx_v_ndim;
  int __pyx_r;
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  void *__pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save;

  /* "View.MemoryView":1179
 *     Check for overlapping memory and verify the shapes.
 *     """
 *     cdef void *tmpdata = NULL             # <<<<<<<<<<<<<<
 *     cdef size_t itemsize = src.memview.view.itemsize
 *     cdef int i
*/
  __pyx_v_tmpdata = NULL;

  /* "View.MemoryView":1180
 *     """
 *     cdef void *tmpdata = NULL
 *     cdef size_t itemsize = src.memview.view.itemsize             # <<<<<<<<<<<<<<
 *     cdef int i
 *     cdef char order = get_best_order(&src, src_ndim)
*/
  __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
  __pyx_v_itemsize = __pyx_t_1;

  /* "View.MemoryView":1182
 *     cdef size_t itemsize = src.memview.view.itemsize
 *     cdef int i
 *     cdef char order = get_best_order(&src, src_ndim)             # <<<<<<<<<<<<<<
 *     cdef bint broadcasting = False
 *     cdef bint direct_copy = False
*/
  __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);

  /* "View.MemoryView":1183
 *     cdef int i
 *     cdef char order = get_best_order(&src, src_ndim)
 *     cdef bint broadcasting = False             # <<<<<<<<<<<<<<
 *     cdef bint direct_copy = False
 *     cdef __Pyx_memviewslice tmp
*/
  __pyx_v_broadcasting = 0;

  /* "View.MemoryView":1184
 *     cdef char order = get_best_order(&src, src_ndim)
 *     cdef bint broadcasting = False
 *     cdef bint direct_copy = False             # <<<<<<<<<<<<<<
 *     cdef __Pyx_memviewslice tmp
 * 
*/
  __pyx_v_direct_copy = 0;

  /* "View.MemoryView":1187
 *     cdef __Pyx_memviewslice tmp
 * 
 *     if src_ndim < dst_ndim:             # <<<<<<<<<<<<<<
 *         broadcast_leading(&src, src_ndim, dst_ndim)
 *     elif dst_ndim < src_ndim:
*/
  __pyx_t_2 = (__pyx_v_src_ndim < __pyx_v_dst_ndim);
  if (__pyx_t_2) {

    /* "View.MemoryView":1188
 * 
 *     if src_ndim < dst_ndim:
 *         broadcast_leading(&src, src_ndim, dst_ndim)             # <<<<<<<<<<<<<<
 *     elif dst_ndim < src_ndim:
 *         broadcast_leading(&dst, dst_ndim, src_ndim)
*/
    __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);

    /* "View.MemoryView":1187
 *     cdef __Pyx_memviewslice tmp
 * 
 *     if src_ndim < dst_ndim:             # <<<<<<<<<<<<<<
 *         broadcast_leading(&src, src_ndim, dst_ndim)
 *     elif dst_ndim < src_ndim:
*/
    goto __pyx_L3;
  }

  /* "View.MemoryView":1189
 *     if src_ndim < dst_ndim:
 *         broadcast_leading(&src, src_ndim, dst_ndim)
 *     elif dst_ndim < src_ndim:             # <<<<<<<<<<<<<<
 *         broadcast_leading(&dst, dst_ndim, src_ndim)
 * 
*/
  __pyx_t_2 = (__pyx_v_dst_ndim < __pyx_v_src_ndim);
  if (__pyx_t_2) {

    /* "View.MemoryView":1190
 *         broadcast_leading(&src, src_ndim, dst_ndim)
 *     elif dst_ndim < src_ndim:
 *         broadcast_leading(&dst, dst_ndim, src_ndim)             # <<<<<<<<<<<<<<
 * 
 *     cdef int ndim = max(src_ndim, dst_ndim)
*/
    __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);

    /* "View.MemoryView":1189
 *     if src_ndim < dst_ndim:
 *         broadcast_leading(&src, src_ndim, dst_ndim)
 *     elif dst_ndim < src_ndim:             # <<<<<<<<<<<<<<
 *         broadcast_leading(&dst, dst_ndim, src_ndim)
 * 
*/
  }
  __pyx_L3:;

  /* "View.MemoryView":1192
 *         broadcast_leading(&dst, dst_ndim, src_ndim)
 * 
 *     cdef int ndim = max(src_ndim, dst_ndim)             # <<<<<<<<<<<<<<
 * 
 *     for i in range(ndim):
*/
  __pyx_t_3 = __pyx_v_dst_ndim;
  __pyx_t_4 = __pyx_v_src_ndim;
  __pyx_t_2 = (__pyx_t_3 > __pyx_t_4);
  if (__pyx_t_2) {
    __pyx_t_5 = __pyx_t_3;
  } else {
    __pyx_t_5 = __pyx_t_4;
  }
  __pyx_v_ndim = __pyx_t_5;

  /* "View.MemoryView":1194
 *     cdef int ndim = max(src_ndim, dst_ndim)
 * 
 *     for i in range(ndim):             # <<<<<<<<<<<<<<
 *         if src.shape[i] != dst.shape[i]:
 *             if src.shape[i] == 1:
*/
  __pyx_t_5 = __pyx_v_ndim;
  __pyx_t_3 = __pyx_t_5;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;

    /* "View.MemoryView":1195
 * 
 *     for i in range(ndim):
 *         if src.shape[i] != dst.shape[i]:             # <<<<<<<<<<<<<<
 *             if src.shape[i] == 1:
 *                 broadcasting = True
*/
    __pyx_t_2 = ((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i]));
    if (__pyx_t_2) {

      /* "View.MemoryView":1196
 *     for i in range(ndim):
 *         if src.shape[i] != dst.shape[i]:
 *             if src.shape[i] == 1:             # <<<<<<<<<<<<<<
 *                 broadcasting = True
 *                 src.strides[i] = 0
*/
      __pyx_t_2 = ((__pyx_v_src.shape[__pyx_v_i]) == 1);
      if (__pyx_t_2) {

        /* "View.MemoryView":1197
 *         if src.shape[i] != dst.shape[i]:
 *             if src.shape[i] == 1:
 *                 broadcasting = True             # <<<<<<<<<<<<<<
 *                 src.strides[i] = 0
 *             else:
*/
        __pyx_v_broadcasting = 1;

        /* "View.MemoryView":1198
 *             if src.shape[i] == 1:
 *                 broadcasting = True
 *                 src.strides[i] = 0             # <<<<<<<<<<<<<<
 *             else:
 *                 _err_extents(i, dst.shape[i], src.shape[i])
*/
        (__pyx_v_src.strides[__pyx_v_i]) = 0;

        /* "View.MemoryView":1196
 *     for i in range(ndim):
 *         if src.shape[i] != dst.shape[i]:
 *             if src.shape[i] == 1:             # <<<<<<<<<<<<<<
 *                 broadcasting = True
 *                 src.strides[i] = 0
*/
        goto __pyx_L7;
      }

      /* "View.MemoryView":1200
 *                 src.strides[i] = 0
 *             else:
 *                 _err_extents(i, dst.shape[i], src.shape[i])             # <<<<<<<<<<<<<<
 * 
 *         if src.suboffsets[i] >= 0:
*/
      /*else*/ {
        __pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(7, 1200, __pyx_L1_error)
      }
      __pyx_L7:;

      /* "View.MemoryView":1195
 * 
 *     for i in range(ndim):
 *         if src.shape[i] != dst.shape[i]:             # <<<<<<<<<<<<<<
 *             if src.shape[i] == 1:
 *                 broadcasting = True
*/
    }

    /* "View.MemoryView":1202
 *                 _err_extents(i, dst.shape[i], src.shape[i])
 * 
 *         if src.suboffsets[i] >= 0:             # <<<<<<<<<<<<<<
 *             _err_dim(PyExc_ValueError, "Dimension %d is not direct", i)
 * 
*/
    __pyx_t_2 = ((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0);
    if (__pyx_t_2) {

      /* "View.MemoryView":1203
 * 
 *         if src.suboffsets[i] >= 0:
 *             _err_dim(PyExc_ValueError, "Dimension %d is not direct", i)             # <<<<<<<<<<<<<<
 * 
 *     if slices_overlap(&src, &dst, ndim, itemsize):
*/
      __pyx_t_6 = __pyx_memoryview_err_dim(PyExc_ValueError, __pyx_mstate_global->__pyx_kp_u_Dimension_d_is_not_direct, __pyx_v_i); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(7, 1203, __pyx_L1_error)

      /* "View.MemoryView":1202
 *                 _err_extents(i, dst.shape[i], src.shape[i])
 * 
 *         if src.suboffsets[i] >= 0:             # <<<<<<<<<<<<<<
 *             _err_dim(PyExc_ValueError, "Dimension %d is not direct", i)
 * 
*/
    }
  }

  /* "View.MemoryView":1205
 *             _err_dim(PyExc_ValueError, "Dimension %d is not direct", i)
 * 
 *     if slices_overlap(&src, &dst, ndim, itemsize):             # <<<<<<<<<<<<<<
 * 
 *         if not slice_is_contig(src, order, ndim):
*/
  __pyx_t_2 = __pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
  if (__pyx_t_2) {

    /* "View.MemoryView":1207
 *     if slices_overlap(&src, &dst, ndim, itemsize):
 * 
 *         if not slice_is_contig(src, order, ndim):             # <<<<<<<<<<<<<<
 *             order = get_best_order(&dst, ndim)
 * 
*/
    __pyx_t_2 = (!__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim));
    if (__pyx_t_2) {

      /* "View.MemoryView":1208
 * 
 *         if not slice_is_contig(src, order, ndim):
 *             order = get_best_order(&dst, ndim)             # <<<<<<<<<<<<<<
 * 
 *         tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
*/
      __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);

      /* "View.MemoryView":1207
 *     if slices_overlap(&src, &dst, ndim, itemsize):
 * 
 *         if not slice_is_contig(src, order, ndim):             # <<<<<<<<<<<<<<
 *             order = get_best_order(&dst, ndim)
 * 
*/
    }

    /* "View.MemoryView":1210
 *             order = get_best_order(&dst, ndim)
 * 
 *         tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)             # <<<<<<<<<<<<<<
 *         src = tmp
 * 
*/
    __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_7 == ((void *)NULL))) __PYX_ERR(7, 1210, __pyx_L1_error)
    __pyx_v_tmpdata = __pyx_t_7;

    /* "View.MemoryView":1211
 * 
 *         tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
 *         src = tmp             # <<<<<<<<<<<<<<
 * 
 *     if not broadcasting:
*/
    __pyx_v_src = __pyx_v_tmp;

    /* "View.MemoryView":1205
 *             _err_dim(PyExc_ValueError, "Dimension %d is not direct", i)
 * 
 *     if slices_overlap(&src, &dst, ndim, itemsize):             # <<<<<<<<<<<<<<
 * 
 *         if not slice_is_contig(src, order, ndim):
*/
  }

  /* "View.MemoryView":1213
 *         src = tmp
 * 
 *     if not broadcasting:             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_2 = (!__pyx_v_broadcasting);
  if (__pyx_t_2) {

    /* "View.MemoryView":1216
 * 
 * 
 *         if slice_is_contig(src, 'C', ndim):             # <<<<<<<<<<<<<<
 *             direct_copy = slice_is_contig(dst, 'C', ndim)
 *         elif slice_is_contig(src, 'F', ndim):
*/
    __pyx_t_2 = __pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim);
    if (__pyx_t_2) {

      /* "View.MemoryView":1217
 * 
 *         if slice_is_contig(src, 'C', ndim):
 *             direct_copy = slice_is_contig(dst, 'C', ndim)             # <<<<<<<<<<<<<<
 *         elif slice_is_contig(src, 'F', ndim):
 *             direct_copy = slice_is_contig(dst, 'F', ndim)
*/
      __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim);

      /* "View.MemoryView":1216
 * 
 * 
 *         if slice_is_contig(src, 'C', ndim):             # <<<<<<<<<<<<<<
 *             direct_copy = slice_is_contig(dst, 'C', ndim)
 *         elif slice_is_contig(src, 'F', ndim):
*/
      goto __pyx_L12;
    }

    /* "View.MemoryView":1218
 *         if slice_is_contig(src, 'C', ndim):
 *             direct_copy = slice_is_contig(dst, 'C', ndim)
 *         elif slice_is_contig(src, 'F', ndim):             # <<<<<<<<<<<<<<
 *             direct_copy = slice_is_contig(dst, 'F', ndim)
 * 
*/
    __pyx_t_2 = __pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim);
    if (__pyx_t_2) {

      /* "View.MemoryView":1219
 *             direct_copy = slice_is_contig(dst, 'C', ndim)
 *         elif slice_is_contig(src, 'F', ndim):
 *             direct_copy = slice_is_contig(dst, 'F', ndim)             # <<<<<<<<<<<<<<
 * 
 *         if direct_copy:
*/
      __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim);

      /* "View.MemoryView":1218
 *         if slice_is_contig(src, 'C', ndim):
 *             direct_copy = slice_is_contig(dst, 'C', ndim)
 *         elif slice_is_contig(src, 'F', ndim):             # <<<<<<<<<<<<<<
 *             direct_copy = slice_is_contig(dst, 'F', ndim)
 * 
*/
    }
    __pyx_L12:;

    /* "View.MemoryView":1221
 *             direct_copy = slice_is_contig(dst, 'F', ndim)
 * 
 *         if direct_copy:             # <<<<<<<<<<<<<<
 * 
 *             refcount_copying(&dst, dtype_is_object, ndim, inc=False)
*/
    if (__pyx_v_direct_copy) {

      /* "View.MemoryView":1223
 *         if direct_copy:
 * 
 *             refcount_copying(&dst, dtype_is_object, ndim, inc=False)             # <<<<<<<<<<<<<<
 *             memcpy(dst.data, src.data, slice_get_size(&src, ndim))
 *             refcount_copying(&dst, dtype_is_object, ndim, inc=True)
*/
      __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);

      /* "View.MemoryView":1224
 * 
 *             refcount_copying(&dst, dtype_is_object, ndim, inc=False)
 *             memcpy(dst.data, src.data, slice_get_size(&src, ndim))             # <<<<<<<<<<<<<<
 *             refcount_copying(&dst, dtype_is_object, ndim, inc=True)
 *             free(tmpdata)
*/
      (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));

      /* "View.MemoryView":1225
 *             refcount_copying(&dst, dtype_is_object, ndim, inc=False)
 *             memcpy(dst.data, src.data, slice_get_size(&src, ndim))
 *             refcount_copying(&dst, dtype_is_object, ndim, inc=True)             # <<<<<<<<<<<<<<
 *             free(tmpdata)
 *             return 0
*/
      __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);

      /* "View.MemoryView":1226
 *             memcpy(dst.data, src.data, slice_get_size(&src, ndim))
 *             refcount_copying(&dst, dtype_is_object, ndim, inc=True)
 *             free(tmpdata)             # <<<<<<<<<<<<<<
 *             return 0
 * 
*/
      free(__pyx_v_tmpdata);

      /* "View.MemoryView":1227
 *             refcount_copying(&dst, dtype_is_object, ndim, inc=True)
 *             free(tmpdata)
 *             return 0             # <<<<<<<<<<<<<<
 * 
 *     if order == 'F' == get_best_order(&dst, ndim):
*/
      __pyx_r = 0;
      goto __pyx_L0;

      /* "View.MemoryView":1221
 *             direct_copy = slice_is_contig(dst, 'F', ndim)
 * 
 *         if direct_copy:             # <<<<<<<<<<<<<<
 * 
 *             refcount_copying(&dst, dtype_is_object, ndim, inc=False)
*/
    }

    /* "View.MemoryView":1213
 *         src = tmp
 * 
 *     if not broadcasting:             # <<<<<<<<<<<<<<
 * 
 * 
*/
  }

  /* "View.MemoryView":1229
 *             return 0
 * 
 *     if order == 'F' == get_best_order(&dst, ndim):             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_2 = (__pyx_v_order == 'F');
  if (__pyx_t_2) {
    __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
  }
  if (__pyx_t_2) {

    /* "View.MemoryView":1232
 * 
 * 
 *         transpose_memslice(&src)             # <<<<<<<<<<<<<<
 *         transpose_memslice(&dst)
 * 
*/
    __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(7, 1232, __pyx_L1_error)

    /* "View.MemoryView":1233
 * 
 *         transpose_memslice(&src)
 *         transpose_memslice(&dst)             # <<<<<<<<<<<<<<
 * 
 *     refcount_copying(&dst, dtype_is_object, ndim, inc=False)
*/
    __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(7, 1233, __pyx_L1_error)

    /* "View.MemoryView":1229
 *             return 0
 * 
 *     if order == 'F' == get_best_order(&dst, ndim):             # <<<<<<<<<<<<<<
 * 
 * 
*/
  }

  /* "View.MemoryView":1235
 *         transpose_memslice(&dst)
 * 
 *     refcount_copying(&dst, dtype_is_object, ndim, inc=False)             # <<<<<<<<<<<<<<
 *     copy_strided_to_strided(&src, &dst, ndim, itemsize)
 *     refcount_copying(&dst, dtype_is_object, ndim, inc=True)
*/
  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);

  /* "View.MemoryView":1236
 * 
 *     refcount_copying(&dst, dtype_is_object, ndim, inc=False)
 *     copy_strided_to_strided(&src, &dst, ndim, itemsize)             # <<<<<<<<<<<<<<
 *     refcount_copying(&dst, dtype_is_object, ndim, inc=True)
 * 
*/
  copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);

  /* "View.MemoryView":1237
 *     refcount_copying(&dst, dtype_is_object, ndim, inc=False)
 *     copy_strided_to_strided(&src, &dst, ndim, itemsize)
 *     refcount_copying(&dst, dtype_is_object, ndim, inc=True)             # <<<<<<<<<<<<<<
 * 
 *     free(tmpdata)
*/
  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);

  /* "View.MemoryView":1239
 *     refcount_copying(&dst, dtype_is_object, ndim, inc=True)
 * 
 *     free(tmpdata)             # <<<<<<<<<<<<<<
 *     return 0
 * 
*/
  free(__pyx_v_tmpdata);

  /* "View.MemoryView":1240
 * 
 *     free(tmpdata)
 *     return 0             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_broadcast_leading')
*/
  __pyx_r = 0;
  goto __pyx_L0;

  /* "View.MemoryView":1170
 * 
 * 
 * @cname('__pyx_memoryview_copy_contents')             # <<<<<<<<<<<<<<
 * cdef int memoryview_copy_contents(__Pyx_memviewslice src,
 *                                   __Pyx_memviewslice dst,
*/

  /* function exit code */
  __pyx_L1_error:;
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  __pyx_L0:;
  return __pyx_r;
}

/* "View.MemoryView":1242
 *     return 0
 * 
 * @cname('__pyx_memoryview_broadcast_leading')             # <<<<<<<<<<<<<<
 * cdef void broadcast_leading(__Pyx_memviewslice *mslice,
 *                             int ndim,
*/

static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim, int __pyx_v_ndim_other) {
  int __pyx_v_i;
  int __pyx_v_offset;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;

  /* "View.MemoryView":1247
 *                             int ndim_other) noexcept nogil:
 *     cdef int i
 *     cdef int offset = ndim_other - ndim             # <<<<<<<<<<<<<<
 * 
 *     for i in range(ndim - 1, -1, -1):
*/
  __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);

  /* "View.MemoryView":1249
 *     cdef int offset = ndim_other - ndim
 * 
 *     for i in range(ndim - 1, -1, -1):             # <<<<<<<<<<<<<<
 *         mslice.shape[i + offset] = mslice.shape[i]
 *         mslice.strides[i + offset] = mslice.strides[i]
*/
  for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
    __pyx_v_i = __pyx_t_1;

    /* "View.MemoryView":1250
 * 
 *     for i in range(ndim - 1, -1, -1):
 *         mslice.shape[i + offset] = mslice.shape[i]             # <<<<<<<<<<<<<<
 *         mslice.strides[i + offset] = mslice.strides[i]
 *         mslice.suboffsets[i + offset] = mslice.suboffsets[i]
*/
    (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);

    /* "View.MemoryView":1251
 *     for i in range(ndim - 1, -1, -1):
 *         mslice.shape[i + offset] = mslice.shape[i]
 *         mslice.strides[i + offset] = mslice.strides[i]             # <<<<<<<<<<<<<<
 *         mslice.suboffsets[i + offset] = mslice.suboffsets[i]
 * 
*/
    (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);

    /* "View.MemoryView":1252
 *         mslice.shape[i + offset] = mslice.shape[i]
 *         mslice.strides[i + offset] = mslice.strides[i]
 *         mslice.suboffsets[i + offset] = mslice.suboffsets[i]             # <<<<<<<<<<<<<<
 * 
 *     for i in range(offset):
*/
    (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
  }

  /* "View.MemoryView":1254
 *         mslice.suboffsets[i + offset] = mslice.suboffsets[i]
 * 
 *     for i in range(offset):             # <<<<<<<<<<<<<<
 *         mslice.shape[i] = 1
 *         mslice.strides[i] = mslice.strides[0]
*/
  __pyx_t_1 = __pyx_v_offset;
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "View.MemoryView":1255
 * 
 *     for i in range(offset):
 *         mslice.shape[i] = 1             # <<<<<<<<<<<<<<
 *         mslice.strides[i] = mslice.strides[0]
 *         mslice.suboffsets[i] = -1
*/
    (__pyx_v_mslice->shape[__pyx_v_i]) = 1;

    /* "View.MemoryView":1256
 *     for i in range(offset):
 *         mslice.shape[i] = 1
 *         mslice.strides[i] = mslice.strides[0]             # <<<<<<<<<<<<<<
 *         mslice.suboffsets[i] = -1
 * 
*/
    (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);

    /* "View.MemoryView":1257
 *         mslice.shape[i] = 1
 *         mslice.strides[i] = mslice.strides[0]
 *         mslice.suboffsets[i] = -1             # <<<<<<<<<<<<<<
 * 
 * 
*/
    (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
  }

  /* "View.MemoryView":1242
 *     return 0
 * 
 * @cname('__pyx_memoryview_broadcast_leading')             # <<<<<<<<<<<<<<
 * cdef void broadcast_leading(__Pyx_memviewslice *mslice,
 *                             int ndim,
*/

  /* function exit code */
}

/* "View.MemoryView":1264
 * 
 * 
 * @cname('__pyx_memoryview_refcount_copying')             # <<<<<<<<<<<<<<
 * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, int ndim, bint inc) noexcept nogil:
 * 
*/

static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_dtype_is_object, int __pyx_v_ndim, int __pyx_v_inc) {

  /* "View.MemoryView":1267
 * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, int ndim, bint inc) noexcept nogil:
 * 
 *     if dtype_is_object:             # <<<<<<<<<<<<<<
 *         refcount_objects_in_slice_with_gil(dst.data, dst.shape, dst.strides, ndim, inc)
 * 
*/
  if (__pyx_v_dtype_is_object) {

    /* "View.MemoryView":1268
 * 
 *     if dtype_is_object:
 *         refcount_objects_in_slice_with_gil(dst.data, dst.shape, dst.strides, ndim, inc)             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
*/
    __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc);

    /* "View.MemoryView":1267
 * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, int ndim, bint inc) noexcept nogil:
 * 
 *     if dtype_is_object:             # <<<<<<<<<<<<<<
 *         refcount_objects_in_slice_with_gil(dst.data, dst.shape, dst.strides, ndim, inc)
 * 
*/
  }

  /* "View.MemoryView":1264
 * 
 * 
 * @cname('__pyx_memoryview_refcount_copying')             # <<<<<<<<<<<<<<
 * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, int ndim, bint inc) noexcept nogil:
 * 
*/

  /* function exit code */
}

/* "View.MemoryView":1270
 *         refcount_objects_in_slice_with_gil(dst.data, dst.shape, dst.strides, ndim, inc)
 * 
 * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')             # <<<<<<<<<<<<<<
 * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape,
 *                                              Py_ssize_t *strides, int ndim,
*/

static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();

  /* "View.MemoryView":1274
 *                                              Py_ssize_t *strides, int ndim,
 *                                              bint inc) noexcept with gil:
 *     refcount_objects_in_slice(data, shape, strides, ndim, inc)             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_refcount_objects_in_slice')
*/
  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);

  /* "View.MemoryView":1270
 *         refcount_objects_in_slice_with_gil(dst.data, dst.shape, dst.strides, ndim, inc)
 * 
 * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')             # <<<<<<<<<<<<<<
 * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape,
 *                                              Py_ssize_t *strides, int ndim,
*/

  /* function exit code */
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
}

/* "View.MemoryView":1276
 *     refcount_objects_in_slice(data, shape, strides, ndim, inc)
 * 
 * @cname('__pyx_memoryview_refcount_objects_in_slice')             # <<<<<<<<<<<<<<
 * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape,
 *                                     Py_ssize_t *strides, int ndim, bint inc) noexcept:
*/

static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_stride;
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;

  /* "View.MemoryView":1280
 *                                     Py_ssize_t *strides, int ndim, bint inc) noexcept:
 *     cdef Py_ssize_t i
 *     cdef Py_ssize_t stride = strides[0]             # <<<<<<<<<<<<<<
 * 
 *     for i in range(shape[0]):
*/
  __pyx_v_stride = (__pyx_v_strides[0]);

  /* "View.MemoryView":1282
 *     cdef Py_ssize_t stride = strides[0]
 * 
 *     for i in range(shape[0]):             # <<<<<<<<<<<<<<
 *         if ndim == 1:
 *             if inc:
*/
  __pyx_t_1 = (__pyx_v_shape[0]);
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "View.MemoryView":1283
 * 
 *     for i in range(shape[0]):
 *         if ndim == 1:             # <<<<<<<<<<<<<<
 *             if inc:
 *                 Py_INCREF((<PyObject **> data)[0])
*/
    __pyx_t_4 = (__pyx_v_ndim == 1);
    if (__pyx_t_4) {

      /* "View.MemoryView":1284
 *     for i in range(shape[0]):
 *         if ndim == 1:
 *             if inc:             # <<<<<<<<<<<<<<
 *                 Py_INCREF((<PyObject **> data)[0])
 *             else:
*/
      if (__pyx_v_inc) {

        /* "View.MemoryView":1285
 *         if ndim == 1:
 *             if inc:
 *                 Py_INCREF((<PyObject **> data)[0])             # <<<<<<<<<<<<<<
 *             else:
 *                 Py_DECREF((<PyObject **> data)[0])
*/
        Py_INCREF((((PyObject **)__pyx_v_data)[0]));

        /* "View.MemoryView":1284
 *     for i in range(shape[0]):
 *         if ndim == 1:
 *             if inc:             # <<<<<<<<<<<<<<
 *                 Py_INCREF((<PyObject **> data)[0])
 *             else:
*/
        goto __pyx_L6;
      }

      /* "View.MemoryView":1287
 *                 Py_INCREF((<PyObject **> data)[0])
 *             else:
 *                 Py_DECREF((<PyObject **> data)[0])             # <<<<<<<<<<<<<<
 *         else:
 *             refcount_objects_in_slice(data, shape + 1, strides + 1, ndim - 1, inc)
*/
      /*else*/ {
        Py_DECREF((((PyObject **)__pyx_v_data)[0]));
      }
      __pyx_L6:;

      /* "View.MemoryView":1283
 * 
 *     for i in range(shape[0]):
 *         if ndim == 1:             # <<<<<<<<<<<<<<
 *             if inc:
 *                 Py_INCREF((<PyObject **> data)[0])
*/
      goto __pyx_L5;
    }

    /* "View.MemoryView":1289
 *                 Py_DECREF((<PyObject **> data)[0])
 *         else:
 *             refcount_objects_in_slice(data, shape + 1, strides + 1, ndim - 1, inc)             # <<<<<<<<<<<<<<
 * 
 *         data += stride
*/
    /*else*/ {
      __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
    }
    __pyx_L5:;

    /* "View.MemoryView":1291
 *             refcount_objects_in_slice(data, shape + 1, strides + 1, ndim - 1, inc)
 * 
 *         data += stride             # <<<<<<<<<<<<<<
 * 
 * 
*/
    __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
  }

  /* "View.MemoryView":1276
 *     refcount_objects_in_slice(data, shape, strides, ndim, inc)
 * 
 * @cname('__pyx_memoryview_refcount_objects_in_slice')             # <<<<<<<<<<<<<<
 * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape,
 *                                     Py_ssize_t *strides, int ndim, bint inc) noexcept:
*/

  /* function exit code */
}

/* "View.MemoryView":1296
 * 
 * 
 * @cname('__pyx_memoryview_slice_assign_scalar')             # <<<<<<<<<<<<<<
 * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim,
 *                               size_t itemsize, void *item,
*/

static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item, int __pyx_v_dtype_is_object) {

  /* "View.MemoryView":1300
 *                               size_t itemsize, void *item,
 *                               bint dtype_is_object) noexcept nogil:
 *     refcount_copying(dst, dtype_is_object, ndim, inc=False)             # <<<<<<<<<<<<<<
 *     _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, itemsize, item)
 *     refcount_copying(dst, dtype_is_object, ndim, inc=True)
*/
  __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);

  /* "View.MemoryView":1301
 *                               bint dtype_is_object) noexcept nogil:
 *     refcount_copying(dst, dtype_is_object, ndim, inc=False)
 *     _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, itemsize, item)             # <<<<<<<<<<<<<<
 *     refcount_copying(dst, dtype_is_object, ndim, inc=True)
 * 
*/
  __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item);

  /* "View.MemoryView":1302
 *     refcount_copying(dst, dtype_is_object, ndim, inc=False)
 *     _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, itemsize, item)
 *     refcount_copying(dst, dtype_is_object, ndim, inc=True)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);

  /* "View.MemoryView":1296
 * 
 * 
 * @cname('__pyx_memoryview_slice_assign_scalar')             # <<<<<<<<<<<<<<
 * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim,
 *                               size_t itemsize, void *item,
*/

  /* function exit code */
}

/* "View.MemoryView":1305
 * 
 * 
 * @cname('__pyx_memoryview__slice_assign_scalar')             # <<<<<<<<<<<<<<
 * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape,
 *                               Py_ssize_t *strides, int ndim,
*/

static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item) {
  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_stride;
  Py_ssize_t __pyx_v_extent;
  int __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  Py_ssize_t __pyx_t_4;

  /* "View.MemoryView":1310
 *                               size_t itemsize, void *item) noexcept nogil:
 *     cdef Py_ssize_t i
 *     cdef Py_ssize_t stride = strides[0]             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t extent = shape[0]
 * 
*/
  __pyx_v_stride = (__pyx_v_strides[0]);

  /* "View.MemoryView":1311
 *     cdef Py_ssize_t i
 *     cdef Py_ssize_t stride = strides[0]
 *     cdef Py_ssize_t extent = shape[0]             # <<<<<<<<<<<<<<
 * 
 *     if ndim == 1:
*/
  __pyx_v_extent = (__pyx_v_shape[0]);

  /* "View.MemoryView":1313
 *     cdef Py_ssize_t extent = shape[0]
 * 
 *     if ndim == 1:             # <<<<<<<<<<<<<<
 *         for i in range(extent):
 *             memcpy(data, item, itemsize)
*/
  __pyx_t_1 = (__pyx_v_ndim == 1);
  if (__pyx_t_1) {

    /* "View.MemoryView":1314
 * 
 *     if ndim == 1:
 *         for i in range(extent):             # <<<<<<<<<<<<<<
 *             memcpy(data, item, itemsize)
 *             data += stride
*/
    __pyx_t_2 = __pyx_v_extent;
    __pyx_t_3 = __pyx_t_2;
    for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
      __pyx_v_i = __pyx_t_4;

      /* "View.MemoryView":1315
 *     if ndim == 1:
 *         for i in range(extent):
 *             memcpy(data, item, itemsize)             # <<<<<<<<<<<<<<
 *             data += stride
 *     else:
*/
      (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));

      /* "View.MemoryView":1316
 *         for i in range(extent):
 *             memcpy(data, item, itemsize)
 *             data += stride             # <<<<<<<<<<<<<<
 *     else:
 *         for i in range(extent):
*/
      __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
    }

    /* "View.MemoryView":1313
 *     cdef Py_ssize_t extent = shape[0]
 * 
 *     if ndim == 1:             # <<<<<<<<<<<<<<
 *         for i in range(extent):
 *             memcpy(data, item, itemsize)
*/
    goto __pyx_L3;
  }

  /* "View.MemoryView":1318
 *             data += stride
 *     else:
 *         for i in range(extent):             # <<<<<<<<<<<<<<
 *             _slice_assign_scalar(data, shape + 1, strides + 1, ndim - 1, itemsize, item)
 *             data += stride
*/
  /*else*/ {
    __pyx_t_2 = __pyx_v_extent;
    __pyx_t_3 = __pyx_t_2;
    for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
      __pyx_v_i = __pyx_t_4;

      /* "View.MemoryView":1319
 *     else:
 *         for i in range(extent):
 *             _slice_assign_scalar(data, shape + 1, strides + 1, ndim - 1, itemsize, item)             # <<<<<<<<<<<<<<
 *             data += stride
 * 
*/
      __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item);

      /* "View.MemoryView":1320
 *         for i in range(extent):
 *             _slice_assign_scalar(data, shape + 1, strides + 1, ndim - 1, itemsize, item)
 *             data += stride             # <<<<<<<<<<<<<<
 * 
*/
      __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
    }
  }
  __pyx_L3:;

  /* "View.MemoryView":1305
 * 
 * 
 * @cname('__pyx_memoryview__slice_assign_scalar')             # <<<<<<<<<<<<<<
 * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape,
 *                               Py_ssize_t *strides, int ndim,
*/

  /* function exit code */
}

/* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x82a3537, 0x6ae9995, 0xb068931, b'name')
*/

/* Python wrapper */
static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum = {"__pyx_unpickle_Enum", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_type,&__pyx_mstate_global->__pyx_n_u_pyx_checksum,&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(7, 4, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(7, 4, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(7, 4, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(7, 4, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__pyx_unpickle_Enum", 0) < (0)) __PYX_ERR(7, 4, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, i); __PYX_ERR(7, 4, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(7, 4, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(7, 4, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(7, 4, __pyx_L3_error)
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyLong_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(7, 4, __pyx_L3_error)
    __pyx_v___pyx_state = ((PyObject*)values[2]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, __pyx_nargs); __PYX_ERR(7, 4, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v___pyx_state), (&PyTuple_Type), 1, "__pyx_state", 1))) __PYX_ERR(7, 4, __pyx_L1_error)
  __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

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

static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_v___pyx_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum", 0);

  /* "(tree fragment)":6
 * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, tuple __pyx_state):
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x82a3537, 0x6ae9995, 0xb068931, b'name')             # <<<<<<<<<<<<<<
 *     __pyx_result = Enum.__new__(__pyx_type)
 *     if __pyx_state is not None:
*/
  __pyx_t_1 = __Pyx_CheckUnpickleChecksum(__pyx_v___pyx_checksum, 0x82a3537, 0x6ae9995, 0xb068931, __pyx_k_name); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(7, 6, __pyx_L1_error)

  /* "(tree fragment)":7
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x82a3537, 0x6ae9995, 0xb068931, b'name')
 *     __pyx_result = Enum.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
*/
  __pyx_t_3 = ((PyObject *)__pyx_mstate_global->__pyx_MemviewEnum_type);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v___pyx_type};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_new, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 7, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v___pyx_result = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "(tree fragment)":8
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x82a3537, 0x6ae9995, 0xb068931, b'name')
 *     __pyx_result = Enum.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
 *     return __pyx_result
*/
  __pyx_t_5 = (__pyx_v___pyx_state != ((PyObject*)Py_None));
  if (__pyx_t_5) {

    /* "(tree fragment)":9
 *     __pyx_result = Enum.__new__(__pyx_type)
 *     if __pyx_state is not None:
 *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
 *     return __pyx_result
 * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, __pyx_state: tuple):
*/
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'");
      __PYX_ERR(7, 9, __pyx_L1_error)
    }
    __pyx_t_2 = __pyx_unpickle_Enum__set_state(((struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), __pyx_v___pyx_state); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "(tree fragment)":8
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x82a3537, 0x6ae9995, 0xb068931, b'name')
 *     __pyx_result = Enum.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
 *     return __pyx_result
*/
  }

  /* "(tree fragment)":10
 *     if __pyx_state is not None:
 *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
 *     return __pyx_result             # <<<<<<<<<<<<<<
 * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, __pyx_state: tuple):
 *     __pyx_result.name = __pyx_state[0]
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v___pyx_result);
  __pyx_r = __pyx_v___pyx_result;
  goto __pyx_L0;

  /* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x82a3537, 0x6ae9995, 0xb068931, b'name')
*/

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

/* "(tree fragment)":11
 *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, __pyx_state: tuple):             # <<<<<<<<<<<<<<
 *     __pyx_result.name = __pyx_state[0]
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 1)
*/

static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 0);

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, __pyx_state: tuple):
 *     __pyx_result.name = __pyx_state[0]             # <<<<<<<<<<<<<<
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 1)
*/
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); 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->name);
  __Pyx_DECREF(__pyx_v___pyx_result->name);
  __pyx_v___pyx_result->name = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "(tree fragment)":13
 * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, __pyx_state: tuple):
 *     __pyx_result.name = __pyx_state[0]
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 1)             # <<<<<<<<<<<<<<
*/
  __pyx_t_2 = __Pyx_UpdateUnpickledDict(((PyObject *)__pyx_v___pyx_result), __pyx_v___pyx_state, 1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(7, 13, __pyx_L1_error)

  /* "(tree fragment)":11
 *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, __pyx_state: tuple):             # <<<<<<<<<<<<<<
 *     __pyx_result.name = __pyx_state[0]
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 1)
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

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

  /* "cpython/complex.pxd":23
 *         @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API")
 *         cdef inline double real(self) noexcept:
 *             return self.cval.real             # <<<<<<<<<<<<<<
 * 
 *         # unavailable in limited API
*/
  __pyx_r = __pyx_v_self->cval.real;
  goto __pyx_L0;

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

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}
#endif /*!(#if !CYTHON_COMPILING_IN_LIMITED_API)*/

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

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

  /* "cpython/complex.pxd":29
 *         @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API")
 *         cdef inline double imag(self) noexcept:
 *             return self.cval.imag             # <<<<<<<<<<<<<<
 * 
 *     # PyTypeObject PyComplex_Type
*/
  __pyx_r = __pyx_v_self->cval.imag;
  goto __pyx_L0;

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

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}
#endif /*!(#if !CYTHON_COMPILING_IN_LIMITED_API)*/

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

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

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

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

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

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

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

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

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

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

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

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cpython.contextvars.get_value", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_pyvalue);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
#endif /*!(#if !CYTHON_COMPILING_IN_LIMITED_API)*/

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

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

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

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

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

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

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

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

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cpython.contextvars.get_value_no_default", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_pyvalue);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
#endif /*!(#if !CYTHON_COMPILING_IN_LIMITED_API)*/

/* "array.pxd":105
 *             arraydescr* ob_descr    # struct arraydescr *ob_descr;
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline __data_union data(self) noexcept nogil:
 *             return __Pyx_PyArray_Data(self)
*/

static CYTHON_INLINE __Pyx_data_union __pyx_f_7cpython_5array_5array_4data_data(arrayobject *__pyx_v_self) {
  __Pyx_data_union __pyx_r;

  /* "array.pxd":107
 *         @property
 *         cdef inline __data_union data(self) noexcept nogil:
 *             return __Pyx_PyArray_Data(self)             # <<<<<<<<<<<<<<
 * 
 *     array newarrayobject(PyTypeObject* type, Py_ssize_t size, arraydescr *descr)
*/
  __pyx_r = __Pyx_PyArray_Data(__pyx_v_self);
  goto __pyx_L0;

  /* "array.pxd":105
 *             arraydescr* ob_descr    # struct arraydescr *ob_descr;
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline __data_union data(self) noexcept nogil:
 *             return __Pyx_PyArray_Data(self)
*/

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

/* "array.pxd":119
 * 
 * 
 * cdef inline array clone(array template, Py_ssize_t length, bint zero):             # <<<<<<<<<<<<<<
 *     """ fast creation of a new array, given a template array.
 *     type will be same as template.
*/

static CYTHON_INLINE arrayobject *__pyx_f_7cpython_5array_clone(arrayobject *__pyx_v_template, Py_ssize_t __pyx_v_length, int __pyx_v_zero) {
  arrayobject *__pyx_v_op = 0;
  arrayobject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("clone", 0);

  /* "array.pxd":123
 *     type will be same as template.
 *     if zero is true, new array will be initialized with zeroes."""
 *     cdef array op = newarrayobject(Py_TYPE(template), length, template.ob_descr)             # <<<<<<<<<<<<<<
 *     if zero and op is not None:
 *         memset(op.data.as_chars, 0, length * op.ob_descr.itemsize)
*/
  __pyx_t_1 = ((PyObject *)newarrayobject(Py_TYPE(((PyObject *)__pyx_v_template)), __pyx_v_length, __pyx_v_template->ob_descr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 123, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_op = ((arrayobject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "array.pxd":124
 *     if zero is true, new array will be initialized with zeroes."""
 *     cdef array op = newarrayobject(Py_TYPE(template), length, template.ob_descr)
 *     if zero and op is not None:             # <<<<<<<<<<<<<<
 *         memset(op.data.as_chars, 0, length * op.ob_descr.itemsize)
 *     return op
*/
  if (__pyx_v_zero) {
  } else {
    __pyx_t_2 = __pyx_v_zero;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = (((PyObject *)__pyx_v_op) != Py_None);
  __pyx_t_2 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "array.pxd":125
 *     cdef array op = newarrayobject(Py_TYPE(template), length, template.ob_descr)
 *     if zero and op is not None:
 *         memset(op.data.as_chars, 0, length * op.ob_descr.itemsize)             # <<<<<<<<<<<<<<
 *     return op
 * 
*/
    (void)(memset(__pyx_f_7cpython_5array_5array_4data_data(__pyx_v_op).as_chars, 0, (__pyx_v_length * __pyx_v_op->ob_descr->itemsize)));

    /* "array.pxd":124
 *     if zero is true, new array will be initialized with zeroes."""
 *     cdef array op = newarrayobject(Py_TYPE(template), length, template.ob_descr)
 *     if zero and op is not None:             # <<<<<<<<<<<<<<
 *         memset(op.data.as_chars, 0, length * op.ob_descr.itemsize)
 *     return op
*/
  }

  /* "array.pxd":126
 *     if zero and op is not None:
 *         memset(op.data.as_chars, 0, length * op.ob_descr.itemsize)
 *     return op             # <<<<<<<<<<<<<<
 * 
 * cdef inline array copy(array self):
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_op);
  __pyx_r = __pyx_v_op;
  goto __pyx_L0;

  /* "array.pxd":119
 * 
 * 
 * cdef inline array clone(array template, Py_ssize_t length, bint zero):             # <<<<<<<<<<<<<<
 *     """ fast creation of a new array, given a template array.
 *     type will be same as template.
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cpython.array.clone", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_op);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "array.pxd":128
 *     return op
 * 
 * cdef inline array copy(array self):             # <<<<<<<<<<<<<<
 *     """ make a copy of an array. """
 *     cdef array op = newarrayobject(Py_TYPE(self), Py_SIZE(self), self.ob_descr)
*/

static CYTHON_INLINE arrayobject *__pyx_f_7cpython_5array_copy(arrayobject *__pyx_v_self) {
  arrayobject *__pyx_v_op = 0;
  arrayobject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("copy", 0);

  /* "array.pxd":130
 * cdef inline array copy(array self):
 *     """ make a copy of an array. """
 *     cdef array op = newarrayobject(Py_TYPE(self), Py_SIZE(self), self.ob_descr)             # <<<<<<<<<<<<<<
 *     memcpy(op.data.as_chars, self.data.as_chars, Py_SIZE(op) * op.ob_descr.itemsize)
 *     return op
*/
  __pyx_t_1 = ((PyObject *)newarrayobject(Py_TYPE(((PyObject *)__pyx_v_self)), Py_SIZE(((PyObject *)__pyx_v_self)), __pyx_v_self->ob_descr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 130, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_op = ((arrayobject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "array.pxd":131
 *     """ make a copy of an array. """
 *     cdef array op = newarrayobject(Py_TYPE(self), Py_SIZE(self), self.ob_descr)
 *     memcpy(op.data.as_chars, self.data.as_chars, Py_SIZE(op) * op.ob_descr.itemsize)             # <<<<<<<<<<<<<<
 *     return op
 * 
*/
  (void)(memcpy(__pyx_f_7cpython_5array_5array_4data_data(__pyx_v_op).as_chars, __pyx_f_7cpython_5array_5array_4data_data(__pyx_v_self).as_chars, (Py_SIZE(((PyObject *)__pyx_v_op)) * __pyx_v_op->ob_descr->itemsize)));

  /* "array.pxd":132
 *     cdef array op = newarrayobject(Py_TYPE(self), Py_SIZE(self), self.ob_descr)
 *     memcpy(op.data.as_chars, self.data.as_chars, Py_SIZE(op) * op.ob_descr.itemsize)
 *     return op             # <<<<<<<<<<<<<<
 * 
 * cdef inline int extend_buffer(array self, char* stuff, Py_ssize_t n) except -1:
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_op);
  __pyx_r = __pyx_v_op;
  goto __pyx_L0;

  /* "array.pxd":128
 *     return op
 * 
 * cdef inline array copy(array self):             # <<<<<<<<<<<<<<
 *     """ make a copy of an array. """
 *     cdef array op = newarrayobject(Py_TYPE(self), Py_SIZE(self), self.ob_descr)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cpython.array.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_op);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "array.pxd":134
 *     return op
 * 
 * cdef inline int extend_buffer(array self, char* stuff, Py_ssize_t n) except -1:             # <<<<<<<<<<<<<<
 *     """ efficient appending of new stuff of same type
 *     (e.g. of same array type)
*/

static CYTHON_INLINE int __pyx_f_7cpython_5array_extend_buffer(arrayobject *__pyx_v_self, char *__pyx_v_stuff, Py_ssize_t __pyx_v_n) {
  Py_ssize_t __pyx_v_itemsize;
  Py_ssize_t __pyx_v_origsize;
  int __pyx_r;
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "array.pxd":138
 *     (e.g. of same array type)
 *     n: number of elements (not number of bytes!) """
 *     cdef Py_ssize_t itemsize = self.ob_descr.itemsize             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t origsize = Py_SIZE(self)
 *     resize_smart(self, origsize + n)
*/
  __pyx_t_1 = __pyx_v_self->ob_descr->itemsize;
  __pyx_v_itemsize = __pyx_t_1;

  /* "array.pxd":139
 *     n: number of elements (not number of bytes!) """
 *     cdef Py_ssize_t itemsize = self.ob_descr.itemsize
 *     cdef Py_ssize_t origsize = Py_SIZE(self)             # <<<<<<<<<<<<<<
 *     resize_smart(self, origsize + n)
 *     memcpy(self.data.as_chars + origsize * itemsize, stuff, n * itemsize)
*/
  __pyx_v_origsize = Py_SIZE(((PyObject *)__pyx_v_self));

  /* "array.pxd":140
 *     cdef Py_ssize_t itemsize = self.ob_descr.itemsize
 *     cdef Py_ssize_t origsize = Py_SIZE(self)
 *     resize_smart(self, origsize + n)             # <<<<<<<<<<<<<<
 *     memcpy(self.data.as_chars + origsize * itemsize, stuff, n * itemsize)
 *     return 0
*/
  __pyx_t_1 = resize_smart(__pyx_v_self, (__pyx_v_origsize + __pyx_v_n)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(9, 140, __pyx_L1_error)

  /* "array.pxd":141
 *     cdef Py_ssize_t origsize = Py_SIZE(self)
 *     resize_smart(self, origsize + n)
 *     memcpy(self.data.as_chars + origsize * itemsize, stuff, n * itemsize)             # <<<<<<<<<<<<<<
 *     return 0
 * 
*/
  (void)(memcpy((__pyx_f_7cpython_5array_5array_4data_data(__pyx_v_self).as_chars + (__pyx_v_origsize * __pyx_v_itemsize)), __pyx_v_stuff, (__pyx_v_n * __pyx_v_itemsize)));

  /* "array.pxd":142
 *     resize_smart(self, origsize + n)
 *     memcpy(self.data.as_chars + origsize * itemsize, stuff, n * itemsize)
 *     return 0             # <<<<<<<<<<<<<<
 * 
 * cdef inline int extend(array self, array other) except -1:
*/
  __pyx_r = 0;
  goto __pyx_L0;

  /* "array.pxd":134
 *     return op
 * 
 * cdef inline int extend_buffer(array self, char* stuff, Py_ssize_t n) except -1:             # <<<<<<<<<<<<<<
 *     """ efficient appending of new stuff of same type
 *     (e.g. of same array type)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cpython.array.extend_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "array.pxd":144
 *     return 0
 * 
 * cdef inline int extend(array self, array other) except -1:             # <<<<<<<<<<<<<<
 *     """ extend array with data from another array; types must match. """
 *     if self.ob_descr.typecode != other.ob_descr.typecode:
*/

static CYTHON_INLINE int __pyx_f_7cpython_5array_extend(arrayobject *__pyx_v_self, arrayobject *__pyx_v_other) {
  int __pyx_r;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "array.pxd":146
 * cdef inline int extend(array self, array other) except -1:
 *     """ extend array with data from another array; types must match. """
 *     if self.ob_descr.typecode != other.ob_descr.typecode:             # <<<<<<<<<<<<<<
 *         PyErr_BadArgument()
 *     return extend_buffer(self, other.data.as_chars, Py_SIZE(other))
*/
  __pyx_t_1 = (__pyx_v_self->ob_descr->typecode_char != __pyx_v_other->ob_descr->typecode_char);
  if (__pyx_t_1) {

    /* "array.pxd":147
 *     """ extend array with data from another array; types must match. """
 *     if self.ob_descr.typecode != other.ob_descr.typecode:
 *         PyErr_BadArgument()             # <<<<<<<<<<<<<<
 *     return extend_buffer(self, other.data.as_chars, Py_SIZE(other))
 * 
*/
    __pyx_t_2 = PyErr_BadArgument(); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(9, 147, __pyx_L1_error)

    /* "array.pxd":146
 * cdef inline int extend(array self, array other) except -1:
 *     """ extend array with data from another array; types must match. """
 *     if self.ob_descr.typecode != other.ob_descr.typecode:             # <<<<<<<<<<<<<<
 *         PyErr_BadArgument()
 *     return extend_buffer(self, other.data.as_chars, Py_SIZE(other))
*/
  }

  /* "array.pxd":148
 *     if self.ob_descr.typecode != other.ob_descr.typecode:
 *         PyErr_BadArgument()
 *     return extend_buffer(self, other.data.as_chars, Py_SIZE(other))             # <<<<<<<<<<<<<<
 * 
 * cdef inline void zero(array self) noexcept:
*/
  __pyx_t_2 = __pyx_f_7cpython_5array_extend_buffer(__pyx_v_self, __pyx_f_7cpython_5array_5array_4data_data(__pyx_v_other).as_chars, Py_SIZE(((PyObject *)__pyx_v_other))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(9, 148, __pyx_L1_error)
  __pyx_r = __pyx_t_2;
  goto __pyx_L0;

  /* "array.pxd":144
 *     return 0
 * 
 * cdef inline int extend(array self, array other) except -1:             # <<<<<<<<<<<<<<
 *     """ extend array with data from another array; types must match. """
 *     if self.ob_descr.typecode != other.ob_descr.typecode:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cpython.array.extend", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "array.pxd":150
 *     return extend_buffer(self, other.data.as_chars, Py_SIZE(other))
 * 
 * cdef inline void zero(array self) noexcept:             # <<<<<<<<<<<<<<
 *     """ set all elements of array to zero. """
 *     memset(self.data.as_chars, 0, Py_SIZE(self) * self.ob_descr.itemsize)
*/

static CYTHON_INLINE void __pyx_f_7cpython_5array_zero(arrayobject *__pyx_v_self) {

  /* "array.pxd":152
 * cdef inline void zero(array self) noexcept:
 *     """ set all elements of array to zero. """
 *     memset(self.data.as_chars, 0, Py_SIZE(self) * self.ob_descr.itemsize)             # <<<<<<<<<<<<<<
*/
  (void)(memset(__pyx_f_7cpython_5array_5array_4data_data(__pyx_v_self).as_chars, 0, (Py_SIZE(((PyObject *)__pyx_v_self)) * __pyx_v_self->ob_descr->itemsize)));

  /* "array.pxd":150
 *     return extend_buffer(self, other.data.as_chars, Py_SIZE(other))
 * 
 * cdef inline void zero(array self) noexcept:             # <<<<<<<<<<<<<<
 *     """ set all elements of array to zero. """
 *     memset(self.data.as_chars, 0, Py_SIZE(self) * self.ob_descr.itemsize)
*/

  /* function exit code */
}

/* "opengl/common/string.pyx":1
 * def get_gl_string(string):             # <<<<<<<<<<<<<<
 *     cdef const char* str
 *     gl_string_enums = {
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_1get_gl_string(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_get_gl_string, "get_gl_string(string)");
static PyMethodDef __pyx_mdef_8CyOpenGL_1get_gl_string = {"get_gl_string", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_1get_gl_string, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_get_gl_string};
static PyObject *__pyx_pw_8CyOpenGL_1get_gl_string(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_string = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_gl_string (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_string,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(10, 1, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(10, 1, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "get_gl_string", 0) < (0)) __PYX_ERR(10, 1, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("get_gl_string", 1, 1, 1, i); __PYX_ERR(10, 1, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(10, 1, __pyx_L3_error)
    }
    __pyx_v_string = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_gl_string", 1, 1, 1, __pyx_nargs); __PYX_ERR(10, 1, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("CyOpenGL.get_gl_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_get_gl_string(__pyx_self, __pyx_v_string);

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

static PyObject *__pyx_pf_8CyOpenGL_get_gl_string(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_string) {
  char const *__pyx_v_str;
  PyObject *__pyx_v_gl_string_enums = NULL;
  PyObject *__pyx_7genexpr__pyx_v_k = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  size_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  GLenum __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_gl_string", 0);

  /* "opengl/common/string.pyx":4
 *     cdef const char* str
 *     gl_string_enums = {
 *         'GL_VENDOR': GL_VENDOR,             # <<<<<<<<<<<<<<
 *         'GL_RENDERER': GL_RENDERER,
 *         'GL_VERSION': GL_VERSION,
*/
  __pyx_t_1 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyLong_From___pyx_anon_enum(GL_VENDOR); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_GL_VENDOR, __pyx_t_2) < (0)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opengl/common/string.pyx":5
 *     gl_string_enums = {
 *         'GL_VENDOR': GL_VENDOR,
 *         'GL_RENDERER': GL_RENDERER,             # <<<<<<<<<<<<<<
 *         'GL_VERSION': GL_VERSION,
 *         'GL_EXTENSIONS': GL_EXTENSIONS,
*/
  __pyx_t_2 = __Pyx_PyLong_From___pyx_anon_enum(GL_RENDERER); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_GL_RENDERER, __pyx_t_2) < (0)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opengl/common/string.pyx":6
 *         'GL_VENDOR': GL_VENDOR,
 *         'GL_RENDERER': GL_RENDERER,
 *         'GL_VERSION': GL_VERSION,             # <<<<<<<<<<<<<<
 *         'GL_EXTENSIONS': GL_EXTENSIONS,
 *         'GL_SHADING_LANGUAGE_VERSION': GL_SHADING_LANGUAGE_VERSION}
*/
  __pyx_t_2 = __Pyx_PyLong_From___pyx_anon_enum(GL_VERSION); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_GL_VERSION, __pyx_t_2) < (0)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opengl/common/string.pyx":7
 *         'GL_RENDERER': GL_RENDERER,
 *         'GL_VERSION': GL_VERSION,
 *         'GL_EXTENSIONS': GL_EXTENSIONS,             # <<<<<<<<<<<<<<
 *         'GL_SHADING_LANGUAGE_VERSION': GL_SHADING_LANGUAGE_VERSION}
 *     if not glGetString(GL_VERSION):
*/
  __pyx_t_2 = __Pyx_PyLong_From___pyx_anon_enum(GL_EXTENSIONS); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_GL_EXTENSIONS, __pyx_t_2) < (0)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opengl/common/string.pyx":8
 *         'GL_VERSION': GL_VERSION,
 *         'GL_EXTENSIONS': GL_EXTENSIONS,
 *         'GL_SHADING_LANGUAGE_VERSION': GL_SHADING_LANGUAGE_VERSION}             # <<<<<<<<<<<<<<
 *     if not glGetString(GL_VERSION):
 *         raise RuntimeError(
*/
  __pyx_t_2 = __Pyx_PyLong_From___pyx_anon_enum(GL_SHADING_LANGUAGE_VERSION); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 8, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_GL_SHADING_LANGUAGE_VERSION, __pyx_t_2) < (0)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_gl_string_enums = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "opengl/common/string.pyx":9
 *         'GL_EXTENSIONS': GL_EXTENSIONS,
 *         'GL_SHADING_LANGUAGE_VERSION': GL_SHADING_LANGUAGE_VERSION}
 *     if not glGetString(GL_VERSION):             # <<<<<<<<<<<<<<
 *         raise RuntimeError(
 *             'GL strings not available - is there a current OpenGL context?')
*/
  __pyx_t_3 = (!(glGetString(GL_VERSION) != 0));
  if (unlikely(__pyx_t_3)) {

    /* "opengl/common/string.pyx":10
 *         'GL_SHADING_LANGUAGE_VERSION': GL_SHADING_LANGUAGE_VERSION}
 *     if not glGetString(GL_VERSION):
 *         raise RuntimeError(             # <<<<<<<<<<<<<<
 *             'GL strings not available - is there a current OpenGL context?')
 *     if string not in gl_string_enums:
*/
    __pyx_t_2 = NULL;
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_GL_strings_not_available_is_ther};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_RuntimeError)), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 10, __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, 10, __pyx_L1_error)

    /* "opengl/common/string.pyx":9
 *         'GL_EXTENSIONS': GL_EXTENSIONS,
 *         'GL_SHADING_LANGUAGE_VERSION': GL_SHADING_LANGUAGE_VERSION}
 *     if not glGetString(GL_VERSION):             # <<<<<<<<<<<<<<
 *         raise RuntimeError(
 *             'GL strings not available - is there a current OpenGL context?')
*/
  }

  /* "opengl/common/string.pyx":12
 *         raise RuntimeError(
 *             'GL strings not available - is there a current OpenGL context?')
 *     if string not in gl_string_enums:             # <<<<<<<<<<<<<<
 *         raise ValueError(
 *             "Invalid GL string. Must be one of %s." % ', '.join(
*/
  __pyx_t_3 = (__Pyx_PyDict_ContainsTF(__pyx_v_string, __pyx_v_gl_string_enums, Py_NE)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(10, 12, __pyx_L1_error)
  if (unlikely(__pyx_t_3)) {

    /* "opengl/common/string.pyx":13
 *             'GL strings not available - is there a current OpenGL context?')
 *     if string not in gl_string_enums:
 *         raise ValueError(             # <<<<<<<<<<<<<<
 *             "Invalid GL string. Must be one of %s." % ', '.join(
 *                 [ "'%s'" % k for k in sorted(gl_string_enums.keys()) ]))
*/
    __pyx_t_2 = NULL;

    /* "opengl/common/string.pyx":14
 *     if string not in gl_string_enums:
 *         raise ValueError(
 *             "Invalid GL string. Must be one of %s." % ', '.join(             # <<<<<<<<<<<<<<
 *                 [ "'%s'" % k for k in sorted(gl_string_enums.keys()) ]))
 *     str = <const char*>glGetString(gl_string_enums[string])
*/
    { /* enter inner scope */

      /* "opengl/common/string.pyx":15
 *         raise ValueError(
 *             "Invalid GL string. Must be one of %s." % ', '.join(
 *                 [ "'%s'" % k for k in sorted(gl_string_enums.keys()) ]))             # <<<<<<<<<<<<<<
 *     str = <const char*>glGetString(gl_string_enums[string])
 *     return str.decode('ascii') if str  else 'undefined'
*/
      __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(10, 15, __pyx_L7_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyDict_Keys(__pyx_v_gl_string_enums); if (unlikely(!__pyx_t_6)) __PYX_ERR(10, 15, __pyx_L7_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = PySequence_List(__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(10, 15, __pyx_L7_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely((PyList_Sort(__pyx_t_7) < 0))) __PYX_ERR(10, 15, __pyx_L7_error)
      __pyx_t_6 = __pyx_t_7; __Pyx_INCREF(__pyx_t_6);
      __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      for (;;) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_6);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(10, 15, __pyx_L7_error)
          #endif
          if (__pyx_t_8 >= __pyx_temp) break;
        }
        __pyx_t_7 = __Pyx_PyList_GetItemRefFast(__pyx_t_6, __pyx_t_8, __Pyx_ReferenceSharing_OwnStrongReference);
        ++__pyx_t_8;
        if (unlikely(!__pyx_t_7)) __PYX_ERR(10, 15, __pyx_L7_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_k, __pyx_t_7);
        __pyx_t_7 = 0;
        __pyx_t_7 = __Pyx_PyUnicode_FormatSafe(__pyx_mstate_global->__pyx_kp_u_s, __pyx_7genexpr__pyx_v_k); if (unlikely(!__pyx_t_7)) __PYX_ERR(10, 15, __pyx_L7_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_7))) __PYX_ERR(10, 15, __pyx_L7_error)
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_7genexpr__pyx_v_k); __pyx_7genexpr__pyx_v_k = 0;
      goto __pyx_L11_exit_scope;
      __pyx_L7_error:;
      __Pyx_XDECREF(__pyx_7genexpr__pyx_v_k); __pyx_7genexpr__pyx_v_k = 0;
      goto __pyx_L1_error;
      __pyx_L11_exit_scope:;
    } /* exit inner scope */

    /* "opengl/common/string.pyx":14
 *     if string not in gl_string_enums:
 *         raise ValueError(
 *             "Invalid GL string. Must be one of %s." % ', '.join(             # <<<<<<<<<<<<<<
 *                 [ "'%s'" % k for k in sorted(gl_string_enums.keys()) ]))
 *     str = <const char*>glGetString(gl_string_enums[string])
*/
    __pyx_t_6 = PyUnicode_Join(__pyx_mstate_global->__pyx_kp_u__6, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(10, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyUnicode_Format(__pyx_mstate_global->__pyx_kp_u_Invalid_GL_string_Must_be_one_of, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(10, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_5};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 13, __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, 13, __pyx_L1_error)

    /* "opengl/common/string.pyx":12
 *         raise RuntimeError(
 *             'GL strings not available - is there a current OpenGL context?')
 *     if string not in gl_string_enums:             # <<<<<<<<<<<<<<
 *         raise ValueError(
 *             "Invalid GL string. Must be one of %s." % ', '.join(
*/
  }

  /* "opengl/common/string.pyx":16
 *             "Invalid GL string. Must be one of %s." % ', '.join(
 *                 [ "'%s'" % k for k in sorted(gl_string_enums.keys()) ]))
 *     str = <const char*>glGetString(gl_string_enums[string])             # <<<<<<<<<<<<<<
 *     return str.decode('ascii') if str  else 'undefined'
*/
  __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_gl_string_enums, __pyx_v_string); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_9 = __Pyx_PyLong_As_GLenum(__pyx_t_1); if (unlikely((__pyx_t_9 == ((GLenum)-1)) && PyErr_Occurred())) __PYX_ERR(10, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_str = ((char const *)glGetString(__pyx_t_9));

  /* "opengl/common/string.pyx":17
 *                 [ "'%s'" % k for k in sorted(gl_string_enums.keys()) ]))
 *     str = <const char*>glGetString(gl_string_enums[string])
 *     return str.decode('ascii') if str  else 'undefined'             # <<<<<<<<<<<<<<
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = (__pyx_v_str != 0);
  if (__pyx_t_3) {
    __pyx_t_8 = __Pyx_ssize_strlen(__pyx_v_str); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(10, 17, __pyx_L1_error)
    __pyx_t_5 = __Pyx_decode_c_string(__pyx_v_str, 0, __pyx_t_8, NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_5)) __PYX_ERR(10, 17, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = __pyx_t_5;
    __pyx_t_5 = 0;
  } else {
    __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_undefined);
    __pyx_t_1 = __pyx_mstate_global->__pyx_n_u_undefined;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "opengl/common/string.pyx":1
 * def get_gl_string(string):             # <<<<<<<<<<<<<<
 *     cdef const char* str
 *     gl_string_enums = {
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("CyOpenGL.get_gl_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_gl_string_enums);
  __Pyx_XDECREF(__pyx_7genexpr__pyx_v_k);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opengl/common/error.pyx":1
 * def clear_gl_errors():             # <<<<<<<<<<<<<<
 *     """
 *     Clears any previous OpenGL errors.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_3clear_gl_errors(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_2clear_gl_errors, "clear_gl_errors()\n\nClears any previous OpenGL errors.");
static PyMethodDef __pyx_mdef_8CyOpenGL_3clear_gl_errors = {"clear_gl_errors", (PyCFunction)__pyx_pw_8CyOpenGL_3clear_gl_errors, METH_NOARGS, __pyx_doc_8CyOpenGL_2clear_gl_errors};
static PyObject *__pyx_pw_8CyOpenGL_3clear_gl_errors(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("clear_gl_errors (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_8CyOpenGL_2clear_gl_errors(__pyx_self);

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

static PyObject *__pyx_pf_8CyOpenGL_2clear_gl_errors(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("clear_gl_errors", 0);

  /* "opengl/common/error.pyx":6
 *     """
 * 
 *     while glGetError() != GL_NO_ERROR:             # <<<<<<<<<<<<<<
 *         pass
 * 
*/
  while (1) {
    __pyx_t_1 = (glGetError() != GL_NO_ERROR);
    if (!__pyx_t_1) break;
  }

  /* "opengl/common/error.pyx":1
 * def clear_gl_errors():             # <<<<<<<<<<<<<<
 *     """
 *     Clears any previous OpenGL errors.
*/

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

/* "opengl/common/error.pyx":9
 *         pass
 * 
 * def print_gl_errors(msg):             # <<<<<<<<<<<<<<
 *     """
 *     Prints all OpenGL errors using given message.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_5print_gl_errors(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_4print_gl_errors, "print_gl_errors(msg)\n\nPrints all OpenGL errors using given message.");
static PyMethodDef __pyx_mdef_8CyOpenGL_5print_gl_errors = {"print_gl_errors", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_5print_gl_errors, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_4print_gl_errors};
static PyObject *__pyx_pw_8CyOpenGL_5print_gl_errors(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_msg = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("print_gl_errors (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_msg,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 9, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 9, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "print_gl_errors", 0) < (0)) __PYX_ERR(1, 9, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("print_gl_errors", 1, 1, 1, i); __PYX_ERR(1, 9, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 9, __pyx_L3_error)
    }
    __pyx_v_msg = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("print_gl_errors", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 9, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("CyOpenGL.print_gl_errors", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_4print_gl_errors(__pyx_self, __pyx_v_msg);

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

static PyObject *__pyx_pf_8CyOpenGL_4print_gl_errors(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_msg) {
  PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_v_k = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5[4];
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("print_gl_errors", 0);

  /* "opengl/common/error.pyx":14
 *     """
 * 
 *     while True:             # <<<<<<<<<<<<<<
 *         err = glGetError()
 *         if err == GL_NO_ERROR:
*/
  while (1) {

    /* "opengl/common/error.pyx":15
 * 
 *     while True:
 *         err = glGetError()             # <<<<<<<<<<<<<<
 *         if err == GL_NO_ERROR:
 *             return
*/
    __pyx_t_1 = __Pyx_PyLong_From_GLenum(glGetError()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_err, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "opengl/common/error.pyx":16
 *     while True:
 *         err = glGetError()
 *         if err == GL_NO_ERROR:             # <<<<<<<<<<<<<<
 *             return
 *         if err == GL_INVALID_ENUM:
*/
    __pyx_t_1 = __Pyx_PyLong_From___pyx_anon_enum(GL_NO_ERROR); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 16, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_err, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 16, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 16, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_3) {

      /* "opengl/common/error.pyx":17
 *         err = glGetError()
 *         if err == GL_NO_ERROR:
 *             return             # <<<<<<<<<<<<<<
 *         if err == GL_INVALID_ENUM:
 *             k = "GL_INVALID_ENUM"
*/
      __Pyx_XDECREF(__pyx_r);
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L0;

      /* "opengl/common/error.pyx":16
 *     while True:
 *         err = glGetError()
 *         if err == GL_NO_ERROR:             # <<<<<<<<<<<<<<
 *             return
 *         if err == GL_INVALID_ENUM:
*/
    }

    /* "opengl/common/error.pyx":18
 *         if err == GL_NO_ERROR:
 *             return
 *         if err == GL_INVALID_ENUM:             # <<<<<<<<<<<<<<
 *             k = "GL_INVALID_ENUM"
 *         elif err == GL_INVALID_VALUE:
*/
    __pyx_t_2 = __Pyx_PyLong_From___pyx_anon_enum(GL_INVALID_ENUM); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 18, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_RichCompare(__pyx_v_err, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 18, __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(1, 18, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_3) {

      /* "opengl/common/error.pyx":19
 *             return
 *         if err == GL_INVALID_ENUM:
 *             k = "GL_INVALID_ENUM"             # <<<<<<<<<<<<<<
 *         elif err == GL_INVALID_VALUE:
 *             k = "GL_INVALID_VALUE"
*/
      __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_GL_INVALID_ENUM);
      __Pyx_XDECREF_SET(__pyx_v_k, __pyx_mstate_global->__pyx_n_u_GL_INVALID_ENUM);

      /* "opengl/common/error.pyx":18
 *         if err == GL_NO_ERROR:
 *             return
 *         if err == GL_INVALID_ENUM:             # <<<<<<<<<<<<<<
 *             k = "GL_INVALID_ENUM"
 *         elif err == GL_INVALID_VALUE:
*/
      goto __pyx_L6;
    }

    /* "opengl/common/error.pyx":20
 *         if err == GL_INVALID_ENUM:
 *             k = "GL_INVALID_ENUM"
 *         elif err == GL_INVALID_VALUE:             # <<<<<<<<<<<<<<
 *             k = "GL_INVALID_VALUE"
 *         elif err == GL_INVALID_OPERATION:
*/
    __pyx_t_1 = __Pyx_PyLong_From___pyx_anon_enum(GL_INVALID_VALUE); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 20, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_err, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 20, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 20, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_3) {

      /* "opengl/common/error.pyx":21
 *             k = "GL_INVALID_ENUM"
 *         elif err == GL_INVALID_VALUE:
 *             k = "GL_INVALID_VALUE"             # <<<<<<<<<<<<<<
 *         elif err == GL_INVALID_OPERATION:
 *             k = "GL_INVALID_OPERATION"
*/
      __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_GL_INVALID_VALUE);
      __Pyx_XDECREF_SET(__pyx_v_k, __pyx_mstate_global->__pyx_n_u_GL_INVALID_VALUE);

      /* "opengl/common/error.pyx":20
 *         if err == GL_INVALID_ENUM:
 *             k = "GL_INVALID_ENUM"
 *         elif err == GL_INVALID_VALUE:             # <<<<<<<<<<<<<<
 *             k = "GL_INVALID_VALUE"
 *         elif err == GL_INVALID_OPERATION:
*/
      goto __pyx_L6;
    }

    /* "opengl/common/error.pyx":22
 *         elif err == GL_INVALID_VALUE:
 *             k = "GL_INVALID_VALUE"
 *         elif err == GL_INVALID_OPERATION:             # <<<<<<<<<<<<<<
 *             k = "GL_INVALID_OPERATION"
 *         elif err == GL_INVALID_FRAMEBUFFER_OPERATION:
*/
    __pyx_t_2 = __Pyx_PyLong_From___pyx_anon_enum(GL_INVALID_OPERATION); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 22, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_RichCompare(__pyx_v_err, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 22, __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(1, 22, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_3) {

      /* "opengl/common/error.pyx":23
 *             k = "GL_INVALID_VALUE"
 *         elif err == GL_INVALID_OPERATION:
 *             k = "GL_INVALID_OPERATION"             # <<<<<<<<<<<<<<
 *         elif err == GL_INVALID_FRAMEBUFFER_OPERATION:
 *             k = "GL_INVALID_FRAMEBUFFER_OPERATION"
*/
      __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_GL_INVALID_OPERATION);
      __Pyx_XDECREF_SET(__pyx_v_k, __pyx_mstate_global->__pyx_n_u_GL_INVALID_OPERATION);

      /* "opengl/common/error.pyx":22
 *         elif err == GL_INVALID_VALUE:
 *             k = "GL_INVALID_VALUE"
 *         elif err == GL_INVALID_OPERATION:             # <<<<<<<<<<<<<<
 *             k = "GL_INVALID_OPERATION"
 *         elif err == GL_INVALID_FRAMEBUFFER_OPERATION:
*/
      goto __pyx_L6;
    }

    /* "opengl/common/error.pyx":24
 *         elif err == GL_INVALID_OPERATION:
 *             k = "GL_INVALID_OPERATION"
 *         elif err == GL_INVALID_FRAMEBUFFER_OPERATION:             # <<<<<<<<<<<<<<
 *             k = "GL_INVALID_FRAMEBUFFER_OPERATION"
 *         else:
*/
    __pyx_t_1 = __Pyx_PyLong_From___pyx_anon_enum(GL_INVALID_FRAMEBUFFER_OPERATION); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 24, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_err, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 24, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 24, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_3) {

      /* "opengl/common/error.pyx":25
 *             k = "GL_INVALID_OPERATION"
 *         elif err == GL_INVALID_FRAMEBUFFER_OPERATION:
 *             k = "GL_INVALID_FRAMEBUFFER_OPERATION"             # <<<<<<<<<<<<<<
 *         else:
 *             k = "GL_ENUM 0x%x" % err
*/
      __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_GL_INVALID_FRAMEBUFFER_OPERATION);
      __Pyx_XDECREF_SET(__pyx_v_k, __pyx_mstate_global->__pyx_n_u_GL_INVALID_FRAMEBUFFER_OPERATION);

      /* "opengl/common/error.pyx":24
 *         elif err == GL_INVALID_OPERATION:
 *             k = "GL_INVALID_OPERATION"
 *         elif err == GL_INVALID_FRAMEBUFFER_OPERATION:             # <<<<<<<<<<<<<<
 *             k = "GL_INVALID_FRAMEBUFFER_OPERATION"
 *         else:
*/
      goto __pyx_L6;
    }

    /* "opengl/common/error.pyx":27
 *             k = "GL_INVALID_FRAMEBUFFER_OPERATION"
 *         else:
 *             k = "GL_ENUM 0x%x" % err             # <<<<<<<<<<<<<<
 *         print("Error %s in %s" % (k, msg))
*/
    /*else*/ {
      __pyx_t_2 = __Pyx_PyUnicode_FormatSafe(__pyx_mstate_global->__pyx_kp_u_GL_ENUM_0x_x, __pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 27, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_XDECREF_SET(__pyx_v_k, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;
    }
    __pyx_L6:;

    /* "opengl/common/error.pyx":28
 *         else:
 *             k = "GL_ENUM 0x%x" % err
 *         print("Error %s in %s" % (k, msg))             # <<<<<<<<<<<<<<
*/
    __pyx_t_1 = NULL;
    __pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_v_msg), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 28, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5[0] = __pyx_mstate_global->__pyx_kp_u_Error;
    __pyx_t_5[1] = __pyx_v_k;
    __pyx_t_5[2] = __pyx_mstate_global->__pyx_kp_u_in;
    __pyx_t_5[3] = __pyx_t_4;
    __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_5, 4, 6 + __Pyx_PyUnicode_GET_LENGTH(__pyx_v_k) + 4 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_k) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4));
    if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 28, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_7 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_6};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_print, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 28, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }

  /* "opengl/common/error.pyx":9
 *         pass
 * 
 * def print_gl_errors(msg):             # <<<<<<<<<<<<<<
 *     """
 *     Prints all OpenGL errors using given message.
*/

  /* 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_6);
  __Pyx_AddTraceback("CyOpenGL.print_gl_errors", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XDECREF(__pyx_v_k);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opengl/vector3.pyx":9
 *     cdef readonly double x, y, z, norm_squared, norm
 * 
 *     def __cinit__(self, triple):             # <<<<<<<<<<<<<<
 *         self.x, self.y, self.z = triple
 *         self.norm_squared = self.x*self.x + self.y*self.y + self.z*self.z
*/

/* Python wrapper */
static int __pyx_pw_8CyOpenGL_7vector3_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_8CyOpenGL_7vector3_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_triple = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_triple,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(11, 9, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(11, 9, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__cinit__", 0) < (0)) __PYX_ERR(11, 9, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, i); __PYX_ERR(11, 9, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(11, 9, __pyx_L3_error)
    }
    __pyx_v_triple = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, __pyx_nargs); __PYX_ERR(11, 9, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("CyOpenGL.vector3.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_7vector3___cinit__(((struct __pyx_obj_8CyOpenGL_vector3 *)__pyx_v_self), __pyx_v_triple);

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

static int __pyx_pf_8CyOpenGL_7vector3___cinit__(struct __pyx_obj_8CyOpenGL_vector3 *__pyx_v_self, PyObject *__pyx_v_triple) {
  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)(PyObject *);
  double __pyx_t_6;
  double __pyx_t_7;
  double __pyx_t_8;
  size_t __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "opengl/vector3.pyx":10
 * 
 *     def __cinit__(self, triple):
 *         self.x, self.y, self.z = triple             # <<<<<<<<<<<<<<
 *         self.norm_squared = self.x*self.x + self.y*self.y + self.z*self.z
 *         self.norm = sqrt(self.norm_squared)
*/
  if ((likely(PyTuple_CheckExact(__pyx_v_triple))) || (PyList_CheckExact(__pyx_v_triple))) {
    PyObject* sequence = __pyx_v_triple;
    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(11, 10, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_3);
    } else {
      __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 10, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 10, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 10, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_3);
    }
    #else
    __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 10, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 10, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 10, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_v_triple); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 10, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4);
    index = 0; __pyx_t_1 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    index = 1; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 2; __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), 3) < (0)) __PYX_ERR(11, 10, __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, 10, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  __pyx_t_6 = __Pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(11, 10, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_7 = __Pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) __PYX_ERR(11, 10, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_8 = __Pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(11, 10, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_self->x = __pyx_t_6;
  __pyx_v_self->y = __pyx_t_7;
  __pyx_v_self->z = __pyx_t_8;

  /* "opengl/vector3.pyx":11
 *     def __cinit__(self, triple):
 *         self.x, self.y, self.z = triple
 *         self.norm_squared = self.x*self.x + self.y*self.y + self.z*self.z             # <<<<<<<<<<<<<<
 *         self.norm = sqrt(self.norm_squared)
 * 
*/
  __pyx_v_self->norm_squared = (((__pyx_v_self->x * __pyx_v_self->x) + (__pyx_v_self->y * __pyx_v_self->y)) + (__pyx_v_self->z * __pyx_v_self->z));

  /* "opengl/vector3.pyx":12
 *         self.x, self.y, self.z = triple
 *         self.norm_squared = self.x*self.x + self.y*self.y + self.z*self.z
 *         self.norm = sqrt(self.norm_squared)             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_sqrt); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyFloat_FromDouble(__pyx_v_self->norm_squared); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_9 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_1, __pyx__function);
    __pyx_t_9 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_4};
    __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_1, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 12, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_8 = __Pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(11, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_self->norm = __pyx_t_8;

  /* "opengl/vector3.pyx":9
 *     cdef readonly double x, y, z, norm_squared, norm
 * 
 *     def __cinit__(self, triple):             # <<<<<<<<<<<<<<
 *         self.x, self.y, self.z = triple
 *         self.norm_squared = self.x*self.x + self.y*self.y + self.z*self.z
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("CyOpenGL.vector3.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opengl/vector3.pyx":14
 *         self.norm = sqrt(self.norm_squared)
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         """
 *         >>> vector3( (0, 1, 2) )
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_7vector3_3__repr__(PyObject *__pyx_v_self); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_7vector3_2__repr__, "vector3.__repr__(self)\n\n>>> vector3( (0, 1, 2) )\n< 0.0, 1.0, 2.0 >");
#if CYTHON_UPDATE_DESCRIPTOR_DOC
struct wrapperbase __pyx_wrapperbase_8CyOpenGL_7vector3_2__repr__;
#endif
static PyObject *__pyx_pw_8CyOpenGL_7vector3_3__repr__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_8CyOpenGL_7vector3_2__repr__(((struct __pyx_obj_8CyOpenGL_vector3 *)__pyx_v_self));

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

static PyObject *__pyx_pf_8CyOpenGL_7vector3_2__repr__(struct __pyx_obj_8CyOpenGL_vector3 *__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[7];
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "opengl/vector3.pyx":19
 *         < 0.0, 1.0, 2.0 >
 *         """
 *         return '< %s, %s, %s >'%(self.x, self.y, self.z)             # <<<<<<<<<<<<<<
 * 
 *     def __add__(self, vector):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->x); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_1), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->y); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_1), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->z); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_1), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5[0] = __pyx_mstate_global->__pyx_kp_u__7;
  __pyx_t_5[1] = __pyx_t_2;
  __pyx_t_5[2] = __pyx_mstate_global->__pyx_kp_u__6;
  __pyx_t_5[3] = __pyx_t_3;
  __pyx_t_5[4] = __pyx_mstate_global->__pyx_kp_u__6;
  __pyx_t_5[5] = __pyx_t_4;
  __pyx_t_5[6] = __pyx_mstate_global->__pyx_kp_u__8;
  __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_5, 7, 2 * 4 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4));
  if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "opengl/vector3.pyx":14
 *         self.norm = sqrt(self.norm_squared)
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         """
 *         >>> vector3( (0, 1, 2) )
*/

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

/* "opengl/vector3.pyx":21
 *         return '< %s, %s, %s >'%(self.x, self.y, self.z)
 * 
 *     def __add__(self, vector):             # <<<<<<<<<<<<<<
 *         return vector3([self.x+vector.x, self.y+vector.y, self.z+vector.z])
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_7vector3_5__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_vector); /*proto*/
static PyObject *__pyx_pw_8CyOpenGL_7vector3_5__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_vector) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__add__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_8CyOpenGL_7vector3_4__add__(((struct __pyx_obj_8CyOpenGL_vector3 *)__pyx_v_self), ((PyObject *)__pyx_v_vector));

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

static PyObject *__pyx_pf_8CyOpenGL_7vector3_4__add__(struct __pyx_obj_8CyOpenGL_vector3 *__pyx_v_self, PyObject *__pyx_v_vector) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  size_t __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__add__", 0);

  /* "opengl/vector3.pyx":22
 * 
 *     def __add__(self, vector):
 *         return vector3([self.x+vector.x, self.y+vector.y, self.z+vector.z])             # <<<<<<<<<<<<<<
 * 
 *     def __sub__(self, vector):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->x); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_vector, __pyx_mstate_global->__pyx_n_u_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyNumber_Add(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 22, __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 = PyFloat_FromDouble(__pyx_v_self->y); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_vector, __pyx_mstate_global->__pyx_n_u_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = PyNumber_Add(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(11, 22, __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 = PyFloat_FromDouble(__pyx_v_self->z); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_vector, __pyx_mstate_global->__pyx_n_u_z); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = PyNumber_Add(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(11, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyList_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_5) != (0)) __PYX_ERR(11, 22, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_t_6) != (0)) __PYX_ERR(11, 22, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_7);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 2, __pyx_t_7) != (0)) __PYX_ERR(11, 22, __pyx_L1_error);
  __pyx_t_5 = 0;
  __pyx_t_6 = 0;
  __pyx_t_7 = 0;
  __pyx_t_8 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8CyOpenGL_vector3, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 22, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_r = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "opengl/vector3.pyx":21
 *         return '< %s, %s, %s >'%(self.x, self.y, self.z)
 * 
 *     def __add__(self, vector):             # <<<<<<<<<<<<<<
 *         return vector3([self.x+vector.x, self.y+vector.y, self.z+vector.z])
 * 
*/

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

/* "opengl/vector3.pyx":24
 *         return vector3([self.x+vector.x, self.y+vector.y, self.z+vector.z])
 * 
 *     def __sub__(self, vector):             # <<<<<<<<<<<<<<
 *         return vector3([self.x-vector.x, self.y-vector.y, self.z-vector.z])
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_7vector3_7__sub__(PyObject *__pyx_v_self, PyObject *__pyx_v_vector); /*proto*/
static PyObject *__pyx_pw_8CyOpenGL_7vector3_7__sub__(PyObject *__pyx_v_self, PyObject *__pyx_v_vector) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__sub__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_8CyOpenGL_7vector3_6__sub__(((struct __pyx_obj_8CyOpenGL_vector3 *)__pyx_v_self), ((PyObject *)__pyx_v_vector));

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

static PyObject *__pyx_pf_8CyOpenGL_7vector3_6__sub__(struct __pyx_obj_8CyOpenGL_vector3 *__pyx_v_self, PyObject *__pyx_v_vector) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  size_t __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__sub__", 0);

  /* "opengl/vector3.pyx":25
 * 
 *     def __sub__(self, vector):
 *         return vector3([self.x-vector.x, self.y-vector.y, self.z-vector.z])             # <<<<<<<<<<<<<<
 * 
 *     def __mul__(self, scalar):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->x); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_vector, __pyx_mstate_global->__pyx_n_u_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyNumber_Subtract(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 25, __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 = PyFloat_FromDouble(__pyx_v_self->y); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_vector, __pyx_mstate_global->__pyx_n_u_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = PyNumber_Subtract(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(11, 25, __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 = PyFloat_FromDouble(__pyx_v_self->z); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_vector, __pyx_mstate_global->__pyx_n_u_z); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = PyNumber_Subtract(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(11, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyList_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_5) != (0)) __PYX_ERR(11, 25, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_t_6) != (0)) __PYX_ERR(11, 25, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_7);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 2, __pyx_t_7) != (0)) __PYX_ERR(11, 25, __pyx_L1_error);
  __pyx_t_5 = 0;
  __pyx_t_6 = 0;
  __pyx_t_7 = 0;
  __pyx_t_8 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8CyOpenGL_vector3, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 25, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_r = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "opengl/vector3.pyx":24
 *         return vector3([self.x+vector.x, self.y+vector.y, self.z+vector.z])
 * 
 *     def __sub__(self, vector):             # <<<<<<<<<<<<<<
 *         return vector3([self.x-vector.x, self.y-vector.y, self.z-vector.z])
 * 
*/

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

/* "opengl/vector3.pyx":27
 *         return vector3([self.x-vector.x, self.y-vector.y, self.z-vector.z])
 * 
 *     def __mul__(self, scalar):             # <<<<<<<<<<<<<<
 *         return vector3([self.x*scalar, self.y*scalar, self.z*scalar])
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_7vector3_9__mul__(PyObject *__pyx_v_self, PyObject *__pyx_v_scalar); /*proto*/
static PyObject *__pyx_pw_8CyOpenGL_7vector3_9__mul__(PyObject *__pyx_v_self, PyObject *__pyx_v_scalar) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__mul__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_8CyOpenGL_7vector3_8__mul__(((struct __pyx_obj_8CyOpenGL_vector3 *)__pyx_v_self), ((PyObject *)__pyx_v_scalar));

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

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

  /* "opengl/vector3.pyx":28
 * 
 *     def __mul__(self, scalar):
 *         return vector3([self.x*scalar, self.y*scalar, self.z*scalar])             # <<<<<<<<<<<<<<
 * 
 *     def __div__(self, scalar):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->x); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyNumber_Multiply(__pyx_t_3, __pyx_v_scalar); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->y); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = PyNumber_Multiply(__pyx_t_3, __pyx_v_scalar); if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->z); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = PyNumber_Multiply(__pyx_t_3, __pyx_v_scalar); if (unlikely(!__pyx_t_6)) __PYX_ERR(11, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_4) != (0)) __PYX_ERR(11, 28, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_5) != (0)) __PYX_ERR(11, 28, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 2, __pyx_t_6) != (0)) __PYX_ERR(11, 28, __pyx_L1_error);
  __pyx_t_4 = 0;
  __pyx_t_5 = 0;
  __pyx_t_6 = 0;
  __pyx_t_7 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8CyOpenGL_vector3, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 28, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_r = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "opengl/vector3.pyx":27
 *         return vector3([self.x-vector.x, self.y-vector.y, self.z-vector.z])
 * 
 *     def __mul__(self, scalar):             # <<<<<<<<<<<<<<
 *         return vector3([self.x*scalar, self.y*scalar, self.z*scalar])
 * 
*/

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

/* "opengl/vector3.pyx":30
 *         return vector3([self.x*scalar, self.y*scalar, self.z*scalar])
 * 
 *     def __div__(self, scalar):             # <<<<<<<<<<<<<<
 *         return vector3([self.x/scalar, self.y/scalar, self.z/scalar])
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_7vector3_11__div__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_7vector3_10__div__, "vector3.__div__(self, scalar)");
static PyMethodDef __pyx_mdef_8CyOpenGL_7vector3_11__div__ = {"__div__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_7vector3_11__div__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_7vector3_10__div__};
static PyObject *__pyx_pw_8CyOpenGL_7vector3_11__div__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_scalar = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__div__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_scalar,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(11, 30, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(11, 30, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__div__", 0) < (0)) __PYX_ERR(11, 30, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__div__", 1, 1, 1, i); __PYX_ERR(11, 30, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(11, 30, __pyx_L3_error)
    }
    __pyx_v_scalar = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__div__", 1, 1, 1, __pyx_nargs); __PYX_ERR(11, 30, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("CyOpenGL.vector3.__div__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_7vector3_10__div__(((struct __pyx_obj_8CyOpenGL_vector3 *)__pyx_v_self), __pyx_v_scalar);

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

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

  /* "opengl/vector3.pyx":31
 * 
 *     def __div__(self, scalar):
 *         return vector3([self.x/scalar, self.y/scalar, self.z/scalar])             # <<<<<<<<<<<<<<
 * 
 *     def __truediv__(self, scalar):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->x); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_v_scalar); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->y); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_v_scalar); if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->z); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_v_scalar); if (unlikely(!__pyx_t_6)) __PYX_ERR(11, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_4) != (0)) __PYX_ERR(11, 31, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_5) != (0)) __PYX_ERR(11, 31, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 2, __pyx_t_6) != (0)) __PYX_ERR(11, 31, __pyx_L1_error);
  __pyx_t_4 = 0;
  __pyx_t_5 = 0;
  __pyx_t_6 = 0;
  __pyx_t_7 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8CyOpenGL_vector3, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 31, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_r = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "opengl/vector3.pyx":30
 *         return vector3([self.x*scalar, self.y*scalar, self.z*scalar])
 * 
 *     def __div__(self, scalar):             # <<<<<<<<<<<<<<
 *         return vector3([self.x/scalar, self.y/scalar, self.z/scalar])
 * 
*/

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

/* "opengl/vector3.pyx":33
 *         return vector3([self.x/scalar, self.y/scalar, self.z/scalar])
 * 
 *     def __truediv__(self, scalar):             # <<<<<<<<<<<<<<
 *         return vector3([self.x/scalar, self.y/scalar, self.z/scalar])
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_7vector3_13__truediv__(PyObject *__pyx_v_self, PyObject *__pyx_v_scalar); /*proto*/
static PyObject *__pyx_pw_8CyOpenGL_7vector3_13__truediv__(PyObject *__pyx_v_self, PyObject *__pyx_v_scalar) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__truediv__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_8CyOpenGL_7vector3_12__truediv__(((struct __pyx_obj_8CyOpenGL_vector3 *)__pyx_v_self), ((PyObject *)__pyx_v_scalar));

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

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

  /* "opengl/vector3.pyx":34
 * 
 *     def __truediv__(self, scalar):
 *         return vector3([self.x/scalar, self.y/scalar, self.z/scalar])             # <<<<<<<<<<<<<<
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->x); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_v_scalar); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->y); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_v_scalar); if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->z); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_v_scalar); if (unlikely(!__pyx_t_6)) __PYX_ERR(11, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_4) != (0)) __PYX_ERR(11, 34, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_5) != (0)) __PYX_ERR(11, 34, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 2, __pyx_t_6) != (0)) __PYX_ERR(11, 34, __pyx_L1_error);
  __pyx_t_4 = 0;
  __pyx_t_5 = 0;
  __pyx_t_6 = 0;
  __pyx_t_7 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8CyOpenGL_vector3, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 34, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_r = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "opengl/vector3.pyx":33
 *         return vector3([self.x/scalar, self.y/scalar, self.z/scalar])
 * 
 *     def __truediv__(self, scalar):             # <<<<<<<<<<<<<<
 *         return vector3([self.x/scalar, self.y/scalar, self.z/scalar])
*/

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

/* "opengl/vector3.pyx":7
 *     Attributes include its norm and the square of its norm.
 *     """
 *     cdef readonly double x, y, z, norm_squared, norm             # <<<<<<<<<<<<<<
 * 
 *     def __cinit__(self, triple):
*/

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

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

static PyObject *__pyx_pf_8CyOpenGL_7vector3_1x___get__(struct __pyx_obj_8CyOpenGL_vector3 *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->x); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

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

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

static PyObject *__pyx_pf_8CyOpenGL_7vector3_1y___get__(struct __pyx_obj_8CyOpenGL_vector3 *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->y); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

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

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

static PyObject *__pyx_pf_8CyOpenGL_7vector3_1z___get__(struct __pyx_obj_8CyOpenGL_vector3 *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->z); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

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

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

static PyObject *__pyx_pf_8CyOpenGL_7vector3_12norm_squared___get__(struct __pyx_obj_8CyOpenGL_vector3 *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->norm_squared); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

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

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

static PyObject *__pyx_pf_8CyOpenGL_7vector3_4norm___get__(struct __pyx_obj_8CyOpenGL_vector3 *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->norm); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "opengl/legacy/lighting.pyx":1
 * def cyglSetStandardLighting():             # <<<<<<<<<<<<<<
 *     """
 *     Sets up our default OpenGL environment.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_7cyglSetStandardLighting(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_6cyglSetStandardLighting, "cyglSetStandardLighting()\n\nSets up our default OpenGL environment.");
static PyMethodDef __pyx_mdef_8CyOpenGL_7cyglSetStandardLighting = {"cyglSetStandardLighting", (PyCFunction)__pyx_pw_8CyOpenGL_7cyglSetStandardLighting, METH_NOARGS, __pyx_doc_8CyOpenGL_6cyglSetStandardLighting};
static PyObject *__pyx_pw_8CyOpenGL_7cyglSetStandardLighting(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cyglSetStandardLighting (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_8CyOpenGL_6cyglSetStandardLighting(__pyx_self);

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

static PyObject *__pyx_pf_8CyOpenGL_6cyglSetStandardLighting(CYTHON_UNUSED PyObject *__pyx_self) {
  GLfloat *__pyx_v_ambient;
  GLfloat *__pyx_v_lightdiffuse;
  GLfloat *__pyx_v_lightspecular;
  GLfloat *__pyx_v_lightposition0;
  GLfloat *__pyx_v_lightposition1;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  GLfloat __pyx_t_1[4];
  GLfloat __pyx_t_2[4];
  GLfloat __pyx_t_3[4];
  GLfloat __pyx_t_4[4];
  GLfloat __pyx_t_5[4];
  __Pyx_RefNannySetupContext("cyglSetStandardLighting", 0);

  /* "opengl/legacy/lighting.pyx":7
 * 
 *     # Lighting intensities and location
 *     cdef GLfloat* ambient = [0.75, 0.75, 0.75, 1.0]             # <<<<<<<<<<<<<<
 *     cdef GLfloat* lightdiffuse = [0.8, 0.8, 0.8, 1.0]
 *     cdef GLfloat* lightspecular = [0.3, 0.3, 0.3, 1.0]
*/
  __pyx_t_1[0] = 0.75;
  __pyx_t_1[1] = 0.75;
  __pyx_t_1[2] = 0.75;
  __pyx_t_1[3] = 1.0;
  __pyx_v_ambient = __pyx_t_1;

  /* "opengl/legacy/lighting.pyx":8
 *     # Lighting intensities and location
 *     cdef GLfloat* ambient = [0.75, 0.75, 0.75, 1.0]
 *     cdef GLfloat* lightdiffuse = [0.8, 0.8, 0.8, 1.0]             # <<<<<<<<<<<<<<
 *     cdef GLfloat* lightspecular = [0.3, 0.3, 0.3, 1.0]
 *     # 2 units from the center, up and to the right
*/
  __pyx_t_2[0] = 0.8;
  __pyx_t_2[1] = 0.8;
  __pyx_t_2[2] = 0.8;
  __pyx_t_2[3] = 1.0;
  __pyx_v_lightdiffuse = __pyx_t_2;

  /* "opengl/legacy/lighting.pyx":9
 *     cdef GLfloat* ambient = [0.75, 0.75, 0.75, 1.0]
 *     cdef GLfloat* lightdiffuse = [0.8, 0.8, 0.8, 1.0]
 *     cdef GLfloat* lightspecular = [0.3, 0.3, 0.3, 1.0]             # <<<<<<<<<<<<<<
 *     # 2 units from the center, up and to the right
 *     # we should be able to control the light
*/
  __pyx_t_3[0] = 0.3;
  __pyx_t_3[1] = 0.3;
  __pyx_t_3[2] = 0.3;
  __pyx_t_3[3] = 1.0;
  __pyx_v_lightspecular = __pyx_t_3;

  /* "opengl/legacy/lighting.pyx":12
 *     # 2 units from the center, up and to the right
 *     # we should be able to control the light
 *     cdef GLfloat* lightposition0 = [0.3, 0.5, 3.0, 1.0]             # <<<<<<<<<<<<<<
 *     cdef GLfloat* lightposition1 = [0.3, -0.5, -3.0, 1.0]
 * 
*/
  __pyx_t_4[0] = 0.3;
  __pyx_t_4[1] = 0.5;
  __pyx_t_4[2] = 3.0;
  __pyx_t_4[3] = 1.0;
  __pyx_v_lightposition0 = __pyx_t_4;

  /* "opengl/legacy/lighting.pyx":13
 *     # we should be able to control the light
 *     cdef GLfloat* lightposition0 = [0.3, 0.5, 3.0, 1.0]
 *     cdef GLfloat* lightposition1 = [0.3, -0.5, -3.0, 1.0]             # <<<<<<<<<<<<<<
 * 
 *     ## Set parameters that apply to all objects:
*/
  __pyx_t_5[0] = 0.3;
  __pyx_t_5[1] = -0.5;
  __pyx_t_5[2] = -3.0;
  __pyx_t_5[3] = 1.0;
  __pyx_v_lightposition1 = __pyx_t_5;

  /* "opengl/legacy/lighting.pyx":17
 *     ## Set parameters that apply to all objects:
 *     # Remove hidden stuff
 *     glEnable(GL_DEPTH_TEST)             # <<<<<<<<<<<<<<
 *     # Allow transparency
 *     # glEnable(GL_ALPHA_TEST)
*/
  glEnable(GL_DEPTH_TEST);

  /* "opengl/legacy/lighting.pyx":20
 *     # Allow transparency
 *     # glEnable(GL_ALPHA_TEST)
 *     glEnable(GL_BLEND)             # <<<<<<<<<<<<<<
 *     glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)
 *     # Enable anti-aliasing of points lines and polygons
*/
  glEnable(GL_BLEND);

  /* "opengl/legacy/lighting.pyx":21
 *     # glEnable(GL_ALPHA_TEST)
 *     glEnable(GL_BLEND)
 *     glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)             # <<<<<<<<<<<<<<
 *     # Enable anti-aliasing of points lines and polygons
 *     glEnable(GL_POINT_SMOOTH)
*/
  glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

  /* "opengl/legacy/lighting.pyx":23
 *     glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)
 *     # Enable anti-aliasing of points lines and polygons
 *     glEnable(GL_POINT_SMOOTH)             # <<<<<<<<<<<<<<
 *     glEnable(GL_LINE_SMOOTH)
 *     #Below call is deprecated and causes odd behavior on some systems.
*/
  glEnable(GL_POINT_SMOOTH);

  /* "opengl/legacy/lighting.pyx":24
 *     # Enable anti-aliasing of points lines and polygons
 *     glEnable(GL_POINT_SMOOTH)
 *     glEnable(GL_LINE_SMOOTH)             # <<<<<<<<<<<<<<
 *     #Below call is deprecated and causes odd behavior on some systems.
 *     #glEnable(GL_POLYGON_SMOOTH)
*/
  glEnable(GL_LINE_SMOOTH);

  /* "opengl/legacy/lighting.pyx":28
 *     #glEnable(GL_POLYGON_SMOOTH)
 *     # Use lights and materials to determine colors
 *     glEnable(GL_LIGHTING)             # <<<<<<<<<<<<<<
 *     # Make the Color command control ambient and diffuse material colors
 *     glColorMaterial(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE)
*/
  glEnable(GL_LIGHTING);

  /* "opengl/legacy/lighting.pyx":30
 *     glEnable(GL_LIGHTING)
 *     # Make the Color command control ambient and diffuse material colors
 *     glColorMaterial(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE)             # <<<<<<<<<<<<<<
 *     glEnable(GL_COLOR_MATERIAL)
 *     # Use interpolated shading (although colors are constant on faces)
*/
  glColorMaterial(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE);

  /* "opengl/legacy/lighting.pyx":31
 *     # Make the Color command control ambient and diffuse material colors
 *     glColorMaterial(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE)
 *     glEnable(GL_COLOR_MATERIAL)             # <<<<<<<<<<<<<<
 *     # Use interpolated shading (although colors are constant on faces)
 *     glShadeModel(GL_SMOOTH)
*/
  glEnable(GL_COLOR_MATERIAL);

  /* "opengl/legacy/lighting.pyx":33
 *     glEnable(GL_COLOR_MATERIAL)
 *     # Use interpolated shading (although colors are constant on faces)
 *     glShadeModel(GL_SMOOTH)             # <<<<<<<<<<<<<<
 *     # Define the counter-clockwise (outer) face to be the front.
 *     glFrontFace(GL_CCW)
*/
  glShadeModel(GL_SMOOTH);

  /* "opengl/legacy/lighting.pyx":35
 *     glShadeModel(GL_SMOOTH)
 *     # Define the counter-clockwise (outer) face to be the front.
 *     glFrontFace(GL_CCW)             # <<<<<<<<<<<<<<
 *     # Rasterize front and back Faces
 *     glDisable(GL_CULL_FACE)
*/
  glFrontFace(GL_CCW);

  /* "opengl/legacy/lighting.pyx":37
 *     glFrontFace(GL_CCW)
 *     # Rasterize front and back Faces
 *     glDisable(GL_CULL_FACE)             # <<<<<<<<<<<<<<
 *     ## Set up lighting
 *     # Allow different properties on fronts and backs
*/
  glDisable(GL_CULL_FACE);

  /* "opengl/legacy/lighting.pyx":40
 *     ## Set up lighting
 *     # Allow different properties on fronts and backs
 *     glLightModelf(GL_LIGHT_MODEL_TWO_SIDE, 1.0)             # <<<<<<<<<<<<<<
 *     # Compute specular reflections from the eye
 *     glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, True)
*/
  glLightModelf(GL_LIGHT_MODEL_TWO_SIDE, 1.0);

  /* "opengl/legacy/lighting.pyx":42
 *     glLightModelf(GL_LIGHT_MODEL_TWO_SIDE, 1.0)
 *     # Compute specular reflections from the eye
 *     glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, True)             # <<<<<<<<<<<<<<
 *     # Ambient light intensity for the entire scene
 *     glLightModelfv(GL_LIGHT_MODEL_AMBIENT, ambient)
*/
  glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, 1);

  /* "opengl/legacy/lighting.pyx":44
 *     glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, True)
 *     # Ambient light intensity for the entire scene
 *     glLightModelfv(GL_LIGHT_MODEL_AMBIENT, ambient)             # <<<<<<<<<<<<<<
 *     # Enable two lights, with attenuation
 *     glEnable(GL_LIGHT0)
*/
  glLightModelfv(GL_LIGHT_MODEL_AMBIENT, __pyx_v_ambient);

  /* "opengl/legacy/lighting.pyx":46
 *     glLightModelfv(GL_LIGHT_MODEL_AMBIENT, ambient)
 *     # Enable two lights, with attenuation
 *     glEnable(GL_LIGHT0)             # <<<<<<<<<<<<<<
 *     glLightfv(GL_LIGHT0, GL_POSITION, lightposition0)
 *     glLightfv(GL_LIGHT0, GL_DIFFUSE, lightdiffuse)
*/
  glEnable(GL_LIGHT0);

  /* "opengl/legacy/lighting.pyx":47
 *     # Enable two lights, with attenuation
 *     glEnable(GL_LIGHT0)
 *     glLightfv(GL_LIGHT0, GL_POSITION, lightposition0)             # <<<<<<<<<<<<<<
 *     glLightfv(GL_LIGHT0, GL_DIFFUSE, lightdiffuse)
 *     glLightfv(GL_LIGHT0, GL_SPECULAR, lightspecular)
*/
  glLightfv(GL_LIGHT0, GL_POSITION, __pyx_v_lightposition0);

  /* "opengl/legacy/lighting.pyx":48
 *     glEnable(GL_LIGHT0)
 *     glLightfv(GL_LIGHT0, GL_POSITION, lightposition0)
 *     glLightfv(GL_LIGHT0, GL_DIFFUSE, lightdiffuse)             # <<<<<<<<<<<<<<
 *     glLightfv(GL_LIGHT0, GL_SPECULAR, lightspecular)
 *     glLightf(GL_LIGHT0, GL_CONSTANT_ATTENUATION,  1.0)
*/
  glLightfv(GL_LIGHT0, GL_DIFFUSE, __pyx_v_lightdiffuse);

  /* "opengl/legacy/lighting.pyx":49
 *     glLightfv(GL_LIGHT0, GL_POSITION, lightposition0)
 *     glLightfv(GL_LIGHT0, GL_DIFFUSE, lightdiffuse)
 *     glLightfv(GL_LIGHT0, GL_SPECULAR, lightspecular)             # <<<<<<<<<<<<<<
 *     glLightf(GL_LIGHT0, GL_CONSTANT_ATTENUATION,  1.0)
 *     glLightf(GL_LIGHT0, GL_LINEAR_ATTENUATION, 0.1)
*/
  glLightfv(GL_LIGHT0, GL_SPECULAR, __pyx_v_lightspecular);

  /* "opengl/legacy/lighting.pyx":50
 *     glLightfv(GL_LIGHT0, GL_DIFFUSE, lightdiffuse)
 *     glLightfv(GL_LIGHT0, GL_SPECULAR, lightspecular)
 *     glLightf(GL_LIGHT0, GL_CONSTANT_ATTENUATION,  1.0)             # <<<<<<<<<<<<<<
 *     glLightf(GL_LIGHT0, GL_LINEAR_ATTENUATION, 0.1)
 *     glLightf(GL_LIGHT0, GL_QUADRATIC_ATTENUATION, 0.08)
*/
  glLightf(GL_LIGHT0, GL_CONSTANT_ATTENUATION, 1.0);

  /* "opengl/legacy/lighting.pyx":51
 *     glLightfv(GL_LIGHT0, GL_SPECULAR, lightspecular)
 *     glLightf(GL_LIGHT0, GL_CONSTANT_ATTENUATION,  1.0)
 *     glLightf(GL_LIGHT0, GL_LINEAR_ATTENUATION, 0.1)             # <<<<<<<<<<<<<<
 *     glLightf(GL_LIGHT0, GL_QUADRATIC_ATTENUATION, 0.08)
 *     glDisable(GL_LIGHT1)
*/
  glLightf(GL_LIGHT0, GL_LINEAR_ATTENUATION, 0.1);

  /* "opengl/legacy/lighting.pyx":52
 *     glLightf(GL_LIGHT0, GL_CONSTANT_ATTENUATION,  1.0)
 *     glLightf(GL_LIGHT0, GL_LINEAR_ATTENUATION, 0.1)
 *     glLightf(GL_LIGHT0, GL_QUADRATIC_ATTENUATION, 0.08)             # <<<<<<<<<<<<<<
 *     glDisable(GL_LIGHT1)
 *     glLightfv(GL_LIGHT1, GL_POSITION, lightposition1)
*/
  glLightf(GL_LIGHT0, GL_QUADRATIC_ATTENUATION, 0.08);

  /* "opengl/legacy/lighting.pyx":53
 *     glLightf(GL_LIGHT0, GL_LINEAR_ATTENUATION, 0.1)
 *     glLightf(GL_LIGHT0, GL_QUADRATIC_ATTENUATION, 0.08)
 *     glDisable(GL_LIGHT1)             # <<<<<<<<<<<<<<
 *     glLightfv(GL_LIGHT1, GL_POSITION, lightposition1)
 *     glLightfv(GL_LIGHT1, GL_DIFFUSE, lightdiffuse)
*/
  glDisable(GL_LIGHT1);

  /* "opengl/legacy/lighting.pyx":54
 *     glLightf(GL_LIGHT0, GL_QUADRATIC_ATTENUATION, 0.08)
 *     glDisable(GL_LIGHT1)
 *     glLightfv(GL_LIGHT1, GL_POSITION, lightposition1)             # <<<<<<<<<<<<<<
 *     glLightfv(GL_LIGHT1, GL_DIFFUSE, lightdiffuse)
 *     glLightfv(GL_LIGHT1, GL_SPECULAR, lightspecular)
*/
  glLightfv(GL_LIGHT1, GL_POSITION, __pyx_v_lightposition1);

  /* "opengl/legacy/lighting.pyx":55
 *     glDisable(GL_LIGHT1)
 *     glLightfv(GL_LIGHT1, GL_POSITION, lightposition1)
 *     glLightfv(GL_LIGHT1, GL_DIFFUSE, lightdiffuse)             # <<<<<<<<<<<<<<
 *     glLightfv(GL_LIGHT1, GL_SPECULAR, lightspecular)
 *     glLightf(GL_LIGHT1, GL_CONSTANT_ATTENUATION,  1.0)
*/
  glLightfv(GL_LIGHT1, GL_DIFFUSE, __pyx_v_lightdiffuse);

  /* "opengl/legacy/lighting.pyx":56
 *     glLightfv(GL_LIGHT1, GL_POSITION, lightposition1)
 *     glLightfv(GL_LIGHT1, GL_DIFFUSE, lightdiffuse)
 *     glLightfv(GL_LIGHT1, GL_SPECULAR, lightspecular)             # <<<<<<<<<<<<<<
 *     glLightf(GL_LIGHT1, GL_CONSTANT_ATTENUATION,  1.0)
 *     glLightf(GL_LIGHT1, GL_LINEAR_ATTENUATION, 0.1)
*/
  glLightfv(GL_LIGHT1, GL_SPECULAR, __pyx_v_lightspecular);

  /* "opengl/legacy/lighting.pyx":57
 *     glLightfv(GL_LIGHT1, GL_DIFFUSE, lightdiffuse)
 *     glLightfv(GL_LIGHT1, GL_SPECULAR, lightspecular)
 *     glLightf(GL_LIGHT1, GL_CONSTANT_ATTENUATION,  1.0)             # <<<<<<<<<<<<<<
 *     glLightf(GL_LIGHT1, GL_LINEAR_ATTENUATION, 0.1)
 *     glLightf(GL_LIGHT1, GL_QUADRATIC_ATTENUATION, 0.08)
*/
  glLightf(GL_LIGHT1, GL_CONSTANT_ATTENUATION, 1.0);

  /* "opengl/legacy/lighting.pyx":58
 *     glLightfv(GL_LIGHT1, GL_SPECULAR, lightspecular)
 *     glLightf(GL_LIGHT1, GL_CONSTANT_ATTENUATION,  1.0)
 *     glLightf(GL_LIGHT1, GL_LINEAR_ATTENUATION, 0.1)             # <<<<<<<<<<<<<<
 *     glLightf(GL_LIGHT1, GL_QUADRATIC_ATTENUATION, 0.08)
 *     # Use the Model View Matrix
*/
  glLightf(GL_LIGHT1, GL_LINEAR_ATTENUATION, 0.1);

  /* "opengl/legacy/lighting.pyx":59
 *     glLightf(GL_LIGHT1, GL_CONSTANT_ATTENUATION,  1.0)
 *     glLightf(GL_LIGHT1, GL_LINEAR_ATTENUATION, 0.1)
 *     glLightf(GL_LIGHT1, GL_QUADRATIC_ATTENUATION, 0.08)             # <<<<<<<<<<<<<<
 *     # Use the Model View Matrix
 *     glMatrixMode(GL_MODELVIEW)
*/
  glLightf(GL_LIGHT1, GL_QUADRATIC_ATTENUATION, 0.08);

  /* "opengl/legacy/lighting.pyx":61
 *     glLightf(GL_LIGHT1, GL_QUADRATIC_ATTENUATION, 0.08)
 *     # Use the Model View Matrix
 *     glMatrixMode(GL_MODELVIEW)             # <<<<<<<<<<<<<<
 *     glLoadIdentity()
*/
  glMatrixMode(GL_MODELVIEW);

  /* "opengl/legacy/lighting.pyx":62
 *     # Use the Model View Matrix
 *     glMatrixMode(GL_MODELVIEW)
 *     glLoadIdentity()             # <<<<<<<<<<<<<<
*/
  glLoadIdentity();

  /* "opengl/legacy/lighting.pyx":1
 * def cyglSetStandardLighting():             # <<<<<<<<<<<<<<
 *     """
 *     Sets up our default OpenGL environment.
*/

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

/* "opengl/legacy/object.pyx":18
 *     cdef togl_widget
 * 
 *     def __cinit__(self, *args,             # <<<<<<<<<<<<<<
 *                   color = [0.8, 0.8, 0.8, 1.0],
 *                   front_specular = [0.8, 0.8, 0.8, 1.0],
*/

/* Python wrapper */
static int __pyx_pw_8CyOpenGL_8GLobject_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_8CyOpenGL_8GLobject_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_color = 0;
  PyObject *__pyx_v_front_specular = 0;
  PyObject *__pyx_v_back_specular = 0;
  PyObject *__pyx_v_front_shininess = 0;
  PyObject *__pyx_v_back_shininess = 0;
  CYTHON_UNUSED PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[5] = {0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1;
  __Pyx_GOTREF(__pyx_v_kwargs);
  __Pyx_INCREF(__pyx_args);
  __pyx_v_args = __pyx_args;
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_color,&__pyx_mstate_global->__pyx_n_u_front_specular,&__pyx_mstate_global->__pyx_n_u_back_specular,&__pyx_mstate_global->__pyx_n_u_front_shininess,&__pyx_mstate_global->__pyx_n_u_back_shininess,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(12, 18, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        default:
        case  0: break;
      }
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, __pyx_v_kwargs, values, 0, __pyx_kwds_len, "__cinit__", 1) < (0)) __PYX_ERR(12, 18, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(__pyx_mstate_global->__pyx_k__9);
      if (!values[1]) values[1] = __Pyx_NewRef(__pyx_mstate_global->__pyx_k__10);
      if (!values[2]) values[2] = __Pyx_NewRef(__pyx_mstate_global->__pyx_k__11);
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_float_0_0));
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_float_0_0));
    } else if (unlikely(__pyx_nargs < 0)) {
      goto __pyx_L5_argtuple_error;
    } else {
      if (!values[0]) values[0] = __Pyx_NewRef(__pyx_mstate_global->__pyx_k__9);
      if (!values[1]) values[1] = __Pyx_NewRef(__pyx_mstate_global->__pyx_k__10);
      if (!values[2]) values[2] = __Pyx_NewRef(__pyx_mstate_global->__pyx_k__11);
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_float_0_0));
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_float_0_0));
    }
    __pyx_v_color = values[0];
    __pyx_v_front_specular = values[1];
    __pyx_v_back_specular = values[2];
    __pyx_v_front_shininess = values[3];
    __pyx_v_back_shininess = values[4];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 0, __pyx_nargs); __PYX_ERR(12, 18, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("CyOpenGL.GLobject.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_8GLobject___cinit__(((struct __pyx_obj_8CyOpenGL_GLobject *)__pyx_v_self), __pyx_v_color, __pyx_v_front_specular, __pyx_v_back_specular, __pyx_v_front_shininess, __pyx_v_back_shininess, __pyx_v_args, __pyx_v_kwargs);

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

static int __pyx_pf_8CyOpenGL_8GLobject___cinit__(struct __pyx_obj_8CyOpenGL_GLobject *__pyx_v_self, PyObject *__pyx_v_color, PyObject *__pyx_v_front_specular, PyObject *__pyx_v_back_specular, PyObject *__pyx_v_front_shininess, PyObject *__pyx_v_back_shininess, CYTHON_UNUSED PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  int __pyx_v_n;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  GLfloat __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "opengl/legacy/object.pyx":26
 *                   **kwargs):
 *         cdef int n
 *         for n from 0 <= n < 4:             # <<<<<<<<<<<<<<
 *             self.color[n] = color[n]
 *             self.front_specular[n] = front_specular[n]
*/
  for (__pyx_v_n = 0; __pyx_v_n < 4; __pyx_v_n++) {

    /* "opengl/legacy/object.pyx":27
 *         cdef int n
 *         for n from 0 <= n < 4:
 *             self.color[n] = color[n]             # <<<<<<<<<<<<<<
 *             self.front_specular[n] = front_specular[n]
 *             self.back_specular[n] = back_specular[n]
*/
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_color, __pyx_v_n, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 27, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_2 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(12, 27, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    (__pyx_v_self->color[__pyx_v_n]) = __pyx_t_2;

    /* "opengl/legacy/object.pyx":28
 *         for n from 0 <= n < 4:
 *             self.color[n] = color[n]
 *             self.front_specular[n] = front_specular[n]             # <<<<<<<<<<<<<<
 *             self.back_specular[n] = back_specular[n]
 *             self.emission[n] = 0.0
*/
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_front_specular, __pyx_v_n, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 28, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_2 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(12, 28, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    (__pyx_v_self->front_specular[__pyx_v_n]) = __pyx_t_2;

    /* "opengl/legacy/object.pyx":29
 *             self.color[n] = color[n]
 *             self.front_specular[n] = front_specular[n]
 *             self.back_specular[n] = back_specular[n]             # <<<<<<<<<<<<<<
 *             self.emission[n] = 0.0
 *         self.front_shininess = front_shininess
*/
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_back_specular, __pyx_v_n, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 29, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_2 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(12, 29, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    (__pyx_v_self->back_specular[__pyx_v_n]) = __pyx_t_2;

    /* "opengl/legacy/object.pyx":30
 *             self.front_specular[n] = front_specular[n]
 *             self.back_specular[n] = back_specular[n]
 *             self.emission[n] = 0.0             # <<<<<<<<<<<<<<
 *         self.front_shininess = front_shininess
 *         self.back_shininess = back_shininess
*/
    (__pyx_v_self->emission[__pyx_v_n]) = 0.0;
  }

  /* "opengl/legacy/object.pyx":31
 *             self.back_specular[n] = back_specular[n]
 *             self.emission[n] = 0.0
 *         self.front_shininess = front_shininess             # <<<<<<<<<<<<<<
 *         self.back_shininess = back_shininess
 *         self.list_id = 0
*/
  __pyx_t_2 = __Pyx_PyFloat_AsFloat(__pyx_v_front_shininess); if (unlikely((__pyx_t_2 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(12, 31, __pyx_L1_error)
  __pyx_v_self->front_shininess = __pyx_t_2;

  /* "opengl/legacy/object.pyx":32
 *             self.emission[n] = 0.0
 *         self.front_shininess = front_shininess
 *         self.back_shininess = back_shininess             # <<<<<<<<<<<<<<
 *         self.list_id = 0
 *         self.togl_widget = kwargs.get('togl_widget', None)
*/
  __pyx_t_2 = __Pyx_PyFloat_AsFloat(__pyx_v_back_shininess); if (unlikely((__pyx_t_2 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(12, 32, __pyx_L1_error)
  __pyx_v_self->back_shininess = __pyx_t_2;

  /* "opengl/legacy/object.pyx":33
 *         self.front_shininess = front_shininess
 *         self.back_shininess = back_shininess
 *         self.list_id = 0             # <<<<<<<<<<<<<<
 *         self.togl_widget = kwargs.get('togl_widget', None)
 * 
*/
  __pyx_v_self->list_id = 0;

  /* "opengl/legacy/object.pyx":34
 *         self.back_shininess = back_shininess
 *         self.list_id = 0
 *         self.togl_widget = kwargs.get('togl_widget', None)             # <<<<<<<<<<<<<<
 * 
 *     def delete_resource(self):
*/
  __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_kwargs, __pyx_mstate_global->__pyx_n_u_togl_widget, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->togl_widget);
  __Pyx_DECREF(__pyx_v_self->togl_widget);
  __pyx_v_self->togl_widget = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "opengl/legacy/object.pyx":18
 *     cdef togl_widget
 * 
 *     def __cinit__(self, *args,             # <<<<<<<<<<<<<<
 *                   color = [0.8, 0.8, 0.8, 1.0],
 *                   front_specular = [0.8, 0.8, 0.8, 1.0],
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("CyOpenGL.GLobject.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opengl/legacy/object.pyx":36
 *         self.togl_widget = kwargs.get('togl_widget', None)
 * 
 *     def delete_resource(self):             # <<<<<<<<<<<<<<
 *         old_widget = RawOpenGLWidget.current_widget
 *         if self.togl_widget:
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_8GLobject_3delete_resource(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_8GLobject_2delete_resource, "GLobject.delete_resource(self)");
static PyMethodDef __pyx_mdef_8CyOpenGL_8GLobject_3delete_resource = {"delete_resource", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_8GLobject_3delete_resource, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_8GLobject_2delete_resource};
static PyObject *__pyx_pw_8CyOpenGL_8GLobject_3delete_resource(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("delete_resource (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("delete_resource", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("delete_resource", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8CyOpenGL_8GLobject_2delete_resource(((struct __pyx_obj_8CyOpenGL_GLobject *)__pyx_v_self));

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

static PyObject *__pyx_pf_8CyOpenGL_8GLobject_2delete_resource(struct __pyx_obj_8CyOpenGL_GLobject *__pyx_v_self) {
  PyObject *__pyx_v_old_widget = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  size_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("delete_resource", 0);

  /* "opengl/legacy/object.pyx":37
 * 
 *     def delete_resource(self):
 *         old_widget = RawOpenGLWidget.current_widget             # <<<<<<<<<<<<<<
 *         if self.togl_widget:
 *             self.togl_widget.make_current()
*/
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_RawOpenGLWidget); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_current_widget); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_old_widget = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "opengl/legacy/object.pyx":38
 *     def delete_resource(self):
 *         old_widget = RawOpenGLWidget.current_widget
 *         if self.togl_widget:             # <<<<<<<<<<<<<<
 *             self.togl_widget.make_current()
 *         if self.list_id and glIsList(self.list_id) == GL_TRUE:
*/
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_self->togl_widget); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(12, 38, __pyx_L1_error)
  if (__pyx_t_3) {

    /* "opengl/legacy/object.pyx":39
 *         old_widget = RawOpenGLWidget.current_widget
 *         if self.togl_widget:
 *             self.togl_widget.make_current()             # <<<<<<<<<<<<<<
 *         if self.list_id and glIsList(self.list_id) == GL_TRUE:
 *             glDeleteLists(self.list_id, 1)
*/
    __pyx_t_1 = __pyx_v_self->togl_widget;
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_make_current, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 39, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "opengl/legacy/object.pyx":38
 *     def delete_resource(self):
 *         old_widget = RawOpenGLWidget.current_widget
 *         if self.togl_widget:             # <<<<<<<<<<<<<<
 *             self.togl_widget.make_current()
 *         if self.list_id and glIsList(self.list_id) == GL_TRUE:
*/
  }

  /* "opengl/legacy/object.pyx":40
 *         if self.togl_widget:
 *             self.togl_widget.make_current()
 *         if self.list_id and glIsList(self.list_id) == GL_TRUE:             # <<<<<<<<<<<<<<
 *             glDeleteLists(self.list_id, 1)
 *         old_widget.make_current()
*/
  __pyx_t_5 = (__pyx_v_self->list_id != 0);
  if (__pyx_t_5) {
  } else {
    __pyx_t_3 = __pyx_t_5;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_5 = (glIsList(__pyx_v_self->list_id) == GL_TRUE);
  __pyx_t_3 = __pyx_t_5;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_3) {

    /* "opengl/legacy/object.pyx":41
 *             self.togl_widget.make_current()
 *         if self.list_id and glIsList(self.list_id) == GL_TRUE:
 *             glDeleteLists(self.list_id, 1)             # <<<<<<<<<<<<<<
 *         old_widget.make_current()
 * 
*/
    glDeleteLists(__pyx_v_self->list_id, 1);

    /* "opengl/legacy/object.pyx":40
 *         if self.togl_widget:
 *             self.togl_widget.make_current()
 *         if self.list_id and glIsList(self.list_id) == GL_TRUE:             # <<<<<<<<<<<<<<
 *             glDeleteLists(self.list_id, 1)
 *         old_widget.make_current()
*/
  }

  /* "opengl/legacy/object.pyx":42
 *         if self.list_id and glIsList(self.list_id) == GL_TRUE:
 *             glDeleteLists(self.list_id, 1)
 *         old_widget.make_current()             # <<<<<<<<<<<<<<
 * 
 *     cdef set_material(self):
*/
  __pyx_t_1 = __pyx_v_old_widget;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_make_current, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 42, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opengl/legacy/object.pyx":36
 *         self.togl_widget = kwargs.get('togl_widget', None)
 * 
 *     def delete_resource(self):             # <<<<<<<<<<<<<<
 *         old_widget = RawOpenGLWidget.current_widget
 *         if self.togl_widget:
*/

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

/* "opengl/legacy/object.pyx":44
 *         old_widget.make_current()
 * 
 *     cdef set_material(self):             # <<<<<<<<<<<<<<
 *         glMaterialfv(GL_FRONT, GL_SPECULAR, self.front_specular)
 *         glMaterialf(GL_FRONT, GL_SHININESS, self.front_shininess)
*/

static PyObject *__pyx_f_8CyOpenGL_8GLobject_set_material(struct __pyx_obj_8CyOpenGL_GLobject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_material", 0);

  /* "opengl/legacy/object.pyx":45
 * 
 *     cdef set_material(self):
 *         glMaterialfv(GL_FRONT, GL_SPECULAR, self.front_specular)             # <<<<<<<<<<<<<<
 *         glMaterialf(GL_FRONT, GL_SHININESS, self.front_shininess)
 *         glMaterialfv(GL_BACK,  GL_SPECULAR, self.back_specular)
*/
  glMaterialfv(GL_FRONT, GL_SPECULAR, __pyx_v_self->front_specular);

  /* "opengl/legacy/object.pyx":46
 *     cdef set_material(self):
 *         glMaterialfv(GL_FRONT, GL_SPECULAR, self.front_specular)
 *         glMaterialf(GL_FRONT, GL_SHININESS, self.front_shininess)             # <<<<<<<<<<<<<<
 *         glMaterialfv(GL_BACK,  GL_SPECULAR, self.back_specular)
 *         glMaterialf(GL_BACK,  GL_SHININESS, self.back_shininess)
*/
  glMaterialf(GL_FRONT, GL_SHININESS, __pyx_v_self->front_shininess);

  /* "opengl/legacy/object.pyx":47
 *         glMaterialfv(GL_FRONT, GL_SPECULAR, self.front_specular)
 *         glMaterialf(GL_FRONT, GL_SHININESS, self.front_shininess)
 *         glMaterialfv(GL_BACK,  GL_SPECULAR, self.back_specular)             # <<<<<<<<<<<<<<
 *         glMaterialf(GL_BACK,  GL_SHININESS, self.back_shininess)
 *         glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, self.emission)
*/
  glMaterialfv(GL_BACK, GL_SPECULAR, __pyx_v_self->back_specular);

  /* "opengl/legacy/object.pyx":48
 *         glMaterialf(GL_FRONT, GL_SHININESS, self.front_shininess)
 *         glMaterialfv(GL_BACK,  GL_SPECULAR, self.back_specular)
 *         glMaterialf(GL_BACK,  GL_SHININESS, self.back_shininess)             # <<<<<<<<<<<<<<
 *         glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, self.emission)
 *         glColor4fv(self.color)
*/
  glMaterialf(GL_BACK, GL_SHININESS, __pyx_v_self->back_shininess);

  /* "opengl/legacy/object.pyx":49
 *         glMaterialfv(GL_BACK,  GL_SPECULAR, self.back_specular)
 *         glMaterialf(GL_BACK,  GL_SHININESS, self.back_shininess)
 *         glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, self.emission)             # <<<<<<<<<<<<<<
 *         glColor4fv(self.color)
 * 
*/
  glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, __pyx_v_self->emission);

  /* "opengl/legacy/object.pyx":50
 *         glMaterialf(GL_BACK,  GL_SHININESS, self.back_shininess)
 *         glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, self.emission)
 *         glColor4fv(self.color)             # <<<<<<<<<<<<<<
 * 
 *     def draw(self, *args, **kwargs):
*/
  glColor4fv(__pyx_v_self->color);

  /* "opengl/legacy/object.pyx":44
 *         old_widget.make_current()
 * 
 *     cdef set_material(self):             # <<<<<<<<<<<<<<
 *         glMaterialfv(GL_FRONT, GL_SPECULAR, self.front_specular)
 *         glMaterialf(GL_FRONT, GL_SHININESS, self.front_shininess)
*/

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

/* "opengl/legacy/object.pyx":52
 *         glColor4fv(self.color)
 * 
 *     def draw(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         """
 *         Subclasses must override this.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_8GLobject_5draw(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_8GLobject_4draw, "GLobject.draw(self, *args, **kwargs)\n\nSubclasses must override this.\nIssue the OpenGL commands to draw this object.\nMake sure the GL calls are suitable for use in a display list.");
static PyMethodDef __pyx_mdef_8CyOpenGL_8GLobject_5draw = {"draw", (PyCFunction)(void(*)(void))(PyCFunctionWithKeywords)__pyx_pw_8CyOpenGL_8GLobject_5draw, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8CyOpenGL_8GLobject_4draw};
static PyObject *__pyx_pw_8CyOpenGL_8GLobject_5draw(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_args = 0;
  CYTHON_UNUSED PyObject *__pyx_v_kwargs = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("draw (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (__pyx_kwds_len > 0) {
    if (unlikely(__Pyx_CheckKeywordStrings("draw", __pyx_kwds) == -1)) return NULL;
  }
  __Pyx_INCREF(__pyx_args);
  __pyx_v_args = __pyx_args;
  __pyx_r = __pyx_pf_8CyOpenGL_8GLobject_4draw(((struct __pyx_obj_8CyOpenGL_GLobject *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_8CyOpenGL_8GLobject_4draw(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_GLobject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("draw", 0);

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

/* "opengl/legacy/object.pyx":59
 *         """
 * 
 *     def build_display_list(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         """
 *         Generate a display list containing the commands to draw this object.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_8GLobject_7build_display_list(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_8GLobject_6build_display_list, "GLobject.build_display_list(self, *args, **kwargs)\n\nGenerate a display list containing the commands to draw this object.\nThe arguments are passed to the object's draw method.");
static PyMethodDef __pyx_mdef_8CyOpenGL_8GLobject_7build_display_list = {"build_display_list", (PyCFunction)(void(*)(void))(PyCFunctionWithKeywords)__pyx_pw_8CyOpenGL_8GLobject_7build_display_list, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8CyOpenGL_8GLobject_6build_display_list};
static PyObject *__pyx_pw_8CyOpenGL_8GLobject_7build_display_list(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("build_display_list (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (__pyx_kwds_len > 0) {
    if (unlikely(__Pyx_CheckKeywordStrings("build_display_list", __pyx_kwds) == -1)) return NULL;
    __pyx_v_kwargs = __Pyx_KwargsAsDict_VARARGS(__pyx_kwds, __pyx_kwvalues);
    if (unlikely(!__pyx_v_kwargs)) return NULL;
    __Pyx_GOTREF(__pyx_v_kwargs);
  } else {
    __pyx_v_kwargs = PyDict_New();
    if (unlikely(!__pyx_v_kwargs)) return NULL;
    __Pyx_GOTREF(__pyx_v_kwargs);
  }
  __Pyx_INCREF(__pyx_args);
  __pyx_v_args = __pyx_args;
  __pyx_r = __pyx_pf_8CyOpenGL_8GLobject_6build_display_list(((struct __pyx_obj_8CyOpenGL_GLobject *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_8CyOpenGL_8GLobject_6build_display_list(struct __pyx_obj_8CyOpenGL_GLobject *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  GLuint __pyx_v_list_id;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  GLuint __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("build_display_list", 0);

  /* "opengl/legacy/object.pyx":64
 *         The arguments are passed to the object's draw method.
 *         """
 *         self.list_id = list_id = glGenLists(1)             # <<<<<<<<<<<<<<
 *         glNewList(list_id, GL_COMPILE)
 *         self.draw(*args, **kwargs)
*/
  __pyx_t_1 = glGenLists(1);
  __pyx_v_self->list_id = __pyx_t_1;
  __pyx_v_list_id = __pyx_t_1;

  /* "opengl/legacy/object.pyx":65
 *         """
 *         self.list_id = list_id = glGenLists(1)
 *         glNewList(list_id, GL_COMPILE)             # <<<<<<<<<<<<<<
 *         self.draw(*args, **kwargs)
 *         glEndList()
*/
  glNewList(__pyx_v_list_id, GL_COMPILE);

  /* "opengl/legacy/object.pyx":66
 *         self.list_id = list_id = glGenLists(1)
 *         glNewList(list_id, GL_COMPILE)
 *         self.draw(*args, **kwargs)             # <<<<<<<<<<<<<<
 *         glEndList()
 * 
*/
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_draw); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 66, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyDict_Copy(__pyx_v_kwargs); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 66, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_v_args, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 66, __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;

  /* "opengl/legacy/object.pyx":67
 *         glNewList(list_id, GL_COMPILE)
 *         self.draw(*args, **kwargs)
 *         glEndList()             # <<<<<<<<<<<<<<
 * 
 *     cpdef display(self):
*/
  glEndList();

  /* "opengl/legacy/object.pyx":59
 *         """
 * 
 *     def build_display_list(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         """
 *         Generate a display list containing the commands to draw this object.
*/

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

/* "opengl/legacy/object.pyx":69
 *         glEndList()
 * 
 *     cpdef display(self):             # <<<<<<<<<<<<<<
 *         if glIsList(self.list_id) == GL_TRUE:
 *             glCallList(self.list_id)
*/

static PyObject *__pyx_pw_8CyOpenGL_8GLobject_9display(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_f_8CyOpenGL_8GLobject_display(struct __pyx_obj_8CyOpenGL_GLobject *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("display", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_8CyOpenGL_GLobject &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 69, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_8CyOpenGL_8GLobject_9display)) {
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
          __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 69, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __pyx_r = __pyx_t_2;
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "opengl/legacy/object.pyx":70
 * 
 *     cpdef display(self):
 *         if glIsList(self.list_id) == GL_TRUE:             # <<<<<<<<<<<<<<
 *             glCallList(self.list_id)
*/
  __pyx_t_6 = (glIsList(__pyx_v_self->list_id) == GL_TRUE);
  if (__pyx_t_6) {

    /* "opengl/legacy/object.pyx":71
 *     cpdef display(self):
 *         if glIsList(self.list_id) == GL_TRUE:
 *             glCallList(self.list_id)             # <<<<<<<<<<<<<<
*/
    glCallList(__pyx_v_self->list_id);

    /* "opengl/legacy/object.pyx":70
 * 
 *     cpdef display(self):
 *         if glIsList(self.list_id) == GL_TRUE:             # <<<<<<<<<<<<<<
 *             glCallList(self.list_id)
*/
  }

  /* "opengl/legacy/object.pyx":69
 *         glEndList()
 * 
 *     cpdef display(self):             # <<<<<<<<<<<<<<
 *         if glIsList(self.list_id) == GL_TRUE:
 *             glCallList(self.list_id)
*/

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

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_8GLobject_9display(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_8GLobject_8display, "GLobject.display(self)");
static PyMethodDef __pyx_mdef_8CyOpenGL_8GLobject_9display = {"display", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_8GLobject_9display, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_8GLobject_8display};
static PyObject *__pyx_pw_8CyOpenGL_8GLobject_9display(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("display (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("display", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("display", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8CyOpenGL_8GLobject_8display(((struct __pyx_obj_8CyOpenGL_GLobject *)__pyx_v_self));

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

static PyObject *__pyx_pf_8CyOpenGL_8GLobject_8display(struct __pyx_obj_8CyOpenGL_GLobject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("display", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8CyOpenGL_8GLobject_display(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 69, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "opengl/legacy/wireframe_sphere.pyx":6
 *     """
 * 
 *     def draw(self, GLfloat radius, GLint slices, GLint stacks):             # <<<<<<<<<<<<<<
 *         assert slices % 2 == 0 and stacks % 2 == 0
 *         self.set_material()
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_15WireframeSphere_1draw(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_15WireframeSphere_draw, "WireframeSphere.draw(self, GLfloat radius, GLint slices, GLint stacks)");
static PyMethodDef __pyx_mdef_8CyOpenGL_15WireframeSphere_1draw = {"draw", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_15WireframeSphere_1draw, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_15WireframeSphere_draw};
static PyObject *__pyx_pw_8CyOpenGL_15WireframeSphere_1draw(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  GLfloat __pyx_v_radius;
  GLint __pyx_v_slices;
  GLint __pyx_v_stacks;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("draw (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_radius,&__pyx_mstate_global->__pyx_n_u_slices,&__pyx_mstate_global->__pyx_n_u_stacks,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(13, 6, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(13, 6, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(13, 6, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(13, 6, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "draw", 0) < (0)) __PYX_ERR(13, 6, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("draw", 1, 3, 3, i); __PYX_ERR(13, 6, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(13, 6, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(13, 6, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(13, 6, __pyx_L3_error)
    }
    __pyx_v_radius = __Pyx_PyFloat_AsFloat(values[0]); if (unlikely((__pyx_v_radius == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(13, 6, __pyx_L3_error)
    __pyx_v_slices = __Pyx_PyLong_As_GLint(values[1]); if (unlikely((__pyx_v_slices == ((GLint)-1)) && PyErr_Occurred())) __PYX_ERR(13, 6, __pyx_L3_error)
    __pyx_v_stacks = __Pyx_PyLong_As_GLint(values[2]); if (unlikely((__pyx_v_stacks == ((GLint)-1)) && PyErr_Occurred())) __PYX_ERR(13, 6, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("draw", 1, 3, 3, __pyx_nargs); __PYX_ERR(13, 6, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("CyOpenGL.WireframeSphere.draw", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_15WireframeSphere_draw(((struct __pyx_obj_8CyOpenGL_WireframeSphere *)__pyx_v_self), __pyx_v_radius, __pyx_v_slices, __pyx_v_stacks);

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

/* "opengl/legacy/wireframe_sphere.pyx":17
 *         dtheta = 2*pi/slices
 *         dphi = pi/stacks
 *         def draw_point(phi, theta):             # <<<<<<<<<<<<<<
 *             x, y, z = sin(phi)*sin(theta), sin(phi)*cos(theta), cos(phi)
 *             glNormal3f(x, y, z)
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_15WireframeSphere_4draw_1draw_point(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8CyOpenGL_15WireframeSphere_4draw_1draw_point = {"draw_point", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_15WireframeSphere_4draw_1draw_point, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8CyOpenGL_15WireframeSphere_4draw_1draw_point(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_phi = 0;
  PyObject *__pyx_v_theta = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("draw_point (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_phi,&__pyx_mstate_global->__pyx_n_u_theta,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(13, 17, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(13, 17, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(13, 17, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "draw_point", 0) < (0)) __PYX_ERR(13, 17, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("draw_point", 1, 2, 2, i); __PYX_ERR(13, 17, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(13, 17, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(13, 17, __pyx_L3_error)
    }
    __pyx_v_phi = values[0];
    __pyx_v_theta = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("draw_point", 1, 2, 2, __pyx_nargs); __PYX_ERR(13, 17, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("CyOpenGL.WireframeSphere.draw.draw_point", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_15WireframeSphere_4draw_draw_point(__pyx_self, __pyx_v_phi, __pyx_v_theta);

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

static PyObject *__pyx_pf_8CyOpenGL_15WireframeSphere_4draw_draw_point(PyObject *__pyx_self, PyObject *__pyx_v_phi, PyObject *__pyx_v_theta) {
  struct __pyx_obj_8CyOpenGL___pyx_scope_struct__draw *__pyx_cur_scope;
  struct __pyx_obj_8CyOpenGL___pyx_scope_struct__draw *__pyx_outer_scope;
  PyObject *__pyx_v_x = NULL;
  PyObject *__pyx_v_y = NULL;
  PyObject *__pyx_v_z = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  GLfloat __pyx_t_7;
  GLfloat __pyx_t_8;
  GLfloat __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("draw_point", 0);
  __pyx_outer_scope = (struct __pyx_obj_8CyOpenGL___pyx_scope_struct__draw *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "opengl/legacy/wireframe_sphere.pyx":18
 *         dphi = pi/stacks
 *         def draw_point(phi, theta):
 *             x, y, z = sin(phi)*sin(theta), sin(phi)*cos(theta), cos(phi)             # <<<<<<<<<<<<<<
 *             glNormal3f(x, y, z)
 *             glVertex3f(r*x, r*y, r*z)
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_sin); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_phi};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 18, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_sin); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_theta};
    __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 18, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_5 = PyNumber_Multiply(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_1 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_sin); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
    assert(__pyx_t_1);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
    __pyx_t_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_phi};
    __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 18, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_1 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_cos); if (unlikely(!__pyx_t_6)) __PYX_ERR(13, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_6);
    assert(__pyx_t_1);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
    __pyx_t_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_theta};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 18, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_t_6 = PyNumber_Multiply(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(13, 18, __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_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_cos); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_1, __pyx__function);
    __pyx_t_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_phi};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_1, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 18, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v_x = __pyx_t_5;
  __pyx_t_5 = 0;
  __pyx_v_y = __pyx_t_6;
  __pyx_t_6 = 0;
  __pyx_v_z = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "opengl/legacy/wireframe_sphere.pyx":19
 *         def draw_point(phi, theta):
 *             x, y, z = sin(phi)*sin(theta), sin(phi)*cos(theta), cos(phi)
 *             glNormal3f(x, y, z)             # <<<<<<<<<<<<<<
 *             glVertex3f(r*x, r*y, r*z)
 * 
*/
  __pyx_t_7 = __Pyx_PyFloat_AsFloat(__pyx_v_x); if (unlikely((__pyx_t_7 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(13, 19, __pyx_L1_error)
  __pyx_t_8 = __Pyx_PyFloat_AsFloat(__pyx_v_y); if (unlikely((__pyx_t_8 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(13, 19, __pyx_L1_error)
  __pyx_t_9 = __Pyx_PyFloat_AsFloat(__pyx_v_z); if (unlikely((__pyx_t_9 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(13, 19, __pyx_L1_error)
  glNormal3f(__pyx_t_7, __pyx_t_8, __pyx_t_9);

  /* "opengl/legacy/wireframe_sphere.pyx":20
 *             x, y, z = sin(phi)*sin(theta), sin(phi)*cos(theta), cos(phi)
 *             glNormal3f(x, y, z)
 *             glVertex3f(r*x, r*y, r*z)             # <<<<<<<<<<<<<<
 * 
 *         # Draw the longitudes
*/
  if (unlikely(!__pyx_cur_scope->__pyx_v_r)) { __Pyx_RaiseClosureNameError("r"); __PYX_ERR(13, 20, __pyx_L1_error) }
  __pyx_t_2 = PyNumber_Multiply(__pyx_cur_scope->__pyx_v_r, __pyx_v_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_9 = __Pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_9 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(13, 20, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_cur_scope->__pyx_v_r)) { __Pyx_RaiseClosureNameError("r"); __PYX_ERR(13, 20, __pyx_L1_error) }
  __pyx_t_2 = PyNumber_Multiply(__pyx_cur_scope->__pyx_v_r, __pyx_v_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_8 = __Pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_8 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(13, 20, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_cur_scope->__pyx_v_r)) { __Pyx_RaiseClosureNameError("r"); __PYX_ERR(13, 20, __pyx_L1_error) }
  __pyx_t_2 = PyNumber_Multiply(__pyx_cur_scope->__pyx_v_r, __pyx_v_z); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_7 = __Pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_7 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(13, 20, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  glVertex3f(__pyx_t_9, __pyx_t_8, __pyx_t_7);

  /* "opengl/legacy/wireframe_sphere.pyx":17
 *         dtheta = 2*pi/slices
 *         dphi = pi/stacks
 *         def draw_point(phi, theta):             # <<<<<<<<<<<<<<
 *             x, y, z = sin(phi)*sin(theta), sin(phi)*cos(theta), cos(phi)
 *             glNormal3f(x, y, z)
*/

  /* 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("CyOpenGL.WireframeSphere.draw.draw_point", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XDECREF(__pyx_v_y);
  __Pyx_XDECREF(__pyx_v_z);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opengl/legacy/wireframe_sphere.pyx":6
 *     """
 * 
 *     def draw(self, GLfloat radius, GLint slices, GLint stacks):             # <<<<<<<<<<<<<<
 *         assert slices % 2 == 0 and stacks % 2 == 0
 *         self.set_material()
*/

static PyObject *__pyx_pf_8CyOpenGL_15WireframeSphere_draw(struct __pyx_obj_8CyOpenGL_WireframeSphere *__pyx_v_self, GLfloat __pyx_v_radius, GLint __pyx_v_slices, GLint __pyx_v_stacks) {
  struct __pyx_obj_8CyOpenGL___pyx_scope_struct__draw *__pyx_cur_scope;
  PyObject *__pyx_v_dtheta = NULL;
  PyObject *__pyx_v_dphi = NULL;
  PyObject *__pyx_v_draw_point = 0;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_theta = NULL;
  PyObject *__pyx_v_j = NULL;
  PyObject *__pyx_v_phi = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  PyObject *(*__pyx_t_9)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("draw", 0);
  __pyx_cur_scope = (struct __pyx_obj_8CyOpenGL___pyx_scope_struct__draw *)__pyx_tp_new_8CyOpenGL___pyx_scope_struct__draw(__pyx_mstate_global->__pyx_ptype_8CyOpenGL___pyx_scope_struct__draw, __pyx_mstate_global->__pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_8CyOpenGL___pyx_scope_struct__draw *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(13, 6, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }

  /* "opengl/legacy/wireframe_sphere.pyx":7
 * 
 *     def draw(self, GLfloat radius, GLint slices, GLint stacks):
 *         assert slices % 2 == 0 and stacks % 2 == 0             # <<<<<<<<<<<<<<
 *         self.set_material()
 *         r = radius
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_2 = (__Pyx_mod_long(__pyx_v_slices, 2, 1) == 0);
    if (__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L3_bool_binop_done;
    }
    __pyx_t_2 = (__Pyx_mod_long(__pyx_v_stacks, 2, 1) == 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L3_bool_binop_done:;
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(13, 7, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(13, 7, __pyx_L1_error)
  #endif

  /* "opengl/legacy/wireframe_sphere.pyx":8
 *     def draw(self, GLfloat radius, GLint slices, GLint stacks):
 *         assert slices % 2 == 0 and stacks % 2 == 0
 *         self.set_material()             # <<<<<<<<<<<<<<
 *         r = radius
 *         # We put the north pole on the y-axis.
*/
  __pyx_t_3 = ((struct __pyx_vtabstruct_8CyOpenGL_WireframeSphere *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_material(((struct __pyx_obj_8CyOpenGL_GLobject *)__pyx_v_self)); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 8, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "opengl/legacy/wireframe_sphere.pyx":9
 *         assert slices % 2 == 0 and stacks % 2 == 0
 *         self.set_material()
 *         r = radius             # <<<<<<<<<<<<<<
 *         # We put the north pole on the y-axis.
 *         glPushMatrix()
*/
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_radius); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_cur_scope->__pyx_v_r = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "opengl/legacy/wireframe_sphere.pyx":11
 *         r = radius
 *         # We put the north pole on the y-axis.
 *         glPushMatrix()             # <<<<<<<<<<<<<<
 *         glLoadIdentity()
 *         glRotatef(90, 1.0, 0.0, 0.0)
*/
  glPushMatrix();

  /* "opengl/legacy/wireframe_sphere.pyx":12
 *         # We put the north pole on the y-axis.
 *         glPushMatrix()
 *         glLoadIdentity()             # <<<<<<<<<<<<<<
 *         glRotatef(90, 1.0, 0.0, 0.0)
 * 
*/
  glLoadIdentity();

  /* "opengl/legacy/wireframe_sphere.pyx":13
 *         glPushMatrix()
 *         glLoadIdentity()
 *         glRotatef(90, 1.0, 0.0, 0.0)             # <<<<<<<<<<<<<<
 * 
 *         dtheta = 2*pi/slices
*/
  glRotatef(90.0, 1.0, 0.0, 0.0);

  /* "opengl/legacy/wireframe_sphere.pyx":15
 *         glRotatef(90, 1.0, 0.0, 0.0)
 * 
 *         dtheta = 2*pi/slices             # <<<<<<<<<<<<<<
 *         dphi = pi/stacks
 *         def draw_point(phi, theta):
*/
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_pi); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyLong_MultiplyCObj(__pyx_mstate_global->__pyx_int_2, __pyx_t_3, 2, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyLong_From_GLint(__pyx_v_slices); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyNumber_Divide(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_dtheta = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "opengl/legacy/wireframe_sphere.pyx":16
 * 
 *         dtheta = 2*pi/slices
 *         dphi = pi/stacks             # <<<<<<<<<<<<<<
 *         def draw_point(phi, theta):
 *             x, y, z = sin(phi)*sin(theta), sin(phi)*cos(theta), cos(phi)
*/
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_pi); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = __Pyx_PyLong_From_GLint(__pyx_v_stacks); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyNumber_Divide(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 16, __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_v_dphi = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "opengl/legacy/wireframe_sphere.pyx":17
 *         dtheta = 2*pi/slices
 *         dphi = pi/stacks
 *         def draw_point(phi, theta):             # <<<<<<<<<<<<<<
 *             x, y, z = sin(phi)*sin(theta), sin(phi)*cos(theta), cos(phi)
 *             glNormal3f(x, y, z)
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_15WireframeSphere_4draw_1draw_point, 0, __pyx_mstate_global->__pyx_n_u_draw_locals_draw_point, ((PyObject*)__pyx_cur_scope), __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_v_draw_point = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "opengl/legacy/wireframe_sphere.pyx":23
 * 
 *         # Draw the longitudes
 *         for i in range(slices):             # <<<<<<<<<<<<<<
 *             theta = dtheta*i
 *             glBegin(GL_LINE_STRIP)
*/
  __pyx_t_3 = NULL;
  __pyx_t_5 = __Pyx_PyLong_From_GLint(__pyx_v_slices); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_5};
    __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)(&PyRange_Type), __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 23, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(13, 23, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  for (;;) {
    {
      __pyx_t_4 = __pyx_t_7(__pyx_t_5);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(13, 23, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "opengl/legacy/wireframe_sphere.pyx":24
 *         # Draw the longitudes
 *         for i in range(slices):
 *             theta = dtheta*i             # <<<<<<<<<<<<<<
 *             glBegin(GL_LINE_STRIP)
 *             for j in range(stacks + 1):
*/
    __pyx_t_4 = PyNumber_Multiply(__pyx_v_dtheta, __pyx_v_i); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 24, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_XDECREF_SET(__pyx_v_theta, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "opengl/legacy/wireframe_sphere.pyx":25
 *         for i in range(slices):
 *             theta = dtheta*i
 *             glBegin(GL_LINE_STRIP)             # <<<<<<<<<<<<<<
 *             for j in range(stacks + 1):
 *                 draw_point(dphi*j, theta)
*/
    glBegin(GL_LINE_STRIP);

    /* "opengl/legacy/wireframe_sphere.pyx":26
 *             theta = dtheta*i
 *             glBegin(GL_LINE_STRIP)
 *             for j in range(stacks + 1):             # <<<<<<<<<<<<<<
 *                 draw_point(dphi*j, theta)
 *             glEnd()
*/
    __pyx_t_3 = NULL;
    __pyx_t_8 = __Pyx_PyLong_From_long((__pyx_v_stacks + 1)); if (unlikely(!__pyx_t_8)) __PYX_ERR(13, 26, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_8};
      __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)(&PyRange_Type), __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 26, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __pyx_t_8 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(13, 26, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(13, 26, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    for (;;) {
      {
        __pyx_t_4 = __pyx_t_9(__pyx_t_8);
        if (unlikely(!__pyx_t_4)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(13, 26, __pyx_L1_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "opengl/legacy/wireframe_sphere.pyx":27
 *             glBegin(GL_LINE_STRIP)
 *             for j in range(stacks + 1):
 *                 draw_point(dphi*j, theta)             # <<<<<<<<<<<<<<
 *             glEnd()
 * 
*/
      __pyx_t_4 = PyNumber_Multiply(__pyx_v_dphi, __pyx_v_j); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 27, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __pyx_pf_8CyOpenGL_15WireframeSphere_4draw_draw_point(__pyx_v_draw_point, __pyx_t_4, __pyx_v_theta); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 27, __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;

      /* "opengl/legacy/wireframe_sphere.pyx":26
 *             theta = dtheta*i
 *             glBegin(GL_LINE_STRIP)
 *             for j in range(stacks + 1):             # <<<<<<<<<<<<<<
 *                 draw_point(dphi*j, theta)
 *             glEnd()
*/
    }
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "opengl/legacy/wireframe_sphere.pyx":28
 *             for j in range(stacks + 1):
 *                 draw_point(dphi*j, theta)
 *             glEnd()             # <<<<<<<<<<<<<<
 * 
 *         # Draw the latitudes
*/
    glEnd();

    /* "opengl/legacy/wireframe_sphere.pyx":23
 * 
 *         # Draw the longitudes
 *         for i in range(slices):             # <<<<<<<<<<<<<<
 *             theta = dtheta*i
 *             glBegin(GL_LINE_STRIP)
*/
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "opengl/legacy/wireframe_sphere.pyx":31
 * 
 *         # Draw the latitudes
 *         for j in range(1, stacks):             # <<<<<<<<<<<<<<
 *             glBegin(GL_LINE_LOOP)
 *             phi = dphi*j
*/
  __pyx_t_8 = NULL;
  __pyx_t_3 = __Pyx_PyLong_From_GLint(__pyx_v_stacks); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_mstate_global->__pyx_int_1, __pyx_t_3};
    __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)(&PyRange_Type), __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 31, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
  }
  __pyx_t_3 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(13, 31, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  for (;;) {
    {
      __pyx_t_5 = __pyx_t_7(__pyx_t_3);
      if (unlikely(!__pyx_t_5)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(13, 31, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "opengl/legacy/wireframe_sphere.pyx":32
 *         # Draw the latitudes
 *         for j in range(1, stacks):
 *             glBegin(GL_LINE_LOOP)             # <<<<<<<<<<<<<<
 *             phi = dphi*j
 *             for i in range(0, slices):
*/
    glBegin(GL_LINE_LOOP);

    /* "opengl/legacy/wireframe_sphere.pyx":33
 *         for j in range(1, stacks):
 *             glBegin(GL_LINE_LOOP)
 *             phi = dphi*j             # <<<<<<<<<<<<<<
 *             for i in range(0, slices):
 *                 draw_point(phi, dtheta*i)
*/
    __pyx_t_5 = PyNumber_Multiply(__pyx_v_dphi, __pyx_v_j); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 33, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_XDECREF_SET(__pyx_v_phi, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "opengl/legacy/wireframe_sphere.pyx":34
 *             glBegin(GL_LINE_LOOP)
 *             phi = dphi*j
 *             for i in range(0, slices):             # <<<<<<<<<<<<<<
 *                 draw_point(phi, dtheta*i)
 *             glEnd()
*/
    __pyx_t_8 = NULL;
    __pyx_t_4 = __Pyx_PyLong_From_GLint(__pyx_v_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 34, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_mstate_global->__pyx_int_0, __pyx_t_4};
      __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)(&PyRange_Type), __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 34, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __pyx_t_4 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 34, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(13, 34, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    for (;;) {
      {
        __pyx_t_5 = __pyx_t_9(__pyx_t_4);
        if (unlikely(!__pyx_t_5)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(13, 34, __pyx_L1_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "opengl/legacy/wireframe_sphere.pyx":35
 *             phi = dphi*j
 *             for i in range(0, slices):
 *                 draw_point(phi, dtheta*i)             # <<<<<<<<<<<<<<
 *             glEnd()
 *         glPopMatrix()
*/
      __pyx_t_5 = PyNumber_Multiply(__pyx_v_dtheta, __pyx_v_i); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 35, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_8 = __pyx_pf_8CyOpenGL_15WireframeSphere_4draw_draw_point(__pyx_v_draw_point, __pyx_v_phi, __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(13, 35, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "opengl/legacy/wireframe_sphere.pyx":34
 *             glBegin(GL_LINE_LOOP)
 *             phi = dphi*j
 *             for i in range(0, slices):             # <<<<<<<<<<<<<<
 *                 draw_point(phi, dtheta*i)
 *             glEnd()
*/
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "opengl/legacy/wireframe_sphere.pyx":36
 *             for i in range(0, slices):
 *                 draw_point(phi, dtheta*i)
 *             glEnd()             # <<<<<<<<<<<<<<
 *         glPopMatrix()
*/
    glEnd();

    /* "opengl/legacy/wireframe_sphere.pyx":31
 * 
 *         # Draw the latitudes
 *         for j in range(1, stacks):             # <<<<<<<<<<<<<<
 *             glBegin(GL_LINE_LOOP)
 *             phi = dphi*j
*/
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "opengl/legacy/wireframe_sphere.pyx":37
 *                 draw_point(phi, dtheta*i)
 *             glEnd()
 *         glPopMatrix()             # <<<<<<<<<<<<<<
*/
  glPopMatrix();

  /* "opengl/legacy/wireframe_sphere.pyx":6
 *     """
 * 
 *     def draw(self, GLfloat radius, GLint slices, GLint stacks):             # <<<<<<<<<<<<<<
 *         assert slices % 2 == 0 and stacks % 2 == 0
 *         self.set_material()
*/

  /* 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_8);
  __Pyx_AddTraceback("CyOpenGL.WireframeSphere.draw", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dtheta);
  __Pyx_XDECREF(__pyx_v_dphi);
  __Pyx_XDECREF(__pyx_v_draw_point);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_theta);
  __Pyx_XDECREF(__pyx_v_j);
  __Pyx_XDECREF(__pyx_v_phi);
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opengl/legacy/triangle_mesh.pyx":5
 *     A triangle which can tessellate itself.
 *     """
 *     def __init__(self, vertices):             # <<<<<<<<<<<<<<
 *         self.vertices = vertices
 *         self.triangles = [(0,1,2)]
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_12TriangleMesh_1__init__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_12TriangleMesh___init__, "TriangleMesh.__init__(self, vertices)");
static PyMethodDef __pyx_mdef_8CyOpenGL_12TriangleMesh_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_12TriangleMesh_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_12TriangleMesh___init__};
static PyObject *__pyx_pw_8CyOpenGL_12TriangleMesh_1__init__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_vertices = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_vertices,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(14, 5, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(14, 5, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(14, 5, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(14, 5, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, i); __PYX_ERR(14, 5, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(14, 5, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(14, 5, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
    __pyx_v_vertices = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(14, 5, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("CyOpenGL.TriangleMesh.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_12TriangleMesh___init__(__pyx_self, __pyx_v_self, __pyx_v_vertices);

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

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

  /* "opengl/legacy/triangle_mesh.pyx":6
 *     """
 *     def __init__(self, vertices):
 *         self.vertices = vertices             # <<<<<<<<<<<<<<
 *         self.triangles = [(0,1,2)]
 * 
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_vertices, __pyx_v_vertices) < (0)) __PYX_ERR(14, 6, __pyx_L1_error)

  /* "opengl/legacy/triangle_mesh.pyx":7
 *     def __init__(self, vertices):
 *         self.vertices = vertices
 *         self.triangles = [(0,1,2)]             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
*/
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_tuple[1]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[1]);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_mstate_global->__pyx_tuple[1]) != (0)) __PYX_ERR(14, 7, __pyx_L1_error);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_triangles, __pyx_t_1) < (0)) __PYX_ERR(14, 7, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/legacy/triangle_mesh.pyx":5
 *     A triangle which can tessellate itself.
 *     """
 *     def __init__(self, vertices):             # <<<<<<<<<<<<<<
 *         self.vertices = vertices
 *         self.triangles = [(0,1,2)]
*/

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

/* "opengl/legacy/triangle_mesh.pyx":9
 *         self.triangles = [(0,1,2)]
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return str(self.triangles)
 * 
*/

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

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

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

  /* "opengl/legacy/triangle_mesh.pyx":10
 * 
 *     def __repr__(self):
 *         return str(self.triangles)             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, n):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_triangles); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 10, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Unicode(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 10, __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;

  /* "opengl/legacy/triangle_mesh.pyx":9
 *         self.triangles = [(0,1,2)]
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return str(self.triangles)
 * 
*/

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

/* "opengl/legacy/triangle_mesh.pyx":12
 *         return str(self.triangles)
 * 
 *     def __getitem__(self, n):             # <<<<<<<<<<<<<<
 *         x, y, z = self.triangles[n]
 *         return (self.vertices[x], self.vertices[y], self.vertices[z])
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_12TriangleMesh_5__getitem__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_12TriangleMesh_4__getitem__, "TriangleMesh.__getitem__(self, n)");
static PyMethodDef __pyx_mdef_8CyOpenGL_12TriangleMesh_5__getitem__ = {"__getitem__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_12TriangleMesh_5__getitem__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_12TriangleMesh_4__getitem__};
static PyObject *__pyx_pw_8CyOpenGL_12TriangleMesh_5__getitem__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_n = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_n,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(14, 12, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(14, 12, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(14, 12, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__getitem__", 0) < (0)) __PYX_ERR(14, 12, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, i); __PYX_ERR(14, 12, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(14, 12, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(14, 12, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
    __pyx_v_n = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, __pyx_nargs); __PYX_ERR(14, 12, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("CyOpenGL.TriangleMesh.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_12TriangleMesh_4__getitem__(__pyx_self, __pyx_v_self, __pyx_v_n);

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

static PyObject *__pyx_pf_8CyOpenGL_12TriangleMesh_4__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_n) {
  PyObject *__pyx_v_x = NULL;
  PyObject *__pyx_v_y = NULL;
  PyObject *__pyx_v_z = 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 *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "opengl/legacy/triangle_mesh.pyx":13
 * 
 *     def __getitem__(self, n):
 *         x, y, z = self.triangles[n]             # <<<<<<<<<<<<<<
 *         return (self.vertices[x], self.vertices[y], self.vertices[z])
 * 
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_triangles); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 13, __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(14, 13, __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(14, 13, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_4);
    } else {
      __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 13, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 13, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_4)) __PYX_ERR(14, 13, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_4);
    }
    #else
    __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) __PYX_ERR(14, 13, __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(14, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_5);
    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(14, 13, __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(14, 13, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  __pyx_v_x = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v_y = __pyx_t_3;
  __pyx_t_3 = 0;
  __pyx_v_z = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "opengl/legacy/triangle_mesh.pyx":14
 *     def __getitem__(self, n):
 *         x, y, z = self.triangles[n]
 *         return (self.vertices[x], self.vertices[y], self.vertices[z])             # <<<<<<<<<<<<<<
 * 
 *     def subdivide(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_vertices); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 14, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_v_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(14, 14, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_vertices); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 14, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_v_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 14, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_vertices); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 14, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_v_z); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 14, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 14, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4) != (0)) __PYX_ERR(14, 14, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3) != (0)) __PYX_ERR(14, 14, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_1) != (0)) __PYX_ERR(14, 14, __pyx_L1_error);
  __pyx_t_4 = 0;
  __pyx_t_3 = 0;
  __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "opengl/legacy/triangle_mesh.pyx":12
 *         return str(self.triangles)
 * 
 *     def __getitem__(self, n):             # <<<<<<<<<<<<<<
 *         x, y, z = self.triangles[n]
 *         return (self.vertices[x], self.vertices[y], self.vertices[z])
*/

  /* 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("CyOpenGL.TriangleMesh.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XDECREF(__pyx_v_y);
  __Pyx_XDECREF(__pyx_v_z);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opengl/legacy/triangle_mesh.pyx":16
 *         return (self.vertices[x], self.vertices[y], self.vertices[z])
 * 
 *     def subdivide(self):             # <<<<<<<<<<<<<<
 *         """
 *         Replace each triangle by four triangles:
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_12TriangleMesh_7subdivide(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_12TriangleMesh_6subdivide, "TriangleMesh.subdivide(self)\n\nReplace each triangle by four triangles:\n               z\n             /                       zx - yz\n           /  \\ /                    x -  xy - y\nNew midpoint vertices are appended to the vertex list.");
static PyMethodDef __pyx_mdef_8CyOpenGL_12TriangleMesh_7subdivide = {"subdivide", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_12TriangleMesh_7subdivide, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_12TriangleMesh_6subdivide};
static PyObject *__pyx_pw_8CyOpenGL_12TriangleMesh_7subdivide(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("subdivide (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(14, 16, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(14, 16, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "subdivide", 0) < (0)) __PYX_ERR(14, 16, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("subdivide", 1, 1, 1, i); __PYX_ERR(14, 16, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(14, 16, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("subdivide", 1, 1, 1, __pyx_nargs); __PYX_ERR(14, 16, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("CyOpenGL.TriangleMesh.subdivide", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_12TriangleMesh_6subdivide(__pyx_self, __pyx_v_self);

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

static PyObject *__pyx_pf_8CyOpenGL_12TriangleMesh_6subdivide(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_new_triangles = NULL;
  PyObject *__pyx_v_V = NULL;
  PyObject *__pyx_v_triangle = NULL;
  PyObject *__pyx_v_x = NULL;
  PyObject *__pyx_v_y = NULL;
  PyObject *__pyx_v_z = NULL;
  PyObject *__pyx_v_n = NULL;
  PyObject *__pyx_v_xy = NULL;
  PyObject *__pyx_v_yz = NULL;
  PyObject *__pyx_v_zx = 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;
  PyObject *__pyx_t_7 = NULL;
  PyObject *(*__pyx_t_8)(PyObject *);
  Py_ssize_t __pyx_t_9;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("subdivide", 0);

  /* "opengl/legacy/triangle_mesh.pyx":26
 *         New midpoint vertices are appended to the vertex list.
 *         """
 *         new_triangles = []             # <<<<<<<<<<<<<<
 *         V = self.vertices
 *         for triangle in self.triangles:
*/
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_new_triangles = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "opengl/legacy/triangle_mesh.pyx":27
 *         """
 *         new_triangles = []
 *         V = self.vertices             # <<<<<<<<<<<<<<
 *         for triangle in self.triangles:
 *             x, y, z = triangle
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_vertices); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_V = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "opengl/legacy/triangle_mesh.pyx":28
 *         new_triangles = []
 *         V = self.vertices
 *         for triangle in self.triangles:             # <<<<<<<<<<<<<<
 *             x, y, z = triangle
 *             n = len(V)
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_triangles); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 28, __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(14, 28, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(14, 28, __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))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(14, 28, __pyx_L1_error)
          #endif
          if (__pyx_t_3 >= __pyx_temp) break;
        }
        __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_2, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference);
        ++__pyx_t_3;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(14, 28, __pyx_L1_error)
          #endif
          if (__pyx_t_3 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3));
        #else
        __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3);
        #endif
        ++__pyx_t_3;
      }
      if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 28, __pyx_L1_error)
    } else {
      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(14, 28, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_triangle, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "opengl/legacy/triangle_mesh.pyx":29
 *         V = self.vertices
 *         for triangle in self.triangles:
 *             x, y, z = triangle             # <<<<<<<<<<<<<<
 *             n = len(V)
 *             self.vertices.append((V[x] + V[y])/2)
*/
    if ((likely(PyTuple_CheckExact(__pyx_v_triangle))) || (PyList_CheckExact(__pyx_v_triangle))) {
      PyObject* sequence = __pyx_v_triangle;
      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(14, 29, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_5);
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2);
        __Pyx_INCREF(__pyx_t_6);
      } else {
        __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 29, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_1);
        __pyx_t_5 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_5)) __PYX_ERR(14, 29, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_5);
        __pyx_t_6 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_6)) __PYX_ERR(14, 29, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_6);
      }
      #else
      __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 29, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(14, 29, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(14, 29, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      #endif
    } else {
      Py_ssize_t index = -1;
      __pyx_t_7 = PyObject_GetIter(__pyx_v_triangle); if (unlikely(!__pyx_t_7)) __PYX_ERR(14, 29, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_7);
      index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_1);
      index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_5);
      index = 2; __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), 3) < (0)) __PYX_ERR(14, 29, __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(14, 29, __pyx_L1_error)
      __pyx_L6_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_1);
    __pyx_t_1 = 0;
    __Pyx_XDECREF_SET(__pyx_v_y, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_XDECREF_SET(__pyx_v_z, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "opengl/legacy/triangle_mesh.pyx":30
 *         for triangle in self.triangles:
 *             x, y, z = triangle
 *             n = len(V)             # <<<<<<<<<<<<<<
 *             self.vertices.append((V[x] + V[y])/2)
 *             self.vertices.append((V[y] + V[z])/2)
*/
    __pyx_t_9 = PyObject_Length(__pyx_v_V); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(14, 30, __pyx_L1_error)
    __pyx_t_6 = PyLong_FromSsize_t(__pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(14, 30, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "opengl/legacy/triangle_mesh.pyx":31
 *             x, y, z = triangle
 *             n = len(V)
 *             self.vertices.append((V[x] + V[y])/2)             # <<<<<<<<<<<<<<
 *             self.vertices.append((V[y] + V[z])/2)
 *             self.vertices.append((V[z] + V[x])/2)
*/
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_vertices); if (unlikely(!__pyx_t_6)) __PYX_ERR(14, 31, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_V, __pyx_v_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(14, 31, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_V, __pyx_v_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 31, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = PyNumber_Add(__pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(14, 31, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyLong_TrueDivideObjC(__pyx_t_7, __pyx_mstate_global->__pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 31, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_10 = __Pyx_PyObject_Append(__pyx_t_6, __pyx_t_1); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(14, 31, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "opengl/legacy/triangle_mesh.pyx":32
 *             n = len(V)
 *             self.vertices.append((V[x] + V[y])/2)
 *             self.vertices.append((V[y] + V[z])/2)             # <<<<<<<<<<<<<<
 *             self.vertices.append((V[z] + V[x])/2)
 *             xy, yz, zx = n, n+1, n+2
*/
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_vertices); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 32, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_V, __pyx_v_y); if (unlikely(!__pyx_t_6)) __PYX_ERR(14, 32, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_V, __pyx_v_z); if (unlikely(!__pyx_t_7)) __PYX_ERR(14, 32, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_5 = PyNumber_Add(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(14, 32, __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 = __Pyx_PyLong_TrueDivideObjC(__pyx_t_5, __pyx_mstate_global->__pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(14, 32, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_10 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_7); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(14, 32, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "opengl/legacy/triangle_mesh.pyx":33
 *             self.vertices.append((V[x] + V[y])/2)
 *             self.vertices.append((V[y] + V[z])/2)
 *             self.vertices.append((V[z] + V[x])/2)             # <<<<<<<<<<<<<<
 *             xy, yz, zx = n, n+1, n+2
 *             new_triangles += [(x, xy, zx), (xy, yz, zx),
*/
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_vertices); if (unlikely(!__pyx_t_7)) __PYX_ERR(14, 33, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_V, __pyx_v_z); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 33, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_V, __pyx_v_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(14, 33, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyNumber_Add(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(14, 33, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyLong_TrueDivideObjC(__pyx_t_6, __pyx_mstate_global->__pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(14, 33, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_10 = __Pyx_PyObject_Append(__pyx_t_7, __pyx_t_5); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(14, 33, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "opengl/legacy/triangle_mesh.pyx":34
 *             self.vertices.append((V[y] + V[z])/2)
 *             self.vertices.append((V[z] + V[x])/2)
 *             xy, yz, zx = n, n+1, n+2             # <<<<<<<<<<<<<<
 *             new_triangles += [(x, xy, zx), (xy, yz, zx),
 *                               (zx, yz, z), (xy, y, yz)]
*/
    __pyx_t_5 = __pyx_v_n;
    __Pyx_INCREF(__pyx_t_5);
    __pyx_t_7 = __Pyx_PyLong_AddObjC(__pyx_v_n, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(14, 34, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_6 = __Pyx_PyLong_AddObjC(__pyx_v_n, __pyx_mstate_global->__pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(14, 34, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_XDECREF_SET(__pyx_v_xy, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_XDECREF_SET(__pyx_v_yz, __pyx_t_7);
    __pyx_t_7 = 0;
    __Pyx_XDECREF_SET(__pyx_v_zx, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "opengl/legacy/triangle_mesh.pyx":35
 *             self.vertices.append((V[z] + V[x])/2)
 *             xy, yz, zx = n, n+1, n+2
 *             new_triangles += [(x, xy, zx), (xy, yz, zx),             # <<<<<<<<<<<<<<
 *                               (zx, yz, z), (xy, y, yz)]
 *         self.triangles = new_triangles
*/
    __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(14, 35, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_v_x);
    __Pyx_GIVEREF(__pyx_v_x);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_x) != (0)) __PYX_ERR(14, 35, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_xy);
    __Pyx_GIVEREF(__pyx_v_xy);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_xy) != (0)) __PYX_ERR(14, 35, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_zx);
    __Pyx_GIVEREF(__pyx_v_zx);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_zx) != (0)) __PYX_ERR(14, 35, __pyx_L1_error);
    __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(14, 35, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_INCREF(__pyx_v_xy);
    __Pyx_GIVEREF(__pyx_v_xy);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_xy) != (0)) __PYX_ERR(14, 35, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_yz);
    __Pyx_GIVEREF(__pyx_v_yz);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_yz) != (0)) __PYX_ERR(14, 35, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_zx);
    __Pyx_GIVEREF(__pyx_v_zx);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_v_zx) != (0)) __PYX_ERR(14, 35, __pyx_L1_error);

    /* "opengl/legacy/triangle_mesh.pyx":36
 *             xy, yz, zx = n, n+1, n+2
 *             new_triangles += [(x, xy, zx), (xy, yz, zx),
 *                               (zx, yz, z), (xy, y, yz)]             # <<<<<<<<<<<<<<
 *         self.triangles = new_triangles
*/
    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(14, 36, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_zx);
    __Pyx_GIVEREF(__pyx_v_zx);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_zx) != (0)) __PYX_ERR(14, 36, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_yz);
    __Pyx_GIVEREF(__pyx_v_yz);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_yz) != (0)) __PYX_ERR(14, 36, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_z);
    __Pyx_GIVEREF(__pyx_v_z);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_z) != (0)) __PYX_ERR(14, 36, __pyx_L1_error);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 36, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_xy);
    __Pyx_GIVEREF(__pyx_v_xy);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_xy) != (0)) __PYX_ERR(14, 36, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_y);
    __Pyx_GIVEREF(__pyx_v_y);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_y) != (0)) __PYX_ERR(14, 36, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_yz);
    __Pyx_GIVEREF(__pyx_v_yz);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_yz) != (0)) __PYX_ERR(14, 36, __pyx_L1_error);

    /* "opengl/legacy/triangle_mesh.pyx":35
 *             self.vertices.append((V[z] + V[x])/2)
 *             xy, yz, zx = n, n+1, n+2
 *             new_triangles += [(x, xy, zx), (xy, yz, zx),             # <<<<<<<<<<<<<<
 *                               (zx, yz, z), (xy, y, yz)]
 *         self.triangles = new_triangles
*/
    __pyx_t_11 = PyList_New(4); if (unlikely(!__pyx_t_11)) __PYX_ERR(14, 35, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_GIVEREF(__pyx_t_6);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_11, 0, __pyx_t_6) != (0)) __PYX_ERR(14, 35, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_7);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_11, 1, __pyx_t_7) != (0)) __PYX_ERR(14, 35, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_5);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_11, 2, __pyx_t_5) != (0)) __PYX_ERR(14, 35, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_11, 3, __pyx_t_1) != (0)) __PYX_ERR(14, 35, __pyx_L1_error);
    __pyx_t_6 = 0;
    __pyx_t_7 = 0;
    __pyx_t_5 = 0;
    __pyx_t_1 = 0;
    __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_new_triangles, __pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 35, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF_SET(__pyx_v_new_triangles, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "opengl/legacy/triangle_mesh.pyx":28
 *         new_triangles = []
 *         V = self.vertices
 *         for triangle in self.triangles:             # <<<<<<<<<<<<<<
 *             x, y, z = triangle
 *             n = len(V)
*/
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opengl/legacy/triangle_mesh.pyx":37
 *             new_triangles += [(x, xy, zx), (xy, yz, zx),
 *                               (zx, yz, z), (xy, y, yz)]
 *         self.triangles = new_triangles             # <<<<<<<<<<<<<<
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_triangles, __pyx_v_new_triangles) < (0)) __PYX_ERR(14, 37, __pyx_L1_error)

  /* "opengl/legacy/triangle_mesh.pyx":16
 *         return (self.vertices[x], self.vertices[y], self.vertices[z])
 * 
 *     def subdivide(self):             # <<<<<<<<<<<<<<
 *         """
 *         Replace each triangle by four triangles:
*/

  /* 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_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("CyOpenGL.TriangleMesh.subdivide", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_new_triangles);
  __Pyx_XDECREF(__pyx_v_V);
  __Pyx_XDECREF(__pyx_v_triangle);
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XDECREF(__pyx_v_y);
  __Pyx_XDECREF(__pyx_v_z);
  __Pyx_XDECREF(__pyx_v_n);
  __Pyx_XDECREF(__pyx_v_xy);
  __Pyx_XDECREF(__pyx_v_yz);
  __Pyx_XDECREF(__pyx_v_zx);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opengl/legacy/meshed_surface.pyx":12
 *     cdef GLushort* indices
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         free(self.nv_array)
 *         free(self.indices)
*/

/* Python wrapper */
static void __pyx_pw_8CyOpenGL_13MeshedSurface_1__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_8CyOpenGL_13MeshedSurface_1__dealloc__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_pf_8CyOpenGL_13MeshedSurface___dealloc__(((struct __pyx_obj_8CyOpenGL_MeshedSurface *)__pyx_v_self));

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

static void __pyx_pf_8CyOpenGL_13MeshedSurface___dealloc__(struct __pyx_obj_8CyOpenGL_MeshedSurface *__pyx_v_self) {

  /* "opengl/legacy/meshed_surface.pyx":13
 * 
 *     def __dealloc__(self):
 *         free(self.nv_array)             # <<<<<<<<<<<<<<
 *         free(self.indices)
 * 
*/
  free(__pyx_v_self->nv_array);

  /* "opengl/legacy/meshed_surface.pyx":14
 *     def __dealloc__(self):
 *         free(self.nv_array)
 *         free(self.indices)             # <<<<<<<<<<<<<<
 * 
 *     def build_arrays(self):
*/
  free(__pyx_v_self->indices);

  /* "opengl/legacy/meshed_surface.pyx":12
 *     cdef GLushort* indices
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         free(self.nv_array)
 *         free(self.indices)
*/

  /* function exit code */
}

/* "opengl/legacy/meshed_surface.pyx":16
 *         free(self.indices)
 * 
 *     def build_arrays(self):             # <<<<<<<<<<<<<<
 *         cdef double scale
 *         cdef vector3 V, N
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_13MeshedSurface_3build_arrays(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_13MeshedSurface_2build_arrays, "MeshedSurface.build_arrays(self)");
static PyMethodDef __pyx_mdef_8CyOpenGL_13MeshedSurface_3build_arrays = {"build_arrays", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_13MeshedSurface_3build_arrays, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_13MeshedSurface_2build_arrays};
static PyObject *__pyx_pw_8CyOpenGL_13MeshedSurface_3build_arrays(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("build_arrays (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("build_arrays", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("build_arrays", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8CyOpenGL_13MeshedSurface_2build_arrays(((struct __pyx_obj_8CyOpenGL_MeshedSurface *)__pyx_v_self));

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

static PyObject *__pyx_pf_8CyOpenGL_13MeshedSurface_2build_arrays(struct __pyx_obj_8CyOpenGL_MeshedSurface *__pyx_v_self) {
  struct __pyx_obj_8CyOpenGL_vector3 *__pyx_v_V = 0;
  struct __pyx_obj_8CyOpenGL_vector3 *__pyx_v_N = 0;
  GLfloat *__pyx_v_NV;
  GLushort *__pyx_v_T;
  size_t __pyx_v_NVsize;
  PyObject *__pyx_v_Tsize = NULL;
  PyObject *__pyx_v_triangle = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  GLfloat *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  PyObject *(*__pyx_t_6)(PyObject *);
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *(*__pyx_t_10)(PyObject *);
  double __pyx_t_11;
  double __pyx_t_12;
  double __pyx_t_13;
  GLushort *__pyx_t_14;
  GLushort __pyx_t_15;
  GLushort __pyx_t_16;
  GLushort __pyx_t_17;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("build_arrays", 0);

  /* "opengl/legacy/meshed_surface.pyx":21
 *         cdef GLfloat* NV
 *         cdef GLushort* T
 *         NVsize = 6*len(self.vertices)*sizeof(GLfloat)             # <<<<<<<<<<<<<<
 *         self.nv_array = NV = <GLfloat *> malloc(NVsize)
 *         for V, N in zip(self.vertices, self.normals):
*/
  __pyx_t_1 = __pyx_v_self->vertices;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(2, 21, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_NVsize = ((6 * __pyx_t_2) * (sizeof(GLfloat)));

  /* "opengl/legacy/meshed_surface.pyx":22
 *         cdef GLushort* T
 *         NVsize = 6*len(self.vertices)*sizeof(GLfloat)
 *         self.nv_array = NV = <GLfloat *> malloc(NVsize)             # <<<<<<<<<<<<<<
 *         for V, N in zip(self.vertices, self.normals):
 *             NV[0], NV[1], NV[2] = N.x, N.y, N.z
*/
  __pyx_t_3 = ((GLfloat *)malloc(__pyx_v_NVsize));
  __pyx_v_self->nv_array = __pyx_t_3;
  __pyx_v_NV = __pyx_t_3;

  /* "opengl/legacy/meshed_surface.pyx":23
 *         NVsize = 6*len(self.vertices)*sizeof(GLfloat)
 *         self.nv_array = NV = <GLfloat *> malloc(NVsize)
 *         for V, N in zip(self.vertices, self.normals):             # <<<<<<<<<<<<<<
 *             NV[0], NV[1], NV[2] = N.x, N.y, N.z
 *             NV[3], NV[4], NV[5] = V.x, V.y, V.z
*/
  __pyx_t_4 = NULL;
  __pyx_t_5 = 1;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_self->vertices, __pyx_v_self->normals};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_zip, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 23, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_4 = __pyx_t_1; __Pyx_INCREF(__pyx_t_4);
    __pyx_t_2 = 0;
    __pyx_t_6 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 23, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 23, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_6)) {
      if (likely(PyList_CheckExact(__pyx_t_4))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(2, 23, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_4, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference);
        ++__pyx_t_2;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(2, 23, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_2));
        #else
        __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_2);
        #endif
        ++__pyx_t_2;
      }
      if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 23, __pyx_L1_error)
    } else {
      __pyx_t_1 = __pyx_t_6(__pyx_t_4);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(2, 23, __pyx_L1_error)
          PyErr_Clear();
        }
        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(2, 23, __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_INCREF(__pyx_t_7);
        __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_8);
      } else {
        __pyx_t_7 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 23, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_7);
        __pyx_t_8 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 23, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_8);
      }
      #else
      __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 23, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 23, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 23, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9);
      index = 0; __pyx_t_7 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_7)) goto __pyx_L5_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_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_8);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < (0)) __PYX_ERR(2, 23, __pyx_L1_error)
      __pyx_t_10 = NULL;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      goto __pyx_L6_unpacking_done;
      __pyx_L5_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, 23, __pyx_L1_error)
      __pyx_L6_unpacking_done:;
    }
    if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_mstate_global->__pyx_ptype_8CyOpenGL_vector3))))) __PYX_ERR(2, 23, __pyx_L1_error)
    if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_mstate_global->__pyx_ptype_8CyOpenGL_vector3))))) __PYX_ERR(2, 23, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_V, ((struct __pyx_obj_8CyOpenGL_vector3 *)__pyx_t_7));
    __pyx_t_7 = 0;
    __Pyx_XDECREF_SET(__pyx_v_N, ((struct __pyx_obj_8CyOpenGL_vector3 *)__pyx_t_8));
    __pyx_t_8 = 0;

    /* "opengl/legacy/meshed_surface.pyx":24
 *         self.nv_array = NV = <GLfloat *> malloc(NVsize)
 *         for V, N in zip(self.vertices, self.normals):
 *             NV[0], NV[1], NV[2] = N.x, N.y, N.z             # <<<<<<<<<<<<<<
 *             NV[3], NV[4], NV[5] = V.x, V.y, V.z
 *             NV += 6
*/
    __pyx_t_11 = __pyx_v_N->x;
    __pyx_t_12 = __pyx_v_N->y;
    __pyx_t_13 = __pyx_v_N->z;
    (__pyx_v_NV[0]) = __pyx_t_11;
    (__pyx_v_NV[1]) = __pyx_t_12;
    (__pyx_v_NV[2]) = __pyx_t_13;

    /* "opengl/legacy/meshed_surface.pyx":25
 *         for V, N in zip(self.vertices, self.normals):
 *             NV[0], NV[1], NV[2] = N.x, N.y, N.z
 *             NV[3], NV[4], NV[5] = V.x, V.y, V.z             # <<<<<<<<<<<<<<
 *             NV += 6
 * 
*/
    __pyx_t_13 = __pyx_v_V->x;
    __pyx_t_12 = __pyx_v_V->y;
    __pyx_t_11 = __pyx_v_V->z;
    (__pyx_v_NV[3]) = __pyx_t_13;
    (__pyx_v_NV[4]) = __pyx_t_12;
    (__pyx_v_NV[5]) = __pyx_t_11;

    /* "opengl/legacy/meshed_surface.pyx":26
 *             NV[0], NV[1], NV[2] = N.x, N.y, N.z
 *             NV[3], NV[4], NV[5] = V.x, V.y, V.z
 *             NV += 6             # <<<<<<<<<<<<<<
 * 
 *         self.count = 3*len(self.triangles)
*/
    __pyx_v_NV = (__pyx_v_NV + 6);

    /* "opengl/legacy/meshed_surface.pyx":23
 *         NVsize = 6*len(self.vertices)*sizeof(GLfloat)
 *         self.nv_array = NV = <GLfloat *> malloc(NVsize)
 *         for V, N in zip(self.vertices, self.normals):             # <<<<<<<<<<<<<<
 *             NV[0], NV[1], NV[2] = N.x, N.y, N.z
 *             NV[3], NV[4], NV[5] = V.x, V.y, V.z
*/
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opengl/legacy/meshed_surface.pyx":28
 *             NV += 6
 * 
 *         self.count = 3*len(self.triangles)             # <<<<<<<<<<<<<<
 *         Tsize = self.count*sizeof(GLushort)
 *         self.indices = T = <GLushort *> malloc(Tsize)
*/
  __pyx_t_4 = __pyx_v_self->triangles;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_2 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(2, 28, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyLong_FromSsize_t((3 * __pyx_t_2)); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __Pyx_GOTREF(__pyx_v_self->count);
  __Pyx_DECREF(__pyx_v_self->count);
  __pyx_v_self->count = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "opengl/legacy/meshed_surface.pyx":29
 * 
 *         self.count = 3*len(self.triangles)
 *         Tsize = self.count*sizeof(GLushort)             # <<<<<<<<<<<<<<
 *         self.indices = T = <GLushort *> malloc(Tsize)
 *         for triangle in self.triangles:
*/
  __pyx_t_4 = __Pyx_PyLong_FromSize_t((sizeof(GLushort))); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = PyNumber_Multiply(__pyx_v_self->count, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_Tsize = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "opengl/legacy/meshed_surface.pyx":30
 *         self.count = 3*len(self.triangles)
 *         Tsize = self.count*sizeof(GLushort)
 *         self.indices = T = <GLushort *> malloc(Tsize)             # <<<<<<<<<<<<<<
 *         for triangle in self.triangles:
 *             T[0], T[1], T[2] = triangle
*/
  __pyx_t_5 = __Pyx_PyLong_As_size_t(__pyx_v_Tsize); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 30, __pyx_L1_error)
  __pyx_t_14 = ((GLushort *)malloc(__pyx_t_5));
  __pyx_v_self->indices = __pyx_t_14;
  __pyx_v_T = __pyx_t_14;

  /* "opengl/legacy/meshed_surface.pyx":31
 *         Tsize = self.count*sizeof(GLushort)
 *         self.indices = T = <GLushort *> malloc(Tsize)
 *         for triangle in self.triangles:             # <<<<<<<<<<<<<<
 *             T[0], T[1], T[2] = triangle
 *             T += 3
*/
  if (likely(PyList_CheckExact(__pyx_v_self->triangles)) || PyTuple_CheckExact(__pyx_v_self->triangles)) {
    __pyx_t_1 = __pyx_v_self->triangles; __Pyx_INCREF(__pyx_t_1);
    __pyx_t_2 = 0;
    __pyx_t_6 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_self->triangles); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 31, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 31, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_6)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(2, 31, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference);
        ++__pyx_t_2;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(2, 31, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2));
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2);
        #endif
        ++__pyx_t_2;
      }
      if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 31, __pyx_L1_error)
    } else {
      __pyx_t_4 = __pyx_t_6(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(2, 31, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_XDECREF_SET(__pyx_v_triangle, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "opengl/legacy/meshed_surface.pyx":32
 *         self.indices = T = <GLushort *> malloc(Tsize)
 *         for triangle in self.triangles:
 *             T[0], T[1], T[2] = triangle             # <<<<<<<<<<<<<<
 *             T += 3
 * 
*/
    if ((likely(PyTuple_CheckExact(__pyx_v_triangle))) || (PyList_CheckExact(__pyx_v_triangle))) {
      PyObject* sequence = __pyx_v_triangle;
      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_4 = PyTuple_GET_ITEM(sequence, 0);
        __Pyx_INCREF(__pyx_t_4);
        __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_8);
        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 2);
        __Pyx_INCREF(__pyx_t_7);
      } else {
        __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 32, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_4);
        __pyx_t_8 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 32, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_8);
        __pyx_t_7 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 32, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_7);
      }
      #else
      __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 32, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 32, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 32, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      #endif
    } else {
      Py_ssize_t index = -1;
      __pyx_t_9 = PyObject_GetIter(__pyx_v_triangle); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 32, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9);
      index = 0; __pyx_t_4 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_4)) goto __pyx_L10_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_4);
      index = 1; __pyx_t_8 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_8)) goto __pyx_L10_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_8);
      index = 2; __pyx_t_7 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_7)) goto __pyx_L10_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_7);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 3) < (0)) __PYX_ERR(2, 32, __pyx_L1_error)
      __pyx_t_10 = NULL;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      goto __pyx_L11_unpacking_done;
      __pyx_L10_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, 32, __pyx_L1_error)
      __pyx_L11_unpacking_done:;
    }
    __pyx_t_15 = __Pyx_PyLong_As_GLushort(__pyx_t_4); if (unlikely((__pyx_t_15 == ((GLushort)-1)) && PyErr_Occurred())) __PYX_ERR(2, 32, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_16 = __Pyx_PyLong_As_GLushort(__pyx_t_8); if (unlikely((__pyx_t_16 == ((GLushort)-1)) && PyErr_Occurred())) __PYX_ERR(2, 32, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_17 = __Pyx_PyLong_As_GLushort(__pyx_t_7); if (unlikely((__pyx_t_17 == ((GLushort)-1)) && PyErr_Occurred())) __PYX_ERR(2, 32, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    (__pyx_v_T[0]) = __pyx_t_15;
    (__pyx_v_T[1]) = __pyx_t_16;
    (__pyx_v_T[2]) = __pyx_t_17;

    /* "opengl/legacy/meshed_surface.pyx":33
 *         for triangle in self.triangles:
 *             T[0], T[1], T[2] = triangle
 *             T += 3             # <<<<<<<<<<<<<<
 * 
 *     def draw(self, use_material=True):
*/
    __pyx_v_T = (__pyx_v_T + 3);

    /* "opengl/legacy/meshed_surface.pyx":31
 *         Tsize = self.count*sizeof(GLushort)
 *         self.indices = T = <GLushort *> malloc(Tsize)
 *         for triangle in self.triangles:             # <<<<<<<<<<<<<<
 *             T[0], T[1], T[2] = triangle
 *             T += 3
*/
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/legacy/meshed_surface.pyx":16
 *         free(self.indices)
 * 
 *     def build_arrays(self):             # <<<<<<<<<<<<<<
 *         cdef double scale
 *         cdef vector3 V, N
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("CyOpenGL.MeshedSurface.build_arrays", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_V);
  __Pyx_XDECREF((PyObject *)__pyx_v_N);
  __Pyx_XDECREF(__pyx_v_Tsize);
  __Pyx_XDECREF(__pyx_v_triangle);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opengl/legacy/meshed_surface.pyx":35
 *             T += 3
 * 
 *     def draw(self, use_material=True):             # <<<<<<<<<<<<<<
 *         glNormalPointer(GL_FLOAT, 6*sizeof(GLfloat), self.nv_array)
 *         glVertexPointer(3, GL_FLOAT, 6*sizeof(GLfloat), self.nv_array+3)
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_13MeshedSurface_5draw(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_13MeshedSurface_4draw, "MeshedSurface.draw(self, use_material=True)");
static PyMethodDef __pyx_mdef_8CyOpenGL_13MeshedSurface_5draw = {"draw", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_13MeshedSurface_5draw, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_13MeshedSurface_4draw};
static PyObject *__pyx_pw_8CyOpenGL_13MeshedSurface_5draw(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_use_material = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("draw (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_use_material,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(2, 35, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 35, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "draw", 0) < (0)) __PYX_ERR(2, 35, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_True));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 35, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_True));
    }
    __pyx_v_use_material = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("draw", 0, 0, 1, __pyx_nargs); __PYX_ERR(2, 35, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("CyOpenGL.MeshedSurface.draw", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_13MeshedSurface_4draw(((struct __pyx_obj_8CyOpenGL_MeshedSurface *)__pyx_v_self), __pyx_v_use_material);

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

static PyObject *__pyx_pf_8CyOpenGL_13MeshedSurface_4draw(struct __pyx_obj_8CyOpenGL_MeshedSurface *__pyx_v_self, PyObject *__pyx_v_use_material) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  GLsizei __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("draw", 0);

  /* "opengl/legacy/meshed_surface.pyx":36
 * 
 *     def draw(self, use_material=True):
 *         glNormalPointer(GL_FLOAT, 6*sizeof(GLfloat), self.nv_array)             # <<<<<<<<<<<<<<
 *         glVertexPointer(3, GL_FLOAT, 6*sizeof(GLfloat), self.nv_array+3)
 *         glEnableClientState(GL_NORMAL_ARRAY)
*/
  glNormalPointer(GL_FLOAT, (6 * (sizeof(GLfloat))), __pyx_v_self->nv_array);

  /* "opengl/legacy/meshed_surface.pyx":37
 *     def draw(self, use_material=True):
 *         glNormalPointer(GL_FLOAT, 6*sizeof(GLfloat), self.nv_array)
 *         glVertexPointer(3, GL_FLOAT, 6*sizeof(GLfloat), self.nv_array+3)             # <<<<<<<<<<<<<<
 *         glEnableClientState(GL_NORMAL_ARRAY)
 *         glEnableClientState(GL_VERTEX_ARRAY)
*/
  glVertexPointer(3, GL_FLOAT, (6 * (sizeof(GLfloat))), (__pyx_v_self->nv_array + 3));

  /* "opengl/legacy/meshed_surface.pyx":38
 *         glNormalPointer(GL_FLOAT, 6*sizeof(GLfloat), self.nv_array)
 *         glVertexPointer(3, GL_FLOAT, 6*sizeof(GLfloat), self.nv_array+3)
 *         glEnableClientState(GL_NORMAL_ARRAY)             # <<<<<<<<<<<<<<
 *         glEnableClientState(GL_VERTEX_ARRAY)
 *         glDisableClientState(GL_COLOR_ARRAY)
*/
  glEnableClientState(GL_NORMAL_ARRAY);

  /* "opengl/legacy/meshed_surface.pyx":39
 *         glVertexPointer(3, GL_FLOAT, 6*sizeof(GLfloat), self.nv_array+3)
 *         glEnableClientState(GL_NORMAL_ARRAY)
 *         glEnableClientState(GL_VERTEX_ARRAY)             # <<<<<<<<<<<<<<
 *         glDisableClientState(GL_COLOR_ARRAY)
 *         if use_material:
*/
  glEnableClientState(GL_VERTEX_ARRAY);

  /* "opengl/legacy/meshed_surface.pyx":40
 *         glEnableClientState(GL_NORMAL_ARRAY)
 *         glEnableClientState(GL_VERTEX_ARRAY)
 *         glDisableClientState(GL_COLOR_ARRAY)             # <<<<<<<<<<<<<<
 *         if use_material:
 *             self.set_material()
*/
  glDisableClientState(GL_COLOR_ARRAY);

  /* "opengl/legacy/meshed_surface.pyx":41
 *         glEnableClientState(GL_VERTEX_ARRAY)
 *         glDisableClientState(GL_COLOR_ARRAY)
 *         if use_material:             # <<<<<<<<<<<<<<
 *             self.set_material()
 *         glDrawElements(GL_TRIANGLES, self.count, GL_UNSIGNED_SHORT,
*/
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_use_material); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(2, 41, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "opengl/legacy/meshed_surface.pyx":42
 *         glDisableClientState(GL_COLOR_ARRAY)
 *         if use_material:
 *             self.set_material()             # <<<<<<<<<<<<<<
 *         glDrawElements(GL_TRIANGLES, self.count, GL_UNSIGNED_SHORT,
 *                        self.indices)
*/
    __pyx_t_2 = ((struct __pyx_vtabstruct_8CyOpenGL_MeshedSurface *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_material(((struct __pyx_obj_8CyOpenGL_GLobject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 42, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "opengl/legacy/meshed_surface.pyx":41
 *         glEnableClientState(GL_VERTEX_ARRAY)
 *         glDisableClientState(GL_COLOR_ARRAY)
 *         if use_material:             # <<<<<<<<<<<<<<
 *             self.set_material()
 *         glDrawElements(GL_TRIANGLES, self.count, GL_UNSIGNED_SHORT,
*/
  }

  /* "opengl/legacy/meshed_surface.pyx":43
 *         if use_material:
 *             self.set_material()
 *         glDrawElements(GL_TRIANGLES, self.count, GL_UNSIGNED_SHORT,             # <<<<<<<<<<<<<<
 *                        self.indices)
 *         glDisableClientState(GL_NORMAL_ARRAY)
*/
  __pyx_t_3 = __Pyx_PyLong_As_GLsizei(__pyx_v_self->count); if (unlikely((__pyx_t_3 == ((GLsizei)-1)) && PyErr_Occurred())) __PYX_ERR(2, 43, __pyx_L1_error)

  /* "opengl/legacy/meshed_surface.pyx":44
 *             self.set_material()
 *         glDrawElements(GL_TRIANGLES, self.count, GL_UNSIGNED_SHORT,
 *                        self.indices)             # <<<<<<<<<<<<<<
 *         glDisableClientState(GL_NORMAL_ARRAY)
 *         glDisableClientState(GL_VERTEX_ARRAY)
*/
  glDrawElements(GL_TRIANGLES, __pyx_t_3, GL_UNSIGNED_SHORT, __pyx_v_self->indices);

  /* "opengl/legacy/meshed_surface.pyx":45
 *         glDrawElements(GL_TRIANGLES, self.count, GL_UNSIGNED_SHORT,
 *                        self.indices)
 *         glDisableClientState(GL_NORMAL_ARRAY)             # <<<<<<<<<<<<<<
 *         glDisableClientState(GL_VERTEX_ARRAY)
*/
  glDisableClientState(GL_NORMAL_ARRAY);

  /* "opengl/legacy/meshed_surface.pyx":46
 *                        self.indices)
 *         glDisableClientState(GL_NORMAL_ARRAY)
 *         glDisableClientState(GL_VERTEX_ARRAY)             # <<<<<<<<<<<<<<
*/
  glDisableClientState(GL_VERTEX_ARRAY);

  /* "opengl/legacy/meshed_surface.pyx":35
 *             T += 3
 * 
 *     def draw(self, use_material=True):             # <<<<<<<<<<<<<<
 *         glNormalPointer(GL_FLOAT, 6*sizeof(GLfloat), self.nv_array)
 *         glVertexPointer(3, GL_FLOAT, 6*sizeof(GLfloat), self.nv_array+3)
*/

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

/* "opengl/legacy/poincare_triangle.pyx":14
 *     cdef center, mesh, original_vertices
 * 
 *     def __init__(self, vertices, center, subdivision_depth=4, **kwargs):             # <<<<<<<<<<<<<<
 *         self.original_vertices = vertices
 *         self.center = center
*/

/* Python wrapper */
static int __pyx_pw_8CyOpenGL_16PoincareTriangle_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_8CyOpenGL_16PoincareTriangle_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_vertices = 0;
  PyObject *__pyx_v_center = 0;
  PyObject *__pyx_v_subdivision_depth = 0;
  CYTHON_UNUSED PyObject *__pyx_v_kwargs = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_vertices,&__pyx_mstate_global->__pyx_n_u_center,&__pyx_mstate_global->__pyx_n_u_subdivision_depth,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(15, 14, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(15, 14, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(15, 14, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(15, 14, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, __pyx_v_kwargs, values, kwd_pos_args, __pyx_kwds_len, "__init__", 1) < (0)) __PYX_ERR(15, 14, __pyx_L3_error)
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_4));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, i); __PYX_ERR(15, 14, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(15, 14, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(15, 14, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(15, 14, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_4));
    }
    __pyx_v_vertices = values[0];
    __pyx_v_center = values[1];
    __pyx_v_subdivision_depth = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, __pyx_nargs); __PYX_ERR(15, 14, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_XDECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("CyOpenGL.PoincareTriangle.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_16PoincareTriangle___init__(((struct __pyx_obj_8CyOpenGL_PoincareTriangle *)__pyx_v_self), __pyx_v_vertices, __pyx_v_center, __pyx_v_subdivision_depth, __pyx_v_kwargs);

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

static int __pyx_pf_8CyOpenGL_16PoincareTriangle___init__(struct __pyx_obj_8CyOpenGL_PoincareTriangle *__pyx_v_self, PyObject *__pyx_v_vertices, PyObject *__pyx_v_center, PyObject *__pyx_v_subdivision_depth, CYTHON_UNUSED PyObject *__pyx_v_kwargs) {
  CYTHON_UNUSED PyObject *__pyx_v_n = NULL;
  PyObject *__pyx_v_normals = NULL;
  PyObject *__pyx_v_vertex = NULL;
  PyObject *__pyx_v_scale = NULL;
  PyObject *__pyx_v_V = NULL;
  PyObject *__pyx_v_N = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  Py_ssize_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  long __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  int __pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);
  __Pyx_INCREF(__pyx_v_vertices);

  /* "opengl/legacy/poincare_triangle.pyx":15
 * 
 *     def __init__(self, vertices, center, subdivision_depth=4, **kwargs):
 *         self.original_vertices = vertices             # <<<<<<<<<<<<<<
 *         self.center = center
 *         self.mesh = TriangleMesh(vertices)
*/
  __Pyx_INCREF(__pyx_v_vertices);
  __Pyx_GIVEREF(__pyx_v_vertices);
  __Pyx_GOTREF(__pyx_v_self->original_vertices);
  __Pyx_DECREF(__pyx_v_self->original_vertices);
  __pyx_v_self->original_vertices = __pyx_v_vertices;

  /* "opengl/legacy/poincare_triangle.pyx":16
 *     def __init__(self, vertices, center, subdivision_depth=4, **kwargs):
 *         self.original_vertices = vertices
 *         self.center = center             # <<<<<<<<<<<<<<
 *         self.mesh = TriangleMesh(vertices)
 *         for n in range(subdivision_depth):
*/
  __Pyx_INCREF(__pyx_v_center);
  __Pyx_GIVEREF(__pyx_v_center);
  __Pyx_GOTREF(__pyx_v_self->center);
  __Pyx_DECREF(__pyx_v_self->center);
  __pyx_v_self->center = __pyx_v_center;

  /* "opengl/legacy/poincare_triangle.pyx":17
 *         self.original_vertices = vertices
 *         self.center = center
 *         self.mesh = TriangleMesh(vertices)             # <<<<<<<<<<<<<<
 *         for n in range(subdivision_depth):
 *             self.mesh.subdivide()
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_TriangleMesh); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_vertices};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 17, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->mesh);
  __Pyx_DECREF(__pyx_v_self->mesh);
  __pyx_v_self->mesh = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "opengl/legacy/poincare_triangle.pyx":18
 *         self.center = center
 *         self.mesh = TriangleMesh(vertices)
 *         for n in range(subdivision_depth):             # <<<<<<<<<<<<<<
 *             self.mesh.subdivide()
 * 
*/
  __pyx_t_3 = NULL;
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_subdivision_depth};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(&PyRange_Type), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 18, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(15, 18, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    {
      __pyx_t_1 = __pyx_t_5(__pyx_t_3);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(15, 18, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "opengl/legacy/poincare_triangle.pyx":19
 *         self.mesh = TriangleMesh(vertices)
 *         for n in range(subdivision_depth):
 *             self.mesh.subdivide()             # <<<<<<<<<<<<<<
 * 
 * 
*/
    __pyx_t_2 = __pyx_v_self->mesh;
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_subdivide, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 19, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "opengl/legacy/poincare_triangle.pyx":18
 *         self.center = center
 *         self.mesh = TriangleMesh(vertices)
 *         for n in range(subdivision_depth):             # <<<<<<<<<<<<<<
 *             self.mesh.subdivide()
 * 
*/
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "opengl/legacy/poincare_triangle.pyx":22
 * 
 * 
 *         self.triangles = self.mesh.triangles             # <<<<<<<<<<<<<<
 *         self.vertices = vertices = []
 *         self.normals = normals = []
*/
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->mesh, __pyx_mstate_global->__pyx_n_u_triangles); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_GOTREF(__pyx_v_self->__pyx_base.triangles);
  __Pyx_DECREF(__pyx_v_self->__pyx_base.triangles);
  __pyx_v_self->__pyx_base.triangles = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "opengl/legacy/poincare_triangle.pyx":23
 * 
 *         self.triangles = self.mesh.triangles
 *         self.vertices = vertices = []             # <<<<<<<<<<<<<<
 *         self.normals = normals = []
 *         for vertex in self.mesh.vertices:
*/
  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_GOTREF(__pyx_v_self->__pyx_base.vertices);
  __Pyx_DECREF(__pyx_v_self->__pyx_base.vertices);
  __pyx_v_self->__pyx_base.vertices = __pyx_t_3;
  __Pyx_INCREF(__pyx_t_3);
  __Pyx_DECREF_SET(__pyx_v_vertices, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "opengl/legacy/poincare_triangle.pyx":24
 *         self.triangles = self.mesh.triangles
 *         self.vertices = vertices = []
 *         self.normals = normals = []             # <<<<<<<<<<<<<<
 *         for vertex in self.mesh.vertices:
 *             scale = 1 + sqrt(max(0, 1 - vertex.norm_squared))
*/
  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_GOTREF(__pyx_v_self->__pyx_base.normals);
  __Pyx_DECREF(__pyx_v_self->__pyx_base.normals);
  __pyx_v_self->__pyx_base.normals = __pyx_t_3;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_v_normals = __pyx_t_3;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "opengl/legacy/poincare_triangle.pyx":25
 *         self.vertices = vertices = []
 *         self.normals = normals = []
 *         for vertex in self.mesh.vertices:             # <<<<<<<<<<<<<<
 *             scale = 1 + sqrt(max(0, 1 - vertex.norm_squared))
 *             V = vertex/scale
*/
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->mesh, __pyx_mstate_global->__pyx_n_u_vertices); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 25, __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_6 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 25, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(15, 25, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(15, 25, __pyx_L1_error)
          #endif
          if (__pyx_t_6 >= __pyx_temp) break;
        }
        __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_6, __Pyx_ReferenceSharing_OwnStrongReference);
        ++__pyx_t_6;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(15, 25, __pyx_L1_error)
          #endif
          if (__pyx_t_6 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6));
        #else
        __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6);
        #endif
        ++__pyx_t_6;
      }
      if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 25, __pyx_L1_error)
    } else {
      __pyx_t_3 = __pyx_t_5(__pyx_t_1);
      if (unlikely(!__pyx_t_3)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(15, 25, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_XDECREF_SET(__pyx_v_vertex, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "opengl/legacy/poincare_triangle.pyx":26
 *         self.normals = normals = []
 *         for vertex in self.mesh.vertices:
 *             scale = 1 + sqrt(max(0, 1 - vertex.norm_squared))             # <<<<<<<<<<<<<<
 *             V = vertex/scale
 *             N = self.center - V
*/
    __pyx_t_2 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_sqrt); if (unlikely(!__pyx_t_7)) __PYX_ERR(15, 26, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_vertex, __pyx_mstate_global->__pyx_n_u_norm_squared); if (unlikely(!__pyx_t_8)) __PYX_ERR(15, 26, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = __Pyx_PyLong_SubtractCObj(__pyx_mstate_global->__pyx_int_1, __pyx_t_8, 1, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(15, 26, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_10 = 0;
    __pyx_t_11 = __Pyx_PyLong_From_long(__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(15, 26, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_12 = PyObject_RichCompare(__pyx_t_9, __pyx_t_11, Py_GT); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) __PYX_ERR(15, 26, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(15, 26, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    if (__pyx_t_13) {
      __Pyx_INCREF(__pyx_t_9);
      __pyx_t_8 = __pyx_t_9;
    } else {
      __pyx_t_12 = __Pyx_PyLong_From_long(__pyx_t_10); if (unlikely(!__pyx_t_12)) __PYX_ERR(15, 26, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_8 = __pyx_t_12;
      __pyx_t_12 = 0;
    }
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_4 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_7);
      assert(__pyx_t_2);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
      __pyx_t_4 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_8};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 26, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __pyx_t_7 = __Pyx_PyLong_AddCObj(__pyx_mstate_global->__pyx_int_1, __pyx_t_3, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(15, 26, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF_SET(__pyx_v_scale, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "opengl/legacy/poincare_triangle.pyx":27
 *         for vertex in self.mesh.vertices:
 *             scale = 1 + sqrt(max(0, 1 - vertex.norm_squared))
 *             V = vertex/scale             # <<<<<<<<<<<<<<
 *             N = self.center - V
 *             N = N/N.norm
*/
    __pyx_t_7 = __Pyx_PyNumber_Divide(__pyx_v_vertex, __pyx_v_scale); if (unlikely(!__pyx_t_7)) __PYX_ERR(15, 27, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_XDECREF_SET(__pyx_v_V, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "opengl/legacy/poincare_triangle.pyx":28
 *             scale = 1 + sqrt(max(0, 1 - vertex.norm_squared))
 *             V = vertex/scale
 *             N = self.center - V             # <<<<<<<<<<<<<<
 *             N = N/N.norm
 *             vertices.append(V)
*/
    __pyx_t_7 = PyNumber_Subtract(__pyx_v_self->center, __pyx_v_V); if (unlikely(!__pyx_t_7)) __PYX_ERR(15, 28, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_XDECREF_SET(__pyx_v_N, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "opengl/legacy/poincare_triangle.pyx":29
 *             V = vertex/scale
 *             N = self.center - V
 *             N = N/N.norm             # <<<<<<<<<<<<<<
 *             vertices.append(V)
 *             normals.append(N)
*/
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_N, __pyx_mstate_global->__pyx_n_u_norm); if (unlikely(!__pyx_t_7)) __PYX_ERR(15, 29, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_v_N, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 29, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF_SET(__pyx_v_N, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "opengl/legacy/poincare_triangle.pyx":30
 *             N = self.center - V
 *             N = N/N.norm
 *             vertices.append(V)             # <<<<<<<<<<<<<<
 *             normals.append(N)
 *         self.build_arrays()
*/
    __pyx_t_14 = __Pyx_PyObject_Append(__pyx_v_vertices, __pyx_v_V); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(15, 30, __pyx_L1_error)

    /* "opengl/legacy/poincare_triangle.pyx":31
 *             N = N/N.norm
 *             vertices.append(V)
 *             normals.append(N)             # <<<<<<<<<<<<<<
 *         self.build_arrays()
*/
    __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_normals, __pyx_v_N); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(15, 31, __pyx_L1_error)

    /* "opengl/legacy/poincare_triangle.pyx":25
 *         self.vertices = vertices = []
 *         self.normals = normals = []
 *         for vertex in self.mesh.vertices:             # <<<<<<<<<<<<<<
 *             scale = 1 + sqrt(max(0, 1 - vertex.norm_squared))
 *             V = vertex/scale
*/
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/legacy/poincare_triangle.pyx":32
 *             vertices.append(V)
 *             normals.append(N)
 *         self.build_arrays()             # <<<<<<<<<<<<<<
*/
  __pyx_t_3 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_build_arrays, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 32, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/legacy/poincare_triangle.pyx":14
 *     cdef center, mesh, original_vertices
 * 
 *     def __init__(self, vertices, center, subdivision_depth=4, **kwargs):             # <<<<<<<<<<<<<<
 *         self.original_vertices = vertices
 *         self.center = center
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("CyOpenGL.PoincareTriangle.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_n);
  __Pyx_XDECREF(__pyx_v_normals);
  __Pyx_XDECREF(__pyx_v_vertex);
  __Pyx_XDECREF(__pyx_v_scale);
  __Pyx_XDECREF(__pyx_v_V);
  __Pyx_XDECREF(__pyx_v_N);
  __Pyx_XDECREF(__pyx_v_vertices);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opengl/legacy/poincare_polygon.pyx":12
 *     cdef vertices, center, triangles
 * 
 *     def __init__(self, vertices, center, **kwargs):             # <<<<<<<<<<<<<<
 *         self.vertices = vertices
 *         self.center = center
*/

/* Python wrapper */
static int __pyx_pw_8CyOpenGL_15PoincarePolygon_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_8CyOpenGL_15PoincarePolygon_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_vertices = 0;
  PyObject *__pyx_v_center = 0;
  CYTHON_UNUSED PyObject *__pyx_v_kwargs = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_vertices,&__pyx_mstate_global->__pyx_n_u_center,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(3, 12, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(3, 12, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 12, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, __pyx_v_kwargs, values, kwd_pos_args, __pyx_kwds_len, "__init__", 1) < (0)) __PYX_ERR(3, 12, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, i); __PYX_ERR(3, 12, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 12, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(3, 12, __pyx_L3_error)
    }
    __pyx_v_vertices = values[0];
    __pyx_v_center = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(3, 12, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_XDECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("CyOpenGL.PoincarePolygon.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_15PoincarePolygon___init__(((struct __pyx_obj_8CyOpenGL_PoincarePolygon *)__pyx_v_self), __pyx_v_vertices, __pyx_v_center, __pyx_v_kwargs);

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

static int __pyx_pf_8CyOpenGL_15PoincarePolygon___init__(struct __pyx_obj_8CyOpenGL_PoincarePolygon *__pyx_v_self, PyObject *__pyx_v_vertices, PyObject *__pyx_v_center, CYTHON_UNUSED PyObject *__pyx_v_kwargs) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "opengl/legacy/poincare_polygon.pyx":13
 * 
 *     def __init__(self, vertices, center, **kwargs):
 *         self.vertices = vertices             # <<<<<<<<<<<<<<
 *         self.center = center
 *         self.triangulate()
*/
  __Pyx_INCREF(__pyx_v_vertices);
  __Pyx_GIVEREF(__pyx_v_vertices);
  __Pyx_GOTREF(__pyx_v_self->vertices);
  __Pyx_DECREF(__pyx_v_self->vertices);
  __pyx_v_self->vertices = __pyx_v_vertices;

  /* "opengl/legacy/poincare_polygon.pyx":14
 *     def __init__(self, vertices, center, **kwargs):
 *         self.vertices = vertices
 *         self.center = center             # <<<<<<<<<<<<<<
 *         self.triangulate()
 * 
*/
  __Pyx_INCREF(__pyx_v_center);
  __Pyx_GIVEREF(__pyx_v_center);
  __Pyx_GOTREF(__pyx_v_self->center);
  __Pyx_DECREF(__pyx_v_self->center);
  __pyx_v_self->center = __pyx_v_center;

  /* "opengl/legacy/poincare_polygon.pyx":15
 *         self.vertices = vertices
 *         self.center = center
 *         self.triangulate()             # <<<<<<<<<<<<<<
 * 
 *     cdef triangulate(self):
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_8CyOpenGL_PoincarePolygon *)__pyx_v_self->__pyx_base.__pyx_vtab)->triangulate(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/legacy/poincare_polygon.pyx":12
 *     cdef vertices, center, triangles
 * 
 *     def __init__(self, vertices, center, **kwargs):             # <<<<<<<<<<<<<<
 *         self.vertices = vertices
 *         self.center = center
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("CyOpenGL.PoincarePolygon.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opengl/legacy/poincare_polygon.pyx":17
 *         self.triangulate()
 * 
 *     cdef triangulate(self):             # <<<<<<<<<<<<<<
 *         Vlist = self.vertices
 *         zero = vector3((0,0,0))
*/

static PyObject *__pyx_f_8CyOpenGL_15PoincarePolygon_triangulate(struct __pyx_obj_8CyOpenGL_PoincarePolygon *__pyx_v_self) {
  PyObject *__pyx_v_Vlist = NULL;
  struct __pyx_obj_8CyOpenGL_vector3 *__pyx_v_zero = NULL;
  PyObject *__pyx_v_N = NULL;
  PyObject *__pyx_v_centroid = NULL;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_vertices = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("triangulate", 0);

  /* "opengl/legacy/poincare_polygon.pyx":18
 * 
 *     cdef triangulate(self):
 *         Vlist = self.vertices             # <<<<<<<<<<<<<<
 *         zero = vector3((0,0,0))
 *         N = len(Vlist)
*/
  __pyx_t_1 = __pyx_v_self->vertices;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_Vlist = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "opengl/legacy/poincare_polygon.pyx":19
 *     cdef triangulate(self):
 *         Vlist = self.vertices
 *         zero = vector3((0,0,0))             # <<<<<<<<<<<<<<
 *         N = len(Vlist)
 *         self.triangles = []
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_tuple[2]};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8CyOpenGL_vector3, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 19, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_zero = ((struct __pyx_obj_8CyOpenGL_vector3 *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "opengl/legacy/poincare_polygon.pyx":20
 *         Vlist = self.vertices
 *         zero = vector3((0,0,0))
 *         N = len(Vlist)             # <<<<<<<<<<<<<<
 *         self.triangles = []
 *         centroid = sum(Vlist, zero)/N
*/
  __pyx_t_4 = PyObject_Length(__pyx_v_Vlist); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(3, 20, __pyx_L1_error)
  __pyx_t_1 = PyLong_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_N = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "opengl/legacy/poincare_polygon.pyx":21
 *         zero = vector3((0,0,0))
 *         N = len(Vlist)
 *         self.triangles = []             # <<<<<<<<<<<<<<
 *         centroid = sum(Vlist, zero)/N
 *         for i in range(0,N):
*/
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->triangles);
  __Pyx_DECREF(__pyx_v_self->triangles);
  __pyx_v_self->triangles = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "opengl/legacy/poincare_polygon.pyx":22
 *         N = len(Vlist)
 *         self.triangles = []
 *         centroid = sum(Vlist, zero)/N             # <<<<<<<<<<<<<<
 *         for i in range(0,N):
 *             vertices = [centroid, Vlist[i-1],Vlist[i]]
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_Vlist, ((PyObject *)__pyx_v_zero)};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_sum, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 22, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_v_N); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_centroid = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "opengl/legacy/poincare_polygon.pyx":23
 *         self.triangles = []
 *         centroid = sum(Vlist, zero)/N
 *         for i in range(0,N):             # <<<<<<<<<<<<<<
 *             vertices = [centroid, Vlist[i-1],Vlist[i]]
 *             self.triangles.append(PoincareTriangle(vertices, self.center))
*/
  __pyx_t_1 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_mstate_global->__pyx_int_0, __pyx_v_N};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(&PyRange_Type), __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 23, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 23, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    {
      __pyx_t_2 = __pyx_t_5(__pyx_t_1);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(3, 23, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "opengl/legacy/poincare_polygon.pyx":24
 *         centroid = sum(Vlist, zero)/N
 *         for i in range(0,N):
 *             vertices = [centroid, Vlist[i-1],Vlist[i]]             # <<<<<<<<<<<<<<
 *             self.triangles.append(PoincareTriangle(vertices, self.center))
 * 
*/
    __pyx_t_2 = __Pyx_PyLong_SubtractObjC(__pyx_v_i, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 24, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_Vlist, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 24, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_Vlist, __pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 24, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_7 = PyList_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 24, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_INCREF(__pyx_v_centroid);
    __Pyx_GIVEREF(__pyx_v_centroid);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 0, __pyx_v_centroid) != (0)) __PYX_ERR(3, 24, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_6);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 1, __pyx_t_6) != (0)) __PYX_ERR(3, 24, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_2);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 2, __pyx_t_2) != (0)) __PYX_ERR(3, 24, __pyx_L1_error);
    __pyx_t_6 = 0;
    __pyx_t_2 = 0;
    __Pyx_XDECREF_SET(__pyx_v_vertices, ((PyObject*)__pyx_t_7));
    __pyx_t_7 = 0;

    /* "opengl/legacy/poincare_polygon.pyx":25
 *         for i in range(0,N):
 *             vertices = [centroid, Vlist[i-1],Vlist[i]]
 *             self.triangles.append(PoincareTriangle(vertices, self.center))             # <<<<<<<<<<<<<<
 * 
 *     def draw(self):
*/
    __pyx_t_2 = NULL;
    __pyx_t_3 = 1;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_vertices, __pyx_v_self->center};
      __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8CyOpenGL_PoincareTriangle, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 25, __pyx_L1_error)
      __Pyx_GOTREF((PyObject *)__pyx_t_7);
    }
    __pyx_t_8 = __Pyx_PyObject_Append(__pyx_v_self->triangles, ((PyObject *)__pyx_t_7)); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(3, 25, __pyx_L1_error)
    __Pyx_DECREF((PyObject *)__pyx_t_7); __pyx_t_7 = 0;

    /* "opengl/legacy/poincare_polygon.pyx":23
 *         self.triangles = []
 *         centroid = sum(Vlist, zero)/N
 *         for i in range(0,N):             # <<<<<<<<<<<<<<
 *             vertices = [centroid, Vlist[i-1],Vlist[i]]
 *             self.triangles.append(PoincareTriangle(vertices, self.center))
*/
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/legacy/poincare_polygon.pyx":17
 *         self.triangulate()
 * 
 *     cdef triangulate(self):             # <<<<<<<<<<<<<<
 *         Vlist = self.vertices
 *         zero = vector3((0,0,0))
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("CyOpenGL.PoincarePolygon.triangulate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_Vlist);
  __Pyx_XDECREF((PyObject *)__pyx_v_zero);
  __Pyx_XDECREF(__pyx_v_N);
  __Pyx_XDECREF(__pyx_v_centroid);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_vertices);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opengl/legacy/poincare_polygon.pyx":27
 *             self.triangles.append(PoincareTriangle(vertices, self.center))
 * 
 *     def draw(self):             # <<<<<<<<<<<<<<
 *         self.set_material()
 *         for triangle in self.triangles:
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_15PoincarePolygon_3draw(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_15PoincarePolygon_2draw, "PoincarePolygon.draw(self)");
static PyMethodDef __pyx_mdef_8CyOpenGL_15PoincarePolygon_3draw = {"draw", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_15PoincarePolygon_3draw, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_15PoincarePolygon_2draw};
static PyObject *__pyx_pw_8CyOpenGL_15PoincarePolygon_3draw(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("draw (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("draw", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("draw", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8CyOpenGL_15PoincarePolygon_2draw(((struct __pyx_obj_8CyOpenGL_PoincarePolygon *)__pyx_v_self));

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

static PyObject *__pyx_pf_8CyOpenGL_15PoincarePolygon_2draw(struct __pyx_obj_8CyOpenGL_PoincarePolygon *__pyx_v_self) {
  PyObject *__pyx_v_triangle = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("draw", 0);

  /* "opengl/legacy/poincare_polygon.pyx":28
 * 
 *     def draw(self):
 *         self.set_material()             # <<<<<<<<<<<<<<
 *         for triangle in self.triangles:
 *             triangle.draw(use_material=False)
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_8CyOpenGL_PoincarePolygon *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_material(((struct __pyx_obj_8CyOpenGL_GLobject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/legacy/poincare_polygon.pyx":29
 *     def draw(self):
 *         self.set_material()
 *         for triangle in self.triangles:             # <<<<<<<<<<<<<<
 *             triangle.draw(use_material=False)
*/
  if (likely(PyList_CheckExact(__pyx_v_self->triangles)) || PyTuple_CheckExact(__pyx_v_self->triangles)) {
    __pyx_t_1 = __pyx_v_self->triangles; __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->triangles); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 29, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 29, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(3, 29, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference);
        ++__pyx_t_2;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(3, 29, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2));
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2);
        #endif
        ++__pyx_t_2;
      }
      if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 29, __pyx_L1_error)
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(3, 29, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_XDECREF_SET(__pyx_v_triangle, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "opengl/legacy/poincare_polygon.pyx":30
 *         self.set_material()
 *         for triangle in self.triangles:
 *             triangle.draw(use_material=False)             # <<<<<<<<<<<<<<
*/
    __pyx_t_5 = __pyx_v_triangle;
    __Pyx_INCREF(__pyx_t_5);
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_5, NULL};
      __pyx_t_7 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 30, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_use_material, Py_False, __pyx_t_7, __pyx_callargs+1, 0) < (0)) __PYX_ERR(3, 30, __pyx_L1_error)
      __pyx_t_4 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_draw, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_7);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 30, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "opengl/legacy/poincare_polygon.pyx":29
 *     def draw(self):
 *         self.set_material()
 *         for triangle in self.triangles:             # <<<<<<<<<<<<<<
 *             triangle.draw(use_material=False)
*/
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/legacy/poincare_polygon.pyx":27
 *             self.triangles.append(PoincareTriangle(vertices, self.center))
 * 
 *     def draw(self):             # <<<<<<<<<<<<<<
 *         self.set_material()
 *         for triangle in self.triangles:
*/

  /* 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_7);
  __Pyx_AddTraceback("CyOpenGL.PoincarePolygon.draw", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_triangle);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opengl/legacy/klein_polygon.pyx":11
 *     cdef vertices, closest
 * 
 *     def __init__(self, vertices, closest, **kwargs):             # <<<<<<<<<<<<<<
 *         self.vertices = vertices
 *         self.closest = closest
*/

/* Python wrapper */
static int __pyx_pw_8CyOpenGL_12KleinPolygon_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_8CyOpenGL_12KleinPolygon_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_vertices = 0;
  PyObject *__pyx_v_closest = 0;
  CYTHON_UNUSED PyObject *__pyx_v_kwargs = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_vertices,&__pyx_mstate_global->__pyx_n_u_closest,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(16, 11, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(16, 11, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(16, 11, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, __pyx_v_kwargs, values, kwd_pos_args, __pyx_kwds_len, "__init__", 1) < (0)) __PYX_ERR(16, 11, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, i); __PYX_ERR(16, 11, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(16, 11, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(16, 11, __pyx_L3_error)
    }
    __pyx_v_vertices = values[0];
    __pyx_v_closest = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(16, 11, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_XDECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("CyOpenGL.KleinPolygon.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_12KleinPolygon___init__(((struct __pyx_obj_8CyOpenGL_KleinPolygon *)__pyx_v_self), __pyx_v_vertices, __pyx_v_closest, __pyx_v_kwargs);

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

static int __pyx_pf_8CyOpenGL_12KleinPolygon___init__(struct __pyx_obj_8CyOpenGL_KleinPolygon *__pyx_v_self, PyObject *__pyx_v_vertices, PyObject *__pyx_v_closest, CYTHON_UNUSED PyObject *__pyx_v_kwargs) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "opengl/legacy/klein_polygon.pyx":12
 * 
 *     def __init__(self, vertices, closest, **kwargs):
 *         self.vertices = vertices             # <<<<<<<<<<<<<<
 *         self.closest = closest
 * 
*/
  __Pyx_INCREF(__pyx_v_vertices);
  __Pyx_GIVEREF(__pyx_v_vertices);
  __Pyx_GOTREF(__pyx_v_self->vertices);
  __Pyx_DECREF(__pyx_v_self->vertices);
  __pyx_v_self->vertices = __pyx_v_vertices;

  /* "opengl/legacy/klein_polygon.pyx":13
 *     def __init__(self, vertices, closest, **kwargs):
 *         self.vertices = vertices
 *         self.closest = closest             # <<<<<<<<<<<<<<
 * 
 *     def draw(self):
*/
  __Pyx_INCREF(__pyx_v_closest);
  __Pyx_GIVEREF(__pyx_v_closest);
  __Pyx_GOTREF(__pyx_v_self->closest);
  __Pyx_DECREF(__pyx_v_self->closest);
  __pyx_v_self->closest = __pyx_v_closest;

  /* "opengl/legacy/klein_polygon.pyx":11
 *     cdef vertices, closest
 * 
 *     def __init__(self, vertices, closest, **kwargs):             # <<<<<<<<<<<<<<
 *         self.vertices = vertices
 *         self.closest = closest
*/

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

/* "opengl/legacy/klein_polygon.pyx":15
 *         self.closest = closest
 * 
 *     def draw(self):             # <<<<<<<<<<<<<<
 *         N = self.closest/self.closest.norm
 *         self.set_material()
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_12KleinPolygon_3draw(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_12KleinPolygon_2draw, "KleinPolygon.draw(self)");
static PyMethodDef __pyx_mdef_8CyOpenGL_12KleinPolygon_3draw = {"draw", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_12KleinPolygon_3draw, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_12KleinPolygon_2draw};
static PyObject *__pyx_pw_8CyOpenGL_12KleinPolygon_3draw(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("draw (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("draw", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("draw", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8CyOpenGL_12KleinPolygon_2draw(((struct __pyx_obj_8CyOpenGL_KleinPolygon *)__pyx_v_self));

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

static PyObject *__pyx_pf_8CyOpenGL_12KleinPolygon_2draw(struct __pyx_obj_8CyOpenGL_KleinPolygon *__pyx_v_self) {
  PyObject *__pyx_v_N = NULL;
  PyObject *__pyx_v_V = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  GLfloat __pyx_t_3;
  GLfloat __pyx_t_4;
  GLfloat __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("draw", 0);

  /* "opengl/legacy/klein_polygon.pyx":16
 * 
 *     def draw(self):
 *         N = self.closest/self.closest.norm             # <<<<<<<<<<<<<<
 *         self.set_material()
 *         glBegin(GL_POLYGON)
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->closest, __pyx_mstate_global->__pyx_n_u_norm); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_v_self->closest, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(16, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_N = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "opengl/legacy/klein_polygon.pyx":17
 *     def draw(self):
 *         N = self.closest/self.closest.norm
 *         self.set_material()             # <<<<<<<<<<<<<<
 *         glBegin(GL_POLYGON)
 *         glNormal3f(N.x, N.y, N.z)
*/
  __pyx_t_2 = ((struct __pyx_vtabstruct_8CyOpenGL_KleinPolygon *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_material(((struct __pyx_obj_8CyOpenGL_GLobject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(16, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opengl/legacy/klein_polygon.pyx":18
 *         N = self.closest/self.closest.norm
 *         self.set_material()
 *         glBegin(GL_POLYGON)             # <<<<<<<<<<<<<<
 *         glNormal3f(N.x, N.y, N.z)
 *         for V in self.vertices:
*/
  glBegin(GL_POLYGON);

  /* "opengl/legacy/klein_polygon.pyx":19
 *         self.set_material()
 *         glBegin(GL_POLYGON)
 *         glNormal3f(N.x, N.y, N.z)             # <<<<<<<<<<<<<<
 *         for V in self.vertices:
 *             glVertex3f(V.x, V.y, V.z)
*/
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_N, __pyx_mstate_global->__pyx_n_u_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(16, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_3 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(16, 19, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_N, __pyx_mstate_global->__pyx_n_u_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(16, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_4 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(16, 19, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_N, __pyx_mstate_global->__pyx_n_u_z); if (unlikely(!__pyx_t_2)) __PYX_ERR(16, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_5 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(16, 19, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  glNormal3f(__pyx_t_3, __pyx_t_4, __pyx_t_5);

  /* "opengl/legacy/klein_polygon.pyx":20
 *         glBegin(GL_POLYGON)
 *         glNormal3f(N.x, N.y, N.z)
 *         for V in self.vertices:             # <<<<<<<<<<<<<<
 *             glVertex3f(V.x, V.y, V.z)
 *         glEnd()
*/
  if (likely(PyList_CheckExact(__pyx_v_self->vertices)) || PyTuple_CheckExact(__pyx_v_self->vertices)) {
    __pyx_t_2 = __pyx_v_self->vertices; __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_self->vertices); if (unlikely(!__pyx_t_2)) __PYX_ERR(16, 20, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(16, 20, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_7)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(16, 20, __pyx_L1_error)
          #endif
          if (__pyx_t_6 >= __pyx_temp) break;
        }
        __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_2, __pyx_t_6, __Pyx_ReferenceSharing_OwnStrongReference);
        ++__pyx_t_6;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(16, 20, __pyx_L1_error)
          #endif
          if (__pyx_t_6 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6));
        #else
        __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6);
        #endif
        ++__pyx_t_6;
      }
      if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 20, __pyx_L1_error)
    } else {
      __pyx_t_1 = __pyx_t_7(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(16, 20, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_V, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "opengl/legacy/klein_polygon.pyx":21
 *         glNormal3f(N.x, N.y, N.z)
 *         for V in self.vertices:
 *             glVertex3f(V.x, V.y, V.z)             # <<<<<<<<<<<<<<
 *         glEnd()
*/
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_V, __pyx_mstate_global->__pyx_n_u_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 21, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_5 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(16, 21, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_V, __pyx_mstate_global->__pyx_n_u_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 21, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_4 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(16, 21, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_V, __pyx_mstate_global->__pyx_n_u_z); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 21, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_3 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(16, 21, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    glVertex3f(__pyx_t_5, __pyx_t_4, __pyx_t_3);

    /* "opengl/legacy/klein_polygon.pyx":20
 *         glBegin(GL_POLYGON)
 *         glNormal3f(N.x, N.y, N.z)
 *         for V in self.vertices:             # <<<<<<<<<<<<<<
 *             glVertex3f(V.x, V.y, V.z)
 *         glEnd()
*/
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opengl/legacy/klein_polygon.pyx":22
 *         for V in self.vertices:
 *             glVertex3f(V.x, V.y, V.z)
 *         glEnd()             # <<<<<<<<<<<<<<
*/
  glEnd();

  /* "opengl/legacy/klein_polygon.pyx":15
 *         self.closest = closest
 * 
 *     def draw(self):             # <<<<<<<<<<<<<<
 *         N = self.closest/self.closest.norm
 *         self.set_material()
*/

  /* 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("CyOpenGL.KleinPolygon.draw", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_N);
  __Pyx_XDECREF(__pyx_v_V);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opengl/legacy/hyperbolic_polyhedron.pyx":10
 *     """
 * 
 *     def __init__(self, facedicts, model_var, sphere_var, togl_widget=None):             # <<<<<<<<<<<<<<
 *         self.facedicts = facedicts
 *         self.model = model_var
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_20HyperbolicPolyhedron_1__init__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_20HyperbolicPolyhedron___init__, "HyperbolicPolyhedron.__init__(self, facedicts, model_var, sphere_var, togl_widget=None)");
static PyMethodDef __pyx_mdef_8CyOpenGL_20HyperbolicPolyhedron_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_20HyperbolicPolyhedron_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_20HyperbolicPolyhedron___init__};
static PyObject *__pyx_pw_8CyOpenGL_20HyperbolicPolyhedron_1__init__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_facedicts = 0;
  PyObject *__pyx_v_model_var = 0;
  PyObject *__pyx_v_sphere_var = 0;
  PyObject *__pyx_v_togl_widget = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[5] = {0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_facedicts,&__pyx_mstate_global->__pyx_n_u_model_var,&__pyx_mstate_global->__pyx_n_u_sphere_var,&__pyx_mstate_global->__pyx_n_u_togl_widget,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(17, 10, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(17, 10, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(17, 10, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(17, 10, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(17, 10, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(17, 10, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(17, 10, __pyx_L3_error)
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 4; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 4, 5, i); __PYX_ERR(17, 10, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(17, 10, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(17, 10, __pyx_L3_error)
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(17, 10, __pyx_L3_error)
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(17, 10, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(17, 10, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_self = values[0];
    __pyx_v_facedicts = values[1];
    __pyx_v_model_var = values[2];
    __pyx_v_sphere_var = values[3];
    __pyx_v_togl_widget = values[4];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 4, 5, __pyx_nargs); __PYX_ERR(17, 10, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("CyOpenGL.HyperbolicPolyhedron.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_20HyperbolicPolyhedron___init__(__pyx_self, __pyx_v_self, __pyx_v_facedicts, __pyx_v_model_var, __pyx_v_sphere_var, __pyx_v_togl_widget);

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

static PyObject *__pyx_pf_8CyOpenGL_20HyperbolicPolyhedron___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_facedicts, PyObject *__pyx_v_model_var, PyObject *__pyx_v_sphere_var, PyObject *__pyx_v_togl_widget) {
  PyObject *__pyx_v_dict = NULL;
  PyObject *__pyx_v_vertices = NULL;
  struct __pyx_obj_8CyOpenGL_vector3 *__pyx_v_closest = NULL;
  PyObject *__pyx_v_center = NULL;
  PyObject *__pyx_v_color = NULL;
  PyObject *__pyx_v_face = NULL;
  PyObject *__pyx_8genexpr1__pyx_v_vertex = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  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;
  int __pyx_t_15;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "opengl/legacy/hyperbolic_polyhedron.pyx":11
 * 
 *     def __init__(self, facedicts, model_var, sphere_var, togl_widget=None):
 *         self.facedicts = facedicts             # <<<<<<<<<<<<<<
 *         self.model = model_var
 *         self.sphere = sphere_var
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_facedicts, __pyx_v_facedicts) < (0)) __PYX_ERR(17, 11, __pyx_L1_error)

  /* "opengl/legacy/hyperbolic_polyhedron.pyx":12
 *     def __init__(self, facedicts, model_var, sphere_var, togl_widget=None):
 *         self.facedicts = facedicts
 *         self.model = model_var             # <<<<<<<<<<<<<<
 *         self.sphere = sphere_var
 *         self.face_specular = [0.5, 0.5, 0.5, 1.0]
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_model, __pyx_v_model_var) < (0)) __PYX_ERR(17, 12, __pyx_L1_error)

  /* "opengl/legacy/hyperbolic_polyhedron.pyx":13
 *         self.facedicts = facedicts
 *         self.model = model_var
 *         self.sphere = sphere_var             # <<<<<<<<<<<<<<
 *         self.face_specular = [0.5, 0.5, 0.5, 1.0]
 *         self.front_shininess = 50.0
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_sphere, __pyx_v_sphere_var) < (0)) __PYX_ERR(17, 13, __pyx_L1_error)

  /* "opengl/legacy/hyperbolic_polyhedron.pyx":14
 *         self.model = model_var
 *         self.sphere = sphere_var
 *         self.face_specular = [0.5, 0.5, 0.5, 1.0]             # <<<<<<<<<<<<<<
 *         self.front_shininess = 50.0
 *         self.back_shininess = 50.0
*/
  __pyx_t_1 = PyList_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 14, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_float_0_5);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_float_0_5);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_mstate_global->__pyx_float_0_5) != (0)) __PYX_ERR(17, 14, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_float_0_5);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_float_0_5);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_float_0_5) != (0)) __PYX_ERR(17, 14, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_float_0_5);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_float_0_5);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 2, __pyx_mstate_global->__pyx_float_0_5) != (0)) __PYX_ERR(17, 14, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_float_1_0);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_float_1_0);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 3, __pyx_mstate_global->__pyx_float_1_0) != (0)) __PYX_ERR(17, 14, __pyx_L1_error);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_face_specular, __pyx_t_1) < (0)) __PYX_ERR(17, 14, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/legacy/hyperbolic_polyhedron.pyx":15
 *         self.sphere = sphere_var
 *         self.face_specular = [0.5, 0.5, 0.5, 1.0]
 *         self.front_shininess = 50.0             # <<<<<<<<<<<<<<
 *         self.back_shininess = 50.0
 *         self.S_infinity = WireframeSphere(color=[1.0, 1.0, 1.0, .2],
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_front_shininess, __pyx_mstate_global->__pyx_float_50_0) < (0)) __PYX_ERR(17, 15, __pyx_L1_error)

  /* "opengl/legacy/hyperbolic_polyhedron.pyx":16
 *         self.face_specular = [0.5, 0.5, 0.5, 1.0]
 *         self.front_shininess = 50.0
 *         self.back_shininess = 50.0             # <<<<<<<<<<<<<<
 *         self.S_infinity = WireframeSphere(color=[1.0, 1.0, 1.0, .2],
 *                                           front_specular=[0.5, 0.5, 0.5, 1.0],
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_back_shininess, __pyx_mstate_global->__pyx_float_50_0) < (0)) __PYX_ERR(17, 16, __pyx_L1_error)

  /* "opengl/legacy/hyperbolic_polyhedron.pyx":17
 *         self.front_shininess = 50.0
 *         self.back_shininess = 50.0
 *         self.S_infinity = WireframeSphere(color=[1.0, 1.0, 1.0, .2],             # <<<<<<<<<<<<<<
 *                                           front_specular=[0.5, 0.5, 0.5, 1.0],
 *                                           front_shininess=50.0,
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = PyList_New(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_float_1_0);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_float_1_0);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_mstate_global->__pyx_float_1_0) != (0)) __PYX_ERR(17, 17, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_float_1_0);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_float_1_0);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_mstate_global->__pyx_float_1_0) != (0)) __PYX_ERR(17, 17, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_float_1_0);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_float_1_0);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 2, __pyx_mstate_global->__pyx_float_1_0) != (0)) __PYX_ERR(17, 17, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_float__2);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_float__2);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 3, __pyx_mstate_global->__pyx_float__2) != (0)) __PYX_ERR(17, 17, __pyx_L1_error);

  /* "opengl/legacy/hyperbolic_polyhedron.pyx":18
 *         self.back_shininess = 50.0
 *         self.S_infinity = WireframeSphere(color=[1.0, 1.0, 1.0, .2],
 *                                           front_specular=[0.5, 0.5, 0.5, 1.0],             # <<<<<<<<<<<<<<
 *                                           front_shininess=50.0,
 *                                           togl_widget=togl_widget)
*/
  __pyx_t_4 = PyList_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(17, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_float_0_5);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_float_0_5);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_mstate_global->__pyx_float_0_5) != (0)) __PYX_ERR(17, 18, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_float_0_5);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_float_0_5);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_mstate_global->__pyx_float_0_5) != (0)) __PYX_ERR(17, 18, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_float_0_5);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_float_0_5);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 2, __pyx_mstate_global->__pyx_float_0_5) != (0)) __PYX_ERR(17, 18, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_float_1_0);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_float_1_0);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 3, __pyx_mstate_global->__pyx_float_1_0) != (0)) __PYX_ERR(17, 18, __pyx_L1_error);

  /* "opengl/legacy/hyperbolic_polyhedron.pyx":20
 *                                           front_specular=[0.5, 0.5, 0.5, 1.0],
 *                                           front_shininess=50.0,
 *                                           togl_widget=togl_widget)             # <<<<<<<<<<<<<<
 *         self.S_infinity.build_display_list(1.0, 30, 30)
 *         self.Klein_faces = []
*/
  __pyx_t_5 = 1;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 4 : 0)] = {__pyx_t_2, NULL};
    __pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(17, 17, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_color, __pyx_t_3, __pyx_t_6, __pyx_callargs+1, 0) < (0)) __PYX_ERR(17, 17, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_front_specular, __pyx_t_4, __pyx_t_6, __pyx_callargs+1, 1) < (0)) __PYX_ERR(17, 17, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_front_shininess, __pyx_mstate_global->__pyx_float_50_0, __pyx_t_6, __pyx_callargs+1, 2) < (0)) __PYX_ERR(17, 17, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_togl_widget, __pyx_v_togl_widget, __pyx_t_6, __pyx_callargs+1, 3) < (0)) __PYX_ERR(17, 17, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_ptype_8CyOpenGL_WireframeSphere, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 17, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }

  /* "opengl/legacy/hyperbolic_polyhedron.pyx":17
 *         self.front_shininess = 50.0
 *         self.back_shininess = 50.0
 *         self.S_infinity = WireframeSphere(color=[1.0, 1.0, 1.0, .2],             # <<<<<<<<<<<<<<
 *                                           front_specular=[0.5, 0.5, 0.5, 1.0],
 *                                           front_shininess=50.0,
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_S_infinity, ((PyObject *)__pyx_t_1)) < (0)) __PYX_ERR(17, 17, __pyx_L1_error)
  __Pyx_DECREF((PyObject *)__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/legacy/hyperbolic_polyhedron.pyx":21
 *                                           front_shininess=50.0,
 *                                           togl_widget=togl_widget)
 *         self.S_infinity.build_display_list(1.0, 30, 30)             # <<<<<<<<<<<<<<
 *         self.Klein_faces = []
 *         self.Poincare_faces = []
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_S_infinity); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_build_display_list); if (unlikely(!__pyx_t_6)) __PYX_ERR(17, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_mstate_global->__pyx_tuple[3], NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/legacy/hyperbolic_polyhedron.pyx":22
 *                                           togl_widget=togl_widget)
 *         self.S_infinity.build_display_list(1.0, 30, 30)
 *         self.Klein_faces = []             # <<<<<<<<<<<<<<
 *         self.Poincare_faces = []
 *         for dict in facedicts:
*/
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_Klein_faces, __pyx_t_1) < (0)) __PYX_ERR(17, 22, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/legacy/hyperbolic_polyhedron.pyx":23
 *         self.S_infinity.build_display_list(1.0, 30, 30)
 *         self.Klein_faces = []
 *         self.Poincare_faces = []             # <<<<<<<<<<<<<<
 *         for dict in facedicts:
 *             vertices = [vector3(vertex) for vertex in dict['vertices']]
*/
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_Poincare_faces, __pyx_t_1) < (0)) __PYX_ERR(17, 23, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/legacy/hyperbolic_polyhedron.pyx":24
 *         self.Klein_faces = []
 *         self.Poincare_faces = []
 *         for dict in facedicts:             # <<<<<<<<<<<<<<
 *             vertices = [vector3(vertex) for vertex in dict['vertices']]
 *             closest = vector3(dict['closest'])
*/
  if (likely(PyList_CheckExact(__pyx_v_facedicts)) || PyTuple_CheckExact(__pyx_v_facedicts)) {
    __pyx_t_1 = __pyx_v_facedicts; __Pyx_INCREF(__pyx_t_1);
    __pyx_t_7 = 0;
    __pyx_t_8 = NULL;
  } else {
    __pyx_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_facedicts); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 24, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(17, 24, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_8)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(17, 24, __pyx_L1_error)
          #endif
          if (__pyx_t_7 >= __pyx_temp) break;
        }
        __pyx_t_6 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference);
        ++__pyx_t_7;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(17, 24, __pyx_L1_error)
          #endif
          if (__pyx_t_7 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_6 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_7));
        #else
        __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_7);
        #endif
        ++__pyx_t_7;
      }
      if (unlikely(!__pyx_t_6)) __PYX_ERR(17, 24, __pyx_L1_error)
    } else {
      __pyx_t_6 = __pyx_t_8(__pyx_t_1);
      if (unlikely(!__pyx_t_6)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(17, 24, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_XDECREF_SET(__pyx_v_dict, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "opengl/legacy/hyperbolic_polyhedron.pyx":25
 *         self.Poincare_faces = []
 *         for dict in facedicts:
 *             vertices = [vector3(vertex) for vertex in dict['vertices']]             # <<<<<<<<<<<<<<
 *             closest = vector3(dict['closest'])
 *             center = closest*(1/dict['distance']**2)
*/
    { /* enter inner scope */
      __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(17, 25, __pyx_L7_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_dict, __pyx_mstate_global->__pyx_n_u_vertices); if (unlikely(!__pyx_t_4)) __PYX_ERR(17, 25, __pyx_L7_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
        __pyx_t_3 = __pyx_t_4; __Pyx_INCREF(__pyx_t_3);
        __pyx_t_9 = 0;
        __pyx_t_10 = NULL;
      } else {
        __pyx_t_9 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 25, __pyx_L7_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(17, 25, __pyx_L7_error)
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      for (;;) {
        if (likely(!__pyx_t_10)) {
          if (likely(PyList_CheckExact(__pyx_t_3))) {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3);
              #if !CYTHON_ASSUME_SAFE_SIZE
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(17, 25, __pyx_L7_error)
              #endif
              if (__pyx_t_9 >= __pyx_temp) break;
            }
            __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_3, __pyx_t_9, __Pyx_ReferenceSharing_OwnStrongReference);
            ++__pyx_t_9;
          } else {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
              #if !CYTHON_ASSUME_SAFE_SIZE
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(17, 25, __pyx_L7_error)
              #endif
              if (__pyx_t_9 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_9));
            #else
            __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_9);
            #endif
            ++__pyx_t_9;
          }
          if (unlikely(!__pyx_t_4)) __PYX_ERR(17, 25, __pyx_L7_error)
        } else {
          __pyx_t_4 = __pyx_t_10(__pyx_t_3);
          if (unlikely(!__pyx_t_4)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(17, 25, __pyx_L7_error)
              PyErr_Clear();
            }
            break;
          }
        }
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_XDECREF_SET(__pyx_8genexpr1__pyx_v_vertex, __pyx_t_4);
        __pyx_t_4 = 0;
        __pyx_t_2 = NULL;
        __pyx_t_5 = 1;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_8genexpr1__pyx_v_vertex};
          __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8CyOpenGL_vector3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (unlikely(!__pyx_t_4)) __PYX_ERR(17, 25, __pyx_L7_error)
          __Pyx_GOTREF((PyObject *)__pyx_t_4);
        }
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_6, (PyObject*)__pyx_t_4))) __PYX_ERR(17, 25, __pyx_L7_error)
        __Pyx_DECREF((PyObject *)__pyx_t_4); __pyx_t_4 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_vertex); __pyx_8genexpr1__pyx_v_vertex = 0;
      goto __pyx_L11_exit_scope;
      __pyx_L7_error:;
      __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_vertex); __pyx_8genexpr1__pyx_v_vertex = 0;
      goto __pyx_L1_error;
      __pyx_L11_exit_scope:;
    } /* exit inner scope */
    __Pyx_XDECREF_SET(__pyx_v_vertices, ((PyObject*)__pyx_t_6));
    __pyx_t_6 = 0;

    /* "opengl/legacy/hyperbolic_polyhedron.pyx":26
 *         for dict in facedicts:
 *             vertices = [vector3(vertex) for vertex in dict['vertices']]
 *             closest = vector3(dict['closest'])             # <<<<<<<<<<<<<<
 *             center = closest*(1/dict['distance']**2)
 *             color = hls_to_rgb(dict['hue'], 0.5, 1.0) + (1.0,)
*/
    __pyx_t_3 = NULL;
    __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_dict, __pyx_mstate_global->__pyx_n_u_closest); if (unlikely(!__pyx_t_4)) __PYX_ERR(17, 26, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4};
      __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8CyOpenGL_vector3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(17, 26, __pyx_L1_error)
      __Pyx_GOTREF((PyObject *)__pyx_t_6);
    }
    __Pyx_XDECREF_SET(__pyx_v_closest, ((struct __pyx_obj_8CyOpenGL_vector3 *)__pyx_t_6));
    __pyx_t_6 = 0;

    /* "opengl/legacy/hyperbolic_polyhedron.pyx":27
 *             vertices = [vector3(vertex) for vertex in dict['vertices']]
 *             closest = vector3(dict['closest'])
 *             center = closest*(1/dict['distance']**2)             # <<<<<<<<<<<<<<
 *             color = hls_to_rgb(dict['hue'], 0.5, 1.0) + (1.0,)
 *             self.Klein_faces.append(
*/
    __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_dict, __pyx_mstate_global->__pyx_n_u_distance); if (unlikely(!__pyx_t_6)) __PYX_ERR(17, 27, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = PyNumber_Power(__pyx_t_6, __pyx_mstate_global->__pyx_int_2, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(17, 27, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_mstate_global->__pyx_int_1, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(17, 27, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_Multiply(((PyObject *)__pyx_v_closest), __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(17, 27, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF_SET(__pyx_v_center, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "opengl/legacy/hyperbolic_polyhedron.pyx":28
 *             closest = vector3(dict['closest'])
 *             center = closest*(1/dict['distance']**2)
 *             color = hls_to_rgb(dict['hue'], 0.5, 1.0) + (1.0,)             # <<<<<<<<<<<<<<
 *             self.Klein_faces.append(
 *                 KleinPolygon(vertices, closest,
*/
    __pyx_t_6 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_hls_to_rgb); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 28, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_v_dict, __pyx_mstate_global->__pyx_n_u_hue); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 28, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
      assert(__pyx_t_6);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[4] = {__pyx_t_6, __pyx_t_2, __pyx_mstate_global->__pyx_float_0_5, __pyx_mstate_global->__pyx_float_1_0};
      __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(17, 28, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __pyx_t_3 = PyNumber_Add(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[4]); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 28, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF_SET(__pyx_v_color, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "opengl/legacy/hyperbolic_polyhedron.pyx":29
 *             center = closest*(1/dict['distance']**2)
 *             color = hls_to_rgb(dict['hue'], 0.5, 1.0) + (1.0,)
 *             self.Klein_faces.append(             # <<<<<<<<<<<<<<
 *                 KleinPolygon(vertices, closest,
 *                              color=color,
*/
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_Klein_faces); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 29, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "opengl/legacy/hyperbolic_polyhedron.pyx":30
 *             color = hls_to_rgb(dict['hue'], 0.5, 1.0) + (1.0,)
 *             self.Klein_faces.append(
 *                 KleinPolygon(vertices, closest,             # <<<<<<<<<<<<<<
 *                              color=color,
 *                              front_specular=self.face_specular,
*/
    __pyx_t_2 = NULL;

    /* "opengl/legacy/hyperbolic_polyhedron.pyx":32
 *                 KleinPolygon(vertices, closest,
 *                              color=color,
 *                              front_specular=self.face_specular,             # <<<<<<<<<<<<<<
 *                              back_specular=self.face_specular,
 *                              front_shininess=self.front_shininess,
*/
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_face_specular); if (unlikely(!__pyx_t_6)) __PYX_ERR(17, 32, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);

    /* "opengl/legacy/hyperbolic_polyhedron.pyx":33
 *                              color=color,
 *                              front_specular=self.face_specular,
 *                              back_specular=self.face_specular,             # <<<<<<<<<<<<<<
 *                              front_shininess=self.front_shininess,
 *                              back_shininess=self.back_shininess,
*/
    __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_face_specular); if (unlikely(!__pyx_t_11)) __PYX_ERR(17, 33, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);

    /* "opengl/legacy/hyperbolic_polyhedron.pyx":34
 *                              front_specular=self.face_specular,
 *                              back_specular=self.face_specular,
 *                              front_shininess=self.front_shininess,             # <<<<<<<<<<<<<<
 *                              back_shininess=self.back_shininess,
 *                              togl_widget=togl_widget))
*/
    __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_front_shininess); if (unlikely(!__pyx_t_12)) __PYX_ERR(17, 34, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);

    /* "opengl/legacy/hyperbolic_polyhedron.pyx":35
 *                              back_specular=self.face_specular,
 *                              front_shininess=self.front_shininess,
 *                              back_shininess=self.back_shininess,             # <<<<<<<<<<<<<<
 *                              togl_widget=togl_widget))
 *             self.Poincare_faces.append(
*/
    __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_back_shininess); if (unlikely(!__pyx_t_13)) __PYX_ERR(17, 35, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);

    /* "opengl/legacy/hyperbolic_polyhedron.pyx":36
 *                              front_shininess=self.front_shininess,
 *                              back_shininess=self.back_shininess,
 *                              togl_widget=togl_widget))             # <<<<<<<<<<<<<<
 *             self.Poincare_faces.append(
 *                 PoincarePolygon(vertices, center,
*/
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[3 + ((CYTHON_VECTORCALL) ? 6 : 0)] = {__pyx_t_2, __pyx_v_vertices, ((PyObject *)__pyx_v_closest)};
      __pyx_t_14 = __Pyx_MakeVectorcallBuilderKwds(6); if (unlikely(!__pyx_t_14)) __PYX_ERR(17, 30, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_color, __pyx_v_color, __pyx_t_14, __pyx_callargs+3, 0) < (0)) __PYX_ERR(17, 30, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_front_specular, __pyx_t_6, __pyx_t_14, __pyx_callargs+3, 1) < (0)) __PYX_ERR(17, 30, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_back_specular, __pyx_t_11, __pyx_t_14, __pyx_callargs+3, 2) < (0)) __PYX_ERR(17, 30, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_front_shininess, __pyx_t_12, __pyx_t_14, __pyx_callargs+3, 3) < (0)) __PYX_ERR(17, 30, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_back_shininess, __pyx_t_13, __pyx_t_14, __pyx_callargs+3, 4) < (0)) __PYX_ERR(17, 30, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_togl_widget, __pyx_v_togl_widget, __pyx_t_14, __pyx_callargs+3, 5) < (0)) __PYX_ERR(17, 30, __pyx_L1_error)
      __pyx_t_4 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_ptype_8CyOpenGL_KleinPolygon, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_14);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(17, 30, __pyx_L1_error)
      __Pyx_GOTREF((PyObject *)__pyx_t_4);
    }

    /* "opengl/legacy/hyperbolic_polyhedron.pyx":29
 *             center = closest*(1/dict['distance']**2)
 *             color = hls_to_rgb(dict['hue'], 0.5, 1.0) + (1.0,)
 *             self.Klein_faces.append(             # <<<<<<<<<<<<<<
 *                 KleinPolygon(vertices, closest,
 *                              color=color,
*/
    __pyx_t_15 = __Pyx_PyObject_Append(__pyx_t_3, ((PyObject *)__pyx_t_4)); if (unlikely(__pyx_t_15 == ((int)-1))) __PYX_ERR(17, 29, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF((PyObject *)__pyx_t_4); __pyx_t_4 = 0;

    /* "opengl/legacy/hyperbolic_polyhedron.pyx":37
 *                              back_shininess=self.back_shininess,
 *                              togl_widget=togl_widget))
 *             self.Poincare_faces.append(             # <<<<<<<<<<<<<<
 *                 PoincarePolygon(vertices, center,
 *                                 color=color,
*/
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_Poincare_faces); if (unlikely(!__pyx_t_4)) __PYX_ERR(17, 37, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);

    /* "opengl/legacy/hyperbolic_polyhedron.pyx":38
 *                              togl_widget=togl_widget))
 *             self.Poincare_faces.append(
 *                 PoincarePolygon(vertices, center,             # <<<<<<<<<<<<<<
 *                                 color=color,
 *                                 front_specular=self.face_specular,
*/
    __pyx_t_14 = NULL;

    /* "opengl/legacy/hyperbolic_polyhedron.pyx":40
 *                 PoincarePolygon(vertices, center,
 *                                 color=color,
 *                                 front_specular=self.face_specular,             # <<<<<<<<<<<<<<
 *                                 back_specular=self.face_specular,
 *                                 front_shininess=self.front_shininess,
*/
    __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_face_specular); if (unlikely(!__pyx_t_13)) __PYX_ERR(17, 40, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);

    /* "opengl/legacy/hyperbolic_polyhedron.pyx":41
 *                                 color=color,
 *                                 front_specular=self.face_specular,
 *                                 back_specular=self.face_specular,             # <<<<<<<<<<<<<<
 *                                 front_shininess=self.front_shininess,
 *                                 back_shininess=self.back_shininess,
*/
    __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_face_specular); if (unlikely(!__pyx_t_12)) __PYX_ERR(17, 41, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);

    /* "opengl/legacy/hyperbolic_polyhedron.pyx":42
 *                                 front_specular=self.face_specular,
 *                                 back_specular=self.face_specular,
 *                                 front_shininess=self.front_shininess,             # <<<<<<<<<<<<<<
 *                                 back_shininess=self.back_shininess,
 *                                 togl_widget=togl_widget))
*/
    __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_front_shininess); if (unlikely(!__pyx_t_11)) __PYX_ERR(17, 42, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);

    /* "opengl/legacy/hyperbolic_polyhedron.pyx":43
 *                                 back_specular=self.face_specular,
 *                                 front_shininess=self.front_shininess,
 *                                 back_shininess=self.back_shininess,             # <<<<<<<<<<<<<<
 *                                 togl_widget=togl_widget))
 *         for face in self.Klein_faces:
*/
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_back_shininess); if (unlikely(!__pyx_t_6)) __PYX_ERR(17, 43, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);

    /* "opengl/legacy/hyperbolic_polyhedron.pyx":44
 *                                 front_shininess=self.front_shininess,
 *                                 back_shininess=self.back_shininess,
 *                                 togl_widget=togl_widget))             # <<<<<<<<<<<<<<
 *         for face in self.Klein_faces:
 *             face.build_display_list()
*/
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[3 + ((CYTHON_VECTORCALL) ? 6 : 0)] = {__pyx_t_14, __pyx_v_vertices, __pyx_v_center};
      __pyx_t_2 = __Pyx_MakeVectorcallBuilderKwds(6); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 38, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_color, __pyx_v_color, __pyx_t_2, __pyx_callargs+3, 0) < (0)) __PYX_ERR(17, 38, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_front_specular, __pyx_t_13, __pyx_t_2, __pyx_callargs+3, 1) < (0)) __PYX_ERR(17, 38, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_back_specular, __pyx_t_12, __pyx_t_2, __pyx_callargs+3, 2) < (0)) __PYX_ERR(17, 38, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_front_shininess, __pyx_t_11, __pyx_t_2, __pyx_callargs+3, 3) < (0)) __PYX_ERR(17, 38, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_back_shininess, __pyx_t_6, __pyx_t_2, __pyx_callargs+3, 4) < (0)) __PYX_ERR(17, 38, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_togl_widget, __pyx_v_togl_widget, __pyx_t_2, __pyx_callargs+3, 5) < (0)) __PYX_ERR(17, 38, __pyx_L1_error)
      __pyx_t_3 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_ptype_8CyOpenGL_PoincarePolygon, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_2);
      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 38, __pyx_L1_error)
      __Pyx_GOTREF((PyObject *)__pyx_t_3);
    }

    /* "opengl/legacy/hyperbolic_polyhedron.pyx":37
 *                              back_shininess=self.back_shininess,
 *                              togl_widget=togl_widget))
 *             self.Poincare_faces.append(             # <<<<<<<<<<<<<<
 *                 PoincarePolygon(vertices, center,
 *                                 color=color,
*/
    __pyx_t_15 = __Pyx_PyObject_Append(__pyx_t_4, ((PyObject *)__pyx_t_3)); if (unlikely(__pyx_t_15 == ((int)-1))) __PYX_ERR(17, 37, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF((PyObject *)__pyx_t_3); __pyx_t_3 = 0;

    /* "opengl/legacy/hyperbolic_polyhedron.pyx":24
 *         self.Klein_faces = []
 *         self.Poincare_faces = []
 *         for dict in facedicts:             # <<<<<<<<<<<<<<
 *             vertices = [vector3(vertex) for vertex in dict['vertices']]
 *             closest = vector3(dict['closest'])
*/
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/legacy/hyperbolic_polyhedron.pyx":45
 *                                 back_shininess=self.back_shininess,
 *                                 togl_widget=togl_widget))
 *         for face in self.Klein_faces:             # <<<<<<<<<<<<<<
 *             face.build_display_list()
 *         for face in self.Poincare_faces:
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_Klein_faces); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 45, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3);
    __pyx_t_7 = 0;
    __pyx_t_8 = NULL;
  } else {
    __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 45, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(17, 45, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_8)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(17, 45, __pyx_L1_error)
          #endif
          if (__pyx_t_7 >= __pyx_temp) break;
        }
        __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_3, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference);
        ++__pyx_t_7;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(17, 45, __pyx_L1_error)
          #endif
          if (__pyx_t_7 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7));
        #else
        __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7);
        #endif
        ++__pyx_t_7;
      }
      if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 45, __pyx_L1_error)
    } else {
      __pyx_t_1 = __pyx_t_8(__pyx_t_3);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(17, 45, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_face, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "opengl/legacy/hyperbolic_polyhedron.pyx":46
 *                                 togl_widget=togl_widget))
 *         for face in self.Klein_faces:
 *             face.build_display_list()             # <<<<<<<<<<<<<<
 *         for face in self.Poincare_faces:
 *             face.build_display_list()
*/
    __pyx_t_4 = __pyx_v_face;
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_build_display_list, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 46, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "opengl/legacy/hyperbolic_polyhedron.pyx":45
 *                                 back_shininess=self.back_shininess,
 *                                 togl_widget=togl_widget))
 *         for face in self.Klein_faces:             # <<<<<<<<<<<<<<
 *             face.build_display_list()
 *         for face in self.Poincare_faces:
*/
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "opengl/legacy/hyperbolic_polyhedron.pyx":47
 *         for face in self.Klein_faces:
 *             face.build_display_list()
 *         for face in self.Poincare_faces:             # <<<<<<<<<<<<<<
 *             face.build_display_list()
 * 
*/
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_Poincare_faces); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 47, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
    __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1);
    __pyx_t_7 = 0;
    __pyx_t_8 = NULL;
  } else {
    __pyx_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 47, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(17, 47, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  for (;;) {
    if (likely(!__pyx_t_8)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(17, 47, __pyx_L1_error)
          #endif
          if (__pyx_t_7 >= __pyx_temp) break;
        }
        __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference);
        ++__pyx_t_7;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(17, 47, __pyx_L1_error)
          #endif
          if (__pyx_t_7 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_7));
        #else
        __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_7);
        #endif
        ++__pyx_t_7;
      }
      if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 47, __pyx_L1_error)
    } else {
      __pyx_t_3 = __pyx_t_8(__pyx_t_1);
      if (unlikely(!__pyx_t_3)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(17, 47, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_XDECREF_SET(__pyx_v_face, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "opengl/legacy/hyperbolic_polyhedron.pyx":48
 *             face.build_display_list()
 *         for face in self.Poincare_faces:
 *             face.build_display_list()             # <<<<<<<<<<<<<<
 * 
 *     def draw(self, *args):
*/
    __pyx_t_4 = __pyx_v_face;
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
      __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_build_display_list, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 48, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "opengl/legacy/hyperbolic_polyhedron.pyx":47
 *         for face in self.Klein_faces:
 *             face.build_display_list()
 *         for face in self.Poincare_faces:             # <<<<<<<<<<<<<<
 *             face.build_display_list()
 * 
*/
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/legacy/hyperbolic_polyhedron.pyx":10
 *     """
 * 
 *     def __init__(self, facedicts, model_var, sphere_var, togl_widget=None):             # <<<<<<<<<<<<<<
 *         self.facedicts = facedicts
 *         self.model = model_var
*/

  /* 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_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_AddTraceback("CyOpenGL.HyperbolicPolyhedron.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dict);
  __Pyx_XDECREF(__pyx_v_vertices);
  __Pyx_XDECREF((PyObject *)__pyx_v_closest);
  __Pyx_XDECREF(__pyx_v_center);
  __Pyx_XDECREF(__pyx_v_color);
  __Pyx_XDECREF(__pyx_v_face);
  __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_vertex);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opengl/legacy/hyperbolic_polyhedron.pyx":50
 *             face.build_display_list()
 * 
 *     def draw(self, *args):             # <<<<<<<<<<<<<<
 *         model = self.model.get()
 *         if model == 'Klein':
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_20HyperbolicPolyhedron_3draw(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_20HyperbolicPolyhedron_2draw, "HyperbolicPolyhedron.draw(self, *args)");
static PyMethodDef __pyx_mdef_8CyOpenGL_20HyperbolicPolyhedron_3draw = {"draw", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_20HyperbolicPolyhedron_3draw, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_20HyperbolicPolyhedron_2draw};
static PyObject *__pyx_pw_8CyOpenGL_20HyperbolicPolyhedron_3draw(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_args = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("draw (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  __pyx_v_args = __Pyx_ArgsSlice_FASTCALL(__pyx_args, 1, __pyx_nargs);
  if (unlikely(!__pyx_v_args)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_v_args);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(17, 50, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        default:
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(17, 50, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      const Py_ssize_t used_pos_args = (kwd_pos_args < 1) ? kwd_pos_args : 1;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, used_pos_args, __pyx_kwds_len, "draw", 0) < (0)) __PYX_ERR(17, 50, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("draw", 0, 1, 1, i); __PYX_ERR(17, 50, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs < 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(17, 50, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("draw", 0, 1, 1, __pyx_nargs); __PYX_ERR(17, 50, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_AddTraceback("CyOpenGL.HyperbolicPolyhedron.draw", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_20HyperbolicPolyhedron_2draw(__pyx_self, __pyx_v_self, __pyx_v_args);

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

static PyObject *__pyx_pf_8CyOpenGL_20HyperbolicPolyhedron_2draw(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_args) {
  PyObject *__pyx_v_model = NULL;
  PyObject *__pyx_v_face = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("draw", 0);

  /* "opengl/legacy/hyperbolic_polyhedron.pyx":51
 * 
 *     def draw(self, *args):
 *         model = self.model.get()             # <<<<<<<<<<<<<<
 *         if model == 'Klein':
 *             for face in self.Klein_faces:
*/
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_model); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __pyx_t_3;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 51, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_model = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "opengl/legacy/hyperbolic_polyhedron.pyx":52
 *     def draw(self, *args):
 *         model = self.model.get()
 *         if model == 'Klein':             # <<<<<<<<<<<<<<
 *             for face in self.Klein_faces:
 *                 face.display()
*/
  __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_v_model, __pyx_mstate_global->__pyx_n_u_Klein, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(17, 52, __pyx_L1_error)
  if (__pyx_t_5) {

    /* "opengl/legacy/hyperbolic_polyhedron.pyx":53
 *         model = self.model.get()
 *         if model == 'Klein':
 *             for face in self.Klein_faces:             # <<<<<<<<<<<<<<
 *                 face.display()
 *         elif model == 'Poincare':
*/
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_Klein_faces); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 53, __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_6 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 53, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(17, 53, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    for (;;) {
      if (likely(!__pyx_t_7)) {
        if (likely(PyList_CheckExact(__pyx_t_3))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(17, 53, __pyx_L1_error)
            #endif
            if (__pyx_t_6 >= __pyx_temp) break;
          }
          __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_3, __pyx_t_6, __Pyx_ReferenceSharing_OwnStrongReference);
          ++__pyx_t_6;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(17, 53, __pyx_L1_error)
            #endif
            if (__pyx_t_6 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6));
          #else
          __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_6);
          #endif
          ++__pyx_t_6;
        }
        if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 53, __pyx_L1_error)
      } else {
        __pyx_t_1 = __pyx_t_7(__pyx_t_3);
        if (unlikely(!__pyx_t_1)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(17, 53, __pyx_L1_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_XDECREF_SET(__pyx_v_face, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "opengl/legacy/hyperbolic_polyhedron.pyx":54
 *         if model == 'Klein':
 *             for face in self.Klein_faces:
 *                 face.display()             # <<<<<<<<<<<<<<
 *         elif model == 'Poincare':
 *             for face in self.Poincare_faces:
*/
      __pyx_t_2 = __pyx_v_face;
      __Pyx_INCREF(__pyx_t_2);
      __pyx_t_4 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
        __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_display, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 54, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "opengl/legacy/hyperbolic_polyhedron.pyx":53
 *         model = self.model.get()
 *         if model == 'Klein':
 *             for face in self.Klein_faces:             # <<<<<<<<<<<<<<
 *                 face.display()
 *         elif model == 'Poincare':
*/
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "opengl/legacy/hyperbolic_polyhedron.pyx":52
 *     def draw(self, *args):
 *         model = self.model.get()
 *         if model == 'Klein':             # <<<<<<<<<<<<<<
 *             for face in self.Klein_faces:
 *                 face.display()
*/
    goto __pyx_L3;
  }

  /* "opengl/legacy/hyperbolic_polyhedron.pyx":55
 *             for face in self.Klein_faces:
 *                 face.display()
 *         elif model == 'Poincare':             # <<<<<<<<<<<<<<
 *             for face in self.Poincare_faces:
 *                 face.display()
*/
  __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_v_model, __pyx_mstate_global->__pyx_n_u_Poincare, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(17, 55, __pyx_L1_error)
  if (__pyx_t_5) {

    /* "opengl/legacy/hyperbolic_polyhedron.pyx":56
 *                 face.display()
 *         elif model == 'Poincare':
 *             for face in self.Poincare_faces:             # <<<<<<<<<<<<<<
 *                 face.display()
 *         if self.sphere.get():
*/
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_Poincare_faces); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 56, __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_6 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 56, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(17, 56, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    for (;;) {
      if (likely(!__pyx_t_7)) {
        if (likely(PyList_CheckExact(__pyx_t_1))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(17, 56, __pyx_L1_error)
            #endif
            if (__pyx_t_6 >= __pyx_temp) break;
          }
          __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_6, __Pyx_ReferenceSharing_OwnStrongReference);
          ++__pyx_t_6;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(17, 56, __pyx_L1_error)
            #endif
            if (__pyx_t_6 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6));
          #else
          __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6);
          #endif
          ++__pyx_t_6;
        }
        if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 56, __pyx_L1_error)
      } else {
        __pyx_t_3 = __pyx_t_7(__pyx_t_1);
        if (unlikely(!__pyx_t_3)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(17, 56, __pyx_L1_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_XDECREF_SET(__pyx_v_face, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "opengl/legacy/hyperbolic_polyhedron.pyx":57
 *         elif model == 'Poincare':
 *             for face in self.Poincare_faces:
 *                 face.display()             # <<<<<<<<<<<<<<
 *         if self.sphere.get():
 *             self.S_infinity.display()
*/
      __pyx_t_2 = __pyx_v_face;
      __Pyx_INCREF(__pyx_t_2);
      __pyx_t_4 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
        __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_display, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 57, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "opengl/legacy/hyperbolic_polyhedron.pyx":56
 *                 face.display()
 *         elif model == 'Poincare':
 *             for face in self.Poincare_faces:             # <<<<<<<<<<<<<<
 *                 face.display()
 *         if self.sphere.get():
*/
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "opengl/legacy/hyperbolic_polyhedron.pyx":55
 *             for face in self.Klein_faces:
 *                 face.display()
 *         elif model == 'Poincare':             # <<<<<<<<<<<<<<
 *             for face in self.Poincare_faces:
 *                 face.display()
*/
  }
  __pyx_L3:;

  /* "opengl/legacy/hyperbolic_polyhedron.pyx":58
 *             for face in self.Poincare_faces:
 *                 face.display()
 *         if self.sphere.get():             # <<<<<<<<<<<<<<
 *             self.S_infinity.display()
*/
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_sphere); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 58, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __pyx_t_2;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 58, __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(17, 58, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_5) {

    /* "opengl/legacy/hyperbolic_polyhedron.pyx":59
 *                 face.display()
 *         if self.sphere.get():
 *             self.S_infinity.display()             # <<<<<<<<<<<<<<
*/
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_S_infinity); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 59, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __pyx_t_3;
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_display, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 59, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "opengl/legacy/hyperbolic_polyhedron.pyx":58
 *             for face in self.Poincare_faces:
 *                 face.display()
 *         if self.sphere.get():             # <<<<<<<<<<<<<<
 *             self.S_infinity.display()
*/
  }

  /* "opengl/legacy/hyperbolic_polyhedron.pyx":50
 *             face.build_display_list()
 * 
 *     def draw(self, *args):             # <<<<<<<<<<<<<<
 *         model = self.model.get()
 *         if model == 'Klein':
*/

  /* 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("CyOpenGL.HyperbolicPolyhedron.draw", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_model);
  __Pyx_XDECREF(__pyx_v_face);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opengl/legacy/colorizer.pyx":9
 *     cdef double lightness, saturation, alpha
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         cdef int n
 *         # red blue green cyan magenta yellow
*/

/* Python wrapper */
static int __pyx_pw_8CyOpenGL_9Colorizer_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_8CyOpenGL_9Colorizer_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return -1;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__cinit__", __pyx_kwds); return -1;}
  __pyx_r = __pyx_pf_8CyOpenGL_9Colorizer___cinit__(((struct __pyx_obj_8CyOpenGL_Colorizer *)__pyx_v_self));

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

static int __pyx_pf_8CyOpenGL_9Colorizer___cinit__(struct __pyx_obj_8CyOpenGL_Colorizer *__pyx_v_self) {
  int __pyx_v_n;
  PyObject *__pyx_v_hues = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "opengl/legacy/colorizer.pyx":12
 *         cdef int n
 *         # red blue green cyan magenta yellow
 *         cdef hues = [0,4,2,3,5,1]             # <<<<<<<<<<<<<<
 *         # maybe one day Cython will let you initialize C arrays
 *         for n in range(6):
*/
  __pyx_t_1 = PyList_New(6); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_0);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(18, 12, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_4);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_4);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_4) != (0)) __PYX_ERR(18, 12, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_2);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_2);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 2, __pyx_mstate_global->__pyx_int_2) != (0)) __PYX_ERR(18, 12, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_3);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_3);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 3, __pyx_mstate_global->__pyx_int_3) != (0)) __PYX_ERR(18, 12, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_5);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_5);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 4, __pyx_mstate_global->__pyx_int_5) != (0)) __PYX_ERR(18, 12, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_1);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 5, __pyx_mstate_global->__pyx_int_1) != (0)) __PYX_ERR(18, 12, __pyx_L1_error);
  __pyx_v_hues = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "opengl/legacy/colorizer.pyx":14
 *         cdef hues = [0,4,2,3,5,1]
 *         # maybe one day Cython will let you initialize C arrays
 *         for n in range(6):             # <<<<<<<<<<<<<<
 *             self.base_hue[n] = hues[n]
 * 
*/
  for (__pyx_t_2 = 0; __pyx_t_2 < 6; __pyx_t_2+=1) {
    __pyx_v_n = __pyx_t_2;

    /* "opengl/legacy/colorizer.pyx":15
 *         # maybe one day Cython will let you initialize C arrays
 *         for n in range(6):
 *             self.base_hue[n] = hues[n]             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, lightness=0.6, saturation=0.9, alpha=0.8):
*/
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_hues, __pyx_v_n, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(18, 15, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    (__pyx_v_self->base_hue[__pyx_v_n]) = __pyx_t_3;
  }

  /* "opengl/legacy/colorizer.pyx":9
 *     cdef double lightness, saturation, alpha
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         cdef int n
 *         # red blue green cyan magenta yellow
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("CyOpenGL.Colorizer.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_hues);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opengl/legacy/colorizer.pyx":17
 *             self.base_hue[n] = hues[n]
 * 
 *     def __init__(self, lightness=0.6, saturation=0.9, alpha=0.8):             # <<<<<<<<<<<<<<
 *         self.lightness = lightness
 *         self.saturation = saturation
*/

/* Python wrapper */
static int __pyx_pw_8CyOpenGL_9Colorizer_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_8CyOpenGL_9Colorizer_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_lightness = 0;
  PyObject *__pyx_v_saturation = 0;
  PyObject *__pyx_v_alpha = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_lightness,&__pyx_mstate_global->__pyx_n_u_saturation,&__pyx_mstate_global->__pyx_n_u_alpha,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(18, 17, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(18, 17, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(18, 17, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(18, 17, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(18, 17, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_float_0_6));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_float_0_9));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_float_0_8));
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(18, 17, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(18, 17, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(18, 17, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_float_0_6));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_float_0_9));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_float_0_8));
    }
    __pyx_v_lightness = values[0];
    __pyx_v_saturation = values[1];
    __pyx_v_alpha = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 3, __pyx_nargs); __PYX_ERR(18, 17, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("CyOpenGL.Colorizer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_9Colorizer_2__init__(((struct __pyx_obj_8CyOpenGL_Colorizer *)__pyx_v_self), __pyx_v_lightness, __pyx_v_saturation, __pyx_v_alpha);

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

static int __pyx_pf_8CyOpenGL_9Colorizer_2__init__(struct __pyx_obj_8CyOpenGL_Colorizer *__pyx_v_self, PyObject *__pyx_v_lightness, PyObject *__pyx_v_saturation, PyObject *__pyx_v_alpha) {
  int __pyx_r;
  double __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "opengl/legacy/colorizer.pyx":18
 * 
 *     def __init__(self, lightness=0.6, saturation=0.9, alpha=0.8):
 *         self.lightness = lightness             # <<<<<<<<<<<<<<
 *         self.saturation = saturation
 *         self.alpha = alpha
*/
  __pyx_t_1 = __Pyx_PyFloat_AsDouble(__pyx_v_lightness); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(18, 18, __pyx_L1_error)
  __pyx_v_self->lightness = __pyx_t_1;

  /* "opengl/legacy/colorizer.pyx":19
 *     def __init__(self, lightness=0.6, saturation=0.9, alpha=0.8):
 *         self.lightness = lightness
 *         self.saturation = saturation             # <<<<<<<<<<<<<<
 *         self.alpha = alpha
 * 
*/
  __pyx_t_1 = __Pyx_PyFloat_AsDouble(__pyx_v_saturation); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(18, 19, __pyx_L1_error)
  __pyx_v_self->saturation = __pyx_t_1;

  /* "opengl/legacy/colorizer.pyx":20
 *         self.lightness = lightness
 *         self.saturation = saturation
 *         self.alpha = alpha             # <<<<<<<<<<<<<<
 * 
 *     def __call__(self, index):
*/
  __pyx_t_1 = __Pyx_PyFloat_AsDouble(__pyx_v_alpha); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(18, 20, __pyx_L1_error)
  __pyx_v_self->alpha = __pyx_t_1;

  /* "opengl/legacy/colorizer.pyx":17
 *             self.base_hue[n] = hues[n]
 * 
 *     def __init__(self, lightness=0.6, saturation=0.9, alpha=0.8):             # <<<<<<<<<<<<<<
 *         self.lightness = lightness
 *         self.saturation = saturation
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("CyOpenGL.Colorizer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "opengl/legacy/colorizer.pyx":22
 *         self.alpha = alpha
 * 
 *     def __call__(self, index):             # <<<<<<<<<<<<<<
 *         cdef double hue, R, G, B
 *         hue = (self.base_hue[index%6] + self.index_to_hue(index//6)) / 6.0
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_9Colorizer_5__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_8CyOpenGL_9Colorizer_5__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_index = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__call__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_index,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(18, 22, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(18, 22, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__call__", 0) < (0)) __PYX_ERR(18, 22, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 1, 1, 1, i); __PYX_ERR(18, 22, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(18, 22, __pyx_L3_error)
    }
    __pyx_v_index = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__call__", 1, 1, 1, __pyx_nargs); __PYX_ERR(18, 22, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("CyOpenGL.Colorizer.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_9Colorizer_4__call__(((struct __pyx_obj_8CyOpenGL_Colorizer *)__pyx_v_self), __pyx_v_index);

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

static PyObject *__pyx_pf_8CyOpenGL_9Colorizer_4__call__(struct __pyx_obj_8CyOpenGL_Colorizer *__pyx_v_self, PyObject *__pyx_v_index) {
  double __pyx_v_hue;
  double __pyx_v_R;
  double __pyx_v_G;
  double __pyx_v_B;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  double __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 *);
  double __pyx_t_10;
  double __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__call__", 0);

  /* "opengl/legacy/colorizer.pyx":24
 *     def __call__(self, index):
 *         cdef double hue, R, G, B
 *         hue = (self.base_hue[index%6] + self.index_to_hue(index//6)) / 6.0             # <<<<<<<<<<<<<<
 *         R, G, B = self.hls_to_rgb(hue, self.lightness, self.saturation)
 *         return [R, G, B, self.alpha]
*/
  __pyx_t_1 = __Pyx_PyLong_RemainderObjC(__pyx_v_index, __pyx_mstate_global->__pyx_int_6, 6, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(18, 24, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyLong_FloorDivideObjC(__pyx_v_index, __pyx_mstate_global->__pyx_int_6, 6, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(18, 24, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = ((struct __pyx_vtabstruct_8CyOpenGL_Colorizer *)__pyx_v_self->__pyx_vtab)->index_to_hue(__pyx_v_self, __pyx_t_3); if (unlikely(PyErr_Occurred())) __PYX_ERR(18, 24, __pyx_L1_error)
  __pyx_v_hue = (((__pyx_v_self->base_hue[__pyx_t_2]) + __pyx_t_4) / 6.0);

  /* "opengl/legacy/colorizer.pyx":25
 *         cdef double hue, R, G, B
 *         hue = (self.base_hue[index%6] + self.index_to_hue(index//6)) / 6.0
 *         R, G, B = self.hls_to_rgb(hue, self.lightness, self.saturation)             # <<<<<<<<<<<<<<
 *         return [R, G, B, self.alpha]
 * 
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_8CyOpenGL_Colorizer *)__pyx_v_self->__pyx_vtab)->hls_to_rgb(__pyx_v_self, __pyx_v_hue, __pyx_v_self->lightness, __pyx_v_self->saturation); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 25, __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 != 3)) {
      if (size > 3) __Pyx_RaiseTooManyValuesError(3);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(18, 25, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0);
      __Pyx_INCREF(__pyx_t_5);
      __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_t_7 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_7);
    } else {
      __pyx_t_5 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_5)) __PYX_ERR(18, 25, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_6)) __PYX_ERR(18, 25, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_7)) __PYX_ERR(18, 25, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_7);
    }
    #else
    __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(18, 25, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(18, 25, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_7)) __PYX_ERR(18, 25, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_8 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(18, 25, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8);
    index = 0; __pyx_t_5 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_5)) goto __pyx_L3_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_L3_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_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_7);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 3) < (0)) __PYX_ERR(18, 25, __pyx_L1_error)
    __pyx_t_9 = NULL;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_9 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(18, 25, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  __pyx_t_4 = __Pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(18, 25, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_10 = __Pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(18, 25, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_11 = __Pyx_PyFloat_AsDouble(__pyx_t_7); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(18, 25, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_v_R = __pyx_t_4;
  __pyx_v_G = __pyx_t_10;
  __pyx_v_B = __pyx_t_11;

  /* "opengl/legacy/colorizer.pyx":26
 *         hue = (self.base_hue[index%6] + self.index_to_hue(index//6)) / 6.0
 *         R, G, B = self.hls_to_rgb(hue, self.lightness, self.saturation)
 *         return [R, G, B, self.alpha]             # <<<<<<<<<<<<<<
 * 
 *     cdef double index_to_hue(self, int index):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_R); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = PyFloat_FromDouble(__pyx_v_G); if (unlikely(!__pyx_t_7)) __PYX_ERR(18, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_6 = PyFloat_FromDouble(__pyx_v_B); if (unlikely(!__pyx_t_6)) __PYX_ERR(18, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = PyFloat_FromDouble(__pyx_v_self->alpha); if (unlikely(!__pyx_t_5)) __PYX_ERR(18, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_8 = PyList_New(4); if (unlikely(!__pyx_t_8)) __PYX_ERR(18, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 0, __pyx_t_1) != (0)) __PYX_ERR(18, 26, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_7);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 1, __pyx_t_7) != (0)) __PYX_ERR(18, 26, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 2, __pyx_t_6) != (0)) __PYX_ERR(18, 26, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 3, __pyx_t_5) != (0)) __PYX_ERR(18, 26, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_t_7 = 0;
  __pyx_t_6 = 0;
  __pyx_t_5 = 0;
  __pyx_r = __pyx_t_8;
  __pyx_t_8 = 0;
  goto __pyx_L0;

  /* "opengl/legacy/colorizer.pyx":22
 *         self.alpha = alpha
 * 
 *     def __call__(self, index):             # <<<<<<<<<<<<<<
 *         cdef double hue, R, G, B
 *         hue = (self.base_hue[index%6] + self.index_to_hue(index//6)) / 6.0
*/

  /* 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_8);
  __Pyx_AddTraceback("CyOpenGL.Colorizer.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opengl/legacy/colorizer.pyx":28
 *         return [R, G, B, self.alpha]
 * 
 *     cdef double index_to_hue(self, int index):             # <<<<<<<<<<<<<<
 *         cdef unsigned int num=0, den=1
 *         while index:
*/

static double __pyx_f_8CyOpenGL_9Colorizer_index_to_hue(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_Colorizer *__pyx_v_self, int __pyx_v_index) {
  unsigned int __pyx_v_num;
  unsigned int __pyx_v_den;
  double __pyx_r;
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "opengl/legacy/colorizer.pyx":29
 * 
 *     cdef double index_to_hue(self, int index):
 *         cdef unsigned int num=0, den=1             # <<<<<<<<<<<<<<
 *         while index:
 *             num = num<<1
*/
  __pyx_v_num = 0;
  __pyx_v_den = 1;

  /* "opengl/legacy/colorizer.pyx":30
 *     cdef double index_to_hue(self, int index):
 *         cdef unsigned int num=0, den=1
 *         while index:             # <<<<<<<<<<<<<<
 *             num = num<<1
 *             den = den<<1
*/
  while (1) {
    __pyx_t_1 = (__pyx_v_index != 0);
    if (!__pyx_t_1) break;

    /* "opengl/legacy/colorizer.pyx":31
 *         cdef unsigned int num=0, den=1
 *         while index:
 *             num = num<<1             # <<<<<<<<<<<<<<
 *             den = den<<1
 *             if index & 0x1:
*/
    __pyx_v_num = (__pyx_v_num << 1);

    /* "opengl/legacy/colorizer.pyx":32
 *         while index:
 *             num = num<<1
 *             den = den<<1             # <<<<<<<<<<<<<<
 *             if index & 0x1:
 *                 num += 1
*/
    __pyx_v_den = (__pyx_v_den << 1);

    /* "opengl/legacy/colorizer.pyx":33
 *             num = num<<1
 *             den = den<<1
 *             if index & 0x1:             # <<<<<<<<<<<<<<
 *                 num += 1
 *             index = index>>1
*/
    __pyx_t_1 = ((__pyx_v_index & 0x1) != 0);
    if (__pyx_t_1) {

      /* "opengl/legacy/colorizer.pyx":34
 *             den = den<<1
 *             if index & 0x1:
 *                 num += 1             # <<<<<<<<<<<<<<
 *             index = index>>1
 *         return <double>num/<double>den
*/
      __pyx_v_num = (__pyx_v_num + 1);

      /* "opengl/legacy/colorizer.pyx":33
 *             num = num<<1
 *             den = den<<1
 *             if index & 0x1:             # <<<<<<<<<<<<<<
 *                 num += 1
 *             index = index>>1
*/
    }

    /* "opengl/legacy/colorizer.pyx":35
 *             if index & 0x1:
 *                 num += 1
 *             index = index>>1             # <<<<<<<<<<<<<<
 *         return <double>num/<double>den
 * 
*/
    __pyx_v_index = (__pyx_v_index >> 1);
  }

  /* "opengl/legacy/colorizer.pyx":36
 *                 num += 1
 *             index = index>>1
 *         return <double>num/<double>den             # <<<<<<<<<<<<<<
 * 
 *     cdef hls_to_rgb(self, double h, double l, double s):
*/
  if (unlikely(((double)__pyx_v_den) == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "float division");
    __PYX_ERR(18, 36, __pyx_L1_error)
  }
  __pyx_r = (((double)__pyx_v_num) / ((double)__pyx_v_den));
  goto __pyx_L0;

  /* "opengl/legacy/colorizer.pyx":28
 *         return [R, G, B, self.alpha]
 * 
 *     cdef double index_to_hue(self, int index):             # <<<<<<<<<<<<<<
 *         cdef unsigned int num=0, den=1
 *         while index:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("CyOpenGL.Colorizer.index_to_hue", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  return __pyx_r;
}

/* "opengl/legacy/colorizer.pyx":38
 *         return <double>num/<double>den
 * 
 *     cdef hls_to_rgb(self, double h, double l, double s):             # <<<<<<<<<<<<<<
 *         if s == 0.0:
 *             return l, l, l
*/

static PyObject *__pyx_f_8CyOpenGL_9Colorizer_hls_to_rgb(struct __pyx_obj_8CyOpenGL_Colorizer *__pyx_v_self, double __pyx_v_h, double __pyx_v_l, double __pyx_v_s) {
  double __pyx_v_m2;
  double __pyx_v_m1;
  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_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("hls_to_rgb", 0);

  /* "opengl/legacy/colorizer.pyx":39
 * 
 *     cdef hls_to_rgb(self, double h, double l, double s):
 *         if s == 0.0:             # <<<<<<<<<<<<<<
 *             return l, l, l
 *         if l <= 0.5:
*/
  __pyx_t_1 = (__pyx_v_s == 0.0);
  if (__pyx_t_1) {

    /* "opengl/legacy/colorizer.pyx":40
 *     cdef hls_to_rgb(self, double h, double l, double s):
 *         if s == 0.0:
 *             return l, l, l             # <<<<<<<<<<<<<<
 *         if l <= 0.5:
 *             m2 = l * (1.0+s)
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyFloat_FromDouble(__pyx_v_l); if (unlikely(!__pyx_t_2)) __PYX_ERR(18, 40, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyFloat_FromDouble(__pyx_v_l); if (unlikely(!__pyx_t_3)) __PYX_ERR(18, 40, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyFloat_FromDouble(__pyx_v_l); if (unlikely(!__pyx_t_4)) __PYX_ERR(18, 40, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(18, 40, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_2);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2) != (0)) __PYX_ERR(18, 40, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_3);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3) != (0)) __PYX_ERR(18, 40, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_4);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4) != (0)) __PYX_ERR(18, 40, __pyx_L1_error);
    __pyx_t_2 = 0;
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;

    /* "opengl/legacy/colorizer.pyx":39
 * 
 *     cdef hls_to_rgb(self, double h, double l, double s):
 *         if s == 0.0:             # <<<<<<<<<<<<<<
 *             return l, l, l
 *         if l <= 0.5:
*/
  }

  /* "opengl/legacy/colorizer.pyx":41
 *         if s == 0.0:
 *             return l, l, l
 *         if l <= 0.5:             # <<<<<<<<<<<<<<
 *             m2 = l * (1.0+s)
 *         else:
*/
  __pyx_t_1 = (__pyx_v_l <= 0.5);
  if (__pyx_t_1) {

    /* "opengl/legacy/colorizer.pyx":42
 *             return l, l, l
 *         if l <= 0.5:
 *             m2 = l * (1.0+s)             # <<<<<<<<<<<<<<
 *         else:
 *             m2 = l+s-(l*s)
*/
    __pyx_v_m2 = (__pyx_v_l * (1.0 + __pyx_v_s));

    /* "opengl/legacy/colorizer.pyx":41
 *         if s == 0.0:
 *             return l, l, l
 *         if l <= 0.5:             # <<<<<<<<<<<<<<
 *             m2 = l * (1.0+s)
 *         else:
*/
    goto __pyx_L4;
  }

  /* "opengl/legacy/colorizer.pyx":44
 *             m2 = l * (1.0+s)
 *         else:
 *             m2 = l+s-(l*s)             # <<<<<<<<<<<<<<
 *         m1 = 2.0*l - m2
 *         return (self.hls_interp(m1, m2, h+1.0/3.0),
*/
  /*else*/ {
    __pyx_v_m2 = ((__pyx_v_l + __pyx_v_s) - (__pyx_v_l * __pyx_v_s));
  }
  __pyx_L4:;

  /* "opengl/legacy/colorizer.pyx":45
 *         else:
 *             m2 = l+s-(l*s)
 *         m1 = 2.0*l - m2             # <<<<<<<<<<<<<<
 *         return (self.hls_interp(m1, m2, h+1.0/3.0),
 *                 self.hls_interp(m1, m2, h),
*/
  __pyx_v_m1 = ((2.0 * __pyx_v_l) - __pyx_v_m2);

  /* "opengl/legacy/colorizer.pyx":46
 *             m2 = l+s-(l*s)
 *         m1 = 2.0*l - m2
 *         return (self.hls_interp(m1, m2, h+1.0/3.0),             # <<<<<<<<<<<<<<
 *                 self.hls_interp(m1, m2, h),
 *                 self.hls_interp(m1, m2, h-1.0/3.0))
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = ((struct __pyx_vtabstruct_8CyOpenGL_Colorizer *)__pyx_v_self->__pyx_vtab)->hls_interp(__pyx_v_self, __pyx_v_m1, __pyx_v_m2, (__pyx_v_h + (1.0 / 3.0))); if (unlikely(!__pyx_t_5)) __PYX_ERR(18, 46, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "opengl/legacy/colorizer.pyx":47
 *         m1 = 2.0*l - m2
 *         return (self.hls_interp(m1, m2, h+1.0/3.0),
 *                 self.hls_interp(m1, m2, h),             # <<<<<<<<<<<<<<
 *                 self.hls_interp(m1, m2, h-1.0/3.0))
 * 
*/
  __pyx_t_4 = ((struct __pyx_vtabstruct_8CyOpenGL_Colorizer *)__pyx_v_self->__pyx_vtab)->hls_interp(__pyx_v_self, __pyx_v_m1, __pyx_v_m2, __pyx_v_h); if (unlikely(!__pyx_t_4)) __PYX_ERR(18, 47, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "opengl/legacy/colorizer.pyx":48
 *         return (self.hls_interp(m1, m2, h+1.0/3.0),
 *                 self.hls_interp(m1, m2, h),
 *                 self.hls_interp(m1, m2, h-1.0/3.0))             # <<<<<<<<<<<<<<
 * 
 *     cdef hls_interp(self, double m1, double m2, double hue):
*/
  __pyx_t_3 = ((struct __pyx_vtabstruct_8CyOpenGL_Colorizer *)__pyx_v_self->__pyx_vtab)->hls_interp(__pyx_v_self, __pyx_v_m1, __pyx_v_m2, (__pyx_v_h - (1.0 / 3.0))); if (unlikely(!__pyx_t_3)) __PYX_ERR(18, 48, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "opengl/legacy/colorizer.pyx":46
 *             m2 = l+s-(l*s)
 *         m1 = 2.0*l - m2
 *         return (self.hls_interp(m1, m2, h+1.0/3.0),             # <<<<<<<<<<<<<<
 *                 self.hls_interp(m1, m2, h),
 *                 self.hls_interp(m1, m2, h-1.0/3.0))
*/
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(18, 46, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5) != (0)) __PYX_ERR(18, 46, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4) != (0)) __PYX_ERR(18, 46, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_3) != (0)) __PYX_ERR(18, 46, __pyx_L1_error);
  __pyx_t_5 = 0;
  __pyx_t_4 = 0;
  __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "opengl/legacy/colorizer.pyx":38
 *         return <double>num/<double>den
 * 
 *     cdef hls_to_rgb(self, double h, double l, double s):             # <<<<<<<<<<<<<<
 *         if s == 0.0:
 *             return l, l, l
*/

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

/* "opengl/legacy/colorizer.pyx":50
 *                 self.hls_interp(m1, m2, h-1.0/3.0))
 * 
 *     cdef hls_interp(self, double m1, double m2, double hue):             # <<<<<<<<<<<<<<
 *         hue = hue % 1.0
 *         if hue < 1.0/6.0:
*/

static PyObject *__pyx_f_8CyOpenGL_9Colorizer_hls_interp(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_Colorizer *__pyx_v_self, double __pyx_v_m1, double __pyx_v_m2, double __pyx_v_hue) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("hls_interp", 0);

  /* "opengl/legacy/colorizer.pyx":51
 * 
 *     cdef hls_interp(self, double m1, double m2, double hue):
 *         hue = hue % 1.0             # <<<<<<<<<<<<<<
 *         if hue < 1.0/6.0:
 *             return m1 + (m2-m1)*hue*6.0
*/
  __pyx_v_hue = __Pyx_mod_double(__pyx_v_hue, 1.0, 1);

  /* "opengl/legacy/colorizer.pyx":52
 *     cdef hls_interp(self, double m1, double m2, double hue):
 *         hue = hue % 1.0
 *         if hue < 1.0/6.0:             # <<<<<<<<<<<<<<
 *             return m1 + (m2-m1)*hue*6.0
 *         if hue < 0.5:
*/
  __pyx_t_1 = (__pyx_v_hue < (1.0 / 6.0));
  if (__pyx_t_1) {

    /* "opengl/legacy/colorizer.pyx":53
 *         hue = hue % 1.0
 *         if hue < 1.0/6.0:
 *             return m1 + (m2-m1)*hue*6.0             # <<<<<<<<<<<<<<
 *         if hue < 0.5:
 *             return m2
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyFloat_FromDouble((__pyx_v_m1 + (((__pyx_v_m2 - __pyx_v_m1) * __pyx_v_hue) * 6.0))); if (unlikely(!__pyx_t_2)) __PYX_ERR(18, 53, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "opengl/legacy/colorizer.pyx":52
 *     cdef hls_interp(self, double m1, double m2, double hue):
 *         hue = hue % 1.0
 *         if hue < 1.0/6.0:             # <<<<<<<<<<<<<<
 *             return m1 + (m2-m1)*hue*6.0
 *         if hue < 0.5:
*/
  }

  /* "opengl/legacy/colorizer.pyx":54
 *         if hue < 1.0/6.0:
 *             return m1 + (m2-m1)*hue*6.0
 *         if hue < 0.5:             # <<<<<<<<<<<<<<
 *             return m2
 *         if hue < 2.0/3.0:
*/
  __pyx_t_1 = (__pyx_v_hue < 0.5);
  if (__pyx_t_1) {

    /* "opengl/legacy/colorizer.pyx":55
 *             return m1 + (m2-m1)*hue*6.0
 *         if hue < 0.5:
 *             return m2             # <<<<<<<<<<<<<<
 *         if hue < 2.0/3.0:
 *             return m1 + (m2-m1)*(2.0/3.0-hue)*6.0
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyFloat_FromDouble(__pyx_v_m2); if (unlikely(!__pyx_t_2)) __PYX_ERR(18, 55, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "opengl/legacy/colorizer.pyx":54
 *         if hue < 1.0/6.0:
 *             return m1 + (m2-m1)*hue*6.0
 *         if hue < 0.5:             # <<<<<<<<<<<<<<
 *             return m2
 *         if hue < 2.0/3.0:
*/
  }

  /* "opengl/legacy/colorizer.pyx":56
 *         if hue < 0.5:
 *             return m2
 *         if hue < 2.0/3.0:             # <<<<<<<<<<<<<<
 *             return m1 + (m2-m1)*(2.0/3.0-hue)*6.0
 *         return m1
*/
  __pyx_t_1 = (__pyx_v_hue < (2.0 / 3.0));
  if (__pyx_t_1) {

    /* "opengl/legacy/colorizer.pyx":57
 *             return m2
 *         if hue < 2.0/3.0:
 *             return m1 + (m2-m1)*(2.0/3.0-hue)*6.0             # <<<<<<<<<<<<<<
 *         return m1
 * 
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyFloat_FromDouble((__pyx_v_m1 + (((__pyx_v_m2 - __pyx_v_m1) * ((2.0 / 3.0) - __pyx_v_hue)) * 6.0))); if (unlikely(!__pyx_t_2)) __PYX_ERR(18, 57, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "opengl/legacy/colorizer.pyx":56
 *         if hue < 0.5:
 *             return m2
 *         if hue < 2.0/3.0:             # <<<<<<<<<<<<<<
 *             return m1 + (m2-m1)*(2.0/3.0-hue)*6.0
 *         return m1
*/
  }

  /* "opengl/legacy/colorizer.pyx":58
 *         if hue < 2.0/3.0:
 *             return m1 + (m2-m1)*(2.0/3.0-hue)*6.0
 *         return m1             # <<<<<<<<<<<<<<
 * 
 * GetColor = Colorizer()
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_m1); if (unlikely(!__pyx_t_2)) __PYX_ERR(18, 58, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "opengl/legacy/colorizer.pyx":50
 *                 self.hls_interp(m1, m2, h-1.0/3.0))
 * 
 *     cdef hls_interp(self, double m1, double m2, double hue):             # <<<<<<<<<<<<<<
 *         hue = hue % 1.0
 *         if hue < 1.0/6.0:
*/

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

/* "opengl/legacy/horosphere.pyx":9
 *     cdef GLint stacks, slices
 * 
 *     def __init__(self,             # <<<<<<<<<<<<<<
 *                  color=[0.8,0.0,0.0,0.3],
 *                  radius=1.0,
*/

/* Python wrapper */
static int __pyx_pw_8CyOpenGL_10Horosphere_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_8CyOpenGL_10Horosphere_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_color = 0;
  PyObject *__pyx_v_radius = 0;
  CYTHON_UNUSED PyObject *__pyx_v_front_specular = 0;
  CYTHON_UNUSED PyObject *__pyx_v_back_specular = 0;
  CYTHON_UNUSED PyObject *__pyx_v_front_shininess = 0;
  CYTHON_UNUSED PyObject *__pyx_v_back_shininess = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[6] = {0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_color,&__pyx_mstate_global->__pyx_n_u_radius,&__pyx_mstate_global->__pyx_n_u_front_specular,&__pyx_mstate_global->__pyx_n_u_back_specular,&__pyx_mstate_global->__pyx_n_u_front_shininess,&__pyx_mstate_global->__pyx_n_u_back_shininess,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(19, 9, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  6:
        values[5] = __Pyx_ArgRef_VARARGS(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(19, 9, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_VARARGS(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(19, 9, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_VARARGS(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(19, 9, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(19, 9, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(19, 9, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(19, 9, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(19, 9, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(__pyx_mstate_global->__pyx_k__12);
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_float_1_0));
      if (!values[2]) values[2] = __Pyx_NewRef(__pyx_mstate_global->__pyx_k__13);
      if (!values[3]) values[3] = __Pyx_NewRef(__pyx_mstate_global->__pyx_k__14);
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_float_50_0));
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_float_0_0));
    } else {
      switch (__pyx_nargs) {
        case  6:
        values[5] = __Pyx_ArgRef_VARARGS(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(19, 9, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_VARARGS(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(19, 9, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_VARARGS(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(19, 9, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(19, 9, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(19, 9, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(19, 9, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(__pyx_mstate_global->__pyx_k__12);
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_float_1_0));
      if (!values[2]) values[2] = __Pyx_NewRef(__pyx_mstate_global->__pyx_k__13);
      if (!values[3]) values[3] = __Pyx_NewRef(__pyx_mstate_global->__pyx_k__14);
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_float_50_0));
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_float_0_0));
    }
    __pyx_v_color = values[0];
    __pyx_v_radius = values[1];
    __pyx_v_front_specular = values[2];
    __pyx_v_back_specular = values[3];
    __pyx_v_front_shininess = values[4];
    __pyx_v_back_shininess = values[5];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 6, __pyx_nargs); __PYX_ERR(19, 9, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("CyOpenGL.Horosphere.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_10Horosphere___init__(((struct __pyx_obj_8CyOpenGL_Horosphere *)__pyx_v_self), __pyx_v_color, __pyx_v_radius, __pyx_v_front_specular, __pyx_v_back_specular, __pyx_v_front_shininess, __pyx_v_back_shininess);

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

static int __pyx_pf_8CyOpenGL_10Horosphere___init__(struct __pyx_obj_8CyOpenGL_Horosphere *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_color, PyObject *__pyx_v_radius, CYTHON_UNUSED PyObject *__pyx_v_front_specular, CYTHON_UNUSED PyObject *__pyx_v_back_specular, CYTHON_UNUSED PyObject *__pyx_v_front_shininess, CYTHON_UNUSED PyObject *__pyx_v_back_shininess) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  GLdouble __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  long __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  GLint __pyx_t_8;
  size_t __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "opengl/legacy/horosphere.pyx":17
 *                  back_shininess = 0.0
 *                  ):
 *         self.radius = radius             # <<<<<<<<<<<<<<
 *         self.stacks = 2*max(2, int(8*radius))
 *         self.slices = max(20, int(60*radius))
*/
  __pyx_t_1 = __Pyx_PyFloat_AsDouble(__pyx_v_radius); if (unlikely((__pyx_t_1 == ((GLdouble)-1)) && PyErr_Occurred())) __PYX_ERR(19, 17, __pyx_L1_error)
  __pyx_v_self->radius = __pyx_t_1;

  /* "opengl/legacy/horosphere.pyx":18
 *                  ):
 *         self.radius = radius
 *         self.stacks = 2*max(2, int(8*radius))             # <<<<<<<<<<<<<<
 *         self.slices = max(20, int(60*radius))
 *         self.build_vertices_and_normals()
*/
  __pyx_t_2 = __Pyx_PyLong_MultiplyCObj(__pyx_mstate_global->__pyx_int_8, __pyx_v_radius, 8, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(19, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = 2;
  __pyx_t_5 = __Pyx_PyLong_From_long(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(19, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 18, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(19, 18, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__pyx_t_7) {
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_2 = __pyx_t_3;
  } else {
    __pyx_t_6 = __Pyx_PyLong_From_long(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 18, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_PyInt_FromNumber(&__pyx_t_6, NULL, 0) < (0)) __PYX_ERR(19, 18, __pyx_L1_error)
    __pyx_t_2 = __pyx_t_6;
    __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyLong_MultiplyCObj(__pyx_mstate_global->__pyx_int_2, __pyx_t_2, 2, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_8 = __Pyx_PyLong_As_GLint(__pyx_t_3); if (unlikely((__pyx_t_8 == ((GLint)-1)) && PyErr_Occurred())) __PYX_ERR(19, 18, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_self->stacks = __pyx_t_8;

  /* "opengl/legacy/horosphere.pyx":19
 *         self.radius = radius
 *         self.stacks = 2*max(2, int(8*radius))
 *         self.slices = max(20, int(60*radius))             # <<<<<<<<<<<<<<
 *         self.build_vertices_and_normals()
 *         self.build_triangles()
*/
  __pyx_t_3 = __Pyx_PyLong_MultiplyCObj(__pyx_mstate_global->__pyx_int_60, __pyx_v_radius, 60, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(19, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_4 = 20;
  __pyx_t_6 = __Pyx_PyLong_From_long(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_t_6, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(19, 19, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(19, 19, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_7) {
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_3 = __pyx_t_2;
  } else {
    __pyx_t_5 = __Pyx_PyLong_From_long(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(19, 19, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_PyInt_FromNumber(&__pyx_t_5, NULL, 0) < (0)) __PYX_ERR(19, 19, __pyx_L1_error)
    __pyx_t_3 = __pyx_t_5;
    __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_8 = __Pyx_PyLong_As_GLint(__pyx_t_3); if (unlikely((__pyx_t_8 == ((GLint)-1)) && PyErr_Occurred())) __PYX_ERR(19, 19, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_self->slices = __pyx_t_8;

  /* "opengl/legacy/horosphere.pyx":20
 *         self.stacks = 2*max(2, int(8*radius))
 *         self.slices = max(20, int(60*radius))
 *         self.build_vertices_and_normals()             # <<<<<<<<<<<<<<
 *         self.build_triangles()
 *         self.build_arrays()
*/
  __pyx_t_3 = ((struct __pyx_vtabstruct_8CyOpenGL_Horosphere *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->build_vertices_and_normals(__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "opengl/legacy/horosphere.pyx":21
 *         self.slices = max(20, int(60*radius))
 *         self.build_vertices_and_normals()
 *         self.build_triangles()             # <<<<<<<<<<<<<<
 *         self.build_arrays()
 * 
*/
  __pyx_t_3 = ((struct __pyx_vtabstruct_8CyOpenGL_Horosphere *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->build_triangles(__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "opengl/legacy/horosphere.pyx":22
 *         self.build_vertices_and_normals()
 *         self.build_triangles()
 *         self.build_arrays()             # <<<<<<<<<<<<<<
 * 
 *     cdef build_vertices_and_normals(self):
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_9 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_build_arrays, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 22, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "opengl/legacy/horosphere.pyx":9
 *     cdef GLint stacks, slices
 * 
 *     def __init__(self,             # <<<<<<<<<<<<<<
 *                  color=[0.8,0.0,0.0,0.3],
 *                  radius=1.0,
*/

  /* 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_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("CyOpenGL.Horosphere.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opengl/legacy/horosphere.pyx":24
 *         self.build_arrays()
 * 
 *     cdef build_vertices_and_normals(self):             # <<<<<<<<<<<<<<
 *         a, b = self.stacks, self.slices
 *         dtheta = 2*pi/b
*/

static PyObject *__pyx_f_8CyOpenGL_10Horosphere_build_vertices_and_normals(struct __pyx_obj_8CyOpenGL_Horosphere *__pyx_v_self) {
  PyObject *__pyx_v_a = NULL;
  PyObject *__pyx_v_b = NULL;
  PyObject *__pyx_v_dtheta = NULL;
  PyObject *__pyx_v_dphi = NULL;
  PyObject *__pyx_v_verts = NULL;
  PyObject *__pyx_v_phi = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_j = NULL;
  PyObject *__pyx_v_r = NULL;
  PyObject *__pyx_v_z = NULL;
  PyObject *__pyx_v_theta = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_x = NULL;
  PyObject *__pyx_v_y = NULL;
  struct __pyx_obj_8CyOpenGL_vector3 *__pyx_v_N = NULL;
  PyObject *__pyx_v_V = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *(*__pyx_t_8)(PyObject *);
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  int __pyx_t_12;
  PyObject *(*__pyx_t_13)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("build_vertices_and_normals", 0);

  /* "opengl/legacy/horosphere.pyx":25
 * 
 *     cdef build_vertices_and_normals(self):
 *         a, b = self.stacks, self.slices             # <<<<<<<<<<<<<<
 *         dtheta = 2*pi/b
 *         dphi = pi/a
*/
  __pyx_t_1 = __Pyx_PyLong_From_GLint(__pyx_v_self->stacks); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyLong_From_GLint(__pyx_v_self->slices); if (unlikely(!__pyx_t_2)) __PYX_ERR(19, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_a = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v_b = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "opengl/legacy/horosphere.pyx":26
 *     cdef build_vertices_and_normals(self):
 *         a, b = self.stacks, self.slices
 *         dtheta = 2*pi/b             # <<<<<<<<<<<<<<
 *         dphi = pi/a
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_pi); if (unlikely(!__pyx_t_2)) __PYX_ERR(19, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyLong_MultiplyCObj(__pyx_mstate_global->__pyx_int_2, __pyx_t_2, 2, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_v_b); if (unlikely(!__pyx_t_2)) __PYX_ERR(19, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_dtheta = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "opengl/legacy/horosphere.pyx":27
 *         a, b = self.stacks, self.slices
 *         dtheta = 2*pi/b
 *         dphi = pi/a             # <<<<<<<<<<<<<<
 * 
 *         verts = []
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_pi); if (unlikely(!__pyx_t_2)) __PYX_ERR(19, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_2, __pyx_v_a); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_dphi = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "opengl/legacy/horosphere.pyx":29
 *         dphi = pi/a
 * 
 *         verts = []             # <<<<<<<<<<<<<<
 *         phi = 0
 *         for j in range(a - 1):
*/
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_verts = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "opengl/legacy/horosphere.pyx":30
 * 
 *         verts = []
 *         phi = 0             # <<<<<<<<<<<<<<
 *         for j in range(a - 1):
 *             phi += dphi
*/
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
  __pyx_v_phi = __pyx_mstate_global->__pyx_int_0;

  /* "opengl/legacy/horosphere.pyx":31
 *         verts = []
 *         phi = 0
 *         for j in range(a - 1):             # <<<<<<<<<<<<<<
 *             phi += dphi
 *             r, z = sin(phi), cos(phi)
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = __Pyx_PyLong_SubtractObjC(__pyx_v_a, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(&PyRange_Type), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 31, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(19, 31, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    {
      __pyx_t_1 = __pyx_t_5(__pyx_t_3);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(19, 31, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "opengl/legacy/horosphere.pyx":32
 *         phi = 0
 *         for j in range(a - 1):
 *             phi += dphi             # <<<<<<<<<<<<<<
 *             r, z = sin(phi), cos(phi)
 *             theta = 0
*/
    __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_phi, __pyx_v_dphi); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 32, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v_phi, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "opengl/legacy/horosphere.pyx":33
 *         for j in range(a - 1):
 *             phi += dphi
 *             r, z = sin(phi), cos(phi)             # <<<<<<<<<<<<<<
 *             theta = 0
 *             for i in range(0, b):
*/
    __pyx_t_2 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_sin); if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 33, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6);
      assert(__pyx_t_2);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
      __pyx_t_4 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_phi};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 33, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __pyx_t_2 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_cos); if (unlikely(!__pyx_t_7)) __PYX_ERR(19, 33, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_4 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_7);
      assert(__pyx_t_2);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
      __pyx_t_4 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_phi};
      __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 33, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
    }
    __Pyx_XDECREF_SET(__pyx_v_r, __pyx_t_1);
    __pyx_t_1 = 0;
    __Pyx_XDECREF_SET(__pyx_v_z, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "opengl/legacy/horosphere.pyx":34
 *             phi += dphi
 *             r, z = sin(phi), cos(phi)
 *             theta = 0             # <<<<<<<<<<<<<<
 *             for i in range(0, b):
 *                 verts.append((r*cos(theta), r*sin(theta), z))
*/
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
    __Pyx_XDECREF_SET(__pyx_v_theta, __pyx_mstate_global->__pyx_int_0);

    /* "opengl/legacy/horosphere.pyx":35
 *             r, z = sin(phi), cos(phi)
 *             theta = 0
 *             for i in range(0, b):             # <<<<<<<<<<<<<<
 *                 verts.append((r*cos(theta), r*sin(theta), z))
 *                 theta += dtheta
*/
    __pyx_t_1 = NULL;
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_mstate_global->__pyx_int_0, __pyx_v_b};
      __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)(&PyRange_Type), __pyx_callargs+__pyx_t_4, (3-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 35, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
    }
    __pyx_t_1 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 35, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(19, 35, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    for (;;) {
      {
        __pyx_t_6 = __pyx_t_8(__pyx_t_1);
        if (unlikely(!__pyx_t_6)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(19, 35, __pyx_L1_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "opengl/legacy/horosphere.pyx":36
 *             theta = 0
 *             for i in range(0, b):
 *                 verts.append((r*cos(theta), r*sin(theta), z))             # <<<<<<<<<<<<<<
 *                 theta += dtheta
 *         verts += [(0, 0, 1), (0, 0, -1)]
*/
      __pyx_t_7 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_cos); if (unlikely(!__pyx_t_2)) __PYX_ERR(19, 36, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
        assert(__pyx_t_7);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
        __pyx_t_4 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_theta};
        __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 36, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
      }
      __pyx_t_2 = PyNumber_Multiply(__pyx_v_r, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(19, 36, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_sin); if (unlikely(!__pyx_t_9)) __PYX_ERR(19, 36, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_4 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_9))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_9);
        assert(__pyx_t_7);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_9);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_9, __pyx__function);
        __pyx_t_4 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_theta};
        __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_9, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 36, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
      }
      __pyx_t_9 = PyNumber_Multiply(__pyx_v_r, __pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(19, 36, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 36, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_2);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2) != (0)) __PYX_ERR(19, 36, __pyx_L1_error);
      __Pyx_GIVEREF(__pyx_t_9);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_9) != (0)) __PYX_ERR(19, 36, __pyx_L1_error);
      __Pyx_INCREF(__pyx_v_z);
      __Pyx_GIVEREF(__pyx_v_z);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_z) != (0)) __PYX_ERR(19, 36, __pyx_L1_error);
      __pyx_t_2 = 0;
      __pyx_t_9 = 0;
      __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_verts, __pyx_t_6); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(19, 36, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "opengl/legacy/horosphere.pyx":37
 *             for i in range(0, b):
 *                 verts.append((r*cos(theta), r*sin(theta), z))
 *                 theta += dtheta             # <<<<<<<<<<<<<<
 *         verts += [(0, 0, 1), (0, 0, -1)]
 *         assert len(verts) == a*b - b + 2
*/
      __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_theta, __pyx_v_dtheta); if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 37, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF_SET(__pyx_v_theta, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "opengl/legacy/horosphere.pyx":35
 *             r, z = sin(phi), cos(phi)
 *             theta = 0
 *             for i in range(0, b):             # <<<<<<<<<<<<<<
 *                 verts.append((r*cos(theta), r*sin(theta), z))
 *                 theta += dtheta
*/
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "opengl/legacy/horosphere.pyx":31
 *         verts = []
 *         phi = 0
 *         for j in range(a - 1):             # <<<<<<<<<<<<<<
 *             phi += dphi
 *             r, z = sin(phi), cos(phi)
*/
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "opengl/legacy/horosphere.pyx":38
 *                 verts.append((r*cos(theta), r*sin(theta), z))
 *                 theta += dtheta
 *         verts += [(0, 0, 1), (0, 0, -1)]             # <<<<<<<<<<<<<<
 *         assert len(verts) == a*b - b + 2
 * 
*/
  __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 38, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_tuple[5]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[5]);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_mstate_global->__pyx_tuple[5]) != (0)) __PYX_ERR(19, 38, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_tuple[6]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[6]);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_mstate_global->__pyx_tuple[6]) != (0)) __PYX_ERR(19, 38, __pyx_L1_error);
  __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_verts, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 38, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF_SET(__pyx_v_verts, ((PyObject*)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "opengl/legacy/horosphere.pyx":39
 *                 theta += dtheta
 *         verts += [(0, 0, 1), (0, 0, -1)]
 *         assert len(verts) == a*b - b + 2             # <<<<<<<<<<<<<<
 * 
 *         self.vertices, self.normals = [], []
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_11 = __Pyx_PyList_GET_SIZE(__pyx_v_verts); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(19, 39, __pyx_L1_error)
    __pyx_t_1 = PyLong_FromSsize_t(__pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 39, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyNumber_Multiply(__pyx_v_a, __pyx_v_b); if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 39, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = PyNumber_Subtract(__pyx_t_3, __pyx_v_b); if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 39, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyLong_AddObjC(__pyx_t_6, __pyx_mstate_global->__pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 39, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 39, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(19, 39, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_12)) {
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(19, 39, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(19, 39, __pyx_L1_error)
  #endif

  /* "opengl/legacy/horosphere.pyx":41
 *         assert len(verts) == a*b - b + 2
 * 
 *         self.vertices, self.normals = [], []             # <<<<<<<<<<<<<<
 *         for x, y, z in verts:
 *             N = vector3((x, y, z))
*/
  __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 41, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 41, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_6);
  __Pyx_GOTREF(__pyx_v_self->__pyx_base.vertices);
  __Pyx_DECREF(__pyx_v_self->__pyx_base.vertices);
  __pyx_v_self->__pyx_base.vertices = __pyx_t_6;
  __pyx_t_6 = 0;
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_GOTREF(__pyx_v_self->__pyx_base.normals);
  __Pyx_DECREF(__pyx_v_self->__pyx_base.normals);
  __pyx_v_self->__pyx_base.normals = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "opengl/legacy/horosphere.pyx":42
 * 
 *         self.vertices, self.normals = [], []
 *         for x, y, z in verts:             # <<<<<<<<<<<<<<
 *             N = vector3((x, y, z))
 *             V = N*self.radius
*/
  __pyx_t_3 = __pyx_v_verts; __Pyx_INCREF(__pyx_t_3);
  __pyx_t_11 = 0;
  for (;;) {
    {
      Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3);
      #if !CYTHON_ASSUME_SAFE_SIZE
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(19, 42, __pyx_L1_error)
      #endif
      if (__pyx_t_11 >= __pyx_temp) break;
    }
    __pyx_t_6 = __Pyx_PyList_GetItemRefFast(__pyx_t_3, __pyx_t_11, __Pyx_ReferenceSharing_OwnStrongReference);
    ++__pyx_t_11;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 42, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) {
      PyObject* sequence = __pyx_t_6;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 3)) {
        if (size > 3) __Pyx_RaiseTooManyValuesError(3);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(19, 42, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_9);
        __pyx_t_2 = PyTuple_GET_ITEM(sequence, 2);
        __Pyx_INCREF(__pyx_t_2);
      } else {
        __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 42, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_1);
        __pyx_t_9 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_9)) __PYX_ERR(19, 42, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_9);
        __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_2)) __PYX_ERR(19, 42, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_2);
      }
      #else
      __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 42, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_9 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(19, 42, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(19, 42, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      #endif
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_7 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(19, 42, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_13 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_7);
      index = 0; __pyx_t_1 = __pyx_t_13(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L11_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_1);
      index = 1; __pyx_t_9 = __pyx_t_13(__pyx_t_7); if (unlikely(!__pyx_t_9)) goto __pyx_L11_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_9);
      index = 2; __pyx_t_2 = __pyx_t_13(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L11_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_2);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_7), 3) < (0)) __PYX_ERR(19, 42, __pyx_L1_error)
      __pyx_t_13 = NULL;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L12_unpacking_done;
      __pyx_L11_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_13 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(19, 42, __pyx_L1_error)
      __pyx_L12_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_1);
    __pyx_t_1 = 0;
    __Pyx_XDECREF_SET(__pyx_v_y, __pyx_t_9);
    __pyx_t_9 = 0;
    __Pyx_XDECREF_SET(__pyx_v_z, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "opengl/legacy/horosphere.pyx":43
 *         self.vertices, self.normals = [], []
 *         for x, y, z in verts:
 *             N = vector3((x, y, z))             # <<<<<<<<<<<<<<
 *             V = N*self.radius
 *             self.vertices.append(V)
*/
    __pyx_t_2 = NULL;
    __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(19, 43, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_INCREF(__pyx_v_x);
    __Pyx_GIVEREF(__pyx_v_x);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_x) != (0)) __PYX_ERR(19, 43, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_y);
    __Pyx_GIVEREF(__pyx_v_y);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_y) != (0)) __PYX_ERR(19, 43, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_z);
    __Pyx_GIVEREF(__pyx_v_z);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_v_z) != (0)) __PYX_ERR(19, 43, __pyx_L1_error);
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_9};
      __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8CyOpenGL_vector3, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 43, __pyx_L1_error)
      __Pyx_GOTREF((PyObject *)__pyx_t_6);
    }
    __Pyx_XDECREF_SET(__pyx_v_N, ((struct __pyx_obj_8CyOpenGL_vector3 *)__pyx_t_6));
    __pyx_t_6 = 0;

    /* "opengl/legacy/horosphere.pyx":44
 *         for x, y, z in verts:
 *             N = vector3((x, y, z))
 *             V = N*self.radius             # <<<<<<<<<<<<<<
 *             self.vertices.append(V)
 *             self.normals.append(N)
*/
    __pyx_t_6 = PyFloat_FromDouble(__pyx_v_self->radius); if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 44, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_9 = PyNumber_Multiply(((PyObject *)__pyx_v_N), __pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(19, 44, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF_SET(__pyx_v_V, __pyx_t_9);
    __pyx_t_9 = 0;

    /* "opengl/legacy/horosphere.pyx":45
 *             N = vector3((x, y, z))
 *             V = N*self.radius
 *             self.vertices.append(V)             # <<<<<<<<<<<<<<
 *             self.normals.append(N)
 * 
*/
    __pyx_t_10 = __Pyx_PyObject_Append(__pyx_v_self->__pyx_base.vertices, __pyx_v_V); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(19, 45, __pyx_L1_error)

    /* "opengl/legacy/horosphere.pyx":46
 *             V = N*self.radius
 *             self.vertices.append(V)
 *             self.normals.append(N)             # <<<<<<<<<<<<<<
 * 
 *     cdef build_triangles(self):
*/
    __pyx_t_10 = __Pyx_PyObject_Append(__pyx_v_self->__pyx_base.normals, ((PyObject *)__pyx_v_N)); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(19, 46, __pyx_L1_error)

    /* "opengl/legacy/horosphere.pyx":42
 * 
 *         self.vertices, self.normals = [], []
 *         for x, y, z in verts:             # <<<<<<<<<<<<<<
 *             N = vector3((x, y, z))
 *             V = N*self.radius
*/
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "opengl/legacy/horosphere.pyx":24
 *         self.build_arrays()
 * 
 *     cdef build_vertices_and_normals(self):             # <<<<<<<<<<<<<<
 *         a, b = self.stacks, self.slices
 *         dtheta = 2*pi/b
*/

  /* 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_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("CyOpenGL.Horosphere.build_vertices_and_normals", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_a);
  __Pyx_XDECREF(__pyx_v_b);
  __Pyx_XDECREF(__pyx_v_dtheta);
  __Pyx_XDECREF(__pyx_v_dphi);
  __Pyx_XDECREF(__pyx_v_verts);
  __Pyx_XDECREF(__pyx_v_phi);
  __Pyx_XDECREF(__pyx_v_j);
  __Pyx_XDECREF(__pyx_v_r);
  __Pyx_XDECREF(__pyx_v_z);
  __Pyx_XDECREF(__pyx_v_theta);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XDECREF(__pyx_v_y);
  __Pyx_XDECREF((PyObject *)__pyx_v_N);
  __Pyx_XDECREF(__pyx_v_V);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opengl/legacy/horosphere.pyx":48
 *             self.normals.append(N)
 * 
 *     cdef build_triangles(self):             # <<<<<<<<<<<<<<
 *         self.triangles = tri = []
 *         a, b = self.stacks, self.slices
*/

static PyObject *__pyx_f_8CyOpenGL_10Horosphere_build_triangles(struct __pyx_obj_8CyOpenGL_Horosphere *__pyx_v_self) {
  PyObject *__pyx_v_tri = NULL;
  PyObject *__pyx_v_a = NULL;
  PyObject *__pyx_v_b = NULL;
  PyObject *__pyx_v_north = NULL;
  PyObject *__pyx_v_south = NULL;
  PyObject *__pyx_v_shift = NULL;
  PyObject *__pyx_v_annulus = NULL;
  PyObject *__pyx_v_v0 = NULL;
  PyObject *__pyx_v_w0 = NULL;
  PyObject *__pyx_v_v1 = NULL;
  PyObject *__pyx_v_w1 = NULL;
  PyObject *__pyx_v_s = NULL;
  PyObject *__pyx_8genexpr2__pyx_v_i = NULL;
  PyObject *__pyx_8genexpr3__pyx_v_i = NULL;
  PyObject *__pyx_8genexpr4__pyx_v_u = NULL;
  PyObject *__pyx_8genexpr4__pyx_v_v = NULL;
  PyObject *__pyx_8genexpr4__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;
  size_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 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *(*__pyx_t_12)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("build_triangles", 0);

  /* "opengl/legacy/horosphere.pyx":49
 * 
 *     cdef build_triangles(self):
 *         self.triangles = tri = []             # <<<<<<<<<<<<<<
 *         a, b = self.stacks, self.slices
 * 
*/
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->__pyx_base.triangles);
  __Pyx_DECREF(__pyx_v_self->__pyx_base.triangles);
  __pyx_v_self->__pyx_base.triangles = __pyx_t_1;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_tri = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/legacy/horosphere.pyx":50
 *     cdef build_triangles(self):
 *         self.triangles = tri = []
 *         a, b = self.stacks, self.slices             # <<<<<<<<<<<<<<
 * 
 *         # Start with the two polar caps
*/
  __pyx_t_1 = __Pyx_PyLong_From_GLint(__pyx_v_self->stacks); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyLong_From_GLint(__pyx_v_self->slices); if (unlikely(!__pyx_t_2)) __PYX_ERR(19, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_a = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v_b = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "opengl/legacy/horosphere.pyx":53
 * 
 *         # Start with the two polar caps
 *         north = a*b - b             # <<<<<<<<<<<<<<
 *         south = north + 1
 *         tri += [(north, i, (i + 1) % b) for i in range(b)]
*/
  __pyx_t_2 = PyNumber_Multiply(__pyx_v_a, __pyx_v_b); if (unlikely(!__pyx_t_2)) __PYX_ERR(19, 53, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyNumber_Subtract(__pyx_t_2, __pyx_v_b); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 53, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_north = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "opengl/legacy/horosphere.pyx":54
 *         # Start with the two polar caps
 *         north = a*b - b
 *         south = north + 1             # <<<<<<<<<<<<<<
 *         tri += [(north, i, (i + 1) % b) for i in range(b)]
 *         shift = north - b
*/
  __pyx_t_1 = __Pyx_PyLong_AddObjC(__pyx_v_north, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 54, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_south = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "opengl/legacy/horosphere.pyx":55
 *         north = a*b - b
 *         south = north + 1
 *         tri += [(north, i, (i + 1) % b) for i in range(b)]             # <<<<<<<<<<<<<<
 *         shift = north - b
 *         tri += [(south, shift + (i + 1) % b, shift + i) for i in range(b)]
*/
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 55, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = NULL;
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_b};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(&PyRange_Type), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(19, 55, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 55, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(19, 55, __pyx_L5_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    for (;;) {
      {
        __pyx_t_2 = __pyx_t_5(__pyx_t_3);
        if (unlikely(!__pyx_t_2)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(19, 55, __pyx_L5_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_XDECREF_SET(__pyx_8genexpr2__pyx_v_i, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_PyLong_AddObjC(__pyx_8genexpr2__pyx_v_i, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(19, 55, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_6 = PyNumber_Remainder(__pyx_t_2, __pyx_v_b); if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 55, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(19, 55, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_north);
      __Pyx_GIVEREF(__pyx_v_north);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_north) != (0)) __PYX_ERR(19, 55, __pyx_L5_error);
      __Pyx_INCREF(__pyx_8genexpr2__pyx_v_i);
      __Pyx_GIVEREF(__pyx_8genexpr2__pyx_v_i);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_8genexpr2__pyx_v_i) != (0)) __PYX_ERR(19, 55, __pyx_L5_error);
      __Pyx_GIVEREF(__pyx_t_6);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_6) != (0)) __PYX_ERR(19, 55, __pyx_L5_error);
      __pyx_t_6 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(19, 55, __pyx_L5_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_i); __pyx_8genexpr2__pyx_v_i = 0;
    goto __pyx_L9_exit_scope;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_i); __pyx_8genexpr2__pyx_v_i = 0;
    goto __pyx_L1_error;
    __pyx_L9_exit_scope:;
  } /* exit inner scope */
  __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_tri, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF_SET(__pyx_v_tri, ((PyObject*)__pyx_t_3));
  __pyx_t_3 = 0;

  /* "opengl/legacy/horosphere.pyx":56
 *         south = north + 1
 *         tri += [(north, i, (i + 1) % b) for i in range(b)]
 *         shift = north - b             # <<<<<<<<<<<<<<
 *         tri += [(south, shift + (i + 1) % b, shift + i) for i in range(b)]
 * 
*/
  __pyx_t_3 = PyNumber_Subtract(__pyx_v_north, __pyx_v_b); if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 56, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_shift = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "opengl/legacy/horosphere.pyx":57
 *         tri += [(north, i, (i + 1) % b) for i in range(b)]
 *         shift = north - b
 *         tri += [(south, shift + (i + 1) % b, shift + i) for i in range(b)]             # <<<<<<<<<<<<<<
 * 
 *         # Now build the rest with annular bands
*/
  { /* enter inner scope */
    __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 57, __pyx_L12_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = NULL;
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_b};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(&PyRange_Type), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 57, __pyx_L12_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(19, 57, __pyx_L12_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(19, 57, __pyx_L12_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    for (;;) {
      {
        __pyx_t_1 = __pyx_t_5(__pyx_t_2);
        if (unlikely(!__pyx_t_1)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(19, 57, __pyx_L12_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_XDECREF_SET(__pyx_8genexpr3__pyx_v_i, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyLong_AddObjC(__pyx_8genexpr3__pyx_v_i, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 57, __pyx_L12_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = PyNumber_Remainder(__pyx_t_1, __pyx_v_b); if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 57, __pyx_L12_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyNumber_Add(__pyx_v_shift, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 57, __pyx_L12_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyNumber_Add(__pyx_v_shift, __pyx_8genexpr3__pyx_v_i); if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 57, __pyx_L12_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(19, 57, __pyx_L12_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_v_south);
      __Pyx_GIVEREF(__pyx_v_south);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_south) != (0)) __PYX_ERR(19, 57, __pyx_L12_error);
      __Pyx_GIVEREF(__pyx_t_1);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_1) != (0)) __PYX_ERR(19, 57, __pyx_L12_error);
      __Pyx_GIVEREF(__pyx_t_6);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_6) != (0)) __PYX_ERR(19, 57, __pyx_L12_error);
      __pyx_t_1 = 0;
      __pyx_t_6 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_7))) __PYX_ERR(19, 57, __pyx_L12_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_i); __pyx_8genexpr3__pyx_v_i = 0;
    goto __pyx_L16_exit_scope;
    __pyx_L12_error:;
    __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_i); __pyx_8genexpr3__pyx_v_i = 0;
    goto __pyx_L1_error;
    __pyx_L16_exit_scope:;
  } /* exit inner scope */
  __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_tri, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(19, 57, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF_SET(__pyx_v_tri, ((PyObject*)__pyx_t_2));
  __pyx_t_2 = 0;

  /* "opengl/legacy/horosphere.pyx":60
 * 
 *         # Now build the rest with annular bands
 *         annulus = []             # <<<<<<<<<<<<<<
 *         for v0 in range(0, b):
 *             w0 = (v0 + 1) % b
*/
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(19, 60, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_annulus = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "opengl/legacy/horosphere.pyx":61
 *         # Now build the rest with annular bands
 *         annulus = []
 *         for v0 in range(0, b):             # <<<<<<<<<<<<<<
 *             w0 = (v0 + 1) % b
 *             v1, w1 = v0 + b, w0 + b
*/
  __pyx_t_3 = NULL;
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_mstate_global->__pyx_int_0, __pyx_v_b};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(&PyRange_Type), __pyx_callargs+__pyx_t_4, (3-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(19, 61, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(19, 61, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    {
      __pyx_t_2 = __pyx_t_5(__pyx_t_3);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(19, 61, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF_SET(__pyx_v_v0, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "opengl/legacy/horosphere.pyx":62
 *         annulus = []
 *         for v0 in range(0, b):
 *             w0 = (v0 + 1) % b             # <<<<<<<<<<<<<<
 *             v1, w1 = v0 + b, w0 + b
 *             annulus += [(v0, v1, w1), (w0, v0, w1)]
*/
    __pyx_t_2 = __Pyx_PyLong_AddObjC(__pyx_v_v0, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(19, 62, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_7 = PyNumber_Remainder(__pyx_t_2, __pyx_v_b); if (unlikely(!__pyx_t_7)) __PYX_ERR(19, 62, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF_SET(__pyx_v_w0, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "opengl/legacy/horosphere.pyx":63
 *         for v0 in range(0, b):
 *             w0 = (v0 + 1) % b
 *             v1, w1 = v0 + b, w0 + b             # <<<<<<<<<<<<<<
 *             annulus += [(v0, v1, w1), (w0, v0, w1)]
 * 
*/
    __pyx_t_7 = PyNumber_Add(__pyx_v_v0, __pyx_v_b); if (unlikely(!__pyx_t_7)) __PYX_ERR(19, 63, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_2 = PyNumber_Add(__pyx_v_w0, __pyx_v_b); if (unlikely(!__pyx_t_2)) __PYX_ERR(19, 63, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF_SET(__pyx_v_v1, __pyx_t_7);
    __pyx_t_7 = 0;
    __Pyx_XDECREF_SET(__pyx_v_w1, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "opengl/legacy/horosphere.pyx":64
 *             w0 = (v0 + 1) % b
 *             v1, w1 = v0 + b, w0 + b
 *             annulus += [(v0, v1, w1), (w0, v0, w1)]             # <<<<<<<<<<<<<<
 * 
 *         for s in range(0, b*(a - 2), b):
*/
    __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(19, 64, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_v0);
    __Pyx_GIVEREF(__pyx_v_v0);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_v0) != (0)) __PYX_ERR(19, 64, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_v1);
    __Pyx_GIVEREF(__pyx_v_v1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_v1) != (0)) __PYX_ERR(19, 64, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_w1);
    __Pyx_GIVEREF(__pyx_v_w1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_w1) != (0)) __PYX_ERR(19, 64, __pyx_L1_error);
    __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(19, 64, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_INCREF(__pyx_v_w0);
    __Pyx_GIVEREF(__pyx_v_w0);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_w0) != (0)) __PYX_ERR(19, 64, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_v0);
    __Pyx_GIVEREF(__pyx_v_v0);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_v0) != (0)) __PYX_ERR(19, 64, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_w1);
    __Pyx_GIVEREF(__pyx_v_w1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_v_w1) != (0)) __PYX_ERR(19, 64, __pyx_L1_error);
    __pyx_t_6 = PyList_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 64, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_2);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_2) != (0)) __PYX_ERR(19, 64, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_7);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 1, __pyx_t_7) != (0)) __PYX_ERR(19, 64, __pyx_L1_error);
    __pyx_t_2 = 0;
    __pyx_t_7 = 0;
    __pyx_t_7 = PyNumber_InPlaceAdd(__pyx_v_annulus, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(19, 64, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF_SET(__pyx_v_annulus, ((PyObject*)__pyx_t_7));
    __pyx_t_7 = 0;

    /* "opengl/legacy/horosphere.pyx":61
 *         # Now build the rest with annular bands
 *         annulus = []
 *         for v0 in range(0, b):             # <<<<<<<<<<<<<<
 *             w0 = (v0 + 1) % b
 *             v1, w1 = v0 + b, w0 + b
*/
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "opengl/legacy/horosphere.pyx":66
 *             annulus += [(v0, v1, w1), (w0, v0, w1)]
 * 
 *         for s in range(0, b*(a - 2), b):             # <<<<<<<<<<<<<<
 *             tri += [(u + s, v + s, w + s) for u, v, w in annulus]
*/
  __pyx_t_7 = NULL;
  __pyx_t_6 = __Pyx_PyLong_SubtractObjC(__pyx_v_a, __pyx_mstate_global->__pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 66, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = PyNumber_Multiply(__pyx_v_b, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(19, 66, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_7, __pyx_mstate_global->__pyx_int_0, __pyx_t_2, __pyx_v_b};
    __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(&PyRange_Type), __pyx_callargs+__pyx_t_4, (4-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 66, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(19, 66, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(19, 66, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  for (;;) {
    {
      __pyx_t_3 = __pyx_t_5(__pyx_t_2);
      if (unlikely(!__pyx_t_3)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(19, 66, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "opengl/legacy/horosphere.pyx":67
 * 
 *         for s in range(0, b*(a - 2), b):
 *             tri += [(u + s, v + s, w + s) for u, v, w in annulus]             # <<<<<<<<<<<<<<
*/
    { /* enter inner scope */
      __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 67, __pyx_L24_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_7 = __pyx_v_annulus; __Pyx_INCREF(__pyx_t_7);
      __pyx_t_8 = 0;
      for (;;) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_7);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(19, 67, __pyx_L24_error)
          #endif
          if (__pyx_t_8 >= __pyx_temp) break;
        }
        __pyx_t_6 = __Pyx_PyList_GetItemRefFast(__pyx_t_7, __pyx_t_8, __Pyx_ReferenceSharing_OwnStrongReference);
        ++__pyx_t_8;
        if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 67, __pyx_L24_error)
        __Pyx_GOTREF(__pyx_t_6);
        if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) {
          PyObject* sequence = __pyx_t_6;
          Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
          if (unlikely(size != 3)) {
            if (size > 3) __Pyx_RaiseTooManyValuesError(3);
            else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
            __PYX_ERR(19, 67, __pyx_L24_error)
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          if (likely(PyTuple_CheckExact(sequence))) {
            __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
            __Pyx_INCREF(__pyx_t_1);
            __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1);
            __Pyx_INCREF(__pyx_t_9);
            __pyx_t_10 = PyTuple_GET_ITEM(sequence, 2);
            __Pyx_INCREF(__pyx_t_10);
          } else {
            __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
            if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 67, __pyx_L24_error)
            __Pyx_XGOTREF(__pyx_t_1);
            __pyx_t_9 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
            if (unlikely(!__pyx_t_9)) __PYX_ERR(19, 67, __pyx_L24_error)
            __Pyx_XGOTREF(__pyx_t_9);
            __pyx_t_10 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
            if (unlikely(!__pyx_t_10)) __PYX_ERR(19, 67, __pyx_L24_error)
            __Pyx_XGOTREF(__pyx_t_10);
          }
          #else
          __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 67, __pyx_L24_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_9 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(19, 67, __pyx_L24_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_10)) __PYX_ERR(19, 67, __pyx_L24_error)
          __Pyx_GOTREF(__pyx_t_10);
          #endif
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        } else {
          Py_ssize_t index = -1;
          __pyx_t_11 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_11)) __PYX_ERR(19, 67, __pyx_L24_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_t_12 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_11);
          index = 0; __pyx_t_1 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_1)) goto __pyx_L27_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_1);
          index = 1; __pyx_t_9 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_9)) goto __pyx_L27_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_9);
          index = 2; __pyx_t_10 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_10)) goto __pyx_L27_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_10);
          if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 3) < (0)) __PYX_ERR(19, 67, __pyx_L24_error)
          __pyx_t_12 = NULL;
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          goto __pyx_L28_unpacking_done;
          __pyx_L27_unpacking_failed:;
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __pyx_t_12 = NULL;
          if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
          __PYX_ERR(19, 67, __pyx_L24_error)
          __pyx_L28_unpacking_done:;
        }
        __Pyx_XDECREF_SET(__pyx_8genexpr4__pyx_v_u, __pyx_t_1);
        __pyx_t_1 = 0;
        __Pyx_XDECREF_SET(__pyx_8genexpr4__pyx_v_v, __pyx_t_9);
        __pyx_t_9 = 0;
        __Pyx_XDECREF_SET(__pyx_8genexpr4__pyx_v_w, __pyx_t_10);
        __pyx_t_10 = 0;
        __pyx_t_6 = PyNumber_Add(__pyx_8genexpr4__pyx_v_u, __pyx_v_s); if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 67, __pyx_L24_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_10 = PyNumber_Add(__pyx_8genexpr4__pyx_v_v, __pyx_v_s); if (unlikely(!__pyx_t_10)) __PYX_ERR(19, 67, __pyx_L24_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_9 = PyNumber_Add(__pyx_8genexpr4__pyx_v_w, __pyx_v_s); if (unlikely(!__pyx_t_9)) __PYX_ERR(19, 67, __pyx_L24_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 67, __pyx_L24_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_GIVEREF(__pyx_t_6);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6) != (0)) __PYX_ERR(19, 67, __pyx_L24_error);
        __Pyx_GIVEREF(__pyx_t_10);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_10) != (0)) __PYX_ERR(19, 67, __pyx_L24_error);
        __Pyx_GIVEREF(__pyx_t_9);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_9) != (0)) __PYX_ERR(19, 67, __pyx_L24_error);
        __pyx_t_6 = 0;
        __pyx_t_10 = 0;
        __pyx_t_9 = 0;
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_1))) __PYX_ERR(19, 67, __pyx_L24_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_u); __pyx_8genexpr4__pyx_v_u = 0;
      __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_v); __pyx_8genexpr4__pyx_v_v = 0;
      __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_w); __pyx_8genexpr4__pyx_v_w = 0;
      goto __pyx_L30_exit_scope;
      __pyx_L24_error:;
      __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_u); __pyx_8genexpr4__pyx_v_u = 0;
      __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_v); __pyx_8genexpr4__pyx_v_v = 0;
      __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_w); __pyx_8genexpr4__pyx_v_w = 0;
      goto __pyx_L1_error;
      __pyx_L30_exit_scope:;
    } /* exit inner scope */
    __pyx_t_7 = PyNumber_InPlaceAdd(__pyx_v_tri, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(19, 67, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF_SET(__pyx_v_tri, ((PyObject*)__pyx_t_7));
    __pyx_t_7 = 0;

    /* "opengl/legacy/horosphere.pyx":66
 *             annulus += [(v0, v1, w1), (w0, v0, w1)]
 * 
 *         for s in range(0, b*(a - 2), b):             # <<<<<<<<<<<<<<
 *             tri += [(u + s, v + s, w + s) for u, v, w in annulus]
*/
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opengl/legacy/horosphere.pyx":48
 *             self.normals.append(N)
 * 
 *     cdef build_triangles(self):             # <<<<<<<<<<<<<<
 *         self.triangles = tri = []
 *         a, b = self.stacks, self.slices
*/

  /* 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_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("CyOpenGL.Horosphere.build_triangles", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_tri);
  __Pyx_XDECREF(__pyx_v_a);
  __Pyx_XDECREF(__pyx_v_b);
  __Pyx_XDECREF(__pyx_v_north);
  __Pyx_XDECREF(__pyx_v_south);
  __Pyx_XDECREF(__pyx_v_shift);
  __Pyx_XDECREF(__pyx_v_annulus);
  __Pyx_XDECREF(__pyx_v_v0);
  __Pyx_XDECREF(__pyx_v_w0);
  __Pyx_XDECREF(__pyx_v_v1);
  __Pyx_XDECREF(__pyx_v_w1);
  __Pyx_XDECREF(__pyx_v_s);
  __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_i);
  __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_i);
  __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_u);
  __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_v);
  __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_w);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opengl/legacy/horoball_group.pyx":15
 *     cdef original_indices
 * 
 *     def __init__(self, horoballs, indices, meridian, longitude):             # <<<<<<<<<<<<<<
 *         self.horoballs = horoballs
 *         self.meridian = complex(meridian)
*/

/* Python wrapper */
static int __pyx_pw_8CyOpenGL_13HoroballGroup_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_8CyOpenGL_13HoroballGroup_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_horoballs = 0;
  PyObject *__pyx_v_indices = 0;
  PyObject *__pyx_v_meridian = 0;
  PyObject *__pyx_v_longitude = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[4] = {0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_horoballs,&__pyx_mstate_global->__pyx_n_u_indices,&__pyx_mstate_global->__pyx_n_u_meridian,&__pyx_mstate_global->__pyx_n_u_longitude,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(4, 15, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_VARARGS(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(4, 15, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(4, 15, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(4, 15, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 15, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(4, 15, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 4; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, i); __PYX_ERR(4, 15, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 4)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 15, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(4, 15, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(4, 15, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_VARARGS(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(4, 15, __pyx_L3_error)
    }
    __pyx_v_horoballs = values[0];
    __pyx_v_indices = values[1];
    __pyx_v_meridian = values[2];
    __pyx_v_longitude = values[3];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, __pyx_nargs); __PYX_ERR(4, 15, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("CyOpenGL.HoroballGroup.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_13HoroballGroup___init__(((struct __pyx_obj_8CyOpenGL_HoroballGroup *)__pyx_v_self), __pyx_v_horoballs, __pyx_v_indices, __pyx_v_meridian, __pyx_v_longitude);

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

static int __pyx_pf_8CyOpenGL_13HoroballGroup___init__(struct __pyx_obj_8CyOpenGL_HoroballGroup *__pyx_v_self, PyObject *__pyx_v_horoballs, PyObject *__pyx_v_indices, PyObject *__pyx_v_meridian, PyObject *__pyx_v_longitude) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "opengl/legacy/horoball_group.pyx":16
 * 
 *     def __init__(self, horoballs, indices, meridian, longitude):
 *         self.horoballs = horoballs             # <<<<<<<<<<<<<<
 *         self.meridian = complex(meridian)
 *         self.longitude = complex(longitude)
*/
  __Pyx_INCREF(__pyx_v_horoballs);
  __Pyx_GIVEREF(__pyx_v_horoballs);
  __Pyx_GOTREF(__pyx_v_self->horoballs);
  __Pyx_DECREF(__pyx_v_self->horoballs);
  __pyx_v_self->horoballs = __pyx_v_horoballs;

  /* "opengl/legacy/horoball_group.pyx":17
 *     def __init__(self, horoballs, indices, meridian, longitude):
 *         self.horoballs = horoballs
 *         self.meridian = complex(meridian)             # <<<<<<<<<<<<<<
 *         self.longitude = complex(longitude)
 *         self.original_indices = indices
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_meridian};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(&PyComplex_Type), __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 17, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->meridian);
  __Pyx_DECREF(__pyx_v_self->meridian);
  __pyx_v_self->meridian = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "opengl/legacy/horoball_group.pyx":18
 *         self.horoballs = horoballs
 *         self.meridian = complex(meridian)
 *         self.longitude = complex(longitude)             # <<<<<<<<<<<<<<
 *         self.original_indices = indices
 *         self.build_spheres()
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_longitude};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(&PyComplex_Type), __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 18, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->longitude);
  __Pyx_DECREF(__pyx_v_self->longitude);
  __pyx_v_self->longitude = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "opengl/legacy/horoball_group.pyx":19
 *         self.meridian = complex(meridian)
 *         self.longitude = complex(longitude)
 *         self.original_indices = indices             # <<<<<<<<<<<<<<
 *         self.build_spheres()
 * 
*/
  __Pyx_INCREF(__pyx_v_indices);
  __Pyx_GIVEREF(__pyx_v_indices);
  __Pyx_GOTREF(__pyx_v_self->original_indices);
  __Pyx_DECREF(__pyx_v_self->original_indices);
  __pyx_v_self->original_indices = __pyx_v_indices;

  /* "opengl/legacy/horoball_group.pyx":20
 *         self.longitude = complex(longitude)
 *         self.original_indices = indices
 *         self.build_spheres()             # <<<<<<<<<<<<<<
 * 
 *     cdef build_spheres(self):
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_8CyOpenGL_HoroballGroup *)__pyx_v_self->__pyx_base.__pyx_vtab)->build_spheres(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/legacy/horoball_group.pyx":15
 *     cdef original_indices
 * 
 *     def __init__(self, horoballs, indices, meridian, longitude):             # <<<<<<<<<<<<<<
 *         self.horoballs = horoballs
 *         self.meridian = complex(meridian)
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("CyOpenGL.HoroballGroup.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opengl/legacy/horoball_group.pyx":22
 *         self.build_spheres()
 * 
 *     cdef build_spheres(self):             # <<<<<<<<<<<<<<
 *         cdef GLfloat color[4]
 *         self.keys = keys = []
*/

static PyObject *__pyx_f_8CyOpenGL_13HoroballGroup_build_spheres(struct __pyx_obj_8CyOpenGL_HoroballGroup *__pyx_v_self) {
  GLfloat __pyx_v_color[4];
  PyObject *__pyx_v_keys = NULL;
  PyObject *__pyx_v_spheres = NULL;
  PyObject *__pyx_v_centers = NULL;
  PyObject *__pyx_v_D = NULL;
  PyObject *__pyx_v_z_center = NULL;
  PyObject *__pyx_v_radius = NULL;
  PyObject *__pyx_v_index = NULL;
  PyObject *__pyx_v_key = NULL;
  struct __pyx_obj_8CyOpenGL_vector3 *__pyx_v_center = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  GLfloat __pyx_t_10[4];
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("build_spheres", 0);

  /* "opengl/legacy/horoball_group.pyx":24
 *     cdef build_spheres(self):
 *         cdef GLfloat color[4]
 *         self.keys = keys = []             # <<<<<<<<<<<<<<
 *         self.spheres = spheres = {}
 *         self.centers = centers = {}
*/
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->keys);
  __Pyx_DECREF(__pyx_v_self->keys);
  __pyx_v_self->keys = __pyx_t_1;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_keys = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/legacy/horoball_group.pyx":25
 *         cdef GLfloat color[4]
 *         self.keys = keys = []
 *         self.spheres = spheres = {}             # <<<<<<<<<<<<<<
 *         self.centers = centers = {}
 *         for D in self.horoballs:
*/
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->spheres);
  __Pyx_DECREF(__pyx_v_self->spheres);
  __pyx_v_self->spheres = __pyx_t_1;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_spheres = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/legacy/horoball_group.pyx":26
 *         self.keys = keys = []
 *         self.spheres = spheres = {}
 *         self.centers = centers = {}             # <<<<<<<<<<<<<<
 *         for D in self.horoballs:
 *             z_center = D['center']
*/
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->centers);
  __Pyx_DECREF(__pyx_v_self->centers);
  __pyx_v_self->centers = __pyx_t_1;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_centers = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/legacy/horoball_group.pyx":27
 *         self.spheres = spheres = {}
 *         self.centers = centers = {}
 *         for D in self.horoballs:             # <<<<<<<<<<<<<<
 *             z_center = D['center']
 *             radius = round(D['radius'], 10)
*/
  if (likely(PyList_CheckExact(__pyx_v_self->horoballs)) || PyTuple_CheckExact(__pyx_v_self->horoballs)) {
    __pyx_t_1 = __pyx_v_self->horoballs; __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->horoballs); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 27, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 27, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 27, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference);
        ++__pyx_t_2;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 27, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2));
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2);
        #endif
        ++__pyx_t_2;
      }
      if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 27, __pyx_L1_error)
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(4, 27, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_XDECREF_SET(__pyx_v_D, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "opengl/legacy/horoball_group.pyx":28
 *         self.centers = centers = {}
 *         for D in self.horoballs:
 *             z_center = D['center']             # <<<<<<<<<<<<<<
 *             radius = round(D['radius'], 10)
 *             index = D['index']
*/
    __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_D, __pyx_mstate_global->__pyx_n_u_center); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 28, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_XDECREF_SET(__pyx_v_z_center, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "opengl/legacy/horoball_group.pyx":29
 *         for D in self.horoballs:
 *             z_center = D['center']
 *             radius = round(D['radius'], 10)             # <<<<<<<<<<<<<<
 *             index = D['index']
 *             key = (radius, index)
*/
    __pyx_t_5 = NULL;
    __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_D, __pyx_mstate_global->__pyx_n_u_radius); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 29, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = 1;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_t_6, __pyx_mstate_global->__pyx_int_10};
      __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_round, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 29, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_radius, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "opengl/legacy/horoball_group.pyx":30
 *             z_center = D['center']
 *             radius = round(D['radius'], 10)
 *             index = D['index']             # <<<<<<<<<<<<<<
 *             key = (radius, index)
 *             center = vector3((z_center.real, z_center.imag, radius))
*/
    __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_D, __pyx_mstate_global->__pyx_n_u_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 30, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "opengl/legacy/horoball_group.pyx":31
 *             radius = round(D['radius'], 10)
 *             index = D['index']
 *             key = (radius, index)             # <<<<<<<<<<<<<<
 *             center = vector3((z_center.real, z_center.imag, radius))
 *             color = GetColor(self.original_indices[index])
*/
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 31, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_radius);
    __Pyx_GIVEREF(__pyx_v_radius);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_radius) != (0)) __PYX_ERR(4, 31, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_index);
    __Pyx_GIVEREF(__pyx_v_index);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_index) != (0)) __PYX_ERR(4, 31, __pyx_L1_error);
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "opengl/legacy/horoball_group.pyx":32
 *             index = D['index']
 *             key = (radius, index)
 *             center = vector3((z_center.real, z_center.imag, radius))             # <<<<<<<<<<<<<<
 *             color = GetColor(self.original_indices[index])
 *             try:
*/
    __pyx_t_6 = NULL;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_z_center, __pyx_mstate_global->__pyx_n_u_real); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 32, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_z_center, __pyx_mstate_global->__pyx_n_u_imag); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 32, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 32, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_GIVEREF(__pyx_t_5);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5) != (0)) __PYX_ERR(4, 32, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_8);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_8) != (0)) __PYX_ERR(4, 32, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_radius);
    __Pyx_GIVEREF(__pyx_v_radius);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_v_radius) != (0)) __PYX_ERR(4, 32, __pyx_L1_error);
    __pyx_t_5 = 0;
    __pyx_t_8 = 0;
    __pyx_t_7 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_9};
      __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8CyOpenGL_vector3, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 32, __pyx_L1_error)
      __Pyx_GOTREF((PyObject *)__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_center, ((struct __pyx_obj_8CyOpenGL_vector3 *)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "opengl/legacy/horoball_group.pyx":33
 *             key = (radius, index)
 *             center = vector3((z_center.real, z_center.imag, radius))
 *             color = GetColor(self.original_indices[index])             # <<<<<<<<<<<<<<
 *             try:
 *                 centers[key].append(center)
*/
    __pyx_t_9 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_GetColor); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 33, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_v_self->original_indices, __pyx_v_index); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 33, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_7 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6);
      assert(__pyx_t_9);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
      __pyx_t_7 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_8};
      __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 33, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    if (unlikely((__Pyx_carray_from_py_GLfloat(__pyx_t_4, __pyx_t_10, 4) < 0))) __PYX_ERR(4, 33, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    memcpy(&(__pyx_v_color[0]), __pyx_t_10, sizeof(__pyx_v_color[0]) * (4));

    /* "opengl/legacy/horoball_group.pyx":34
 *             center = vector3((z_center.real, z_center.imag, radius))
 *             color = GetColor(self.original_indices[index])
 *             try:             # <<<<<<<<<<<<<<
 *                 centers[key].append(center)
 *             except KeyError:
*/
    {
      __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:*/ {

        /* "opengl/legacy/horoball_group.pyx":35
 *             color = GetColor(self.original_indices[index])
 *             try:
 *                 centers[key].append(center)             # <<<<<<<<<<<<<<
 *             except KeyError:
 *                 keys.append(key)
*/
        __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_centers, __pyx_v_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 35, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_14 = __Pyx_PyObject_Append(__pyx_t_4, ((PyObject *)__pyx_v_center)); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(4, 35, __pyx_L5_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "opengl/legacy/horoball_group.pyx":34
 *             center = vector3((z_center.real, z_center.imag, radius))
 *             color = GetColor(self.original_indices[index])
 *             try:             # <<<<<<<<<<<<<<
 *                 centers[key].append(center)
 *             except KeyError:
*/
      }
      __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_L12_try_end;
      __pyx_L5_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;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

      /* "opengl/legacy/horoball_group.pyx":36
 *             try:
 *                 centers[key].append(center)
 *             except KeyError:             # <<<<<<<<<<<<<<
 *                 keys.append(key)
 *                 centers[key] = [center]
*/
      __pyx_t_15 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_KeyError))));
      if (__pyx_t_15) {
        __Pyx_AddTraceback("CyOpenGL.HoroballGroup.build_spheres", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_8) < 0) __PYX_ERR(4, 36, __pyx_L7_except_error)
        __Pyx_XGOTREF(__pyx_t_4);
        __Pyx_XGOTREF(__pyx_t_6);
        __Pyx_XGOTREF(__pyx_t_8);

        /* "opengl/legacy/horoball_group.pyx":37
 *                 centers[key].append(center)
 *             except KeyError:
 *                 keys.append(key)             # <<<<<<<<<<<<<<
 *                 centers[key] = [center]
 *                 spheres[key] = Horosphere(radius=radius, color=color)
*/
        __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_keys, __pyx_v_key); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(4, 37, __pyx_L7_except_error)

        /* "opengl/legacy/horoball_group.pyx":38
 *             except KeyError:
 *                 keys.append(key)
 *                 centers[key] = [center]             # <<<<<<<<<<<<<<
 *                 spheres[key] = Horosphere(radius=radius, color=color)
 *         keys.sort()
*/
        __pyx_t_9 = PyList_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 38, __pyx_L7_except_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_INCREF((PyObject *)__pyx_v_center);
        __Pyx_GIVEREF((PyObject *)__pyx_v_center);
        if (__Pyx_PyList_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_v_center)) != (0)) __PYX_ERR(4, 38, __pyx_L7_except_error);
        if (unlikely((PyDict_SetItem(__pyx_v_centers, __pyx_v_key, __pyx_t_9) < 0))) __PYX_ERR(4, 38, __pyx_L7_except_error)
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

        /* "opengl/legacy/horoball_group.pyx":39
 *                 keys.append(key)
 *                 centers[key] = [center]
 *                 spheres[key] = Horosphere(radius=radius, color=color)             # <<<<<<<<<<<<<<
 *         keys.sort()
 *         for key in keys:
*/
        __pyx_t_5 = NULL;
        __pyx_t_16 = __Pyx_carray_to_py_GLfloat(__pyx_v_color, 4); if (unlikely(!__pyx_t_16)) __PYX_ERR(4, 39, __pyx_L7_except_error)
        __Pyx_GOTREF(__pyx_t_16);
        __pyx_t_7 = 1;
        {
          PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 2 : 0)] = {__pyx_t_5, NULL};
          __pyx_t_17 = __Pyx_MakeVectorcallBuilderKwds(2); if (unlikely(!__pyx_t_17)) __PYX_ERR(4, 39, __pyx_L7_except_error)
          __Pyx_GOTREF(__pyx_t_17);
          if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_radius, __pyx_v_radius, __pyx_t_17, __pyx_callargs+1, 0) < (0)) __PYX_ERR(4, 39, __pyx_L7_except_error)
          if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_color, __pyx_t_16, __pyx_t_17, __pyx_callargs+1, 1) < (0)) __PYX_ERR(4, 39, __pyx_L7_except_error)
          __pyx_t_9 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_ptype_8CyOpenGL_Horosphere, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_17);
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
          __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
          if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 39, __pyx_L7_except_error)
          __Pyx_GOTREF((PyObject *)__pyx_t_9);
        }
        if (unlikely((PyDict_SetItem(__pyx_v_spheres, __pyx_v_key, ((PyObject *)__pyx_t_9)) < 0))) __PYX_ERR(4, 39, __pyx_L7_except_error)
        __Pyx_DECREF((PyObject *)__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        goto __pyx_L6_exception_handled;
      }
      goto __pyx_L7_except_error;

      /* "opengl/legacy/horoball_group.pyx":34
 *             center = vector3((z_center.real, z_center.imag, radius))
 *             color = GetColor(self.original_indices[index])
 *             try:             # <<<<<<<<<<<<<<
 *                 centers[key].append(center)
 *             except KeyError:
*/
      __pyx_L7_except_error:;
      __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_L6_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);
      __pyx_L12_try_end:;
    }

    /* "opengl/legacy/horoball_group.pyx":27
 *         self.spheres = spheres = {}
 *         self.centers = centers = {}
 *         for D in self.horoballs:             # <<<<<<<<<<<<<<
 *             z_center = D['center']
 *             radius = round(D['radius'], 10)
*/
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/legacy/horoball_group.pyx":40
 *                 centers[key] = [center]
 *                 spheres[key] = Horosphere(radius=radius, color=color)
 *         keys.sort()             # <<<<<<<<<<<<<<
 *         for key in keys:
 *             spheres[key].build_display_list()
*/
  __pyx_t_14 = PyList_Sort(__pyx_v_keys); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(4, 40, __pyx_L1_error)

  /* "opengl/legacy/horoball_group.pyx":41
 *                 spheres[key] = Horosphere(radius=radius, color=color)
 *         keys.sort()
 *         for key in keys:             # <<<<<<<<<<<<<<
 *             spheres[key].build_display_list()
 * 
*/
  __pyx_t_1 = __pyx_v_keys; __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = 0;
  for (;;) {
    {
      Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
      #if !CYTHON_ASSUME_SAFE_SIZE
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 41, __pyx_L1_error)
      #endif
      if (__pyx_t_2 >= __pyx_temp) break;
    }
    __pyx_t_8 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference);
    ++__pyx_t_2;
    if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 41, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_8);
    __pyx_t_8 = 0;

    /* "opengl/legacy/horoball_group.pyx":42
 *         keys.sort()
 *         for key in keys:
 *             spheres[key].build_display_list()             # <<<<<<<<<<<<<<
 * 
 *     def draw(self, R, T):
*/
    __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_spheres, __pyx_v_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 42, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __pyx_t_4;
    __Pyx_INCREF(__pyx_t_6);
    __pyx_t_7 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
      __pyx_t_8 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_build_display_list, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 42, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
    }
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "opengl/legacy/horoball_group.pyx":41
 *                 spheres[key] = Horosphere(radius=radius, color=color)
 *         keys.sort()
 *         for key in keys:             # <<<<<<<<<<<<<<
 *             spheres[key].build_display_list()
 * 
*/
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/legacy/horoball_group.pyx":22
 *         self.build_spheres()
 * 
 *     cdef build_spheres(self):             # <<<<<<<<<<<<<<
 *         cdef GLfloat color[4]
 *         self.keys = keys = []
*/

  /* 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_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_AddTraceback("CyOpenGL.HoroballGroup.build_spheres", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_keys);
  __Pyx_XDECREF(__pyx_v_spheres);
  __Pyx_XDECREF(__pyx_v_centers);
  __Pyx_XDECREF(__pyx_v_D);
  __Pyx_XDECREF(__pyx_v_z_center);
  __Pyx_XDECREF(__pyx_v_radius);
  __Pyx_XDECREF(__pyx_v_index);
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF((PyObject *)__pyx_v_center);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opengl/legacy/horoball_group.pyx":44
 *             spheres[key].build_display_list()
 * 
 *     def draw(self, R, T):             # <<<<<<<<<<<<<<
 *         vx, vy = self.meridian.real, self.meridian.imag
 *         ux = self.longitude.real
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_13HoroballGroup_3draw(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_13HoroballGroup_2draw, "HoroballGroup.draw(self, R, T)");
static PyMethodDef __pyx_mdef_8CyOpenGL_13HoroballGroup_3draw = {"draw", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_13HoroballGroup_3draw, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_13HoroballGroup_2draw};
static PyObject *__pyx_pw_8CyOpenGL_13HoroballGroup_3draw(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_R = 0;
  PyObject *__pyx_v_T = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("draw (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_R,&__pyx_mstate_global->__pyx_n_u_T,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(4, 44, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(4, 44, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 44, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "draw", 0) < (0)) __PYX_ERR(4, 44, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("draw", 1, 2, 2, i); __PYX_ERR(4, 44, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 44, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(4, 44, __pyx_L3_error)
    }
    __pyx_v_R = values[0];
    __pyx_v_T = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("draw", 1, 2, 2, __pyx_nargs); __PYX_ERR(4, 44, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("CyOpenGL.HoroballGroup.draw", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_13HoroballGroup_2draw(((struct __pyx_obj_8CyOpenGL_HoroballGroup *)__pyx_v_self), __pyx_v_R, __pyx_v_T);

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

static PyObject *__pyx_pf_8CyOpenGL_13HoroballGroup_2draw(struct __pyx_obj_8CyOpenGL_HoroballGroup *__pyx_v_self, PyObject *__pyx_v_R, PyObject *__pyx_v_T) {
  PyObject *__pyx_v_vx = NULL;
  PyObject *__pyx_v_vy = NULL;
  PyObject *__pyx_v_ux = NULL;
  PyObject *__pyx_v_key = NULL;
  PyObject *__pyx_v_sphere = NULL;
  PyObject *__pyx_v_center = NULL;
  PyObject *__pyx_v_x = NULL;
  PyObject *__pyx_v_y = NULL;
  PyObject *__pyx_v_N_min = NULL;
  PyObject *__pyx_v_N_max = NULL;
  PyObject *__pyx_v_n = NULL;
  PyObject *__pyx_v_xn = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_yn = NULL;
  PyObject *__pyx_v_M_min = NULL;
  PyObject *__pyx_v_M_max = NULL;
  PyObject *__pyx_v_m = NULL;
  PyObject *__pyx_v_disp = 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;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  GLfloat __pyx_t_9;
  GLfloat __pyx_t_10;
  GLfloat __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  size_t __pyx_t_15;
  long __pyx_t_16;
  long __pyx_t_17;
  long __pyx_t_18;
  long __pyx_t_19;
  long __pyx_t_20;
  long __pyx_t_21;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("draw", 0);

  /* "opengl/legacy/horoball_group.pyx":45
 * 
 *     def draw(self, R, T):
 *         vx, vy = self.meridian.real, self.meridian.imag             # <<<<<<<<<<<<<<
 *         ux = self.longitude.real
 *         for key in self.keys:
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->meridian, __pyx_mstate_global->__pyx_n_u_real); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 45, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->meridian, __pyx_mstate_global->__pyx_n_u_imag); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 45, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_vx = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v_vy = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "opengl/legacy/horoball_group.pyx":46
 *     def draw(self, R, T):
 *         vx, vy = self.meridian.real, self.meridian.imag
 *         ux = self.longitude.real             # <<<<<<<<<<<<<<
 *         for key in self.keys:
 *             sphere = self.spheres[key]
*/
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->longitude, __pyx_mstate_global->__pyx_n_u_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 46, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_ux = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "opengl/legacy/horoball_group.pyx":47
 *         vx, vy = self.meridian.real, self.meridian.imag
 *         ux = self.longitude.real
 *         for key in self.keys:             # <<<<<<<<<<<<<<
 *             sphere = self.spheres[key]
 *             for center in self.centers[key]:
*/
  if (likely(PyList_CheckExact(__pyx_v_self->keys)) || PyTuple_CheckExact(__pyx_v_self->keys)) {
    __pyx_t_2 = __pyx_v_self->keys; __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->keys); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 47, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 47, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 47, __pyx_L1_error)
          #endif
          if (__pyx_t_3 >= __pyx_temp) break;
        }
        __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_2, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference);
        ++__pyx_t_3;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 47, __pyx_L1_error)
          #endif
          if (__pyx_t_3 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3));
        #else
        __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3);
        #endif
        ++__pyx_t_3;
      }
      if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 47, __pyx_L1_error)
    } else {
      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(4, 47, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "opengl/legacy/horoball_group.pyx":48
 *         ux = self.longitude.real
 *         for key in self.keys:
 *             sphere = self.spheres[key]             # <<<<<<<<<<<<<<
 *             for center in self.centers[key]:
 *                 x, y = center.x, center.y
*/
    __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_self->spheres, __pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 48, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_sphere, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "opengl/legacy/horoball_group.pyx":49
 *         for key in self.keys:
 *             sphere = self.spheres[key]
 *             for center in self.centers[key]:             # <<<<<<<<<<<<<<
 *                 x, y = center.x, center.y
 *                 glPushMatrix()
*/
    __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_self->centers, __pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 49, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
      __pyx_t_5 = __pyx_t_1; __Pyx_INCREF(__pyx_t_5);
      __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 49, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 49, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    for (;;) {
      if (likely(!__pyx_t_7)) {
        if (likely(PyList_CheckExact(__pyx_t_5))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_5);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 49, __pyx_L1_error)
            #endif
            if (__pyx_t_6 >= __pyx_temp) break;
          }
          __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_5, __pyx_t_6, __Pyx_ReferenceSharing_OwnStrongReference);
          ++__pyx_t_6;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_5);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 49, __pyx_L1_error)
            #endif
            if (__pyx_t_6 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6));
          #else
          __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_6);
          #endif
          ++__pyx_t_6;
        }
        if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 49, __pyx_L1_error)
      } else {
        __pyx_t_1 = __pyx_t_7(__pyx_t_5);
        if (unlikely(!__pyx_t_1)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(4, 49, __pyx_L1_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_XDECREF_SET(__pyx_v_center, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "opengl/legacy/horoball_group.pyx":50
 *             sphere = self.spheres[key]
 *             for center in self.centers[key]:
 *                 x, y = center.x, center.y             # <<<<<<<<<<<<<<
 *                 glPushMatrix()
 *                 glTranslatef(x, y, center.z)
*/
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_center, __pyx_mstate_global->__pyx_n_u_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 50, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_center, __pyx_mstate_global->__pyx_n_u_y); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 50, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_1);
      __pyx_t_1 = 0;
      __Pyx_XDECREF_SET(__pyx_v_y, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "opengl/legacy/horoball_group.pyx":51
 *             for center in self.centers[key]:
 *                 x, y = center.x, center.y
 *                 glPushMatrix()             # <<<<<<<<<<<<<<
 *                 glTranslatef(x, y, center.z)
 *                 N_min = -ceil( (T + y)/vy )
*/
      glPushMatrix();

      /* "opengl/legacy/horoball_group.pyx":52
 *                 x, y = center.x, center.y
 *                 glPushMatrix()
 *                 glTranslatef(x, y, center.z)             # <<<<<<<<<<<<<<
 *                 N_min = -ceil( (T + y)/vy )
 *                 N_max = ceil( (T - y)/vy )
*/
      __pyx_t_9 = __Pyx_PyFloat_AsFloat(__pyx_v_x); if (unlikely((__pyx_t_9 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(4, 52, __pyx_L1_error)
      __pyx_t_10 = __Pyx_PyFloat_AsFloat(__pyx_v_y); if (unlikely((__pyx_t_10 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(4, 52, __pyx_L1_error)
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_center, __pyx_mstate_global->__pyx_n_u_z); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 52, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_11 = __Pyx_PyFloat_AsFloat(__pyx_t_8); if (unlikely((__pyx_t_11 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(4, 52, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      glTranslatef(__pyx_t_9, __pyx_t_10, __pyx_t_11);

      /* "opengl/legacy/horoball_group.pyx":53
 *                 glPushMatrix()
 *                 glTranslatef(x, y, center.z)
 *                 N_min = -ceil( (T + y)/vy )             # <<<<<<<<<<<<<<
 *                 N_max = ceil( (T - y)/vy )
 *                 for n from N_min <= n <= N_max:
*/
      __pyx_t_1 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_ceil); if (unlikely(!__pyx_t_12)) __PYX_ERR(4, 53, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_13 = PyNumber_Add(__pyx_v_T, __pyx_v_y); if (unlikely(!__pyx_t_13)) __PYX_ERR(4, 53, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_14 = __Pyx_PyNumber_Divide(__pyx_t_13, __pyx_v_vy); if (unlikely(!__pyx_t_14)) __PYX_ERR(4, 53, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __pyx_t_15 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_12))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_12);
        assert(__pyx_t_1);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_12);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_12, __pyx__function);
        __pyx_t_15 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_14};
        __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_12, __pyx_callargs+__pyx_t_15, (2-__pyx_t_15) | (__pyx_t_15*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 53, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
      }
      __pyx_t_12 = PyNumber_Negative(__pyx_t_8); if (unlikely(!__pyx_t_12)) __PYX_ERR(4, 53, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF_SET(__pyx_v_N_min, __pyx_t_12);
      __pyx_t_12 = 0;

      /* "opengl/legacy/horoball_group.pyx":54
 *                 glTranslatef(x, y, center.z)
 *                 N_min = -ceil( (T + y)/vy )
 *                 N_max = ceil( (T - y)/vy )             # <<<<<<<<<<<<<<
 *                 for n from N_min <= n <= N_max:
 *                     xn = x + n*vx
*/
      __pyx_t_8 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_ceil); if (unlikely(!__pyx_t_14)) __PYX_ERR(4, 54, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);
      __pyx_t_1 = PyNumber_Subtract(__pyx_v_T, __pyx_v_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 54, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_13 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_v_vy); if (unlikely(!__pyx_t_13)) __PYX_ERR(4, 54, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_15 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_14))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_14);
        assert(__pyx_t_8);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_14);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_14, __pyx__function);
        __pyx_t_15 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_13};
        __pyx_t_12 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_14, __pyx_callargs+__pyx_t_15, (2-__pyx_t_15) | (__pyx_t_15*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        if (unlikely(!__pyx_t_12)) __PYX_ERR(4, 54, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
      }
      __Pyx_XDECREF_SET(__pyx_v_N_max, __pyx_t_12);
      __pyx_t_12 = 0;

      /* "opengl/legacy/horoball_group.pyx":55
 *                 N_min = -ceil( (T + y)/vy )
 *                 N_max = ceil( (T - y)/vy )
 *                 for n from N_min <= n <= N_max:             # <<<<<<<<<<<<<<
 *                     xn = x + n*vx
 *                     yn = y + n*vy
*/
      __pyx_t_16 = __Pyx_PyLong_As_long(__pyx_v_N_min); if (unlikely((__pyx_t_16 == (long)-1) && PyErr_Occurred())) __PYX_ERR(4, 55, __pyx_L1_error)
      __pyx_t_17 = __Pyx_PyLong_As_long(__pyx_v_N_max); if (unlikely((__pyx_t_17 == (long)-1) && PyErr_Occurred())) __PYX_ERR(4, 55, __pyx_L1_error)
      for (__pyx_t_18 = __pyx_t_16; __pyx_t_18 <= __pyx_t_17; __pyx_t_18++) {
        __pyx_t_12 = __Pyx_PyLong_From_long(__pyx_t_18); if (unlikely(!__pyx_t_12)) __PYX_ERR(4, 55, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_12);
        __pyx_t_12 = 0;

        /* "opengl/legacy/horoball_group.pyx":56
 *                 N_max = ceil( (T - y)/vy )
 *                 for n from N_min <= n <= N_max:
 *                     xn = x + n*vx             # <<<<<<<<<<<<<<
 *                     yn = y + n*vy
 *                     M_min = -ceil( (R + xn)/ux )
*/
        __pyx_t_12 = PyNumber_Multiply(__pyx_v_n, __pyx_v_vx); if (unlikely(!__pyx_t_12)) __PYX_ERR(4, 56, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_14 = PyNumber_Add(__pyx_v_x, __pyx_t_12); if (unlikely(!__pyx_t_14)) __PYX_ERR(4, 56, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_XDECREF_SET(__pyx_v_xn, __pyx_t_14);
        __pyx_t_14 = 0;

        /* "opengl/legacy/horoball_group.pyx":57
 *                 for n from N_min <= n <= N_max:
 *                     xn = x + n*vx
 *                     yn = y + n*vy             # <<<<<<<<<<<<<<
 *                     M_min = -ceil( (R + xn)/ux )
 *                     M_max = ceil( (R - xn)/ux )
*/
        __pyx_t_14 = PyNumber_Multiply(__pyx_v_n, __pyx_v_vy); if (unlikely(!__pyx_t_14)) __PYX_ERR(4, 57, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_14);
        __pyx_t_12 = PyNumber_Add(__pyx_v_y, __pyx_t_14); if (unlikely(!__pyx_t_12)) __PYX_ERR(4, 57, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __Pyx_XDECREF_SET(__pyx_v_yn, __pyx_t_12);
        __pyx_t_12 = 0;

        /* "opengl/legacy/horoball_group.pyx":58
 *                     xn = x + n*vx
 *                     yn = y + n*vy
 *                     M_min = -ceil( (R + xn)/ux )             # <<<<<<<<<<<<<<
 *                     M_max = ceil( (R - xn)/ux )
 *                     for m from M_min <= m <= M_max:
*/
        __pyx_t_14 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_ceil); if (unlikely(!__pyx_t_13)) __PYX_ERR(4, 58, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_8 = PyNumber_Add(__pyx_v_R, __pyx_v_xn); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 58, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_8, __pyx_v_ux); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 58, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_15 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_13))) {
          __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13);
          assert(__pyx_t_14);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_13);
          __Pyx_INCREF(__pyx_t_14);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_13, __pyx__function);
          __pyx_t_15 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_14, __pyx_t_1};
          __pyx_t_12 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_13, __pyx_callargs+__pyx_t_15, (2-__pyx_t_15) | (__pyx_t_15*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          if (unlikely(!__pyx_t_12)) __PYX_ERR(4, 58, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_12);
        }
        __pyx_t_13 = PyNumber_Negative(__pyx_t_12); if (unlikely(!__pyx_t_13)) __PYX_ERR(4, 58, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_XDECREF_SET(__pyx_v_M_min, __pyx_t_13);
        __pyx_t_13 = 0;

        /* "opengl/legacy/horoball_group.pyx":59
 *                     yn = y + n*vy
 *                     M_min = -ceil( (R + xn)/ux )
 *                     M_max = ceil( (R - xn)/ux )             # <<<<<<<<<<<<<<
 *                     for m from M_min <= m <= M_max:
 *                         disp = n*self.meridian + m*self.longitude
*/
        __pyx_t_12 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_ceil); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 59, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_14 = PyNumber_Subtract(__pyx_v_R, __pyx_v_xn); if (unlikely(!__pyx_t_14)) __PYX_ERR(4, 59, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_14);
        __pyx_t_8 = __Pyx_PyNumber_Divide(__pyx_t_14, __pyx_v_ux); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 59, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __pyx_t_15 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_1))) {
          __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_1);
          assert(__pyx_t_12);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_12);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_1, __pyx__function);
          __pyx_t_15 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_8};
          __pyx_t_13 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_1, __pyx_callargs+__pyx_t_15, (2-__pyx_t_15) | (__pyx_t_15*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          if (unlikely(!__pyx_t_13)) __PYX_ERR(4, 59, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_13);
        }
        __Pyx_XDECREF_SET(__pyx_v_M_max, __pyx_t_13);
        __pyx_t_13 = 0;

        /* "opengl/legacy/horoball_group.pyx":60
 *                     M_min = -ceil( (R + xn)/ux )
 *                     M_max = ceil( (R - xn)/ux )
 *                     for m from M_min <= m <= M_max:             # <<<<<<<<<<<<<<
 *                         disp = n*self.meridian + m*self.longitude
 *                         glPushMatrix()
*/
        __pyx_t_19 = __Pyx_PyLong_As_long(__pyx_v_M_min); if (unlikely((__pyx_t_19 == (long)-1) && PyErr_Occurred())) __PYX_ERR(4, 60, __pyx_L1_error)
        __pyx_t_20 = __Pyx_PyLong_As_long(__pyx_v_M_max); if (unlikely((__pyx_t_20 == (long)-1) && PyErr_Occurred())) __PYX_ERR(4, 60, __pyx_L1_error)
        for (__pyx_t_21 = __pyx_t_19; __pyx_t_21 <= __pyx_t_20; __pyx_t_21++) {
          __pyx_t_13 = __Pyx_PyLong_From_long(__pyx_t_21); if (unlikely(!__pyx_t_13)) __PYX_ERR(4, 60, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_XDECREF_SET(__pyx_v_m, __pyx_t_13);
          __pyx_t_13 = 0;

          /* "opengl/legacy/horoball_group.pyx":61
 *                     M_max = ceil( (R - xn)/ux )
 *                     for m from M_min <= m <= M_max:
 *                         disp = n*self.meridian + m*self.longitude             # <<<<<<<<<<<<<<
 *                         glPushMatrix()
 *                         glTranslatef(disp.real, disp.imag, 0.0)
*/
          __pyx_t_13 = PyNumber_Multiply(__pyx_v_n, __pyx_v_self->meridian); if (unlikely(!__pyx_t_13)) __PYX_ERR(4, 61, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_13);
          __pyx_t_1 = PyNumber_Multiply(__pyx_v_m, __pyx_v_self->longitude); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 61, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_8 = PyNumber_Add(__pyx_t_13, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 61, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_XDECREF_SET(__pyx_v_disp, __pyx_t_8);
          __pyx_t_8 = 0;

          /* "opengl/legacy/horoball_group.pyx":62
 *                     for m from M_min <= m <= M_max:
 *                         disp = n*self.meridian + m*self.longitude
 *                         glPushMatrix()             # <<<<<<<<<<<<<<
 *                         glTranslatef(disp.real, disp.imag, 0.0)
 *                         sphere.display()
*/
          glPushMatrix();

          /* "opengl/legacy/horoball_group.pyx":63
 *                         disp = n*self.meridian + m*self.longitude
 *                         glPushMatrix()
 *                         glTranslatef(disp.real, disp.imag, 0.0)             # <<<<<<<<<<<<<<
 *                         sphere.display()
 *                         glPopMatrix()
*/
          __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_disp, __pyx_mstate_global->__pyx_n_u_real); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 63, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_11 = __Pyx_PyFloat_AsFloat(__pyx_t_8); if (unlikely((__pyx_t_11 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(4, 63, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_disp, __pyx_mstate_global->__pyx_n_u_imag); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 63, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_10 = __Pyx_PyFloat_AsFloat(__pyx_t_8); if (unlikely((__pyx_t_10 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(4, 63, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          glTranslatef(__pyx_t_11, __pyx_t_10, 0.0);

          /* "opengl/legacy/horoball_group.pyx":64
 *                         glPushMatrix()
 *                         glTranslatef(disp.real, disp.imag, 0.0)
 *                         sphere.display()             # <<<<<<<<<<<<<<
 *                         glPopMatrix()
 *                 glPopMatrix()
*/
          __pyx_t_1 = __pyx_v_sphere;
          __Pyx_INCREF(__pyx_t_1);
          __pyx_t_15 = 0;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
            __pyx_t_8 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_display, __pyx_callargs+__pyx_t_15, (1-__pyx_t_15) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
            if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 64, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_8);
          }
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

          /* "opengl/legacy/horoball_group.pyx":65
 *                         glTranslatef(disp.real, disp.imag, 0.0)
 *                         sphere.display()
 *                         glPopMatrix()             # <<<<<<<<<<<<<<
 *                 glPopMatrix()
 * 
*/
          glPopMatrix();
          __pyx_t_21 = __Pyx_PyLong_As_long(__pyx_v_m); if (unlikely((__pyx_t_21 == (long)-1) && PyErr_Occurred())) __PYX_ERR(4, 60, __pyx_L1_error)
        }

        /* "opengl/legacy/horoball_group.pyx":60
 *                     M_min = -ceil( (R + xn)/ux )
 *                     M_max = ceil( (R - xn)/ux )
 *                     for m from M_min <= m <= M_max:             # <<<<<<<<<<<<<<
 *                         disp = n*self.meridian + m*self.longitude
 *                         glPushMatrix()
*/
        __pyx_t_8 = __Pyx_PyLong_From_long(__pyx_t_21); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 60, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_XDECREF_SET(__pyx_v_m, __pyx_t_8);
        __pyx_t_8 = 0;
        __pyx_t_18 = __Pyx_PyLong_As_long(__pyx_v_n); if (unlikely((__pyx_t_18 == (long)-1) && PyErr_Occurred())) __PYX_ERR(4, 55, __pyx_L1_error)
      }

      /* "opengl/legacy/horoball_group.pyx":55
 *                 N_min = -ceil( (T + y)/vy )
 *                 N_max = ceil( (T - y)/vy )
 *                 for n from N_min <= n <= N_max:             # <<<<<<<<<<<<<<
 *                     xn = x + n*vx
 *                     yn = y + n*vy
*/
      __pyx_t_8 = __Pyx_PyLong_From_long(__pyx_t_18); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 55, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "opengl/legacy/horoball_group.pyx":66
 *                         sphere.display()
 *                         glPopMatrix()
 *                 glPopMatrix()             # <<<<<<<<<<<<<<
 * 
*/
      glPopMatrix();

      /* "opengl/legacy/horoball_group.pyx":49
 *         for key in self.keys:
 *             sphere = self.spheres[key]
 *             for center in self.centers[key]:             # <<<<<<<<<<<<<<
 *                 x, y = center.x, center.y
 *                 glPushMatrix()
*/
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "opengl/legacy/horoball_group.pyx":47
 *         vx, vy = self.meridian.real, self.meridian.imag
 *         ux = self.longitude.real
 *         for key in self.keys:             # <<<<<<<<<<<<<<
 *             sphere = self.spheres[key]
 *             for center in self.centers[key]:
*/
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opengl/legacy/horoball_group.pyx":44
 *             spheres[key].build_display_list()
 * 
 *     def draw(self, R, T):             # <<<<<<<<<<<<<<
 *         vx, vy = self.meridian.real, self.meridian.imag
 *         ux = self.longitude.real
*/

  /* 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_8);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_AddTraceback("CyOpenGL.HoroballGroup.draw", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_vx);
  __Pyx_XDECREF(__pyx_v_vy);
  __Pyx_XDECREF(__pyx_v_ux);
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF(__pyx_v_sphere);
  __Pyx_XDECREF(__pyx_v_center);
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XDECREF(__pyx_v_y);
  __Pyx_XDECREF(__pyx_v_N_min);
  __Pyx_XDECREF(__pyx_v_N_max);
  __Pyx_XDECREF(__pyx_v_n);
  __Pyx_XDECREF(__pyx_v_xn);
  __Pyx_XDECREF(__pyx_v_yn);
  __Pyx_XDECREF(__pyx_v_M_min);
  __Pyx_XDECREF(__pyx_v_M_max);
  __Pyx_XDECREF(__pyx_v_m);
  __Pyx_XDECREF(__pyx_v_disp);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opengl/legacy/parallelogram.pyx":7
 *     """
 * 
 *     def draw(self, s1, s2):             # <<<<<<<<<<<<<<
 *         glDisable(GL_LIGHTING)
 *         glLineWidth(2.0)
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_13Parallelogram_1draw(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_13Parallelogram_draw, "Parallelogram.draw(self, s1, s2)");
static PyMethodDef __pyx_mdef_8CyOpenGL_13Parallelogram_1draw = {"draw", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_13Parallelogram_1draw, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_13Parallelogram_draw};
static PyObject *__pyx_pw_8CyOpenGL_13Parallelogram_1draw(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_s1 = 0;
  PyObject *__pyx_v_s2 = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("draw (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_s1,&__pyx_mstate_global->__pyx_n_u_s2,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(20, 7, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(20, 7, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(20, 7, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "draw", 0) < (0)) __PYX_ERR(20, 7, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("draw", 1, 2, 2, i); __PYX_ERR(20, 7, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(20, 7, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(20, 7, __pyx_L3_error)
    }
    __pyx_v_s1 = values[0];
    __pyx_v_s2 = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("draw", 1, 2, 2, __pyx_nargs); __PYX_ERR(20, 7, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("CyOpenGL.Parallelogram.draw", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_13Parallelogram_draw(((struct __pyx_obj_8CyOpenGL_Parallelogram *)__pyx_v_self), __pyx_v_s1, __pyx_v_s2);

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

static PyObject *__pyx_pf_8CyOpenGL_13Parallelogram_draw(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_Parallelogram *__pyx_v_self, PyObject *__pyx_v_s1, PyObject *__pyx_v_s2) {
  PyObject *__pyx_v_p = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  GLfloat __pyx_t_3;
  GLfloat __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("draw", 0);

  /* "opengl/legacy/parallelogram.pyx":8
 * 
 *     def draw(self, s1, s2):
 *         glDisable(GL_LIGHTING)             # <<<<<<<<<<<<<<
 *         glLineWidth(2.0)
 *         glColor4f(1.0, 0.0, 1.0, 1.0)
*/
  glDisable(GL_LIGHTING);

  /* "opengl/legacy/parallelogram.pyx":9
 *     def draw(self, s1, s2):
 *         glDisable(GL_LIGHTING)
 *         glLineWidth(2.0)             # <<<<<<<<<<<<<<
 *         glColor4f(1.0, 0.0, 1.0, 1.0)
 *         glBegin(GL_LINE_LOOP)
*/
  glLineWidth(2.0);

  /* "opengl/legacy/parallelogram.pyx":10
 *         glDisable(GL_LIGHTING)
 *         glLineWidth(2.0)
 *         glColor4f(1.0, 0.0, 1.0, 1.0)             # <<<<<<<<<<<<<<
 *         glBegin(GL_LINE_LOOP)
 *         p = -(s1+s2)/2
*/
  glColor4f(1.0, 0.0, 1.0, 1.0);

  /* "opengl/legacy/parallelogram.pyx":11
 *         glLineWidth(2.0)
 *         glColor4f(1.0, 0.0, 1.0, 1.0)
 *         glBegin(GL_LINE_LOOP)             # <<<<<<<<<<<<<<
 *         p = -(s1+s2)/2
 *         glVertex3f(p.real, p.imag, 0.0)
*/
  glBegin(GL_LINE_LOOP);

  /* "opengl/legacy/parallelogram.pyx":12
 *         glColor4f(1.0, 0.0, 1.0, 1.0)
 *         glBegin(GL_LINE_LOOP)
 *         p = -(s1+s2)/2             # <<<<<<<<<<<<<<
 *         glVertex3f(p.real, p.imag, 0.0)
 *         p += s1
*/
  __pyx_t_1 = PyNumber_Add(__pyx_v_s1, __pyx_v_s2); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Negative(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(20, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyLong_TrueDivideObjC(__pyx_t_2, __pyx_mstate_global->__pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_p = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "opengl/legacy/parallelogram.pyx":13
 *         glBegin(GL_LINE_LOOP)
 *         p = -(s1+s2)/2
 *         glVertex3f(p.real, p.imag, 0.0)             # <<<<<<<<<<<<<<
 *         p += s1
 *         glVertex3f(p.real, p.imag, 0.0)
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_p, __pyx_mstate_global->__pyx_n_u_real); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 13, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_3 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(20, 13, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_p, __pyx_mstate_global->__pyx_n_u_imag); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 13, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_4 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(20, 13, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  glVertex3f(__pyx_t_3, __pyx_t_4, 0.0);

  /* "opengl/legacy/parallelogram.pyx":14
 *         p = -(s1+s2)/2
 *         glVertex3f(p.real, p.imag, 0.0)
 *         p += s1             # <<<<<<<<<<<<<<
 *         glVertex3f(p.real, p.imag, 0.0)
 *         p += s2
*/
  __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_p, __pyx_v_s1); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 14, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_p, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "opengl/legacy/parallelogram.pyx":15
 *         glVertex3f(p.real, p.imag, 0.0)
 *         p += s1
 *         glVertex3f(p.real, p.imag, 0.0)             # <<<<<<<<<<<<<<
 *         p += s2
 *         glVertex3f(p.real, p.imag, 0.0)
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_p, __pyx_mstate_global->__pyx_n_u_real); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_4 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(20, 15, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_p, __pyx_mstate_global->__pyx_n_u_imag); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_3 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(20, 15, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  glVertex3f(__pyx_t_4, __pyx_t_3, 0.0);

  /* "opengl/legacy/parallelogram.pyx":16
 *         p += s1
 *         glVertex3f(p.real, p.imag, 0.0)
 *         p += s2             # <<<<<<<<<<<<<<
 *         glVertex3f(p.real, p.imag, 0.0)
 *         p -= s1
*/
  __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_p, __pyx_v_s2); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_p, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "opengl/legacy/parallelogram.pyx":17
 *         glVertex3f(p.real, p.imag, 0.0)
 *         p += s2
 *         glVertex3f(p.real, p.imag, 0.0)             # <<<<<<<<<<<<<<
 *         p -= s1
 *         glVertex3f(p.real, p.imag, 0.0)
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_p, __pyx_mstate_global->__pyx_n_u_real); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_3 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(20, 17, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_p, __pyx_mstate_global->__pyx_n_u_imag); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_4 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(20, 17, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  glVertex3f(__pyx_t_3, __pyx_t_4, 0.0);

  /* "opengl/legacy/parallelogram.pyx":18
 *         p += s2
 *         glVertex3f(p.real, p.imag, 0.0)
 *         p -= s1             # <<<<<<<<<<<<<<
 *         glVertex3f(p.real, p.imag, 0.0)
 *         glEnd()
*/
  __pyx_t_1 = PyNumber_InPlaceSubtract(__pyx_v_p, __pyx_v_s1); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_p, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "opengl/legacy/parallelogram.pyx":19
 *         glVertex3f(p.real, p.imag, 0.0)
 *         p -= s1
 *         glVertex3f(p.real, p.imag, 0.0)             # <<<<<<<<<<<<<<
 *         glEnd()
 *         glEnable(GL_LIGHTING)
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_p, __pyx_mstate_global->__pyx_n_u_real); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_4 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(20, 19, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_p, __pyx_mstate_global->__pyx_n_u_imag); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_3 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(20, 19, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  glVertex3f(__pyx_t_4, __pyx_t_3, 0.0);

  /* "opengl/legacy/parallelogram.pyx":20
 *         p -= s1
 *         glVertex3f(p.real, p.imag, 0.0)
 *         glEnd()             # <<<<<<<<<<<<<<
 *         glEnable(GL_LIGHTING)
 * 
*/
  glEnd();

  /* "opengl/legacy/parallelogram.pyx":21
 *         glVertex3f(p.real, p.imag, 0.0)
 *         glEnd()
 *         glEnable(GL_LIGHTING)             # <<<<<<<<<<<<<<
 * 
*/
  glEnable(GL_LIGHTING);

  /* "opengl/legacy/parallelogram.pyx":7
 *     """
 * 
 *     def draw(self, s1, s2):             # <<<<<<<<<<<<<<
 *         glDisable(GL_LIGHTING)
 *         glLineWidth(2.0)
*/

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

/* "opengl/legacy/edge_set.pyx":13
 *     cdef segments, longitude, meridian, stipple
 * 
 *     def __init__(self, segments, longitude, meridian, togl_widget=None):             # <<<<<<<<<<<<<<
 *         self.segments = segments
 *         self.longitude, self.meridian = complex(longitude), complex(meridian)
*/

/* Python wrapper */
static int __pyx_pw_8CyOpenGL_7EdgeSet_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_8CyOpenGL_7EdgeSet_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_segments = 0;
  PyObject *__pyx_v_longitude = 0;
  PyObject *__pyx_v_meridian = 0;
  CYTHON_UNUSED PyObject *__pyx_v_togl_widget = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[4] = {0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_segments,&__pyx_mstate_global->__pyx_n_u_longitude,&__pyx_mstate_global->__pyx_n_u_meridian,&__pyx_mstate_global->__pyx_n_u_togl_widget,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(21, 13, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_VARARGS(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(21, 13, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(21, 13, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(21, 13, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(21, 13, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(21, 13, __pyx_L3_error)
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, i); __PYX_ERR(21, 13, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_VARARGS(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(21, 13, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(21, 13, __pyx_L3_error)
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(21, 13, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(21, 13, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_segments = values[0];
    __pyx_v_longitude = values[1];
    __pyx_v_meridian = values[2];
    __pyx_v_togl_widget = values[3];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, __pyx_nargs); __PYX_ERR(21, 13, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("CyOpenGL.EdgeSet.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_7EdgeSet___init__(((struct __pyx_obj_8CyOpenGL_EdgeSet *)__pyx_v_self), __pyx_v_segments, __pyx_v_longitude, __pyx_v_meridian, __pyx_v_togl_widget);

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

static int __pyx_pf_8CyOpenGL_7EdgeSet___init__(struct __pyx_obj_8CyOpenGL_EdgeSet *__pyx_v_self, PyObject *__pyx_v_segments, PyObject *__pyx_v_longitude, PyObject *__pyx_v_meridian, CYTHON_UNUSED PyObject *__pyx_v_togl_widget) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "opengl/legacy/edge_set.pyx":14
 * 
 *     def __init__(self, segments, longitude, meridian, togl_widget=None):
 *         self.segments = segments             # <<<<<<<<<<<<<<
 *         self.longitude, self.meridian = complex(longitude), complex(meridian)
 *         self.stipple = True
*/
  __Pyx_INCREF(__pyx_v_segments);
  __Pyx_GIVEREF(__pyx_v_segments);
  __Pyx_GOTREF(__pyx_v_self->segments);
  __Pyx_DECREF(__pyx_v_self->segments);
  __pyx_v_self->segments = __pyx_v_segments;

  /* "opengl/legacy/edge_set.pyx":15
 *     def __init__(self, segments, longitude, meridian, togl_widget=None):
 *         self.segments = segments
 *         self.longitude, self.meridian = complex(longitude), complex(meridian)             # <<<<<<<<<<<<<<
 *         self.stipple = True
 * 
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_longitude};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(&PyComplex_Type), __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_4 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_meridian};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(&PyComplex_Type), __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(21, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->longitude);
  __Pyx_DECREF(__pyx_v_self->longitude);
  __pyx_v_self->longitude = __pyx_t_1;
  __pyx_t_1 = 0;
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->meridian);
  __Pyx_DECREF(__pyx_v_self->meridian);
  __pyx_v_self->meridian = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "opengl/legacy/edge_set.pyx":16
 *         self.segments = segments
 *         self.longitude, self.meridian = complex(longitude), complex(meridian)
 *         self.stipple = True             # <<<<<<<<<<<<<<
 * 
 *     cdef set_dark_color(self):
*/
  __Pyx_INCREF(Py_True);
  __Pyx_GIVEREF(Py_True);
  __Pyx_GOTREF(__pyx_v_self->stipple);
  __Pyx_DECREF(__pyx_v_self->stipple);
  __pyx_v_self->stipple = Py_True;

  /* "opengl/legacy/edge_set.pyx":13
 *     cdef segments, longitude, meridian, stipple
 * 
 *     def __init__(self, segments, longitude, meridian, togl_widget=None):             # <<<<<<<<<<<<<<
 *         self.segments = segments
 *         self.longitude, self.meridian = complex(longitude), complex(meridian)
*/

  /* 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_4);
  __Pyx_AddTraceback("CyOpenGL.EdgeSet.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opengl/legacy/edge_set.pyx":18
 *         self.stipple = True
 * 
 *     cdef set_dark_color(self):             # <<<<<<<<<<<<<<
 *         glColor4f(0.0, 0.0, 0.0, 1.0)
 * 
*/

static PyObject *__pyx_f_8CyOpenGL_7EdgeSet_set_dark_color(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_EdgeSet *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_dark_color", 0);

  /* "opengl/legacy/edge_set.pyx":19
 * 
 *     cdef set_dark_color(self):
 *         glColor4f(0.0, 0.0, 0.0, 1.0)             # <<<<<<<<<<<<<<
 * 
 *     cdef set_light_color(self):
*/
  glColor4f(0.0, 0.0, 0.0, 1.0);

  /* "opengl/legacy/edge_set.pyx":18
 *         self.stipple = True
 * 
 *     cdef set_dark_color(self):             # <<<<<<<<<<<<<<
 *         glColor4f(0.0, 0.0, 0.0, 1.0)
 * 
*/

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

/* "opengl/legacy/edge_set.pyx":21
 *         glColor4f(0.0, 0.0, 0.0, 1.0)
 * 
 *     cdef set_light_color(self):             # <<<<<<<<<<<<<<
 *         glColor4f(0.7, 0.7, 0.7, 1.0)
 * 
*/

static PyObject *__pyx_f_8CyOpenGL_7EdgeSet_set_light_color(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_EdgeSet *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_light_color", 0);

  /* "opengl/legacy/edge_set.pyx":22
 * 
 *     cdef set_light_color(self):
 *         glColor4f(0.7, 0.7, 0.7, 1.0)             # <<<<<<<<<<<<<<
 * 
 *     def draw(self, shifts, dark=True):
*/
  glColor4f(0.7, 0.7, 0.7, 1.0);

  /* "opengl/legacy/edge_set.pyx":21
 *         glColor4f(0.0, 0.0, 0.0, 1.0)
 * 
 *     cdef set_light_color(self):             # <<<<<<<<<<<<<<
 *         glColor4f(0.7, 0.7, 0.7, 1.0)
 * 
*/

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

/* "opengl/legacy/edge_set.pyx":24
 *         glColor4f(0.7, 0.7, 0.7, 1.0)
 * 
 *     def draw(self, shifts, dark=True):             # <<<<<<<<<<<<<<
 *         glDisable(GL_LIGHTING)
 *         glLineWidth(2.0)
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_7EdgeSet_3draw(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_7EdgeSet_2draw, "EdgeSet.draw(self, shifts, dark=True)");
static PyMethodDef __pyx_mdef_8CyOpenGL_7EdgeSet_3draw = {"draw", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_7EdgeSet_3draw, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_7EdgeSet_2draw};
static PyObject *__pyx_pw_8CyOpenGL_7EdgeSet_3draw(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_shifts = 0;
  PyObject *__pyx_v_dark = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("draw (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_shifts,&__pyx_mstate_global->__pyx_n_u_dark,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(21, 24, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(21, 24, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(21, 24, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "draw", 0) < (0)) __PYX_ERR(21, 24, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_True));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("draw", 0, 1, 2, i); __PYX_ERR(21, 24, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(21, 24, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(21, 24, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_True));
    }
    __pyx_v_shifts = values[0];
    __pyx_v_dark = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("draw", 0, 1, 2, __pyx_nargs); __PYX_ERR(21, 24, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("CyOpenGL.EdgeSet.draw", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_7EdgeSet_2draw(((struct __pyx_obj_8CyOpenGL_EdgeSet *)__pyx_v_self), __pyx_v_shifts, __pyx_v_dark);

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

static PyObject *__pyx_pf_8CyOpenGL_7EdgeSet_2draw(struct __pyx_obj_8CyOpenGL_EdgeSet *__pyx_v_self, PyObject *__pyx_v_shifts, PyObject *__pyx_v_dark) {
  PyObject *__pyx_v_M = NULL;
  PyObject *__pyx_v_L = NULL;
  PyObject *__pyx_v_disp = NULL;
  PyObject *__pyx_v_P1 = NULL;
  PyObject *__pyx_v_P2 = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  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;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *(*__pyx_t_9)(PyObject *);
  GLfloat __pyx_t_10;
  GLfloat __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  PyObject *(*__pyx_t_13)(PyObject *);
  PyObject *__pyx_t_14 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("draw", 0);

  /* "opengl/legacy/edge_set.pyx":25
 * 
 *     def draw(self, shifts, dark=True):
 *         glDisable(GL_LIGHTING)             # <<<<<<<<<<<<<<
 *         glLineWidth(2.0)
 *         if self.stipple:
*/
  glDisable(GL_LIGHTING);

  /* "opengl/legacy/edge_set.pyx":26
 *     def draw(self, shifts, dark=True):
 *         glDisable(GL_LIGHTING)
 *         glLineWidth(2.0)             # <<<<<<<<<<<<<<
 *         if self.stipple:
 *             glEnable(GL_LINE_STIPPLE)
*/
  glLineWidth(2.0);

  /* "opengl/legacy/edge_set.pyx":27
 *         glDisable(GL_LIGHTING)
 *         glLineWidth(2.0)
 *         if self.stipple:             # <<<<<<<<<<<<<<
 *             glEnable(GL_LINE_STIPPLE)
 *             glLineStipple(1, 0xcccc)
*/
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->stipple); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(21, 27, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "opengl/legacy/edge_set.pyx":28
 *         glLineWidth(2.0)
 *         if self.stipple:
 *             glEnable(GL_LINE_STIPPLE)             # <<<<<<<<<<<<<<
 *             glLineStipple(1, 0xcccc)
 *         if dark:
*/
    glEnable(GL_LINE_STIPPLE);

    /* "opengl/legacy/edge_set.pyx":29
 *         if self.stipple:
 *             glEnable(GL_LINE_STIPPLE)
 *             glLineStipple(1, 0xcccc)             # <<<<<<<<<<<<<<
 *         if dark:
 *             self.set_dark_color()
*/
    glLineStipple(1, 0xcccc);

    /* "opengl/legacy/edge_set.pyx":27
 *         glDisable(GL_LIGHTING)
 *         glLineWidth(2.0)
 *         if self.stipple:             # <<<<<<<<<<<<<<
 *             glEnable(GL_LINE_STIPPLE)
 *             glLineStipple(1, 0xcccc)
*/
  }

  /* "opengl/legacy/edge_set.pyx":30
 *             glEnable(GL_LINE_STIPPLE)
 *             glLineStipple(1, 0xcccc)
 *         if dark:             # <<<<<<<<<<<<<<
 *             self.set_dark_color()
 *         else:
*/
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_dark); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(21, 30, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "opengl/legacy/edge_set.pyx":31
 *             glLineStipple(1, 0xcccc)
 *         if dark:
 *             self.set_dark_color()             # <<<<<<<<<<<<<<
 *         else:
 *             self.set_light_color()
*/
    __pyx_t_2 = ((struct __pyx_vtabstruct_8CyOpenGL_EdgeSet *)__pyx_v_self->__pyx_base.__pyx_vtab)->set_dark_color(__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(21, 31, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "opengl/legacy/edge_set.pyx":30
 *             glEnable(GL_LINE_STIPPLE)
 *             glLineStipple(1, 0xcccc)
 *         if dark:             # <<<<<<<<<<<<<<
 *             self.set_dark_color()
 *         else:
*/
    goto __pyx_L4;
  }

  /* "opengl/legacy/edge_set.pyx":33
 *             self.set_dark_color()
 *         else:
 *             self.set_light_color()             # <<<<<<<<<<<<<<
 *         for M, L in shifts:
 *             disp = M*self.meridian + L*self.longitude
*/
  /*else*/ {
    __pyx_t_2 = ((struct __pyx_vtabstruct_8CyOpenGL_EdgeSet *)__pyx_v_self->__pyx_base.__pyx_vtab)->set_light_color(__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(21, 33, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_L4:;

  /* "opengl/legacy/edge_set.pyx":34
 *         else:
 *             self.set_light_color()
 *         for M, L in shifts:             # <<<<<<<<<<<<<<
 *             disp = M*self.meridian + L*self.longitude
 *             glPushMatrix()
*/
  if (likely(PyList_CheckExact(__pyx_v_shifts)) || PyTuple_CheckExact(__pyx_v_shifts)) {
    __pyx_t_2 = __pyx_v_shifts; __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_shifts); if (unlikely(!__pyx_t_2)) __PYX_ERR(21, 34, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(21, 34, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(21, 34, __pyx_L1_error)
          #endif
          if (__pyx_t_3 >= __pyx_temp) break;
        }
        __pyx_t_5 = __Pyx_PyList_GetItemRefFast(__pyx_t_2, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference);
        ++__pyx_t_3;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(21, 34, __pyx_L1_error)
          #endif
          if (__pyx_t_3 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3));
        #else
        __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3);
        #endif
        ++__pyx_t_3;
      }
      if (unlikely(!__pyx_t_5)) __PYX_ERR(21, 34, __pyx_L1_error)
    } else {
      __pyx_t_5 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_5)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(21, 34, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_5);
    if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
      PyObject* sequence = __pyx_t_5;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(21, 34, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0);
        __Pyx_INCREF(__pyx_t_6);
        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_7);
      } else {
        __pyx_t_6 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_6)) __PYX_ERR(21, 34, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_6);
        __pyx_t_7 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_7)) __PYX_ERR(21, 34, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_7);
      }
      #else
      __pyx_t_6 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(21, 34, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(21, 34, __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(21, 34, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8);
      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(21, 34, __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(21, 34, __pyx_L1_error)
      __pyx_L8_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_M, __pyx_t_6);
    __pyx_t_6 = 0;
    __Pyx_XDECREF_SET(__pyx_v_L, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "opengl/legacy/edge_set.pyx":35
 *             self.set_light_color()
 *         for M, L in shifts:
 *             disp = M*self.meridian + L*self.longitude             # <<<<<<<<<<<<<<
 *             glPushMatrix()
 *             glTranslatef(disp.real, disp.imag, 0.0)
*/
    __pyx_t_5 = PyNumber_Multiply(__pyx_v_M, __pyx_v_self->meridian); if (unlikely(!__pyx_t_5)) __PYX_ERR(21, 35, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = PyNumber_Multiply(__pyx_v_L, __pyx_v_self->longitude); if (unlikely(!__pyx_t_7)) __PYX_ERR(21, 35, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(21, 35, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF_SET(__pyx_v_disp, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "opengl/legacy/edge_set.pyx":36
 *         for M, L in shifts:
 *             disp = M*self.meridian + L*self.longitude
 *             glPushMatrix()             # <<<<<<<<<<<<<<
 *             glTranslatef(disp.real, disp.imag, 0.0)
 *             for P1, P2 in self.segments:
*/
    glPushMatrix();

    /* "opengl/legacy/edge_set.pyx":37
 *             disp = M*self.meridian + L*self.longitude
 *             glPushMatrix()
 *             glTranslatef(disp.real, disp.imag, 0.0)             # <<<<<<<<<<<<<<
 *             for P1, P2 in self.segments:
 *                 glBegin(GL_LINES)
*/
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_disp, __pyx_mstate_global->__pyx_n_u_real); if (unlikely(!__pyx_t_6)) __PYX_ERR(21, 37, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_10 = __Pyx_PyFloat_AsFloat(__pyx_t_6); if (unlikely((__pyx_t_10 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(21, 37, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_disp, __pyx_mstate_global->__pyx_n_u_imag); if (unlikely(!__pyx_t_6)) __PYX_ERR(21, 37, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_11 = __Pyx_PyFloat_AsFloat(__pyx_t_6); if (unlikely((__pyx_t_11 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(21, 37, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    glTranslatef(__pyx_t_10, __pyx_t_11, 0.0);

    /* "opengl/legacy/edge_set.pyx":38
 *             glPushMatrix()
 *             glTranslatef(disp.real, disp.imag, 0.0)
 *             for P1, P2 in self.segments:             # <<<<<<<<<<<<<<
 *                 glBegin(GL_LINES)
 *                 glVertex3f(P1.real, P1.imag, 0.0)
*/
    if (likely(PyList_CheckExact(__pyx_v_self->segments)) || PyTuple_CheckExact(__pyx_v_self->segments)) {
      __pyx_t_6 = __pyx_v_self->segments; __Pyx_INCREF(__pyx_t_6);
      __pyx_t_12 = 0;
      __pyx_t_13 = NULL;
    } else {
      __pyx_t_12 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_self->segments); if (unlikely(!__pyx_t_6)) __PYX_ERR(21, 38, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_13 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_13)) __PYX_ERR(21, 38, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_13)) {
        if (likely(PyList_CheckExact(__pyx_t_6))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_6);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(21, 38, __pyx_L1_error)
            #endif
            if (__pyx_t_12 >= __pyx_temp) break;
          }
          __pyx_t_7 = __Pyx_PyList_GetItemRefFast(__pyx_t_6, __pyx_t_12, __Pyx_ReferenceSharing_OwnStrongReference);
          ++__pyx_t_12;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_6);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(21, 38, __pyx_L1_error)
            #endif
            if (__pyx_t_12 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_7 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_12));
          #else
          __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_12);
          #endif
          ++__pyx_t_12;
        }
        if (unlikely(!__pyx_t_7)) __PYX_ERR(21, 38, __pyx_L1_error)
      } else {
        __pyx_t_7 = __pyx_t_13(__pyx_t_6);
        if (unlikely(!__pyx_t_7)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(21, 38, __pyx_L1_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __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 != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          __PYX_ERR(21, 38, __pyx_L1_error)
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0);
          __Pyx_INCREF(__pyx_t_5);
          __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1);
          __Pyx_INCREF(__pyx_t_8);
        } else {
          __pyx_t_5 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
          if (unlikely(!__pyx_t_5)) __PYX_ERR(21, 38, __pyx_L1_error)
          __Pyx_XGOTREF(__pyx_t_5);
          __pyx_t_8 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
          if (unlikely(!__pyx_t_8)) __PYX_ERR(21, 38, __pyx_L1_error)
          __Pyx_XGOTREF(__pyx_t_8);
        }
        #else
        __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(21, 38, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(21, 38, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        #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(21, 38, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_14);
        index = 0; __pyx_t_5 = __pyx_t_9(__pyx_t_14); if (unlikely(!__pyx_t_5)) goto __pyx_L11_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_5);
        index = 1; __pyx_t_8 = __pyx_t_9(__pyx_t_14); if (unlikely(!__pyx_t_8)) goto __pyx_L11_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_8);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_14), 2) < (0)) __PYX_ERR(21, 38, __pyx_L1_error)
        __pyx_t_9 = NULL;
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        goto __pyx_L12_unpacking_done;
        __pyx_L11_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __pyx_t_9 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        __PYX_ERR(21, 38, __pyx_L1_error)
        __pyx_L12_unpacking_done:;
      }
      __Pyx_XDECREF_SET(__pyx_v_P1, __pyx_t_5);
      __pyx_t_5 = 0;
      __Pyx_XDECREF_SET(__pyx_v_P2, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "opengl/legacy/edge_set.pyx":39
 *             glTranslatef(disp.real, disp.imag, 0.0)
 *             for P1, P2 in self.segments:
 *                 glBegin(GL_LINES)             # <<<<<<<<<<<<<<
 *                 glVertex3f(P1.real, P1.imag, 0.0)
 *                 glVertex3f(P2.real, P2.imag, 0.0)
*/
      glBegin(GL_LINES);

      /* "opengl/legacy/edge_set.pyx":40
 *             for P1, P2 in self.segments:
 *                 glBegin(GL_LINES)
 *                 glVertex3f(P1.real, P1.imag, 0.0)             # <<<<<<<<<<<<<<
 *                 glVertex3f(P2.real, P2.imag, 0.0)
 *                 glEnd()
*/
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_P1, __pyx_mstate_global->__pyx_n_u_real); if (unlikely(!__pyx_t_7)) __PYX_ERR(21, 40, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_11 = __Pyx_PyFloat_AsFloat(__pyx_t_7); if (unlikely((__pyx_t_11 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(21, 40, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_P1, __pyx_mstate_global->__pyx_n_u_imag); if (unlikely(!__pyx_t_7)) __PYX_ERR(21, 40, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_10 = __Pyx_PyFloat_AsFloat(__pyx_t_7); if (unlikely((__pyx_t_10 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(21, 40, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      glVertex3f(__pyx_t_11, __pyx_t_10, 0.0);

      /* "opengl/legacy/edge_set.pyx":41
 *                 glBegin(GL_LINES)
 *                 glVertex3f(P1.real, P1.imag, 0.0)
 *                 glVertex3f(P2.real, P2.imag, 0.0)             # <<<<<<<<<<<<<<
 *                 glEnd()
 *             glPopMatrix()
*/
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_P2, __pyx_mstate_global->__pyx_n_u_real); if (unlikely(!__pyx_t_7)) __PYX_ERR(21, 41, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_10 = __Pyx_PyFloat_AsFloat(__pyx_t_7); if (unlikely((__pyx_t_10 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(21, 41, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_P2, __pyx_mstate_global->__pyx_n_u_imag); if (unlikely(!__pyx_t_7)) __PYX_ERR(21, 41, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_11 = __Pyx_PyFloat_AsFloat(__pyx_t_7); if (unlikely((__pyx_t_11 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(21, 41, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      glVertex3f(__pyx_t_10, __pyx_t_11, 0.0);

      /* "opengl/legacy/edge_set.pyx":42
 *                 glVertex3f(P1.real, P1.imag, 0.0)
 *                 glVertex3f(P2.real, P2.imag, 0.0)
 *                 glEnd()             # <<<<<<<<<<<<<<
 *             glPopMatrix()
 *         if self.stipple:
*/
      glEnd();

      /* "opengl/legacy/edge_set.pyx":38
 *             glPushMatrix()
 *             glTranslatef(disp.real, disp.imag, 0.0)
 *             for P1, P2 in self.segments:             # <<<<<<<<<<<<<<
 *                 glBegin(GL_LINES)
 *                 glVertex3f(P1.real, P1.imag, 0.0)
*/
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "opengl/legacy/edge_set.pyx":43
 *                 glVertex3f(P2.real, P2.imag, 0.0)
 *                 glEnd()
 *             glPopMatrix()             # <<<<<<<<<<<<<<
 *         if self.stipple:
 *             glDisable(GL_LINE_STIPPLE)
*/
    glPopMatrix();

    /* "opengl/legacy/edge_set.pyx":34
 *         else:
 *             self.set_light_color()
 *         for M, L in shifts:             # <<<<<<<<<<<<<<
 *             disp = M*self.meridian + L*self.longitude
 *             glPushMatrix()
*/
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opengl/legacy/edge_set.pyx":44
 *                 glEnd()
 *             glPopMatrix()
 *         if self.stipple:             # <<<<<<<<<<<<<<
 *             glDisable(GL_LINE_STIPPLE)
 *         glEnable(GL_LIGHTING)
*/
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->stipple); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(21, 44, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "opengl/legacy/edge_set.pyx":45
 *             glPopMatrix()
 *         if self.stipple:
 *             glDisable(GL_LINE_STIPPLE)             # <<<<<<<<<<<<<<
 *         glEnable(GL_LIGHTING)
*/
    glDisable(GL_LINE_STIPPLE);

    /* "opengl/legacy/edge_set.pyx":44
 *                 glEnd()
 *             glPopMatrix()
 *         if self.stipple:             # <<<<<<<<<<<<<<
 *             glDisable(GL_LINE_STIPPLE)
 *         glEnable(GL_LIGHTING)
*/
  }

  /* "opengl/legacy/edge_set.pyx":46
 *         if self.stipple:
 *             glDisable(GL_LINE_STIPPLE)
 *         glEnable(GL_LIGHTING)             # <<<<<<<<<<<<<<
*/
  glEnable(GL_LIGHTING);

  /* "opengl/legacy/edge_set.pyx":24
 *         glColor4f(0.7, 0.7, 0.7, 1.0)
 * 
 *     def draw(self, shifts, dark=True):             # <<<<<<<<<<<<<<
 *         glDisable(GL_LIGHTING)
 *         glLineWidth(2.0)
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_AddTraceback("CyOpenGL.EdgeSet.draw", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_M);
  __Pyx_XDECREF(__pyx_v_L);
  __Pyx_XDECREF(__pyx_v_disp);
  __Pyx_XDECREF(__pyx_v_P1);
  __Pyx_XDECREF(__pyx_v_P2);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opengl/legacy/triangulation_edge_set.pyx":7
 *     xy-plane in upper half-space.
 *     """
 *     def __init__(self, triangulation, longitude, meridian, togl_widget=None):             # <<<<<<<<<<<<<<
 *         self.segments = [D['endpoints'] for D in triangulation]
 *         self.longitude, self.meridian = complex(longitude), complex(meridian)
*/

/* Python wrapper */
static int __pyx_pw_8CyOpenGL_20TriangulationEdgeSet_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_8CyOpenGL_20TriangulationEdgeSet_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_triangulation = 0;
  PyObject *__pyx_v_longitude = 0;
  PyObject *__pyx_v_meridian = 0;
  CYTHON_UNUSED PyObject *__pyx_v_togl_widget = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[4] = {0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_triangulation,&__pyx_mstate_global->__pyx_n_u_longitude,&__pyx_mstate_global->__pyx_n_u_meridian,&__pyx_mstate_global->__pyx_n_u_togl_widget,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(22, 7, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_VARARGS(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(22, 7, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(22, 7, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(22, 7, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(22, 7, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(22, 7, __pyx_L3_error)
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, i); __PYX_ERR(22, 7, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_VARARGS(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(22, 7, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(22, 7, __pyx_L3_error)
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(22, 7, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(22, 7, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_triangulation = values[0];
    __pyx_v_longitude = values[1];
    __pyx_v_meridian = values[2];
    __pyx_v_togl_widget = values[3];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, __pyx_nargs); __PYX_ERR(22, 7, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("CyOpenGL.TriangulationEdgeSet.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_20TriangulationEdgeSet___init__(((struct __pyx_obj_8CyOpenGL_TriangulationEdgeSet *)__pyx_v_self), __pyx_v_triangulation, __pyx_v_longitude, __pyx_v_meridian, __pyx_v_togl_widget);

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

static int __pyx_pf_8CyOpenGL_20TriangulationEdgeSet___init__(struct __pyx_obj_8CyOpenGL_TriangulationEdgeSet *__pyx_v_self, PyObject *__pyx_v_triangulation, PyObject *__pyx_v_longitude, PyObject *__pyx_v_meridian, CYTHON_UNUSED PyObject *__pyx_v_togl_widget) {
  PyObject *__pyx_8genexpr5__pyx_v_D = NULL;
  int __pyx_r;
  __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;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "opengl/legacy/triangulation_edge_set.pyx":8
 *     """
 *     def __init__(self, triangulation, longitude, meridian, togl_widget=None):
 *         self.segments = [D['endpoints'] for D in triangulation]             # <<<<<<<<<<<<<<
 *         self.longitude, self.meridian = complex(longitude), complex(meridian)
 *         self.stipple = False
*/
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 8, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (likely(PyList_CheckExact(__pyx_v_triangulation)) || PyTuple_CheckExact(__pyx_v_triangulation)) {
      __pyx_t_2 = __pyx_v_triangulation; __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_triangulation); if (unlikely(!__pyx_t_2)) __PYX_ERR(22, 8, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(22, 8, __pyx_L5_error)
    }
    for (;;) {
      if (likely(!__pyx_t_4)) {
        if (likely(PyList_CheckExact(__pyx_t_2))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(22, 8, __pyx_L5_error)
            #endif
            if (__pyx_t_3 >= __pyx_temp) break;
          }
          __pyx_t_5 = __Pyx_PyList_GetItemRefFast(__pyx_t_2, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference);
          ++__pyx_t_3;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(22, 8, __pyx_L5_error)
            #endif
            if (__pyx_t_3 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_5 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3));
          #else
          __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3);
          #endif
          ++__pyx_t_3;
        }
        if (unlikely(!__pyx_t_5)) __PYX_ERR(22, 8, __pyx_L5_error)
      } else {
        __pyx_t_5 = __pyx_t_4(__pyx_t_2);
        if (unlikely(!__pyx_t_5)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(22, 8, __pyx_L5_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_XDECREF_SET(__pyx_8genexpr5__pyx_v_D, __pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_8genexpr5__pyx_v_D, __pyx_mstate_global->__pyx_n_u_endpoints); if (unlikely(!__pyx_t_5)) __PYX_ERR(22, 8, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(22, 8, __pyx_L5_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_D); __pyx_8genexpr5__pyx_v_D = 0;
    goto __pyx_L9_exit_scope;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_D); __pyx_8genexpr5__pyx_v_D = 0;
    goto __pyx_L1_error;
    __pyx_L9_exit_scope:;
  } /* exit inner scope */
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->__pyx_base.segments);
  __Pyx_DECREF(__pyx_v_self->__pyx_base.segments);
  __pyx_v_self->__pyx_base.segments = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "opengl/legacy/triangulation_edge_set.pyx":9
 *     def __init__(self, triangulation, longitude, meridian, togl_widget=None):
 *         self.segments = [D['endpoints'] for D in triangulation]
 *         self.longitude, self.meridian = complex(longitude), complex(meridian)             # <<<<<<<<<<<<<<
 *         self.stipple = False
 * 
*/
  __pyx_t_2 = NULL;
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_longitude};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(&PyComplex_Type), __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_5 = NULL;
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_meridian};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(&PyComplex_Type), __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(22, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->__pyx_base.longitude);
  __Pyx_DECREF(__pyx_v_self->__pyx_base.longitude);
  __pyx_v_self->__pyx_base.longitude = __pyx_t_1;
  __pyx_t_1 = 0;
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->__pyx_base.meridian);
  __Pyx_DECREF(__pyx_v_self->__pyx_base.meridian);
  __pyx_v_self->__pyx_base.meridian = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "opengl/legacy/triangulation_edge_set.pyx":10
 *         self.segments = [D['endpoints'] for D in triangulation]
 *         self.longitude, self.meridian = complex(longitude), complex(meridian)
 *         self.stipple = False             # <<<<<<<<<<<<<<
 * 
 *     cdef set_light_color(self):
*/
  __Pyx_INCREF(Py_False);
  __Pyx_GIVEREF(Py_False);
  __Pyx_GOTREF(__pyx_v_self->__pyx_base.stipple);
  __Pyx_DECREF(__pyx_v_self->__pyx_base.stipple);
  __pyx_v_self->__pyx_base.stipple = Py_False;

  /* "opengl/legacy/triangulation_edge_set.pyx":7
 *     xy-plane in upper half-space.
 *     """
 *     def __init__(self, triangulation, longitude, meridian, togl_widget=None):             # <<<<<<<<<<<<<<
 *         self.segments = [D['endpoints'] for D in triangulation]
 *         self.longitude, self.meridian = complex(longitude), complex(meridian)
*/

  /* 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_5);
  __Pyx_AddTraceback("CyOpenGL.TriangulationEdgeSet.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_D);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opengl/legacy/triangulation_edge_set.pyx":12
 *         self.stipple = False
 * 
 *     cdef set_light_color(self):             # <<<<<<<<<<<<<<
 *         glColor4f(0.6, 0.6, 0.6, 1.0)
*/

static PyObject *__pyx_f_8CyOpenGL_20TriangulationEdgeSet_set_light_color(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_TriangulationEdgeSet *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_light_color", 0);

  /* "opengl/legacy/triangulation_edge_set.pyx":13
 * 
 *     cdef set_light_color(self):
 *         glColor4f(0.6, 0.6, 0.6, 1.0)             # <<<<<<<<<<<<<<
*/
  glColor4f(0.6, 0.6, 0.6, 1.0);

  /* "opengl/legacy/triangulation_edge_set.pyx":12
 *         self.stipple = False
 * 
 *     cdef set_light_color(self):             # <<<<<<<<<<<<<<
 *         glColor4f(0.6, 0.6, 0.6, 1.0)
*/

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

/* "opengl/legacy/label.pyx":9
 *     cdef codes
 * 
 *     def __init__(self, position, int_label):             # <<<<<<<<<<<<<<
 *         self.x, self.y = position.real, position.imag
 *         self.codes = [ord(c) for c in repr(int_label)]
*/

/* Python wrapper */
static int __pyx_pw_8CyOpenGL_5Label_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_8CyOpenGL_5Label_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_position = 0;
  PyObject *__pyx_v_int_label = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_position,&__pyx_mstate_global->__pyx_n_u_int_label,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(23, 9, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(23, 9, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(23, 9, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(23, 9, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, i); __PYX_ERR(23, 9, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(23, 9, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(23, 9, __pyx_L3_error)
    }
    __pyx_v_position = values[0];
    __pyx_v_int_label = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(23, 9, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("CyOpenGL.Label.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_5Label___init__(((struct __pyx_obj_8CyOpenGL_Label *)__pyx_v_self), __pyx_v_position, __pyx_v_int_label);

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

static int __pyx_pf_8CyOpenGL_5Label___init__(struct __pyx_obj_8CyOpenGL_Label *__pyx_v_self, PyObject *__pyx_v_position, PyObject *__pyx_v_int_label) {
  Py_UCS4 __pyx_8genexpr6__pyx_v_c;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  GLfloat __pyx_t_2;
  GLfloat __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  void *__pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "opengl/legacy/label.pyx":10
 * 
 *     def __init__(self, position, int_label):
 *         self.x, self.y = position.real, position.imag             # <<<<<<<<<<<<<<
 *         self.codes = [ord(c) for c in repr(int_label)]
 * 
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_position, __pyx_mstate_global->__pyx_n_u_real); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 10, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_2 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(23, 10, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_position, __pyx_mstate_global->__pyx_n_u_imag); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 10, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_3 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(23, 10, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_self->x = __pyx_t_2;
  __pyx_v_self->y = __pyx_t_3;

  /* "opengl/legacy/label.pyx":11
 *     def __init__(self, position, int_label):
 *         self.x, self.y = position.real, position.imag
 *         self.codes = [ord(c) for c in repr(int_label)]             # <<<<<<<<<<<<<<
 * 
 *     cdef get_shape(self):
*/
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 11, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyObject_Repr(__pyx_v_int_label); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 11, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (unlikely(__pyx_t_4 == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable");
      __PYX_ERR(23, 11, __pyx_L1_error)
    }
    __pyx_t_9 = __Pyx_init_unicode_iteration(__pyx_t_4, (&__pyx_t_6), (&__pyx_t_7), (&__pyx_t_8)); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(23, 11, __pyx_L1_error)
    for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_6; __pyx_t_10++) {
      __pyx_t_5 = __pyx_t_10;
      __pyx_8genexpr6__pyx_v_c = __Pyx_PyUnicode_READ(__pyx_t_8, __pyx_t_7, __pyx_t_5);
      __pyx_t_11 = __Pyx_PyLong_From_long(__Pyx_long_cast(__pyx_8genexpr6__pyx_v_c)); if (unlikely(!__pyx_t_11)) __PYX_ERR(23, 11, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_11))) __PYX_ERR(23, 11, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } /* exit inner scope */
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->codes);
  __Pyx_DECREF(__pyx_v_self->codes);
  __pyx_v_self->codes = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "opengl/legacy/label.pyx":9
 *     cdef codes
 * 
 *     def __init__(self, position, int_label):             # <<<<<<<<<<<<<<
 *         self.x, self.y = position.real, position.imag
 *         self.codes = [ord(c) for c in repr(int_label)]
*/

  /* 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_11);
  __Pyx_AddTraceback("CyOpenGL.Label.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opengl/legacy/label.pyx":13
 *         self.codes = [ord(c) for c in repr(int_label)]
 * 
 *     cdef get_shape(self):             # <<<<<<<<<<<<<<
 *         cdef SnapPy_glyph* glyph
 *         width, height = 0, 0
*/

static PyObject *__pyx_f_8CyOpenGL_5Label_get_shape(struct __pyx_obj_8CyOpenGL_Label *__pyx_v_self) {
  SnapPy_glyph *__pyx_v_glyph;
  PyObject *__pyx_v_width = NULL;
  long __pyx_v_height;
  PyObject *__pyx_v_c = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  long __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_shape", 0);

  /* "opengl/legacy/label.pyx":15
 *     cdef get_shape(self):
 *         cdef SnapPy_glyph* glyph
 *         width, height = 0, 0             # <<<<<<<<<<<<<<
 *         for c in self.codes:
 *             glyph = SnapPy_font[c]
*/
  __pyx_t_1 = __pyx_mstate_global->__pyx_int_0;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = 0;
  __pyx_v_width = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v_height = __pyx_t_2;

  /* "opengl/legacy/label.pyx":16
 *         cdef SnapPy_glyph* glyph
 *         width, height = 0, 0
 *         for c in self.codes:             # <<<<<<<<<<<<<<
 *             glyph = SnapPy_font[c]
 *             width += glyph.width
*/
  if (likely(PyList_CheckExact(__pyx_v_self->codes)) || PyTuple_CheckExact(__pyx_v_self->codes)) {
    __pyx_t_1 = __pyx_v_self->codes; __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->codes); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 16, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 16, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(23, 16, __pyx_L1_error)
          #endif
          if (__pyx_t_3 >= __pyx_temp) break;
        }
        __pyx_t_5 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference);
        ++__pyx_t_3;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(23, 16, __pyx_L1_error)
          #endif
          if (__pyx_t_3 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3));
        #else
        __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3);
        #endif
        ++__pyx_t_3;
      }
      if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 16, __pyx_L1_error)
    } else {
      __pyx_t_5 = __pyx_t_4(__pyx_t_1);
      if (unlikely(!__pyx_t_5)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(23, 16, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_XDECREF_SET(__pyx_v_c, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "opengl/legacy/label.pyx":17
 *         width, height = 0, 0
 *         for c in self.codes:
 *             glyph = SnapPy_font[c]             # <<<<<<<<<<<<<<
 *             width += glyph.width
 *             height = glyph.height
*/
    __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_c); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(23, 17, __pyx_L1_error)
    __pyx_v_glyph = (SnapPy_font[__pyx_t_6]);

    /* "opengl/legacy/label.pyx":18
 *         for c in self.codes:
 *             glyph = SnapPy_font[c]
 *             width += glyph.width             # <<<<<<<<<<<<<<
 *             height = glyph.height
 *         return width, height
*/
    __pyx_t_5 = __Pyx_PyLong_From_int(__pyx_v_glyph->width); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 18, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = PyNumber_InPlaceAdd(__pyx_v_width, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(23, 18, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF_SET(__pyx_v_width, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "opengl/legacy/label.pyx":19
 *             glyph = SnapPy_font[c]
 *             width += glyph.width
 *             height = glyph.height             # <<<<<<<<<<<<<<
 *         return width, height
 * 
*/
    __pyx_t_8 = __pyx_v_glyph->height;
    __pyx_v_height = __pyx_t_8;

    /* "opengl/legacy/label.pyx":16
 *         cdef SnapPy_glyph* glyph
 *         width, height = 0, 0
 *         for c in self.codes:             # <<<<<<<<<<<<<<
 *             glyph = SnapPy_font[c]
 *             width += glyph.width
*/
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/legacy/label.pyx":20
 *             width += glyph.width
 *             height = glyph.height
 *         return width, height             # <<<<<<<<<<<<<<
 * 
 *     def draw(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyLong_From_long(__pyx_v_height); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(23, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_INCREF(__pyx_v_width);
  __Pyx_GIVEREF(__pyx_v_width);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_width) != (0)) __PYX_ERR(23, 20, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_1) != (0)) __PYX_ERR(23, 20, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "opengl/legacy/label.pyx":13
 *         self.codes = [ord(c) for c in repr(int_label)]
 * 
 *     cdef get_shape(self):             # <<<<<<<<<<<<<<
 *         cdef SnapPy_glyph* glyph
 *         width, height = 0, 0
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("CyOpenGL.Label.get_shape", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_width);
  __Pyx_XDECREF(__pyx_v_c);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opengl/legacy/label.pyx":22
 *         return width, height
 * 
 *     def draw(self):             # <<<<<<<<<<<<<<
 *         cdef SnapPy_glyph* glyph
 *         glRasterPos2f(self.x, self.y)
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_5Label_3draw(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_5Label_2draw, "Label.draw(self)");
static PyMethodDef __pyx_mdef_8CyOpenGL_5Label_3draw = {"draw", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_5Label_3draw, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_5Label_2draw};
static PyObject *__pyx_pw_8CyOpenGL_5Label_3draw(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("draw (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("draw", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("draw", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8CyOpenGL_5Label_2draw(((struct __pyx_obj_8CyOpenGL_Label *)__pyx_v_self));

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

static PyObject *__pyx_pf_8CyOpenGL_5Label_2draw(struct __pyx_obj_8CyOpenGL_Label *__pyx_v_self) {
  SnapPy_glyph *__pyx_v_glyph;
  PyObject *__pyx_v_width = NULL;
  PyObject *__pyx_v_height = NULL;
  PyObject *__pyx_v_c = 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 *);
  GLfloat __pyx_t_6;
  GLfloat __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  Py_ssize_t __pyx_t_10;
  int __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("draw", 0);

  /* "opengl/legacy/label.pyx":24
 *     def draw(self):
 *         cdef SnapPy_glyph* glyph
 *         glRasterPos2f(self.x, self.y)             # <<<<<<<<<<<<<<
 *         width, height = self.get_shape()
 *         # This is a trick to move the raster position in units of 1 pixel
*/
  glRasterPos2f(__pyx_v_self->x, __pyx_v_self->y);

  /* "opengl/legacy/label.pyx":25
 *         cdef SnapPy_glyph* glyph
 *         glRasterPos2f(self.x, self.y)
 *         width, height = self.get_shape()             # <<<<<<<<<<<<<<
 *         # This is a trick to move the raster position in units of 1 pixel
 *         glBitmap(0, 0, 0, 0, -width/2, -height/2, NULL)
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_8CyOpenGL_Label *)__pyx_v_self->__pyx_vtab)->get_shape(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 25, __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(23, 25, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
      __Pyx_INCREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_3);
    } else {
      __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 25, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_3)) __PYX_ERR(23, 25, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_3);
    }
    #else
    __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 25, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(23, 25, __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(23, 25, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4);
    index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 1; __pyx_t_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(23, 25, __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(23, 25, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  __pyx_v_width = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_v_height = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "opengl/legacy/label.pyx":27
 *         width, height = self.get_shape()
 *         # This is a trick to move the raster position in units of 1 pixel
 *         glBitmap(0, 0, 0, 0, -width/2, -height/2, NULL)             # <<<<<<<<<<<<<<
 *         for c in self.codes:
 *             glyph = SnapPy_font[c]
*/
  __pyx_t_1 = PyNumber_Negative(__pyx_v_width); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyLong_TrueDivideObjC(__pyx_t_1, __pyx_mstate_global->__pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(23, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = __Pyx_PyFloat_AsFloat(__pyx_t_3); if (unlikely((__pyx_t_6 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(23, 27, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Negative(__pyx_v_height); if (unlikely(!__pyx_t_3)) __PYX_ERR(23, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyLong_TrueDivideObjC(__pyx_t_3, __pyx_mstate_global->__pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_7 = __Pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_7 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(23, 27, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  glBitmap(0, 0, 0.0, 0.0, __pyx_t_6, __pyx_t_7, NULL);

  /* "opengl/legacy/label.pyx":28
 *         # This is a trick to move the raster position in units of 1 pixel
 *         glBitmap(0, 0, 0, 0, -width/2, -height/2, NULL)
 *         for c in self.codes:             # <<<<<<<<<<<<<<
 *             glyph = SnapPy_font[c]
 *             if glyph != NULL:
*/
  if (likely(PyList_CheckExact(__pyx_v_self->codes)) || PyTuple_CheckExact(__pyx_v_self->codes)) {
    __pyx_t_1 = __pyx_v_self->codes; __Pyx_INCREF(__pyx_t_1);
    __pyx_t_8 = 0;
    __pyx_t_9 = NULL;
  } else {
    __pyx_t_8 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_self->codes); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 28, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(23, 28, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_9)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(23, 28, __pyx_L1_error)
          #endif
          if (__pyx_t_8 >= __pyx_temp) break;
        }
        __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_8, __Pyx_ReferenceSharing_OwnStrongReference);
        ++__pyx_t_8;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(23, 28, __pyx_L1_error)
          #endif
          if (__pyx_t_8 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_8));
        #else
        __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_8);
        #endif
        ++__pyx_t_8;
      }
      if (unlikely(!__pyx_t_3)) __PYX_ERR(23, 28, __pyx_L1_error)
    } else {
      __pyx_t_3 = __pyx_t_9(__pyx_t_1);
      if (unlikely(!__pyx_t_3)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(23, 28, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_XDECREF_SET(__pyx_v_c, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "opengl/legacy/label.pyx":29
 *         glBitmap(0, 0, 0, 0, -width/2, -height/2, NULL)
 *         for c in self.codes:
 *             glyph = SnapPy_font[c]             # <<<<<<<<<<<<<<
 *             if glyph != NULL:
 *                 glDrawPixels(glyph.width, glyph.height,
*/
    __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_c); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(23, 29, __pyx_L1_error)
    __pyx_v_glyph = (SnapPy_font[__pyx_t_10]);

    /* "opengl/legacy/label.pyx":30
 *         for c in self.codes:
 *             glyph = SnapPy_font[c]
 *             if glyph != NULL:             # <<<<<<<<<<<<<<
 *                 glDrawPixels(glyph.width, glyph.height,
 *                              GL_RGBA, GL_UNSIGNED_BYTE,
*/
    __pyx_t_11 = (__pyx_v_glyph != NULL);
    if (__pyx_t_11) {

      /* "opengl/legacy/label.pyx":31
 *             glyph = SnapPy_font[c]
 *             if glyph != NULL:
 *                 glDrawPixels(glyph.width, glyph.height,             # <<<<<<<<<<<<<<
 *                              GL_RGBA, GL_UNSIGNED_BYTE,
 *                              <GLvoid*> glyph.pixel_data)
*/
      glDrawPixels(__pyx_v_glyph->width, __pyx_v_glyph->height, GL_RGBA, GL_UNSIGNED_BYTE, ((GLvoid *)__pyx_v_glyph->pixel_data));

      /* "opengl/legacy/label.pyx":34
 *                              GL_RGBA, GL_UNSIGNED_BYTE,
 *                              <GLvoid*> glyph.pixel_data)
 *                 glBitmap(0, 0, 0, 0, glyph.width, 0, NULL)             # <<<<<<<<<<<<<<
*/
      glBitmap(0, 0, 0.0, 0.0, __pyx_v_glyph->width, 0.0, NULL);

      /* "opengl/legacy/label.pyx":30
 *         for c in self.codes:
 *             glyph = SnapPy_font[c]
 *             if glyph != NULL:             # <<<<<<<<<<<<<<
 *                 glDrawPixels(glyph.width, glyph.height,
 *                              GL_RGBA, GL_UNSIGNED_BYTE,
*/
    }

    /* "opengl/legacy/label.pyx":28
 *         # This is a trick to move the raster position in units of 1 pixel
 *         glBitmap(0, 0, 0, 0, -width/2, -height/2, NULL)
 *         for c in self.codes:             # <<<<<<<<<<<<<<
 *             glyph = SnapPy_font[c]
 *             if glyph != NULL:
*/
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/legacy/label.pyx":22
 *         return width, height
 * 
 *     def draw(self):             # <<<<<<<<<<<<<<
 *         cdef SnapPy_glyph* glyph
 *         glRasterPos2f(self.x, self.y)
*/

  /* 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("CyOpenGL.Label.draw", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_width);
  __Pyx_XDECREF(__pyx_v_height);
  __Pyx_XDECREF(__pyx_v_c);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opengl/legacy/label_set.pyx":11
 *     cdef int width, height
 * 
 *     def __init__(self, triangulation, longitude, meridian, togl_widget=None):             # <<<<<<<<<<<<<<
 *         self.longitude, self.meridian = complex(longitude), complex(meridian)
 *         self.segments = [ Label(sum(D['endpoints'])/2, D['indices'][1])
*/

/* Python wrapper */
static int __pyx_pw_8CyOpenGL_8LabelSet_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_8CyOpenGL_8LabelSet_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_triangulation = 0;
  PyObject *__pyx_v_longitude = 0;
  PyObject *__pyx_v_meridian = 0;
  CYTHON_UNUSED PyObject *__pyx_v_togl_widget = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[4] = {0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_triangulation,&__pyx_mstate_global->__pyx_n_u_longitude,&__pyx_mstate_global->__pyx_n_u_meridian,&__pyx_mstate_global->__pyx_n_u_togl_widget,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(24, 11, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_VARARGS(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(24, 11, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(24, 11, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(24, 11, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(24, 11, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(24, 11, __pyx_L3_error)
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, i); __PYX_ERR(24, 11, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_VARARGS(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(24, 11, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(24, 11, __pyx_L3_error)
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(24, 11, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(24, 11, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_triangulation = values[0];
    __pyx_v_longitude = values[1];
    __pyx_v_meridian = values[2];
    __pyx_v_togl_widget = values[3];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, __pyx_nargs); __PYX_ERR(24, 11, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("CyOpenGL.LabelSet.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_8LabelSet___init__(((struct __pyx_obj_8CyOpenGL_LabelSet *)__pyx_v_self), __pyx_v_triangulation, __pyx_v_longitude, __pyx_v_meridian, __pyx_v_togl_widget);

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

static int __pyx_pf_8CyOpenGL_8LabelSet___init__(struct __pyx_obj_8CyOpenGL_LabelSet *__pyx_v_self, PyObject *__pyx_v_triangulation, PyObject *__pyx_v_longitude, PyObject *__pyx_v_meridian, CYTHON_UNUSED PyObject *__pyx_v_togl_widget) {
  PyObject *__pyx_v_vertices = NULL;
  PyObject *__pyx_8genexpr7__pyx_v_D = NULL;
  PyObject *__pyx_8genexpr8__pyx_v_D = NULL;
  PyObject *__pyx_8genexpr9__pyx_v_D = NULL;
  PyObject *__pyx_9genexpr10__pyx_v_v = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  PyObject *(*__pyx_t_6)(PyObject *);
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  Py_ssize_t __pyx_t_11;
  int __pyx_t_12;
  int __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "opengl/legacy/label_set.pyx":12
 * 
 *     def __init__(self, triangulation, longitude, meridian, togl_widget=None):
 *         self.longitude, self.meridian = complex(longitude), complex(meridian)             # <<<<<<<<<<<<<<
 *         self.segments = [ Label(sum(D['endpoints'])/2, D['indices'][1])
 *                           for D in triangulation]
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_longitude};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(&PyComplex_Type), __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 12, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_4 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_meridian};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(&PyComplex_Type), __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(24, 12, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->longitude);
  __Pyx_DECREF(__pyx_v_self->longitude);
  __pyx_v_self->longitude = __pyx_t_1;
  __pyx_t_1 = 0;
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->meridian);
  __Pyx_DECREF(__pyx_v_self->meridian);
  __pyx_v_self->meridian = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "opengl/legacy/label_set.pyx":13
 *     def __init__(self, triangulation, longitude, meridian, togl_widget=None):
 *         self.longitude, self.meridian = complex(longitude), complex(meridian)
 *         self.segments = [ Label(sum(D['endpoints'])/2, D['indices'][1])             # <<<<<<<<<<<<<<
 *                           for D in triangulation]
 * 
*/
  { /* enter inner scope */
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(24, 13, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "opengl/legacy/label_set.pyx":14
 *         self.longitude, self.meridian = complex(longitude), complex(meridian)
 *         self.segments = [ Label(sum(D['endpoints'])/2, D['indices'][1])
 *                           for D in triangulation]             # <<<<<<<<<<<<<<
 * 
 *         vertices = [ (complex(D['endpoints'][0]), int(D['indices'][0]))
*/
    if (likely(PyList_CheckExact(__pyx_v_triangulation)) || PyTuple_CheckExact(__pyx_v_triangulation)) {
      __pyx_t_1 = __pyx_v_triangulation; __Pyx_INCREF(__pyx_t_1);
      __pyx_t_5 = 0;
      __pyx_t_6 = NULL;
    } else {
      __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_triangulation); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 14, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(24, 14, __pyx_L5_error)
    }
    for (;;) {
      if (likely(!__pyx_t_6)) {
        if (likely(PyList_CheckExact(__pyx_t_1))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(24, 14, __pyx_L5_error)
            #endif
            if (__pyx_t_5 >= __pyx_temp) break;
          }
          __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_5, __Pyx_ReferenceSharing_OwnStrongReference);
          ++__pyx_t_5;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(24, 14, __pyx_L5_error)
            #endif
            if (__pyx_t_5 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5));
          #else
          __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5);
          #endif
          ++__pyx_t_5;
        }
        if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 14, __pyx_L5_error)
      } else {
        __pyx_t_4 = __pyx_t_6(__pyx_t_1);
        if (unlikely(!__pyx_t_4)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(24, 14, __pyx_L5_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_XDECREF_SET(__pyx_8genexpr7__pyx_v_D, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "opengl/legacy/label_set.pyx":13
 *     def __init__(self, triangulation, longitude, meridian, togl_widget=None):
 *         self.longitude, self.meridian = complex(longitude), complex(meridian)
 *         self.segments = [ Label(sum(D['endpoints'])/2, D['indices'][1])             # <<<<<<<<<<<<<<
 *                           for D in triangulation]
 * 
*/
      __pyx_t_7 = NULL;
      __pyx_t_9 = NULL;
      __pyx_t_10 = __Pyx_PyObject_Dict_GetItem(__pyx_8genexpr7__pyx_v_D, __pyx_mstate_global->__pyx_n_u_endpoints); if (unlikely(!__pyx_t_10)) __PYX_ERR(24, 13, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_3 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_10};
        __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_sum, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (unlikely(!__pyx_t_8)) __PYX_ERR(24, 13, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_8);
      }
      __pyx_t_10 = __Pyx_PyLong_TrueDivideObjC(__pyx_t_8, __pyx_mstate_global->__pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(24, 13, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_8genexpr7__pyx_v_D, __pyx_mstate_global->__pyx_n_u_indices); if (unlikely(!__pyx_t_8)) __PYX_ERR(24, 13, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_8, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_9)) __PYX_ERR(24, 13, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_3 = 1;
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_t_10, __pyx_t_9};
        __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8CyOpenGL_Label, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 13, __pyx_L5_error)
        __Pyx_GOTREF((PyObject *)__pyx_t_4);
      }
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_4))) __PYX_ERR(24, 13, __pyx_L5_error)
      __Pyx_DECREF((PyObject *)__pyx_t_4); __pyx_t_4 = 0;

      /* "opengl/legacy/label_set.pyx":14
 *         self.longitude, self.meridian = complex(longitude), complex(meridian)
 *         self.segments = [ Label(sum(D['endpoints'])/2, D['indices'][1])
 *                           for D in triangulation]             # <<<<<<<<<<<<<<
 * 
 *         vertices = [ (complex(D['endpoints'][0]), int(D['indices'][0]))
*/
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_D); __pyx_8genexpr7__pyx_v_D = 0;
    goto __pyx_L9_exit_scope;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_D); __pyx_8genexpr7__pyx_v_D = 0;
    goto __pyx_L1_error;
    __pyx_L9_exit_scope:;
  } /* exit inner scope */

  /* "opengl/legacy/label_set.pyx":13
 *     def __init__(self, triangulation, longitude, meridian, togl_widget=None):
 *         self.longitude, self.meridian = complex(longitude), complex(meridian)
 *         self.segments = [ Label(sum(D['endpoints'])/2, D['indices'][1])             # <<<<<<<<<<<<<<
 *                           for D in triangulation]
 * 
*/
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->segments);
  __Pyx_DECREF(__pyx_v_self->segments);
  __pyx_v_self->segments = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "opengl/legacy/label_set.pyx":16
 *                           for D in triangulation]
 * 
 *         vertices = [ (complex(D['endpoints'][0]), int(D['indices'][0]))             # <<<<<<<<<<<<<<
 *                      for D in triangulation]
 *         vertices += [ (complex(D['endpoints'][1]), int(D['indices'][2]))
*/
  { /* enter inner scope */
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(24, 16, __pyx_L12_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "opengl/legacy/label_set.pyx":17
 * 
 *         vertices = [ (complex(D['endpoints'][0]), int(D['indices'][0]))
 *                      for D in triangulation]             # <<<<<<<<<<<<<<
 *         vertices += [ (complex(D['endpoints'][1]), int(D['indices'][2]))
 *                       for D in triangulation]
*/
    if (likely(PyList_CheckExact(__pyx_v_triangulation)) || PyTuple_CheckExact(__pyx_v_triangulation)) {
      __pyx_t_1 = __pyx_v_triangulation; __Pyx_INCREF(__pyx_t_1);
      __pyx_t_5 = 0;
      __pyx_t_6 = NULL;
    } else {
      __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_triangulation); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 17, __pyx_L12_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(24, 17, __pyx_L12_error)
    }
    for (;;) {
      if (likely(!__pyx_t_6)) {
        if (likely(PyList_CheckExact(__pyx_t_1))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(24, 17, __pyx_L12_error)
            #endif
            if (__pyx_t_5 >= __pyx_temp) break;
          }
          __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_5, __Pyx_ReferenceSharing_OwnStrongReference);
          ++__pyx_t_5;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(24, 17, __pyx_L12_error)
            #endif
            if (__pyx_t_5 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5));
          #else
          __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5);
          #endif
          ++__pyx_t_5;
        }
        if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 17, __pyx_L12_error)
      } else {
        __pyx_t_4 = __pyx_t_6(__pyx_t_1);
        if (unlikely(!__pyx_t_4)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(24, 17, __pyx_L12_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_XDECREF_SET(__pyx_8genexpr8__pyx_v_D, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "opengl/legacy/label_set.pyx":16
 *                           for D in triangulation]
 * 
 *         vertices = [ (complex(D['endpoints'][0]), int(D['indices'][0]))             # <<<<<<<<<<<<<<
 *                      for D in triangulation]
 *         vertices += [ (complex(D['endpoints'][1]), int(D['indices'][2]))
*/
      __pyx_t_9 = NULL;
      __pyx_t_10 = __Pyx_PyObject_Dict_GetItem(__pyx_8genexpr8__pyx_v_D, __pyx_mstate_global->__pyx_n_u_endpoints); if (unlikely(!__pyx_t_10)) __PYX_ERR(24, 16, __pyx_L12_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_10, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_7)) __PYX_ERR(24, 16, __pyx_L12_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_3 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_7};
        __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)(&PyComplex_Type), __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 16, __pyx_L12_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      __pyx_t_7 = __Pyx_PyObject_Dict_GetItem(__pyx_8genexpr8__pyx_v_D, __pyx_mstate_global->__pyx_n_u_indices); if (unlikely(!__pyx_t_7)) __PYX_ERR(24, 16, __pyx_L12_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_7, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_9)) __PYX_ERR(24, 16, __pyx_L12_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyNumber_Int(__pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(24, 16, __pyx_L12_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(24, 16, __pyx_L12_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_GIVEREF(__pyx_t_4);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_4) != (0)) __PYX_ERR(24, 16, __pyx_L12_error);
      __Pyx_GIVEREF(__pyx_t_7);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_7) != (0)) __PYX_ERR(24, 16, __pyx_L12_error);
      __pyx_t_4 = 0;
      __pyx_t_7 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_9))) __PYX_ERR(24, 16, __pyx_L12_error)
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

      /* "opengl/legacy/label_set.pyx":17
 * 
 *         vertices = [ (complex(D['endpoints'][0]), int(D['indices'][0]))
 *                      for D in triangulation]             # <<<<<<<<<<<<<<
 *         vertices += [ (complex(D['endpoints'][1]), int(D['indices'][2]))
 *                       for D in triangulation]
*/
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_D); __pyx_8genexpr8__pyx_v_D = 0;
    goto __pyx_L16_exit_scope;
    __pyx_L12_error:;
    __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_D); __pyx_8genexpr8__pyx_v_D = 0;
    goto __pyx_L1_error;
    __pyx_L16_exit_scope:;
  } /* exit inner scope */
  __pyx_v_vertices = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "opengl/legacy/label_set.pyx":18
 *         vertices = [ (complex(D['endpoints'][0]), int(D['indices'][0]))
 *                      for D in triangulation]
 *         vertices += [ (complex(D['endpoints'][1]), int(D['indices'][2]))             # <<<<<<<<<<<<<<
 *                       for D in triangulation]
 *         self.vertices = [Label(*v) for v in set(vertices)]
*/
  { /* enter inner scope */
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(24, 18, __pyx_L19_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "opengl/legacy/label_set.pyx":19
 *                      for D in triangulation]
 *         vertices += [ (complex(D['endpoints'][1]), int(D['indices'][2]))
 *                       for D in triangulation]             # <<<<<<<<<<<<<<
 *         self.vertices = [Label(*v) for v in set(vertices)]
 * 
*/
    if (likely(PyList_CheckExact(__pyx_v_triangulation)) || PyTuple_CheckExact(__pyx_v_triangulation)) {
      __pyx_t_1 = __pyx_v_triangulation; __Pyx_INCREF(__pyx_t_1);
      __pyx_t_5 = 0;
      __pyx_t_6 = NULL;
    } else {
      __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_triangulation); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 19, __pyx_L19_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(24, 19, __pyx_L19_error)
    }
    for (;;) {
      if (likely(!__pyx_t_6)) {
        if (likely(PyList_CheckExact(__pyx_t_1))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(24, 19, __pyx_L19_error)
            #endif
            if (__pyx_t_5 >= __pyx_temp) break;
          }
          __pyx_t_9 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_5, __Pyx_ReferenceSharing_OwnStrongReference);
          ++__pyx_t_5;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(24, 19, __pyx_L19_error)
            #endif
            if (__pyx_t_5 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_9 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5));
          #else
          __pyx_t_9 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5);
          #endif
          ++__pyx_t_5;
        }
        if (unlikely(!__pyx_t_9)) __PYX_ERR(24, 19, __pyx_L19_error)
      } else {
        __pyx_t_9 = __pyx_t_6(__pyx_t_1);
        if (unlikely(!__pyx_t_9)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(24, 19, __pyx_L19_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_XDECREF_SET(__pyx_8genexpr9__pyx_v_D, __pyx_t_9);
      __pyx_t_9 = 0;

      /* "opengl/legacy/label_set.pyx":18
 *         vertices = [ (complex(D['endpoints'][0]), int(D['indices'][0]))
 *                      for D in triangulation]
 *         vertices += [ (complex(D['endpoints'][1]), int(D['indices'][2]))             # <<<<<<<<<<<<<<
 *                       for D in triangulation]
 *         self.vertices = [Label(*v) for v in set(vertices)]
*/
      __pyx_t_7 = NULL;
      __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_8genexpr9__pyx_v_D, __pyx_mstate_global->__pyx_n_u_endpoints); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 18, __pyx_L19_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_10 = __Pyx_GetItemInt(__pyx_t_4, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_10)) __PYX_ERR(24, 18, __pyx_L19_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_3 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_10};
        __pyx_t_9 = __Pyx_PyObject_FastCall((PyObject*)(&PyComplex_Type), __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (unlikely(!__pyx_t_9)) __PYX_ERR(24, 18, __pyx_L19_error)
        __Pyx_GOTREF(__pyx_t_9);
      }
      __pyx_t_10 = __Pyx_PyObject_Dict_GetItem(__pyx_8genexpr9__pyx_v_D, __pyx_mstate_global->__pyx_n_u_indices); if (unlikely(!__pyx_t_10)) __PYX_ERR(24, 18, __pyx_L19_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_10, 2, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_7)) __PYX_ERR(24, 18, __pyx_L19_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = __Pyx_PyNumber_Int(__pyx_t_7); if (unlikely(!__pyx_t_10)) __PYX_ERR(24, 18, __pyx_L19_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(24, 18, __pyx_L19_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_9);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_9) != (0)) __PYX_ERR(24, 18, __pyx_L19_error);
      __Pyx_GIVEREF(__pyx_t_10);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_10) != (0)) __PYX_ERR(24, 18, __pyx_L19_error);
      __pyx_t_9 = 0;
      __pyx_t_10 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_7))) __PYX_ERR(24, 18, __pyx_L19_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "opengl/legacy/label_set.pyx":19
 *                      for D in triangulation]
 *         vertices += [ (complex(D['endpoints'][1]), int(D['indices'][2]))
 *                       for D in triangulation]             # <<<<<<<<<<<<<<
 *         self.vertices = [Label(*v) for v in set(vertices)]
 * 
*/
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_D); __pyx_8genexpr9__pyx_v_D = 0;
    goto __pyx_L23_exit_scope;
    __pyx_L19_error:;
    __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_D); __pyx_8genexpr9__pyx_v_D = 0;
    goto __pyx_L1_error;
    __pyx_L23_exit_scope:;
  } /* exit inner scope */

  /* "opengl/legacy/label_set.pyx":18
 *         vertices = [ (complex(D['endpoints'][0]), int(D['indices'][0]))
 *                      for D in triangulation]
 *         vertices += [ (complex(D['endpoints'][1]), int(D['indices'][2]))             # <<<<<<<<<<<<<<
 *                       for D in triangulation]
 *         self.vertices = [Label(*v) for v in set(vertices)]
*/
  __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_vertices, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF_SET(__pyx_v_vertices, ((PyObject*)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "opengl/legacy/label_set.pyx":20
 *         vertices += [ (complex(D['endpoints'][1]), int(D['indices'][2]))
 *                       for D in triangulation]
 *         self.vertices = [Label(*v) for v in set(vertices)]             # <<<<<<<<<<<<<<
 * 
 *     def draw(self, shifts):
*/
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 20, __pyx_L26_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = 0;
    __pyx_t_7 = PySet_New(__pyx_v_vertices); if (unlikely(!__pyx_t_7)) __PYX_ERR(24, 20, __pyx_L26_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_10 = __Pyx_set_iterator(__pyx_t_7, 1, (&__pyx_t_11), (&__pyx_t_12)); if (unlikely(!__pyx_t_10)) __PYX_ERR(24, 20, __pyx_L26_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_2);
    __pyx_t_2 = __pyx_t_10;
    __pyx_t_10 = 0;
    while (1) {
      __pyx_t_13 = __Pyx_set_iter_next(__pyx_t_2, __pyx_t_11, &__pyx_t_5, &__pyx_t_10, __pyx_t_12);
      if (unlikely(__pyx_t_13 == 0)) break;
      if (unlikely(__pyx_t_13 == -1)) __PYX_ERR(24, 20, __pyx_L26_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_XDECREF_SET(__pyx_9genexpr10__pyx_v_v, __pyx_t_10);
      __pyx_t_10 = 0;
      __pyx_t_10 = __Pyx_PySequence_Tuple(__pyx_9genexpr10__pyx_v_v); if (unlikely(!__pyx_t_10)) __PYX_ERR(24, 20, __pyx_L26_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_mstate_global->__pyx_ptype_8CyOpenGL_Label), __pyx_t_10, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(24, 20, __pyx_L26_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_7))) __PYX_ERR(24, 20, __pyx_L26_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_9genexpr10__pyx_v_v); __pyx_9genexpr10__pyx_v_v = 0;
    goto __pyx_L29_exit_scope;
    __pyx_L26_error:;
    __Pyx_XDECREF(__pyx_9genexpr10__pyx_v_v); __pyx_9genexpr10__pyx_v_v = 0;
    goto __pyx_L1_error;
    __pyx_L29_exit_scope:;
  } /* exit inner scope */
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->vertices);
  __Pyx_DECREF(__pyx_v_self->vertices);
  __pyx_v_self->vertices = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "opengl/legacy/label_set.pyx":11
 *     cdef int width, height
 * 
 *     def __init__(self, triangulation, longitude, meridian, togl_widget=None):             # <<<<<<<<<<<<<<
 *         self.longitude, self.meridian = complex(longitude), complex(meridian)
 *         self.segments = [ Label(sum(D['endpoints'])/2, D['indices'][1])
*/

  /* 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_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("CyOpenGL.LabelSet.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_vertices);
  __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_D);
  __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_D);
  __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_D);
  __Pyx_XDECREF(__pyx_9genexpr10__pyx_v_v);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opengl/legacy/label_set.pyx":22
 *         self.vertices = [Label(*v) for v in set(vertices)]
 * 
 *     def draw(self, shifts):             # <<<<<<<<<<<<<<
 *         glRasterPos3f(0.0, 0.0, 0.0)
 *         for M, L in shifts:
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_8LabelSet_3draw(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_8LabelSet_2draw, "LabelSet.draw(self, shifts)");
static PyMethodDef __pyx_mdef_8CyOpenGL_8LabelSet_3draw = {"draw", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_8LabelSet_3draw, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_8LabelSet_2draw};
static PyObject *__pyx_pw_8CyOpenGL_8LabelSet_3draw(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_shifts = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("draw (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_shifts,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(24, 22, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(24, 22, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "draw", 0) < (0)) __PYX_ERR(24, 22, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("draw", 1, 1, 1, i); __PYX_ERR(24, 22, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(24, 22, __pyx_L3_error)
    }
    __pyx_v_shifts = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("draw", 1, 1, 1, __pyx_nargs); __PYX_ERR(24, 22, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("CyOpenGL.LabelSet.draw", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_8LabelSet_2draw(((struct __pyx_obj_8CyOpenGL_LabelSet *)__pyx_v_self), __pyx_v_shifts);

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

static PyObject *__pyx_pf_8CyOpenGL_8LabelSet_2draw(struct __pyx_obj_8CyOpenGL_LabelSet *__pyx_v_self, PyObject *__pyx_v_shifts) {
  PyObject *__pyx_v_M = NULL;
  PyObject *__pyx_v_L = NULL;
  PyObject *__pyx_v_disp = NULL;
  PyObject *__pyx_v_labels = NULL;
  PyObject *__pyx_v_label = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *(*__pyx_t_8)(PyObject *);
  GLfloat __pyx_t_9;
  GLfloat __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  PyObject *(*__pyx_t_13)(PyObject *);
  size_t __pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("draw", 0);

  /* "opengl/legacy/label_set.pyx":23
 * 
 *     def draw(self, shifts):
 *         glRasterPos3f(0.0, 0.0, 0.0)             # <<<<<<<<<<<<<<
 *         for M, L in shifts:
 *             disp = M*self.meridian + L*self.longitude
*/
  glRasterPos3f(0.0, 0.0, 0.0);

  /* "opengl/legacy/label_set.pyx":24
 *     def draw(self, shifts):
 *         glRasterPos3f(0.0, 0.0, 0.0)
 *         for M, L in shifts:             # <<<<<<<<<<<<<<
 *             disp = M*self.meridian + L*self.longitude
 *             glPushMatrix()
*/
  if (likely(PyList_CheckExact(__pyx_v_shifts)) || PyTuple_CheckExact(__pyx_v_shifts)) {
    __pyx_t_1 = __pyx_v_shifts; __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_shifts); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 24, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(24, 24, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(24, 24, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference);
        ++__pyx_t_2;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(24, 24, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2));
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2);
        #endif
        ++__pyx_t_2;
      }
      if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 24, __pyx_L1_error)
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(24, 24, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __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(24, 24, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0);
        __Pyx_INCREF(__pyx_t_5);
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_6);
      } else {
        __pyx_t_5 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 24, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_5);
        __pyx_t_6 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_6)) __PYX_ERR(24, 24, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_6);
      }
      #else
      __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 24, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(24, 24, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      #endif
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_7 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(24, 24, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_7);
      index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_5);
      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(24, 24, __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(24, 24, __pyx_L1_error)
      __pyx_L6_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_M, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_XDECREF_SET(__pyx_v_L, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "opengl/legacy/label_set.pyx":25
 *         glRasterPos3f(0.0, 0.0, 0.0)
 *         for M, L in shifts:
 *             disp = M*self.meridian + L*self.longitude             # <<<<<<<<<<<<<<
 *             glPushMatrix()
 *             glTranslatef(disp.real, disp.imag, 0.0)
*/
    __pyx_t_4 = PyNumber_Multiply(__pyx_v_M, __pyx_v_self->meridian); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 25, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = PyNumber_Multiply(__pyx_v_L, __pyx_v_self->longitude); if (unlikely(!__pyx_t_6)) __PYX_ERR(24, 25, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 25, __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;
    __Pyx_XDECREF_SET(__pyx_v_disp, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "opengl/legacy/label_set.pyx":26
 *         for M, L in shifts:
 *             disp = M*self.meridian + L*self.longitude
 *             glPushMatrix()             # <<<<<<<<<<<<<<
 *             glTranslatef(disp.real, disp.imag, 0.0)
 *             for labels in (self.segments, self.vertices):
*/
    glPushMatrix();

    /* "opengl/legacy/label_set.pyx":27
 *             disp = M*self.meridian + L*self.longitude
 *             glPushMatrix()
 *             glTranslatef(disp.real, disp.imag, 0.0)             # <<<<<<<<<<<<<<
 *             for labels in (self.segments, self.vertices):
 *                 for label in labels:
*/
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_disp, __pyx_mstate_global->__pyx_n_u_real); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 27, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_9 = __Pyx_PyFloat_AsFloat(__pyx_t_5); if (unlikely((__pyx_t_9 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(24, 27, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_disp, __pyx_mstate_global->__pyx_n_u_imag); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 27, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_10 = __Pyx_PyFloat_AsFloat(__pyx_t_5); if (unlikely((__pyx_t_10 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(24, 27, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    glTranslatef(__pyx_t_9, __pyx_t_10, 0.0);

    /* "opengl/legacy/label_set.pyx":28
 *             glPushMatrix()
 *             glTranslatef(disp.real, disp.imag, 0.0)
 *             for labels in (self.segments, self.vertices):             # <<<<<<<<<<<<<<
 *                 for label in labels:
 *                     label.draw()
*/
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 28, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_self->segments);
    __Pyx_GIVEREF(__pyx_v_self->segments);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_self->segments) != (0)) __PYX_ERR(24, 28, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_self->vertices);
    __Pyx_GIVEREF(__pyx_v_self->vertices);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_self->vertices) != (0)) __PYX_ERR(24, 28, __pyx_L1_error);
    __pyx_t_6 = __pyx_t_5; __Pyx_INCREF(__pyx_t_6);
    __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    for (;;) {
      if (__pyx_t_11 >= 2) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_5 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_11));
      #else
      __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_11);
      #endif
      ++__pyx_t_11;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 28, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_XDECREF_SET(__pyx_v_labels, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "opengl/legacy/label_set.pyx":29
 *             glTranslatef(disp.real, disp.imag, 0.0)
 *             for labels in (self.segments, self.vertices):
 *                 for label in labels:             # <<<<<<<<<<<<<<
 *                     label.draw()
 *             glPopMatrix()
*/
      if (likely(PyList_CheckExact(__pyx_v_labels)) || PyTuple_CheckExact(__pyx_v_labels)) {
        __pyx_t_5 = __pyx_v_labels; __Pyx_INCREF(__pyx_t_5);
        __pyx_t_12 = 0;
        __pyx_t_13 = NULL;
      } else {
        __pyx_t_12 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_labels); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 29, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_13 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_13)) __PYX_ERR(24, 29, __pyx_L1_error)
      }
      for (;;) {
        if (likely(!__pyx_t_13)) {
          if (likely(PyList_CheckExact(__pyx_t_5))) {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_5);
              #if !CYTHON_ASSUME_SAFE_SIZE
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(24, 29, __pyx_L1_error)
              #endif
              if (__pyx_t_12 >= __pyx_temp) break;
            }
            __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_5, __pyx_t_12, __Pyx_ReferenceSharing_OwnStrongReference);
            ++__pyx_t_12;
          } else {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_5);
              #if !CYTHON_ASSUME_SAFE_SIZE
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(24, 29, __pyx_L1_error)
              #endif
              if (__pyx_t_12 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_12));
            #else
            __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_12);
            #endif
            ++__pyx_t_12;
          }
          if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 29, __pyx_L1_error)
        } else {
          __pyx_t_4 = __pyx_t_13(__pyx_t_5);
          if (unlikely(!__pyx_t_4)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(24, 29, __pyx_L1_error)
              PyErr_Clear();
            }
            break;
          }
        }
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_XDECREF_SET(__pyx_v_label, __pyx_t_4);
        __pyx_t_4 = 0;

        /* "opengl/legacy/label_set.pyx":30
 *             for labels in (self.segments, self.vertices):
 *                 for label in labels:
 *                     label.draw()             # <<<<<<<<<<<<<<
 *             glPopMatrix()
*/
        __pyx_t_7 = __pyx_v_label;
        __Pyx_INCREF(__pyx_t_7);
        __pyx_t_14 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
          __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_draw, __pyx_callargs+__pyx_t_14, (1-__pyx_t_14) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 30, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
        }
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "opengl/legacy/label_set.pyx":29
 *             glTranslatef(disp.real, disp.imag, 0.0)
 *             for labels in (self.segments, self.vertices):
 *                 for label in labels:             # <<<<<<<<<<<<<<
 *                     label.draw()
 *             glPopMatrix()
*/
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "opengl/legacy/label_set.pyx":28
 *             glPushMatrix()
 *             glTranslatef(disp.real, disp.imag, 0.0)
 *             for labels in (self.segments, self.vertices):             # <<<<<<<<<<<<<<
 *                 for label in labels:
 *                     label.draw()
*/
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "opengl/legacy/label_set.pyx":31
 *                 for label in labels:
 *                     label.draw()
 *             glPopMatrix()             # <<<<<<<<<<<<<<
*/
    glPopMatrix();

    /* "opengl/legacy/label_set.pyx":24
 *     def draw(self, shifts):
 *         glRasterPos3f(0.0, 0.0, 0.0)
 *         for M, L in shifts:             # <<<<<<<<<<<<<<
 *             disp = M*self.meridian + L*self.longitude
 *             glPushMatrix()
*/
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/legacy/label_set.pyx":22
 *         self.vertices = [Label(*v) for v in set(vertices)]
 * 
 *     def draw(self, shifts):             # <<<<<<<<<<<<<<
 *         glRasterPos3f(0.0, 0.0, 0.0)
 *         for M, L in shifts:
*/

  /* 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_AddTraceback("CyOpenGL.LabelSet.draw", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_M);
  __Pyx_XDECREF(__pyx_v_L);
  __Pyx_XDECREF(__pyx_v_disp);
  __Pyx_XDECREF(__pyx_v_labels);
  __Pyx_XDECREF(__pyx_v_label);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opengl/legacy/horoball_scene.pyx":18
 *     cdef togl_widget
 * 
 *     def __init__(self, nbhd, pgram_var, Ford_var, tri_var, horo_var, label_var,             # <<<<<<<<<<<<<<
 *                  flipped=False, cutoff=0.1, which_cusp=0, togl_widget=None):
 *         self.nbhd = nbhd
*/

/* Python wrapper */
static int __pyx_pw_8CyOpenGL_13HoroballScene_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_8CyOpenGL_13HoroballScene_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_nbhd = 0;
  PyObject *__pyx_v_pgram_var = 0;
  PyObject *__pyx_v_Ford_var = 0;
  PyObject *__pyx_v_tri_var = 0;
  PyObject *__pyx_v_horo_var = 0;
  PyObject *__pyx_v_label_var = 0;
  PyObject *__pyx_v_flipped = 0;
  PyObject *__pyx_v_cutoff = 0;
  PyObject *__pyx_v_which_cusp = 0;
  PyObject *__pyx_v_togl_widget = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_nbhd,&__pyx_mstate_global->__pyx_n_u_pgram_var,&__pyx_mstate_global->__pyx_n_u_Ford_var,&__pyx_mstate_global->__pyx_n_u_tri_var,&__pyx_mstate_global->__pyx_n_u_horo_var,&__pyx_mstate_global->__pyx_n_u_label_var,&__pyx_mstate_global->__pyx_n_u_flipped,&__pyx_mstate_global->__pyx_n_u_cutoff,&__pyx_mstate_global->__pyx_n_u_which_cusp,&__pyx_mstate_global->__pyx_n_u_togl_widget,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(25, 18, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 10:
        values[9] = __Pyx_ArgRef_VARARGS(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(25, 18, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_VARARGS(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(25, 18, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_VARARGS(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(25, 18, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_VARARGS(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(25, 18, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_VARARGS(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(25, 18, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_VARARGS(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(25, 18, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_VARARGS(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(25, 18, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(25, 18, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(25, 18, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(25, 18, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(25, 18, __pyx_L3_error)

      /* "opengl/legacy/horoball_scene.pyx":19
 * 
 *     def __init__(self, nbhd, pgram_var, Ford_var, tri_var, horo_var, label_var,
 *                  flipped=False, cutoff=0.1, which_cusp=0, togl_widget=None):             # <<<<<<<<<<<<<<
 *         self.nbhd = nbhd
 *         self.which_cusp = which_cusp
*/
      if (!values[6]) values[6] = __Pyx_NewRef(((PyObject *)Py_False));
      if (!values[7]) values[7] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_float_0_1));
      if (!values[8]) values[8] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
      if (!values[9]) values[9] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 6; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 10, i); __PYX_ERR(25, 18, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case 10:
        values[9] = __Pyx_ArgRef_VARARGS(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(25, 18, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_VARARGS(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(25, 18, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_VARARGS(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(25, 18, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_VARARGS(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(25, 18, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_VARARGS(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(25, 18, __pyx_L3_error)
        values[4] = __Pyx_ArgRef_VARARGS(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(25, 18, __pyx_L3_error)
        values[3] = __Pyx_ArgRef_VARARGS(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(25, 18, __pyx_L3_error)
        values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(25, 18, __pyx_L3_error)
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(25, 18, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(25, 18, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[6]) values[6] = __Pyx_NewRef(((PyObject *)Py_False));
      if (!values[7]) values[7] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_float_0_1));
      if (!values[8]) values[8] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
      if (!values[9]) values[9] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_nbhd = values[0];
    __pyx_v_pgram_var = values[1];
    __pyx_v_Ford_var = values[2];
    __pyx_v_tri_var = values[3];
    __pyx_v_horo_var = values[4];
    __pyx_v_label_var = values[5];
    __pyx_v_flipped = values[6];
    __pyx_v_cutoff = values[7];
    __pyx_v_which_cusp = values[8];
    __pyx_v_togl_widget = values[9];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 10, __pyx_nargs); __PYX_ERR(25, 18, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("CyOpenGL.HoroballScene.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_13HoroballScene___init__(((struct __pyx_obj_8CyOpenGL_HoroballScene *)__pyx_v_self), __pyx_v_nbhd, __pyx_v_pgram_var, __pyx_v_Ford_var, __pyx_v_tri_var, __pyx_v_horo_var, __pyx_v_label_var, __pyx_v_flipped, __pyx_v_cutoff, __pyx_v_which_cusp, __pyx_v_togl_widget);

  /* "opengl/legacy/horoball_scene.pyx":18
 *     cdef togl_widget
 * 
 *     def __init__(self, nbhd, pgram_var, Ford_var, tri_var, horo_var, label_var,             # <<<<<<<<<<<<<<
 *                  flipped=False, cutoff=0.1, which_cusp=0, togl_widget=None):
 *         self.nbhd = nbhd
*/

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

static int __pyx_pf_8CyOpenGL_13HoroballScene___init__(struct __pyx_obj_8CyOpenGL_HoroballScene *__pyx_v_self, PyObject *__pyx_v_nbhd, PyObject *__pyx_v_pgram_var, PyObject *__pyx_v_Ford_var, PyObject *__pyx_v_tri_var, PyObject *__pyx_v_horo_var, PyObject *__pyx_v_label_var, PyObject *__pyx_v_flipped, PyObject *__pyx_v_cutoff, PyObject *__pyx_v_which_cusp, PyObject *__pyx_v_togl_widget) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  double __pyx_t_3;
  double __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "opengl/legacy/horoball_scene.pyx":20
 *     def __init__(self, nbhd, pgram_var, Ford_var, tri_var, horo_var, label_var,
 *                  flipped=False, cutoff=0.1, which_cusp=0, togl_widget=None):
 *         self.nbhd = nbhd             # <<<<<<<<<<<<<<
 *         self.which_cusp = which_cusp
 *         self.flipped = flipped
*/
  __Pyx_INCREF(__pyx_v_nbhd);
  __Pyx_GIVEREF(__pyx_v_nbhd);
  __Pyx_GOTREF(__pyx_v_self->nbhd);
  __Pyx_DECREF(__pyx_v_self->nbhd);
  __pyx_v_self->nbhd = __pyx_v_nbhd;

  /* "opengl/legacy/horoball_scene.pyx":21
 *                  flipped=False, cutoff=0.1, which_cusp=0, togl_widget=None):
 *         self.nbhd = nbhd
 *         self.which_cusp = which_cusp             # <<<<<<<<<<<<<<
 *         self.flipped = flipped
 *         self.tri_var = tri_var
*/
  __pyx_t_1 = __Pyx_PyLong_As_int(__pyx_v_which_cusp); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(25, 21, __pyx_L1_error)
  __pyx_v_self->which_cusp = __pyx_t_1;

  /* "opengl/legacy/horoball_scene.pyx":22
 *         self.nbhd = nbhd
 *         self.which_cusp = which_cusp
 *         self.flipped = flipped             # <<<<<<<<<<<<<<
 *         self.tri_var = tri_var
 *         self.Ford_var = Ford_var
*/
  __Pyx_INCREF(__pyx_v_flipped);
  __Pyx_GIVEREF(__pyx_v_flipped);
  __Pyx_GOTREF(__pyx_v_self->flipped);
  __Pyx_DECREF(__pyx_v_self->flipped);
  __pyx_v_self->flipped = __pyx_v_flipped;

  /* "opengl/legacy/horoball_scene.pyx":23
 *         self.which_cusp = which_cusp
 *         self.flipped = flipped
 *         self.tri_var = tri_var             # <<<<<<<<<<<<<<
 *         self.Ford_var = Ford_var
 *         self.pgram_var = pgram_var
*/
  __Pyx_INCREF(__pyx_v_tri_var);
  __Pyx_GIVEREF(__pyx_v_tri_var);
  __Pyx_GOTREF(__pyx_v_self->tri_var);
  __Pyx_DECREF(__pyx_v_self->tri_var);
  __pyx_v_self->tri_var = __pyx_v_tri_var;

  /* "opengl/legacy/horoball_scene.pyx":24
 *         self.flipped = flipped
 *         self.tri_var = tri_var
 *         self.Ford_var = Ford_var             # <<<<<<<<<<<<<<
 *         self.pgram_var = pgram_var
 *         self.horo_var = horo_var
*/
  __Pyx_INCREF(__pyx_v_Ford_var);
  __Pyx_GIVEREF(__pyx_v_Ford_var);
  __Pyx_GOTREF(__pyx_v_self->Ford_var);
  __Pyx_DECREF(__pyx_v_self->Ford_var);
  __pyx_v_self->Ford_var = __pyx_v_Ford_var;

  /* "opengl/legacy/horoball_scene.pyx":25
 *         self.tri_var = tri_var
 *         self.Ford_var = Ford_var
 *         self.pgram_var = pgram_var             # <<<<<<<<<<<<<<
 *         self.horo_var = horo_var
 *         self.label_var = label_var
*/
  __Pyx_INCREF(__pyx_v_pgram_var);
  __Pyx_GIVEREF(__pyx_v_pgram_var);
  __Pyx_GOTREF(__pyx_v_self->pgram_var);
  __Pyx_DECREF(__pyx_v_self->pgram_var);
  __pyx_v_self->pgram_var = __pyx_v_pgram_var;

  /* "opengl/legacy/horoball_scene.pyx":26
 *         self.Ford_var = Ford_var
 *         self.pgram_var = pgram_var
 *         self.horo_var = horo_var             # <<<<<<<<<<<<<<
 *         self.label_var = label_var
 *         self.offset = 0.0j
*/
  __Pyx_INCREF(__pyx_v_horo_var);
  __Pyx_GIVEREF(__pyx_v_horo_var);
  __Pyx_GOTREF(__pyx_v_self->horo_var);
  __Pyx_DECREF(__pyx_v_self->horo_var);
  __pyx_v_self->horo_var = __pyx_v_horo_var;

  /* "opengl/legacy/horoball_scene.pyx":27
 *         self.pgram_var = pgram_var
 *         self.horo_var = horo_var
 *         self.label_var = label_var             # <<<<<<<<<<<<<<
 *         self.offset = 0.0j
 *         self.Xangle, self.Yangle = 0.0, 0.0
*/
  __Pyx_INCREF(__pyx_v_label_var);
  __Pyx_GIVEREF(__pyx_v_label_var);
  __Pyx_GOTREF(__pyx_v_self->label_var);
  __Pyx_DECREF(__pyx_v_self->label_var);
  __pyx_v_self->label_var = __pyx_v_label_var;

  /* "opengl/legacy/horoball_scene.pyx":28
 *         self.horo_var = horo_var
 *         self.label_var = label_var
 *         self.offset = 0.0j             # <<<<<<<<<<<<<<
 *         self.Xangle, self.Yangle = 0.0, 0.0
 *         self.set_cutoff(cutoff)
*/
  __pyx_t_2 = PyComplex_FromDoubles(0.0, 0.0); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->offset);
  __Pyx_DECREF(__pyx_v_self->offset);
  __pyx_v_self->offset = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "opengl/legacy/horoball_scene.pyx":29
 *         self.label_var = label_var
 *         self.offset = 0.0j
 *         self.Xangle, self.Yangle = 0.0, 0.0             # <<<<<<<<<<<<<<
 *         self.set_cutoff(cutoff)
 *         self.pgram = Parallelogram()
*/
  __pyx_t_3 = 0.0;
  __pyx_t_4 = 0.0;
  __pyx_v_self->Xangle = __pyx_t_3;
  __pyx_v_self->Yangle = __pyx_t_4;

  /* "opengl/legacy/horoball_scene.pyx":30
 *         self.offset = 0.0j
 *         self.Xangle, self.Yangle = 0.0, 0.0
 *         self.set_cutoff(cutoff)             # <<<<<<<<<<<<<<
 *         self.pgram = Parallelogram()
 *         self.togl_widget = togl_widget
*/
  __pyx_t_5 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_cutoff};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_set_cutoff, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 30, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opengl/legacy/horoball_scene.pyx":31
 *         self.Xangle, self.Yangle = 0.0, 0.0
 *         self.set_cutoff(cutoff)
 *         self.pgram = Parallelogram()             # <<<<<<<<<<<<<<
 *         self.togl_widget = togl_widget
 *         self.build_scene()
*/
  __pyx_t_5 = NULL;
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8CyOpenGL_Parallelogram, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 31, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_2);
  }
  __Pyx_GIVEREF((PyObject *)__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->pgram);
  __Pyx_DECREF(__pyx_v_self->pgram);
  __pyx_v_self->pgram = ((PyObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "opengl/legacy/horoball_scene.pyx":32
 *         self.set_cutoff(cutoff)
 *         self.pgram = Parallelogram()
 *         self.togl_widget = togl_widget             # <<<<<<<<<<<<<<
 *         self.build_scene()
 * 
*/
  __Pyx_INCREF(__pyx_v_togl_widget);
  __Pyx_GIVEREF(__pyx_v_togl_widget);
  __Pyx_GOTREF(__pyx_v_self->togl_widget);
  __Pyx_DECREF(__pyx_v_self->togl_widget);
  __pyx_v_self->togl_widget = __pyx_v_togl_widget;

  /* "opengl/legacy/horoball_scene.pyx":33
 *         self.pgram = Parallelogram()
 *         self.togl_widget = togl_widget
 *         self.build_scene()             # <<<<<<<<<<<<<<
 * 
 *     def set_cutoff(self, cutoff):
*/
  __pyx_t_5 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_build_scene, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 33, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opengl/legacy/horoball_scene.pyx":18
 *     cdef togl_widget
 * 
 *     def __init__(self, nbhd, pgram_var, Ford_var, tri_var, horo_var, label_var,             # <<<<<<<<<<<<<<
 *                  flipped=False, cutoff=0.1, which_cusp=0, togl_widget=None):
 *         self.nbhd = nbhd
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("CyOpenGL.HoroballScene.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opengl/legacy/horoball_scene.pyx":35
 *         self.build_scene()
 * 
 *     def set_cutoff(self, cutoff):             # <<<<<<<<<<<<<<
 *         self.cutoff = cutoff
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_13HoroballScene_3set_cutoff(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_13HoroballScene_2set_cutoff, "HoroballScene.set_cutoff(self, cutoff)");
static PyMethodDef __pyx_mdef_8CyOpenGL_13HoroballScene_3set_cutoff = {"set_cutoff", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_13HoroballScene_3set_cutoff, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_13HoroballScene_2set_cutoff};
static PyObject *__pyx_pw_8CyOpenGL_13HoroballScene_3set_cutoff(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_cutoff = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_cutoff (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_cutoff,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(25, 35, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(25, 35, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "set_cutoff", 0) < (0)) __PYX_ERR(25, 35, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("set_cutoff", 1, 1, 1, i); __PYX_ERR(25, 35, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(25, 35, __pyx_L3_error)
    }
    __pyx_v_cutoff = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_cutoff", 1, 1, 1, __pyx_nargs); __PYX_ERR(25, 35, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("CyOpenGL.HoroballScene.set_cutoff", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_13HoroballScene_2set_cutoff(((struct __pyx_obj_8CyOpenGL_HoroballScene *)__pyx_v_self), __pyx_v_cutoff);

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

static PyObject *__pyx_pf_8CyOpenGL_13HoroballScene_2set_cutoff(struct __pyx_obj_8CyOpenGL_HoroballScene *__pyx_v_self, PyObject *__pyx_v_cutoff) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  double __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_cutoff", 0);

  /* "opengl/legacy/horoball_scene.pyx":36
 * 
 *     def set_cutoff(self, cutoff):
 *         self.cutoff = cutoff             # <<<<<<<<<<<<<<
 * 
 *     def flip(self, boolean_value):
*/
  __pyx_t_1 = __Pyx_PyFloat_AsDouble(__pyx_v_cutoff); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(25, 36, __pyx_L1_error)
  __pyx_v_self->cutoff = __pyx_t_1;

  /* "opengl/legacy/horoball_scene.pyx":35
 *         self.build_scene()
 * 
 *     def set_cutoff(self, cutoff):             # <<<<<<<<<<<<<<
 *         self.cutoff = cutoff
 * 
*/

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

/* "opengl/legacy/horoball_scene.pyx":38
 *         self.cutoff = cutoff
 * 
 *     def flip(self, boolean_value):             # <<<<<<<<<<<<<<
 *         self.flipped = boolean_value
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_13HoroballScene_5flip(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_13HoroballScene_4flip, "HoroballScene.flip(self, boolean_value)");
static PyMethodDef __pyx_mdef_8CyOpenGL_13HoroballScene_5flip = {"flip", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_13HoroballScene_5flip, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_13HoroballScene_4flip};
static PyObject *__pyx_pw_8CyOpenGL_13HoroballScene_5flip(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_boolean_value = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("flip (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_boolean_value,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(25, 38, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(25, 38, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "flip", 0) < (0)) __PYX_ERR(25, 38, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("flip", 1, 1, 1, i); __PYX_ERR(25, 38, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(25, 38, __pyx_L3_error)
    }
    __pyx_v_boolean_value = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("flip", 1, 1, 1, __pyx_nargs); __PYX_ERR(25, 38, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("CyOpenGL.HoroballScene.flip", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_13HoroballScene_4flip(((struct __pyx_obj_8CyOpenGL_HoroballScene *)__pyx_v_self), __pyx_v_boolean_value);

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

static PyObject *__pyx_pf_8CyOpenGL_13HoroballScene_4flip(struct __pyx_obj_8CyOpenGL_HoroballScene *__pyx_v_self, PyObject *__pyx_v_boolean_value) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("flip", 0);

  /* "opengl/legacy/horoball_scene.pyx":39
 * 
 *     def flip(self, boolean_value):
 *         self.flipped = boolean_value             # <<<<<<<<<<<<<<
 * 
 *     def build_scene(self, which_cusp=None, full_list=True):
*/
  __Pyx_INCREF(__pyx_v_boolean_value);
  __Pyx_GIVEREF(__pyx_v_boolean_value);
  __Pyx_GOTREF(__pyx_v_self->flipped);
  __Pyx_DECREF(__pyx_v_self->flipped);
  __pyx_v_self->flipped = __pyx_v_boolean_value;

  /* "opengl/legacy/horoball_scene.pyx":38
 *         self.cutoff = cutoff
 * 
 *     def flip(self, boolean_value):             # <<<<<<<<<<<<<<
 *         self.flipped = boolean_value
 * 
*/

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

/* "opengl/legacy/horoball_scene.pyx":41
 *         self.flipped = boolean_value
 * 
 *     def build_scene(self, which_cusp=None, full_list=True):             # <<<<<<<<<<<<<<
 *         if self.nbhd is None:
 *             self.cusp_view = self.labels = None
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_13HoroballScene_7build_scene(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_13HoroballScene_6build_scene, "HoroballScene.build_scene(self, which_cusp=None, full_list=True)");
static PyMethodDef __pyx_mdef_8CyOpenGL_13HoroballScene_7build_scene = {"build_scene", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_13HoroballScene_7build_scene, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_13HoroballScene_6build_scene};
static PyObject *__pyx_pw_8CyOpenGL_13HoroballScene_7build_scene(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_which_cusp = 0;
  PyObject *__pyx_v_full_list = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("build_scene (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_which_cusp,&__pyx_mstate_global->__pyx_n_u_full_list,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(25, 41, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(25, 41, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(25, 41, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "build_scene", 0) < (0)) __PYX_ERR(25, 41, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_True));
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(25, 41, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(25, 41, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_True));
    }
    __pyx_v_which_cusp = values[0];
    __pyx_v_full_list = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("build_scene", 0, 0, 2, __pyx_nargs); __PYX_ERR(25, 41, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("CyOpenGL.HoroballScene.build_scene", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_13HoroballScene_6build_scene(((struct __pyx_obj_8CyOpenGL_HoroballScene *)__pyx_v_self), __pyx_v_which_cusp, __pyx_v_full_list);

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

/* "opengl/legacy/horoball_scene.pyx":52
 *             self.which_cusp = which_cusp
 *         self.meridian, self.longitude = (
 *             complex(z) for z in self.nbhd.translations(self.which_cusp))             # <<<<<<<<<<<<<<
 *         self.cusp_view = HoroballGroup(
 *             self.nbhd.horoballs(self.cutoff, which_cusp, full_list),
*/

static PyObject *__pyx_pf_8CyOpenGL_13HoroballScene_11build_scene_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) {
  struct __pyx_obj_8CyOpenGL___pyx_scope_struct_1_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_8CyOpenGL___pyx_scope_struct_1_genexpr *)__pyx_tp_new_8CyOpenGL___pyx_scope_struct_1_genexpr(__pyx_mstate_global->__pyx_ptype_8CyOpenGL___pyx_scope_struct_1_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_8CyOpenGL___pyx_scope_struct_1_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(25, 52, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_8CyOpenGL_13HoroballScene_11build_scene_2generator, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_build_scene_locals_genexpr, __pyx_mstate_global->__pyx_n_u_CyOpenGL); if (unlikely(!gen)) __PYX_ERR(25, 52, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("CyOpenGL.HoroballScene.build_scene.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_8CyOpenGL_13HoroballScene_11build_scene_2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_8CyOpenGL___pyx_scope_struct_1_genexpr *__pyx_cur_scope = ((struct __pyx_obj_8CyOpenGL___pyx_scope_struct_1_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(__pyx_sent_value != Py_None)) {
    if (unlikely(__pyx_sent_value)) PyErr_SetString(PyExc_TypeError, "can't send non-None value to a just-started generator");
    __PYX_ERR(25, 52, __pyx_L1_error)
  }
  if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(25, 52, __pyx_L1_error) }
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1);
    __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 52, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(25, 52, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(25, 52, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference);
        ++__pyx_t_2;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(25, 52, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2));
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2);
        #endif
        ++__pyx_t_2;
      }
      if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 52, __pyx_L1_error)
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(25, 52, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_z);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_z, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_cur_scope->__pyx_v_z};
      __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)(&PyComplex_Type), __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 52, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    __Pyx_XGIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(25, 52, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

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

/* "opengl/legacy/horoball_scene.pyx":41
 *         self.flipped = boolean_value
 * 
 *     def build_scene(self, which_cusp=None, full_list=True):             # <<<<<<<<<<<<<<
 *         if self.nbhd is None:
 *             self.cusp_view = self.labels = None
*/

static PyObject *__pyx_pf_8CyOpenGL_13HoroballScene_6build_scene(struct __pyx_obj_8CyOpenGL_HoroballScene *__pyx_v_self, PyObject *__pyx_v_which_cusp, PyObject *__pyx_v_full_list) {
  PyObject *__pyx_gb_8CyOpenGL_13HoroballScene_11build_scene_2generator = 0;
  PyObject *__pyx_9genexpr12__pyx_v_n = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *(*__pyx_t_8)(PyObject *);
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *(*__pyx_t_13)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("build_scene", 0);
  __Pyx_INCREF(__pyx_v_which_cusp);

  /* "opengl/legacy/horoball_scene.pyx":42
 * 
 *     def build_scene(self, which_cusp=None, full_list=True):
 *         if self.nbhd is None:             # <<<<<<<<<<<<<<
 *             self.cusp_view = self.labels = None
 *             self.light_Ford = self.dark_Ford = None
*/
  __pyx_t_1 = (__pyx_v_self->nbhd == Py_None);
  if (__pyx_t_1) {

    /* "opengl/legacy/horoball_scene.pyx":43
 *     def build_scene(self, which_cusp=None, full_list=True):
 *         if self.nbhd is None:
 *             self.cusp_view = self.labels = None             # <<<<<<<<<<<<<<
 *             self.light_Ford = self.dark_Ford = None
 *             self.light_tri = self.dark_tri = None
*/
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    __Pyx_GOTREF(__pyx_v_self->cusp_view);
    __Pyx_DECREF(__pyx_v_self->cusp_view);
    __pyx_v_self->cusp_view = Py_None;
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    __Pyx_GOTREF(__pyx_v_self->labels);
    __Pyx_DECREF(__pyx_v_self->labels);
    __pyx_v_self->labels = Py_None;

    /* "opengl/legacy/horoball_scene.pyx":44
 *         if self.nbhd is None:
 *             self.cusp_view = self.labels = None
 *             self.light_Ford = self.dark_Ford = None             # <<<<<<<<<<<<<<
 *             self.light_tri = self.dark_tri = None
 *             return
*/
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    __Pyx_GOTREF(__pyx_v_self->light_Ford);
    __Pyx_DECREF(__pyx_v_self->light_Ford);
    __pyx_v_self->light_Ford = Py_None;
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    __Pyx_GOTREF(__pyx_v_self->dark_Ford);
    __Pyx_DECREF(__pyx_v_self->dark_Ford);
    __pyx_v_self->dark_Ford = Py_None;

    /* "opengl/legacy/horoball_scene.pyx":45
 *             self.cusp_view = self.labels = None
 *             self.light_Ford = self.dark_Ford = None
 *             self.light_tri = self.dark_tri = None             # <<<<<<<<<<<<<<
 *             return
 *         if which_cusp == None:
*/
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    __Pyx_GOTREF(__pyx_v_self->light_tri);
    __Pyx_DECREF(__pyx_v_self->light_tri);
    __pyx_v_self->light_tri = Py_None;
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    __Pyx_GOTREF(__pyx_v_self->dark_tri);
    __Pyx_DECREF(__pyx_v_self->dark_tri);
    __pyx_v_self->dark_tri = Py_None;

    /* "opengl/legacy/horoball_scene.pyx":46
 *             self.light_Ford = self.dark_Ford = None
 *             self.light_tri = self.dark_tri = None
 *             return             # <<<<<<<<<<<<<<
 *         if which_cusp == None:
 *             which_cusp = self.which_cusp
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "opengl/legacy/horoball_scene.pyx":42
 * 
 *     def build_scene(self, which_cusp=None, full_list=True):
 *         if self.nbhd is None:             # <<<<<<<<<<<<<<
 *             self.cusp_view = self.labels = None
 *             self.light_Ford = self.dark_Ford = None
*/
  }

  /* "opengl/legacy/horoball_scene.pyx":47
 *             self.light_tri = self.dark_tri = None
 *             return
 *         if which_cusp == None:             # <<<<<<<<<<<<<<
 *             which_cusp = self.which_cusp
 *         else:
*/
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_which_cusp, Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 47, __pyx_L1_error)
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(25, 47, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_1) {

    /* "opengl/legacy/horoball_scene.pyx":48
 *             return
 *         if which_cusp == None:
 *             which_cusp = self.which_cusp             # <<<<<<<<<<<<<<
 *         else:
 *             self.which_cusp = which_cusp
*/
    __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_self->which_cusp); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 48, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF_SET(__pyx_v_which_cusp, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "opengl/legacy/horoball_scene.pyx":47
 *             self.light_tri = self.dark_tri = None
 *             return
 *         if which_cusp == None:             # <<<<<<<<<<<<<<
 *             which_cusp = self.which_cusp
 *         else:
*/
    goto __pyx_L4;
  }

  /* "opengl/legacy/horoball_scene.pyx":50
 *             which_cusp = self.which_cusp
 *         else:
 *             self.which_cusp = which_cusp             # <<<<<<<<<<<<<<
 *         self.meridian, self.longitude = (
 *             complex(z) for z in self.nbhd.translations(self.which_cusp))
*/
  /*else*/ {
    __pyx_t_3 = __Pyx_PyLong_As_int(__pyx_v_which_cusp); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(25, 50, __pyx_L1_error)
    __pyx_v_self->which_cusp = __pyx_t_3;
  }
  __pyx_L4:;

  /* "opengl/legacy/horoball_scene.pyx":52
 *             self.which_cusp = which_cusp
 *         self.meridian, self.longitude = (
 *             complex(z) for z in self.nbhd.translations(self.which_cusp))             # <<<<<<<<<<<<<<
 *         self.cusp_view = HoroballGroup(
 *             self.nbhd.horoballs(self.cutoff, which_cusp, full_list),
*/
  __pyx_t_4 = __pyx_v_self->nbhd;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyLong_From_int(__pyx_v_self->which_cusp); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 52, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_translations, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 52, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_t_5 = __pyx_pf_8CyOpenGL_13HoroballScene_11build_scene_genexpr(NULL, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 52, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  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(25, 51, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
      __Pyx_INCREF(__pyx_t_2);
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_4);
    } else {
      __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 51, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_2);
      __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 51, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_4);
    }
    #else
    __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 51, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 51, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    #endif
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_7 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(25, 51, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_7);
    index = 0; __pyx_t_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_4 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_4)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < (0)) __PYX_ERR(25, 51, __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(25, 51, __pyx_L1_error)
    __pyx_L6_unpacking_done:;
  }

  /* "opengl/legacy/horoball_scene.pyx":51
 *         else:
 *             self.which_cusp = which_cusp
 *         self.meridian, self.longitude = (             # <<<<<<<<<<<<<<
 *             complex(z) for z in self.nbhd.translations(self.which_cusp))
 *         self.cusp_view = HoroballGroup(
*/
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->meridian);
  __Pyx_DECREF(__pyx_v_self->meridian);
  __pyx_v_self->meridian = __pyx_t_2;
  __pyx_t_2 = 0;
  __Pyx_GIVEREF(__pyx_t_4);
  __Pyx_GOTREF(__pyx_v_self->longitude);
  __Pyx_DECREF(__pyx_v_self->longitude);
  __pyx_v_self->longitude = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "opengl/legacy/horoball_scene.pyx":53
 *         self.meridian, self.longitude = (
 *             complex(z) for z in self.nbhd.translations(self.which_cusp))
 *         self.cusp_view = HoroballGroup(             # <<<<<<<<<<<<<<
 *             self.nbhd.horoballs(self.cutoff, which_cusp, full_list),
 *             [self.nbhd.original_index(n) for n in range(self.nbhd.num_cusps())],
*/
  __pyx_t_4 = NULL;

  /* "opengl/legacy/horoball_scene.pyx":54
 *             complex(z) for z in self.nbhd.translations(self.which_cusp))
 *         self.cusp_view = HoroballGroup(
 *             self.nbhd.horoballs(self.cutoff, which_cusp, full_list),             # <<<<<<<<<<<<<<
 *             [self.nbhd.original_index(n) for n in range(self.nbhd.num_cusps())],
 *             self.meridian,
*/
  __pyx_t_7 = __pyx_v_self->nbhd;
  __Pyx_INCREF(__pyx_t_7);
  __pyx_t_9 = PyFloat_FromDouble(__pyx_v_self->cutoff); if (unlikely(!__pyx_t_9)) __PYX_ERR(25, 54, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_7, __pyx_t_9, __pyx_v_which_cusp, __pyx_v_full_list};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_horoballs, __pyx_callargs+__pyx_t_6, (4-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 54, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  { /* enter inner scope */

    /* "opengl/legacy/horoball_scene.pyx":55
 *         self.cusp_view = HoroballGroup(
 *             self.nbhd.horoballs(self.cutoff, which_cusp, full_list),
 *             [self.nbhd.original_index(n) for n in range(self.nbhd.num_cusps())],             # <<<<<<<<<<<<<<
 *             self.meridian,
 *             self.longitude)
*/
    __pyx_t_9 = PyList_New(0); if (unlikely(!__pyx_t_9)) __PYX_ERR(25, 55, __pyx_L9_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_10 = NULL;
    __pyx_t_12 = __pyx_v_self->nbhd;
    __Pyx_INCREF(__pyx_t_12);
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_12, NULL};
      __pyx_t_11 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_num_cusps, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      if (unlikely(!__pyx_t_11)) __PYX_ERR(25, 55, __pyx_L9_error)
      __Pyx_GOTREF(__pyx_t_11);
    }
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_11};
      __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)(&PyRange_Type), __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(25, 55, __pyx_L9_error)
      __Pyx_GOTREF(__pyx_t_7);
    }
    __pyx_t_11 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(25, 55, __pyx_L9_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_13 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_11); if (unlikely(!__pyx_t_13)) __PYX_ERR(25, 55, __pyx_L9_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    for (;;) {
      {
        __pyx_t_7 = __pyx_t_13(__pyx_t_11);
        if (unlikely(!__pyx_t_7)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(25, 55, __pyx_L9_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_XDECREF_SET(__pyx_9genexpr12__pyx_v_n, __pyx_t_7);
      __pyx_t_7 = 0;
      __pyx_t_10 = __pyx_v_self->nbhd;
      __Pyx_INCREF(__pyx_t_10);
      __pyx_t_6 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_9genexpr12__pyx_v_n};
        __pyx_t_7 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_original_index, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (unlikely(!__pyx_t_7)) __PYX_ERR(25, 55, __pyx_L9_error)
        __Pyx_GOTREF(__pyx_t_7);
      }
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_9, (PyObject*)__pyx_t_7))) __PYX_ERR(25, 55, __pyx_L9_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_9genexpr12__pyx_v_n); __pyx_9genexpr12__pyx_v_n = 0;
    goto __pyx_L13_exit_scope;
    __pyx_L9_error:;
    __Pyx_XDECREF(__pyx_9genexpr12__pyx_v_n); __pyx_9genexpr12__pyx_v_n = 0;
    goto __pyx_L1_error;
    __pyx_L13_exit_scope:;
  } /* exit inner scope */

  /* "opengl/legacy/horoball_scene.pyx":57
 *             [self.nbhd.original_index(n) for n in range(self.nbhd.num_cusps())],
 *             self.meridian,
 *             self.longitude)             # <<<<<<<<<<<<<<
 *         self.light_Ford = FordEdgeSet(
 *                 self.nbhd.Ford_domain(self.which_cusp),
*/
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[5] = {__pyx_t_4, __pyx_t_2, __pyx_t_9, __pyx_v_self->meridian, __pyx_v_self->longitude};
    __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8CyOpenGL_HoroballGroup, __pyx_callargs+__pyx_t_6, (5-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 53, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_5);
  }

  /* "opengl/legacy/horoball_scene.pyx":53
 *         self.meridian, self.longitude = (
 *             complex(z) for z in self.nbhd.translations(self.which_cusp))
 *         self.cusp_view = HoroballGroup(             # <<<<<<<<<<<<<<
 *             self.nbhd.horoballs(self.cutoff, which_cusp, full_list),
 *             [self.nbhd.original_index(n) for n in range(self.nbhd.num_cusps())],
*/
  __Pyx_GIVEREF((PyObject *)__pyx_t_5);
  __Pyx_GOTREF(__pyx_v_self->cusp_view);
  __Pyx_DECREF(__pyx_v_self->cusp_view);
  __pyx_v_self->cusp_view = ((PyObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "opengl/legacy/horoball_scene.pyx":58
 *             self.meridian,
 *             self.longitude)
 *         self.light_Ford = FordEdgeSet(             # <<<<<<<<<<<<<<
 *                 self.nbhd.Ford_domain(self.which_cusp),
 *                 self.longitude, self.meridian, togl_widget=self.togl_widget)
*/
  __pyx_t_9 = NULL;

  /* "opengl/legacy/horoball_scene.pyx":59
 *             self.longitude)
 *         self.light_Ford = FordEdgeSet(
 *                 self.nbhd.Ford_domain(self.which_cusp),             # <<<<<<<<<<<<<<
 *                 self.longitude, self.meridian, togl_widget=self.togl_widget)
 *         self.dark_Ford = FordEdgeSet(
*/
  __pyx_t_4 = __pyx_v_self->nbhd;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_11 = __Pyx_PyLong_From_int(__pyx_v_self->which_cusp); if (unlikely(!__pyx_t_11)) __PYX_ERR(25, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_11};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_Ford_domain, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 59, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }

  /* "opengl/legacy/horoball_scene.pyx":60
 *         self.light_Ford = FordEdgeSet(
 *                 self.nbhd.Ford_domain(self.which_cusp),
 *                 self.longitude, self.meridian, togl_widget=self.togl_widget)             # <<<<<<<<<<<<<<
 *         self.dark_Ford = FordEdgeSet(
 *                 self.nbhd.Ford_domain(self.which_cusp),
*/
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[4 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_9, __pyx_t_2, __pyx_v_self->longitude, __pyx_v_self->meridian};
    __pyx_t_11 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(25, 58, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_togl_widget, __pyx_v_self->togl_widget, __pyx_t_11, __pyx_callargs+4, 0) < (0)) __PYX_ERR(25, 58, __pyx_L1_error)
    __pyx_t_5 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_ptype_8CyOpenGL_FordEdgeSet, __pyx_callargs+__pyx_t_6, (4-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_11);
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 58, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_5);
  }

  /* "opengl/legacy/horoball_scene.pyx":58
 *             self.meridian,
 *             self.longitude)
 *         self.light_Ford = FordEdgeSet(             # <<<<<<<<<<<<<<
 *                 self.nbhd.Ford_domain(self.which_cusp),
 *                 self.longitude, self.meridian, togl_widget=self.togl_widget)
*/
  __Pyx_GIVEREF((PyObject *)__pyx_t_5);
  __Pyx_GOTREF(__pyx_v_self->light_Ford);
  __Pyx_DECREF(__pyx_v_self->light_Ford);
  __pyx_v_self->light_Ford = ((PyObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "opengl/legacy/horoball_scene.pyx":61
 *                 self.nbhd.Ford_domain(self.which_cusp),
 *                 self.longitude, self.meridian, togl_widget=self.togl_widget)
 *         self.dark_Ford = FordEdgeSet(             # <<<<<<<<<<<<<<
 *                 self.nbhd.Ford_domain(self.which_cusp),
 *                 self.longitude, self.meridian, togl_widget=self.togl_widget)
*/
  __pyx_t_11 = NULL;

  /* "opengl/legacy/horoball_scene.pyx":62
 *                 self.longitude, self.meridian, togl_widget=self.togl_widget)
 *         self.dark_Ford = FordEdgeSet(
 *                 self.nbhd.Ford_domain(self.which_cusp),             # <<<<<<<<<<<<<<
 *                 self.longitude, self.meridian, togl_widget=self.togl_widget)
 *         self.light_tri = TriangulationEdgeSet(
*/
  __pyx_t_9 = __pyx_v_self->nbhd;
  __Pyx_INCREF(__pyx_t_9);
  __pyx_t_4 = __Pyx_PyLong_From_int(__pyx_v_self->which_cusp); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 62, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_4};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_Ford_domain, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 62, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }

  /* "opengl/legacy/horoball_scene.pyx":63
 *         self.dark_Ford = FordEdgeSet(
 *                 self.nbhd.Ford_domain(self.which_cusp),
 *                 self.longitude, self.meridian, togl_widget=self.togl_widget)             # <<<<<<<<<<<<<<
 *         self.light_tri = TriangulationEdgeSet(
 *                 self.nbhd.triangulation(self.which_cusp),
*/
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[4 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_11, __pyx_t_2, __pyx_v_self->longitude, __pyx_v_self->meridian};
    __pyx_t_4 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 61, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_togl_widget, __pyx_v_self->togl_widget, __pyx_t_4, __pyx_callargs+4, 0) < (0)) __PYX_ERR(25, 61, __pyx_L1_error)
    __pyx_t_5 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_ptype_8CyOpenGL_FordEdgeSet, __pyx_callargs+__pyx_t_6, (4-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 61, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_5);
  }

  /* "opengl/legacy/horoball_scene.pyx":61
 *                 self.nbhd.Ford_domain(self.which_cusp),
 *                 self.longitude, self.meridian, togl_widget=self.togl_widget)
 *         self.dark_Ford = FordEdgeSet(             # <<<<<<<<<<<<<<
 *                 self.nbhd.Ford_domain(self.which_cusp),
 *                 self.longitude, self.meridian, togl_widget=self.togl_widget)
*/
  __Pyx_GIVEREF((PyObject *)__pyx_t_5);
  __Pyx_GOTREF(__pyx_v_self->dark_Ford);
  __Pyx_DECREF(__pyx_v_self->dark_Ford);
  __pyx_v_self->dark_Ford = ((PyObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "opengl/legacy/horoball_scene.pyx":64
 *                 self.nbhd.Ford_domain(self.which_cusp),
 *                 self.longitude, self.meridian, togl_widget=self.togl_widget)
 *         self.light_tri = TriangulationEdgeSet(             # <<<<<<<<<<<<<<
 *                 self.nbhd.triangulation(self.which_cusp),
 *                 self.longitude, self.meridian, togl_widget=self.togl_widget)
*/
  __pyx_t_4 = NULL;

  /* "opengl/legacy/horoball_scene.pyx":65
 *                 self.longitude, self.meridian, togl_widget=self.togl_widget)
 *         self.light_tri = TriangulationEdgeSet(
 *                 self.nbhd.triangulation(self.which_cusp),             # <<<<<<<<<<<<<<
 *                 self.longitude, self.meridian, togl_widget=self.togl_widget)
 *         self.dark_tri = TriangulationEdgeSet(
*/
  __pyx_t_11 = __pyx_v_self->nbhd;
  __Pyx_INCREF(__pyx_t_11);
  __pyx_t_9 = __Pyx_PyLong_From_int(__pyx_v_self->which_cusp); if (unlikely(!__pyx_t_9)) __PYX_ERR(25, 65, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_t_9};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_triangulation, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 65, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }

  /* "opengl/legacy/horoball_scene.pyx":66
 *         self.light_tri = TriangulationEdgeSet(
 *                 self.nbhd.triangulation(self.which_cusp),
 *                 self.longitude, self.meridian, togl_widget=self.togl_widget)             # <<<<<<<<<<<<<<
 *         self.dark_tri = TriangulationEdgeSet(
 *                 self.nbhd.triangulation(self.which_cusp),
*/
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[4 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_4, __pyx_t_2, __pyx_v_self->longitude, __pyx_v_self->meridian};
    __pyx_t_9 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(25, 64, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_togl_widget, __pyx_v_self->togl_widget, __pyx_t_9, __pyx_callargs+4, 0) < (0)) __PYX_ERR(25, 64, __pyx_L1_error)
    __pyx_t_5 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_ptype_8CyOpenGL_TriangulationEdgeSet, __pyx_callargs+__pyx_t_6, (4-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_9);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 64, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_5);
  }

  /* "opengl/legacy/horoball_scene.pyx":64
 *                 self.nbhd.Ford_domain(self.which_cusp),
 *                 self.longitude, self.meridian, togl_widget=self.togl_widget)
 *         self.light_tri = TriangulationEdgeSet(             # <<<<<<<<<<<<<<
 *                 self.nbhd.triangulation(self.which_cusp),
 *                 self.longitude, self.meridian, togl_widget=self.togl_widget)
*/
  __Pyx_GIVEREF((PyObject *)__pyx_t_5);
  __Pyx_GOTREF(__pyx_v_self->light_tri);
  __Pyx_DECREF(__pyx_v_self->light_tri);
  __pyx_v_self->light_tri = ((PyObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "opengl/legacy/horoball_scene.pyx":67
 *                 self.nbhd.triangulation(self.which_cusp),
 *                 self.longitude, self.meridian, togl_widget=self.togl_widget)
 *         self.dark_tri = TriangulationEdgeSet(             # <<<<<<<<<<<<<<
 *                 self.nbhd.triangulation(self.which_cusp),
 *                 self.longitude, self.meridian, togl_widget=self.togl_widget)
*/
  __pyx_t_9 = NULL;

  /* "opengl/legacy/horoball_scene.pyx":68
 *                 self.longitude, self.meridian, togl_widget=self.togl_widget)
 *         self.dark_tri = TriangulationEdgeSet(
 *                 self.nbhd.triangulation(self.which_cusp),             # <<<<<<<<<<<<<<
 *                 self.longitude, self.meridian, togl_widget=self.togl_widget)
 *         self.labels = LabelSet(
*/
  __pyx_t_4 = __pyx_v_self->nbhd;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_11 = __Pyx_PyLong_From_int(__pyx_v_self->which_cusp); if (unlikely(!__pyx_t_11)) __PYX_ERR(25, 68, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_11};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_triangulation, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 68, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }

  /* "opengl/legacy/horoball_scene.pyx":69
 *         self.dark_tri = TriangulationEdgeSet(
 *                 self.nbhd.triangulation(self.which_cusp),
 *                 self.longitude, self.meridian, togl_widget=self.togl_widget)             # <<<<<<<<<<<<<<
 *         self.labels = LabelSet(
 *                 self.nbhd.triangulation(self.which_cusp),
*/
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[4 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_9, __pyx_t_2, __pyx_v_self->longitude, __pyx_v_self->meridian};
    __pyx_t_11 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(25, 67, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_togl_widget, __pyx_v_self->togl_widget, __pyx_t_11, __pyx_callargs+4, 0) < (0)) __PYX_ERR(25, 67, __pyx_L1_error)
    __pyx_t_5 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_ptype_8CyOpenGL_TriangulationEdgeSet, __pyx_callargs+__pyx_t_6, (4-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_11);
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 67, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_5);
  }

  /* "opengl/legacy/horoball_scene.pyx":67
 *                 self.nbhd.triangulation(self.which_cusp),
 *                 self.longitude, self.meridian, togl_widget=self.togl_widget)
 *         self.dark_tri = TriangulationEdgeSet(             # <<<<<<<<<<<<<<
 *                 self.nbhd.triangulation(self.which_cusp),
 *                 self.longitude, self.meridian, togl_widget=self.togl_widget)
*/
  __Pyx_GIVEREF((PyObject *)__pyx_t_5);
  __Pyx_GOTREF(__pyx_v_self->dark_tri);
  __Pyx_DECREF(__pyx_v_self->dark_tri);
  __pyx_v_self->dark_tri = ((PyObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "opengl/legacy/horoball_scene.pyx":70
 *                 self.nbhd.triangulation(self.which_cusp),
 *                 self.longitude, self.meridian, togl_widget=self.togl_widget)
 *         self.labels = LabelSet(             # <<<<<<<<<<<<<<
 *                 self.nbhd.triangulation(self.which_cusp),
 *                 self.longitude, self.meridian, togl_widget=self.togl_widget)
*/
  __pyx_t_11 = NULL;

  /* "opengl/legacy/horoball_scene.pyx":71
 *                 self.longitude, self.meridian, togl_widget=self.togl_widget)
 *         self.labels = LabelSet(
 *                 self.nbhd.triangulation(self.which_cusp),             # <<<<<<<<<<<<<<
 *                 self.longitude, self.meridian, togl_widget=self.togl_widget)
 *         self.gl_compile()
*/
  __pyx_t_9 = __pyx_v_self->nbhd;
  __Pyx_INCREF(__pyx_t_9);
  __pyx_t_4 = __Pyx_PyLong_From_int(__pyx_v_self->which_cusp); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 71, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_4};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_triangulation, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 71, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }

  /* "opengl/legacy/horoball_scene.pyx":72
 *         self.labels = LabelSet(
 *                 self.nbhd.triangulation(self.which_cusp),
 *                 self.longitude, self.meridian, togl_widget=self.togl_widget)             # <<<<<<<<<<<<<<
 *         self.gl_compile()
 * 
*/
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[4 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_11, __pyx_t_2, __pyx_v_self->longitude, __pyx_v_self->meridian};
    __pyx_t_4 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 70, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_togl_widget, __pyx_v_self->togl_widget, __pyx_t_4, __pyx_callargs+4, 0) < (0)) __PYX_ERR(25, 70, __pyx_L1_error)
    __pyx_t_5 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_ptype_8CyOpenGL_LabelSet, __pyx_callargs+__pyx_t_6, (4-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 70, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_5);
  }

  /* "opengl/legacy/horoball_scene.pyx":70
 *                 self.nbhd.triangulation(self.which_cusp),
 *                 self.longitude, self.meridian, togl_widget=self.togl_widget)
 *         self.labels = LabelSet(             # <<<<<<<<<<<<<<
 *                 self.nbhd.triangulation(self.which_cusp),
 *                 self.longitude, self.meridian, togl_widget=self.togl_widget)
*/
  __Pyx_GIVEREF((PyObject *)__pyx_t_5);
  __Pyx_GOTREF(__pyx_v_self->labels);
  __Pyx_DECREF(__pyx_v_self->labels);
  __pyx_v_self->labels = ((PyObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "opengl/legacy/horoball_scene.pyx":73
 *                 self.nbhd.triangulation(self.which_cusp),
 *                 self.longitude, self.meridian, togl_widget=self.togl_widget)
 *         self.gl_compile()             # <<<<<<<<<<<<<<
 * 
 *     def delete_resource(self):
*/
  __pyx_t_5 = ((struct __pyx_vtabstruct_8CyOpenGL_HoroballScene *)__pyx_v_self->__pyx_vtab)->gl_compile(__pyx_v_self); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 73, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "opengl/legacy/horoball_scene.pyx":41
 *         self.flipped = boolean_value
 * 
 *     def build_scene(self, which_cusp=None, full_list=True):             # <<<<<<<<<<<<<<
 *         if self.nbhd is None:
 *             self.cusp_view = self.labels = 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_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("CyOpenGL.HoroballScene.build_scene", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_gb_8CyOpenGL_13HoroballScene_11build_scene_2generator);
  __Pyx_XDECREF(__pyx_9genexpr12__pyx_v_n);
  __Pyx_XDECREF(__pyx_v_which_cusp);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opengl/legacy/horoball_scene.pyx":75
 *         self.gl_compile()
 * 
 *     def delete_resource(self):             # <<<<<<<<<<<<<<
 *         self.cusp_view.delete_resource()
 *         self.light_Ford.delete_resource()
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_13HoroballScene_9delete_resource(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_13HoroballScene_8delete_resource, "HoroballScene.delete_resource(self)");
static PyMethodDef __pyx_mdef_8CyOpenGL_13HoroballScene_9delete_resource = {"delete_resource", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_13HoroballScene_9delete_resource, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_13HoroballScene_8delete_resource};
static PyObject *__pyx_pw_8CyOpenGL_13HoroballScene_9delete_resource(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("delete_resource (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("delete_resource", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("delete_resource", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8CyOpenGL_13HoroballScene_8delete_resource(((struct __pyx_obj_8CyOpenGL_HoroballScene *)__pyx_v_self));

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

static PyObject *__pyx_pf_8CyOpenGL_13HoroballScene_8delete_resource(struct __pyx_obj_8CyOpenGL_HoroballScene *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("delete_resource", 0);

  /* "opengl/legacy/horoball_scene.pyx":76
 * 
 *     def delete_resource(self):
 *         self.cusp_view.delete_resource()             # <<<<<<<<<<<<<<
 *         self.light_Ford.delete_resource()
 *         self.dark_Ford.delete_resource()
*/
  __pyx_t_2 = __pyx_v_self->cusp_view;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_delete_resource, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 76, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/legacy/horoball_scene.pyx":77
 *     def delete_resource(self):
 *         self.cusp_view.delete_resource()
 *         self.light_Ford.delete_resource()             # <<<<<<<<<<<<<<
 *         self.dark_Ford.delete_resource()
 *         self.light_tri.delete_resource()
*/
  __pyx_t_2 = __pyx_v_self->light_Ford;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_delete_resource, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 77, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/legacy/horoball_scene.pyx":78
 *         self.cusp_view.delete_resource()
 *         self.light_Ford.delete_resource()
 *         self.dark_Ford.delete_resource()             # <<<<<<<<<<<<<<
 *         self.light_tri.delete_resource()
 *         self.dark_tri.delete_resource()
*/
  __pyx_t_2 = __pyx_v_self->dark_Ford;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_delete_resource, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 78, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/legacy/horoball_scene.pyx":79
 *         self.light_Ford.delete_resource()
 *         self.dark_Ford.delete_resource()
 *         self.light_tri.delete_resource()             # <<<<<<<<<<<<<<
 *         self.dark_tri.delete_resource()
 *         self.labels.delete_resource()
*/
  __pyx_t_2 = __pyx_v_self->light_tri;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_delete_resource, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 79, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/legacy/horoball_scene.pyx":80
 *         self.dark_Ford.delete_resource()
 *         self.light_tri.delete_resource()
 *         self.dark_tri.delete_resource()             # <<<<<<<<<<<<<<
 *         self.labels.delete_resource()
 * 
*/
  __pyx_t_2 = __pyx_v_self->dark_tri;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_delete_resource, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 80, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/legacy/horoball_scene.pyx":81
 *         self.light_tri.delete_resource()
 *         self.dark_tri.delete_resource()
 *         self.labels.delete_resource()             # <<<<<<<<<<<<<<
 * 
 *     cdef build_shifts(self, R, T):
*/
  __pyx_t_2 = __pyx_v_self->labels;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_delete_resource, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 81, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/legacy/horoball_scene.pyx":75
 *         self.gl_compile()
 * 
 *     def delete_resource(self):             # <<<<<<<<<<<<<<
 *         self.cusp_view.delete_resource()
 *         self.light_Ford.delete_resource()
*/

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

/* "opengl/legacy/horoball_scene.pyx":83
 *         self.labels.delete_resource()
 * 
 *     cdef build_shifts(self, R, T):             # <<<<<<<<<<<<<<
 *         self.shifts = []
 *         if self.cusp_view is None:
*/

static PyObject *__pyx_f_8CyOpenGL_13HoroballScene_build_shifts(struct __pyx_obj_8CyOpenGL_HoroballScene *__pyx_v_self, PyObject *__pyx_v_R, PyObject *__pyx_v_T) {
  PyObject *__pyx_v_M = NULL;
  PyObject *__pyx_v_N = NULL;
  PyObject *__pyx_v_m = NULL;
  PyObject *__pyx_v_shear = NULL;
  PyObject *__pyx_v_left = NULL;
  PyObject *__pyx_v_n = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  size_t __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  PyObject *__pyx_t_10 = NULL;
  PyObject *(*__pyx_t_11)(PyObject *);
  int __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("build_shifts", 0);

  /* "opengl/legacy/horoball_scene.pyx":84
 * 
 *     cdef build_shifts(self, R, T):
 *         self.shifts = []             # <<<<<<<<<<<<<<
 *         if self.cusp_view is None:
 *             return
*/
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 84, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->shifts);
  __Pyx_DECREF(__pyx_v_self->shifts);
  __pyx_v_self->shifts = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "opengl/legacy/horoball_scene.pyx":85
 *     cdef build_shifts(self, R, T):
 *         self.shifts = []
 *         if self.cusp_view is None:             # <<<<<<<<<<<<<<
 *             return
 *         if self.meridian.imag == 0 or self.longitude.real == 0:
*/
  __pyx_t_2 = (__pyx_v_self->cusp_view == Py_None);
  if (__pyx_t_2) {

    /* "opengl/legacy/horoball_scene.pyx":86
 *         self.shifts = []
 *         if self.cusp_view is None:
 *             return             # <<<<<<<<<<<<<<
 *         if self.meridian.imag == 0 or self.longitude.real == 0:
 *             return
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "opengl/legacy/horoball_scene.pyx":85
 *     cdef build_shifts(self, R, T):
 *         self.shifts = []
 *         if self.cusp_view is None:             # <<<<<<<<<<<<<<
 *             return
 *         if self.meridian.imag == 0 or self.longitude.real == 0:
*/
  }

  /* "opengl/legacy/horoball_scene.pyx":87
 *         if self.cusp_view is None:
 *             return
 *         if self.meridian.imag == 0 or self.longitude.real == 0:             # <<<<<<<<<<<<<<
 *             return
 *         M = 1 + int(ceil(T/abs(self.meridian.imag)))
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->meridian, __pyx_mstate_global->__pyx_n_u_imag); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = (__Pyx_PyLong_BoolEqObjC(__pyx_t_1, __pyx_mstate_global->__pyx_int_0, 0, 0)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(25, 87, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (!__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->longitude, __pyx_mstate_global->__pyx_n_u_real); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = (__Pyx_PyLong_BoolEqObjC(__pyx_t_1, __pyx_mstate_global->__pyx_int_0, 0, 0)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(25, 87, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_2 = __pyx_t_3;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_2) {

    /* "opengl/legacy/horoball_scene.pyx":88
 *             return
 *         if self.meridian.imag == 0 or self.longitude.real == 0:
 *             return             # <<<<<<<<<<<<<<
 *         M = 1 + int(ceil(T/abs(self.meridian.imag)))
 *         N = 1 + int(ceil(R/self.longitude.real))
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "opengl/legacy/horoball_scene.pyx":87
 *         if self.cusp_view is None:
 *             return
 *         if self.meridian.imag == 0 or self.longitude.real == 0:             # <<<<<<<<<<<<<<
 *             return
 *         M = 1 + int(ceil(T/abs(self.meridian.imag)))
*/
  }

  /* "opengl/legacy/horoball_scene.pyx":89
 *         if self.meridian.imag == 0 or self.longitude.real == 0:
 *             return
 *         M = 1 + int(ceil(T/abs(self.meridian.imag)))             # <<<<<<<<<<<<<<
 *         N = 1 + int(ceil(R/self.longitude.real))
 *         for m in range(-M,M+1):
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ceil); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 89, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->meridian, __pyx_mstate_global->__pyx_n_u_imag); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 89, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyNumber_Absolute(__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(25, 89, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_v_T, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 89, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_8 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_8 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_6};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 89, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_5 = __Pyx_PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 89, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyLong_AddCObj(__pyx_mstate_global->__pyx_int_1, __pyx_t_5, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 89, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_M = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "opengl/legacy/horoball_scene.pyx":90
 *             return
 *         M = 1 + int(ceil(T/abs(self.meridian.imag)))
 *         N = 1 + int(ceil(R/self.longitude.real))             # <<<<<<<<<<<<<<
 *         for m in range(-M,M+1):
 *             shear = m*self.meridian.real/self.longitude.real
*/
  __pyx_t_5 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_ceil); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 90, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->longitude, __pyx_mstate_global->__pyx_n_u_real); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 90, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = __Pyx_PyNumber_Divide(__pyx_v_R, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(25, 90, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_8 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
    assert(__pyx_t_5);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
    __pyx_t_8 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_7};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 90, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_6 = __Pyx_PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 90, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyLong_AddCObj(__pyx_mstate_global->__pyx_int_1, __pyx_t_6, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 90, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_N = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "opengl/legacy/horoball_scene.pyx":91
 *         M = 1 + int(ceil(T/abs(self.meridian.imag)))
 *         N = 1 + int(ceil(R/self.longitude.real))
 *         for m in range(-M,M+1):             # <<<<<<<<<<<<<<
 *             shear = m*self.meridian.real/self.longitude.real
 *             left = int(floor(-shear-N))
*/
  __pyx_t_6 = NULL;
  __pyx_t_7 = PyNumber_Negative(__pyx_v_M); if (unlikely(!__pyx_t_7)) __PYX_ERR(25, 91, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_5 = __Pyx_PyLong_AddObjC(__pyx_v_M, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 91, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_8 = 1;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_7, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(&PyRange_Type), __pyx_callargs+__pyx_t_8, (3-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 91, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 91, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(25, 91, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    {
      __pyx_t_1 = __pyx_t_9(__pyx_t_5);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(25, 91, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_1);
    if (__Pyx_PyInt_FromNumber(&__pyx_t_1, NULL, 1) < (0)) __PYX_ERR(25, 91, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_m, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "opengl/legacy/horoball_scene.pyx":92
 *         N = 1 + int(ceil(R/self.longitude.real))
 *         for m in range(-M,M+1):
 *             shear = m*self.meridian.real/self.longitude.real             # <<<<<<<<<<<<<<
 *             left = int(floor(-shear-N))
 *             for n in range(left,left+2*N+1):
*/
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->meridian, __pyx_mstate_global->__pyx_n_u_real); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 92, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = PyNumber_Multiply(__pyx_v_m, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(25, 92, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->longitude, __pyx_mstate_global->__pyx_n_u_real); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 92, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_t_7, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 92, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF_SET(__pyx_v_shear, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "opengl/legacy/horoball_scene.pyx":93
 *         for m in range(-M,M+1):
 *             shear = m*self.meridian.real/self.longitude.real
 *             left = int(floor(-shear-N))             # <<<<<<<<<<<<<<
 *             for n in range(left,left+2*N+1):
 *                 self.shifts.append((m,n))
*/
    __pyx_t_1 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_floor); if (unlikely(!__pyx_t_7)) __PYX_ERR(25, 93, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_4 = PyNumber_Negative(__pyx_v_shear); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 93, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_10 = PyNumber_Subtract(__pyx_t_4, __pyx_v_N); if (unlikely(!__pyx_t_10)) __PYX_ERR(25, 93, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_8 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_7);
      assert(__pyx_t_1);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
      __pyx_t_8 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_10};
      __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 93, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
    }
    __pyx_t_7 = __Pyx_PyNumber_Int(__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(25, 93, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF_SET(__pyx_v_left, ((PyObject*)__pyx_t_7));
    __pyx_t_7 = 0;

    /* "opengl/legacy/horoball_scene.pyx":94
 *             shear = m*self.meridian.real/self.longitude.real
 *             left = int(floor(-shear-N))
 *             for n in range(left,left+2*N+1):             # <<<<<<<<<<<<<<
 *                 self.shifts.append((m,n))
 * 
*/
    __pyx_t_6 = NULL;
    __pyx_t_10 = __Pyx_PyLong_MultiplyCObj(__pyx_mstate_global->__pyx_int_2, __pyx_v_N, 2, 0, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(25, 94, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_1 = PyNumber_Add(__pyx_v_left, __pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 94, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_10 = __Pyx_PyLong_AddObjC(__pyx_t_1, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(25, 94, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_8 = 1;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_v_left, __pyx_t_10};
      __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)(&PyRange_Type), __pyx_callargs+__pyx_t_8, (3-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(25, 94, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
    }
    __pyx_t_10 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_10)) __PYX_ERR(25, 94, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(25, 94, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    for (;;) {
      {
        __pyx_t_7 = __pyx_t_11(__pyx_t_10);
        if (unlikely(!__pyx_t_7)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(25, 94, __pyx_L1_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_7);
      if (__Pyx_PyInt_FromNumber(&__pyx_t_7, NULL, 1) < (0)) __PYX_ERR(25, 94, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_n, ((PyObject*)__pyx_t_7));
      __pyx_t_7 = 0;

      /* "opengl/legacy/horoball_scene.pyx":95
 *             left = int(floor(-shear-N))
 *             for n in range(left,left+2*N+1):
 *                 self.shifts.append((m,n))             # <<<<<<<<<<<<<<
 * 
 *     def translate(self, z):
*/
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(25, 95, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_v_m);
      __Pyx_GIVEREF(__pyx_v_m);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_m) != (0)) __PYX_ERR(25, 95, __pyx_L1_error);
      __Pyx_INCREF(__pyx_v_n);
      __Pyx_GIVEREF(__pyx_v_n);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_n) != (0)) __PYX_ERR(25, 95, __pyx_L1_error);
      __pyx_t_12 = __Pyx_PyObject_Append(__pyx_v_self->shifts, __pyx_t_7); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(25, 95, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "opengl/legacy/horoball_scene.pyx":94
 *             shear = m*self.meridian.real/self.longitude.real
 *             left = int(floor(-shear-N))
 *             for n in range(left,left+2*N+1):             # <<<<<<<<<<<<<<
 *                 self.shifts.append((m,n))
 * 
*/
    }
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

    /* "opengl/legacy/horoball_scene.pyx":91
 *         M = 1 + int(ceil(T/abs(self.meridian.imag)))
 *         N = 1 + int(ceil(R/self.longitude.real))
 *         for m in range(-M,M+1):             # <<<<<<<<<<<<<<
 *             shear = m*self.meridian.real/self.longitude.real
 *             left = int(floor(-shear-N))
*/
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "opengl/legacy/horoball_scene.pyx":83
 *         self.labels.delete_resource()
 * 
 *     cdef build_shifts(self, R, T):             # <<<<<<<<<<<<<<
 *         self.shifts = []
 *         if self.cusp_view is 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_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("CyOpenGL.HoroballScene.build_shifts", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_M);
  __Pyx_XDECREF(__pyx_v_N);
  __Pyx_XDECREF(__pyx_v_m);
  __Pyx_XDECREF(__pyx_v_shear);
  __Pyx_XDECREF(__pyx_v_left);
  __Pyx_XDECREF(__pyx_v_n);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opengl/legacy/horoball_scene.pyx":97
 *                 self.shifts.append((m,n))
 * 
 *     def translate(self, z):             # <<<<<<<<<<<<<<
 *         """
 *         Translate modulo the cusp stabilizer.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_13HoroballScene_11translate(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_13HoroballScene_10translate, "HoroballScene.translate(self, z)\n\nTranslate modulo the cusp stabilizer.");
static PyMethodDef __pyx_mdef_8CyOpenGL_13HoroballScene_11translate = {"translate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_13HoroballScene_11translate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_13HoroballScene_10translate};
static PyObject *__pyx_pw_8CyOpenGL_13HoroballScene_11translate(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_z = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("translate (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_z,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(25, 97, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(25, 97, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "translate", 0) < (0)) __PYX_ERR(25, 97, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("translate", 1, 1, 1, i); __PYX_ERR(25, 97, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(25, 97, __pyx_L3_error)
    }
    __pyx_v_z = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("translate", 1, 1, 1, __pyx_nargs); __PYX_ERR(25, 97, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("CyOpenGL.HoroballScene.translate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_13HoroballScene_10translate(((struct __pyx_obj_8CyOpenGL_HoroballScene *)__pyx_v_self), __pyx_v_z);

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

static PyObject *__pyx_pf_8CyOpenGL_13HoroballScene_10translate(struct __pyx_obj_8CyOpenGL_HoroballScene *__pyx_v_self, PyObject *__pyx_v_z) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("translate", 0);
  __Pyx_INCREF(__pyx_v_z);

  /* "opengl/legacy/horoball_scene.pyx":101
 *         Translate modulo the cusp stabilizer.
 *         """
 *         if self.cusp_view is None:             # <<<<<<<<<<<<<<
 *             return
 *         if self.flipped:
*/
  __pyx_t_1 = (__pyx_v_self->cusp_view == Py_None);
  if (__pyx_t_1) {

    /* "opengl/legacy/horoball_scene.pyx":102
 *         """
 *         if self.cusp_view is None:
 *             return             # <<<<<<<<<<<<<<
 *         if self.flipped:
 *             z = z.conjugate()
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "opengl/legacy/horoball_scene.pyx":101
 *         Translate modulo the cusp stabilizer.
 *         """
 *         if self.cusp_view is None:             # <<<<<<<<<<<<<<
 *             return
 *         if self.flipped:
*/
  }

  /* "opengl/legacy/horoball_scene.pyx":103
 *         if self.cusp_view is None:
 *             return
 *         if self.flipped:             # <<<<<<<<<<<<<<
 *             z = z.conjugate()
 *         z += self.offset
*/
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->flipped); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(25, 103, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "opengl/legacy/horoball_scene.pyx":104
 *             return
 *         if self.flipped:
 *             z = z.conjugate()             # <<<<<<<<<<<<<<
 *         z += self.offset
 *         z += 0.5*self.meridian.imag*1j
*/
    __pyx_t_3 = __pyx_v_z;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_conjugate, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 104, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF_SET(__pyx_v_z, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "opengl/legacy/horoball_scene.pyx":103
 *         if self.cusp_view is None:
 *             return
 *         if self.flipped:             # <<<<<<<<<<<<<<
 *             z = z.conjugate()
 *         z += self.offset
*/
  }

  /* "opengl/legacy/horoball_scene.pyx":105
 *         if self.flipped:
 *             z = z.conjugate()
 *         z += self.offset             # <<<<<<<<<<<<<<
 *         z += 0.5*self.meridian.imag*1j
 *         z = z - (z.imag//self.meridian.imag)*self.meridian
*/
  __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_z, __pyx_v_self->offset); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 105, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF_SET(__pyx_v_z, __pyx_t_2);
  __pyx_t_2 = 0;

  /* "opengl/legacy/horoball_scene.pyx":106
 *             z = z.conjugate()
 *         z += self.offset
 *         z += 0.5*self.meridian.imag*1j             # <<<<<<<<<<<<<<
 *         z = z - (z.imag//self.meridian.imag)*self.meridian
 *         z -= 0.5*self.meridian.imag*1j
*/
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->meridian, __pyx_mstate_global->__pyx_n_u_imag); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyNumber_Multiply(__pyx_mstate_global->__pyx_float_0_5, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(25, 106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyComplex_FromDoubles(0.0, 1.0); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = PyNumber_Multiply(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_z, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF_SET(__pyx_v_z, __pyx_t_2);
  __pyx_t_2 = 0;

  /* "opengl/legacy/horoball_scene.pyx":107
 *         z += self.offset
 *         z += 0.5*self.meridian.imag*1j
 *         z = z - (z.imag//self.meridian.imag)*self.meridian             # <<<<<<<<<<<<<<
 *         z -= 0.5*self.meridian.imag*1j
 *         z += 0.5*self.longitude.real
*/
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_z, __pyx_mstate_global->__pyx_n_u_imag); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 107, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->meridian, __pyx_mstate_global->__pyx_n_u_imag); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 107, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = PyNumber_FloorDivide(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(25, 107, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyNumber_Multiply(__pyx_t_3, __pyx_v_self->meridian); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 107, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Subtract(__pyx_v_z, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(25, 107, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF_SET(__pyx_v_z, __pyx_t_3);
  __pyx_t_3 = 0;

  /* "opengl/legacy/horoball_scene.pyx":108
 *         z += 0.5*self.meridian.imag*1j
 *         z = z - (z.imag//self.meridian.imag)*self.meridian
 *         z -= 0.5*self.meridian.imag*1j             # <<<<<<<<<<<<<<
 *         z += 0.5*self.longitude.real
 *         z = z - (z.real//self.longitude.real)*self.longitude
*/
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->meridian, __pyx_mstate_global->__pyx_n_u_imag); if (unlikely(!__pyx_t_3)) __PYX_ERR(25, 108, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = PyNumber_Multiply(__pyx_mstate_global->__pyx_float_0_5, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 108, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyComplex_FromDoubles(0.0, 1.0); if (unlikely(!__pyx_t_3)) __PYX_ERR(25, 108, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyNumber_Multiply(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 108, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_InPlaceSubtract(__pyx_v_z, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(25, 108, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF_SET(__pyx_v_z, __pyx_t_3);
  __pyx_t_3 = 0;

  /* "opengl/legacy/horoball_scene.pyx":109
 *         z = z - (z.imag//self.meridian.imag)*self.meridian
 *         z -= 0.5*self.meridian.imag*1j
 *         z += 0.5*self.longitude.real             # <<<<<<<<<<<<<<
 *         z = z - (z.real//self.longitude.real)*self.longitude
 *         z -= 0.5*self.longitude
*/
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->longitude, __pyx_mstate_global->__pyx_n_u_real); if (unlikely(!__pyx_t_3)) __PYX_ERR(25, 109, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyNumber_Multiply(__pyx_mstate_global->__pyx_float_0_5, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 109, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_z, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(25, 109, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF_SET(__pyx_v_z, __pyx_t_3);
  __pyx_t_3 = 0;

  /* "opengl/legacy/horoball_scene.pyx":110
 *         z -= 0.5*self.meridian.imag*1j
 *         z += 0.5*self.longitude.real
 *         z = z - (z.real//self.longitude.real)*self.longitude             # <<<<<<<<<<<<<<
 *         z -= 0.5*self.longitude
 *         self.offset = z
*/
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_z, __pyx_mstate_global->__pyx_n_u_real); if (unlikely(!__pyx_t_3)) __PYX_ERR(25, 110, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->longitude, __pyx_mstate_global->__pyx_n_u_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 110, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = PyNumber_FloorDivide(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 110, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_Multiply(__pyx_t_5, __pyx_v_self->longitude); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 110, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyNumber_Subtract(__pyx_v_z, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 110, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF_SET(__pyx_v_z, __pyx_t_5);
  __pyx_t_5 = 0;

  /* "opengl/legacy/horoball_scene.pyx":111
 *         z += 0.5*self.longitude.real
 *         z = z - (z.real//self.longitude.real)*self.longitude
 *         z -= 0.5*self.longitude             # <<<<<<<<<<<<<<
 *         self.offset = z
 * 
*/
  __pyx_t_5 = PyNumber_Multiply(__pyx_mstate_global->__pyx_float_0_5, __pyx_v_self->longitude); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 111, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = PyNumber_InPlaceSubtract(__pyx_v_z, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 111, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF_SET(__pyx_v_z, __pyx_t_2);
  __pyx_t_2 = 0;

  /* "opengl/legacy/horoball_scene.pyx":112
 *         z = z - (z.real//self.longitude.real)*self.longitude
 *         z -= 0.5*self.longitude
 *         self.offset = z             # <<<<<<<<<<<<<<
 * 
 *     cdef right_top(self):
*/
  __Pyx_INCREF(__pyx_v_z);
  __Pyx_GIVEREF(__pyx_v_z);
  __Pyx_GOTREF(__pyx_v_self->offset);
  __Pyx_DECREF(__pyx_v_self->offset);
  __pyx_v_self->offset = __pyx_v_z;

  /* "opengl/legacy/horoball_scene.pyx":97
 *                 self.shifts.append((m,n))
 * 
 *     def translate(self, z):             # <<<<<<<<<<<<<<
 *         """
 *         Translate modulo the cusp stabilizer.
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("CyOpenGL.HoroballScene.translate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_z);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opengl/legacy/horoball_scene.pyx":114
 *         self.offset = z
 * 
 *     cdef right_top(self):             # <<<<<<<<<<<<<<
 *         cdef GLfloat proj[16]
 * 
*/

static PyObject *__pyx_f_8CyOpenGL_13HoroballScene_right_top(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_HoroballScene *__pyx_v_self) {
  GLfloat __pyx_v_proj[16];
  float __pyx_v_x;
  float __pyx_v_y;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  float __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_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("right_top", 0);

  /* "opengl/legacy/horoball_scene.pyx":117
 *         cdef GLfloat proj[16]
 * 
 *         glGetFloatv(GL_PROJECTION_MATRIX, proj)             # <<<<<<<<<<<<<<
 *         x = abs(<float>proj[0])
 *         y = abs(<float>proj[5])
*/
  glGetFloatv(GL_PROJECTION_MATRIX, __pyx_v_proj);

  /* "opengl/legacy/horoball_scene.pyx":118
 * 
 *         glGetFloatv(GL_PROJECTION_MATRIX, proj)
 *         x = abs(<float>proj[0])             # <<<<<<<<<<<<<<
 *         y = abs(<float>proj[5])
 *         if x < 1e-4 or y < 1e-4:
*/
  __pyx_t_1 = fabsf(((float)(__pyx_v_proj[0]))); 
  __pyx_v_x = __pyx_t_1;

  /* "opengl/legacy/horoball_scene.pyx":119
 *         glGetFloatv(GL_PROJECTION_MATRIX, proj)
 *         x = abs(<float>proj[0])
 *         y = abs(<float>proj[5])             # <<<<<<<<<<<<<<
 *         if x < 1e-4 or y < 1e-4:
 *             return (1.0, 1.0)
*/
  __pyx_t_1 = fabsf(((float)(__pyx_v_proj[5]))); 
  __pyx_v_y = __pyx_t_1;

  /* "opengl/legacy/horoball_scene.pyx":120
 *         x = abs(<float>proj[0])
 *         y = abs(<float>proj[5])
 *         if x < 1e-4 or y < 1e-4:             # <<<<<<<<<<<<<<
 *             return (1.0, 1.0)
 * 
*/
  __pyx_t_3 = (__pyx_v_x < 1e-4);
  if (!__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = (__pyx_v_y < 1e-4);
  __pyx_t_2 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "opengl/legacy/horoball_scene.pyx":121
 *         y = abs(<float>proj[5])
 *         if x < 1e-4 or y < 1e-4:
 *             return (1.0, 1.0)             # <<<<<<<<<<<<<<
 * 
 *         return (1.0/x, 1.0/y)
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_tuple[7]);
    __pyx_r = __pyx_mstate_global->__pyx_tuple[7];
    goto __pyx_L0;

    /* "opengl/legacy/horoball_scene.pyx":120
 *         x = abs(<float>proj[0])
 *         y = abs(<float>proj[5])
 *         if x < 1e-4 or y < 1e-4:             # <<<<<<<<<<<<<<
 *             return (1.0, 1.0)
 * 
*/
  }

  /* "opengl/legacy/horoball_scene.pyx":123
 *             return (1.0, 1.0)
 * 
 *         return (1.0/x, 1.0/y)             # <<<<<<<<<<<<<<
 * 
 *     cdef gl_compile(self):
*/
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(__pyx_v_x == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "float division");
    __PYX_ERR(25, 123, __pyx_L1_error)
  }
  __pyx_t_4 = PyFloat_FromDouble((1.0 / ((double)__pyx_v_x))); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 123, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (unlikely(__pyx_v_y == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "float division");
    __PYX_ERR(25, 123, __pyx_L1_error)
  }
  __pyx_t_5 = PyFloat_FromDouble((1.0 / ((double)__pyx_v_y))); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 123, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 123, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4) != (0)) __PYX_ERR(25, 123, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5) != (0)) __PYX_ERR(25, 123, __pyx_L1_error);
  __pyx_t_4 = 0;
  __pyx_t_5 = 0;
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 0;
  goto __pyx_L0;

  /* "opengl/legacy/horoball_scene.pyx":114
 *         self.offset = z
 * 
 *     cdef right_top(self):             # <<<<<<<<<<<<<<
 *         cdef GLfloat proj[16]
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("CyOpenGL.HoroballScene.right_top", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opengl/legacy/horoball_scene.pyx":125
 *         return (1.0/x, 1.0/y)
 * 
 *     cdef gl_compile(self):             # <<<<<<<<<<<<<<
 *         """
 *         Build the display lists for all of the component objects.
*/

static PyObject *__pyx_f_8CyOpenGL_13HoroballScene_gl_compile(struct __pyx_obj_8CyOpenGL_HoroballScene *__pyx_v_self) {
  PyObject *__pyx_v_right = NULL;
  PyObject *__pyx_v_top = NULL;
  PyObject *__pyx_v_R = NULL;
  PyObject *__pyx_v_T = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *(*__pyx_t_6)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("gl_compile", 0);

  /* "opengl/legacy/horoball_scene.pyx":129
 *         Build the display lists for all of the component objects.
 *         """
 *         self.pgram.build_display_list(self.longitude, self.meridian)             # <<<<<<<<<<<<<<
 *         right, top = self.right_top()
 *         R = right + 2.0 + 0.5*self.longitude.real
*/
  __pyx_t_2 = __pyx_v_self->pgram;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_self->longitude, __pyx_v_self->meridian};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_build_display_list, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 129, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/legacy/horoball_scene.pyx":130
 *         """
 *         self.pgram.build_display_list(self.longitude, self.meridian)
 *         right, top = self.right_top()             # <<<<<<<<<<<<<<
 *         R = right + 2.0 + 0.5*self.longitude.real
 *         T = top + 2.0 + 0.5*self.meridian.imag
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_8CyOpenGL_HoroballScene *)__pyx_v_self->__pyx_vtab)->right_top(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 130, __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(25, 130, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
      __Pyx_INCREF(__pyx_t_2);
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_4);
    } else {
      __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 130, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_2);
      __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 130, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_4);
    }
    #else
    __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 130, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 130, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 130, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_5);
    index = 0; __pyx_t_2 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 1; __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), 2) < (0)) __PYX_ERR(25, 130, __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(25, 130, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  __pyx_v_right = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_v_top = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "opengl/legacy/horoball_scene.pyx":131
 *         self.pgram.build_display_list(self.longitude, self.meridian)
 *         right, top = self.right_top()
 *         R = right + 2.0 + 0.5*self.longitude.real             # <<<<<<<<<<<<<<
 *         T = top + 2.0 + 0.5*self.meridian.imag
 *         self.cusp_view.build_display_list(R, T)
*/
  __pyx_t_1 = __Pyx_PyFloat_AddObjC(__pyx_v_right, __pyx_mstate_global->__pyx_float_2_0, 2.0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 131, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->longitude, __pyx_mstate_global->__pyx_n_u_real); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 131, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = PyNumber_Multiply(__pyx_mstate_global->__pyx_float_0_5, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 131, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 131, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_R = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "opengl/legacy/horoball_scene.pyx":132
 *         right, top = self.right_top()
 *         R = right + 2.0 + 0.5*self.longitude.real
 *         T = top + 2.0 + 0.5*self.meridian.imag             # <<<<<<<<<<<<<<
 *         self.cusp_view.build_display_list(R, T)
 *         self.build_shifts(R, T)
*/
  __pyx_t_4 = __Pyx_PyFloat_AddObjC(__pyx_v_top, __pyx_mstate_global->__pyx_float_2_0, 2.0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 132, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->meridian, __pyx_mstate_global->__pyx_n_u_imag); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 132, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyNumber_Multiply(__pyx_mstate_global->__pyx_float_0_5, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 132, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_Add(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 132, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_T = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "opengl/legacy/horoball_scene.pyx":133
 *         R = right + 2.0 + 0.5*self.longitude.real
 *         T = top + 2.0 + 0.5*self.meridian.imag
 *         self.cusp_view.build_display_list(R, T)             # <<<<<<<<<<<<<<
 *         self.build_shifts(R, T)
 *         self.light_Ford.build_display_list(self.shifts, dark=False)
*/
  __pyx_t_1 = __pyx_v_self->cusp_view;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_v_R, __pyx_v_T};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_build_display_list, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 133, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opengl/legacy/horoball_scene.pyx":134
 *         T = top + 2.0 + 0.5*self.meridian.imag
 *         self.cusp_view.build_display_list(R, T)
 *         self.build_shifts(R, T)             # <<<<<<<<<<<<<<
 *         self.light_Ford.build_display_list(self.shifts, dark=False)
 *         self.dark_Ford.build_display_list(self.shifts, dark=True)
*/
  __pyx_t_2 = ((struct __pyx_vtabstruct_8CyOpenGL_HoroballScene *)__pyx_v_self->__pyx_vtab)->build_shifts(__pyx_v_self, __pyx_v_R, __pyx_v_T); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 134, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opengl/legacy/horoball_scene.pyx":135
 *         self.cusp_view.build_display_list(R, T)
 *         self.build_shifts(R, T)
 *         self.light_Ford.build_display_list(self.shifts, dark=False)             # <<<<<<<<<<<<<<
 *         self.dark_Ford.build_display_list(self.shifts, dark=True)
 *         self.light_tri.build_display_list(self.shifts, dark=False)
*/
  __pyx_t_1 = __pyx_v_self->light_Ford;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_1, __pyx_v_self->shifts};
    __pyx_t_4 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 135, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dark, Py_False, __pyx_t_4, __pyx_callargs+2, 0) < (0)) __PYX_ERR(25, 135, __pyx_L1_error)
    __pyx_t_2 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_build_display_list, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 135, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opengl/legacy/horoball_scene.pyx":136
 *         self.build_shifts(R, T)
 *         self.light_Ford.build_display_list(self.shifts, dark=False)
 *         self.dark_Ford.build_display_list(self.shifts, dark=True)             # <<<<<<<<<<<<<<
 *         self.light_tri.build_display_list(self.shifts, dark=False)
 *         self.dark_tri.build_display_list(self.shifts, dark=True)
*/
  __pyx_t_4 = __pyx_v_self->dark_Ford;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_4, __pyx_v_self->shifts};
    __pyx_t_1 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 136, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dark, Py_True, __pyx_t_1, __pyx_callargs+2, 0) < (0)) __PYX_ERR(25, 136, __pyx_L1_error)
    __pyx_t_2 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_build_display_list, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_1);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 136, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opengl/legacy/horoball_scene.pyx":137
 *         self.light_Ford.build_display_list(self.shifts, dark=False)
 *         self.dark_Ford.build_display_list(self.shifts, dark=True)
 *         self.light_tri.build_display_list(self.shifts, dark=False)             # <<<<<<<<<<<<<<
 *         self.dark_tri.build_display_list(self.shifts, dark=True)
 *         self.labels.build_display_list(self.shifts)
*/
  __pyx_t_1 = __pyx_v_self->light_tri;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_1, __pyx_v_self->shifts};
    __pyx_t_4 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 137, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dark, Py_False, __pyx_t_4, __pyx_callargs+2, 0) < (0)) __PYX_ERR(25, 137, __pyx_L1_error)
    __pyx_t_2 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_build_display_list, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 137, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opengl/legacy/horoball_scene.pyx":138
 *         self.dark_Ford.build_display_list(self.shifts, dark=True)
 *         self.light_tri.build_display_list(self.shifts, dark=False)
 *         self.dark_tri.build_display_list(self.shifts, dark=True)             # <<<<<<<<<<<<<<
 *         self.labels.build_display_list(self.shifts)
 * 
*/
  __pyx_t_4 = __pyx_v_self->dark_tri;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_4, __pyx_v_self->shifts};
    __pyx_t_1 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 138, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dark, Py_True, __pyx_t_1, __pyx_callargs+2, 0) < (0)) __PYX_ERR(25, 138, __pyx_L1_error)
    __pyx_t_2 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_build_display_list, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_1);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 138, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opengl/legacy/horoball_scene.pyx":139
 *         self.light_tri.build_display_list(self.shifts, dark=False)
 *         self.dark_tri.build_display_list(self.shifts, dark=True)
 *         self.labels.build_display_list(self.shifts)             # <<<<<<<<<<<<<<
 * 
 *     cdef draw_segments(self, ford_height, pgram_height):
*/
  __pyx_t_1 = __pyx_v_self->labels;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_self->shifts};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_build_display_list, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 139, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opengl/legacy/horoball_scene.pyx":125
 *         return (1.0/x, 1.0/y)
 * 
 *     cdef gl_compile(self):             # <<<<<<<<<<<<<<
 *         """
 *         Build the display lists for all of the component objects.
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("CyOpenGL.HoroballScene.gl_compile", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_right);
  __Pyx_XDECREF(__pyx_v_top);
  __Pyx_XDECREF(__pyx_v_R);
  __Pyx_XDECREF(__pyx_v_T);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opengl/legacy/horoball_scene.pyx":141
 *         self.labels.build_display_list(self.shifts)
 * 
 *     cdef draw_segments(self, ford_height, pgram_height):             # <<<<<<<<<<<<<<
 *         with_horoballs = self.horo_var.get()
 *         glPushMatrix()
*/

static PyObject *__pyx_f_8CyOpenGL_13HoroballScene_draw_segments(struct __pyx_obj_8CyOpenGL_HoroballScene *__pyx_v_self, PyObject *__pyx_v_ford_height, PyObject *__pyx_v_pgram_height) {
  PyObject *__pyx_v_with_horoballs = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  GLfloat __pyx_t_4;
  GLfloat __pyx_t_5;
  GLfloat __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("draw_segments", 0);

  /* "opengl/legacy/horoball_scene.pyx":142
 * 
 *     cdef draw_segments(self, ford_height, pgram_height):
 *         with_horoballs = self.horo_var.get()             # <<<<<<<<<<<<<<
 *         glPushMatrix()
 *         glTranslatef(self.offset.real, self.offset.imag, ford_height)
*/
  __pyx_t_2 = __pyx_v_self->horo_var;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 142, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_with_horoballs = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "opengl/legacy/horoball_scene.pyx":143
 *     cdef draw_segments(self, ford_height, pgram_height):
 *         with_horoballs = self.horo_var.get()
 *         glPushMatrix()             # <<<<<<<<<<<<<<
 *         glTranslatef(self.offset.real, self.offset.imag, ford_height)
 *         if self.tri_var.get():
*/
  glPushMatrix();

  /* "opengl/legacy/horoball_scene.pyx":144
 *         with_horoballs = self.horo_var.get()
 *         glPushMatrix()
 *         glTranslatef(self.offset.real, self.offset.imag, ford_height)             # <<<<<<<<<<<<<<
 *         if self.tri_var.get():
 *             if with_horoballs:
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->offset, __pyx_mstate_global->__pyx_n_u_real); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 144, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_4 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(25, 144, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->offset, __pyx_mstate_global->__pyx_n_u_imag); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 144, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_5 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(25, 144, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = __Pyx_PyFloat_AsFloat(__pyx_v_ford_height); if (unlikely((__pyx_t_6 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(25, 144, __pyx_L1_error)
  glTranslatef(__pyx_t_4, __pyx_t_5, __pyx_t_6);

  /* "opengl/legacy/horoball_scene.pyx":145
 *         glPushMatrix()
 *         glTranslatef(self.offset.real, self.offset.imag, ford_height)
 *         if self.tri_var.get():             # <<<<<<<<<<<<<<
 *             if with_horoballs:
 *                 self.light_tri.display()
*/
  __pyx_t_2 = __pyx_v_self->tri_var;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 145, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(25, 145, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_7) {

    /* "opengl/legacy/horoball_scene.pyx":146
 *         glTranslatef(self.offset.real, self.offset.imag, ford_height)
 *         if self.tri_var.get():
 *             if with_horoballs:             # <<<<<<<<<<<<<<
 *                 self.light_tri.display()
 *             else:
*/
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_with_horoballs); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(25, 146, __pyx_L1_error)
    if (__pyx_t_7) {

      /* "opengl/legacy/horoball_scene.pyx":147
 *         if self.tri_var.get():
 *             if with_horoballs:
 *                 self.light_tri.display()             # <<<<<<<<<<<<<<
 *             else:
 *                 self.dark_tri.display()
*/
      __pyx_t_2 = __pyx_v_self->light_tri;
      __Pyx_INCREF(__pyx_t_2);
      __pyx_t_3 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
        __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_display, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 147, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "opengl/legacy/horoball_scene.pyx":146
 *         glTranslatef(self.offset.real, self.offset.imag, ford_height)
 *         if self.tri_var.get():
 *             if with_horoballs:             # <<<<<<<<<<<<<<
 *                 self.light_tri.display()
 *             else:
*/
      goto __pyx_L4;
    }

    /* "opengl/legacy/horoball_scene.pyx":149
 *                 self.light_tri.display()
 *             else:
 *                 self.dark_tri.display()             # <<<<<<<<<<<<<<
 *         if self.Ford_var.get():
 *             if with_horoballs:
*/
    /*else*/ {
      __pyx_t_2 = __pyx_v_self->dark_tri;
      __Pyx_INCREF(__pyx_t_2);
      __pyx_t_3 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
        __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_display, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 149, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __pyx_L4:;

    /* "opengl/legacy/horoball_scene.pyx":145
 *         glPushMatrix()
 *         glTranslatef(self.offset.real, self.offset.imag, ford_height)
 *         if self.tri_var.get():             # <<<<<<<<<<<<<<
 *             if with_horoballs:
 *                 self.light_tri.display()
*/
  }

  /* "opengl/legacy/horoball_scene.pyx":150
 *             else:
 *                 self.dark_tri.display()
 *         if self.Ford_var.get():             # <<<<<<<<<<<<<<
 *             if with_horoballs:
 *                 self.light_Ford.display()
*/
  __pyx_t_2 = __pyx_v_self->Ford_var;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 150, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(25, 150, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_7) {

    /* "opengl/legacy/horoball_scene.pyx":151
 *                 self.dark_tri.display()
 *         if self.Ford_var.get():
 *             if with_horoballs:             # <<<<<<<<<<<<<<
 *                 self.light_Ford.display()
 *             else:
*/
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_with_horoballs); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(25, 151, __pyx_L1_error)
    if (__pyx_t_7) {

      /* "opengl/legacy/horoball_scene.pyx":152
 *         if self.Ford_var.get():
 *             if with_horoballs:
 *                 self.light_Ford.display()             # <<<<<<<<<<<<<<
 *             else:
 *                 self.dark_Ford.display()
*/
      __pyx_t_2 = __pyx_v_self->light_Ford;
      __Pyx_INCREF(__pyx_t_2);
      __pyx_t_3 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
        __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_display, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 152, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "opengl/legacy/horoball_scene.pyx":151
 *                 self.dark_tri.display()
 *         if self.Ford_var.get():
 *             if with_horoballs:             # <<<<<<<<<<<<<<
 *                 self.light_Ford.display()
 *             else:
*/
      goto __pyx_L6;
    }

    /* "opengl/legacy/horoball_scene.pyx":154
 *                 self.light_Ford.display()
 *             else:
 *                 self.dark_Ford.display()             # <<<<<<<<<<<<<<
 *         glPopMatrix()
 *         if self.pgram_var.get():
*/
    /*else*/ {
      __pyx_t_2 = __pyx_v_self->dark_Ford;
      __Pyx_INCREF(__pyx_t_2);
      __pyx_t_3 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
        __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_display, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 154, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __pyx_L6:;

    /* "opengl/legacy/horoball_scene.pyx":150
 *             else:
 *                 self.dark_tri.display()
 *         if self.Ford_var.get():             # <<<<<<<<<<<<<<
 *             if with_horoballs:
 *                 self.light_Ford.display()
*/
  }

  /* "opengl/legacy/horoball_scene.pyx":155
 *             else:
 *                 self.dark_Ford.display()
 *         glPopMatrix()             # <<<<<<<<<<<<<<
 *         if self.pgram_var.get():
 *             glPushMatrix()
*/
  glPopMatrix();

  /* "opengl/legacy/horoball_scene.pyx":156
 *                 self.dark_Ford.display()
 *         glPopMatrix()
 *         if self.pgram_var.get():             # <<<<<<<<<<<<<<
 *             glPushMatrix()
 *             glTranslatef(0.0, 0.0, pgram_height)
*/
  __pyx_t_2 = __pyx_v_self->pgram_var;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 156, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(25, 156, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_7) {

    /* "opengl/legacy/horoball_scene.pyx":157
 *         glPopMatrix()
 *         if self.pgram_var.get():
 *             glPushMatrix()             # <<<<<<<<<<<<<<
 *             glTranslatef(0.0, 0.0, pgram_height)
 *             self.pgram.display()
*/
    glPushMatrix();

    /* "opengl/legacy/horoball_scene.pyx":158
 *         if self.pgram_var.get():
 *             glPushMatrix()
 *             glTranslatef(0.0, 0.0, pgram_height)             # <<<<<<<<<<<<<<
 *             self.pgram.display()
 *             glPopMatrix()
*/
    __pyx_t_6 = __Pyx_PyFloat_AsFloat(__pyx_v_pgram_height); if (unlikely((__pyx_t_6 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(25, 158, __pyx_L1_error)
    glTranslatef(0.0, 0.0, __pyx_t_6);

    /* "opengl/legacy/horoball_scene.pyx":159
 *             glPushMatrix()
 *             glTranslatef(0.0, 0.0, pgram_height)
 *             self.pgram.display()             # <<<<<<<<<<<<<<
 *             glPopMatrix()
 * 
*/
    __pyx_t_2 = __pyx_v_self->pgram;
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_3 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_display, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 159, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "opengl/legacy/horoball_scene.pyx":160
 *             glTranslatef(0.0, 0.0, pgram_height)
 *             self.pgram.display()
 *             glPopMatrix()             # <<<<<<<<<<<<<<
 * 
 *     def draw(self, *args):
*/
    glPopMatrix();

    /* "opengl/legacy/horoball_scene.pyx":156
 *                 self.dark_Ford.display()
 *         glPopMatrix()
 *         if self.pgram_var.get():             # <<<<<<<<<<<<<<
 *             glPushMatrix()
 *             glTranslatef(0.0, 0.0, pgram_height)
*/
  }

  /* "opengl/legacy/horoball_scene.pyx":141
 *         self.labels.build_display_list(self.shifts)
 * 
 *     cdef draw_segments(self, ford_height, pgram_height):             # <<<<<<<<<<<<<<
 *         with_horoballs = self.horo_var.get()
 *         glPushMatrix()
*/

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

/* "opengl/legacy/horoball_scene.pyx":162
 *             glPopMatrix()
 * 
 *     def draw(self, *args):             # <<<<<<<<<<<<<<
 *         """
 *         The scene is drawn translated by self.offset, but the
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_13HoroballScene_13draw(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_13HoroballScene_12draw, "HoroballScene.draw(self, *args)\n\nThe scene is drawn translated by self.offset, but the\nparallelogram stays fixed.");
static PyMethodDef __pyx_mdef_8CyOpenGL_13HoroballScene_13draw = {"draw", (PyCFunction)(void(*)(void))(PyCFunctionWithKeywords)__pyx_pw_8CyOpenGL_13HoroballScene_13draw, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8CyOpenGL_13HoroballScene_12draw};
static PyObject *__pyx_pw_8CyOpenGL_13HoroballScene_13draw(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_args = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("draw (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("draw", __pyx_kwds); return NULL;}
  __Pyx_INCREF(__pyx_args);
  __pyx_v_args = __pyx_args;
  __pyx_r = __pyx_pf_8CyOpenGL_13HoroballScene_12draw(((struct __pyx_obj_8CyOpenGL_HoroballScene *)__pyx_v_self), __pyx_v_args);

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

static PyObject *__pyx_pf_8CyOpenGL_13HoroballScene_12draw(struct __pyx_obj_8CyOpenGL_HoroballScene *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_args) {
  double __pyx_v_label_height;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  GLfloat __pyx_t_5;
  GLfloat __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("draw", 0);

  /* "opengl/legacy/horoball_scene.pyx":167
 *         parallelogram stays fixed.
 *         """
 *         if self.nbhd is None:             # <<<<<<<<<<<<<<
 *             return
 *         glPushMatrix()
*/
  __pyx_t_1 = (__pyx_v_self->nbhd == Py_None);
  if (__pyx_t_1) {

    /* "opengl/legacy/horoball_scene.pyx":168
 *         """
 *         if self.nbhd is None:
 *             return             # <<<<<<<<<<<<<<
 *         glPushMatrix()
 *         if self.flipped:
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "opengl/legacy/horoball_scene.pyx":167
 *         parallelogram stays fixed.
 *         """
 *         if self.nbhd is None:             # <<<<<<<<<<<<<<
 *             return
 *         glPushMatrix()
*/
  }

  /* "opengl/legacy/horoball_scene.pyx":169
 *         if self.nbhd is None:
 *             return
 *         glPushMatrix()             # <<<<<<<<<<<<<<
 *         if self.flipped:
 *             self.draw_segments(-2.0, -2.2)
*/
  glPushMatrix();

  /* "opengl/legacy/horoball_scene.pyx":170
 *             return
 *         glPushMatrix()
 *         if self.flipped:             # <<<<<<<<<<<<<<
 *             self.draw_segments(-2.0, -2.2)
 *             label_height = -2.4
*/
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->flipped); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(25, 170, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "opengl/legacy/horoball_scene.pyx":171
 *         glPushMatrix()
 *         if self.flipped:
 *             self.draw_segments(-2.0, -2.2)             # <<<<<<<<<<<<<<
 *             label_height = -2.4
 *         else:
*/
    __pyx_t_2 = ((struct __pyx_vtabstruct_8CyOpenGL_HoroballScene *)__pyx_v_self->__pyx_vtab)->draw_segments(__pyx_v_self, __pyx_mstate_global->__pyx_float_neg_2_0, __pyx_mstate_global->__pyx_float_neg_2_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 171, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "opengl/legacy/horoball_scene.pyx":172
 *         if self.flipped:
 *             self.draw_segments(-2.0, -2.2)
 *             label_height = -2.4             # <<<<<<<<<<<<<<
 *         else:
 *             self.draw_segments(2.0, 2.2)
*/
    __pyx_v_label_height = -2.4;

    /* "opengl/legacy/horoball_scene.pyx":170
 *             return
 *         glPushMatrix()
 *         if self.flipped:             # <<<<<<<<<<<<<<
 *             self.draw_segments(-2.0, -2.2)
 *             label_height = -2.4
*/
    goto __pyx_L4;
  }

  /* "opengl/legacy/horoball_scene.pyx":174
 *             label_height = -2.4
 *         else:
 *             self.draw_segments(2.0, 2.2)             # <<<<<<<<<<<<<<
 *             label_height = 2.4
 *         if self.horo_var.get():
*/
  /*else*/ {
    __pyx_t_2 = ((struct __pyx_vtabstruct_8CyOpenGL_HoroballScene *)__pyx_v_self->__pyx_vtab)->draw_segments(__pyx_v_self, __pyx_mstate_global->__pyx_float_2_0, __pyx_mstate_global->__pyx_float_2_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 174, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "opengl/legacy/horoball_scene.pyx":175
 *         else:
 *             self.draw_segments(2.0, 2.2)
 *             label_height = 2.4             # <<<<<<<<<<<<<<
 *         if self.horo_var.get():
 *             glPushMatrix()
*/
    __pyx_v_label_height = 2.4;
  }
  __pyx_L4:;

  /* "opengl/legacy/horoball_scene.pyx":176
 *             self.draw_segments(2.0, 2.2)
 *             label_height = 2.4
 *         if self.horo_var.get():             # <<<<<<<<<<<<<<
 *             glPushMatrix()
 *             glTranslatef(self.offset.real, self.offset.imag, 0.0)
*/
  __pyx_t_3 = __pyx_v_self->horo_var;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 176, __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(25, 176, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_1) {

    /* "opengl/legacy/horoball_scene.pyx":177
 *             label_height = 2.4
 *         if self.horo_var.get():
 *             glPushMatrix()             # <<<<<<<<<<<<<<
 *             glTranslatef(self.offset.real, self.offset.imag, 0.0)
 *             self.cusp_view.display()
*/
    glPushMatrix();

    /* "opengl/legacy/horoball_scene.pyx":178
 *         if self.horo_var.get():
 *             glPushMatrix()
 *             glTranslatef(self.offset.real, self.offset.imag, 0.0)             # <<<<<<<<<<<<<<
 *             self.cusp_view.display()
 *             glPopMatrix()
*/
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->offset, __pyx_mstate_global->__pyx_n_u_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 178, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_5 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(25, 178, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->offset, __pyx_mstate_global->__pyx_n_u_imag); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 178, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = __Pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_6 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(25, 178, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    glTranslatef(__pyx_t_5, __pyx_t_6, 0.0);

    /* "opengl/legacy/horoball_scene.pyx":179
 *             glPushMatrix()
 *             glTranslatef(self.offset.real, self.offset.imag, 0.0)
 *             self.cusp_view.display()             # <<<<<<<<<<<<<<
 *             glPopMatrix()
 *         if self.label_var.get():
*/
    __pyx_t_3 = __pyx_v_self->cusp_view;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_display, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 179, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "opengl/legacy/horoball_scene.pyx":180
 *             glTranslatef(self.offset.real, self.offset.imag, 0.0)
 *             self.cusp_view.display()
 *             glPopMatrix()             # <<<<<<<<<<<<<<
 *         if self.label_var.get():
 *             glPushMatrix()
*/
    glPopMatrix();

    /* "opengl/legacy/horoball_scene.pyx":176
 *             self.draw_segments(2.0, 2.2)
 *             label_height = 2.4
 *         if self.horo_var.get():             # <<<<<<<<<<<<<<
 *             glPushMatrix()
 *             glTranslatef(self.offset.real, self.offset.imag, 0.0)
*/
  }

  /* "opengl/legacy/horoball_scene.pyx":181
 *             self.cusp_view.display()
 *             glPopMatrix()
 *         if self.label_var.get():             # <<<<<<<<<<<<<<
 *             glPushMatrix()
 *             glTranslatef(self.offset.real, self.offset.imag, label_height)
*/
  __pyx_t_3 = __pyx_v_self->label_var;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 181, __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(25, 181, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_1) {

    /* "opengl/legacy/horoball_scene.pyx":182
 *             glPopMatrix()
 *         if self.label_var.get():
 *             glPushMatrix()             # <<<<<<<<<<<<<<
 *             glTranslatef(self.offset.real, self.offset.imag, label_height)
 *             self.labels.display()
*/
    glPushMatrix();

    /* "opengl/legacy/horoball_scene.pyx":183
 *         if self.label_var.get():
 *             glPushMatrix()
 *             glTranslatef(self.offset.real, self.offset.imag, label_height)             # <<<<<<<<<<<<<<
 *             self.labels.display()
 *             glPopMatrix()
*/
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->offset, __pyx_mstate_global->__pyx_n_u_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 183, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = __Pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_6 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(25, 183, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->offset, __pyx_mstate_global->__pyx_n_u_imag); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 183, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_5 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(25, 183, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    glTranslatef(__pyx_t_6, __pyx_t_5, __pyx_v_label_height);

    /* "opengl/legacy/horoball_scene.pyx":184
 *             glPushMatrix()
 *             glTranslatef(self.offset.real, self.offset.imag, label_height)
 *             self.labels.display()             # <<<<<<<<<<<<<<
 *             glPopMatrix()
 *         glPopMatrix()
*/
    __pyx_t_3 = __pyx_v_self->labels;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_display, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 184, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "opengl/legacy/horoball_scene.pyx":185
 *             glTranslatef(self.offset.real, self.offset.imag, label_height)
 *             self.labels.display()
 *             glPopMatrix()             # <<<<<<<<<<<<<<
 *         glPopMatrix()
*/
    glPopMatrix();

    /* "opengl/legacy/horoball_scene.pyx":181
 *             self.cusp_view.display()
 *             glPopMatrix()
 *         if self.label_var.get():             # <<<<<<<<<<<<<<
 *             glPushMatrix()
 *             glTranslatef(self.offset.real, self.offset.imag, label_height)
*/
  }

  /* "opengl/legacy/horoball_scene.pyx":186
 *             self.labels.display()
 *             glPopMatrix()
 *         glPopMatrix()             # <<<<<<<<<<<<<<
*/
  glPopMatrix();

  /* "opengl/legacy/horoball_scene.pyx":162
 *             glPopMatrix()
 * 
 *     def draw(self, *args):             # <<<<<<<<<<<<<<
 *         """
 *         The scene is drawn translated by self.offset, but the
*/

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

/* "opengl/legacy/raw_openGL_widget.pyx":19
 *     current_widget = None
 * 
 *     def __init__(self, parent, cnf={}, **kw):             # <<<<<<<<<<<<<<
 *         """
 *         Create an OpenGL widget, arguments are passed down to
*/

static PyObject *__pyx_pf_8CyOpenGL_8__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__defaults__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_self)->arg0);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_self)->arg0);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_self)->arg0) != (0)) __PYX_ERR(5, 19, __pyx_L1_error);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1) != (0)) __PYX_ERR(5, 19, __pyx_L1_error);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None) != (0)) __PYX_ERR(5, 19, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("CyOpenGL.__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_8CyOpenGL_15RawOpenGLWidget_1__init__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_15RawOpenGLWidget___init__, "RawOpenGLWidget.__init__(self, parent, cnf={}, **kw)\n\nCreate an OpenGL widget, arguments are passed down to\nthe togl Tk widget constructor.");
static PyMethodDef __pyx_mdef_8CyOpenGL_15RawOpenGLWidget_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_15RawOpenGLWidget_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_15RawOpenGLWidget___init__};
static PyObject *__pyx_pw_8CyOpenGL_15RawOpenGLWidget_1__init__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_parent = 0;
  PyObject *__pyx_v_cnf = 0;
  PyObject *__pyx_v_kw = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  __pyx_v_kw = PyDict_New(); if (unlikely(!__pyx_v_kw)) return NULL;
  __Pyx_GOTREF(__pyx_v_kw);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_parent,&__pyx_mstate_global->__pyx_n_u_cnf,0};
    struct __pyx_defaults *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_self);
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(5, 19, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(5, 19, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(5, 19, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(5, 19, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, __pyx_v_kw, values, kwd_pos_args, __pyx_kwds_len, "__init__", 1) < (0)) __PYX_ERR(5, 19, __pyx_L3_error)
      if (!values[2]) values[2] = __Pyx_NewRef(__pyx_dynamic_args->arg0);
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, i); __PYX_ERR(5, 19, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(5, 19, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(5, 19, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(5, 19, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef(__pyx_dynamic_args->arg0);
    }
    __pyx_v_self = values[0];
    __pyx_v_parent = values[1];
    __pyx_v_cnf = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, __pyx_nargs); __PYX_ERR(5, 19, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_DECREF(__pyx_v_kw); __pyx_v_kw = 0;
  __Pyx_AddTraceback("CyOpenGL.RawOpenGLWidget.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_15RawOpenGLWidget___init__(__pyx_self, __pyx_v_self, __pyx_v_parent, __pyx_v_cnf, __pyx_v_kw);

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

static PyObject *__pyx_pf_8CyOpenGL_15RawOpenGLWidget___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_parent, PyObject *__pyx_v_cnf, PyObject *__pyx_v_kw) {
  char *__pyx_v_missing_gl_function;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8[5];
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "opengl/legacy/raw_openGL_widget.pyx":25
 *         """
 * 
 *         super().__init__(parent, cnf, **kw)             # <<<<<<<<<<<<<<
 *         self.root = parent
 * 
*/
  __pyx_t_2 = NULL;
  __pyx_t_4 = NULL;
  __pyx_t_5 = __Pyx_CyFunction_GetClassObj(__pyx_self);
  if (!__pyx_t_5) { PyErr_SetString(PyExc_RuntimeError, "super(): empty __class__ cell"); __PYX_ERR(5, 25, __pyx_L1_error) }
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_t_5, __pyx_v_self};
    __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_super, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 25, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_init); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyDict_Copy(__pyx_v_kw); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = 1;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_6 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_parent, __pyx_v_cnf};
    __pyx_t_1 = __Pyx_PyObject_FastCallDict((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_3);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 25, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/legacy/raw_openGL_widget.pyx":26
 * 
 *         super().__init__(parent, cnf, **kw)
 *         self.root = parent             # <<<<<<<<<<<<<<
 * 
 *         self._initialized = False
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_root, __pyx_v_parent) < (0)) __PYX_ERR(5, 26, __pyx_L1_error)

  /* "opengl/legacy/raw_openGL_widget.pyx":28
 *         self.root = parent
 * 
 *         self._initialized = False             # <<<<<<<<<<<<<<
 * 
 *         # Switch to the GL context so that that we can call GLEW
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_initialized, Py_False) < (0)) __PYX_ERR(5, 28, __pyx_L1_error)

  /* "opengl/legacy/raw_openGL_widget.pyx":32
 *         # Switch to the GL context so that that we can call GLEW
 *         # initialize
 *         self.make_current()             # <<<<<<<<<<<<<<
 * 
 *         # Check that GLEW set all function pointers that we are calling
*/
  __pyx_t_5 = __pyx_v_self;
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_make_current, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 32, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/legacy/raw_openGL_widget.pyx":37
 *         # below.
 *         cdef char * missing_gl_function
 *         missing_gl_function = checkGlewForLegacyOpenGL()             # <<<<<<<<<<<<<<
 *         if missing_gl_function:
 *             raise Exception(
*/
  __pyx_v_missing_gl_function = checkGlewForLegacyOpenGL();

  /* "opengl/legacy/raw_openGL_widget.pyx":38
 *         cdef char * missing_gl_function
 *         missing_gl_function = checkGlewForLegacyOpenGL()
 *         if missing_gl_function:             # <<<<<<<<<<<<<<
 *             raise Exception(
 *                 ("Missing gl function: %s. Your graphics card probably does "
*/
  __pyx_t_7 = (__pyx_v_missing_gl_function != 0);
  if (unlikely(__pyx_t_7)) {

    /* "opengl/legacy/raw_openGL_widget.pyx":39
 *         missing_gl_function = checkGlewForLegacyOpenGL()
 *         if missing_gl_function:
 *             raise Exception(             # <<<<<<<<<<<<<<
 *                 ("Missing gl function: %s. Your graphics card probably does "
 *                  "not support the required OpenGL version (2.1). Your "
*/
    __pyx_t_5 = NULL;

    /* "opengl/legacy/raw_openGL_widget.pyx":42
 *                 ("Missing gl function: %s. Your graphics card probably does "
 *                  "not support the required OpenGL version (2.1). Your "
 *                  "OpenGL version is %s.") % (missing_gl_function,             # <<<<<<<<<<<<<<
 *                                              get_gl_string('GL_VERSION')))
 * 
*/
    __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_missing_gl_function); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 42, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_3), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 42, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "opengl/legacy/raw_openGL_widget.pyx":43
 *                  "not support the required OpenGL version (2.1). Your "
 *                  "OpenGL version is %s.") % (missing_gl_function,
 *                                              get_gl_string('GL_VERSION')))             # <<<<<<<<<<<<<<
 * 
 *     def make_current(self):
*/
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_get_gl_string); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 43, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_mstate_global->__pyx_tuple[8], NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 43, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_4), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 43, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_8[0] = __pyx_mstate_global->__pyx_kp_u_Missing_gl_function;
    __pyx_t_8[1] = __pyx_t_2;
    __pyx_t_8[2] = __pyx_mstate_global->__pyx_kp_u_Your_graphics_card_probably_doe;
    __pyx_t_8[3] = __pyx_t_3;
    __pyx_t_8[4] = __pyx_mstate_global->__pyx_kp_u__2;

    /* "opengl/legacy/raw_openGL_widget.pyx":40
 *         if missing_gl_function:
 *             raise Exception(
 *                 ("Missing gl function: %s. Your graphics card probably does "             # <<<<<<<<<<<<<<
 *                  "not support the required OpenGL version (2.1). Your "
 *                  "OpenGL version is %s.") % (missing_gl_function,
*/
    __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_8, 5, 21 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + 105 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3) + 1, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3));
    if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 40, __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_6 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_4};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_Exception)), __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 39, __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(5, 39, __pyx_L1_error)

    /* "opengl/legacy/raw_openGL_widget.pyx":38
 *         cdef char * missing_gl_function
 *         missing_gl_function = checkGlewForLegacyOpenGL()
 *         if missing_gl_function:             # <<<<<<<<<<<<<<
 *             raise Exception(
 *                 ("Missing gl function: %s. Your graphics card probably does "
*/
  }

  /* "opengl/legacy/raw_openGL_widget.pyx":19
 *     current_widget = None
 * 
 *     def __init__(self, parent, cnf={}, **kw):             # <<<<<<<<<<<<<<
 *         """
 *         Create an OpenGL widget, arguments are passed down to
*/

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

/* "opengl/legacy/raw_openGL_widget.pyx":45
 *                                              get_gl_string('GL_VERSION')))
 * 
 *     def make_current(self):             # <<<<<<<<<<<<<<
 *         """
 *         Makes this RawOpenGLWidget's GL context the current context
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_15RawOpenGLWidget_3make_current(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_15RawOpenGLWidget_2make_current, "RawOpenGLWidget.make_current(self)\n\nMakes this RawOpenGLWidget's GL context the current context\nso that all gl calls are destined for this widget.");
static PyMethodDef __pyx_mdef_8CyOpenGL_15RawOpenGLWidget_3make_current = {"make_current", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_15RawOpenGLWidget_3make_current, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_15RawOpenGLWidget_2make_current};
static PyObject *__pyx_pw_8CyOpenGL_15RawOpenGLWidget_3make_current(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_current (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(5, 45, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(5, 45, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "make_current", 0) < (0)) __PYX_ERR(5, 45, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("make_current", 1, 1, 1, i); __PYX_ERR(5, 45, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(5, 45, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("make_current", 1, 1, 1, __pyx_nargs); __PYX_ERR(5, 45, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("CyOpenGL.RawOpenGLWidget.make_current", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_15RawOpenGLWidget_2make_current(__pyx_self, __pyx_v_self);

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

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

  /* "opengl/legacy/raw_openGL_widget.pyx":50
 *         so that all gl calls are destined for this widget.
 *         """
 *         super().make_current()             # <<<<<<<<<<<<<<
 *         RawOpenGLWidget.current_widget =  self
 * 
*/
  __pyx_t_4 = NULL;
  __pyx_t_5 = __Pyx_CyFunction_GetClassObj(__pyx_self);
  if (!__pyx_t_5) { PyErr_SetString(PyExc_RuntimeError, "super(): empty __class__ cell"); __PYX_ERR(5, 50, __pyx_L1_error) }
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_t_5, __pyx_v_self};
    __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_super, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 50, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_2 = __pyx_t_3;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_make_current, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 50, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/legacy/raw_openGL_widget.pyx":51
 *         """
 *         super().make_current()
 *         RawOpenGLWidget.current_widget =  self             # <<<<<<<<<<<<<<
 * 
 *     def redraw(self):
*/
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_RawOpenGLWidget); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_current_widget, __pyx_v_self) < (0)) __PYX_ERR(5, 51, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/legacy/raw_openGL_widget.pyx":45
 *                                              get_gl_string('GL_VERSION')))
 * 
 *     def make_current(self):             # <<<<<<<<<<<<<<
 *         """
 *         Makes this RawOpenGLWidget's GL context the current context
*/

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

/* "opengl/legacy/raw_openGL_widget.pyx":53
 *         RawOpenGLWidget.current_widget =  self
 * 
 *     def redraw(self):             # <<<<<<<<<<<<<<
 *         """
 *         Some clients want to update state and do a redraw but the
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_15RawOpenGLWidget_5redraw(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_15RawOpenGLWidget_4redraw, "RawOpenGLWidget.redraw(self)\n\nSome clients want to update state and do a redraw but the\nGLCanvas is not in a state yet where we have a valid framebuffer.\n\nThese clients can call redraw that bails early if there is no\nvalid framebuffer yet.");
static PyMethodDef __pyx_mdef_8CyOpenGL_15RawOpenGLWidget_5redraw = {"redraw", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_15RawOpenGLWidget_5redraw, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_15RawOpenGLWidget_4redraw};
static PyObject *__pyx_pw_8CyOpenGL_15RawOpenGLWidget_5redraw(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("redraw (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(5, 53, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(5, 53, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "redraw", 0) < (0)) __PYX_ERR(5, 53, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("redraw", 1, 1, 1, i); __PYX_ERR(5, 53, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(5, 53, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("redraw", 1, 1, 1, __pyx_nargs); __PYX_ERR(5, 53, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("CyOpenGL.RawOpenGLWidget.redraw", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_15RawOpenGLWidget_4redraw(__pyx_self, __pyx_v_self);

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

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

  /* "opengl/legacy/raw_openGL_widget.pyx":61
 *         valid framebuffer yet.
 *         """
 *         if self._initialized:             # <<<<<<<<<<<<<<
 *             self.draw()
 * 
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_initialized); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 61, __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(5, 61, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "opengl/legacy/raw_openGL_widget.pyx":62
 *         """
 *         if self._initialized:
 *             self.draw()             # <<<<<<<<<<<<<<
 * 
 *     def draw(self):
*/
    __pyx_t_3 = __pyx_v_self;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_draw, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 62, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "opengl/legacy/raw_openGL_widget.pyx":61
 *         valid framebuffer yet.
 *         """
 *         if self._initialized:             # <<<<<<<<<<<<<<
 *             self.draw()
 * 
*/
  }

  /* "opengl/legacy/raw_openGL_widget.pyx":53
 *         RawOpenGLWidget.current_widget =  self
 * 
 *     def redraw(self):             # <<<<<<<<<<<<<<
 *         """
 *         Some clients want to update state and do a redraw but the
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("CyOpenGL.RawOpenGLWidget.redraw", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opengl/legacy/raw_openGL_widget.pyx":64
 *             self.draw()
 * 
 *     def draw(self):             # <<<<<<<<<<<<<<
 *         self._initialized = True
 *         self.make_current()
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_15RawOpenGLWidget_7draw(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_15RawOpenGLWidget_6draw, "RawOpenGLWidget.draw(self)");
static PyMethodDef __pyx_mdef_8CyOpenGL_15RawOpenGLWidget_7draw = {"draw", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_15RawOpenGLWidget_7draw, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_15RawOpenGLWidget_6draw};
static PyObject *__pyx_pw_8CyOpenGL_15RawOpenGLWidget_7draw(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("draw (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(5, 64, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(5, 64, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "draw", 0) < (0)) __PYX_ERR(5, 64, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("draw", 1, 1, 1, i); __PYX_ERR(5, 64, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(5, 64, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("draw", 1, 1, 1, __pyx_nargs); __PYX_ERR(5, 64, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("CyOpenGL.RawOpenGLWidget.draw", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_15RawOpenGLWidget_6draw(__pyx_self, __pyx_v_self);

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

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

  /* "opengl/legacy/raw_openGL_widget.pyx":65
 * 
 *     def draw(self):
 *         self._initialized = True             # <<<<<<<<<<<<<<
 *         self.make_current()
 *         self.draw_impl(width = self.winfo_width(),
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_initialized, Py_True) < (0)) __PYX_ERR(5, 65, __pyx_L1_error)

  /* "opengl/legacy/raw_openGL_widget.pyx":66
 *     def draw(self):
 *         self._initialized = True
 *         self.make_current()             # <<<<<<<<<<<<<<
 *         self.draw_impl(width = self.winfo_width(),
 *                        height = self.winfo_height())
*/
  __pyx_t_2 = __pyx_v_self;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_make_current, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 66, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/legacy/raw_openGL_widget.pyx":67
 *         self._initialized = True
 *         self.make_current()
 *         self.draw_impl(width = self.winfo_width(),             # <<<<<<<<<<<<<<
 *                        height = self.winfo_height())
 *         self.swap_buffers()
*/
  __pyx_t_2 = __pyx_v_self;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_5 = __pyx_v_self;
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
    __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_winfo_width, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 67, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }

  /* "opengl/legacy/raw_openGL_widget.pyx":68
 *         self.make_current()
 *         self.draw_impl(width = self.winfo_width(),
 *                        height = self.winfo_height())             # <<<<<<<<<<<<<<
 *         self.swap_buffers()
 * 
*/
  __pyx_t_6 = __pyx_v_self;
  __Pyx_INCREF(__pyx_t_6);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
    __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_winfo_height, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 68, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
  }
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 2 : 0)] = {__pyx_t_2, NULL};
    __pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 67, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_width, __pyx_t_4, __pyx_t_6, __pyx_callargs+1, 0) < (0)) __PYX_ERR(5, 67, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_height, __pyx_t_5, __pyx_t_6, __pyx_callargs+1, 1) < (0)) __PYX_ERR(5, 67, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_draw_impl, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 67, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/legacy/raw_openGL_widget.pyx":69
 *         self.draw_impl(width = self.winfo_width(),
 *                        height = self.winfo_height())
 *         self.swap_buffers()             # <<<<<<<<<<<<<<
 * 
 *     def save_image_window_resolution(self, outfile):
*/
  __pyx_t_6 = __pyx_v_self;
  __Pyx_INCREF(__pyx_t_6);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_swap_buffers, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 69, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/legacy/raw_openGL_widget.pyx":64
 *             self.draw()
 * 
 *     def draw(self):             # <<<<<<<<<<<<<<
 *         self._initialized = True
 *         self.make_current()
*/

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

/* "opengl/legacy/raw_openGL_widget.pyx":71
 *         self.swap_buffers()
 * 
 *     def save_image_window_resolution(self, outfile):             # <<<<<<<<<<<<<<
 *         cdef array.array c_array
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_15RawOpenGLWidget_9save_image_window_resolution(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_15RawOpenGLWidget_8save_image_window_resolution, "RawOpenGLWidget.save_image_window_resolution(self, outfile)");
static PyMethodDef __pyx_mdef_8CyOpenGL_15RawOpenGLWidget_9save_image_window_resolution = {"save_image_window_resolution", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_15RawOpenGLWidget_9save_image_window_resolution, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_15RawOpenGLWidget_8save_image_window_resolution};
static PyObject *__pyx_pw_8CyOpenGL_15RawOpenGLWidget_9save_image_window_resolution(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_outfile = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("save_image_window_resolution (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_outfile,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(5, 71, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(5, 71, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(5, 71, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "save_image_window_resolution", 0) < (0)) __PYX_ERR(5, 71, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("save_image_window_resolution", 1, 2, 2, i); __PYX_ERR(5, 71, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(5, 71, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(5, 71, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
    __pyx_v_outfile = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("save_image_window_resolution", 1, 2, 2, __pyx_nargs); __PYX_ERR(5, 71, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("CyOpenGL.RawOpenGLWidget.save_image_window_resolution", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_15RawOpenGLWidget_8save_image_window_resolution(__pyx_self, __pyx_v_self, __pyx_v_outfile);

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

static PyObject *__pyx_pf_8CyOpenGL_15RawOpenGLWidget_8save_image_window_resolution(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_outfile) {
  arrayobject *__pyx_v_c_array = 0;
  PyObject *__pyx_v_width = NULL;
  PyObject *__pyx_v_height = NULL;
  PyObject *__pyx_v_stride = NULL;
  PyObject *__pyx_v_rows = NULL;
  PyObject *__pyx_v_writer = NULL;
  PyObject *__pyx_9genexpr13__pyx_v_i = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  int __pyx_t_6;
  GLsizei __pyx_t_7;
  GLsizei __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *(*__pyx_t_10)(PyObject *);
  PyObject *__pyx_t_11 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("save_image_window_resolution", 0);

  /* "opengl/legacy/raw_openGL_widget.pyx":74
 *         cdef array.array c_array
 * 
 *         width = self.winfo_width()             # <<<<<<<<<<<<<<
 *         height = self.winfo_height()
 * 
*/
  __pyx_t_2 = __pyx_v_self;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_winfo_width, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 74, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_width = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "opengl/legacy/raw_openGL_widget.pyx":75
 * 
 *         width = self.winfo_width()
 *         height = self.winfo_height()             # <<<<<<<<<<<<<<
 * 
 *         self.make_current()
*/
  __pyx_t_2 = __pyx_v_self;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_winfo_height, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 75, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_height = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "opengl/legacy/raw_openGL_widget.pyx":77
 *         height = self.winfo_height()
 * 
 *         self.make_current()             # <<<<<<<<<<<<<<
 *         self.draw_impl(width = width,
 *                        height = height)
*/
  __pyx_t_2 = __pyx_v_self;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_make_current, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 77, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/legacy/raw_openGL_widget.pyx":78
 * 
 *         self.make_current()
 *         self.draw_impl(width = width,             # <<<<<<<<<<<<<<
 *                        height = height)
 *         glFinish()
*/
  __pyx_t_2 = __pyx_v_self;
  __Pyx_INCREF(__pyx_t_2);

  /* "opengl/legacy/raw_openGL_widget.pyx":79
 *         self.make_current()
 *         self.draw_impl(width = width,
 *                        height = height)             # <<<<<<<<<<<<<<
 *         glFinish()
 * 
*/
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 2 : 0)] = {__pyx_t_2, NULL};
    __pyx_t_4 = __Pyx_MakeVectorcallBuilderKwds(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 78, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_width, __pyx_v_width, __pyx_t_4, __pyx_callargs+1, 0) < (0)) __PYX_ERR(5, 78, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_height, __pyx_v_height, __pyx_t_4, __pyx_callargs+1, 1) < (0)) __PYX_ERR(5, 78, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_draw_impl, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 78, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/legacy/raw_openGL_widget.pyx":80
 *         self.draw_impl(width = width,
 *                        height = height)
 *         glFinish()             # <<<<<<<<<<<<<<
 * 
 *         c_array = array.array('B')
*/
  glFinish();

  /* "opengl/legacy/raw_openGL_widget.pyx":82
 *         glFinish()
 * 
 *         c_array = array.array('B')             # <<<<<<<<<<<<<<
 *         array.resize(c_array, 3 * width * height)
 *         glPixelStorei(GL_PACK_ALIGNMENT, 1)
*/
  __pyx_t_4 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_n_u_B};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7cpython_5array_array, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 82, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_c_array = ((arrayobject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "opengl/legacy/raw_openGL_widget.pyx":83
 * 
 *         c_array = array.array('B')
 *         array.resize(c_array, 3 * width * height)             # <<<<<<<<<<<<<<
 *         glPixelStorei(GL_PACK_ALIGNMENT, 1)
 *         glReadPixels(0, 0, width, height,
*/
  __pyx_t_1 = __Pyx_PyLong_MultiplyCObj(__pyx_mstate_global->__pyx_int_3, __pyx_v_width, 3, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 83, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyNumber_Multiply(__pyx_t_1, __pyx_v_height); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 83, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(5, 83, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_6 = resize(__pyx_v_c_array, __pyx_t_5); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(5, 83, __pyx_L1_error)

  /* "opengl/legacy/raw_openGL_widget.pyx":84
 *         c_array = array.array('B')
 *         array.resize(c_array, 3 * width * height)
 *         glPixelStorei(GL_PACK_ALIGNMENT, 1)             # <<<<<<<<<<<<<<
 *         glReadPixels(0, 0, width, height,
 *                      GL_RGB,
*/
  glPixelStorei(GL_PACK_ALIGNMENT, 1);

  /* "opengl/legacy/raw_openGL_widget.pyx":85
 *         array.resize(c_array, 3 * width * height)
 *         glPixelStorei(GL_PACK_ALIGNMENT, 1)
 *         glReadPixels(0, 0, width, height,             # <<<<<<<<<<<<<<
 *                      GL_RGB,
 *                      GL_UNSIGNED_BYTE,
*/
  __pyx_t_7 = __Pyx_PyLong_As_GLsizei(__pyx_v_width); if (unlikely((__pyx_t_7 == ((GLsizei)-1)) && PyErr_Occurred())) __PYX_ERR(5, 85, __pyx_L1_error)
  __pyx_t_8 = __Pyx_PyLong_As_GLsizei(__pyx_v_height); if (unlikely((__pyx_t_8 == ((GLsizei)-1)) && PyErr_Occurred())) __PYX_ERR(5, 85, __pyx_L1_error)

  /* "opengl/legacy/raw_openGL_widget.pyx":88
 *                      GL_RGB,
 *                      GL_UNSIGNED_BYTE,
 *                      c_array.data.as_voidptr)             # <<<<<<<<<<<<<<
 * 
 *         stride = 3 * width
*/
  glReadPixels(0, 0, __pyx_t_7, __pyx_t_8, GL_RGB, GL_UNSIGNED_BYTE, __pyx_f_7cpython_5array_5array_4data_data(__pyx_v_c_array).as_voidptr);

  /* "opengl/legacy/raw_openGL_widget.pyx":90
 *                      c_array.data.as_voidptr)
 * 
 *         stride = 3 * width             # <<<<<<<<<<<<<<
 *         rows = [ c_array[i * stride : (i+1) * stride]
 *                  for i in range(height - 1, -1, -1) ]
*/
  __pyx_t_4 = __Pyx_PyLong_MultiplyCObj(__pyx_mstate_global->__pyx_int_3, __pyx_v_width, 3, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 90, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_v_stride = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "opengl/legacy/raw_openGL_widget.pyx":91
 * 
 *         stride = 3 * width
 *         rows = [ c_array[i * stride : (i+1) * stride]             # <<<<<<<<<<<<<<
 *                  for i in range(height - 1, -1, -1) ]
 * 
*/
  { /* enter inner scope */
    __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 91, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_4);

    /* "opengl/legacy/raw_openGL_widget.pyx":92
 *         stride = 3 * width
 *         rows = [ c_array[i * stride : (i+1) * stride]
 *                  for i in range(height - 1, -1, -1) ]             # <<<<<<<<<<<<<<
 * 
 *         writer = png.Writer(
*/
    __pyx_t_2 = NULL;
    __pyx_t_9 = __Pyx_PyLong_SubtractObjC(__pyx_v_height, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 92, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_3 = 1;
    {
      PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_t_9, __pyx_mstate_global->__pyx_int_neg_1, __pyx_mstate_global->__pyx_int_neg_1};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(&PyRange_Type), __pyx_callargs+__pyx_t_3, (4-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 92, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 92, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(5, 92, __pyx_L5_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    for (;;) {
      {
        __pyx_t_1 = __pyx_t_10(__pyx_t_9);
        if (unlikely(!__pyx_t_1)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(5, 92, __pyx_L5_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_XDECREF_SET(__pyx_9genexpr13__pyx_v_i, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "opengl/legacy/raw_openGL_widget.pyx":91
 * 
 *         stride = 3 * width
 *         rows = [ c_array[i * stride : (i+1) * stride]             # <<<<<<<<<<<<<<
 *                  for i in range(height - 1, -1, -1) ]
 * 
*/
      __pyx_t_1 = PyNumber_Multiply(__pyx_9genexpr13__pyx_v_i, __pyx_v_stride); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 91, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyLong_AddObjC(__pyx_9genexpr13__pyx_v_i, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 91, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_11 = PyNumber_Multiply(__pyx_t_2, __pyx_v_stride); if (unlikely(!__pyx_t_11)) __PYX_ERR(5, 91, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_c_array), 0, 0, &__pyx_t_1, &__pyx_t_11, NULL, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 91, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_2))) __PYX_ERR(5, 91, __pyx_L5_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "opengl/legacy/raw_openGL_widget.pyx":92
 *         stride = 3 * width
 *         rows = [ c_array[i * stride : (i+1) * stride]
 *                  for i in range(height - 1, -1, -1) ]             # <<<<<<<<<<<<<<
 * 
 *         writer = png.Writer(
*/
    }
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_9genexpr13__pyx_v_i); __pyx_9genexpr13__pyx_v_i = 0;
    goto __pyx_L9_exit_scope;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_9genexpr13__pyx_v_i); __pyx_9genexpr13__pyx_v_i = 0;
    goto __pyx_L1_error;
    __pyx_L9_exit_scope:;
  } /* exit inner scope */
  __pyx_v_rows = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "opengl/legacy/raw_openGL_widget.pyx":94
 *                  for i in range(height - 1, -1, -1) ]
 * 
 *         writer = png.Writer(             # <<<<<<<<<<<<<<
 *             width, height,
 *             greyscale = False,
*/
  __pyx_t_9 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_png); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 94, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Writer); if (unlikely(!__pyx_t_11)) __PYX_ERR(5, 94, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opengl/legacy/raw_openGL_widget.pyx":98
 *             greyscale = False,
 *             bitdepth = 8,
 *             alpha = False)             # <<<<<<<<<<<<<<
 *         writer.write(outfile, rows)
*/
  __pyx_t_3 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_11))) {
    __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_11);
    assert(__pyx_t_9);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_11);
    __Pyx_INCREF(__pyx_t_9);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_11, __pyx__function);
    __pyx_t_3 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[3 + ((CYTHON_VECTORCALL) ? 3 : 0)] = {__pyx_t_9, __pyx_v_width, __pyx_v_height};
    __pyx_t_2 = __Pyx_MakeVectorcallBuilderKwds(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 94, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_greyscale, Py_False, __pyx_t_2, __pyx_callargs+3, 0) < (0)) __PYX_ERR(5, 94, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_bitdepth, __pyx_mstate_global->__pyx_int_8, __pyx_t_2, __pyx_callargs+3, 1) < (0)) __PYX_ERR(5, 94, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_alpha, Py_False, __pyx_t_2, __pyx_callargs+3, 2) < (0)) __PYX_ERR(5, 94, __pyx_L1_error)
    __pyx_t_4 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_11, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_2);
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 94, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  __pyx_v_writer = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "opengl/legacy/raw_openGL_widget.pyx":99
 *             bitdepth = 8,
 *             alpha = False)
 *         writer.write(outfile, rows)             # <<<<<<<<<<<<<<
*/
  __pyx_t_11 = __pyx_v_writer;
  __Pyx_INCREF(__pyx_t_11);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_11, __pyx_v_outfile, __pyx_v_rows};
    __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_write, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 99, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opengl/legacy/raw_openGL_widget.pyx":71
 *         self.swap_buffers()
 * 
 *     def save_image_window_resolution(self, outfile):             # <<<<<<<<<<<<<<
 *         cdef array.array c_array
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("CyOpenGL.RawOpenGLWidget.save_image_window_resolution", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_c_array);
  __Pyx_XDECREF(__pyx_v_width);
  __Pyx_XDECREF(__pyx_v_height);
  __Pyx_XDECREF(__pyx_v_stride);
  __Pyx_XDECREF(__pyx_v_rows);
  __Pyx_XDECREF(__pyx_v_writer);
  __Pyx_XDECREF(__pyx_9genexpr13__pyx_v_i);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opengl/legacy/perspectiveWidget.pyx":1
 * cdef cyglTranslateScene(s, x, y, mousex, mousey):             # <<<<<<<<<<<<<<
 *     cdef GLdouble X, Y
 *     cdef GLdouble mat[16]
*/

static PyObject *__pyx_f_8CyOpenGL_cyglTranslateScene(PyObject *__pyx_v_s, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_mousex, PyObject *__pyx_v_mousey) {
  GLdouble __pyx_v_X;
  GLdouble __pyx_v_Y;
  GLdouble __pyx_v_mat[16];
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  GLdouble __pyx_t_3;
  GLdouble __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cyglTranslateScene", 0);

  /* "opengl/legacy/perspectiveWidget.pyx":5
 *     cdef GLdouble mat[16]
 * 
 *     X, Y = s * (x - mousex), s * (mousey - y)             # <<<<<<<<<<<<<<
 *     glMatrixMode(GL_MODELVIEW)
 *     glGetDoublev(GL_MODELVIEW_MATRIX, mat)
*/
  __pyx_t_1 = PyNumber_Subtract(__pyx_v_x, __pyx_v_mousex); if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Multiply(__pyx_v_s, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(26, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_3 == ((GLdouble)-1)) && PyErr_Occurred())) __PYX_ERR(26, 5, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_Subtract(__pyx_v_mousey, __pyx_v_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(26, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyNumber_Multiply(__pyx_v_s, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 5, __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 == ((GLdouble)-1)) && PyErr_Occurred())) __PYX_ERR(26, 5, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_X = __pyx_t_3;
  __pyx_v_Y = __pyx_t_4;

  /* "opengl/legacy/perspectiveWidget.pyx":6
 * 
 *     X, Y = s * (x - mousex), s * (mousey - y)
 *     glMatrixMode(GL_MODELVIEW)             # <<<<<<<<<<<<<<
 *     glGetDoublev(GL_MODELVIEW_MATRIX, mat)
 *     glLoadIdentity()
*/
  glMatrixMode(GL_MODELVIEW);

  /* "opengl/legacy/perspectiveWidget.pyx":7
 *     X, Y = s * (x - mousex), s * (mousey - y)
 *     glMatrixMode(GL_MODELVIEW)
 *     glGetDoublev(GL_MODELVIEW_MATRIX, mat)             # <<<<<<<<<<<<<<
 *     glLoadIdentity()
 *     glTranslatef(X, Y, 0.0)
*/
  glGetDoublev(GL_MODELVIEW_MATRIX, __pyx_v_mat);

  /* "opengl/legacy/perspectiveWidget.pyx":8
 *     glMatrixMode(GL_MODELVIEW)
 *     glGetDoublev(GL_MODELVIEW_MATRIX, mat)
 *     glLoadIdentity()             # <<<<<<<<<<<<<<
 *     glTranslatef(X, Y, 0.0)
 *     glMultMatrixd(mat)
*/
  glLoadIdentity();

  /* "opengl/legacy/perspectiveWidget.pyx":9
 *     glGetDoublev(GL_MODELVIEW_MATRIX, mat)
 *     glLoadIdentity()
 *     glTranslatef(X, Y, 0.0)             # <<<<<<<<<<<<<<
 *     glMultMatrixd(mat)
 * 
*/
  glTranslatef(__pyx_v_X, __pyx_v_Y, 0.0);

  /* "opengl/legacy/perspectiveWidget.pyx":10
 *     glLoadIdentity()
 *     glTranslatef(X, Y, 0.0)
 *     glMultMatrixd(mat)             # <<<<<<<<<<<<<<
 * 
 * cdef cyglRotateScene(xcenter, ycenter, zcenter, Xangle, Yangle):
*/
  glMultMatrixd(__pyx_v_mat);

  /* "opengl/legacy/perspectiveWidget.pyx":1
 * cdef cyglTranslateScene(s, x, y, mousex, mousey):             # <<<<<<<<<<<<<<
 *     cdef GLdouble X, Y
 *     cdef GLdouble mat[16]
*/

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

/* "opengl/legacy/perspectiveWidget.pyx":12
 *     glMultMatrixd(mat)
 * 
 * cdef cyglRotateScene(xcenter, ycenter, zcenter, Xangle, Yangle):             # <<<<<<<<<<<<<<
 *     cdef GLdouble mat[16]
 * 
*/

static PyObject *__pyx_f_8CyOpenGL_cyglRotateScene(PyObject *__pyx_v_xcenter, PyObject *__pyx_v_ycenter, PyObject *__pyx_v_zcenter, PyObject *__pyx_v_Xangle, PyObject *__pyx_v_Yangle) {
  GLdouble __pyx_v_mat[16];
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  GLfloat __pyx_t_1;
  GLfloat __pyx_t_2;
  GLfloat __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cyglRotateScene", 0);

  /* "opengl/legacy/perspectiveWidget.pyx":15
 *     cdef GLdouble mat[16]
 * 
 *     glMatrixMode(GL_MODELVIEW)             # <<<<<<<<<<<<<<
 *     glGetDoublev(GL_MODELVIEW_MATRIX, mat)
 *     glLoadIdentity()
*/
  glMatrixMode(GL_MODELVIEW);

  /* "opengl/legacy/perspectiveWidget.pyx":16
 * 
 *     glMatrixMode(GL_MODELVIEW)
 *     glGetDoublev(GL_MODELVIEW_MATRIX, mat)             # <<<<<<<<<<<<<<
 *     glLoadIdentity()
 *     glTranslatef(xcenter, ycenter, zcenter)
*/
  glGetDoublev(GL_MODELVIEW_MATRIX, __pyx_v_mat);

  /* "opengl/legacy/perspectiveWidget.pyx":17
 *     glMatrixMode(GL_MODELVIEW)
 *     glGetDoublev(GL_MODELVIEW_MATRIX, mat)
 *     glLoadIdentity()             # <<<<<<<<<<<<<<
 *     glTranslatef(xcenter, ycenter, zcenter)
 *     glRotatef(Yangle, 1., 0., 0.)
*/
  glLoadIdentity();

  /* "opengl/legacy/perspectiveWidget.pyx":18
 *     glGetDoublev(GL_MODELVIEW_MATRIX, mat)
 *     glLoadIdentity()
 *     glTranslatef(xcenter, ycenter, zcenter)             # <<<<<<<<<<<<<<
 *     glRotatef(Yangle, 1., 0., 0.)
 *     glRotatef(Xangle, 0., 1., 0.)
*/
  __pyx_t_1 = __Pyx_PyFloat_AsFloat(__pyx_v_xcenter); if (unlikely((__pyx_t_1 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(26, 18, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyFloat_AsFloat(__pyx_v_ycenter); if (unlikely((__pyx_t_2 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(26, 18, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyFloat_AsFloat(__pyx_v_zcenter); if (unlikely((__pyx_t_3 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(26, 18, __pyx_L1_error)
  glTranslatef(__pyx_t_1, __pyx_t_2, __pyx_t_3);

  /* "opengl/legacy/perspectiveWidget.pyx":19
 *     glLoadIdentity()
 *     glTranslatef(xcenter, ycenter, zcenter)
 *     glRotatef(Yangle, 1., 0., 0.)             # <<<<<<<<<<<<<<
 *     glRotatef(Xangle, 0., 1., 0.)
 *     glTranslatef(-xcenter, -ycenter, -zcenter)
*/
  __pyx_t_3 = __Pyx_PyFloat_AsFloat(__pyx_v_Yangle); if (unlikely((__pyx_t_3 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(26, 19, __pyx_L1_error)
  glRotatef(__pyx_t_3, 1., 0., 0.);

  /* "opengl/legacy/perspectiveWidget.pyx":20
 *     glTranslatef(xcenter, ycenter, zcenter)
 *     glRotatef(Yangle, 1., 0., 0.)
 *     glRotatef(Xangle, 0., 1., 0.)             # <<<<<<<<<<<<<<
 *     glTranslatef(-xcenter, -ycenter, -zcenter)
 *     glMultMatrixd(mat)
*/
  __pyx_t_3 = __Pyx_PyFloat_AsFloat(__pyx_v_Xangle); if (unlikely((__pyx_t_3 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(26, 20, __pyx_L1_error)
  glRotatef(__pyx_t_3, 0., 1., 0.);

  /* "opengl/legacy/perspectiveWidget.pyx":21
 *     glRotatef(Yangle, 1., 0., 0.)
 *     glRotatef(Xangle, 0., 1., 0.)
 *     glTranslatef(-xcenter, -ycenter, -zcenter)             # <<<<<<<<<<<<<<
 *     glMultMatrixd(mat)
 * 
*/
  __pyx_t_4 = PyNumber_Negative(__pyx_v_xcenter); if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyFloat_AsFloat(__pyx_t_4); if (unlikely((__pyx_t_3 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(26, 21, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyNumber_Negative(__pyx_v_ycenter); if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_PyFloat_AsFloat(__pyx_t_4); if (unlikely((__pyx_t_2 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(26, 21, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyNumber_Negative(__pyx_v_zcenter); if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = __Pyx_PyFloat_AsFloat(__pyx_t_4); if (unlikely((__pyx_t_1 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(26, 21, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  glTranslatef(__pyx_t_3, __pyx_t_2, __pyx_t_1);

  /* "opengl/legacy/perspectiveWidget.pyx":22
 *     glRotatef(Xangle, 0., 1., 0.)
 *     glTranslatef(-xcenter, -ycenter, -zcenter)
 *     glMultMatrixd(mat)             # <<<<<<<<<<<<<<
 * 
 * class OpenGLPerspectiveWidget(RawOpenGLWidget):
*/
  glMultMatrixd(__pyx_v_mat);

  /* "opengl/legacy/perspectiveWidget.pyx":12
 *     glMultMatrixd(mat)
 * 
 * cdef cyglRotateScene(xcenter, ycenter, zcenter, Xangle, Yangle):             # <<<<<<<<<<<<<<
 *     cdef GLdouble mat[16]
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("CyOpenGL.cyglRotateScene", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opengl/legacy/perspectiveWidget.pyx":38
 *     http://www.yorvic.york.ac.uk/~mjh/
 *     """
 *     def __init__(self, master=None, help='No help is available.',             # <<<<<<<<<<<<<<
 *                  mouse_pick=False, mouse_rotate=True, mouse_translate=False,
 *                  mouse_scale=False,
*/

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

  /* "opengl/legacy/perspectiveWidget.pyx":40
 *     def __init__(self, master=None, help='No help is available.',
 *                  mouse_pick=False, mouse_rotate=True, mouse_translate=False,
 *                  mouse_scale=False,             # <<<<<<<<<<<<<<
 *                  fovy=30.0, near=1.0, far=100.0,
 *                  cnf={}, **kw):
*/
  __pyx_t_1 = PyTuple_New(10); if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 38, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, Py_None) != (0)) __PYX_ERR(26, 38, __pyx_L1_error);
  __Pyx_INCREF(((PyObject*)__pyx_mstate_global->__pyx_kp_u_No_help_is_available));
  __Pyx_GIVEREF(((PyObject*)__pyx_mstate_global->__pyx_kp_u_No_help_is_available));
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject*)__pyx_mstate_global->__pyx_kp_u_No_help_is_available)) != (0)) __PYX_ERR(26, 38, __pyx_L1_error);
  __Pyx_INCREF(((PyObject*)Py_False));
  __Pyx_GIVEREF(((PyObject*)Py_False));
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject*)Py_False)) != (0)) __PYX_ERR(26, 38, __pyx_L1_error);
  __Pyx_INCREF(((PyObject*)Py_True));
  __Pyx_GIVEREF(((PyObject*)Py_True));
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject*)Py_True)) != (0)) __PYX_ERR(26, 38, __pyx_L1_error);
  __Pyx_INCREF(((PyObject*)Py_False));
  __Pyx_GIVEREF(((PyObject*)Py_False));
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 4, ((PyObject*)Py_False)) != (0)) __PYX_ERR(26, 38, __pyx_L1_error);
  __Pyx_INCREF(((PyObject*)Py_False));
  __Pyx_GIVEREF(((PyObject*)Py_False));
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 5, ((PyObject*)Py_False)) != (0)) __PYX_ERR(26, 38, __pyx_L1_error);
  __Pyx_INCREF(((PyObject*)__pyx_mstate_global->__pyx_float_30_0));
  __Pyx_GIVEREF(((PyObject*)__pyx_mstate_global->__pyx_float_30_0));
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 6, ((PyObject*)__pyx_mstate_global->__pyx_float_30_0)) != (0)) __PYX_ERR(26, 38, __pyx_L1_error);
  __Pyx_INCREF(((PyObject*)__pyx_mstate_global->__pyx_float_1_0));
  __Pyx_GIVEREF(((PyObject*)__pyx_mstate_global->__pyx_float_1_0));
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 7, ((PyObject*)__pyx_mstate_global->__pyx_float_1_0)) != (0)) __PYX_ERR(26, 38, __pyx_L1_error);
  __Pyx_INCREF(((PyObject*)__pyx_mstate_global->__pyx_float_100_0));
  __Pyx_GIVEREF(((PyObject*)__pyx_mstate_global->__pyx_float_100_0));
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 8, ((PyObject*)__pyx_mstate_global->__pyx_float_100_0)) != (0)) __PYX_ERR(26, 38, __pyx_L1_error);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_self)->arg0);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_self)->arg0);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 9, __Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_self)->arg0) != (0)) __PYX_ERR(26, 38, __pyx_L1_error);

  /* "opengl/legacy/perspectiveWidget.pyx":38
 *     http://www.yorvic.york.ac.uk/~mjh/
 *     """
 *     def __init__(self, master=None, help='No help is available.',             # <<<<<<<<<<<<<<
 *                  mouse_pick=False, mouse_rotate=True, mouse_translate=False,
 *                  mouse_scale=False,
*/
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(26, 38, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1) != (0)) __PYX_ERR(26, 38, __pyx_L1_error);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None) != (0)) __PYX_ERR(26, 38, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("CyOpenGL.__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_8CyOpenGL_23OpenGLPerspectiveWidget_1__init__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_23OpenGLPerspectiveWidget___init__, "OpenGLPerspectiveWidget.__init__(self, master=None, help='No help is available.', mouse_pick=False, mouse_rotate=True, mouse_translate=False, mouse_scale=False, fovy=30.0, near=1.0, far=100.0, cnf={}, **kw)\n\nCreate an opengl widget with given view parameters and mouse behaviors.");
static PyMethodDef __pyx_mdef_8CyOpenGL_23OpenGLPerspectiveWidget_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_23OpenGLPerspectiveWidget_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_23OpenGLPerspectiveWidget___init__};
static PyObject *__pyx_pw_8CyOpenGL_23OpenGLPerspectiveWidget_1__init__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_master = 0;
  PyObject *__pyx_v_help = 0;
  PyObject *__pyx_v_mouse_pick = 0;
  PyObject *__pyx_v_mouse_rotate = 0;
  PyObject *__pyx_v_mouse_translate = 0;
  PyObject *__pyx_v_mouse_scale = 0;
  PyObject *__pyx_v_fovy = 0;
  PyObject *__pyx_v_near = 0;
  PyObject *__pyx_v_far = 0;
  PyObject *__pyx_v_cnf = 0;
  PyObject *__pyx_v_kw = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[11] = {0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  __pyx_v_kw = PyDict_New(); if (unlikely(!__pyx_v_kw)) return NULL;
  __Pyx_GOTREF(__pyx_v_kw);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_master,&__pyx_mstate_global->__pyx_n_u_help,&__pyx_mstate_global->__pyx_n_u_mouse_pick,&__pyx_mstate_global->__pyx_n_u_mouse_rotate,&__pyx_mstate_global->__pyx_n_u_mouse_translate,&__pyx_mstate_global->__pyx_n_u_mouse_scale,&__pyx_mstate_global->__pyx_n_u_fovy,&__pyx_mstate_global->__pyx_n_u_near,&__pyx_mstate_global->__pyx_n_u_far,&__pyx_mstate_global->__pyx_n_u_cnf,0};
    struct __pyx_defaults *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_self);
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(26, 38, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(26, 38, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(26, 38, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(26, 38, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(26, 38, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(26, 38, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(26, 38, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(26, 38, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(26, 38, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(26, 38, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(26, 38, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(26, 38, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, __pyx_v_kw, values, kwd_pos_args, __pyx_kwds_len, "__init__", 1) < (0)) __PYX_ERR(26, 38, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_kp_u_No_help_is_available)));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False)));
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_True)));
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False)));
      if (!values[6]) values[6] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False)));
      if (!values[7]) values[7] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_float_30_0)));
      if (!values[8]) values[8] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_float_1_0)));
      if (!values[9]) values[9] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_float_100_0)));
      if (!values[10]) values[10] = __Pyx_NewRef(__pyx_dynamic_args->arg0);
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 11, i); __PYX_ERR(26, 38, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(26, 38, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(26, 38, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(26, 38, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(26, 38, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(26, 38, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(26, 38, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(26, 38, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(26, 38, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(26, 38, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(26, 38, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(26, 38, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_kp_u_No_help_is_available)));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False)));
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_True)));
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False)));
      if (!values[6]) values[6] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False)));
      if (!values[7]) values[7] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_float_30_0)));
      if (!values[8]) values[8] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_float_1_0)));
      if (!values[9]) values[9] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_float_100_0)));
      if (!values[10]) values[10] = __Pyx_NewRef(__pyx_dynamic_args->arg0);
    }
    __pyx_v_self = values[0];
    __pyx_v_master = values[1];
    __pyx_v_help = values[2];
    __pyx_v_mouse_pick = values[3];
    __pyx_v_mouse_rotate = values[4];
    __pyx_v_mouse_translate = values[5];
    __pyx_v_mouse_scale = values[6];
    __pyx_v_fovy = values[7];
    __pyx_v_near = values[8];
    __pyx_v_far = values[9];
    __pyx_v_cnf = values[10];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 11, __pyx_nargs); __PYX_ERR(26, 38, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_DECREF(__pyx_v_kw); __pyx_v_kw = 0;
  __Pyx_AddTraceback("CyOpenGL.OpenGLPerspectiveWidget.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_23OpenGLPerspectiveWidget___init__(__pyx_self, __pyx_v_self, __pyx_v_master, __pyx_v_help, __pyx_v_mouse_pick, __pyx_v_mouse_rotate, __pyx_v_mouse_translate, __pyx_v_mouse_scale, __pyx_v_fovy, __pyx_v_near, __pyx_v_far, __pyx_v_cnf, __pyx_v_kw);

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

static PyObject *__pyx_pf_8CyOpenGL_23OpenGLPerspectiveWidget___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_master, PyObject *__pyx_v_help, PyObject *__pyx_v_mouse_pick, PyObject *__pyx_v_mouse_rotate, PyObject *__pyx_v_mouse_translate, PyObject *__pyx_v_mouse_scale, PyObject *__pyx_v_fovy, PyObject *__pyx_v_near, PyObject *__pyx_v_far, PyObject *__pyx_v_cnf, PyObject *__pyx_v_kw) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "opengl/legacy/perspectiveWidget.pyx":46
 *         Create an opengl widget with given view parameters and mouse behaviors.
 *         """
 *         RawOpenGLWidget.__init__(self, master, cnf, **kw)             # <<<<<<<<<<<<<<
 *         self.help_text = help
 *         self.initialised = 0
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_RawOpenGLWidget); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 46, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_init); if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 46, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyDict_Copy(__pyx_v_kw); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 46, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_v_self, __pyx_v_master, __pyx_v_cnf};
    __pyx_t_1 = __Pyx_PyObject_FastCallDict((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_3);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 46, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/legacy/perspectiveWidget.pyx":47
 *         """
 *         RawOpenGLWidget.__init__(self, master, cnf, **kw)
 *         self.help_text = help             # <<<<<<<<<<<<<<
 *         self.initialised = 0
 *         if sys.platform == 'darwin':
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_help_text, __pyx_v_help) < (0)) __PYX_ERR(26, 47, __pyx_L1_error)

  /* "opengl/legacy/perspectiveWidget.pyx":48
 *         RawOpenGLWidget.__init__(self, master, cnf, **kw)
 *         self.help_text = help
 *         self.initialised = 0             # <<<<<<<<<<<<<<
 *         if sys.platform == 'darwin':
 *             self.config(cursor='hand')
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_initialised, __pyx_mstate_global->__pyx_int_0) < (0)) __PYX_ERR(26, 48, __pyx_L1_error)

  /* "opengl/legacy/perspectiveWidget.pyx":49
 *         self.help_text = help
 *         self.initialised = 0
 *         if sys.platform == 'darwin':             # <<<<<<<<<<<<<<
 *             self.config(cursor='hand')
 *         else:
*/
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_sys); if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_platform); if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_darwin, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(26, 49, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_6) {

    /* "opengl/legacy/perspectiveWidget.pyx":50
 *         self.initialised = 0
 *         if sys.platform == 'darwin':
 *             self.config(cursor='hand')             # <<<<<<<<<<<<<<
 *         else:
 *             self.config(cursor='fleur')
*/
    __pyx_t_1 = __pyx_v_self;
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_1, NULL};
      __pyx_t_3 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 50, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_cursor, __pyx_mstate_global->__pyx_n_u_hand, __pyx_t_3, __pyx_callargs+1, 0) < (0)) __PYX_ERR(26, 50, __pyx_L1_error)
      __pyx_t_4 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_config, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_3);
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 50, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "opengl/legacy/perspectiveWidget.pyx":49
 *         self.help_text = help
 *         self.initialised = 0
 *         if sys.platform == 'darwin':             # <<<<<<<<<<<<<<
 *             self.config(cursor='hand')
 *         else:
*/
    goto __pyx_L3;
  }

  /* "opengl/legacy/perspectiveWidget.pyx":52
 *             self.config(cursor='hand')
 *         else:
 *             self.config(cursor='fleur')             # <<<<<<<<<<<<<<
 *         self.flipped = False
 * 
*/
  /*else*/ {
    __pyx_t_3 = __pyx_v_self;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, NULL};
      __pyx_t_1 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 52, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_cursor, __pyx_mstate_global->__pyx_n_u_fleur, __pyx_t_1, __pyx_callargs+1, 0) < (0)) __PYX_ERR(26, 52, __pyx_L1_error)
      __pyx_t_4 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_config, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_1);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 52, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __pyx_L3:;

  /* "opengl/legacy/perspectiveWidget.pyx":53
 *         else:
 *             self.config(cursor='fleur')
 *         self.flipped = False             # <<<<<<<<<<<<<<
 * 
 *         # Current coordinates of the mouse.
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_flipped, Py_False) < (0)) __PYX_ERR(26, 53, __pyx_L1_error)

  /* "opengl/legacy/perspectiveWidget.pyx":56
 * 
 *         # Current coordinates of the mouse.
 *         self.xmouse = self.ymouse = self.tmouse = self.delta_t = 0             # <<<<<<<<<<<<<<
 *         self.Xangle = self.Yangle = 0
 * 
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_xmouse, __pyx_mstate_global->__pyx_int_0) < (0)) __PYX_ERR(26, 56, __pyx_L1_error)
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_ymouse, __pyx_mstate_global->__pyx_int_0) < (0)) __PYX_ERR(26, 56, __pyx_L1_error)
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_tmouse, __pyx_mstate_global->__pyx_int_0) < (0)) __PYX_ERR(26, 56, __pyx_L1_error)
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_delta_t, __pyx_mstate_global->__pyx_int_0) < (0)) __PYX_ERR(26, 56, __pyx_L1_error)

  /* "opengl/legacy/perspectiveWidget.pyx":57
 *         # Current coordinates of the mouse.
 *         self.xmouse = self.ymouse = self.tmouse = self.delta_t = 0
 *         self.Xangle = self.Yangle = 0             # <<<<<<<<<<<<<<
 * 
 *         # Where we are centering.
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_Xangle, __pyx_mstate_global->__pyx_int_0) < (0)) __PYX_ERR(26, 57, __pyx_L1_error)
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_Yangle, __pyx_mstate_global->__pyx_int_0) < (0)) __PYX_ERR(26, 57, __pyx_L1_error)

  /* "opengl/legacy/perspectiveWidget.pyx":60
 * 
 *         # Where we are centering.
 *         self.xcenter = 0.0             # <<<<<<<<<<<<<<
 *         self.ycenter = 0.0
 *         self.zcenter = 0.0
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_xcenter, __pyx_mstate_global->__pyx_float_0_0) < (0)) __PYX_ERR(26, 60, __pyx_L1_error)

  /* "opengl/legacy/perspectiveWidget.pyx":61
 *         # Where we are centering.
 *         self.xcenter = 0.0
 *         self.ycenter = 0.0             # <<<<<<<<<<<<<<
 *         self.zcenter = 0.0
 * 
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_ycenter, __pyx_mstate_global->__pyx_float_0_0) < (0)) __PYX_ERR(26, 61, __pyx_L1_error)

  /* "opengl/legacy/perspectiveWidget.pyx":62
 *         self.xcenter = 0.0
 *         self.ycenter = 0.0
 *         self.zcenter = 0.0             # <<<<<<<<<<<<<<
 * 
 *         # The _back color
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_zcenter, __pyx_mstate_global->__pyx_float_0_0) < (0)) __PYX_ERR(26, 62, __pyx_L1_error)

  /* "opengl/legacy/perspectiveWidget.pyx":65
 * 
 *         # The _back color
 *         self.r_back = 1.             # <<<<<<<<<<<<<<
 *         self.g_back = 0.
 *         self.b_back = 1.
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_r_back, __pyx_mstate_global->__pyx_float_1_) < (0)) __PYX_ERR(26, 65, __pyx_L1_error)

  /* "opengl/legacy/perspectiveWidget.pyx":66
 *         # The _back color
 *         self.r_back = 1.
 *         self.g_back = 0.             # <<<<<<<<<<<<<<
 *         self.b_back = 1.
 * 
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_g_back, __pyx_mstate_global->__pyx_float_0_) < (0)) __PYX_ERR(26, 66, __pyx_L1_error)

  /* "opengl/legacy/perspectiveWidget.pyx":67
 *         self.r_back = 1.
 *         self.g_back = 0.
 *         self.b_back = 1.             # <<<<<<<<<<<<<<
 * 
 *         # Where the eye is
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_b_back, __pyx_mstate_global->__pyx_float_1_) < (0)) __PYX_ERR(26, 67, __pyx_L1_error)

  /* "opengl/legacy/perspectiveWidget.pyx":70
 * 
 *         # Where the eye is
 *         self.distance = 10.0             # <<<<<<<<<<<<<<
 * 
 *         # Field of view in y direction
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_distance, __pyx_mstate_global->__pyx_float_10_0) < (0)) __PYX_ERR(26, 70, __pyx_L1_error)

  /* "opengl/legacy/perspectiveWidget.pyx":73
 * 
 *         # Field of view in y direction
 *         self.fovy = fovy             # <<<<<<<<<<<<<<
 * 
 *         # Position of clipping planes.
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_fovy, __pyx_v_fovy) < (0)) __PYX_ERR(26, 73, __pyx_L1_error)

  /* "opengl/legacy/perspectiveWidget.pyx":76
 * 
 *         # Position of clipping planes.
 *         self.near = near             # <<<<<<<<<<<<<<
 *         self.far = far
 * 
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_near, __pyx_v_near) < (0)) __PYX_ERR(26, 76, __pyx_L1_error)

  /* "opengl/legacy/perspectiveWidget.pyx":77
 *         # Position of clipping planes.
 *         self.near = near
 *         self.far = far             # <<<<<<<<<<<<<<
 * 
 *         # Is the widget allowed to autospin?
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_far, __pyx_v_far) < (0)) __PYX_ERR(26, 77, __pyx_L1_error)

  /* "opengl/legacy/perspectiveWidget.pyx":80
 * 
 *         # Is the widget allowed to autospin?
 *         self.autospin_allowed = 0             # <<<<<<<<<<<<<<
 * 
 *         # Is the widget currently autospinning?
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_autospin_allowed, __pyx_mstate_global->__pyx_int_0) < (0)) __PYX_ERR(26, 80, __pyx_L1_error)

  /* "opengl/legacy/perspectiveWidget.pyx":83
 * 
 *         # Is the widget currently autospinning?
 *         self.autospin = 0             # <<<<<<<<<<<<<<
 * 
 *         # Dictionary of key actions (keysym:function) .
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_autospin, __pyx_mstate_global->__pyx_int_0) < (0)) __PYX_ERR(26, 83, __pyx_L1_error)

  /* "opengl/legacy/perspectiveWidget.pyx":86
 * 
 *         # Dictionary of key actions (keysym:function) .
 *         self.key_action = {}             # <<<<<<<<<<<<<<
 * 
 *         # Bindings for events.
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 86, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_key_action, __pyx_t_4) < (0)) __PYX_ERR(26, 86, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opengl/legacy/perspectiveWidget.pyx":89
 * 
 *         # Bindings for events.
 *         if mouse_pick:             # <<<<<<<<<<<<<<
 *             self.bind('<Control-Button-1>', self.tkHandlePick)
 *             self.bind('<Control-Button-1><ButtonRelease-1>', self.tkHandlePick)
*/
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_mouse_pick); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(26, 89, __pyx_L1_error)
  if (__pyx_t_6) {

    /* "opengl/legacy/perspectiveWidget.pyx":90
 *         # Bindings for events.
 *         if mouse_pick:
 *             self.bind('<Control-Button-1>', self.tkHandlePick)             # <<<<<<<<<<<<<<
 *             self.bind('<Control-Button-1><ButtonRelease-1>', self.tkHandlePick)
 *         if mouse_translate and mouse_rotate:
*/
    __pyx_t_1 = __pyx_v_self;
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_tkHandlePick); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 90, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_mstate_global->__pyx_kp_u_Control_Button_1, __pyx_t_3};
      __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_bind, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 90, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "opengl/legacy/perspectiveWidget.pyx":91
 *         if mouse_pick:
 *             self.bind('<Control-Button-1>', self.tkHandlePick)
 *             self.bind('<Control-Button-1><ButtonRelease-1>', self.tkHandlePick)             # <<<<<<<<<<<<<<
 *         if mouse_translate and mouse_rotate:
 *             self.bind('<Button-1>', self.tkRecordMouse)
*/
    __pyx_t_3 = __pyx_v_self;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_tkHandlePick); if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 91, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_Control_Button_1_ButtonRelease, __pyx_t_1};
      __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_bind, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 91, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "opengl/legacy/perspectiveWidget.pyx":89
 * 
 *         # Bindings for events.
 *         if mouse_pick:             # <<<<<<<<<<<<<<
 *             self.bind('<Control-Button-1>', self.tkHandlePick)
 *             self.bind('<Control-Button-1><ButtonRelease-1>', self.tkHandlePick)
*/
  }

  /* "opengl/legacy/perspectiveWidget.pyx":92
 *             self.bind('<Control-Button-1>', self.tkHandlePick)
 *             self.bind('<Control-Button-1><ButtonRelease-1>', self.tkHandlePick)
 *         if mouse_translate and mouse_rotate:             # <<<<<<<<<<<<<<
 *             self.bind('<Button-1>', self.tkRecordMouse)
 *             self.bind('<B1-Motion>', self.tkTranslate)
*/
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_mouse_translate); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(26, 92, __pyx_L1_error)
  if (__pyx_t_7) {
  } else {
    __pyx_t_6 = __pyx_t_7;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_mouse_rotate); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(26, 92, __pyx_L1_error)
  __pyx_t_6 = __pyx_t_7;
  __pyx_L6_bool_binop_done:;
  if (__pyx_t_6) {

    /* "opengl/legacy/perspectiveWidget.pyx":93
 *             self.bind('<Control-Button-1><ButtonRelease-1>', self.tkHandlePick)
 *         if mouse_translate and mouse_rotate:
 *             self.bind('<Button-1>', self.tkRecordMouse)             # <<<<<<<<<<<<<<
 *             self.bind('<B1-Motion>', self.tkTranslate)
 *             if sys.platform == 'darwin':
*/
    __pyx_t_1 = __pyx_v_self;
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_tkRecordMouse); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 93, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_mstate_global->__pyx_kp_u_Button_1, __pyx_t_3};
      __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_bind, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 93, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "opengl/legacy/perspectiveWidget.pyx":94
 *         if mouse_translate and mouse_rotate:
 *             self.bind('<Button-1>', self.tkRecordMouse)
 *             self.bind('<B1-Motion>', self.tkTranslate)             # <<<<<<<<<<<<<<
 *             if sys.platform == 'darwin':
 *                 self.bind('<Shift-Button-1>', self.StartRotate)
*/
    __pyx_t_3 = __pyx_v_self;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_tkTranslate); if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 94, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_B1_Motion, __pyx_t_1};
      __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_bind, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 94, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "opengl/legacy/perspectiveWidget.pyx":95
 *             self.bind('<Button-1>', self.tkRecordMouse)
 *             self.bind('<B1-Motion>', self.tkTranslate)
 *             if sys.platform == 'darwin':             # <<<<<<<<<<<<<<
 *                 self.bind('<Shift-Button-1>', self.StartRotate)
 *                 self.bind('<Shift-B1-Motion>', self.tkRotate)
*/
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_sys); if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 95, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_platform); if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 95, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_darwin, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(26, 95, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_6) {

      /* "opengl/legacy/perspectiveWidget.pyx":96
 *             self.bind('<B1-Motion>', self.tkTranslate)
 *             if sys.platform == 'darwin':
 *                 self.bind('<Shift-Button-1>', self.StartRotate)             # <<<<<<<<<<<<<<
 *                 self.bind('<Shift-B1-Motion>', self.tkRotate)
 *                 self.bind('<ButtonRelease-1>', self.tkAutoSpin)
*/
      __pyx_t_4 = __pyx_v_self;
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_StartRotate); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 96, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = 0;
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_Shift_Button_1, __pyx_t_3};
        __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_bind, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 96, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "opengl/legacy/perspectiveWidget.pyx":97
 *             if sys.platform == 'darwin':
 *                 self.bind('<Shift-Button-1>', self.StartRotate)
 *                 self.bind('<Shift-B1-Motion>', self.tkRotate)             # <<<<<<<<<<<<<<
 *                 self.bind('<ButtonRelease-1>', self.tkAutoSpin)
 *             else:
*/
      __pyx_t_3 = __pyx_v_self;
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_tkRotate); if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 97, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = 0;
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_Shift_B1_Motion, __pyx_t_4};
        __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_bind, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 97, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "opengl/legacy/perspectiveWidget.pyx":98
 *                 self.bind('<Shift-Button-1>', self.StartRotate)
 *                 self.bind('<Shift-B1-Motion>', self.tkRotate)
 *                 self.bind('<ButtonRelease-1>', self.tkAutoSpin)             # <<<<<<<<<<<<<<
 *             else:
 *                 self.bind('<Button-3>', self.StartRotate)
*/
      __pyx_t_4 = __pyx_v_self;
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_tkAutoSpin); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 98, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = 0;
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_ButtonRelease_1, __pyx_t_3};
        __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_bind, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 98, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "opengl/legacy/perspectiveWidget.pyx":95
 *             self.bind('<Button-1>', self.tkRecordMouse)
 *             self.bind('<B1-Motion>', self.tkTranslate)
 *             if sys.platform == 'darwin':             # <<<<<<<<<<<<<<
 *                 self.bind('<Shift-Button-1>', self.StartRotate)
 *                 self.bind('<Shift-B1-Motion>', self.tkRotate)
*/
      goto __pyx_L8;
    }

    /* "opengl/legacy/perspectiveWidget.pyx":100
 *                 self.bind('<ButtonRelease-1>', self.tkAutoSpin)
 *             else:
 *                 self.bind('<Button-3>', self.StartRotate)             # <<<<<<<<<<<<<<
 *                 self.bind('<B3-Motion>', self.tkRotate)
 *                 self.bind('<ButtonRelease-3>', self.tkAutoSpin)
*/
    /*else*/ {
      __pyx_t_3 = __pyx_v_self;
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_StartRotate); if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 100, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = 0;
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_Button_3, __pyx_t_4};
        __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_bind, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 100, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "opengl/legacy/perspectiveWidget.pyx":101
 *             else:
 *                 self.bind('<Button-3>', self.StartRotate)
 *                 self.bind('<B3-Motion>', self.tkRotate)             # <<<<<<<<<<<<<<
 *                 self.bind('<ButtonRelease-3>', self.tkAutoSpin)
 *         elif mouse_rotate:
*/
      __pyx_t_4 = __pyx_v_self;
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_tkRotate); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 101, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = 0;
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_B3_Motion, __pyx_t_3};
        __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_bind, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 101, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "opengl/legacy/perspectiveWidget.pyx":102
 *                 self.bind('<Button-3>', self.StartRotate)
 *                 self.bind('<B3-Motion>', self.tkRotate)
 *                 self.bind('<ButtonRelease-3>', self.tkAutoSpin)             # <<<<<<<<<<<<<<
 *         elif mouse_rotate:
 *             self.bind('<Button-1>', self.StartRotate)
*/
      __pyx_t_3 = __pyx_v_self;
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_tkAutoSpin); if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 102, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = 0;
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_ButtonRelease_3, __pyx_t_4};
        __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_bind, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 102, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __pyx_L8:;

    /* "opengl/legacy/perspectiveWidget.pyx":92
 *             self.bind('<Control-Button-1>', self.tkHandlePick)
 *             self.bind('<Control-Button-1><ButtonRelease-1>', self.tkHandlePick)
 *         if mouse_translate and mouse_rotate:             # <<<<<<<<<<<<<<
 *             self.bind('<Button-1>', self.tkRecordMouse)
 *             self.bind('<B1-Motion>', self.tkTranslate)
*/
    goto __pyx_L5;
  }

  /* "opengl/legacy/perspectiveWidget.pyx":103
 *                 self.bind('<B3-Motion>', self.tkRotate)
 *                 self.bind('<ButtonRelease-3>', self.tkAutoSpin)
 *         elif mouse_rotate:             # <<<<<<<<<<<<<<
 *             self.bind('<Button-1>', self.StartRotate)
 *             self.bind('<B1-Motion>', self.tkRotate)
*/
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_mouse_rotate); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(26, 103, __pyx_L1_error)
  if (__pyx_t_6) {

    /* "opengl/legacy/perspectiveWidget.pyx":104
 *                 self.bind('<ButtonRelease-3>', self.tkAutoSpin)
 *         elif mouse_rotate:
 *             self.bind('<Button-1>', self.StartRotate)             # <<<<<<<<<<<<<<
 *             self.bind('<B1-Motion>', self.tkRotate)
 *             self.bind('<ButtonRelease-1>', self.tkAutoSpin)
*/
    __pyx_t_4 = __pyx_v_self;
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_StartRotate); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 104, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_Button_1, __pyx_t_3};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_bind, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 104, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "opengl/legacy/perspectiveWidget.pyx":105
 *         elif mouse_rotate:
 *             self.bind('<Button-1>', self.StartRotate)
 *             self.bind('<B1-Motion>', self.tkRotate)             # <<<<<<<<<<<<<<
 *             self.bind('<ButtonRelease-1>', self.tkAutoSpin)
 *         elif mouse_translate:
*/
    __pyx_t_3 = __pyx_v_self;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_tkRotate); if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 105, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_B1_Motion, __pyx_t_4};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_bind, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 105, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "opengl/legacy/perspectiveWidget.pyx":106
 *             self.bind('<Button-1>', self.StartRotate)
 *             self.bind('<B1-Motion>', self.tkRotate)
 *             self.bind('<ButtonRelease-1>', self.tkAutoSpin)             # <<<<<<<<<<<<<<
 *         elif mouse_translate:
 *             self.bind('<Button-1>', self.tkRecordMouse)
*/
    __pyx_t_4 = __pyx_v_self;
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_tkAutoSpin); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 106, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_ButtonRelease_1, __pyx_t_3};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_bind, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 106, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "opengl/legacy/perspectiveWidget.pyx":103
 *                 self.bind('<B3-Motion>', self.tkRotate)
 *                 self.bind('<ButtonRelease-3>', self.tkAutoSpin)
 *         elif mouse_rotate:             # <<<<<<<<<<<<<<
 *             self.bind('<Button-1>', self.StartRotate)
 *             self.bind('<B1-Motion>', self.tkRotate)
*/
    goto __pyx_L5;
  }

  /* "opengl/legacy/perspectiveWidget.pyx":107
 *             self.bind('<B1-Motion>', self.tkRotate)
 *             self.bind('<ButtonRelease-1>', self.tkAutoSpin)
 *         elif mouse_translate:             # <<<<<<<<<<<<<<
 *             self.bind('<Button-1>', self.tkRecordMouse)
 *             self.bind('<B1-Motion>', self.tkTranslate)
*/
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_mouse_translate); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(26, 107, __pyx_L1_error)
  if (__pyx_t_6) {

    /* "opengl/legacy/perspectiveWidget.pyx":108
 *             self.bind('<ButtonRelease-1>', self.tkAutoSpin)
 *         elif mouse_translate:
 *             self.bind('<Button-1>', self.tkRecordMouse)             # <<<<<<<<<<<<<<
 *             self.bind('<B1-Motion>', self.tkTranslate)
 *         if mouse_scale:
*/
    __pyx_t_3 = __pyx_v_self;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_tkRecordMouse); if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 108, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_Button_1, __pyx_t_4};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_bind, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 108, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "opengl/legacy/perspectiveWidget.pyx":109
 *         elif mouse_translate:
 *             self.bind('<Button-1>', self.tkRecordMouse)
 *             self.bind('<B1-Motion>', self.tkTranslate)             # <<<<<<<<<<<<<<
 *         if mouse_scale:
 *             self.bind('<Button-2>', self.tkRecordMouse)
*/
    __pyx_t_4 = __pyx_v_self;
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_tkTranslate); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 109, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_B1_Motion, __pyx_t_3};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_bind, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 109, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "opengl/legacy/perspectiveWidget.pyx":107
 *             self.bind('<B1-Motion>', self.tkRotate)
 *             self.bind('<ButtonRelease-1>', self.tkAutoSpin)
 *         elif mouse_translate:             # <<<<<<<<<<<<<<
 *             self.bind('<Button-1>', self.tkRecordMouse)
 *             self.bind('<B1-Motion>', self.tkTranslate)
*/
  }
  __pyx_L5:;

  /* "opengl/legacy/perspectiveWidget.pyx":110
 *             self.bind('<Button-1>', self.tkRecordMouse)
 *             self.bind('<B1-Motion>', self.tkTranslate)
 *         if mouse_scale:             # <<<<<<<<<<<<<<
 *             self.bind('<Button-2>', self.tkRecordMouse)
 *             self.bind('<B2-Motion>', self.tkScale)
*/
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_mouse_scale); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(26, 110, __pyx_L1_error)
  if (__pyx_t_6) {

    /* "opengl/legacy/perspectiveWidget.pyx":111
 *             self.bind('<B1-Motion>', self.tkTranslate)
 *         if mouse_scale:
 *             self.bind('<Button-2>', self.tkRecordMouse)             # <<<<<<<<<<<<<<
 *             self.bind('<B2-Motion>', self.tkScale)
 *             self.bind('<KeyPress>', self.tkKeyPress)
*/
    __pyx_t_3 = __pyx_v_self;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_tkRecordMouse); if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 111, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_Button_2, __pyx_t_4};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_bind, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 111, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "opengl/legacy/perspectiveWidget.pyx":112
 *         if mouse_scale:
 *             self.bind('<Button-2>', self.tkRecordMouse)
 *             self.bind('<B2-Motion>', self.tkScale)             # <<<<<<<<<<<<<<
 *             self.bind('<KeyPress>', self.tkKeyPress)
 * 
*/
    __pyx_t_4 = __pyx_v_self;
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_tkScale); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 112, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_B2_Motion, __pyx_t_3};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_bind, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 112, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "opengl/legacy/perspectiveWidget.pyx":113
 *             self.bind('<Button-2>', self.tkRecordMouse)
 *             self.bind('<B2-Motion>', self.tkScale)
 *             self.bind('<KeyPress>', self.tkKeyPress)             # <<<<<<<<<<<<<<
 * 
 *     def help(self):
*/
    __pyx_t_3 = __pyx_v_self;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_tkKeyPress); if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 113, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_KeyPress, __pyx_t_4};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_bind, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 113, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "opengl/legacy/perspectiveWidget.pyx":110
 *             self.bind('<Button-1>', self.tkRecordMouse)
 *             self.bind('<B1-Motion>', self.tkTranslate)
 *         if mouse_scale:             # <<<<<<<<<<<<<<
 *             self.bind('<Button-2>', self.tkRecordMouse)
 *             self.bind('<B2-Motion>', self.tkScale)
*/
  }

  /* "opengl/legacy/perspectiveWidget.pyx":38
 *     http://www.yorvic.york.ac.uk/~mjh/
 *     """
 *     def __init__(self, master=None, help='No help is available.',             # <<<<<<<<<<<<<<
 *                  mouse_pick=False, mouse_rotate=True, mouse_translate=False,
 *                  mouse_scale=False,
*/

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

/* "opengl/legacy/perspectiveWidget.pyx":115
 *             self.bind('<KeyPress>', self.tkKeyPress)
 * 
 *     def help(self):             # <<<<<<<<<<<<<<
 *         """
 *         Help message for the widget.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_23OpenGLPerspectiveWidget_3help(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_23OpenGLPerspectiveWidget_2help, "OpenGLPerspectiveWidget.help(self)\n\nHelp message for the widget.");
static PyMethodDef __pyx_mdef_8CyOpenGL_23OpenGLPerspectiveWidget_3help = {"help", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_23OpenGLPerspectiveWidget_3help, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_23OpenGLPerspectiveWidget_2help};
static PyObject *__pyx_pw_8CyOpenGL_23OpenGLPerspectiveWidget_3help(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("help (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(26, 115, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(26, 115, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "help", 0) < (0)) __PYX_ERR(26, 115, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("help", 1, 1, 1, i); __PYX_ERR(26, 115, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(26, 115, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("help", 1, 1, 1, __pyx_nargs); __PYX_ERR(26, 115, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("CyOpenGL.OpenGLPerspectiveWidget.help", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_23OpenGLPerspectiveWidget_2help(__pyx_self, __pyx_v_self);

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

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

  /* "opengl/legacy/perspectiveWidget.pyx":119
 *         Help message for the widget.
 *         """
 *         InfoWindow(self, 'Viewer Help', self.help_text, 'viewer_help')             # <<<<<<<<<<<<<<
 * 
 *     def set_background(self, r, g, b):
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_InfoWindow); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 119, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_help_text); if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 119, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[5] = {__pyx_t_2, __pyx_v_self, __pyx_mstate_global->__pyx_kp_u_Viewer_Help, __pyx_t_4, __pyx_mstate_global->__pyx_n_u_viewer_help};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_5, (5-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 119, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/legacy/perspectiveWidget.pyx":115
 *             self.bind('<KeyPress>', self.tkKeyPress)
 * 
 *     def help(self):             # <<<<<<<<<<<<<<
 *         """
 *         Help message for the widget.
*/

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

/* "opengl/legacy/perspectiveWidget.pyx":121
 *         InfoWindow(self, 'Viewer Help', self.help_text, 'viewer_help')
 * 
 *     def set_background(self, r, g, b):             # <<<<<<<<<<<<<<
 *         """
 *         Change the background colour of the widget.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_23OpenGLPerspectiveWidget_5set_background(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_23OpenGLPerspectiveWidget_4set_background, "OpenGLPerspectiveWidget.set_background(self, r, g, b)\n\nChange the background colour of the widget.");
static PyMethodDef __pyx_mdef_8CyOpenGL_23OpenGLPerspectiveWidget_5set_background = {"set_background", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_23OpenGLPerspectiveWidget_5set_background, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_23OpenGLPerspectiveWidget_4set_background};
static PyObject *__pyx_pw_8CyOpenGL_23OpenGLPerspectiveWidget_5set_background(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_r = 0;
  PyObject *__pyx_v_g = 0;
  PyObject *__pyx_v_b = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[4] = {0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_background (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_r,&__pyx_mstate_global->__pyx_n_u_g,&__pyx_mstate_global->__pyx_n_u_b,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(26, 121, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(26, 121, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(26, 121, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(26, 121, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(26, 121, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "set_background", 0) < (0)) __PYX_ERR(26, 121, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 4; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("set_background", 1, 4, 4, i); __PYX_ERR(26, 121, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 4)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(26, 121, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(26, 121, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(26, 121, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(26, 121, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
    __pyx_v_r = values[1];
    __pyx_v_g = values[2];
    __pyx_v_b = values[3];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_background", 1, 4, 4, __pyx_nargs); __PYX_ERR(26, 121, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("CyOpenGL.OpenGLPerspectiveWidget.set_background", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_23OpenGLPerspectiveWidget_4set_background(__pyx_self, __pyx_v_self, __pyx_v_r, __pyx_v_g, __pyx_v_b);

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

static PyObject *__pyx_pf_8CyOpenGL_23OpenGLPerspectiveWidget_4set_background(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_r, PyObject *__pyx_v_g, PyObject *__pyx_v_b) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_background", 0);

  /* "opengl/legacy/perspectiveWidget.pyx":125
 *         Change the background colour of the widget.
 *         """
 *         self.r_back = r             # <<<<<<<<<<<<<<
 *         self.g_back = g
 *         self.b_back = b
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_r_back, __pyx_v_r) < (0)) __PYX_ERR(26, 125, __pyx_L1_error)

  /* "opengl/legacy/perspectiveWidget.pyx":126
 *         """
 *         self.r_back = r
 *         self.g_back = g             # <<<<<<<<<<<<<<
 *         self.b_back = b
 *         self.redraw()
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_g_back, __pyx_v_g) < (0)) __PYX_ERR(26, 126, __pyx_L1_error)

  /* "opengl/legacy/perspectiveWidget.pyx":127
 *         self.r_back = r
 *         self.g_back = g
 *         self.b_back = b             # <<<<<<<<<<<<<<
 *         self.redraw()
 * 
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_b_back, __pyx_v_b) < (0)) __PYX_ERR(26, 127, __pyx_L1_error)

  /* "opengl/legacy/perspectiveWidget.pyx":128
 *         self.g_back = g
 *         self.b_back = b
 *         self.redraw()             # <<<<<<<<<<<<<<
 * 
 *     def set_centerpoint(self, x, y, z):
*/
  __pyx_t_2 = __pyx_v_self;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_redraw, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 128, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/legacy/perspectiveWidget.pyx":121
 *         InfoWindow(self, 'Viewer Help', self.help_text, 'viewer_help')
 * 
 *     def set_background(self, r, g, b):             # <<<<<<<<<<<<<<
 *         """
 *         Change the background colour of the widget.
*/

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

/* "opengl/legacy/perspectiveWidget.pyx":130
 *         self.redraw()
 * 
 *     def set_centerpoint(self, x, y, z):             # <<<<<<<<<<<<<<
 *         """
 *         Set the new center point for the model.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_23OpenGLPerspectiveWidget_7set_centerpoint(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_23OpenGLPerspectiveWidget_6set_centerpoint, "OpenGLPerspectiveWidget.set_centerpoint(self, x, y, z)\n\nSet the new center point for the model.\nThis is where we are looking.");
static PyMethodDef __pyx_mdef_8CyOpenGL_23OpenGLPerspectiveWidget_7set_centerpoint = {"set_centerpoint", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_23OpenGLPerspectiveWidget_7set_centerpoint, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_23OpenGLPerspectiveWidget_6set_centerpoint};
static PyObject *__pyx_pw_8CyOpenGL_23OpenGLPerspectiveWidget_7set_centerpoint(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_x = 0;
  PyObject *__pyx_v_y = 0;
  PyObject *__pyx_v_z = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[4] = {0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_centerpoint (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_y,&__pyx_mstate_global->__pyx_n_u_z,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(26, 130, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(26, 130, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(26, 130, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(26, 130, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(26, 130, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "set_centerpoint", 0) < (0)) __PYX_ERR(26, 130, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 4; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("set_centerpoint", 1, 4, 4, i); __PYX_ERR(26, 130, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 4)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(26, 130, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(26, 130, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(26, 130, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(26, 130, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
    __pyx_v_x = values[1];
    __pyx_v_y = values[2];
    __pyx_v_z = values[3];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_centerpoint", 1, 4, 4, __pyx_nargs); __PYX_ERR(26, 130, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("CyOpenGL.OpenGLPerspectiveWidget.set_centerpoint", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_23OpenGLPerspectiveWidget_6set_centerpoint(__pyx_self, __pyx_v_self, __pyx_v_x, __pyx_v_y, __pyx_v_z);

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

static PyObject *__pyx_pf_8CyOpenGL_23OpenGLPerspectiveWidget_6set_centerpoint(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_z) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_centerpoint", 0);

  /* "opengl/legacy/perspectiveWidget.pyx":135
 *         This is where we are looking.
 *         """
 *         self.xcenter = x             # <<<<<<<<<<<<<<
 *         self.ycenter = y
 *         self.zcenter = z
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_xcenter, __pyx_v_x) < (0)) __PYX_ERR(26, 135, __pyx_L1_error)

  /* "opengl/legacy/perspectiveWidget.pyx":136
 *         """
 *         self.xcenter = x
 *         self.ycenter = y             # <<<<<<<<<<<<<<
 *         self.zcenter = z
 *         self.redraw()
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_ycenter, __pyx_v_y) < (0)) __PYX_ERR(26, 136, __pyx_L1_error)

  /* "opengl/legacy/perspectiveWidget.pyx":137
 *         self.xcenter = x
 *         self.ycenter = y
 *         self.zcenter = z             # <<<<<<<<<<<<<<
 *         self.redraw()
 * 
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_zcenter, __pyx_v_z) < (0)) __PYX_ERR(26, 137, __pyx_L1_error)

  /* "opengl/legacy/perspectiveWidget.pyx":138
 *         self.ycenter = y
 *         self.zcenter = z
 *         self.redraw()             # <<<<<<<<<<<<<<
 * 
 *     def set_eyepoint(self, distance):
*/
  __pyx_t_2 = __pyx_v_self;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_redraw, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 138, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/legacy/perspectiveWidget.pyx":130
 *         self.redraw()
 * 
 *     def set_centerpoint(self, x, y, z):             # <<<<<<<<<<<<<<
 *         """
 *         Set the new center point for the model.
*/

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

/* "opengl/legacy/perspectiveWidget.pyx":140
 *         self.redraw()
 * 
 *     def set_eyepoint(self, distance):             # <<<<<<<<<<<<<<
 *         """
 *         Set how far the eye is from the position we are looking.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_23OpenGLPerspectiveWidget_9set_eyepoint(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_23OpenGLPerspectiveWidget_8set_eyepoint, "OpenGLPerspectiveWidget.set_eyepoint(self, distance)\n\nSet how far the eye is from the position we are looking.");
static PyMethodDef __pyx_mdef_8CyOpenGL_23OpenGLPerspectiveWidget_9set_eyepoint = {"set_eyepoint", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_23OpenGLPerspectiveWidget_9set_eyepoint, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_23OpenGLPerspectiveWidget_8set_eyepoint};
static PyObject *__pyx_pw_8CyOpenGL_23OpenGLPerspectiveWidget_9set_eyepoint(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_distance = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_eyepoint (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_distance,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(26, 140, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(26, 140, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(26, 140, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "set_eyepoint", 0) < (0)) __PYX_ERR(26, 140, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("set_eyepoint", 1, 2, 2, i); __PYX_ERR(26, 140, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(26, 140, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(26, 140, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
    __pyx_v_distance = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_eyepoint", 1, 2, 2, __pyx_nargs); __PYX_ERR(26, 140, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("CyOpenGL.OpenGLPerspectiveWidget.set_eyepoint", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_23OpenGLPerspectiveWidget_8set_eyepoint(__pyx_self, __pyx_v_self, __pyx_v_distance);

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

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

  /* "opengl/legacy/perspectiveWidget.pyx":144
 *         Set how far the eye is from the position we are looking.
 *         """
 *         self.distance = distance             # <<<<<<<<<<<<<<
 *         self.redraw()
 * 
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_distance, __pyx_v_distance) < (0)) __PYX_ERR(26, 144, __pyx_L1_error)

  /* "opengl/legacy/perspectiveWidget.pyx":145
 *         """
 *         self.distance = distance
 *         self.redraw()             # <<<<<<<<<<<<<<
 * 
 *     def reset(self, redraw=True):
*/
  __pyx_t_2 = __pyx_v_self;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_redraw, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 145, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/legacy/perspectiveWidget.pyx":140
 *         self.redraw()
 * 
 *     def set_eyepoint(self, distance):             # <<<<<<<<<<<<<<
 *         """
 *         Set how far the eye is from the position we are looking.
*/

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

/* "opengl/legacy/perspectiveWidget.pyx":147
 *         self.redraw()
 * 
 *     def reset(self, redraw=True):             # <<<<<<<<<<<<<<
 *         """
 *         Reset rotation matrix for this widget.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_23OpenGLPerspectiveWidget_11reset(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_23OpenGLPerspectiveWidget_10reset, "OpenGLPerspectiveWidget.reset(self, redraw=True)\n\nReset rotation matrix for this widget.");
static PyMethodDef __pyx_mdef_8CyOpenGL_23OpenGLPerspectiveWidget_11reset = {"reset", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_23OpenGLPerspectiveWidget_11reset, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_23OpenGLPerspectiveWidget_10reset};
static PyObject *__pyx_pw_8CyOpenGL_23OpenGLPerspectiveWidget_11reset(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_redraw = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("reset (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_redraw,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(26, 147, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(26, 147, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(26, 147, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "reset", 0) < (0)) __PYX_ERR(26, 147, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_True)));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("reset", 0, 1, 2, i); __PYX_ERR(26, 147, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(26, 147, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(26, 147, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_True)));
    }
    __pyx_v_self = values[0];
    __pyx_v_redraw = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("reset", 0, 1, 2, __pyx_nargs); __PYX_ERR(26, 147, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("CyOpenGL.OpenGLPerspectiveWidget.reset", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_23OpenGLPerspectiveWidget_10reset(__pyx_self, __pyx_v_self, __pyx_v_redraw);

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

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

  /* "opengl/legacy/perspectiveWidget.pyx":151
 *         Reset rotation matrix for this widget.
 *         """
 *         self.autospin = 0             # <<<<<<<<<<<<<<
 *         self.make_current()
 *         glMatrixMode(GL_MODELVIEW)
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_autospin, __pyx_mstate_global->__pyx_int_0) < (0)) __PYX_ERR(26, 151, __pyx_L1_error)

  /* "opengl/legacy/perspectiveWidget.pyx":152
 *         """
 *         self.autospin = 0
 *         self.make_current()             # <<<<<<<<<<<<<<
 *         glMatrixMode(GL_MODELVIEW)
 *         glLoadIdentity()
*/
  __pyx_t_2 = __pyx_v_self;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_make_current, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 152, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/legacy/perspectiveWidget.pyx":153
 *         self.autospin = 0
 *         self.make_current()
 *         glMatrixMode(GL_MODELVIEW)             # <<<<<<<<<<<<<<
 *         glLoadIdentity()
 *         if redraw:
*/
  glMatrixMode(GL_MODELVIEW);

  /* "opengl/legacy/perspectiveWidget.pyx":154
 *         self.make_current()
 *         glMatrixMode(GL_MODELVIEW)
 *         glLoadIdentity()             # <<<<<<<<<<<<<<
 *         if redraw:
 *             self.redraw()
*/
  glLoadIdentity();

  /* "opengl/legacy/perspectiveWidget.pyx":155
 *         glMatrixMode(GL_MODELVIEW)
 *         glLoadIdentity()
 *         if redraw:             # <<<<<<<<<<<<<<
 *             self.redraw()
 * 
*/
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_redraw); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(26, 155, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "opengl/legacy/perspectiveWidget.pyx":156
 *         glLoadIdentity()
 *         if redraw:
 *             self.redraw()             # <<<<<<<<<<<<<<
 * 
 *     def tkHandlePick(self, event):
*/
    __pyx_t_2 = __pyx_v_self;
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_3 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_redraw, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 156, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "opengl/legacy/perspectiveWidget.pyx":155
 *         glMatrixMode(GL_MODELVIEW)
 *         glLoadIdentity()
 *         if redraw:             # <<<<<<<<<<<<<<
 *             self.redraw()
 * 
*/
  }

  /* "opengl/legacy/perspectiveWidget.pyx":147
 *         self.redraw()
 * 
 *     def reset(self, redraw=True):             # <<<<<<<<<<<<<<
 *         """
 *         Reset rotation matrix for this widget.
*/

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

/* "opengl/legacy/perspectiveWidget.pyx":158
 *             self.redraw()
 * 
 *     def tkHandlePick(self, event):             # <<<<<<<<<<<<<<
 *         """
 *         Handle a pick on the scene.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_23OpenGLPerspectiveWidget_13tkHandlePick(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_23OpenGLPerspectiveWidget_12tkHandlePick, "OpenGLPerspectiveWidget.tkHandlePick(self, event)\n\nHandle a pick on the scene.");
static PyMethodDef __pyx_mdef_8CyOpenGL_23OpenGLPerspectiveWidget_13tkHandlePick = {"tkHandlePick", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_23OpenGLPerspectiveWidget_13tkHandlePick, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_23OpenGLPerspectiveWidget_12tkHandlePick};
static PyObject *__pyx_pw_8CyOpenGL_23OpenGLPerspectiveWidget_13tkHandlePick(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_event = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("tkHandlePick (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_event,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(26, 158, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(26, 158, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(26, 158, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "tkHandlePick", 0) < (0)) __PYX_ERR(26, 158, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("tkHandlePick", 1, 2, 2, i); __PYX_ERR(26, 158, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(26, 158, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(26, 158, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
    __pyx_v_event = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("tkHandlePick", 1, 2, 2, __pyx_nargs); __PYX_ERR(26, 158, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("CyOpenGL.OpenGLPerspectiveWidget.tkHandlePick", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_23OpenGLPerspectiveWidget_12tkHandlePick(__pyx_self, __pyx_v_self, __pyx_v_event);

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

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

  /* "opengl/legacy/perspectiveWidget.pyx":167
 *         cdef GLint view[4]
 * 
 *         if hasattr(self, 'pick'):             # <<<<<<<<<<<<<<
 *             raise ValueError('Sorry, this implementation was removed')
 *             # See GLU/README.txt for how to restore.
*/
  __pyx_t_1 = __Pyx_HasAttr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_pick); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(26, 167, __pyx_L1_error)
  if (unlikely(__pyx_t_1)) {

    /* "opengl/legacy/perspectiveWidget.pyx":168
 * 
 *         if hasattr(self, 'pick'):
 *             raise ValueError('Sorry, this implementation was removed')             # <<<<<<<<<<<<<<
 *             # See GLU/README.txt for how to restore.
 *             #
*/
    __pyx_t_3 = NULL;
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_Sorry_this_implementation_was_re};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(26, 168, __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(26, 168, __pyx_L1_error)

    /* "opengl/legacy/perspectiveWidget.pyx":167
 *         cdef GLint view[4]
 * 
 *         if hasattr(self, 'pick'):             # <<<<<<<<<<<<<<
 *             raise ValueError('Sorry, this implementation was removed')
 *             # See GLU/README.txt for how to restore.
*/
  }

  /* "opengl/legacy/perspectiveWidget.pyx":158
 *             self.redraw()
 * 
 *     def tkHandlePick(self, event):             # <<<<<<<<<<<<<<
 *         """
 *         Handle a pick on the scene.
*/

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

/* "opengl/legacy/perspectiveWidget.pyx":190
 *             #     self.redraw()
 * 
 *     def tkRecordMouse(self, event):             # <<<<<<<<<<<<<<
 *         """
 *         Record the current mouse position.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_23OpenGLPerspectiveWidget_15tkRecordMouse(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_23OpenGLPerspectiveWidget_14tkRecordMouse, "OpenGLPerspectiveWidget.tkRecordMouse(self, event)\n\nRecord the current mouse position.");
static PyMethodDef __pyx_mdef_8CyOpenGL_23OpenGLPerspectiveWidget_15tkRecordMouse = {"tkRecordMouse", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_23OpenGLPerspectiveWidget_15tkRecordMouse, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_23OpenGLPerspectiveWidget_14tkRecordMouse};
static PyObject *__pyx_pw_8CyOpenGL_23OpenGLPerspectiveWidget_15tkRecordMouse(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_event = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("tkRecordMouse (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_event,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(26, 190, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(26, 190, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(26, 190, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "tkRecordMouse", 0) < (0)) __PYX_ERR(26, 190, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("tkRecordMouse", 1, 2, 2, i); __PYX_ERR(26, 190, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(26, 190, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(26, 190, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
    __pyx_v_event = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("tkRecordMouse", 1, 2, 2, __pyx_nargs); __PYX_ERR(26, 190, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("CyOpenGL.OpenGLPerspectiveWidget.tkRecordMouse", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_23OpenGLPerspectiveWidget_14tkRecordMouse(__pyx_self, __pyx_v_self, __pyx_v_event);

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

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

  /* "opengl/legacy/perspectiveWidget.pyx":194
 *         Record the current mouse position.
 *         """
 *         self.delta_t = event.time - self.tmouse             # <<<<<<<<<<<<<<
 *         self.xmouse, self.ymouse, self.tmouse = event.x, event.y, event.time
 * 
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_event, __pyx_mstate_global->__pyx_n_u_time); if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_tmouse); if (unlikely(!__pyx_t_2)) __PYX_ERR(26, 194, __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(26, 194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_delta_t, __pyx_t_3) < (0)) __PYX_ERR(26, 194, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "opengl/legacy/perspectiveWidget.pyx":195
 *         """
 *         self.delta_t = event.time - self.tmouse
 *         self.xmouse, self.ymouse, self.tmouse = event.x, event.y, event.time             # <<<<<<<<<<<<<<
 * 
 *     def StartRotate(self, event):
*/
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_event, __pyx_mstate_global->__pyx_n_u_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 195, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_event, __pyx_mstate_global->__pyx_n_u_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(26, 195, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_event, __pyx_mstate_global->__pyx_n_u_time); if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 195, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_xmouse, __pyx_t_3) < (0)) __PYX_ERR(26, 195, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_ymouse, __pyx_t_2) < (0)) __PYX_ERR(26, 195, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_tmouse, __pyx_t_1) < (0)) __PYX_ERR(26, 195, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/legacy/perspectiveWidget.pyx":190
 *             #     self.redraw()
 * 
 *     def tkRecordMouse(self, event):             # <<<<<<<<<<<<<<
 *         """
 *         Record the current mouse position.
*/

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

/* "opengl/legacy/perspectiveWidget.pyx":197
 *         self.xmouse, self.ymouse, self.tmouse = event.x, event.y, event.time
 * 
 *     def StartRotate(self, event):             # <<<<<<<<<<<<<<
 *         # Switch off any autospinning if it was happening
 *         self.autospin = 0
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_23OpenGLPerspectiveWidget_17StartRotate(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_23OpenGLPerspectiveWidget_16StartRotate, "OpenGLPerspectiveWidget.StartRotate(self, event)");
static PyMethodDef __pyx_mdef_8CyOpenGL_23OpenGLPerspectiveWidget_17StartRotate = {"StartRotate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_23OpenGLPerspectiveWidget_17StartRotate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_23OpenGLPerspectiveWidget_16StartRotate};
static PyObject *__pyx_pw_8CyOpenGL_23OpenGLPerspectiveWidget_17StartRotate(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_event = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("StartRotate (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_event,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(26, 197, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(26, 197, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(26, 197, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "StartRotate", 0) < (0)) __PYX_ERR(26, 197, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("StartRotate", 1, 2, 2, i); __PYX_ERR(26, 197, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(26, 197, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(26, 197, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
    __pyx_v_event = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("StartRotate", 1, 2, 2, __pyx_nargs); __PYX_ERR(26, 197, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("CyOpenGL.OpenGLPerspectiveWidget.StartRotate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_23OpenGLPerspectiveWidget_16StartRotate(__pyx_self, __pyx_v_self, __pyx_v_event);

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

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

  /* "opengl/legacy/perspectiveWidget.pyx":199
 *     def StartRotate(self, event):
 *         # Switch off any autospinning if it was happening
 *         self.autospin = 0             # <<<<<<<<<<<<<<
 *         self.tkRecordMouse(event)
 * 
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_autospin, __pyx_mstate_global->__pyx_int_0) < (0)) __PYX_ERR(26, 199, __pyx_L1_error)

  /* "opengl/legacy/perspectiveWidget.pyx":200
 *         # Switch off any autospinning if it was happening
 *         self.autospin = 0
 *         self.tkRecordMouse(event)             # <<<<<<<<<<<<<<
 * 
 *     def tkScale(self, event):
*/
  __pyx_t_2 = __pyx_v_self;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_event};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_tkRecordMouse, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 200, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/legacy/perspectiveWidget.pyx":197
 *         self.xmouse, self.ymouse, self.tmouse = event.x, event.y, event.time
 * 
 *     def StartRotate(self, event):             # <<<<<<<<<<<<<<
 *         # Switch off any autospinning if it was happening
 *         self.autospin = 0
*/

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

/* "opengl/legacy/perspectiveWidget.pyx":202
 *         self.tkRecordMouse(event)
 * 
 *     def tkScale(self, event):             # <<<<<<<<<<<<<<
 *         """
 *         Scale the scene.  Achieved by moving the eye position
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_23OpenGLPerspectiveWidget_19tkScale(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_23OpenGLPerspectiveWidget_18tkScale, "OpenGLPerspectiveWidget.tkScale(self, event)\n\nScale the scene.  Achieved by moving the eye position\nwhen using perspective.");
static PyMethodDef __pyx_mdef_8CyOpenGL_23OpenGLPerspectiveWidget_19tkScale = {"tkScale", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_23OpenGLPerspectiveWidget_19tkScale, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_23OpenGLPerspectiveWidget_18tkScale};
static PyObject *__pyx_pw_8CyOpenGL_23OpenGLPerspectiveWidget_19tkScale(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_event = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("tkScale (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_event,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(26, 202, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(26, 202, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(26, 202, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "tkScale", 0) < (0)) __PYX_ERR(26, 202, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("tkScale", 1, 2, 2, i); __PYX_ERR(26, 202, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(26, 202, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(26, 202, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
    __pyx_v_event = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("tkScale", 1, 2, 2, __pyx_nargs); __PYX_ERR(26, 202, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("CyOpenGL.OpenGLPerspectiveWidget.tkScale", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_23OpenGLPerspectiveWidget_18tkScale(__pyx_self, __pyx_v_self, __pyx_v_event);

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

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

  /* "opengl/legacy/perspectiveWidget.pyx":207
 *         when using perspective.
 *         """
 *         scale = 1 - 0.01 * (event.y - self.ymouse)             # <<<<<<<<<<<<<<
 *         self.distance = self.distance * scale
 *         self.redraw()
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_event, __pyx_mstate_global->__pyx_n_u_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_ymouse); if (unlikely(!__pyx_t_2)) __PYX_ERR(26, 207, __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(26, 207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_Multiply(__pyx_mstate_global->__pyx_float_0_01, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(26, 207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyLong_SubtractCObj(__pyx_mstate_global->__pyx_int_1, __pyx_t_2, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_scale = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "opengl/legacy/perspectiveWidget.pyx":208
 *         """
 *         scale = 1 - 0.01 * (event.y - self.ymouse)
 *         self.distance = self.distance * scale             # <<<<<<<<<<<<<<
 *         self.redraw()
 *         self.tkRecordMouse(event)
*/
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_distance); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 208, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyNumber_Multiply(__pyx_t_3, __pyx_v_scale); if (unlikely(!__pyx_t_2)) __PYX_ERR(26, 208, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_distance, __pyx_t_2) < (0)) __PYX_ERR(26, 208, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opengl/legacy/perspectiveWidget.pyx":209
 *         scale = 1 - 0.01 * (event.y - self.ymouse)
 *         self.distance = self.distance * scale
 *         self.redraw()             # <<<<<<<<<<<<<<
 *         self.tkRecordMouse(event)
 * 
*/
  __pyx_t_3 = __pyx_v_self;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_redraw, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(26, 209, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opengl/legacy/perspectiveWidget.pyx":210
 *         self.distance = self.distance * scale
 *         self.redraw()
 *         self.tkRecordMouse(event)             # <<<<<<<<<<<<<<
 * 
 *     def zoom(self, x):
*/
  __pyx_t_3 = __pyx_v_self;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_event};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_tkRecordMouse, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(26, 210, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opengl/legacy/perspectiveWidget.pyx":202
 *         self.tkRecordMouse(event)
 * 
 *     def tkScale(self, event):             # <<<<<<<<<<<<<<
 *         """
 *         Scale the scene.  Achieved by moving the eye position
*/

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

/* "opengl/legacy/perspectiveWidget.pyx":212
 *         self.tkRecordMouse(event)
 * 
 *     def zoom(self, x):             # <<<<<<<<<<<<<<
 *         t = float(x)/100.0
 *         self.distance = t*2.0 + (1-t)*10.0
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_23OpenGLPerspectiveWidget_21zoom(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_23OpenGLPerspectiveWidget_20zoom, "OpenGLPerspectiveWidget.zoom(self, x)");
static PyMethodDef __pyx_mdef_8CyOpenGL_23OpenGLPerspectiveWidget_21zoom = {"zoom", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_23OpenGLPerspectiveWidget_21zoom, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_23OpenGLPerspectiveWidget_20zoom};
static PyObject *__pyx_pw_8CyOpenGL_23OpenGLPerspectiveWidget_21zoom(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_x = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("zoom (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_x,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(26, 212, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(26, 212, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(26, 212, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "zoom", 0) < (0)) __PYX_ERR(26, 212, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("zoom", 1, 2, 2, i); __PYX_ERR(26, 212, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(26, 212, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(26, 212, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
    __pyx_v_x = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zoom", 1, 2, 2, __pyx_nargs); __PYX_ERR(26, 212, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("CyOpenGL.OpenGLPerspectiveWidget.zoom", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_23OpenGLPerspectiveWidget_20zoom(__pyx_self, __pyx_v_self, __pyx_v_x);

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

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

  /* "opengl/legacy/perspectiveWidget.pyx":213
 * 
 *     def zoom(self, x):
 *         t = float(x)/100.0             # <<<<<<<<<<<<<<
 *         self.distance = t*2.0 + (1-t)*10.0
 *         self.redraw()
*/
  __pyx_t_1 = __Pyx_PyObject_AsDouble(__pyx_v_x); if (unlikely(__PYX_CHECK_FLOAT_EXCEPTION(__pyx_t_1, ((double)((double)-1))) && PyErr_Occurred())) __PYX_ERR(26, 213, __pyx_L1_error)
  __pyx_v_t = (__pyx_t_1 / 100.0);

  /* "opengl/legacy/perspectiveWidget.pyx":214
 *     def zoom(self, x):
 *         t = float(x)/100.0
 *         self.distance = t*2.0 + (1-t)*10.0             # <<<<<<<<<<<<<<
 *         self.redraw()
 * 
*/
  __pyx_t_2 = PyFloat_FromDouble(((__pyx_v_t * 2.0) + ((1.0 - __pyx_v_t) * 10.0))); if (unlikely(!__pyx_t_2)) __PYX_ERR(26, 214, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_distance, __pyx_t_2) < (0)) __PYX_ERR(26, 214, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opengl/legacy/perspectiveWidget.pyx":215
 *         t = float(x)/100.0
 *         self.distance = t*2.0 + (1-t)*10.0
 *         self.redraw()             # <<<<<<<<<<<<<<
 * 
 *     def do_AutoSpin(self):
*/
  __pyx_t_3 = __pyx_v_self;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_redraw, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(26, 215, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opengl/legacy/perspectiveWidget.pyx":212
 *         self.tkRecordMouse(event)
 * 
 *     def zoom(self, x):             # <<<<<<<<<<<<<<
 *         t = float(x)/100.0
 *         self.distance = t*2.0 + (1-t)*10.0
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("CyOpenGL.OpenGLPerspectiveWidget.zoom", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opengl/legacy/perspectiveWidget.pyx":217
 *         self.redraw()
 * 
 *     def do_AutoSpin(self):             # <<<<<<<<<<<<<<
 *         self.make_current()
 *         cyglRotateScene(self.xcenter, self.ycenter, self.zcenter,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_23OpenGLPerspectiveWidget_23do_AutoSpin(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_23OpenGLPerspectiveWidget_22do_AutoSpin, "OpenGLPerspectiveWidget.do_AutoSpin(self)");
static PyMethodDef __pyx_mdef_8CyOpenGL_23OpenGLPerspectiveWidget_23do_AutoSpin = {"do_AutoSpin", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_23OpenGLPerspectiveWidget_23do_AutoSpin, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_23OpenGLPerspectiveWidget_22do_AutoSpin};
static PyObject *__pyx_pw_8CyOpenGL_23OpenGLPerspectiveWidget_23do_AutoSpin(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("do_AutoSpin (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(26, 217, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(26, 217, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "do_AutoSpin", 0) < (0)) __PYX_ERR(26, 217, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("do_AutoSpin", 1, 1, 1, i); __PYX_ERR(26, 217, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(26, 217, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("do_AutoSpin", 1, 1, 1, __pyx_nargs); __PYX_ERR(26, 217, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("CyOpenGL.OpenGLPerspectiveWidget.do_AutoSpin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_23OpenGLPerspectiveWidget_22do_AutoSpin(__pyx_self, __pyx_v_self);

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

static PyObject *__pyx_pf_8CyOpenGL_23OpenGLPerspectiveWidget_22do_AutoSpin(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  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_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("do_AutoSpin", 0);

  /* "opengl/legacy/perspectiveWidget.pyx":218
 * 
 *     def do_AutoSpin(self):
 *         self.make_current()             # <<<<<<<<<<<<<<
 *         cyglRotateScene(self.xcenter, self.ycenter, self.zcenter,
 *                         self.Xangle, self.Yangle)
*/
  __pyx_t_2 = __pyx_v_self;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_make_current, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 218, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/legacy/perspectiveWidget.pyx":219
 *     def do_AutoSpin(self):
 *         self.make_current()
 *         cyglRotateScene(self.xcenter, self.ycenter, self.zcenter,             # <<<<<<<<<<<<<<
 *                         self.Xangle, self.Yangle)
 *         self.redraw()
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_xcenter); if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 219, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_ycenter); if (unlikely(!__pyx_t_2)) __PYX_ERR(26, 219, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_zcenter); if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 219, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "opengl/legacy/perspectiveWidget.pyx":220
 *         self.make_current()
 *         cyglRotateScene(self.xcenter, self.ycenter, self.zcenter,
 *                         self.Xangle, self.Yangle)             # <<<<<<<<<<<<<<
 *         self.redraw()
 * 
*/
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_Xangle); if (unlikely(!__pyx_t_5)) __PYX_ERR(26, 220, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_Yangle); if (unlikely(!__pyx_t_6)) __PYX_ERR(26, 220, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);

  /* "opengl/legacy/perspectiveWidget.pyx":219
 *     def do_AutoSpin(self):
 *         self.make_current()
 *         cyglRotateScene(self.xcenter, self.ycenter, self.zcenter,             # <<<<<<<<<<<<<<
 *                         self.Xangle, self.Yangle)
 *         self.redraw()
*/
  __pyx_t_7 = __pyx_f_8CyOpenGL_cyglRotateScene(__pyx_t_1, __pyx_t_2, __pyx_t_4, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(26, 219, __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_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "opengl/legacy/perspectiveWidget.pyx":221
 *         cyglRotateScene(self.xcenter, self.ycenter, self.zcenter,
 *                         self.Xangle, self.Yangle)
 *         self.redraw()             # <<<<<<<<<<<<<<
 * 
 *         if self.autospin:
*/
  __pyx_t_6 = __pyx_v_self;
  __Pyx_INCREF(__pyx_t_6);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
    __pyx_t_7 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_redraw, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_7)) __PYX_ERR(26, 221, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
  }
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "opengl/legacy/perspectiveWidget.pyx":223
 *         self.redraw()
 * 
 *         if self.autospin:             # <<<<<<<<<<<<<<
 *             self.after(10, self.do_AutoSpin)
 * 
*/
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_autospin); if (unlikely(!__pyx_t_7)) __PYX_ERR(26, 223, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(26, 223, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (__pyx_t_8) {

    /* "opengl/legacy/perspectiveWidget.pyx":224
 * 
 *         if self.autospin:
 *             self.after(10, self.do_AutoSpin)             # <<<<<<<<<<<<<<
 * 
 *     def tkAutoSpin(self, event):
*/
    __pyx_t_6 = __pyx_v_self;
    __Pyx_INCREF(__pyx_t_6);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_do_AutoSpin); if (unlikely(!__pyx_t_5)) __PYX_ERR(26, 224, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = 0;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_mstate_global->__pyx_int_10, __pyx_t_5};
      __pyx_t_7 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_after, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(26, 224, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "opengl/legacy/perspectiveWidget.pyx":223
 *         self.redraw()
 * 
 *         if self.autospin:             # <<<<<<<<<<<<<<
 *             self.after(10, self.do_AutoSpin)
 * 
*/
  }

  /* "opengl/legacy/perspectiveWidget.pyx":217
 *         self.redraw()
 * 
 *     def do_AutoSpin(self):             # <<<<<<<<<<<<<<
 *         self.make_current()
 *         cyglRotateScene(self.xcenter, self.ycenter, self.zcenter,
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("CyOpenGL.OpenGLPerspectiveWidget.do_AutoSpin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opengl/legacy/perspectiveWidget.pyx":226
 *             self.after(10, self.do_AutoSpin)
 * 
 *     def tkAutoSpin(self, event):             # <<<<<<<<<<<<<<
 *         """
 *         Perform autospin of scene.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_23OpenGLPerspectiveWidget_25tkAutoSpin(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_23OpenGLPerspectiveWidget_24tkAutoSpin, "OpenGLPerspectiveWidget.tkAutoSpin(self, event)\n\nPerform autospin of scene.");
static PyMethodDef __pyx_mdef_8CyOpenGL_23OpenGLPerspectiveWidget_25tkAutoSpin = {"tkAutoSpin", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_23OpenGLPerspectiveWidget_25tkAutoSpin, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_23OpenGLPerspectiveWidget_24tkAutoSpin};
static PyObject *__pyx_pw_8CyOpenGL_23OpenGLPerspectiveWidget_25tkAutoSpin(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_event = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("tkAutoSpin (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_event,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(26, 226, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(26, 226, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(26, 226, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "tkAutoSpin", 0) < (0)) __PYX_ERR(26, 226, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("tkAutoSpin", 1, 2, 2, i); __PYX_ERR(26, 226, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(26, 226, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(26, 226, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
    __pyx_v_event = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("tkAutoSpin", 1, 2, 2, __pyx_nargs); __PYX_ERR(26, 226, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("CyOpenGL.OpenGLPerspectiveWidget.tkAutoSpin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_23OpenGLPerspectiveWidget_24tkAutoSpin(__pyx_self, __pyx_v_self, __pyx_v_event);

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

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

  /* "opengl/legacy/perspectiveWidget.pyx":230
 *         Perform autospin of scene.
 *         """
 *         if self.autospin_allowed and 0 < self.delta_t < 100:             # <<<<<<<<<<<<<<
 *             self.autospin = 1
 *             self.after(10, self.do_AutoSpin)
*/
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_autospin_allowed); if (unlikely(!__pyx_t_2)) __PYX_ERR(26, 230, __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(26, 230, __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 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_delta_t); if (unlikely(!__pyx_t_2)) __PYX_ERR(26, 230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyObject_RichCompare(__pyx_mstate_global->__pyx_int_0, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 230, __pyx_L1_error)
  if (__Pyx_PyObject_IsTrue(__pyx_t_4)) {
    __Pyx_DECREF(__pyx_t_4);
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_mstate_global->__pyx_int_100, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 230, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(26, 230, __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) {

    /* "opengl/legacy/perspectiveWidget.pyx":231
 *         """
 *         if self.autospin_allowed and 0 < self.delta_t < 100:
 *             self.autospin = 1             # <<<<<<<<<<<<<<
 *             self.after(10, self.do_AutoSpin)
 *         self.update_idletasks()
*/
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_autospin, __pyx_mstate_global->__pyx_int_1) < (0)) __PYX_ERR(26, 231, __pyx_L1_error)

    /* "opengl/legacy/perspectiveWidget.pyx":232
 *         if self.autospin_allowed and 0 < self.delta_t < 100:
 *             self.autospin = 1
 *             self.after(10, self.do_AutoSpin)             # <<<<<<<<<<<<<<
 *         self.update_idletasks()
 * 
*/
    __pyx_t_2 = __pyx_v_self;
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_do_AutoSpin); if (unlikely(!__pyx_t_5)) __PYX_ERR(26, 232, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_mstate_global->__pyx_int_10, __pyx_t_5};
      __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_after, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 232, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "opengl/legacy/perspectiveWidget.pyx":230
 *         Perform autospin of scene.
 *         """
 *         if self.autospin_allowed and 0 < self.delta_t < 100:             # <<<<<<<<<<<<<<
 *             self.autospin = 1
 *             self.after(10, self.do_AutoSpin)
*/
  }

  /* "opengl/legacy/perspectiveWidget.pyx":233
 *             self.autospin = 1
 *             self.after(10, self.do_AutoSpin)
 *         self.update_idletasks()             # <<<<<<<<<<<<<<
 * 
 *     def tkRotate(self, event):
*/
  __pyx_t_5 = __pyx_v_self;
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
    __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_update_idletasks, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 233, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opengl/legacy/perspectiveWidget.pyx":226
 *             self.after(10, self.do_AutoSpin)
 * 
 *     def tkAutoSpin(self, event):             # <<<<<<<<<<<<<<
 *         """
 *         Perform autospin of scene.
*/

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

/* "opengl/legacy/perspectiveWidget.pyx":235
 *         self.update_idletasks()
 * 
 *     def tkRotate(self, event):             # <<<<<<<<<<<<<<
 *         """
 *         Perform rotation of scene.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_23OpenGLPerspectiveWidget_27tkRotate(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_23OpenGLPerspectiveWidget_26tkRotate, "OpenGLPerspectiveWidget.tkRotate(self, event)\n\nPerform rotation of scene.");
static PyMethodDef __pyx_mdef_8CyOpenGL_23OpenGLPerspectiveWidget_27tkRotate = {"tkRotate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_23OpenGLPerspectiveWidget_27tkRotate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_23OpenGLPerspectiveWidget_26tkRotate};
static PyObject *__pyx_pw_8CyOpenGL_23OpenGLPerspectiveWidget_27tkRotate(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_event = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("tkRotate (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_event,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(26, 235, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(26, 235, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(26, 235, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "tkRotate", 0) < (0)) __PYX_ERR(26, 235, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("tkRotate", 1, 2, 2, i); __PYX_ERR(26, 235, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(26, 235, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(26, 235, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
    __pyx_v_event = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("tkRotate", 1, 2, 2, __pyx_nargs); __PYX_ERR(26, 235, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("CyOpenGL.OpenGLPerspectiveWidget.tkRotate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_23OpenGLPerspectiveWidget_26tkRotate(__pyx_self, __pyx_v_self, __pyx_v_event);

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

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

  /* "opengl/legacy/perspectiveWidget.pyx":240
 *         """
 *         cdef GLfloat Xangle, Yangle
 *         self.make_current()             # <<<<<<<<<<<<<<
 *         self.Xangle = 0.5 * (event.x - self.xmouse)
 *         self.Yangle = 0.5 * (event.y - self.ymouse)
*/
  __pyx_t_2 = __pyx_v_self;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_make_current, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 240, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/legacy/perspectiveWidget.pyx":241
 *         cdef GLfloat Xangle, Yangle
 *         self.make_current()
 *         self.Xangle = 0.5 * (event.x - self.xmouse)             # <<<<<<<<<<<<<<
 *         self.Yangle = 0.5 * (event.y - self.ymouse)
 *         cyglRotateScene(self.xcenter, self.ycenter, self.zcenter,
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_event, __pyx_mstate_global->__pyx_n_u_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_xmouse); if (unlikely(!__pyx_t_2)) __PYX_ERR(26, 241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_Multiply(__pyx_mstate_global->__pyx_float_0_5, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(26, 241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_Xangle, __pyx_t_2) < (0)) __PYX_ERR(26, 241, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opengl/legacy/perspectiveWidget.pyx":242
 *         self.make_current()
 *         self.Xangle = 0.5 * (event.x - self.xmouse)
 *         self.Yangle = 0.5 * (event.y - self.ymouse)             # <<<<<<<<<<<<<<
 *         cyglRotateScene(self.xcenter, self.ycenter, self.zcenter,
 *                         self.Xangle, self.Yangle)
*/
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_event, __pyx_mstate_global->__pyx_n_u_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(26, 242, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_ymouse); if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 242, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = PyNumber_Subtract(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 242, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyNumber_Multiply(__pyx_mstate_global->__pyx_float_0_5, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 242, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_Yangle, __pyx_t_4) < (0)) __PYX_ERR(26, 242, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opengl/legacy/perspectiveWidget.pyx":243
 *         self.Xangle = 0.5 * (event.x - self.xmouse)
 *         self.Yangle = 0.5 * (event.y - self.ymouse)
 *         cyglRotateScene(self.xcenter, self.ycenter, self.zcenter,             # <<<<<<<<<<<<<<
 *                         self.Xangle, self.Yangle)
 *         self.redraw()
*/
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_xcenter); if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 243, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_ycenter); if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 243, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_zcenter); if (unlikely(!__pyx_t_2)) __PYX_ERR(26, 243, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "opengl/legacy/perspectiveWidget.pyx":244
 *         self.Yangle = 0.5 * (event.y - self.ymouse)
 *         cyglRotateScene(self.xcenter, self.ycenter, self.zcenter,
 *                         self.Xangle, self.Yangle)             # <<<<<<<<<<<<<<
 *         self.redraw()
 *         self.tkRecordMouse(event)
*/
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_Xangle); if (unlikely(!__pyx_t_5)) __PYX_ERR(26, 244, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_Yangle); if (unlikely(!__pyx_t_6)) __PYX_ERR(26, 244, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);

  /* "opengl/legacy/perspectiveWidget.pyx":243
 *         self.Xangle = 0.5 * (event.x - self.xmouse)
 *         self.Yangle = 0.5 * (event.y - self.ymouse)
 *         cyglRotateScene(self.xcenter, self.ycenter, self.zcenter,             # <<<<<<<<<<<<<<
 *                         self.Xangle, self.Yangle)
 *         self.redraw()
*/
  __pyx_t_7 = __pyx_f_8CyOpenGL_cyglRotateScene(__pyx_t_4, __pyx_t_1, __pyx_t_2, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(26, 243, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __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_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "opengl/legacy/perspectiveWidget.pyx":245
 *         cyglRotateScene(self.xcenter, self.ycenter, self.zcenter,
 *                         self.Xangle, self.Yangle)
 *         self.redraw()             # <<<<<<<<<<<<<<
 *         self.tkRecordMouse(event)
 * 
*/
  __pyx_t_6 = __pyx_v_self;
  __Pyx_INCREF(__pyx_t_6);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
    __pyx_t_7 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_redraw, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_7)) __PYX_ERR(26, 245, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
  }
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "opengl/legacy/perspectiveWidget.pyx":246
 *                         self.Xangle, self.Yangle)
 *         self.redraw()
 *         self.tkRecordMouse(event)             # <<<<<<<<<<<<<<
 * 
 *     def tkTranslate(self, event):
*/
  __pyx_t_6 = __pyx_v_self;
  __Pyx_INCREF(__pyx_t_6);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_event};
    __pyx_t_7 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_tkRecordMouse, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_7)) __PYX_ERR(26, 246, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
  }
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "opengl/legacy/perspectiveWidget.pyx":235
 *         self.update_idletasks()
 * 
 *     def tkRotate(self, event):             # <<<<<<<<<<<<<<
 *         """
 *         Perform rotation of scene.
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("CyOpenGL.OpenGLPerspectiveWidget.tkRotate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opengl/legacy/perspectiveWidget.pyx":248
 *         self.tkRecordMouse(event)
 * 
 *     def tkTranslate(self, event):             # <<<<<<<<<<<<<<
 *         """
 *         Perform translation of scene.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_23OpenGLPerspectiveWidget_29tkTranslate(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_23OpenGLPerspectiveWidget_28tkTranslate, "OpenGLPerspectiveWidget.tkTranslate(self, event)\n\nPerform translation of scene.");
static PyMethodDef __pyx_mdef_8CyOpenGL_23OpenGLPerspectiveWidget_29tkTranslate = {"tkTranslate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_23OpenGLPerspectiveWidget_29tkTranslate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_23OpenGLPerspectiveWidget_28tkTranslate};
static PyObject *__pyx_pw_8CyOpenGL_23OpenGLPerspectiveWidget_29tkTranslate(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_event = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("tkTranslate (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_event,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(26, 248, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(26, 248, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(26, 248, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "tkTranslate", 0) < (0)) __PYX_ERR(26, 248, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("tkTranslate", 1, 2, 2, i); __PYX_ERR(26, 248, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(26, 248, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(26, 248, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
    __pyx_v_event = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("tkTranslate", 1, 2, 2, __pyx_nargs); __PYX_ERR(26, 248, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("CyOpenGL.OpenGLPerspectiveWidget.tkTranslate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_23OpenGLPerspectiveWidget_28tkTranslate(__pyx_self, __pyx_v_self, __pyx_v_event);

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

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

  /* "opengl/legacy/perspectiveWidget.pyx":252
 *         Perform translation of scene.
 *         """
 *         self.make_current()             # <<<<<<<<<<<<<<
 *         cyglTranslateScene(0.05, event.x, event.y, self.xmouse, self.ymouse)
 *         self.redraw()
*/
  __pyx_t_2 = __pyx_v_self;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_make_current, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 252, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/legacy/perspectiveWidget.pyx":253
 *         """
 *         self.make_current()
 *         cyglTranslateScene(0.05, event.x, event.y, self.xmouse, self.ymouse)             # <<<<<<<<<<<<<<
 *         self.redraw()
 *         self.tkRecordMouse(event)
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_event, __pyx_mstate_global->__pyx_n_u_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 253, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_event, __pyx_mstate_global->__pyx_n_u_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(26, 253, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_xmouse); if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 253, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_ymouse); if (unlikely(!__pyx_t_5)) __PYX_ERR(26, 253, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __pyx_f_8CyOpenGL_cyglTranslateScene(__pyx_mstate_global->__pyx_float_0_05, __pyx_t_1, __pyx_t_2, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(26, 253, __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_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;

  /* "opengl/legacy/perspectiveWidget.pyx":254
 *         self.make_current()
 *         cyglTranslateScene(0.05, event.x, event.y, self.xmouse, self.ymouse)
 *         self.redraw()             # <<<<<<<<<<<<<<
 *         self.tkRecordMouse(event)
 * 
*/
  __pyx_t_5 = __pyx_v_self;
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
    __pyx_t_6 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_redraw, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(26, 254, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "opengl/legacy/perspectiveWidget.pyx":255
 *         cyglTranslateScene(0.05, event.x, event.y, self.xmouse, self.ymouse)
 *         self.redraw()
 *         self.tkRecordMouse(event)             # <<<<<<<<<<<<<<
 * 
 *     def mouse_update(self, event):
*/
  __pyx_t_5 = __pyx_v_self;
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_event};
    __pyx_t_6 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_tkRecordMouse, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(26, 255, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "opengl/legacy/perspectiveWidget.pyx":248
 *         self.tkRecordMouse(event)
 * 
 *     def tkTranslate(self, event):             # <<<<<<<<<<<<<<
 *         """
 *         Perform translation of scene.
*/

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

/* "opengl/legacy/perspectiveWidget.pyx":257
 *         self.tkRecordMouse(event)
 * 
 *     def mouse_update(self, event):             # <<<<<<<<<<<<<<
 *         """
 *         Redraw the scene and save the mouse coordinates.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_23OpenGLPerspectiveWidget_31mouse_update(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_23OpenGLPerspectiveWidget_30mouse_update, "OpenGLPerspectiveWidget.mouse_update(self, event)\n\nRedraw the scene and save the mouse coordinates.");
static PyMethodDef __pyx_mdef_8CyOpenGL_23OpenGLPerspectiveWidget_31mouse_update = {"mouse_update", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_23OpenGLPerspectiveWidget_31mouse_update, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_23OpenGLPerspectiveWidget_30mouse_update};
static PyObject *__pyx_pw_8CyOpenGL_23OpenGLPerspectiveWidget_31mouse_update(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_event = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mouse_update (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_event,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(26, 257, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(26, 257, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(26, 257, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "mouse_update", 0) < (0)) __PYX_ERR(26, 257, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("mouse_update", 1, 2, 2, i); __PYX_ERR(26, 257, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(26, 257, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(26, 257, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
    __pyx_v_event = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("mouse_update", 1, 2, 2, __pyx_nargs); __PYX_ERR(26, 257, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("CyOpenGL.OpenGLPerspectiveWidget.mouse_update", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_23OpenGLPerspectiveWidget_30mouse_update(__pyx_self, __pyx_v_self, __pyx_v_event);

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

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

  /* "opengl/legacy/perspectiveWidget.pyx":261
 *         Redraw the scene and save the mouse coordinates.
 *         """
 *         self.redraw()             # <<<<<<<<<<<<<<
 *         self.tkRecordMouse(event)
 * 
*/
  __pyx_t_2 = __pyx_v_self;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_redraw, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 261, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/legacy/perspectiveWidget.pyx":262
 *         """
 *         self.redraw()
 *         self.tkRecordMouse(event)             # <<<<<<<<<<<<<<
 * 
 *     def draw_impl(self, width, height):
*/
  __pyx_t_2 = __pyx_v_self;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_event};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_tkRecordMouse, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 262, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/legacy/perspectiveWidget.pyx":257
 *         self.tkRecordMouse(event)
 * 
 *     def mouse_update(self, event):             # <<<<<<<<<<<<<<
 *         """
 *         Redraw the scene and save the mouse coordinates.
*/

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

/* "opengl/legacy/perspectiveWidget.pyx":264
 *         self.tkRecordMouse(event)
 * 
 *     def draw_impl(self, width, height):             # <<<<<<<<<<<<<<
 *         """
 *         Implements redrawing by calling redraw_impl to draw the scene
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_23OpenGLPerspectiveWidget_33draw_impl(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_23OpenGLPerspectiveWidget_32draw_impl, "OpenGLPerspectiveWidget.draw_impl(self, width, height)\n\nImplements redrawing by calling redraw_impl to draw the scene\nafter setting up the viewport, the projection and view matrix\nand clearing the framebuffer and before swapping the buffers.");
static PyMethodDef __pyx_mdef_8CyOpenGL_23OpenGLPerspectiveWidget_33draw_impl = {"draw_impl", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_23OpenGLPerspectiveWidget_33draw_impl, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_23OpenGLPerspectiveWidget_32draw_impl};
static PyObject *__pyx_pw_8CyOpenGL_23OpenGLPerspectiveWidget_33draw_impl(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_width = 0;
  PyObject *__pyx_v_height = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("draw_impl (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_width,&__pyx_mstate_global->__pyx_n_u_height,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(26, 264, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(26, 264, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(26, 264, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(26, 264, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "draw_impl", 0) < (0)) __PYX_ERR(26, 264, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("draw_impl", 1, 3, 3, i); __PYX_ERR(26, 264, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(26, 264, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(26, 264, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(26, 264, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
    __pyx_v_width = values[1];
    __pyx_v_height = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("draw_impl", 1, 3, 3, __pyx_nargs); __PYX_ERR(26, 264, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("CyOpenGL.OpenGLPerspectiveWidget.draw_impl", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_23OpenGLPerspectiveWidget_32draw_impl(__pyx_self, __pyx_v_self, __pyx_v_width, __pyx_v_height);

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

static PyObject *__pyx_pf_8CyOpenGL_23OpenGLPerspectiveWidget_32draw_impl(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_width, PyObject *__pyx_v_height) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  GLsizei __pyx_t_1;
  GLsizei __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  GLclampf __pyx_t_4;
  GLclampf __pyx_t_5;
  GLclampf __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  size_t __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("draw_impl", 0);

  /* "opengl/legacy/perspectiveWidget.pyx":271
 *         """
 * 
 *         glViewport(0, 0, width, height)             # <<<<<<<<<<<<<<
 * 
 *         # Clear the background and depth buffer.
*/
  __pyx_t_1 = __Pyx_PyLong_As_GLsizei(__pyx_v_width); if (unlikely((__pyx_t_1 == ((GLsizei)-1)) && PyErr_Occurred())) __PYX_ERR(26, 271, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_As_GLsizei(__pyx_v_height); if (unlikely((__pyx_t_2 == ((GLsizei)-1)) && PyErr_Occurred())) __PYX_ERR(26, 271, __pyx_L1_error)
  glViewport(0, 0, __pyx_t_1, __pyx_t_2);

  /* "opengl/legacy/perspectiveWidget.pyx":274
 * 
 *         # Clear the background and depth buffer.
 *         glClearColor(self.r_back, self.g_back, self.b_back, 0.0)             # <<<<<<<<<<<<<<
 *         glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
 * 
*/
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_r_back); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 274, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyFloat_AsFloat(__pyx_t_3); if (unlikely((__pyx_t_4 == ((GLclampf)-1)) && PyErr_Occurred())) __PYX_ERR(26, 274, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_g_back); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 274, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyFloat_AsFloat(__pyx_t_3); if (unlikely((__pyx_t_5 == ((GLclampf)-1)) && PyErr_Occurred())) __PYX_ERR(26, 274, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_b_back); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 274, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = __Pyx_PyFloat_AsFloat(__pyx_t_3); if (unlikely((__pyx_t_6 == ((GLclampf)-1)) && PyErr_Occurred())) __PYX_ERR(26, 274, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  glClearColor(__pyx_t_4, __pyx_t_5, __pyx_t_6, 0.0);

  /* "opengl/legacy/perspectiveWidget.pyx":275
 *         # Clear the background and depth buffer.
 *         glClearColor(self.r_back, self.g_back, self.b_back, 0.0)
 *         glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)             # <<<<<<<<<<<<<<
 * 
 *         # build the projection matrix
*/
  glClear((GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT));

  /* "opengl/legacy/perspectiveWidget.pyx":278
 * 
 *         # build the projection matrix
 *         self.build_projection(width, height)             # <<<<<<<<<<<<<<
 * 
 *         # Call objects redraw method.
*/
  __pyx_t_7 = __pyx_v_self;
  __Pyx_INCREF(__pyx_t_7);
  __pyx_t_8 = 0;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_v_width, __pyx_v_height};
    __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_build_projection, __pyx_callargs+__pyx_t_8, (3-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 278, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "opengl/legacy/perspectiveWidget.pyx":281
 * 
 *         # Call objects redraw method.
 *         glMatrixMode(GL_MODELVIEW)             # <<<<<<<<<<<<<<
 *         glPushMatrix()             # Protect our matrix
 *         self.draw_projection_impl()
*/
  glMatrixMode(GL_MODELVIEW);

  /* "opengl/legacy/perspectiveWidget.pyx":282
 *         # Call objects redraw method.
 *         glMatrixMode(GL_MODELVIEW)
 *         glPushMatrix()             # Protect our matrix             # <<<<<<<<<<<<<<
 *         self.draw_projection_impl()
 *         glPopMatrix()              # Restore the matrix
*/
  glPushMatrix();

  /* "opengl/legacy/perspectiveWidget.pyx":283
 *         glMatrixMode(GL_MODELVIEW)
 *         glPushMatrix()             # Protect our matrix
 *         self.draw_projection_impl()             # <<<<<<<<<<<<<<
 *         glPopMatrix()              # Restore the matrix
 * 
*/
  __pyx_t_7 = __pyx_v_self;
  __Pyx_INCREF(__pyx_t_7);
  __pyx_t_8 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
    __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_draw_projection_impl, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 283, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "opengl/legacy/perspectiveWidget.pyx":284
 *         glPushMatrix()             # Protect our matrix
 *         self.draw_projection_impl()
 *         glPopMatrix()              # Restore the matrix             # <<<<<<<<<<<<<<
 * 
 *     def draw_projection_impl(self):
*/
  glPopMatrix();

  /* "opengl/legacy/perspectiveWidget.pyx":264
 *         self.tkRecordMouse(event)
 * 
 *     def draw_impl(self, width, height):             # <<<<<<<<<<<<<<
 *         """
 *         Implements redrawing by calling redraw_impl to draw the scene
*/

  /* 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_7);
  __Pyx_AddTraceback("CyOpenGL.OpenGLPerspectiveWidget.draw_impl", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opengl/legacy/perspectiveWidget.pyx":286
 *         glPopMatrix()              # Restore the matrix
 * 
 *     def draw_projection_impl(self):             # <<<<<<<<<<<<<<
 *         """
 *         To be implemented by subclass.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_23OpenGLPerspectiveWidget_35draw_projection_impl(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_23OpenGLPerspectiveWidget_34draw_projection_impl, "OpenGLPerspectiveWidget.draw_projection_impl(self)\n\nTo be implemented by subclass.");
static PyMethodDef __pyx_mdef_8CyOpenGL_23OpenGLPerspectiveWidget_35draw_projection_impl = {"draw_projection_impl", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_23OpenGLPerspectiveWidget_35draw_projection_impl, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_23OpenGLPerspectiveWidget_34draw_projection_impl};
static PyObject *__pyx_pw_8CyOpenGL_23OpenGLPerspectiveWidget_35draw_projection_impl(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("draw_projection_impl (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(26, 286, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(26, 286, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "draw_projection_impl", 0) < (0)) __PYX_ERR(26, 286, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("draw_projection_impl", 1, 1, 1, i); __PYX_ERR(26, 286, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(26, 286, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("draw_projection_impl", 1, 1, 1, __pyx_nargs); __PYX_ERR(26, 286, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("CyOpenGL.OpenGLPerspectiveWidget.draw_projection_impl", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_23OpenGLPerspectiveWidget_34draw_projection_impl(__pyx_self, __pyx_v_self);

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

static PyObject *__pyx_pf_8CyOpenGL_23OpenGLPerspectiveWidget_34draw_projection_impl(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("draw_projection_impl", 0);

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

/* "opengl/legacy/perspectiveWidget.pyx":291
 *         """
 * 
 *     def build_projection(self, width, height):             # <<<<<<<<<<<<<<
 *         self.make_current()
 *         cdef GLdouble xmax, ymax, near, far
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_23OpenGLPerspectiveWidget_37build_projection(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_23OpenGLPerspectiveWidget_36build_projection, "OpenGLPerspectiveWidget.build_projection(self, width, height)");
static PyMethodDef __pyx_mdef_8CyOpenGL_23OpenGLPerspectiveWidget_37build_projection = {"build_projection", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_23OpenGLPerspectiveWidget_37build_projection, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_23OpenGLPerspectiveWidget_36build_projection};
static PyObject *__pyx_pw_8CyOpenGL_23OpenGLPerspectiveWidget_37build_projection(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_width = 0;
  PyObject *__pyx_v_height = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("build_projection (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_width,&__pyx_mstate_global->__pyx_n_u_height,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(26, 291, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(26, 291, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(26, 291, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(26, 291, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "build_projection", 0) < (0)) __PYX_ERR(26, 291, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("build_projection", 1, 3, 3, i); __PYX_ERR(26, 291, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(26, 291, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(26, 291, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(26, 291, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
    __pyx_v_width = values[1];
    __pyx_v_height = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("build_projection", 1, 3, 3, __pyx_nargs); __PYX_ERR(26, 291, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("CyOpenGL.OpenGLPerspectiveWidget.build_projection", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_23OpenGLPerspectiveWidget_36build_projection(__pyx_self, __pyx_v_self, __pyx_v_width, __pyx_v_height);

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

static PyObject *__pyx_pf_8CyOpenGL_23OpenGLPerspectiveWidget_36build_projection(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_width, PyObject *__pyx_v_height) {
  GLdouble __pyx_v_xmax;
  GLdouble __pyx_v_ymax;
  GLdouble __pyx_v_near;
  GLdouble __pyx_v_far;
  double __pyx_v_aspect;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  double __pyx_t_4;
  double __pyx_t_5;
  GLdouble __pyx_t_6;
  GLdouble __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  GLfloat __pyx_t_13;
  GLfloat __pyx_t_14;
  GLfloat __pyx_t_15;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("build_projection", 0);

  /* "opengl/legacy/perspectiveWidget.pyx":292
 * 
 *     def build_projection(self, width, height):
 *         self.make_current()             # <<<<<<<<<<<<<<
 *         cdef GLdouble xmax, ymax, near, far
 *         aspect = float(width)/float(height)
*/
  __pyx_t_2 = __pyx_v_self;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_make_current, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 292, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/legacy/perspectiveWidget.pyx":294
 *         self.make_current()
 *         cdef GLdouble xmax, ymax, near, far
 *         aspect = float(width)/float(height)             # <<<<<<<<<<<<<<
 *         near, far = self.near, self.far
 *         glMatrixMode(GL_PROJECTION)
*/
  __pyx_t_4 = __Pyx_PyObject_AsDouble(__pyx_v_width); if (unlikely(__PYX_CHECK_FLOAT_EXCEPTION(__pyx_t_4, ((double)((double)-1))) && PyErr_Occurred())) __PYX_ERR(26, 294, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyObject_AsDouble(__pyx_v_height); if (unlikely(__PYX_CHECK_FLOAT_EXCEPTION(__pyx_t_5, ((double)((double)-1))) && PyErr_Occurred())) __PYX_ERR(26, 294, __pyx_L1_error)
  if (unlikely(__pyx_t_5 == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "float division");
    __PYX_ERR(26, 294, __pyx_L1_error)
  }
  __pyx_v_aspect = (__pyx_t_4 / __pyx_t_5);

  /* "opengl/legacy/perspectiveWidget.pyx":295
 *         cdef GLdouble xmax, ymax, near, far
 *         aspect = float(width)/float(height)
 *         near, far = self.near, self.far             # <<<<<<<<<<<<<<
 *         glMatrixMode(GL_PROJECTION)
 *         glLoadIdentity()
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_near); if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_6 == ((GLdouble)-1)) && PyErr_Occurred())) __PYX_ERR(26, 295, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_far); if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = __Pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_7 == ((GLdouble)-1)) && PyErr_Occurred())) __PYX_ERR(26, 295, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_near = __pyx_t_6;
  __pyx_v_far = __pyx_t_7;

  /* "opengl/legacy/perspectiveWidget.pyx":296
 *         aspect = float(width)/float(height)
 *         near, far = self.near, self.far
 *         glMatrixMode(GL_PROJECTION)             # <<<<<<<<<<<<<<
 *         glLoadIdentity()
 *         ymax = near * tan(self.fovy*pi/360.0)
*/
  glMatrixMode(GL_PROJECTION);

  /* "opengl/legacy/perspectiveWidget.pyx":297
 *         near, far = self.near, self.far
 *         glMatrixMode(GL_PROJECTION)
 *         glLoadIdentity()             # <<<<<<<<<<<<<<
 *         ymax = near * tan(self.fovy*pi/360.0)
 *         xmax = ymax * aspect
*/
  glLoadIdentity();

  /* "opengl/legacy/perspectiveWidget.pyx":298
 *         glMatrixMode(GL_PROJECTION)
 *         glLoadIdentity()
 *         ymax = near * tan(self.fovy*pi/360.0)             # <<<<<<<<<<<<<<
 *         xmax = ymax * aspect
 *         glFrustum(-xmax, xmax, -ymax, ymax, near, far)
*/
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_near); if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_8 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_tan); if (unlikely(!__pyx_t_9)) __PYX_ERR(26, 298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_fovy); if (unlikely(!__pyx_t_10)) __PYX_ERR(26, 298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_pi); if (unlikely(!__pyx_t_11)) __PYX_ERR(26, 298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_12 = PyNumber_Multiply(__pyx_t_10, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(26, 298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_11 = __Pyx_PyFloat_TrueDivideObjC(__pyx_t_12, __pyx_mstate_global->__pyx_float_360_0, 360.0, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(26, 298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_3 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_9))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_9);
    assert(__pyx_t_8);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_9);
    __Pyx_INCREF(__pyx_t_8);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_9, __pyx__function);
    __pyx_t_3 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_11};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_9, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(26, 298, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_t_9 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(26, 298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_7 = __Pyx_PyFloat_AsDouble(__pyx_t_9); if (unlikely((__pyx_t_7 == ((GLdouble)-1)) && PyErr_Occurred())) __PYX_ERR(26, 298, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_v_ymax = __pyx_t_7;

  /* "opengl/legacy/perspectiveWidget.pyx":299
 *         glLoadIdentity()
 *         ymax = near * tan(self.fovy*pi/360.0)
 *         xmax = ymax * aspect             # <<<<<<<<<<<<<<
 *         glFrustum(-xmax, xmax, -ymax, ymax, near, far)
 *         glTranslatef(-self.xcenter, -self.ycenter, -(self.zcenter+self.distance))
*/
  __pyx_v_xmax = (__pyx_v_ymax * __pyx_v_aspect);

  /* "opengl/legacy/perspectiveWidget.pyx":300
 *         ymax = near * tan(self.fovy*pi/360.0)
 *         xmax = ymax * aspect
 *         glFrustum(-xmax, xmax, -ymax, ymax, near, far)             # <<<<<<<<<<<<<<
 *         glTranslatef(-self.xcenter, -self.ycenter, -(self.zcenter+self.distance))
 * 
*/
  glFrustum((-__pyx_v_xmax), __pyx_v_xmax, (-__pyx_v_ymax), __pyx_v_ymax, __pyx_v_near, __pyx_v_far);

  /* "opengl/legacy/perspectiveWidget.pyx":301
 *         xmax = ymax * aspect
 *         glFrustum(-xmax, xmax, -ymax, ymax, near, far)
 *         glTranslatef(-self.xcenter, -self.ycenter, -(self.zcenter+self.distance))             # <<<<<<<<<<<<<<
 * 
 *     def tkKeyPress(self, event):
*/
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_xcenter); if (unlikely(!__pyx_t_9)) __PYX_ERR(26, 301, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_2 = PyNumber_Negative(__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(26, 301, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_13 = __Pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_13 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(26, 301, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_ycenter); if (unlikely(!__pyx_t_2)) __PYX_ERR(26, 301, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_9 = PyNumber_Negative(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(26, 301, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_14 = __Pyx_PyFloat_AsFloat(__pyx_t_9); if (unlikely((__pyx_t_14 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(26, 301, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_zcenter); if (unlikely(!__pyx_t_9)) __PYX_ERR(26, 301, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_distance); if (unlikely(!__pyx_t_2)) __PYX_ERR(26, 301, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyNumber_Add(__pyx_t_9, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 301, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_Negative(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(26, 301, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_15 = __Pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_15 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(26, 301, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  glTranslatef(__pyx_t_13, __pyx_t_14, __pyx_t_15);

  /* "opengl/legacy/perspectiveWidget.pyx":291
 *         """
 * 
 *     def build_projection(self, width, height):             # <<<<<<<<<<<<<<
 *         self.make_current()
 *         cdef GLdouble xmax, ymax, near, far
*/

  /* 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_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("CyOpenGL.OpenGLPerspectiveWidget.build_projection", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opengl/legacy/perspectiveWidget.pyx":303
 *         glTranslatef(-self.xcenter, -self.ycenter, -(self.zcenter+self.distance))
 * 
 *     def tkKeyPress(self, event):             # <<<<<<<<<<<<<<
 *         """
 *         Handle keyboard events.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_23OpenGLPerspectiveWidget_39tkKeyPress(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_23OpenGLPerspectiveWidget_38tkKeyPress, "OpenGLPerspectiveWidget.tkKeyPress(self, event)\n\nHandle keyboard events.");
static PyMethodDef __pyx_mdef_8CyOpenGL_23OpenGLPerspectiveWidget_39tkKeyPress = {"tkKeyPress", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_23OpenGLPerspectiveWidget_39tkKeyPress, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_23OpenGLPerspectiveWidget_38tkKeyPress};
static PyObject *__pyx_pw_8CyOpenGL_23OpenGLPerspectiveWidget_39tkKeyPress(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_event = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("tkKeyPress (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_event,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(26, 303, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(26, 303, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(26, 303, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "tkKeyPress", 0) < (0)) __PYX_ERR(26, 303, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("tkKeyPress", 1, 2, 2, i); __PYX_ERR(26, 303, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(26, 303, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(26, 303, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
    __pyx_v_event = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("tkKeyPress", 1, 2, 2, __pyx_nargs); __PYX_ERR(26, 303, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("CyOpenGL.OpenGLPerspectiveWidget.tkKeyPress", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_23OpenGLPerspectiveWidget_38tkKeyPress(__pyx_self, __pyx_v_self, __pyx_v_event);

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

static PyObject *__pyx_pf_8CyOpenGL_23OpenGLPerspectiveWidget_38tkKeyPress(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_event) {
  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;
  size_t __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  int __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("tkKeyPress", 0);

  /* "opengl/legacy/perspectiveWidget.pyx":307
 *         Handle keyboard events.
 *         """
 *         try:             # <<<<<<<<<<<<<<
 *             self.key_action[event.keysym]()
 *         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:*/ {

      /* "opengl/legacy/perspectiveWidget.pyx":308
 *         """
 *         try:
 *             self.key_action[event.keysym]()             # <<<<<<<<<<<<<<
 *         except KeyError:
 *             pass
*/
      __pyx_t_5 = NULL;
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_key_action); if (unlikely(!__pyx_t_6)) __PYX_ERR(26, 308, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_event, __pyx_mstate_global->__pyx_n_u_keysym); if (unlikely(!__pyx_t_7)) __PYX_ERR(26, 308, __pyx_L3_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(26, 308, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_9 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_8))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_8);
        assert(__pyx_t_5);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_8, __pyx__function);
        __pyx_t_9 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
        __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 308, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "opengl/legacy/perspectiveWidget.pyx":307
 *         Handle keyboard events.
 *         """
 *         try:             # <<<<<<<<<<<<<<
 *             self.key_action[event.keysym]()
 *         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;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "opengl/legacy/perspectiveWidget.pyx":309
 *         try:
 *             self.key_action[event.keysym]()
 *         except KeyError:             # <<<<<<<<<<<<<<
 *             pass
 *         if not self.autospin:
*/
    __pyx_t_10 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_KeyError))));
    if (__pyx_t_10) {
      __Pyx_ErrRestore(0,0,0);
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;

    /* "opengl/legacy/perspectiveWidget.pyx":307
 *         Handle keyboard events.
 *         """
 *         try:             # <<<<<<<<<<<<<<
 *             self.key_action[event.keysym]()
 *         except KeyError:
*/
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "opengl/legacy/perspectiveWidget.pyx":311
 *         except KeyError:
 *             pass
 *         if not self.autospin:             # <<<<<<<<<<<<<<
 *             self.redraw()
 * 
*/
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_autospin); if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 311, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(26, 311, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_12 = (!__pyx_t_11);
  if (__pyx_t_12) {

    /* "opengl/legacy/perspectiveWidget.pyx":312
 *             pass
 *         if not self.autospin:
 *             self.redraw()             # <<<<<<<<<<<<<<
 * 
 *     def tkPrint(self, file):
*/
    __pyx_t_8 = __pyx_v_self;
    __Pyx_INCREF(__pyx_t_8);
    __pyx_t_9 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL};
      __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_redraw, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 312, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "opengl/legacy/perspectiveWidget.pyx":311
 *         except KeyError:
 *             pass
 *         if not self.autospin:             # <<<<<<<<<<<<<<
 *             self.redraw()
 * 
*/
  }

  /* "opengl/legacy/perspectiveWidget.pyx":303
 *         glTranslatef(-self.xcenter, -self.ycenter, -(self.zcenter+self.distance))
 * 
 *     def tkKeyPress(self, event):             # <<<<<<<<<<<<<<
 *         """
 *         Handle keyboard events.
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("CyOpenGL.OpenGLPerspectiveWidget.tkKeyPress", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opengl/legacy/perspectiveWidget.pyx":314
 *             self.redraw()
 * 
 *     def tkPrint(self, file):             # <<<<<<<<<<<<<<
 *         """
 *         Turn the current scene into PostScript via the feedback buffer.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_23OpenGLPerspectiveWidget_41tkPrint(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_23OpenGLPerspectiveWidget_40tkPrint, "OpenGLPerspectiveWidget.tkPrint(self, file)\n\nTurn the current scene into PostScript via the feedback buffer.");
static PyMethodDef __pyx_mdef_8CyOpenGL_23OpenGLPerspectiveWidget_41tkPrint = {"tkPrint", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_23OpenGLPerspectiveWidget_41tkPrint, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_23OpenGLPerspectiveWidget_40tkPrint};
static PyObject *__pyx_pw_8CyOpenGL_23OpenGLPerspectiveWidget_41tkPrint(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_file = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("tkPrint (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_file,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(26, 314, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(26, 314, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(26, 314, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "tkPrint", 0) < (0)) __PYX_ERR(26, 314, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("tkPrint", 1, 2, 2, i); __PYX_ERR(26, 314, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(26, 314, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(26, 314, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
    __pyx_v_file = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("tkPrint", 1, 2, 2, __pyx_nargs); __PYX_ERR(26, 314, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("CyOpenGL.OpenGLPerspectiveWidget.tkPrint", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_23OpenGLPerspectiveWidget_40tkPrint(__pyx_self, __pyx_v_self, __pyx_v_file);

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

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

  /* "opengl/legacy/perspectiveWidget.pyx":318
 *         Turn the current scene into PostScript via the feedback buffer.
 *         """
 *         self.make_current()             # <<<<<<<<<<<<<<
 *         # DEAL WITH THIS
*/
  __pyx_t_2 = __pyx_v_self;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_make_current, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 318, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/legacy/perspectiveWidget.pyx":314
 *             self.redraw()
 * 
 *     def tkPrint(self, file):             # <<<<<<<<<<<<<<
 *         """
 *         Turn the current scene into PostScript via the feedback buffer.
*/

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

/* "opengl/legacy/orthoWidget.pyx":7
 *     """
 * 
 *     def build_projection(self, width, height, t=1.0):             # <<<<<<<<<<<<<<
 *         aspect = float(width)/float(height)
 *         top = self.fovy/2
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_17OpenGLOrthoWidget_1build_projection(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_17OpenGLOrthoWidget_build_projection, "OpenGLOrthoWidget.build_projection(self, width, height, t=1.0)");
static PyMethodDef __pyx_mdef_8CyOpenGL_17OpenGLOrthoWidget_1build_projection = {"build_projection", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_17OpenGLOrthoWidget_1build_projection, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_17OpenGLOrthoWidget_build_projection};
static PyObject *__pyx_pw_8CyOpenGL_17OpenGLOrthoWidget_1build_projection(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_width = 0;
  PyObject *__pyx_v_height = 0;
  CYTHON_UNUSED PyObject *__pyx_v_t = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[4] = {0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("build_projection (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_width,&__pyx_mstate_global->__pyx_n_u_height,&__pyx_mstate_global->__pyx_n_u_t,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(27, 7, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(27, 7, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(27, 7, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(27, 7, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(27, 7, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "build_projection", 0) < (0)) __PYX_ERR(27, 7, __pyx_L3_error)
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_float_1_0)));
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("build_projection", 0, 3, 4, i); __PYX_ERR(27, 7, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(27, 7, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(27, 7, __pyx_L3_error)
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(27, 7, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(27, 7, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_float_1_0)));
    }
    __pyx_v_self = values[0];
    __pyx_v_width = values[1];
    __pyx_v_height = values[2];
    __pyx_v_t = values[3];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("build_projection", 0, 3, 4, __pyx_nargs); __PYX_ERR(27, 7, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("CyOpenGL.OpenGLOrthoWidget.build_projection", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_17OpenGLOrthoWidget_build_projection(__pyx_self, __pyx_v_self, __pyx_v_width, __pyx_v_height, __pyx_v_t);

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

static PyObject *__pyx_pf_8CyOpenGL_17OpenGLOrthoWidget_build_projection(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_width, PyObject *__pyx_v_height, CYTHON_UNUSED PyObject *__pyx_v_t) {
  double __pyx_v_aspect;
  PyObject *__pyx_v_top = NULL;
  PyObject *__pyx_v_right = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  double __pyx_t_1;
  double __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_t_6;
  GLdouble __pyx_t_7;
  GLdouble __pyx_t_8;
  GLdouble __pyx_t_9;
  GLdouble __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("build_projection", 0);

  /* "opengl/legacy/orthoWidget.pyx":8
 * 
 *     def build_projection(self, width, height, t=1.0):
 *         aspect = float(width)/float(height)             # <<<<<<<<<<<<<<
 *         top = self.fovy/2
 *         right = top*aspect
*/
  __pyx_t_1 = __Pyx_PyObject_AsDouble(__pyx_v_width); if (unlikely(__PYX_CHECK_FLOAT_EXCEPTION(__pyx_t_1, ((double)((double)-1))) && PyErr_Occurred())) __PYX_ERR(27, 8, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_AsDouble(__pyx_v_height); if (unlikely(__PYX_CHECK_FLOAT_EXCEPTION(__pyx_t_2, ((double)((double)-1))) && PyErr_Occurred())) __PYX_ERR(27, 8, __pyx_L1_error)
  if (unlikely(__pyx_t_2 == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "float division");
    __PYX_ERR(27, 8, __pyx_L1_error)
  }
  __pyx_v_aspect = (__pyx_t_1 / __pyx_t_2);

  /* "opengl/legacy/orthoWidget.pyx":9
 *     def build_projection(self, width, height, t=1.0):
 *         aspect = float(width)/float(height)
 *         top = self.fovy/2             # <<<<<<<<<<<<<<
 *         right = top*aspect
 *         self.make_current()
*/
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_fovy); if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyLong_TrueDivideObjC(__pyx_t_3, __pyx_mstate_global->__pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_top = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "opengl/legacy/orthoWidget.pyx":10
 *         aspect = float(width)/float(height)
 *         top = self.fovy/2
 *         right = top*aspect             # <<<<<<<<<<<<<<
 *         self.make_current()
 *         glMatrixMode(GL_PROJECTION)
*/
  __pyx_t_4 = PyFloat_FromDouble(__pyx_v_aspect); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 10, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyNumber_Multiply(__pyx_v_top, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 10, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_right = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "opengl/legacy/orthoWidget.pyx":11
 *         top = self.fovy/2
 *         right = top*aspect
 *         self.make_current()             # <<<<<<<<<<<<<<
 *         glMatrixMode(GL_PROJECTION)
 *         glLoadIdentity()
*/
  __pyx_t_4 = __pyx_v_self;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
    __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_make_current, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 11, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "opengl/legacy/orthoWidget.pyx":12
 *         right = top*aspect
 *         self.make_current()
 *         glMatrixMode(GL_PROJECTION)             # <<<<<<<<<<<<<<
 *         glLoadIdentity()
 *         if self.flipped:
*/
  glMatrixMode(GL_PROJECTION);

  /* "opengl/legacy/orthoWidget.pyx":13
 *         self.make_current()
 *         glMatrixMode(GL_PROJECTION)
 *         glLoadIdentity()             # <<<<<<<<<<<<<<
 *         if self.flipped:
 *             glEnable(GL_LIGHT1)
*/
  glLoadIdentity();

  /* "opengl/legacy/orthoWidget.pyx":14
 *         glMatrixMode(GL_PROJECTION)
 *         glLoadIdentity()
 *         if self.flipped:             # <<<<<<<<<<<<<<
 *             glEnable(GL_LIGHT1)
 *             glDisable(GL_LIGHT0)
*/
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_flipped); if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 14, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(27, 14, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_6) {

    /* "opengl/legacy/orthoWidget.pyx":15
 *         glLoadIdentity()
 *         if self.flipped:
 *             glEnable(GL_LIGHT1)             # <<<<<<<<<<<<<<
 *             glDisable(GL_LIGHT0)
 *             glOrtho(-right, right, top, -top, 3.0, -3.0)
*/
    glEnable(GL_LIGHT1);

    /* "opengl/legacy/orthoWidget.pyx":16
 *         if self.flipped:
 *             glEnable(GL_LIGHT1)
 *             glDisable(GL_LIGHT0)             # <<<<<<<<<<<<<<
 *             glOrtho(-right, right, top, -top, 3.0, -3.0)
 *         else:
*/
    glDisable(GL_LIGHT0);

    /* "opengl/legacy/orthoWidget.pyx":17
 *             glEnable(GL_LIGHT1)
 *             glDisable(GL_LIGHT0)
 *             glOrtho(-right, right, top, -top, 3.0, -3.0)             # <<<<<<<<<<<<<<
 *         else:
 *             glEnable(GL_LIGHT0)
*/
    __pyx_t_3 = PyNumber_Negative(__pyx_v_right); if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 17, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = __Pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_7 == ((GLdouble)-1)) && PyErr_Occurred())) __PYX_ERR(27, 17, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_8 = __Pyx_PyFloat_AsDouble(__pyx_v_right); if (unlikely((__pyx_t_8 == ((GLdouble)-1)) && PyErr_Occurred())) __PYX_ERR(27, 17, __pyx_L1_error)
    __pyx_t_9 = __Pyx_PyFloat_AsDouble(__pyx_v_top); if (unlikely((__pyx_t_9 == ((GLdouble)-1)) && PyErr_Occurred())) __PYX_ERR(27, 17, __pyx_L1_error)
    __pyx_t_3 = PyNumber_Negative(__pyx_v_top); if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 17, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_10 = __Pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_10 == ((GLdouble)-1)) && PyErr_Occurred())) __PYX_ERR(27, 17, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    glOrtho(__pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10, 3.0, -3.0);

    /* "opengl/legacy/orthoWidget.pyx":14
 *         glMatrixMode(GL_PROJECTION)
 *         glLoadIdentity()
 *         if self.flipped:             # <<<<<<<<<<<<<<
 *             glEnable(GL_LIGHT1)
 *             glDisable(GL_LIGHT0)
*/
    goto __pyx_L3;
  }

  /* "opengl/legacy/orthoWidget.pyx":19
 *             glOrtho(-right, right, top, -top, 3.0, -3.0)
 *         else:
 *             glEnable(GL_LIGHT0)             # <<<<<<<<<<<<<<
 *             glDisable(GL_LIGHT1)
 *             glOrtho(-right, right, -top, top, -3.0, 3.0)
*/
  /*else*/ {
    glEnable(GL_LIGHT0);

    /* "opengl/legacy/orthoWidget.pyx":20
 *         else:
 *             glEnable(GL_LIGHT0)
 *             glDisable(GL_LIGHT1)             # <<<<<<<<<<<<<<
 *             glOrtho(-right, right, -top, top, -3.0, 3.0)
 * 
*/
    glDisable(GL_LIGHT1);

    /* "opengl/legacy/orthoWidget.pyx":21
 *             glEnable(GL_LIGHT0)
 *             glDisable(GL_LIGHT1)
 *             glOrtho(-right, right, -top, top, -3.0, 3.0)             # <<<<<<<<<<<<<<
 * 
 *     def tkTranslate(self, event):
*/
    __pyx_t_3 = PyNumber_Negative(__pyx_v_right); if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 21, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_10 = __Pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_10 == ((GLdouble)-1)) && PyErr_Occurred())) __PYX_ERR(27, 21, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_9 = __Pyx_PyFloat_AsDouble(__pyx_v_right); if (unlikely((__pyx_t_9 == ((GLdouble)-1)) && PyErr_Occurred())) __PYX_ERR(27, 21, __pyx_L1_error)
    __pyx_t_3 = PyNumber_Negative(__pyx_v_top); if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 21, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = __Pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_8 == ((GLdouble)-1)) && PyErr_Occurred())) __PYX_ERR(27, 21, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_7 = __Pyx_PyFloat_AsDouble(__pyx_v_top); if (unlikely((__pyx_t_7 == ((GLdouble)-1)) && PyErr_Occurred())) __PYX_ERR(27, 21, __pyx_L1_error)
    glOrtho(__pyx_t_10, __pyx_t_9, __pyx_t_8, __pyx_t_7, -3.0, 3.0);
  }
  __pyx_L3:;

  /* "opengl/legacy/orthoWidget.pyx":7
 *     """
 * 
 *     def build_projection(self, width, height, t=1.0):             # <<<<<<<<<<<<<<
 *         aspect = float(width)/float(height)
 *         top = self.fovy/2
*/

  /* 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_AddTraceback("CyOpenGL.OpenGLOrthoWidget.build_projection", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_top);
  __Pyx_XDECREF(__pyx_v_right);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opengl/legacy/orthoWidget.pyx":23
 *             glOrtho(-right, right, -top, top, -3.0, 3.0)
 * 
 *     def tkTranslate(self, event):             # <<<<<<<<<<<<<<
 *         """
 *         Perform translation of scene.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_17OpenGLOrthoWidget_3tkTranslate(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_17OpenGLOrthoWidget_2tkTranslate, "OpenGLOrthoWidget.tkTranslate(self, event)\n\nPerform translation of scene.");
static PyMethodDef __pyx_mdef_8CyOpenGL_17OpenGLOrthoWidget_3tkTranslate = {"tkTranslate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_17OpenGLOrthoWidget_3tkTranslate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_17OpenGLOrthoWidget_2tkTranslate};
static PyObject *__pyx_pw_8CyOpenGL_17OpenGLOrthoWidget_3tkTranslate(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_event = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("tkTranslate (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_event,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(27, 23, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(27, 23, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(27, 23, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "tkTranslate", 0) < (0)) __PYX_ERR(27, 23, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("tkTranslate", 1, 2, 2, i); __PYX_ERR(27, 23, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(27, 23, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(27, 23, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
    __pyx_v_event = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("tkTranslate", 1, 2, 2, __pyx_nargs); __PYX_ERR(27, 23, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("CyOpenGL.OpenGLOrthoWidget.tkTranslate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_17OpenGLOrthoWidget_2tkTranslate(__pyx_self, __pyx_v_self, __pyx_v_event);

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

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

  /* "opengl/legacy/orthoWidget.pyx":27
 *         Perform translation of scene.
 *         """
 *         self.redraw()             # <<<<<<<<<<<<<<
 *         self.tkRecordMouse(event)
*/
  __pyx_t_2 = __pyx_v_self;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_redraw, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 27, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/legacy/orthoWidget.pyx":28
 *         """
 *         self.redraw()
 *         self.tkRecordMouse(event)             # <<<<<<<<<<<<<<
*/
  __pyx_t_2 = __pyx_v_self;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_event};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_tkRecordMouse, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 28, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/legacy/orthoWidget.pyx":23
 *             glOrtho(-right, right, -top, top, -3.0, 3.0)
 * 
 *     def tkTranslate(self, event):             # <<<<<<<<<<<<<<
 *         """
 *         Perform translation of scene.
*/

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

/* "opengl/modern/data_based_texture.pyx":4
 *     cdef GLuint _textureName
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self._textureName = 0
 * 
*/

/* Python wrapper */
static int __pyx_pw_8CyOpenGL_16DataBasedTexture_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_8CyOpenGL_16DataBasedTexture_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return -1;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__cinit__", __pyx_kwds); return -1;}
  __pyx_r = __pyx_pf_8CyOpenGL_16DataBasedTexture___cinit__(((struct __pyx_obj_8CyOpenGL_DataBasedTexture *)__pyx_v_self));

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

static int __pyx_pf_8CyOpenGL_16DataBasedTexture___cinit__(struct __pyx_obj_8CyOpenGL_DataBasedTexture *__pyx_v_self) {
  int __pyx_r;

  /* "opengl/modern/data_based_texture.pyx":5
 * 
 *     def __cinit__(self):
 *         self._textureName = 0             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self,
*/
  __pyx_v_self->_textureName = 0;

  /* "opengl/modern/data_based_texture.pyx":4
 *     cdef GLuint _textureName
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self._textureName = 0
 * 
*/

  /* function exit code */
  __pyx_r = 0;
  return __pyx_r;
}

/* "opengl/modern/data_based_texture.pyx":7
 *         self._textureName = 0
 * 
 *     def __init__(self,             # <<<<<<<<<<<<<<
 *                  unsigned int width,
 *                  unsigned int height,
*/

/* Python wrapper */
static int __pyx_pw_8CyOpenGL_16DataBasedTexture_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_8CyOpenGL_16DataBasedTexture_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  unsigned int __pyx_v_width;
  unsigned int __pyx_v_height;
  __Pyx_memviewslice __pyx_v_rgba_data = { 0, 0, { 0 }, { 0 }, { 0 } };
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_width,&__pyx_mstate_global->__pyx_n_u_height,&__pyx_mstate_global->__pyx_n_u_rgba_data,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(28, 7, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(28, 7, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(28, 7, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(28, 7, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(28, 7, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, i); __PYX_ERR(28, 7, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(28, 7, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(28, 7, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(28, 7, __pyx_L3_error)
    }
    __pyx_v_width = __Pyx_PyLong_As_unsigned_int(values[0]); if (unlikely((__pyx_v_width == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(28, 8, __pyx_L3_error)
    __pyx_v_height = __Pyx_PyLong_As_unsigned_int(values[1]); if (unlikely((__pyx_v_height == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(28, 9, __pyx_L3_error)
    __pyx_v_rgba_data = __Pyx_PyObject_to_MemoryviewSlice_ds_unsigned_char(values[2], PyBUF_WRITABLE); if (unlikely(!__pyx_v_rgba_data.memview)) __PYX_ERR(28, 10, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, __pyx_nargs); __PYX_ERR(28, 7, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_rgba_data, 1);
  __Pyx_AddTraceback("CyOpenGL.DataBasedTexture.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_16DataBasedTexture_2__init__(((struct __pyx_obj_8CyOpenGL_DataBasedTexture *)__pyx_v_self), __pyx_v_width, __pyx_v_height, __pyx_v_rgba_data);

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

static int __pyx_pf_8CyOpenGL_16DataBasedTexture_2__init__(struct __pyx_obj_8CyOpenGL_DataBasedTexture *__pyx_v_self, unsigned int __pyx_v_width, unsigned int __pyx_v_height, __Pyx_memviewslice __pyx_v_rgba_data) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  size_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "opengl/modern/data_based_texture.pyx":12
 *                  unsigned char[:] rgba_data):
 * 
 *         if rgba_data.size != 4 * width * height:             # <<<<<<<<<<<<<<
 *             raise RuntimeError("Length of rgba_data not matching")
 * 
*/
  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_rgba_data, 1, (PyObject *(*)(char *)) __pyx_memview_get_unsigned_char, (int (*)(char *, PyObject *)) __pyx_memview_set_unsigned_char, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyLong_From_long(((4 * __pyx_v_width) * __pyx_v_height)); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __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(28, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(__pyx_t_4)) {

    /* "opengl/modern/data_based_texture.pyx":13
 * 
 *         if rgba_data.size != 4 * width * height:
 *             raise RuntimeError("Length of rgba_data not matching")             # <<<<<<<<<<<<<<
 * 
 *         glGenTextures(1, &self._textureName)
*/
    __pyx_t_1 = NULL;
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_mstate_global->__pyx_kp_u_Length_of_rgba_data_not_matching};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_RuntimeError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 13, __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(28, 13, __pyx_L1_error)

    /* "opengl/modern/data_based_texture.pyx":12
 *                  unsigned char[:] rgba_data):
 * 
 *         if rgba_data.size != 4 * width * height:             # <<<<<<<<<<<<<<
 *             raise RuntimeError("Length of rgba_data not matching")
 * 
*/
  }

  /* "opengl/modern/data_based_texture.pyx":15
 *             raise RuntimeError("Length of rgba_data not matching")
 * 
 *         glGenTextures(1, &self._textureName)             # <<<<<<<<<<<<<<
 *         glActiveTexture(GL_TEXTURE0)
 *         glBindTexture(GL_TEXTURE_2D, self._textureName)
*/
  glGenTextures(1, (&__pyx_v_self->_textureName));

  /* "opengl/modern/data_based_texture.pyx":16
 * 
 *         glGenTextures(1, &self._textureName)
 *         glActiveTexture(GL_TEXTURE0)             # <<<<<<<<<<<<<<
 *         glBindTexture(GL_TEXTURE_2D, self._textureName)
 * 
*/
  glActiveTexture(GL_TEXTURE0);

  /* "opengl/modern/data_based_texture.pyx":17
 *         glGenTextures(1, &self._textureName)
 *         glActiveTexture(GL_TEXTURE0)
 *         glBindTexture(GL_TEXTURE_2D, self._textureName)             # <<<<<<<<<<<<<<
 * 
 *         glTexImage2D(GL_TEXTURE_2D, 0,
*/
  glBindTexture(GL_TEXTURE_2D, __pyx_v_self->_textureName);

  /* "opengl/modern/data_based_texture.pyx":26
 *                      GL_RGBA,
 *                      GL_UNSIGNED_BYTE,
 *                      &rgba_data[0])             # <<<<<<<<<<<<<<
 * 
 *         glTexParameteri(GL_TEXTURE_2D,
*/
  __pyx_t_6 = 0;
  __pyx_t_7 = -1;
  if (__pyx_t_6 < 0) {
    __pyx_t_6 += __pyx_v_rgba_data.shape[0];
    if (unlikely(__pyx_t_6 < 0)) __pyx_t_7 = 0;
  } else if (unlikely(__pyx_t_6 >= __pyx_v_rgba_data.shape[0])) __pyx_t_7 = 0;
  if (unlikely(__pyx_t_7 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_7);
    __PYX_ERR(28, 26, __pyx_L1_error)
  }

  /* "opengl/modern/data_based_texture.pyx":19
 *         glBindTexture(GL_TEXTURE_2D, self._textureName)
 * 
 *         glTexImage2D(GL_TEXTURE_2D, 0,             # <<<<<<<<<<<<<<
 *                      GL_RGBA,
 *                      width,
*/
  glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, __pyx_v_width, __pyx_v_height, 0, GL_RGBA, GL_UNSIGNED_BYTE, (&(*((unsigned char *) ( /* dim=0 */ (__pyx_v_rgba_data.data + __pyx_t_6 * __pyx_v_rgba_data.strides[0]) )))));

  /* "opengl/modern/data_based_texture.pyx":28
 *                      &rgba_data[0])
 * 
 *         glTexParameteri(GL_TEXTURE_2D,             # <<<<<<<<<<<<<<
 *                         GL_TEXTURE_MIN_FILTER,
 *                         GL_LINEAR)
*/
  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);

  /* "opengl/modern/data_based_texture.pyx":31
 *                         GL_TEXTURE_MIN_FILTER,
 *                         GL_LINEAR)
 *         glTexParameteri(GL_TEXTURE_2D,             # <<<<<<<<<<<<<<
 *                         GL_TEXTURE_MAG_FILTER,
 *                         GL_LINEAR)
*/
  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);

  /* "opengl/modern/data_based_texture.pyx":35
 *                         GL_LINEAR)
 * 
 *         glBindTexture(GL_TEXTURE_2D, 0)             # <<<<<<<<<<<<<<
 * 
 *     def bind(self):
*/
  glBindTexture(GL_TEXTURE_2D, 0);

  /* "opengl/modern/data_based_texture.pyx":7
 *         self._textureName = 0
 * 
 *     def __init__(self,             # <<<<<<<<<<<<<<
 *                  unsigned int width,
 *                  unsigned int height,
*/

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

/* "opengl/modern/data_based_texture.pyx":37
 *         glBindTexture(GL_TEXTURE_2D, 0)
 * 
 *     def bind(self):             # <<<<<<<<<<<<<<
 *         glBindTexture(GL_TEXTURE_2D, self._textureName)
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_16DataBasedTexture_5bind(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_16DataBasedTexture_4bind, "DataBasedTexture.bind(self)");
static PyMethodDef __pyx_mdef_8CyOpenGL_16DataBasedTexture_5bind = {"bind", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_16DataBasedTexture_5bind, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_16DataBasedTexture_4bind};
static PyObject *__pyx_pw_8CyOpenGL_16DataBasedTexture_5bind(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("bind (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("bind", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("bind", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8CyOpenGL_16DataBasedTexture_4bind(((struct __pyx_obj_8CyOpenGL_DataBasedTexture *)__pyx_v_self));

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

static PyObject *__pyx_pf_8CyOpenGL_16DataBasedTexture_4bind(struct __pyx_obj_8CyOpenGL_DataBasedTexture *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("bind", 0);

  /* "opengl/modern/data_based_texture.pyx":38
 * 
 *     def bind(self):
 *         glBindTexture(GL_TEXTURE_2D, self._textureName)             # <<<<<<<<<<<<<<
 * 
 *     def unbind(self):
*/
  glBindTexture(GL_TEXTURE_2D, __pyx_v_self->_textureName);

  /* "opengl/modern/data_based_texture.pyx":37
 *         glBindTexture(GL_TEXTURE_2D, 0)
 * 
 *     def bind(self):             # <<<<<<<<<<<<<<
 *         glBindTexture(GL_TEXTURE_2D, self._textureName)
 * 
*/

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

/* "opengl/modern/data_based_texture.pyx":40
 *         glBindTexture(GL_TEXTURE_2D, self._textureName)
 * 
 *     def unbind(self):             # <<<<<<<<<<<<<<
 *         glBindTexture(GL_TEXTURE_2D, 0)
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_16DataBasedTexture_7unbind(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_16DataBasedTexture_6unbind, "DataBasedTexture.unbind(self)");
static PyMethodDef __pyx_mdef_8CyOpenGL_16DataBasedTexture_7unbind = {"unbind", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_16DataBasedTexture_7unbind, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_16DataBasedTexture_6unbind};
static PyObject *__pyx_pw_8CyOpenGL_16DataBasedTexture_7unbind(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("unbind (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("unbind", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("unbind", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8CyOpenGL_16DataBasedTexture_6unbind(((struct __pyx_obj_8CyOpenGL_DataBasedTexture *)__pyx_v_self));

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

static PyObject *__pyx_pf_8CyOpenGL_16DataBasedTexture_6unbind(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_DataBasedTexture *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("unbind", 0);

  /* "opengl/modern/data_based_texture.pyx":41
 * 
 *     def unbind(self):
 *         glBindTexture(GL_TEXTURE_2D, 0)             # <<<<<<<<<<<<<<
 * 
 *     def delete_resource(self):
*/
  glBindTexture(GL_TEXTURE_2D, 0);

  /* "opengl/modern/data_based_texture.pyx":40
 *         glBindTexture(GL_TEXTURE_2D, self._textureName)
 * 
 *     def unbind(self):             # <<<<<<<<<<<<<<
 *         glBindTexture(GL_TEXTURE_2D, 0)
 * 
*/

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

/* "opengl/modern/data_based_texture.pyx":43
 *         glBindTexture(GL_TEXTURE_2D, 0)
 * 
 *     def delete_resource(self):             # <<<<<<<<<<<<<<
 *         glDeleteTextures(1, &self._textureName)
 *         self._textureName = 0
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_16DataBasedTexture_9delete_resource(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_16DataBasedTexture_8delete_resource, "DataBasedTexture.delete_resource(self)");
static PyMethodDef __pyx_mdef_8CyOpenGL_16DataBasedTexture_9delete_resource = {"delete_resource", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_16DataBasedTexture_9delete_resource, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_16DataBasedTexture_8delete_resource};
static PyObject *__pyx_pw_8CyOpenGL_16DataBasedTexture_9delete_resource(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("delete_resource (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("delete_resource", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("delete_resource", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8CyOpenGL_16DataBasedTexture_8delete_resource(((struct __pyx_obj_8CyOpenGL_DataBasedTexture *)__pyx_v_self));

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

static PyObject *__pyx_pf_8CyOpenGL_16DataBasedTexture_8delete_resource(struct __pyx_obj_8CyOpenGL_DataBasedTexture *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("delete_resource", 0);

  /* "opengl/modern/data_based_texture.pyx":44
 * 
 *     def delete_resource(self):
 *         glDeleteTextures(1, &self._textureName)             # <<<<<<<<<<<<<<
 *         self._textureName = 0
*/
  glDeleteTextures(1, (&__pyx_v_self->_textureName));

  /* "opengl/modern/data_based_texture.pyx":45
 *     def delete_resource(self):
 *         glDeleteTextures(1, &self._textureName)
 *         self._textureName = 0             # <<<<<<<<<<<<<<
*/
  __pyx_v_self->_textureName = 0;

  /* "opengl/modern/data_based_texture.pyx":43
 *         glBindTexture(GL_TEXTURE_2D, 0)
 * 
 *     def delete_resource(self):             # <<<<<<<<<<<<<<
 *         glDeleteTextures(1, &self._textureName)
 *         self._textureName = 0
*/

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

/* "opengl/modern/image_based_texture.pyx":2
 * class ImageBasedTexture(DataBasedTexture):
 *     def __init__(self, texture_file):             # <<<<<<<<<<<<<<
 *         w, h, rows, info = png.Reader(texture_file).asRGBA8()
 *         data = bytearray(4 * w * h)
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_17ImageBasedTexture_1__init__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_17ImageBasedTexture___init__, "ImageBasedTexture.__init__(self, texture_file)");
static PyMethodDef __pyx_mdef_8CyOpenGL_17ImageBasedTexture_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_17ImageBasedTexture_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_17ImageBasedTexture___init__};
static PyObject *__pyx_pw_8CyOpenGL_17ImageBasedTexture_1__init__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_texture_file = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_texture_file,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(6, 2, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(6, 2, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(6, 2, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(6, 2, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, i); __PYX_ERR(6, 2, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(6, 2, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(6, 2, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
    __pyx_v_texture_file = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(6, 2, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("CyOpenGL.ImageBasedTexture.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_17ImageBasedTexture___init__(__pyx_self, __pyx_v_self, __pyx_v_texture_file);

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

static PyObject *__pyx_pf_8CyOpenGL_17ImageBasedTexture___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_texture_file) {
  PyObject *__pyx_v_w = NULL;
  PyObject *__pyx_v_h = NULL;
  PyObject *__pyx_v_rows = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_info = NULL;
  PyObject *__pyx_v_data = NULL;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_row = 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;
  size_t __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  Py_ssize_t __pyx_t_9;
  PyObject *(*__pyx_t_10)(PyObject *);
  Py_ssize_t __pyx_t_11;
  int __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "opengl/modern/image_based_texture.pyx":3
 * class ImageBasedTexture(DataBasedTexture):
 *     def __init__(self, texture_file):
 *         w, h, rows, info = png.Reader(texture_file).asRGBA8()             # <<<<<<<<<<<<<<
 *         data = bytearray(4 * w * h)
 *         for i, row in enumerate(rows):
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_png); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_Reader); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_texture_file};
    __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 3, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_2 = __pyx_t_3;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_7 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_asRGBA8, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 3, __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 != 4)) {
      if (size > 4) __Pyx_RaiseTooManyValuesError(4);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(6, 3, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_2);
      __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 3);
      __Pyx_INCREF(__pyx_t_4);
    } else {
      __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 3, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_3);
      __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 3, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_2);
      __pyx_t_6 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 3, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_6);
      __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 3, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 3, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_4);
    }
    #else
    {
      Py_ssize_t i;
      PyObject** temps[4] = {&__pyx_t_3,&__pyx_t_2,&__pyx_t_6,&__pyx_t_4};
      for (i=0; i < 4; i++) {
        PyObject* item = __Pyx_PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(6, 3, __pyx_L1_error)
        __Pyx_GOTREF(item);
        *(temps[i]) = item;
      }
    }
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    PyObject** temps[4] = {&__pyx_t_3,&__pyx_t_2,&__pyx_t_6,&__pyx_t_4};
    __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 3, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_5);
    for (index=0; index < 4; index++) {
      PyObject* item = __pyx_t_8(__pyx_t_5); if (unlikely(!item)) goto __pyx_L3_unpacking_failed;
      __Pyx_GOTREF(item);
      *(temps[index]) = item;
    }
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_5), 4) < (0)) __PYX_ERR(6, 3, __pyx_L1_error)
    __pyx_t_8 = 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_8 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(6, 3, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  __pyx_v_w = __pyx_t_3;
  __pyx_t_3 = 0;
  __pyx_v_h = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_v_rows = __pyx_t_6;
  __pyx_t_6 = 0;
  __pyx_v_info = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "opengl/modern/image_based_texture.pyx":4
 *     def __init__(self, texture_file):
 *         w, h, rows, info = png.Reader(texture_file).asRGBA8()
 *         data = bytearray(4 * w * h)             # <<<<<<<<<<<<<<
 *         for i, row in enumerate(rows):
 *             data[i * 4 * w : (i + 1) * 4 * w] = row
*/
  __pyx_t_4 = NULL;
  __pyx_t_6 = __Pyx_PyLong_MultiplyCObj(__pyx_mstate_global->__pyx_int_4, __pyx_v_w, 4, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = PyNumber_Multiply(__pyx_t_6, __pyx_v_h); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_7 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(&PyByteArray_Type), __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 4, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_data = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "opengl/modern/image_based_texture.pyx":5
 *         w, h, rows, info = png.Reader(texture_file).asRGBA8()
 *         data = bytearray(4 * w * h)
 *         for i, row in enumerate(rows):             # <<<<<<<<<<<<<<
 *             data[i * 4 * w : (i + 1) * 4 * w] = row
 * 
*/
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
  __pyx_t_1 = __pyx_mstate_global->__pyx_int_0;
  if (likely(PyList_CheckExact(__pyx_v_rows)) || PyTuple_CheckExact(__pyx_v_rows)) {
    __pyx_t_2 = __pyx_v_rows; __Pyx_INCREF(__pyx_t_2);
    __pyx_t_9 = 0;
    __pyx_t_10 = NULL;
  } else {
    __pyx_t_9 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_rows); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(6, 5, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_10)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(6, 5, __pyx_L1_error)
          #endif
          if (__pyx_t_9 >= __pyx_temp) break;
        }
        __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_2, __pyx_t_9, __Pyx_ReferenceSharing_OwnStrongReference);
        ++__pyx_t_9;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(6, 5, __pyx_L1_error)
          #endif
          if (__pyx_t_9 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_9));
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_9);
        #endif
        ++__pyx_t_9;
      }
      if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 5, __pyx_L1_error)
    } else {
      __pyx_t_4 = __pyx_t_10(__pyx_t_2);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(6, 5, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_XDECREF_SET(__pyx_v_row, __pyx_t_4);
    __pyx_t_4 = 0;
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1);
    __pyx_t_4 = __Pyx_PyLong_AddObjC(__pyx_t_1, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "opengl/modern/image_based_texture.pyx":6
 *         data = bytearray(4 * w * h)
 *         for i, row in enumerate(rows):
 *             data[i * 4 * w : (i + 1) * 4 * w] = row             # <<<<<<<<<<<<<<
 * 
 *         super().__init__(w, h, data)
*/
    __pyx_t_4 = __Pyx_PyLong_MultiplyObjC(__pyx_v_i, __pyx_mstate_global->__pyx_int_4, 4, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = PyNumber_Multiply(__pyx_t_4, __pyx_v_w); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_12 = (__pyx_t_6 == Py_None);
    if (__pyx_t_12) {
      __pyx_t_11 = 0;
    } else {
      __pyx_t_13 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_13 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(6, 6, __pyx_L1_error)
      __pyx_t_11 = __pyx_t_13;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyLong_AddObjC(__pyx_v_i, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = __Pyx_PyLong_MultiplyObjC(__pyx_t_6, __pyx_mstate_global->__pyx_int_4, 4, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyNumber_Multiply(__pyx_t_4, __pyx_v_w); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_12 = (__pyx_t_6 == Py_None);
    if (__pyx_t_12) {
      __pyx_t_13 = PY_SSIZE_T_MAX;
    } else {
      __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(6, 6, __pyx_L1_error)
      __pyx_t_13 = __pyx_t_14;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (__Pyx_PyObject_SetSlice(__pyx_v_data, __pyx_v_row, __pyx_t_11, __pyx_t_13, NULL, NULL, NULL, 1, 1, 1) < (0)) __PYX_ERR(6, 6, __pyx_L1_error)

    /* "opengl/modern/image_based_texture.pyx":5
 *         w, h, rows, info = png.Reader(texture_file).asRGBA8()
 *         data = bytearray(4 * w * h)
 *         for i, row in enumerate(rows):             # <<<<<<<<<<<<<<
 *             data[i * 4 * w : (i + 1) * 4 * w] = row
 * 
*/
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/modern/image_based_texture.pyx":8
 *             data[i * 4 * w : (i + 1) * 4 * w] = row
 * 
 *         super().__init__(w, h, data)             # <<<<<<<<<<<<<<
*/
  __pyx_t_4 = NULL;
  __pyx_t_3 = __Pyx_CyFunction_GetClassObj(__pyx_self);
  if (!__pyx_t_3) { PyErr_SetString(PyExc_RuntimeError, "super(): empty __class__ cell"); __PYX_ERR(6, 8, __pyx_L1_error) }
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_7 = 1;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_t_3, __pyx_v_self};
    __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_super, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
  }
  __pyx_t_2 = __pyx_t_6;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_7 = 0;
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_v_w, __pyx_v_h, __pyx_v_data};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_init, __pyx_callargs+__pyx_t_7, (4-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/modern/image_based_texture.pyx":2
 * class ImageBasedTexture(DataBasedTexture):
 *     def __init__(self, texture_file):             # <<<<<<<<<<<<<<
 *         w, h, rows, info = png.Reader(texture_file).asRGBA8()
 *         data = bytearray(4 * w * h)
*/

  /* 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("CyOpenGL.ImageBasedTexture.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_w);
  __Pyx_XDECREF(__pyx_v_h);
  __Pyx_XDECREF(__pyx_v_rows);
  __Pyx_XDECREF(__pyx_v_info);
  __Pyx_XDECREF(__pyx_v_data);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_row);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opengl/modern/uniform_buffer_object.pyx":1
 * cdef GLfloat* _convert_matrices_to_floats(             # <<<<<<<<<<<<<<
 *                     matrices, num_matrices, num_rows, num_columns):
 *     cdef GLfloat * floats
*/

static GLfloat *__pyx_f_8CyOpenGL__convert_matrices_to_floats(PyObject *__pyx_v_matrices, PyObject *__pyx_v_num_matrices, PyObject *__pyx_v_num_rows, PyObject *__pyx_v_num_columns) {
  GLfloat *__pyx_v_floats;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_j = NULL;
  PyObject *__pyx_v_k = NULL;
  GLfloat *__pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *(*__pyx_t_6)(PyObject *);
  PyObject *__pyx_t_7 = NULL;
  PyObject *(*__pyx_t_8)(PyObject *);
  PyObject *__pyx_t_9 = NULL;
  GLfloat __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  Py_ssize_t __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_convert_matrices_to_floats", 0);

  /* "opengl/modern/uniform_buffer_object.pyx":5
 *     cdef GLfloat * floats
 *     floats = <GLfloat *> malloc(
 *         num_matrices * num_rows * num_columns * sizeof(GLfloat))             # <<<<<<<<<<<<<<
 *     for i in range(num_matrices):
 *         for j in range(num_rows):
*/
  __pyx_t_1 = PyNumber_Multiply(__pyx_v_num_matrices, __pyx_v_num_rows); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Multiply(__pyx_t_1, __pyx_v_num_columns); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyLong_FromSize_t((sizeof(GLfloat))); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyNumber_Multiply(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(29, 5, __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_t_4 = __Pyx_PyLong_As_size_t(__pyx_t_3); if (unlikely((__pyx_t_4 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(29, 5, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "opengl/modern/uniform_buffer_object.pyx":4
 *                     matrices, num_matrices, num_rows, num_columns):
 *     cdef GLfloat * floats
 *     floats = <GLfloat *> malloc(             # <<<<<<<<<<<<<<
 *         num_matrices * num_rows * num_columns * sizeof(GLfloat))
 *     for i in range(num_matrices):
*/
  __pyx_v_floats = ((GLfloat *)malloc(__pyx_t_4));

  /* "opengl/modern/uniform_buffer_object.pyx":6
 *     floats = <GLfloat *> malloc(
 *         num_matrices * num_rows * num_columns * sizeof(GLfloat))
 *     for i in range(num_matrices):             # <<<<<<<<<<<<<<
 *         for j in range(num_rows):
 *             for k in range(num_columns):
*/
  __pyx_t_1 = NULL;
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_num_matrices};
    __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(&PyRange_Type), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(29, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(29, 6, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  for (;;) {
    {
      __pyx_t_3 = __pyx_t_5(__pyx_t_1);
      if (unlikely(!__pyx_t_3)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(29, 6, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "opengl/modern/uniform_buffer_object.pyx":7
 *         num_matrices * num_rows * num_columns * sizeof(GLfloat))
 *     for i in range(num_matrices):
 *         for j in range(num_rows):             # <<<<<<<<<<<<<<
 *             for k in range(num_columns):
 *                 floats[num_rows * num_columns * i + num_columns * j + k] = (
*/
    __pyx_t_2 = NULL;
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_num_rows};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(&PyRange_Type), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(29, 7, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 7, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 7, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    for (;;) {
      {
        __pyx_t_3 = __pyx_t_6(__pyx_t_2);
        if (unlikely(!__pyx_t_3)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(29, 7, __pyx_L1_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "opengl/modern/uniform_buffer_object.pyx":8
 *     for i in range(num_matrices):
 *         for j in range(num_rows):
 *             for k in range(num_columns):             # <<<<<<<<<<<<<<
 *                 floats[num_rows * num_columns * i + num_columns * j + k] = (
 *                     matrices[i][j][k])
*/
      __pyx_t_7 = NULL;
      __pyx_t_4 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_num_columns};
        __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(&PyRange_Type), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(29, 8, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
      }
      __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(29, 8, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(29, 8, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      for (;;) {
        {
          __pyx_t_3 = __pyx_t_8(__pyx_t_7);
          if (unlikely(!__pyx_t_3)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(29, 8, __pyx_L1_error)
              PyErr_Clear();
            }
            break;
          }
        }
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_3);
        __pyx_t_3 = 0;

        /* "opengl/modern/uniform_buffer_object.pyx":10
 *             for k in range(num_columns):
 *                 floats[num_rows * num_columns * i + num_columns * j + k] = (
 *                     matrices[i][j][k])             # <<<<<<<<<<<<<<
 *     return floats
 * 
*/
        __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_matrices, __pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(29, 10, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_v_j); if (unlikely(!__pyx_t_9)) __PYX_ERR(29, 10, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_9, __pyx_v_k); if (unlikely(!__pyx_t_3)) __PYX_ERR(29, 10, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_10 = __Pyx_PyFloat_AsFloat(__pyx_t_3); if (unlikely((__pyx_t_10 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(29, 10, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

        /* "opengl/modern/uniform_buffer_object.pyx":9
 *         for j in range(num_rows):
 *             for k in range(num_columns):
 *                 floats[num_rows * num_columns * i + num_columns * j + k] = (             # <<<<<<<<<<<<<<
 *                     matrices[i][j][k])
 *     return floats
*/
        __pyx_t_3 = PyNumber_Multiply(__pyx_v_num_rows, __pyx_v_num_columns); if (unlikely(!__pyx_t_3)) __PYX_ERR(29, 9, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_9 = PyNumber_Multiply(__pyx_t_3, __pyx_v_i); if (unlikely(!__pyx_t_9)) __PYX_ERR(29, 9, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = PyNumber_Multiply(__pyx_v_num_columns, __pyx_v_j); if (unlikely(!__pyx_t_3)) __PYX_ERR(29, 9, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_11 = PyNumber_Add(__pyx_t_9, __pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(29, 9, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = PyNumber_Add(__pyx_t_11, __pyx_v_k); if (unlikely(!__pyx_t_3)) __PYX_ERR(29, 9, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(29, 9, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        (__pyx_v_floats[__pyx_t_12]) = __pyx_t_10;

        /* "opengl/modern/uniform_buffer_object.pyx":8
 *     for i in range(num_matrices):
 *         for j in range(num_rows):
 *             for k in range(num_columns):             # <<<<<<<<<<<<<<
 *                 floats[num_rows * num_columns * i + num_columns * j + k] = (
 *                     matrices[i][j][k])
*/
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "opengl/modern/uniform_buffer_object.pyx":7
 *         num_matrices * num_rows * num_columns * sizeof(GLfloat))
 *     for i in range(num_matrices):
 *         for j in range(num_rows):             # <<<<<<<<<<<<<<
 *             for k in range(num_columns):
 *                 floats[num_rows * num_columns * i + num_columns * j + k] = (
*/
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "opengl/modern/uniform_buffer_object.pyx":6
 *     floats = <GLfloat *> malloc(
 *         num_matrices * num_rows * num_columns * sizeof(GLfloat))
 *     for i in range(num_matrices):             # <<<<<<<<<<<<<<
 *         for j in range(num_rows):
 *             for k in range(num_columns):
*/
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/modern/uniform_buffer_object.pyx":11
 *                 floats[num_rows * num_columns * i + num_columns * j + k] = (
 *                     matrices[i][j][k])
 *     return floats             # <<<<<<<<<<<<<<
 * 
 * cdef class UniformBufferObject:
*/
  __pyx_r = __pyx_v_floats;
  goto __pyx_L0;

  /* "opengl/modern/uniform_buffer_object.pyx":1
 * cdef GLfloat* _convert_matrices_to_floats(             # <<<<<<<<<<<<<<
 *                     matrices, num_matrices, num_rows, num_columns):
 *     cdef GLfloat * floats
*/

  /* 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_11);
  __Pyx_AddTraceback("CyOpenGL._convert_matrices_to_floats", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_j);
  __Pyx_XDECREF(__pyx_v_k);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opengl/modern/uniform_buffer_object.pyx":19
 *     cdef _name_to_offset
 * 
 *     def __init__(self, buffer_size, name_to_offset):             # <<<<<<<<<<<<<<
 *         self._buffer = NULL
 *         self._buffer_size = 0
*/

/* Python wrapper */
static int __pyx_pw_8CyOpenGL_19UniformBufferObject_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_8CyOpenGL_19UniformBufferObject_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_buffer_size = 0;
  PyObject *__pyx_v_name_to_offset = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_buffer_size,&__pyx_mstate_global->__pyx_n_u_name_to_offset,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(29, 19, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(29, 19, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(29, 19, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(29, 19, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, i); __PYX_ERR(29, 19, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(29, 19, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(29, 19, __pyx_L3_error)
    }
    __pyx_v_buffer_size = values[0];
    __pyx_v_name_to_offset = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(29, 19, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("CyOpenGL.UniformBufferObject.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_19UniformBufferObject___init__(((struct __pyx_obj_8CyOpenGL_UniformBufferObject *)__pyx_v_self), __pyx_v_buffer_size, __pyx_v_name_to_offset);

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

static int __pyx_pf_8CyOpenGL_19UniformBufferObject___init__(struct __pyx_obj_8CyOpenGL_UniformBufferObject *__pyx_v_self, PyObject *__pyx_v_buffer_size, PyObject *__pyx_v_name_to_offset) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  size_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "opengl/modern/uniform_buffer_object.pyx":20
 * 
 *     def __init__(self, buffer_size, name_to_offset):
 *         self._buffer = NULL             # <<<<<<<<<<<<<<
 *         self._buffer_size = 0
 *         self._uniform_buffer_object = 0
*/
  __pyx_v_self->_buffer = NULL;

  /* "opengl/modern/uniform_buffer_object.pyx":21
 *     def __init__(self, buffer_size, name_to_offset):
 *         self._buffer = NULL
 *         self._buffer_size = 0             # <<<<<<<<<<<<<<
 *         self._uniform_buffer_object = 0
 * 
*/
  __pyx_v_self->_buffer_size = 0;

  /* "opengl/modern/uniform_buffer_object.pyx":22
 *         self._buffer = NULL
 *         self._buffer_size = 0
 *         self._uniform_buffer_object = 0             # <<<<<<<<<<<<<<
 * 
 *         self._name_to_offset = name_to_offset
*/
  __pyx_v_self->_uniform_buffer_object = 0;

  /* "opengl/modern/uniform_buffer_object.pyx":24
 *         self._uniform_buffer_object = 0
 * 
 *         self._name_to_offset = name_to_offset             # <<<<<<<<<<<<<<
 *         self._buffer_size = buffer_size
 *         self._buffer = <char*>(malloc(self._buffer_size))
*/
  __Pyx_INCREF(__pyx_v_name_to_offset);
  __Pyx_GIVEREF(__pyx_v_name_to_offset);
  __Pyx_GOTREF(__pyx_v_self->_name_to_offset);
  __Pyx_DECREF(__pyx_v_self->_name_to_offset);
  __pyx_v_self->_name_to_offset = __pyx_v_name_to_offset;

  /* "opengl/modern/uniform_buffer_object.pyx":25
 * 
 *         self._name_to_offset = name_to_offset
 *         self._buffer_size = buffer_size             # <<<<<<<<<<<<<<
 *         self._buffer = <char*>(malloc(self._buffer_size))
 * 
*/
  __pyx_t_1 = __Pyx_PyLong_As_size_t(__pyx_v_buffer_size); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(29, 25, __pyx_L1_error)
  __pyx_v_self->_buffer_size = __pyx_t_1;

  /* "opengl/modern/uniform_buffer_object.pyx":26
 *         self._name_to_offset = name_to_offset
 *         self._buffer_size = buffer_size
 *         self._buffer = <char*>(malloc(self._buffer_size))             # <<<<<<<<<<<<<<
 * 
 *         glGenBuffers(1, &self._uniform_buffer_object)
*/
  __pyx_v_self->_buffer = ((char *)malloc(__pyx_v_self->_buffer_size));

  /* "opengl/modern/uniform_buffer_object.pyx":28
 *         self._buffer = <char*>(malloc(self._buffer_size))
 * 
 *         glGenBuffers(1, &self._uniform_buffer_object)             # <<<<<<<<<<<<<<
 *         glBindBuffer(GL_UNIFORM_BUFFER, self._uniform_buffer_object)
 *         glBufferData(GL_UNIFORM_BUFFER,
*/
  glGenBuffers(1, (&__pyx_v_self->_uniform_buffer_object));

  /* "opengl/modern/uniform_buffer_object.pyx":29
 * 
 *         glGenBuffers(1, &self._uniform_buffer_object)
 *         glBindBuffer(GL_UNIFORM_BUFFER, self._uniform_buffer_object)             # <<<<<<<<<<<<<<
 *         glBufferData(GL_UNIFORM_BUFFER,
 *                      <GLsizeiptr>self._buffer_size,
*/
  glBindBuffer(GL_UNIFORM_BUFFER, __pyx_v_self->_uniform_buffer_object);

  /* "opengl/modern/uniform_buffer_object.pyx":30
 *         glGenBuffers(1, &self._uniform_buffer_object)
 *         glBindBuffer(GL_UNIFORM_BUFFER, self._uniform_buffer_object)
 *         glBufferData(GL_UNIFORM_BUFFER,             # <<<<<<<<<<<<<<
 *                      <GLsizeiptr>self._buffer_size,
 *                      NULL,
*/
  glBufferData(GL_UNIFORM_BUFFER, ((GLsizeiptr)__pyx_v_self->_buffer_size), NULL, GL_STATIC_DRAW);

  /* "opengl/modern/uniform_buffer_object.pyx":34
 *                      NULL,
 *                      GL_STATIC_DRAW)
 *         glBindBuffer(GL_UNIFORM_BUFFER, 0)             # <<<<<<<<<<<<<<
 * 
 *         print_gl_errors("UniformBufferObject.__init__")
*/
  glBindBuffer(GL_UNIFORM_BUFFER, 0);

  /* "opengl/modern/uniform_buffer_object.pyx":36
 *         glBindBuffer(GL_UNIFORM_BUFFER, 0)
 * 
 *         print_gl_errors("UniformBufferObject.__init__")             # <<<<<<<<<<<<<<
 * 
 *     def set(self, name, uniform_type, value):
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_print_gl_errors); if (unlikely(!__pyx_t_4)) __PYX_ERR(29, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_1 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_UniformBufferObject___init};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_1, (2-__pyx_t_1) | (__pyx_t_1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 36, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opengl/modern/uniform_buffer_object.pyx":19
 *     cdef _name_to_offset
 * 
 *     def __init__(self, buffer_size, name_to_offset):             # <<<<<<<<<<<<<<
 *         self._buffer = NULL
 *         self._buffer_size = 0
*/

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

/* "opengl/modern/uniform_buffer_object.pyx":38
 *         print_gl_errors("UniformBufferObject.__init__")
 * 
 *     def set(self, name, uniform_type, value):             # <<<<<<<<<<<<<<
 *         cdef size_t offset
 *         cdef size_t l
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_19UniformBufferObject_3set(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_19UniformBufferObject_2set, "UniformBufferObject.set(self, name, uniform_type, value)");
static PyMethodDef __pyx_mdef_8CyOpenGL_19UniformBufferObject_3set = {"set", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_19UniformBufferObject_3set, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_19UniformBufferObject_2set};
static PyObject *__pyx_pw_8CyOpenGL_19UniformBufferObject_3set(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_uniform_type = 0;
  PyObject *__pyx_v_value = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_name,&__pyx_mstate_global->__pyx_n_u_uniform_type,&__pyx_mstate_global->__pyx_n_u_value,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(29, 38, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(29, 38, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(29, 38, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(29, 38, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "set", 0) < (0)) __PYX_ERR(29, 38, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("set", 1, 3, 3, i); __PYX_ERR(29, 38, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(29, 38, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(29, 38, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(29, 38, __pyx_L3_error)
    }
    __pyx_v_name = values[0];
    __pyx_v_uniform_type = values[1];
    __pyx_v_value = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set", 1, 3, 3, __pyx_nargs); __PYX_ERR(29, 38, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("CyOpenGL.UniformBufferObject.set", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_19UniformBufferObject_2set(((struct __pyx_obj_8CyOpenGL_UniformBufferObject *)__pyx_v_self), __pyx_v_name, __pyx_v_uniform_type, __pyx_v_value);

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

static PyObject *__pyx_pf_8CyOpenGL_19UniformBufferObject_2set(struct __pyx_obj_8CyOpenGL_UniformBufferObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_uniform_type, PyObject *__pyx_v_value) {
  size_t __pyx_v_offset;
  size_t __pyx_v_l;
  size_t __pyx_v_i;
  size_t __pyx_v_j;
  size_t __pyx_v_k;
  GLfloat *__pyx_v_float_array;
  GLint *__pyx_v_int_array;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  size_t __pyx_t_2;
  int __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10[8];
  PyObject *__pyx_t_11 = NULL;
  size_t __pyx_t_12;
  size_t __pyx_t_13;
  size_t __pyx_t_14;
  GLfloat __pyx_t_15;
  size_t __pyx_t_16;
  GLint __pyx_t_17;
  PyObject *__pyx_t_18[5];
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set", 0);

  /* "opengl/modern/uniform_buffer_object.pyx":46
 *         cdef GLfloat * float_array
 * 
 *         offset = self._name_to_offset[name]             # <<<<<<<<<<<<<<
 * 
 *         if uniform_type == 'vec4[]':
*/
  __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_self->_name_to_offset, __pyx_v_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 46, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyLong_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(29, 46, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_offset = __pyx_t_2;

  /* "opengl/modern/uniform_buffer_object.pyx":48
 *         offset = self._name_to_offset[name]
 * 
 *         if uniform_type == 'vec4[]':             # <<<<<<<<<<<<<<
 *             l = len(value)
 *             if offset + 4 * 4 * l > self._buffer_size:
*/
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_uniform_type, __pyx_mstate_global->__pyx_kp_u_vec4, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(29, 48, __pyx_L1_error)
  if (__pyx_t_3) {

    /* "opengl/modern/uniform_buffer_object.pyx":49
 * 
 *         if uniform_type == 'vec4[]':
 *             l = len(value)             # <<<<<<<<<<<<<<
 *             if offset + 4 * 4 * l > self._buffer_size:
 *                 raise Exception(
*/
    __pyx_t_4 = PyObject_Length(__pyx_v_value); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(29, 49, __pyx_L1_error)
    __pyx_v_l = __pyx_t_4;

    /* "opengl/modern/uniform_buffer_object.pyx":50
 *         if uniform_type == 'vec4[]':
 *             l = len(value)
 *             if offset + 4 * 4 * l > self._buffer_size:             # <<<<<<<<<<<<<<
 *                 raise Exception(
 *                     ("Data for %s of length %d at offset %d not fitting "
*/
    __pyx_t_3 = ((__pyx_v_offset + (0x10 * __pyx_v_l)) > __pyx_v_self->_buffer_size);
    if (unlikely(__pyx_t_3)) {

      /* "opengl/modern/uniform_buffer_object.pyx":51
 *             l = len(value)
 *             if offset + 4 * 4 * l > self._buffer_size:
 *                 raise Exception(             # <<<<<<<<<<<<<<
 *                     ("Data for %s of length %d at offset %d not fitting "
 *                      "into uniform buffer object of size %d") % (
*/
      __pyx_t_5 = NULL;

      /* "opengl/modern/uniform_buffer_object.pyx":54
 *                     ("Data for %s of length %d at offset %d not fitting "
 *                      "into uniform buffer object of size %d") % (
 *                         name, l, offset, self._buffer_size))             # <<<<<<<<<<<<<<
 * 
 *             float_array = <GLfloat*>(self._buffer + offset)
*/
      __pyx_t_6 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_v_name), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 54, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyUnicode_From_size_t(__pyx_v_l, 0, ' ', 'd'); if (unlikely(!__pyx_t_7)) __PYX_ERR(29, 54, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = __Pyx_PyUnicode_From_size_t(__pyx_v_offset, 0, ' ', 'd'); if (unlikely(!__pyx_t_8)) __PYX_ERR(29, 54, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = __Pyx_PyUnicode_From_size_t(__pyx_v_self->_buffer_size, 0, ' ', 'd'); if (unlikely(!__pyx_t_9)) __PYX_ERR(29, 54, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10[0] = __pyx_mstate_global->__pyx_kp_u_Data_for;
      __pyx_t_10[1] = __pyx_t_6;
      __pyx_t_10[2] = __pyx_mstate_global->__pyx_kp_u_of_length;
      __pyx_t_10[3] = __pyx_t_7;
      __pyx_t_10[4] = __pyx_mstate_global->__pyx_kp_u_at_offset;
      __pyx_t_10[5] = __pyx_t_8;
      __pyx_t_10[6] = __pyx_mstate_global->__pyx_kp_u_not_fitting_into_uniform_buffer;
      __pyx_t_10[7] = __pyx_t_9;

      /* "opengl/modern/uniform_buffer_object.pyx":52
 *             if offset + 4 * 4 * l > self._buffer_size:
 *                 raise Exception(
 *                     ("Data for %s of length %d at offset %d not fitting "             # <<<<<<<<<<<<<<
 *                      "into uniform buffer object of size %d") % (
 *                         name, l, offset, self._buffer_size))
*/
      __pyx_t_11 = __Pyx_PyUnicode_Join(__pyx_t_10, 8, 9 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6) + 11 * 2 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8) + 48 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6));
      if (unlikely(!__pyx_t_11)) __PYX_ERR(29, 52, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_2 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_11};
        __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_Exception)), __pyx_callargs+__pyx_t_2, (2-__pyx_t_2) | (__pyx_t_2*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 51, __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(29, 51, __pyx_L1_error)

      /* "opengl/modern/uniform_buffer_object.pyx":50
 *         if uniform_type == 'vec4[]':
 *             l = len(value)
 *             if offset + 4 * 4 * l > self._buffer_size:             # <<<<<<<<<<<<<<
 *                 raise Exception(
 *                     ("Data for %s of length %d at offset %d not fitting "
*/
    }

    /* "opengl/modern/uniform_buffer_object.pyx":56
 *                         name, l, offset, self._buffer_size))
 * 
 *             float_array = <GLfloat*>(self._buffer + offset)             # <<<<<<<<<<<<<<
 *             for i in range(l):
 *                 for j in range(4):
*/
    __pyx_v_float_array = ((GLfloat *)(__pyx_v_self->_buffer + __pyx_v_offset));

    /* "opengl/modern/uniform_buffer_object.pyx":57
 * 
 *             float_array = <GLfloat*>(self._buffer + offset)
 *             for i in range(l):             # <<<<<<<<<<<<<<
 *                 for j in range(4):
 *                     float_array[4 * i + j] = value[i][j]
*/
    __pyx_t_2 = __pyx_v_l;
    __pyx_t_12 = __pyx_t_2;
    for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
      __pyx_v_i = __pyx_t_13;

      /* "opengl/modern/uniform_buffer_object.pyx":58
 *             float_array = <GLfloat*>(self._buffer + offset)
 *             for i in range(l):
 *                 for j in range(4):             # <<<<<<<<<<<<<<
 *                     float_array[4 * i + j] = value[i][j]
 *         elif uniform_type == 'mat4[]':
*/
      for (__pyx_t_14 = 0; __pyx_t_14 < 4; __pyx_t_14+=1) {
        __pyx_v_j = __pyx_t_14;

        /* "opengl/modern/uniform_buffer_object.pyx":59
 *             for i in range(l):
 *                 for j in range(4):
 *                     float_array[4 * i + j] = value[i][j]             # <<<<<<<<<<<<<<
 *         elif uniform_type == 'mat4[]':
 *             l = len(value)
*/
        __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_value, __pyx_v_i, size_t, 0, __Pyx_PyLong_FromSize_t, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 59, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_11 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_j, size_t, 0, __Pyx_PyLong_FromSize_t, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_11)) __PYX_ERR(29, 59, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_15 = __Pyx_PyFloat_AsFloat(__pyx_t_11); if (unlikely((__pyx_t_15 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(29, 59, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        (__pyx_v_float_array[((4 * __pyx_v_i) + __pyx_v_j)]) = __pyx_t_15;
      }
    }

    /* "opengl/modern/uniform_buffer_object.pyx":48
 *         offset = self._name_to_offset[name]
 * 
 *         if uniform_type == 'vec4[]':             # <<<<<<<<<<<<<<
 *             l = len(value)
 *             if offset + 4 * 4 * l > self._buffer_size:
*/
    goto __pyx_L3;
  }

  /* "opengl/modern/uniform_buffer_object.pyx":60
 *                 for j in range(4):
 *                     float_array[4 * i + j] = value[i][j]
 *         elif uniform_type == 'mat4[]':             # <<<<<<<<<<<<<<
 *             l = len(value)
 *             if offset + 4 * 4 * 4 * l > self._buffer_size:
*/
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_uniform_type, __pyx_mstate_global->__pyx_kp_u_mat4, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(29, 60, __pyx_L1_error)
  if (__pyx_t_3) {

    /* "opengl/modern/uniform_buffer_object.pyx":61
 *                     float_array[4 * i + j] = value[i][j]
 *         elif uniform_type == 'mat4[]':
 *             l = len(value)             # <<<<<<<<<<<<<<
 *             if offset + 4 * 4 * 4 * l > self._buffer_size:
 *                 raise Exception(
*/
    __pyx_t_4 = PyObject_Length(__pyx_v_value); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(29, 61, __pyx_L1_error)
    __pyx_v_l = __pyx_t_4;

    /* "opengl/modern/uniform_buffer_object.pyx":62
 *         elif uniform_type == 'mat4[]':
 *             l = len(value)
 *             if offset + 4 * 4 * 4 * l > self._buffer_size:             # <<<<<<<<<<<<<<
 *                 raise Exception(
 *                     ("Data for %s of length %d at offset %d not fitting "
*/
    __pyx_t_3 = ((__pyx_v_offset + (0x40 * __pyx_v_l)) > __pyx_v_self->_buffer_size);
    if (unlikely(__pyx_t_3)) {

      /* "opengl/modern/uniform_buffer_object.pyx":63
 *             l = len(value)
 *             if offset + 4 * 4 * 4 * l > self._buffer_size:
 *                 raise Exception(             # <<<<<<<<<<<<<<
 *                     ("Data for %s of length %d at offset %d not fitting "
 *                      "into uniform buffer object of size %d") % (
*/
      __pyx_t_1 = NULL;

      /* "opengl/modern/uniform_buffer_object.pyx":66
 *                     ("Data for %s of length %d at offset %d not fitting "
 *                      "into uniform buffer object of size %d") % (
 *                         name, l, offset, self._buffer_size))             # <<<<<<<<<<<<<<
 * 
 *             float_array = <GLfloat*>(self._buffer + offset)
*/
      __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_v_name), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(29, 66, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_9 = __Pyx_PyUnicode_From_size_t(__pyx_v_l, 0, ' ', 'd'); if (unlikely(!__pyx_t_9)) __PYX_ERR(29, 66, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_8 = __Pyx_PyUnicode_From_size_t(__pyx_v_offset, 0, ' ', 'd'); if (unlikely(!__pyx_t_8)) __PYX_ERR(29, 66, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_7 = __Pyx_PyUnicode_From_size_t(__pyx_v_self->_buffer_size, 0, ' ', 'd'); if (unlikely(!__pyx_t_7)) __PYX_ERR(29, 66, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_10[0] = __pyx_mstate_global->__pyx_kp_u_Data_for;
      __pyx_t_10[1] = __pyx_t_5;
      __pyx_t_10[2] = __pyx_mstate_global->__pyx_kp_u_of_length;
      __pyx_t_10[3] = __pyx_t_9;
      __pyx_t_10[4] = __pyx_mstate_global->__pyx_kp_u_at_offset;
      __pyx_t_10[5] = __pyx_t_8;
      __pyx_t_10[6] = __pyx_mstate_global->__pyx_kp_u_not_fitting_into_uniform_buffer;
      __pyx_t_10[7] = __pyx_t_7;

      /* "opengl/modern/uniform_buffer_object.pyx":64
 *             if offset + 4 * 4 * 4 * l > self._buffer_size:
 *                 raise Exception(
 *                     ("Data for %s of length %d at offset %d not fitting "             # <<<<<<<<<<<<<<
 *                      "into uniform buffer object of size %d") % (
 *                         name, l, offset, self._buffer_size))
*/
      __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_10, 8, 9 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5) + 11 * 2 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8) + 48 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5));
      if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 64, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_2 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_6};
        __pyx_t_11 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_Exception)), __pyx_callargs+__pyx_t_2, (2-__pyx_t_2) | (__pyx_t_2*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_11)) __PYX_ERR(29, 63, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
      }
      __Pyx_Raise(__pyx_t_11, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __PYX_ERR(29, 63, __pyx_L1_error)

      /* "opengl/modern/uniform_buffer_object.pyx":62
 *         elif uniform_type == 'mat4[]':
 *             l = len(value)
 *             if offset + 4 * 4 * 4 * l > self._buffer_size:             # <<<<<<<<<<<<<<
 *                 raise Exception(
 *                     ("Data for %s of length %d at offset %d not fitting "
*/
    }

    /* "opengl/modern/uniform_buffer_object.pyx":68
 *                         name, l, offset, self._buffer_size))
 * 
 *             float_array = <GLfloat*>(self._buffer + offset)             # <<<<<<<<<<<<<<
 *             for i in range(l):
 *                 for j in range(4):
*/
    __pyx_v_float_array = ((GLfloat *)(__pyx_v_self->_buffer + __pyx_v_offset));

    /* "opengl/modern/uniform_buffer_object.pyx":69
 * 
 *             float_array = <GLfloat*>(self._buffer + offset)
 *             for i in range(l):             # <<<<<<<<<<<<<<
 *                 for j in range(4):
 *                     for k in range(4):
*/
    __pyx_t_2 = __pyx_v_l;
    __pyx_t_12 = __pyx_t_2;
    for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
      __pyx_v_i = __pyx_t_13;

      /* "opengl/modern/uniform_buffer_object.pyx":70
 *             float_array = <GLfloat*>(self._buffer + offset)
 *             for i in range(l):
 *                 for j in range(4):             # <<<<<<<<<<<<<<
 *                     for k in range(4):
 *                         float_array[4 * 4 * i + 4 * j + k] = value[i][j][k]
*/
      for (__pyx_t_14 = 0; __pyx_t_14 < 4; __pyx_t_14+=1) {
        __pyx_v_j = __pyx_t_14;

        /* "opengl/modern/uniform_buffer_object.pyx":71
 *             for i in range(l):
 *                 for j in range(4):
 *                     for k in range(4):             # <<<<<<<<<<<<<<
 *                         float_array[4 * 4 * i + 4 * j + k] = value[i][j][k]
 *         elif uniform_type == 'int[]':
*/
        for (__pyx_t_16 = 0; __pyx_t_16 < 4; __pyx_t_16+=1) {
          __pyx_v_k = __pyx_t_16;

          /* "opengl/modern/uniform_buffer_object.pyx":72
 *                 for j in range(4):
 *                     for k in range(4):
 *                         float_array[4 * 4 * i + 4 * j + k] = value[i][j][k]             # <<<<<<<<<<<<<<
 *         elif uniform_type == 'int[]':
 *             l = len(value)
*/
          __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_value, __pyx_v_i, size_t, 0, __Pyx_PyLong_FromSize_t, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_11)) __PYX_ERR(29, 72, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_11);
          __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_11, __pyx_v_j, size_t, 0, __Pyx_PyLong_FromSize_t, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 72, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __pyx_t_11 = __Pyx_GetItemInt(__pyx_t_6, __pyx_v_k, size_t, 0, __Pyx_PyLong_FromSize_t, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_11)) __PYX_ERR(29, 72, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_t_15 = __Pyx_PyFloat_AsFloat(__pyx_t_11); if (unlikely((__pyx_t_15 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(29, 72, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          (__pyx_v_float_array[(((0x10 * __pyx_v_i) + (4 * __pyx_v_j)) + __pyx_v_k)]) = __pyx_t_15;
        }
      }
    }

    /* "opengl/modern/uniform_buffer_object.pyx":60
 *                 for j in range(4):
 *                     float_array[4 * i + j] = value[i][j]
 *         elif uniform_type == 'mat4[]':             # <<<<<<<<<<<<<<
 *             l = len(value)
 *             if offset + 4 * 4 * 4 * l > self._buffer_size:
*/
    goto __pyx_L3;
  }

  /* "opengl/modern/uniform_buffer_object.pyx":73
 *                     for k in range(4):
 *                         float_array[4 * 4 * i + 4 * j + k] = value[i][j][k]
 *         elif uniform_type == 'int[]':             # <<<<<<<<<<<<<<
 *             l = len(value)
 *             if offset + 16 * l > self._buffer_size:
*/
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_uniform_type, __pyx_mstate_global->__pyx_kp_u_int, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(29, 73, __pyx_L1_error)
  if (__pyx_t_3) {

    /* "opengl/modern/uniform_buffer_object.pyx":74
 *                         float_array[4 * 4 * i + 4 * j + k] = value[i][j][k]
 *         elif uniform_type == 'int[]':
 *             l = len(value)             # <<<<<<<<<<<<<<
 *             if offset + 16 * l > self._buffer_size:
 *                 raise Exception(
*/
    __pyx_t_4 = PyObject_Length(__pyx_v_value); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(29, 74, __pyx_L1_error)
    __pyx_v_l = __pyx_t_4;

    /* "opengl/modern/uniform_buffer_object.pyx":75
 *         elif uniform_type == 'int[]':
 *             l = len(value)
 *             if offset + 16 * l > self._buffer_size:             # <<<<<<<<<<<<<<
 *                 raise Exception(
 *                     ("Data for %s of length %d at offset %d not fitting "
*/
    __pyx_t_3 = ((__pyx_v_offset + (16 * __pyx_v_l)) > __pyx_v_self->_buffer_size);
    if (unlikely(__pyx_t_3)) {

      /* "opengl/modern/uniform_buffer_object.pyx":76
 *             l = len(value)
 *             if offset + 16 * l > self._buffer_size:
 *                 raise Exception(             # <<<<<<<<<<<<<<
 *                     ("Data for %s of length %d at offset %d not fitting "
 *                      "into uniform buffer object of size %d") % (
*/
      __pyx_t_6 = NULL;

      /* "opengl/modern/uniform_buffer_object.pyx":79
 *                     ("Data for %s of length %d at offset %d not fitting "
 *                      "into uniform buffer object of size %d") % (
 *                         name, l, offset, self._buffer_size))             # <<<<<<<<<<<<<<
 * 
 *             int_array = <GLint*>(self._buffer + offset)
*/
      __pyx_t_1 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_v_name), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 79, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_7 = __Pyx_PyUnicode_From_size_t(__pyx_v_l, 0, ' ', 'd'); if (unlikely(!__pyx_t_7)) __PYX_ERR(29, 79, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = __Pyx_PyUnicode_From_size_t(__pyx_v_offset, 0, ' ', 'd'); if (unlikely(!__pyx_t_8)) __PYX_ERR(29, 79, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = __Pyx_PyUnicode_From_size_t(__pyx_v_self->_buffer_size, 0, ' ', 'd'); if (unlikely(!__pyx_t_9)) __PYX_ERR(29, 79, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10[0] = __pyx_mstate_global->__pyx_kp_u_Data_for;
      __pyx_t_10[1] = __pyx_t_1;
      __pyx_t_10[2] = __pyx_mstate_global->__pyx_kp_u_of_length;
      __pyx_t_10[3] = __pyx_t_7;
      __pyx_t_10[4] = __pyx_mstate_global->__pyx_kp_u_at_offset;
      __pyx_t_10[5] = __pyx_t_8;
      __pyx_t_10[6] = __pyx_mstate_global->__pyx_kp_u_not_fitting_into_uniform_buffer;
      __pyx_t_10[7] = __pyx_t_9;

      /* "opengl/modern/uniform_buffer_object.pyx":77
 *             if offset + 16 * l > self._buffer_size:
 *                 raise Exception(
 *                     ("Data for %s of length %d at offset %d not fitting "             # <<<<<<<<<<<<<<
 *                      "into uniform buffer object of size %d") % (
 *                         name, l, offset, self._buffer_size))
*/
      __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_10, 8, 9 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1) + 11 * 2 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8) + 48 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1));
      if (unlikely(!__pyx_t_5)) __PYX_ERR(29, 77, __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_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_2 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_5};
        __pyx_t_11 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_Exception)), __pyx_callargs+__pyx_t_2, (2-__pyx_t_2) | (__pyx_t_2*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_11)) __PYX_ERR(29, 76, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
      }
      __Pyx_Raise(__pyx_t_11, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __PYX_ERR(29, 76, __pyx_L1_error)

      /* "opengl/modern/uniform_buffer_object.pyx":75
 *         elif uniform_type == 'int[]':
 *             l = len(value)
 *             if offset + 16 * l > self._buffer_size:             # <<<<<<<<<<<<<<
 *                 raise Exception(
 *                     ("Data for %s of length %d at offset %d not fitting "
*/
    }

    /* "opengl/modern/uniform_buffer_object.pyx":81
 *                         name, l, offset, self._buffer_size))
 * 
 *             int_array = <GLint*>(self._buffer + offset)             # <<<<<<<<<<<<<<
 *             for i in range(l):
 *                 int_array[4 * i] = value[i]
*/
    __pyx_v_int_array = ((GLint *)(__pyx_v_self->_buffer + __pyx_v_offset));

    /* "opengl/modern/uniform_buffer_object.pyx":82
 * 
 *             int_array = <GLint*>(self._buffer + offset)
 *             for i in range(l):             # <<<<<<<<<<<<<<
 *                 int_array[4 * i] = value[i]
 *         elif uniform_type == 'float[]':
*/
    __pyx_t_2 = __pyx_v_l;
    __pyx_t_12 = __pyx_t_2;
    for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
      __pyx_v_i = __pyx_t_13;

      /* "opengl/modern/uniform_buffer_object.pyx":83
 *             int_array = <GLint*>(self._buffer + offset)
 *             for i in range(l):
 *                 int_array[4 * i] = value[i]             # <<<<<<<<<<<<<<
 *         elif uniform_type == 'float[]':
 *             l = len(value)
*/
      __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_value, __pyx_v_i, size_t, 0, __Pyx_PyLong_FromSize_t, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_11)) __PYX_ERR(29, 83, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_17 = __Pyx_PyLong_As_GLint(__pyx_t_11); if (unlikely((__pyx_t_17 == ((GLint)-1)) && PyErr_Occurred())) __PYX_ERR(29, 83, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      (__pyx_v_int_array[(4 * __pyx_v_i)]) = __pyx_t_17;
    }

    /* "opengl/modern/uniform_buffer_object.pyx":73
 *                     for k in range(4):
 *                         float_array[4 * 4 * i + 4 * j + k] = value[i][j][k]
 *         elif uniform_type == 'int[]':             # <<<<<<<<<<<<<<
 *             l = len(value)
 *             if offset + 16 * l > self._buffer_size:
*/
    goto __pyx_L3;
  }

  /* "opengl/modern/uniform_buffer_object.pyx":84
 *             for i in range(l):
 *                 int_array[4 * i] = value[i]
 *         elif uniform_type == 'float[]':             # <<<<<<<<<<<<<<
 *             l = len(value)
 *             if offset + 16 * l > self._buffer_size:
*/
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_uniform_type, __pyx_mstate_global->__pyx_kp_u_float, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(29, 84, __pyx_L1_error)
  if (likely(__pyx_t_3)) {

    /* "opengl/modern/uniform_buffer_object.pyx":85
 *                 int_array[4 * i] = value[i]
 *         elif uniform_type == 'float[]':
 *             l = len(value)             # <<<<<<<<<<<<<<
 *             if offset + 16 * l > self._buffer_size:
 *                 raise Exception(
*/
    __pyx_t_4 = PyObject_Length(__pyx_v_value); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(29, 85, __pyx_L1_error)
    __pyx_v_l = __pyx_t_4;

    /* "opengl/modern/uniform_buffer_object.pyx":86
 *         elif uniform_type == 'float[]':
 *             l = len(value)
 *             if offset + 16 * l > self._buffer_size:             # <<<<<<<<<<<<<<
 *                 raise Exception(
 *                     ("Data for %s of length %d at offset %d not fitting "
*/
    __pyx_t_3 = ((__pyx_v_offset + (16 * __pyx_v_l)) > __pyx_v_self->_buffer_size);
    if (unlikely(__pyx_t_3)) {

      /* "opengl/modern/uniform_buffer_object.pyx":87
 *             l = len(value)
 *             if offset + 16 * l > self._buffer_size:
 *                 raise Exception(             # <<<<<<<<<<<<<<
 *                     ("Data for %s of length %d at offset %d not fitting "
 *                      "into uniform buffer object of size %d") % (
*/
      __pyx_t_5 = NULL;

      /* "opengl/modern/uniform_buffer_object.pyx":90
 *                     ("Data for %s of length %d at offset %d not fitting "
 *                      "into uniform buffer object of size %d") % (
 *                         name, l, offset, self._buffer_size))             # <<<<<<<<<<<<<<
 * 
 *             float_array = <GLfloat*>(self._buffer + offset)
*/
      __pyx_t_6 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_v_name), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 90, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_9 = __Pyx_PyUnicode_From_size_t(__pyx_v_l, 0, ' ', 'd'); if (unlikely(!__pyx_t_9)) __PYX_ERR(29, 90, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_8 = __Pyx_PyUnicode_From_size_t(__pyx_v_offset, 0, ' ', 'd'); if (unlikely(!__pyx_t_8)) __PYX_ERR(29, 90, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_7 = __Pyx_PyUnicode_From_size_t(__pyx_v_self->_buffer_size, 0, ' ', 'd'); if (unlikely(!__pyx_t_7)) __PYX_ERR(29, 90, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_10[0] = __pyx_mstate_global->__pyx_kp_u_Data_for;
      __pyx_t_10[1] = __pyx_t_6;
      __pyx_t_10[2] = __pyx_mstate_global->__pyx_kp_u_of_length;
      __pyx_t_10[3] = __pyx_t_9;
      __pyx_t_10[4] = __pyx_mstate_global->__pyx_kp_u_at_offset;
      __pyx_t_10[5] = __pyx_t_8;
      __pyx_t_10[6] = __pyx_mstate_global->__pyx_kp_u_not_fitting_into_uniform_buffer;
      __pyx_t_10[7] = __pyx_t_7;

      /* "opengl/modern/uniform_buffer_object.pyx":88
 *             if offset + 16 * l > self._buffer_size:
 *                 raise Exception(
 *                     ("Data for %s of length %d at offset %d not fitting "             # <<<<<<<<<<<<<<
 *                      "into uniform buffer object of size %d") % (
 *                         name, l, offset, self._buffer_size))
*/
      __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_10, 8, 9 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6) + 11 * 2 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8) + 48 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6));
      if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 88, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_2 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_1};
        __pyx_t_11 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_Exception)), __pyx_callargs+__pyx_t_2, (2-__pyx_t_2) | (__pyx_t_2*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (unlikely(!__pyx_t_11)) __PYX_ERR(29, 87, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
      }
      __Pyx_Raise(__pyx_t_11, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __PYX_ERR(29, 87, __pyx_L1_error)

      /* "opengl/modern/uniform_buffer_object.pyx":86
 *         elif uniform_type == 'float[]':
 *             l = len(value)
 *             if offset + 16 * l > self._buffer_size:             # <<<<<<<<<<<<<<
 *                 raise Exception(
 *                     ("Data for %s of length %d at offset %d not fitting "
*/
    }

    /* "opengl/modern/uniform_buffer_object.pyx":92
 *                         name, l, offset, self._buffer_size))
 * 
 *             float_array = <GLfloat*>(self._buffer + offset)             # <<<<<<<<<<<<<<
 *             for i in range(l):
 *                 float_array[4 * i] = value[i]
*/
    __pyx_v_float_array = ((GLfloat *)(__pyx_v_self->_buffer + __pyx_v_offset));

    /* "opengl/modern/uniform_buffer_object.pyx":93
 * 
 *             float_array = <GLfloat*>(self._buffer + offset)
 *             for i in range(l):             # <<<<<<<<<<<<<<
 *                 float_array[4 * i] = value[i]
 *         else:
*/
    __pyx_t_2 = __pyx_v_l;
    __pyx_t_12 = __pyx_t_2;
    for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
      __pyx_v_i = __pyx_t_13;

      /* "opengl/modern/uniform_buffer_object.pyx":94
 *             float_array = <GLfloat*>(self._buffer + offset)
 *             for i in range(l):
 *                 float_array[4 * i] = value[i]             # <<<<<<<<<<<<<<
 *         else:
 *             raise Exception(
*/
      __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_value, __pyx_v_i, size_t, 0, __Pyx_PyLong_FromSize_t, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_11)) __PYX_ERR(29, 94, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_15 = __Pyx_PyFloat_AsFloat(__pyx_t_11); if (unlikely((__pyx_t_15 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(29, 94, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      (__pyx_v_float_array[(4 * __pyx_v_i)]) = __pyx_t_15;
    }

    /* "opengl/modern/uniform_buffer_object.pyx":84
 *             for i in range(l):
 *                 int_array[4 * i] = value[i]
 *         elif uniform_type == 'float[]':             # <<<<<<<<<<<<<<
 *             l = len(value)
 *             if offset + 16 * l > self._buffer_size:
*/
    goto __pyx_L3;
  }

  /* "opengl/modern/uniform_buffer_object.pyx":96
 *                 float_array[4 * i] = value[i]
 *         else:
 *             raise Exception(             # <<<<<<<<<<<<<<
 *                 ("Unsupported uniform type %s for "
 *                  "uniform %s in uniform block") % (
*/
  /*else*/ {
    __pyx_t_1 = NULL;

    /* "opengl/modern/uniform_buffer_object.pyx":99
 *                 ("Unsupported uniform type %s for "
 *                  "uniform %s in uniform block") % (
 *                     uniform_type, name))             # <<<<<<<<<<<<<<
 * 
 *     def commit(self):
*/
    __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_v_uniform_type), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(29, 99, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_v_name), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(29, 99, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_18[0] = __pyx_mstate_global->__pyx_kp_u_Unsupported_uniform_type;
    __pyx_t_18[1] = __pyx_t_5;
    __pyx_t_18[2] = __pyx_mstate_global->__pyx_kp_u_for_uniform;
    __pyx_t_18[3] = __pyx_t_7;
    __pyx_t_18[4] = __pyx_mstate_global->__pyx_kp_u_in_uniform_block;

    /* "opengl/modern/uniform_buffer_object.pyx":97
 *         else:
 *             raise Exception(
 *                 ("Unsupported uniform type %s for "             # <<<<<<<<<<<<<<
 *                  "uniform %s in uniform block") % (
 *                     uniform_type, name))
*/
    __pyx_t_8 = __Pyx_PyUnicode_Join(__pyx_t_18, 5, 25 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5) + 13 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7) + 17, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7));
    if (unlikely(!__pyx_t_8)) __PYX_ERR(29, 97, __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_2 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_8};
      __pyx_t_11 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_Exception)), __pyx_callargs+__pyx_t_2, (2-__pyx_t_2) | (__pyx_t_2*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_11)) __PYX_ERR(29, 96, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
    }
    __Pyx_Raise(__pyx_t_11, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __PYX_ERR(29, 96, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "opengl/modern/uniform_buffer_object.pyx":38
 *         print_gl_errors("UniformBufferObject.__init__")
 * 
 *     def set(self, name, uniform_type, value):             # <<<<<<<<<<<<<<
 *         cdef size_t offset
 *         cdef size_t l
*/

  /* 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_9);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("CyOpenGL.UniformBufferObject.set", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opengl/modern/uniform_buffer_object.pyx":101
 *                     uniform_type, name))
 * 
 *     def commit(self):             # <<<<<<<<<<<<<<
 *         glBindBuffer(GL_UNIFORM_BUFFER, self._uniform_buffer_object)
 *         glBufferData(GL_UNIFORM_BUFFER,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_19UniformBufferObject_5commit(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_19UniformBufferObject_4commit, "UniformBufferObject.commit(self)");
static PyMethodDef __pyx_mdef_8CyOpenGL_19UniformBufferObject_5commit = {"commit", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_19UniformBufferObject_5commit, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_19UniformBufferObject_4commit};
static PyObject *__pyx_pw_8CyOpenGL_19UniformBufferObject_5commit(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("commit (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("commit", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("commit", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8CyOpenGL_19UniformBufferObject_4commit(((struct __pyx_obj_8CyOpenGL_UniformBufferObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_8CyOpenGL_19UniformBufferObject_4commit(struct __pyx_obj_8CyOpenGL_UniformBufferObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("commit", 0);

  /* "opengl/modern/uniform_buffer_object.pyx":102
 * 
 *     def commit(self):
 *         glBindBuffer(GL_UNIFORM_BUFFER, self._uniform_buffer_object)             # <<<<<<<<<<<<<<
 *         glBufferData(GL_UNIFORM_BUFFER,
 *                      <GLsizeiptr>self._buffer_size,
*/
  glBindBuffer(GL_UNIFORM_BUFFER, __pyx_v_self->_uniform_buffer_object);

  /* "opengl/modern/uniform_buffer_object.pyx":103
 *     def commit(self):
 *         glBindBuffer(GL_UNIFORM_BUFFER, self._uniform_buffer_object)
 *         glBufferData(GL_UNIFORM_BUFFER,             # <<<<<<<<<<<<<<
 *                      <GLsizeiptr>self._buffer_size,
 *                      self._buffer,
*/
  glBufferData(GL_UNIFORM_BUFFER, ((GLsizeiptr)__pyx_v_self->_buffer_size), __pyx_v_self->_buffer, GL_STATIC_DRAW);

  /* "opengl/modern/uniform_buffer_object.pyx":101
 *                     uniform_type, name))
 * 
 *     def commit(self):             # <<<<<<<<<<<<<<
 *         glBindBuffer(GL_UNIFORM_BUFFER, self._uniform_buffer_object)
 *         glBufferData(GL_UNIFORM_BUFFER,
*/

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

/* "opengl/modern/uniform_buffer_object.pyx":108
 *                      GL_STATIC_DRAW)
 * 
 *     def bind_block(self, GLuint binding_point):             # <<<<<<<<<<<<<<
 *         glBindBufferBase(GL_UNIFORM_BUFFER,
 *                          binding_point,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_19UniformBufferObject_7bind_block(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_19UniformBufferObject_6bind_block, "UniformBufferObject.bind_block(self, GLuint binding_point)");
static PyMethodDef __pyx_mdef_8CyOpenGL_19UniformBufferObject_7bind_block = {"bind_block", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_19UniformBufferObject_7bind_block, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_19UniformBufferObject_6bind_block};
static PyObject *__pyx_pw_8CyOpenGL_19UniformBufferObject_7bind_block(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  GLuint __pyx_v_binding_point;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("bind_block (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_binding_point,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(29, 108, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(29, 108, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "bind_block", 0) < (0)) __PYX_ERR(29, 108, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("bind_block", 1, 1, 1, i); __PYX_ERR(29, 108, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(29, 108, __pyx_L3_error)
    }
    __pyx_v_binding_point = __Pyx_PyLong_As_GLuint(values[0]); if (unlikely((__pyx_v_binding_point == ((GLuint)-1)) && PyErr_Occurred())) __PYX_ERR(29, 108, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("bind_block", 1, 1, 1, __pyx_nargs); __PYX_ERR(29, 108, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("CyOpenGL.UniformBufferObject.bind_block", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_19UniformBufferObject_6bind_block(((struct __pyx_obj_8CyOpenGL_UniformBufferObject *)__pyx_v_self), __pyx_v_binding_point);

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

static PyObject *__pyx_pf_8CyOpenGL_19UniformBufferObject_6bind_block(struct __pyx_obj_8CyOpenGL_UniformBufferObject *__pyx_v_self, GLuint __pyx_v_binding_point) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("bind_block", 0);

  /* "opengl/modern/uniform_buffer_object.pyx":109
 * 
 *     def bind_block(self, GLuint binding_point):
 *         glBindBufferBase(GL_UNIFORM_BUFFER,             # <<<<<<<<<<<<<<
 *                          binding_point,
 *                          self._uniform_buffer_object)
*/
  glBindBufferBase(GL_UNIFORM_BUFFER, __pyx_v_binding_point, __pyx_v_self->_uniform_buffer_object);

  /* "opengl/modern/uniform_buffer_object.pyx":108
 *                      GL_STATIC_DRAW)
 * 
 *     def bind_block(self, GLuint binding_point):             # <<<<<<<<<<<<<<
 *         glBindBufferBase(GL_UNIFORM_BUFFER,
 *                          binding_point,
*/

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

/* "opengl/modern/uniform_buffer_object.pyx":113
 *                          self._uniform_buffer_object)
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         free(self._buffer)
 *         self._buffer = NULL
*/

/* Python wrapper */
static void __pyx_pw_8CyOpenGL_19UniformBufferObject_9__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_8CyOpenGL_19UniformBufferObject_9__dealloc__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_pf_8CyOpenGL_19UniformBufferObject_8__dealloc__(((struct __pyx_obj_8CyOpenGL_UniformBufferObject *)__pyx_v_self));

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

static void __pyx_pf_8CyOpenGL_19UniformBufferObject_8__dealloc__(struct __pyx_obj_8CyOpenGL_UniformBufferObject *__pyx_v_self) {

  /* "opengl/modern/uniform_buffer_object.pyx":114
 * 
 *     def __dealloc__(self):
 *         free(self._buffer)             # <<<<<<<<<<<<<<
 *         self._buffer = NULL
 * 
*/
  free(__pyx_v_self->_buffer);

  /* "opengl/modern/uniform_buffer_object.pyx":115
 *     def __dealloc__(self):
 *         free(self._buffer)
 *         self._buffer = NULL             # <<<<<<<<<<<<<<
 * 
 *     def delete_resource(self):
*/
  __pyx_v_self->_buffer = NULL;

  /* "opengl/modern/uniform_buffer_object.pyx":113
 *                          self._uniform_buffer_object)
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         free(self._buffer)
 *         self._buffer = NULL
*/

  /* function exit code */
}

/* "opengl/modern/uniform_buffer_object.pyx":117
 *         self._buffer = NULL
 * 
 *     def delete_resource(self):             # <<<<<<<<<<<<<<
 *         glDeleteBuffers(1, &self._uniform_buffer_object)
 *         self._uniform_buffer_object = 0
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_19UniformBufferObject_11delete_resource(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_19UniformBufferObject_10delete_resource, "UniformBufferObject.delete_resource(self)");
static PyMethodDef __pyx_mdef_8CyOpenGL_19UniformBufferObject_11delete_resource = {"delete_resource", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_19UniformBufferObject_11delete_resource, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_19UniformBufferObject_10delete_resource};
static PyObject *__pyx_pw_8CyOpenGL_19UniformBufferObject_11delete_resource(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("delete_resource (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("delete_resource", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("delete_resource", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8CyOpenGL_19UniformBufferObject_10delete_resource(((struct __pyx_obj_8CyOpenGL_UniformBufferObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_8CyOpenGL_19UniformBufferObject_10delete_resource(struct __pyx_obj_8CyOpenGL_UniformBufferObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("delete_resource", 0);

  /* "opengl/modern/uniform_buffer_object.pyx":118
 * 
 *     def delete_resource(self):
 *         glDeleteBuffers(1, &self._uniform_buffer_object)             # <<<<<<<<<<<<<<
 *         self._uniform_buffer_object = 0
*/
  glDeleteBuffers(1, (&__pyx_v_self->_uniform_buffer_object));

  /* "opengl/modern/uniform_buffer_object.pyx":119
 *     def delete_resource(self):
 *         glDeleteBuffers(1, &self._uniform_buffer_object)
 *         self._uniform_buffer_object = 0             # <<<<<<<<<<<<<<
*/
  __pyx_v_self->_uniform_buffer_object = 0;

  /* "opengl/modern/uniform_buffer_object.pyx":117
 *         self._buffer = NULL
 * 
 *     def delete_resource(self):             # <<<<<<<<<<<<<<
 *         glDeleteBuffers(1, &self._uniform_buffer_object)
 *         self._uniform_buffer_object = 0
*/

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

/* "opengl/modern/glsl_program.pyx":1
 * cdef _compile_shader(GLuint shader, name, shader_type):             # <<<<<<<<<<<<<<
 *     """
 *     Compiles given shader and prints compile errors
*/

static PyObject *__pyx_f_8CyOpenGL__compile_shader(GLuint __pyx_v_shader, PyObject *__pyx_v_name, PyObject *__pyx_v_shader_type) {
  GLint __pyx_v_status;
  GLchar *__pyx_v_text;
  GLint __pyx_v_text_len;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7[5];
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_compile_shader", 0);

  /* "opengl/modern/glsl_program.pyx":7
 *     """
 * 
 *     glCompileShader(shader)             # <<<<<<<<<<<<<<
 * 
 *     # The remaining code is just error checking
*/
  glCompileShader(__pyx_v_shader);

  /* "opengl/modern/glsl_program.pyx":11
 *     # The remaining code is just error checking
 * 
 *     cdef GLint status = GL_FALSE             # <<<<<<<<<<<<<<
 *     glGetShaderiv(shader, GL_COMPILE_STATUS, &status)
 * 
*/
  __pyx_v_status = GL_FALSE;

  /* "opengl/modern/glsl_program.pyx":12
 * 
 *     cdef GLint status = GL_FALSE
 *     glGetShaderiv(shader, GL_COMPILE_STATUS, &status)             # <<<<<<<<<<<<<<
 * 
 *     print_gl_errors("glCompileShader")
*/
  glGetShaderiv(__pyx_v_shader, GL_COMPILE_STATUS, (&__pyx_v_status));

  /* "opengl/modern/glsl_program.pyx":14
 *     glGetShaderiv(shader, GL_COMPILE_STATUS, &status)
 * 
 *     print_gl_errors("glCompileShader")             # <<<<<<<<<<<<<<
 * 
 *     if status == GL_TRUE:
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_print_gl_errors); if (unlikely(!__pyx_t_3)) __PYX_ERR(30, 14, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_n_u_glCompileShader};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(30, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/modern/glsl_program.pyx":16
 *     print_gl_errors("glCompileShader")
 * 
 *     if status == GL_TRUE:             # <<<<<<<<<<<<<<
 *         return True
 * 
*/
  __pyx_t_5 = (__pyx_v_status == GL_TRUE);
  if (__pyx_t_5) {

    /* "opengl/modern/glsl_program.pyx":17
 * 
 *     if status == GL_TRUE:
 *         return True             # <<<<<<<<<<<<<<
 * 
 *     print("Compiling %s shader %s failed." % (shader_type, name))
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_True);
    __pyx_r = Py_True;
    goto __pyx_L0;

    /* "opengl/modern/glsl_program.pyx":16
 *     print_gl_errors("glCompileShader")
 * 
 *     if status == GL_TRUE:             # <<<<<<<<<<<<<<
 *         return True
 * 
*/
  }

  /* "opengl/modern/glsl_program.pyx":19
 *         return True
 * 
 *     print("Compiling %s shader %s failed." % (shader_type, name))             # <<<<<<<<<<<<<<
 * 
 *     cdef GLchar * text = NULL
*/
  __pyx_t_3 = NULL;
  __pyx_t_2 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_v_shader_type), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(30, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_v_name), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(30, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7[0] = __pyx_mstate_global->__pyx_kp_u_Compiling;
  __pyx_t_7[1] = __pyx_t_2;
  __pyx_t_7[2] = __pyx_mstate_global->__pyx_kp_u_shader;
  __pyx_t_7[3] = __pyx_t_6;
  __pyx_t_7[4] = __pyx_mstate_global->__pyx_kp_u_failed;
  __pyx_t_8 = __Pyx_PyUnicode_Join(__pyx_t_7, 5, 10 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + 8 * 2 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6));
  if (unlikely(!__pyx_t_8)) __PYX_ERR(30, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_8};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_print, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(30, 19, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/modern/glsl_program.pyx":21
 *     print("Compiling %s shader %s failed." % (shader_type, name))
 * 
 *     cdef GLchar * text = NULL             # <<<<<<<<<<<<<<
 *     cdef GLint text_len
 *     glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &text_len)
*/
  __pyx_v_text = NULL;

  /* "opengl/modern/glsl_program.pyx":23
 *     cdef GLchar * text = NULL
 *     cdef GLint text_len
 *     glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &text_len)             # <<<<<<<<<<<<<<
 *     if text_len > 0:
 *         text = <GLchar *>malloc(text_len)
*/
  glGetShaderiv(__pyx_v_shader, GL_INFO_LOG_LENGTH, (&__pyx_v_text_len));

  /* "opengl/modern/glsl_program.pyx":24
 *     cdef GLint text_len
 *     glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &text_len)
 *     if text_len > 0:             # <<<<<<<<<<<<<<
 *         text = <GLchar *>malloc(text_len)
 *         glGetShaderInfoLog(shader, text_len, NULL, text)
*/
  __pyx_t_5 = (__pyx_v_text_len > 0);
  if (__pyx_t_5) {

    /* "opengl/modern/glsl_program.pyx":25
 *     glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &text_len)
 *     if text_len > 0:
 *         text = <GLchar *>malloc(text_len)             # <<<<<<<<<<<<<<
 *         glGetShaderInfoLog(shader, text_len, NULL, text)
 *         print(text)
*/
    __pyx_v_text = ((GLchar *)malloc(__pyx_v_text_len));

    /* "opengl/modern/glsl_program.pyx":26
 *     if text_len > 0:
 *         text = <GLchar *>malloc(text_len)
 *         glGetShaderInfoLog(shader, text_len, NULL, text)             # <<<<<<<<<<<<<<
 *         print(text)
 *         free(text)
*/
    glGetShaderInfoLog(__pyx_v_shader, __pyx_v_text_len, NULL, __pyx_v_text);

    /* "opengl/modern/glsl_program.pyx":27
 *         text = <GLchar *>malloc(text_len)
 *         glGetShaderInfoLog(shader, text_len, NULL, text)
 *         print(text)             # <<<<<<<<<<<<<<
 *         free(text)
 * 
*/
    __pyx_t_8 = NULL;
    __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_text); if (unlikely(!__pyx_t_3)) __PYX_ERR(30, 27, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_3};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_print, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(30, 27, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "opengl/modern/glsl_program.pyx":28
 *         glGetShaderInfoLog(shader, text_len, NULL, text)
 *         print(text)
 *         free(text)             # <<<<<<<<<<<<<<
 * 
 *     return False
*/
    free(__pyx_v_text);

    /* "opengl/modern/glsl_program.pyx":24
 *     cdef GLint text_len
 *     glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &text_len)
 *     if text_len > 0:             # <<<<<<<<<<<<<<
 *         text = <GLchar *>malloc(text_len)
 *         glGetShaderInfoLog(shader, text_len, NULL, text)
*/
  }

  /* "opengl/modern/glsl_program.pyx":30
 *         free(text)
 * 
 *     return False             # <<<<<<<<<<<<<<
 * 
 * cdef _link_program(GLuint program, name):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(Py_False);
  __pyx_r = Py_False;
  goto __pyx_L0;

  /* "opengl/modern/glsl_program.pyx":1
 * cdef _compile_shader(GLuint shader, name, shader_type):             # <<<<<<<<<<<<<<
 *     """
 *     Compiles given shader and prints compile errors
*/

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

/* "opengl/modern/glsl_program.pyx":32
 *     return False
 * 
 * cdef _link_program(GLuint program, name):             # <<<<<<<<<<<<<<
 *     """
 *     Links given program and prints linking errors
*/

static PyObject *__pyx_f_8CyOpenGL__link_program(GLuint __pyx_v_program, PyObject *__pyx_v_name) {
  GLint __pyx_v_status;
  GLchar *__pyx_v_text;
  GLint __pyx_v_text_len;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_link_program", 0);

  /* "opengl/modern/glsl_program.pyx":38
 *     """
 * 
 *     glLinkProgram(program)             # <<<<<<<<<<<<<<
 * 
 *     print_gl_errors("glLinkProgram")
*/
  glLinkProgram(__pyx_v_program);

  /* "opengl/modern/glsl_program.pyx":40
 *     glLinkProgram(program)
 * 
 *     print_gl_errors("glLinkProgram")             # <<<<<<<<<<<<<<
 * 
 *     # The remaining code is just for error checking
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_print_gl_errors); if (unlikely(!__pyx_t_3)) __PYX_ERR(30, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_n_u_glLinkProgram};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(30, 40, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/modern/glsl_program.pyx":44
 *     # The remaining code is just for error checking
 * 
 *     cdef GLint status = GL_FALSE             # <<<<<<<<<<<<<<
 *     glGetProgramiv(program, GL_LINK_STATUS, &status)
 * 
*/
  __pyx_v_status = GL_FALSE;

  /* "opengl/modern/glsl_program.pyx":45
 * 
 *     cdef GLint status = GL_FALSE
 *     glGetProgramiv(program, GL_LINK_STATUS, &status)             # <<<<<<<<<<<<<<
 * 
 *     if status == GL_TRUE:
*/
  glGetProgramiv(__pyx_v_program, GL_LINK_STATUS, (&__pyx_v_status));

  /* "opengl/modern/glsl_program.pyx":47
 *     glGetProgramiv(program, GL_LINK_STATUS, &status)
 * 
 *     if status == GL_TRUE:             # <<<<<<<<<<<<<<
 *         return True
 * 
*/
  __pyx_t_5 = (__pyx_v_status == GL_TRUE);
  if (__pyx_t_5) {

    /* "opengl/modern/glsl_program.pyx":48
 * 
 *     if status == GL_TRUE:
 *         return True             # <<<<<<<<<<<<<<
 * 
 *     print("Linking GLSL program '%s' failed." % name)
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_True);
    __pyx_r = Py_True;
    goto __pyx_L0;

    /* "opengl/modern/glsl_program.pyx":47
 *     glGetProgramiv(program, GL_LINK_STATUS, &status)
 * 
 *     if status == GL_TRUE:             # <<<<<<<<<<<<<<
 *         return True
 * 
*/
  }

  /* "opengl/modern/glsl_program.pyx":50
 *         return True
 * 
 *     print("Linking GLSL program '%s' failed." % name)             # <<<<<<<<<<<<<<
 * 
 *     cdef GLchar * text = NULL
*/
  __pyx_t_3 = NULL;
  __pyx_t_2 = __Pyx_PyUnicode_FormatSafe(__pyx_mstate_global->__pyx_kp_u_Linking_GLSL_program_s_failed, __pyx_v_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(30, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_2};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_print, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(30, 50, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/modern/glsl_program.pyx":52
 *     print("Linking GLSL program '%s' failed." % name)
 * 
 *     cdef GLchar * text = NULL             # <<<<<<<<<<<<<<
 *     cdef GLint text_len
 *     glGetProgramiv(program, GL_INFO_LOG_LENGTH, &text_len)
*/
  __pyx_v_text = NULL;

  /* "opengl/modern/glsl_program.pyx":54
 *     cdef GLchar * text = NULL
 *     cdef GLint text_len
 *     glGetProgramiv(program, GL_INFO_LOG_LENGTH, &text_len)             # <<<<<<<<<<<<<<
 *     if text_len > 0:
 *         text = <GLchar *>malloc(text_len)
*/
  glGetProgramiv(__pyx_v_program, GL_INFO_LOG_LENGTH, (&__pyx_v_text_len));

  /* "opengl/modern/glsl_program.pyx":55
 *     cdef GLint text_len
 *     glGetProgramiv(program, GL_INFO_LOG_LENGTH, &text_len)
 *     if text_len > 0:             # <<<<<<<<<<<<<<
 *         text = <GLchar *>malloc(text_len)
 *         glGetProgramInfoLog(program, text_len, NULL, text)
*/
  __pyx_t_5 = (__pyx_v_text_len > 0);
  if (__pyx_t_5) {

    /* "opengl/modern/glsl_program.pyx":56
 *     glGetProgramiv(program, GL_INFO_LOG_LENGTH, &text_len)
 *     if text_len > 0:
 *         text = <GLchar *>malloc(text_len)             # <<<<<<<<<<<<<<
 *         glGetProgramInfoLog(program, text_len, NULL, text)
 *         print(text)
*/
    __pyx_v_text = ((GLchar *)malloc(__pyx_v_text_len));

    /* "opengl/modern/glsl_program.pyx":57
 *     if text_len > 0:
 *         text = <GLchar *>malloc(text_len)
 *         glGetProgramInfoLog(program, text_len, NULL, text)             # <<<<<<<<<<<<<<
 *         print(text)
 *         free(text)
*/
    glGetProgramInfoLog(__pyx_v_program, __pyx_v_text_len, NULL, __pyx_v_text);

    /* "opengl/modern/glsl_program.pyx":58
 *         text = <GLchar *>malloc(text_len)
 *         glGetProgramInfoLog(program, text_len, NULL, text)
 *         print(text)             # <<<<<<<<<<<<<<
 *         free(text)
 * 
*/
    __pyx_t_2 = NULL;
    __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_text); if (unlikely(!__pyx_t_3)) __PYX_ERR(30, 58, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_print, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(30, 58, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "opengl/modern/glsl_program.pyx":59
 *         glGetProgramInfoLog(program, text_len, NULL, text)
 *         print(text)
 *         free(text)             # <<<<<<<<<<<<<<
 * 
 *     return False
*/
    free(__pyx_v_text);

    /* "opengl/modern/glsl_program.pyx":55
 *     cdef GLint text_len
 *     glGetProgramiv(program, GL_INFO_LOG_LENGTH, &text_len)
 *     if text_len > 0:             # <<<<<<<<<<<<<<
 *         text = <GLchar *>malloc(text_len)
 *         glGetProgramInfoLog(program, text_len, NULL, text)
*/
  }

  /* "opengl/modern/glsl_program.pyx":61
 *         free(text)
 * 
 *     return False             # <<<<<<<<<<<<<<
 * 
 * cdef class GLSLProgram:
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(Py_False);
  __pyx_r = Py_False;
  goto __pyx_L0;

  /* "opengl/modern/glsl_program.pyx":32
 *     return False
 * 
 * cdef _link_program(GLuint program, name):             # <<<<<<<<<<<<<<
 *     """
 *     Links given program and prints linking errors
*/

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

/* "opengl/modern/glsl_program.pyx":81
 *     cdef _name_to_uniform_block
 * 
 *     def __init__(self, vertex_shader_source, fragment_shader_source,             # <<<<<<<<<<<<<<
 *                  uniform_block_names_sizes_and_offsets = [],
 *                  name = "unnamed"):
*/

/* Python wrapper */
static int __pyx_pw_8CyOpenGL_11GLSLProgram_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_8CyOpenGL_11GLSLProgram_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_vertex_shader_source = 0;
  PyObject *__pyx_v_fragment_shader_source = 0;
  PyObject *__pyx_v_uniform_block_names_sizes_and_offsets = 0;
  PyObject *__pyx_v_name = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[4] = {0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_vertex_shader_source,&__pyx_mstate_global->__pyx_n_u_fragment_shader_source,&__pyx_mstate_global->__pyx_n_u_uniform_block_names_sizes_and_of,&__pyx_mstate_global->__pyx_n_u_name,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(30, 81, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_VARARGS(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(30, 81, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(30, 81, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(30, 81, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(30, 81, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(30, 81, __pyx_L3_error)
      if (!values[2]) values[2] = __Pyx_NewRef(__pyx_mstate_global->__pyx_k__15);
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_unnamed));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, i); __PYX_ERR(30, 81, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_VARARGS(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(30, 81, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(30, 81, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(30, 81, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(30, 81, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef(__pyx_mstate_global->__pyx_k__15);
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_unnamed));
    }
    __pyx_v_vertex_shader_source = values[0];
    __pyx_v_fragment_shader_source = values[1];
    __pyx_v_uniform_block_names_sizes_and_offsets = values[2];
    __pyx_v_name = values[3];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, __pyx_nargs); __PYX_ERR(30, 81, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("CyOpenGL.GLSLProgram.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_11GLSLProgram___init__(((struct __pyx_obj_8CyOpenGL_GLSLProgram *)__pyx_v_self), __pyx_v_vertex_shader_source, __pyx_v_fragment_shader_source, __pyx_v_uniform_block_names_sizes_and_offsets, __pyx_v_name);

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

static int __pyx_pf_8CyOpenGL_11GLSLProgram___init__(struct __pyx_obj_8CyOpenGL_GLSLProgram *__pyx_v_self, PyObject *__pyx_v_vertex_shader_source, PyObject *__pyx_v_fragment_shader_source, PyObject *__pyx_v_uniform_block_names_sizes_and_offsets, PyObject *__pyx_v_name) {
  GLchar const *__pyx_v_c_vertex_shader_source;
  GLchar const *__pyx_v_c_fragment_shader_source;
  PyObject *__pyx_v_block_name = NULL;
  PyObject *__pyx_v_block_size = NULL;
  PyObject *__pyx_v_offsets = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  GLchar const *__pyx_t_2;
  GLchar const *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *(*__pyx_t_13)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "opengl/modern/glsl_program.pyx":84
 *                  uniform_block_names_sizes_and_offsets = [],
 *                  name = "unnamed"):
 *         self._name_to_uniform_block = {}             # <<<<<<<<<<<<<<
 * 
 *         cdef const GLchar* c_vertex_shader_source = vertex_shader_source
*/
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(30, 84, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->_name_to_uniform_block);
  __Pyx_DECREF(__pyx_v_self->_name_to_uniform_block);
  __pyx_v_self->_name_to_uniform_block = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "opengl/modern/glsl_program.pyx":86
 *         self._name_to_uniform_block = {}
 * 
 *         cdef const GLchar* c_vertex_shader_source = vertex_shader_source             # <<<<<<<<<<<<<<
 *         cdef const GLchar* c_fragment_shader_source = fragment_shader_source
 * 
*/
  __pyx_t_2 = __Pyx_PyObject_AsString(__pyx_v_vertex_shader_source); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(30, 86, __pyx_L1_error)
  __pyx_v_c_vertex_shader_source = __pyx_t_2;

  /* "opengl/modern/glsl_program.pyx":87
 * 
 *         cdef const GLchar* c_vertex_shader_source = vertex_shader_source
 *         cdef const GLchar* c_fragment_shader_source = fragment_shader_source             # <<<<<<<<<<<<<<
 * 
 *         clear_gl_errors()
*/
  __pyx_t_3 = __Pyx_PyObject_AsString(__pyx_v_fragment_shader_source); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(30, 87, __pyx_L1_error)
  __pyx_v_c_fragment_shader_source = __pyx_t_3;

  /* "opengl/modern/glsl_program.pyx":89
 *         cdef const GLchar* c_fragment_shader_source = fragment_shader_source
 * 
 *         clear_gl_errors()             # <<<<<<<<<<<<<<
 * 
 *         self._vertex_shader = glCreateShader(GL_VERTEX_SHADER)
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_clear_gl_errors); if (unlikely(!__pyx_t_5)) __PYX_ERR(30, 89, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_6 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(30, 89, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/modern/glsl_program.pyx":91
 *         clear_gl_errors()
 * 
 *         self._vertex_shader = glCreateShader(GL_VERTEX_SHADER)             # <<<<<<<<<<<<<<
 *         self._fragment_shader = glCreateShader(GL_FRAGMENT_SHADER)
 *         self._glsl_program = glCreateProgram()
*/
  __pyx_v_self->_vertex_shader = glCreateShader(GL_VERTEX_SHADER);

  /* "opengl/modern/glsl_program.pyx":92
 * 
 *         self._vertex_shader = glCreateShader(GL_VERTEX_SHADER)
 *         self._fragment_shader = glCreateShader(GL_FRAGMENT_SHADER)             # <<<<<<<<<<<<<<
 *         self._glsl_program = glCreateProgram()
 *         glShaderSource(self._vertex_shader,
*/
  __pyx_v_self->_fragment_shader = glCreateShader(GL_FRAGMENT_SHADER);

  /* "opengl/modern/glsl_program.pyx":93
 *         self._vertex_shader = glCreateShader(GL_VERTEX_SHADER)
 *         self._fragment_shader = glCreateShader(GL_FRAGMENT_SHADER)
 *         self._glsl_program = glCreateProgram()             # <<<<<<<<<<<<<<
 *         glShaderSource(self._vertex_shader,
 *                        1, &c_vertex_shader_source, NULL)
*/
  __pyx_v_self->_glsl_program = glCreateProgram();

  /* "opengl/modern/glsl_program.pyx":94
 *         self._fragment_shader = glCreateShader(GL_FRAGMENT_SHADER)
 *         self._glsl_program = glCreateProgram()
 *         glShaderSource(self._vertex_shader,             # <<<<<<<<<<<<<<
 *                        1, &c_vertex_shader_source, NULL)
 *         glShaderSource(self._fragment_shader,
*/
  glShaderSource(__pyx_v_self->_vertex_shader, 1, (&__pyx_v_c_vertex_shader_source), NULL);

  /* "opengl/modern/glsl_program.pyx":96
 *         glShaderSource(self._vertex_shader,
 *                        1, &c_vertex_shader_source, NULL)
 *         glShaderSource(self._fragment_shader,             # <<<<<<<<<<<<<<
 *                        1, &c_fragment_shader_source, NULL)
 *         self._is_valid = self._compile_and_link(name)
*/
  glShaderSource(__pyx_v_self->_fragment_shader, 1, (&__pyx_v_c_fragment_shader_source), NULL);

  /* "opengl/modern/glsl_program.pyx":98
 *         glShaderSource(self._fragment_shader,
 *                        1, &c_fragment_shader_source, NULL)
 *         self._is_valid = self._compile_and_link(name)             # <<<<<<<<<<<<<<
 * 
 *         if self._is_valid:
*/
  __pyx_t_5 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_name};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_compile_and_link, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(30, 98, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(30, 98, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_self->_is_valid = __pyx_t_7;

  /* "opengl/modern/glsl_program.pyx":100
 *         self._is_valid = self._compile_and_link(name)
 * 
 *         if self._is_valid:             # <<<<<<<<<<<<<<
 *             for block_name, block_size, offsets in (
 *                             uniform_block_names_sizes_and_offsets):
*/
  if (__pyx_v_self->_is_valid) {

    /* "opengl/modern/glsl_program.pyx":101
 * 
 *         if self._is_valid:
 *             for block_name, block_size, offsets in (             # <<<<<<<<<<<<<<
 *                             uniform_block_names_sizes_and_offsets):
 *                 self._name_to_uniform_block[block_name] = (
*/
    if (likely(PyList_CheckExact(__pyx_v_uniform_block_names_sizes_and_offsets)) || PyTuple_CheckExact(__pyx_v_uniform_block_names_sizes_and_offsets)) {
      __pyx_t_1 = __pyx_v_uniform_block_names_sizes_and_offsets; __Pyx_INCREF(__pyx_t_1);
      __pyx_t_8 = 0;
      __pyx_t_9 = NULL;
    } else {
      __pyx_t_8 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_uniform_block_names_sizes_and_offsets); if (unlikely(!__pyx_t_1)) __PYX_ERR(30, 101, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(30, 101, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_9)) {
        if (likely(PyList_CheckExact(__pyx_t_1))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(30, 101, __pyx_L1_error)
            #endif
            if (__pyx_t_8 >= __pyx_temp) break;
          }
          __pyx_t_5 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_8, __Pyx_ReferenceSharing_OwnStrongReference);
          ++__pyx_t_8;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(30, 101, __pyx_L1_error)
            #endif
            if (__pyx_t_8 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_5 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_8));
          #else
          __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_8);
          #endif
          ++__pyx_t_8;
        }
        if (unlikely(!__pyx_t_5)) __PYX_ERR(30, 101, __pyx_L1_error)
      } else {
        __pyx_t_5 = __pyx_t_9(__pyx_t_1);
        if (unlikely(!__pyx_t_5)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(30, 101, __pyx_L1_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_5);
      if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
        PyObject* sequence = __pyx_t_5;
        Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
        if (unlikely(size != 3)) {
          if (size > 3) __Pyx_RaiseTooManyValuesError(3);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          __PYX_ERR(30, 101, __pyx_L1_error)
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
          __Pyx_INCREF(__pyx_t_4);
          __pyx_t_10 = PyTuple_GET_ITEM(sequence, 1);
          __Pyx_INCREF(__pyx_t_10);
          __pyx_t_11 = PyTuple_GET_ITEM(sequence, 2);
          __Pyx_INCREF(__pyx_t_11);
        } else {
          __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
          if (unlikely(!__pyx_t_4)) __PYX_ERR(30, 101, __pyx_L1_error)
          __Pyx_XGOTREF(__pyx_t_4);
          __pyx_t_10 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
          if (unlikely(!__pyx_t_10)) __PYX_ERR(30, 101, __pyx_L1_error)
          __Pyx_XGOTREF(__pyx_t_10);
          __pyx_t_11 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
          if (unlikely(!__pyx_t_11)) __PYX_ERR(30, 101, __pyx_L1_error)
          __Pyx_XGOTREF(__pyx_t_11);
        }
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(30, 101, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_10 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(30, 101, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_11 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_11)) __PYX_ERR(30, 101, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        #endif
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_12 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_12)) __PYX_ERR(30, 101, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_13 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_12);
        index = 0; __pyx_t_4 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_4)) goto __pyx_L6_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_4);
        index = 1; __pyx_t_10 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_10)) goto __pyx_L6_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_10);
        index = 2; __pyx_t_11 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_11)) goto __pyx_L6_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_11);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 3) < (0)) __PYX_ERR(30, 101, __pyx_L1_error)
        __pyx_t_13 = NULL;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        goto __pyx_L7_unpacking_done;
        __pyx_L6_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_13 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        __PYX_ERR(30, 101, __pyx_L1_error)
        __pyx_L7_unpacking_done:;
      }
      __Pyx_XDECREF_SET(__pyx_v_block_name, __pyx_t_4);
      __pyx_t_4 = 0;
      __Pyx_XDECREF_SET(__pyx_v_block_size, __pyx_t_10);
      __pyx_t_10 = 0;
      __Pyx_XDECREF_SET(__pyx_v_offsets, __pyx_t_11);
      __pyx_t_11 = 0;

      /* "opengl/modern/glsl_program.pyx":104
 *                             uniform_block_names_sizes_and_offsets):
 *                 self._name_to_uniform_block[block_name] = (
 *                     UniformBufferObject(block_size, offsets))             # <<<<<<<<<<<<<<
 * 
 *         print_gl_errors("GLSLProgram.__init__")
*/
      __pyx_t_11 = NULL;
      __pyx_t_6 = 1;
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_11, __pyx_v_block_size, __pyx_v_offsets};
        __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8CyOpenGL_UniformBufferObject, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        if (unlikely(!__pyx_t_5)) __PYX_ERR(30, 104, __pyx_L1_error)
        __Pyx_GOTREF((PyObject *)__pyx_t_5);
      }

      /* "opengl/modern/glsl_program.pyx":103
 *             for block_name, block_size, offsets in (
 *                             uniform_block_names_sizes_and_offsets):
 *                 self._name_to_uniform_block[block_name] = (             # <<<<<<<<<<<<<<
 *                     UniformBufferObject(block_size, offsets))
 * 
*/
      if (unlikely((PyObject_SetItem(__pyx_v_self->_name_to_uniform_block, __pyx_v_block_name, ((PyObject *)__pyx_t_5)) < 0))) __PYX_ERR(30, 103, __pyx_L1_error)
      __Pyx_DECREF((PyObject *)__pyx_t_5); __pyx_t_5 = 0;

      /* "opengl/modern/glsl_program.pyx":101
 * 
 *         if self._is_valid:
 *             for block_name, block_size, offsets in (             # <<<<<<<<<<<<<<
 *                             uniform_block_names_sizes_and_offsets):
 *                 self._name_to_uniform_block[block_name] = (
*/
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "opengl/modern/glsl_program.pyx":100
 *         self._is_valid = self._compile_and_link(name)
 * 
 *         if self._is_valid:             # <<<<<<<<<<<<<<
 *             for block_name, block_size, offsets in (
 *                             uniform_block_names_sizes_and_offsets):
*/
  }

  /* "opengl/modern/glsl_program.pyx":106
 *                     UniformBufferObject(block_size, offsets))
 * 
 *         print_gl_errors("GLSLProgram.__init__")             # <<<<<<<<<<<<<<
 * 
 *         if not self._is_valid:
*/
  __pyx_t_5 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_print_gl_errors); if (unlikely(!__pyx_t_11)) __PYX_ERR(30, 106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_6 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_11))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_11);
    assert(__pyx_t_5);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_11);
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_11, __pyx__function);
    __pyx_t_6 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_GLSLProgram___init};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_11, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(30, 106, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/modern/glsl_program.pyx":108
 *         print_gl_errors("GLSLProgram.__init__")
 * 
 *         if not self._is_valid:             # <<<<<<<<<<<<<<
 *             # Only one client so far, so we can give a very concrete
 *             # error message about what is most likely going on.
*/
  __pyx_t_7 = (!__pyx_v_self->_is_valid);
  if (__pyx_t_7) {

    /* "opengl/modern/glsl_program.pyx":111
 *             # Only one client so far, so we can give a very concrete
 *             # error message about what is most likely going on.
 *             print("Most likely causes:")             # <<<<<<<<<<<<<<
 *             print(" * The triangulation has too many tetrahedra")
 *             print("   (given the number of uniforms your graphics card supports).")
*/
    __pyx_t_11 = NULL;
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_mstate_global->__pyx_kp_u_Most_likely_causes};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_print, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(30, 111, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "opengl/modern/glsl_program.pyx":112
 *             # error message about what is most likely going on.
 *             print("Most likely causes:")
 *             print(" * The triangulation has too many tetrahedra")             # <<<<<<<<<<<<<<
 *             print("   (given the number of uniforms your graphics card supports).")
 *             print(" * Your graphics card does not support the required OpenGL version.")
*/
    __pyx_t_11 = NULL;
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_mstate_global->__pyx_kp_u_The_triangulation_has_too_many};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_print, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(30, 112, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "opengl/modern/glsl_program.pyx":113
 *             print("Most likely causes:")
 *             print(" * The triangulation has too many tetrahedra")
 *             print("   (given the number of uniforms your graphics card supports).")             # <<<<<<<<<<<<<<
 *             print(" * Your graphics card does not support the required OpenGL version.")
 *             print("   Required version      Your version")
*/
    __pyx_t_11 = NULL;
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_mstate_global->__pyx_kp_u_given_the_number_of_uniforms_yo};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_print, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(30, 113, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "opengl/modern/glsl_program.pyx":114
 *             print(" * The triangulation has too many tetrahedra")
 *             print("   (given the number of uniforms your graphics card supports).")
 *             print(" * Your graphics card does not support the required OpenGL version.")             # <<<<<<<<<<<<<<
 *             print("   Required version      Your version")
 *             print("   OpenGL:  3.2             %s" % get_gl_string('GL_VERSION'))
*/
    __pyx_t_11 = NULL;
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_mstate_global->__pyx_kp_u_Your_graphics_card_does_not_sup};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_print, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(30, 114, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "opengl/modern/glsl_program.pyx":115
 *             print("   (given the number of uniforms your graphics card supports).")
 *             print(" * Your graphics card does not support the required OpenGL version.")
 *             print("   Required version      Your version")             # <<<<<<<<<<<<<<
 *             print("   OpenGL:  3.2             %s" % get_gl_string('GL_VERSION'))
 *             print("     GLSL:  1.50            %s" % get_gl_string('GL_SHADING_LANGUAGE_VERSION'))
*/
    __pyx_t_11 = NULL;
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_mstate_global->__pyx_kp_u_Required_version_Your_version};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_print, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(30, 115, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "opengl/modern/glsl_program.pyx":116
 *             print(" * Your graphics card does not support the required OpenGL version.")
 *             print("   Required version      Your version")
 *             print("   OpenGL:  3.2             %s" % get_gl_string('GL_VERSION'))             # <<<<<<<<<<<<<<
 *             print("     GLSL:  1.50            %s" % get_gl_string('GL_SHADING_LANGUAGE_VERSION'))
 * 
*/
    __pyx_t_11 = NULL;
    __pyx_t_10 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_get_gl_string); if (unlikely(!__pyx_t_4)) __PYX_ERR(30, 116, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_10);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_10);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_mstate_global->__pyx_n_u_GL_VERSION};
      __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(30, 116, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __pyx_t_4 = __Pyx_PyUnicode_FormatSafe(__pyx_mstate_global->__pyx_kp_u_OpenGL_3_2_s, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(30, 116, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_t_4};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_print, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(30, 116, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "opengl/modern/glsl_program.pyx":117
 *             print("   Required version      Your version")
 *             print("   OpenGL:  3.2             %s" % get_gl_string('GL_VERSION'))
 *             print("     GLSL:  1.50            %s" % get_gl_string('GL_SHADING_LANGUAGE_VERSION'))             # <<<<<<<<<<<<<<
 * 
 *             if False:
*/
    __pyx_t_4 = NULL;
    __pyx_t_5 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_get_gl_string); if (unlikely(!__pyx_t_10)) __PYX_ERR(30, 117, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_10))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_10);
      assert(__pyx_t_5);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_10, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_n_u_GL_SHADING_LANGUAGE_VERSION};
      __pyx_t_11 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_10, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_11)) __PYX_ERR(30, 117, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
    }
    __pyx_t_10 = __Pyx_PyUnicode_FormatSafe(__pyx_mstate_global->__pyx_kp_u_GLSL_1_50_s, __pyx_t_11); if (unlikely(!__pyx_t_10)) __PYX_ERR(30, 117, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_10};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_print, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(30, 117, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "opengl/modern/glsl_program.pyx":108
 *         print_gl_errors("GLSLProgram.__init__")
 * 
 *         if not self._is_valid:             # <<<<<<<<<<<<<<
 *             # Only one client so far, so we can give a very concrete
 *             # error message about what is most likely going on.
*/
  }

  /* "opengl/modern/glsl_program.pyx":81
 *     cdef _name_to_uniform_block
 * 
 *     def __init__(self, vertex_shader_source, fragment_shader_source,             # <<<<<<<<<<<<<<
 *                  uniform_block_names_sizes_and_offsets = [],
 *                  name = "unnamed"):
*/

  /* 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_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("CyOpenGL.GLSLProgram.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_block_name);
  __Pyx_XDECREF(__pyx_v_block_size);
  __Pyx_XDECREF(__pyx_v_offsets);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opengl/modern/glsl_program.pyx":123
 *                    open('/tmp/fragment.glsl', 'wb').write(fragment_shader_source)
 * 
 *     def _compile_and_link(self, name):             # <<<<<<<<<<<<<<
 *         if not _compile_shader(self._vertex_shader, name, 'vertex'):
 *             return False
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_11GLSLProgram_3_compile_and_link(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_11GLSLProgram_2_compile_and_link, "GLSLProgram._compile_and_link(self, name)");
static PyMethodDef __pyx_mdef_8CyOpenGL_11GLSLProgram_3_compile_and_link = {"_compile_and_link", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_11GLSLProgram_3_compile_and_link, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_11GLSLProgram_2_compile_and_link};
static PyObject *__pyx_pw_8CyOpenGL_11GLSLProgram_3_compile_and_link(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_name = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_compile_and_link (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_name,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(30, 123, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(30, 123, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_compile_and_link", 0) < (0)) __PYX_ERR(30, 123, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_compile_and_link", 1, 1, 1, i); __PYX_ERR(30, 123, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(30, 123, __pyx_L3_error)
    }
    __pyx_v_name = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_compile_and_link", 1, 1, 1, __pyx_nargs); __PYX_ERR(30, 123, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("CyOpenGL.GLSLProgram._compile_and_link", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_11GLSLProgram_2_compile_and_link(((struct __pyx_obj_8CyOpenGL_GLSLProgram *)__pyx_v_self), __pyx_v_name);

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

static PyObject *__pyx_pf_8CyOpenGL_11GLSLProgram_2_compile_and_link(struct __pyx_obj_8CyOpenGL_GLSLProgram *__pyx_v_self, PyObject *__pyx_v_name) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_compile_and_link", 0);

  /* "opengl/modern/glsl_program.pyx":124
 * 
 *     def _compile_and_link(self, name):
 *         if not _compile_shader(self._vertex_shader, name, 'vertex'):             # <<<<<<<<<<<<<<
 *             return False
 * 
*/
  __pyx_t_1 = __pyx_f_8CyOpenGL__compile_shader(__pyx_v_self->_vertex_shader, __pyx_v_name, __pyx_mstate_global->__pyx_n_u_vertex); if (unlikely(!__pyx_t_1)) __PYX_ERR(30, 124, __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(30, 124, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (!__pyx_t_2);
  if (__pyx_t_3) {

    /* "opengl/modern/glsl_program.pyx":125
 *     def _compile_and_link(self, name):
 *         if not _compile_shader(self._vertex_shader, name, 'vertex'):
 *             return False             # <<<<<<<<<<<<<<
 * 
 *         if not _compile_shader(self._fragment_shader, name, 'fragment'):
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;

    /* "opengl/modern/glsl_program.pyx":124
 * 
 *     def _compile_and_link(self, name):
 *         if not _compile_shader(self._vertex_shader, name, 'vertex'):             # <<<<<<<<<<<<<<
 *             return False
 * 
*/
  }

  /* "opengl/modern/glsl_program.pyx":127
 *             return False
 * 
 *         if not _compile_shader(self._fragment_shader, name, 'fragment'):             # <<<<<<<<<<<<<<
 *             return False
 * 
*/
  __pyx_t_1 = __pyx_f_8CyOpenGL__compile_shader(__pyx_v_self->_fragment_shader, __pyx_v_name, __pyx_mstate_global->__pyx_n_u_fragment); if (unlikely(!__pyx_t_1)) __PYX_ERR(30, 127, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(30, 127, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_2 = (!__pyx_t_3);
  if (__pyx_t_2) {

    /* "opengl/modern/glsl_program.pyx":128
 * 
 *         if not _compile_shader(self._fragment_shader, name, 'fragment'):
 *             return False             # <<<<<<<<<<<<<<
 * 
 *         glAttachShader(self._glsl_program, self._vertex_shader)
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;

    /* "opengl/modern/glsl_program.pyx":127
 *             return False
 * 
 *         if not _compile_shader(self._fragment_shader, name, 'fragment'):             # <<<<<<<<<<<<<<
 *             return False
 * 
*/
  }

  /* "opengl/modern/glsl_program.pyx":130
 *             return False
 * 
 *         glAttachShader(self._glsl_program, self._vertex_shader)             # <<<<<<<<<<<<<<
 *         glAttachShader(self._glsl_program, self._fragment_shader)
 * 
*/
  glAttachShader(__pyx_v_self->_glsl_program, __pyx_v_self->_vertex_shader);

  /* "opengl/modern/glsl_program.pyx":131
 * 
 *         glAttachShader(self._glsl_program, self._vertex_shader)
 *         glAttachShader(self._glsl_program, self._fragment_shader)             # <<<<<<<<<<<<<<
 * 
 *         if not _link_program(self._glsl_program, name):
*/
  glAttachShader(__pyx_v_self->_glsl_program, __pyx_v_self->_fragment_shader);

  /* "opengl/modern/glsl_program.pyx":133
 *         glAttachShader(self._glsl_program, self._fragment_shader)
 * 
 *         if not _link_program(self._glsl_program, name):             # <<<<<<<<<<<<<<
 *             return False
 * 
*/
  __pyx_t_1 = __pyx_f_8CyOpenGL__link_program(__pyx_v_self->_glsl_program, __pyx_v_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(30, 133, __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(30, 133, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (!__pyx_t_2);
  if (__pyx_t_3) {

    /* "opengl/modern/glsl_program.pyx":134
 * 
 *         if not _link_program(self._glsl_program, name):
 *             return False             # <<<<<<<<<<<<<<
 * 
 *         return True
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;

    /* "opengl/modern/glsl_program.pyx":133
 *         glAttachShader(self._glsl_program, self._fragment_shader)
 * 
 *         if not _link_program(self._glsl_program, name):             # <<<<<<<<<<<<<<
 *             return False
 * 
*/
  }

  /* "opengl/modern/glsl_program.pyx":136
 *             return False
 * 
 *         return True             # <<<<<<<<<<<<<<
 * 
 *     def is_valid(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(Py_True);
  __pyx_r = Py_True;
  goto __pyx_L0;

  /* "opengl/modern/glsl_program.pyx":123
 *                    open('/tmp/fragment.glsl', 'wb').write(fragment_shader_source)
 * 
 *     def _compile_and_link(self, name):             # <<<<<<<<<<<<<<
 *         if not _compile_shader(self._vertex_shader, name, 'vertex'):
 *             return False
*/

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

/* "opengl/modern/glsl_program.pyx":138
 *         return True
 * 
 *     def is_valid(self):             # <<<<<<<<<<<<<<
 *         return self._is_valid
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_11GLSLProgram_5is_valid(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_11GLSLProgram_4is_valid, "GLSLProgram.is_valid(self)");
static PyMethodDef __pyx_mdef_8CyOpenGL_11GLSLProgram_5is_valid = {"is_valid", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_11GLSLProgram_5is_valid, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_11GLSLProgram_4is_valid};
static PyObject *__pyx_pw_8CyOpenGL_11GLSLProgram_5is_valid(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_valid (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("is_valid", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("is_valid", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8CyOpenGL_11GLSLProgram_4is_valid(((struct __pyx_obj_8CyOpenGL_GLSLProgram *)__pyx_v_self));

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

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

  /* "opengl/modern/glsl_program.pyx":139
 * 
 *     def is_valid(self):
 *         return self._is_valid             # <<<<<<<<<<<<<<
 * 
 *     def bind_uniforms(self, name_to_type_and_value):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->_is_valid); if (unlikely(!__pyx_t_1)) __PYX_ERR(30, 139, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "opengl/modern/glsl_program.pyx":138
 *         return True
 * 
 *     def is_valid(self):             # <<<<<<<<<<<<<<
 *         return self._is_valid
 * 
*/

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

/* "opengl/modern/glsl_program.pyx":141
 *         return self._is_valid
 * 
 *     def bind_uniforms(self, name_to_type_and_value):             # <<<<<<<<<<<<<<
 *         """
 *         Bind uniforms. This method can only be used after use_program
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_11GLSLProgram_7bind_uniforms(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_11GLSLProgram_6bind_uniforms, "GLSLProgram.bind_uniforms(self, name_to_type_and_value)\n\nBind uniforms. This method can only be used after use_program\nwas called. It can be called several times (with different keys).\n\nThe method takes a dictionary where the key is the name of the\nuniform to bind and the value is a pair (type, py_value).\nHere type is a string mimicking the GLSL type (e.g., int, vec2,\nmat4, vec4[]).\n\nFor mat4[], py_value needs to support len(py_value)\nsuch that py_value[i][j][k] is convertible to a float and is used\nfor the entry (j,k) of the i-th matrix.");
static PyMethodDef __pyx_mdef_8CyOpenGL_11GLSLProgram_7bind_uniforms = {"bind_uniforms", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_11GLSLProgram_7bind_uniforms, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_11GLSLProgram_6bind_uniforms};
static PyObject *__pyx_pw_8CyOpenGL_11GLSLProgram_7bind_uniforms(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_name_to_type_and_value = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("bind_uniforms (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_name_to_type_and_value,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(30, 141, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(30, 141, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "bind_uniforms", 0) < (0)) __PYX_ERR(30, 141, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("bind_uniforms", 1, 1, 1, i); __PYX_ERR(30, 141, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(30, 141, __pyx_L3_error)
    }
    __pyx_v_name_to_type_and_value = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("bind_uniforms", 1, 1, 1, __pyx_nargs); __PYX_ERR(30, 141, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("CyOpenGL.GLSLProgram.bind_uniforms", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_11GLSLProgram_6bind_uniforms(((struct __pyx_obj_8CyOpenGL_GLSLProgram *)__pyx_v_self), __pyx_v_name_to_type_and_value);

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

static PyObject *__pyx_pf_8CyOpenGL_11GLSLProgram_6bind_uniforms(struct __pyx_obj_8CyOpenGL_GLSLProgram *__pyx_v_self, PyObject *__pyx_v_name_to_type_and_value) {
  size_t __pyx_v_i;
  size_t __pyx_v_j;
  size_t __pyx_v_l;
  GLint __pyx_v_loc;
  GLfloat *__pyx_v_floats;
  GLint *__pyx_v_integers;
  GLfloat __pyx_v_mat4[16];
  GLuint __pyx_v_block_index;
  PyObject *__pyx_v_name = NULL;
  PyObject *__pyx_v_uniform_type = NULL;
  PyObject *__pyx_v_value = NULL;
  PyObject *__pyx_v_name_parts = NULL;
  PyObject *__pyx_v_uniform_name = NULL;
  PyObject *__pyx_v_block_name = NULL;
  PyObject *__pyx_v_buffer_object = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *(*__pyx_t_12)(PyObject *);
  Py_ssize_t __pyx_t_13;
  GLchar const *__pyx_t_14;
  GLint __pyx_t_15;
  double __pyx_t_16;
  double __pyx_t_17;
  GLint __pyx_t_18;
  size_t __pyx_t_19;
  GLfloat __pyx_t_20;
  size_t __pyx_t_21;
  int __pyx_t_22;
  char const *__pyx_t_23;
  PyObject *__pyx_t_24 = NULL;
  PyObject *__pyx_t_25 = NULL;
  PyObject *__pyx_t_26 = NULL;
  PyObject *__pyx_t_27 = NULL;
  PyObject *__pyx_t_28 = NULL;
  PyObject *__pyx_t_29 = NULL;
  char const *__pyx_t_30;
  size_t __pyx_t_31;
  char const *__pyx_t_32;
  char const *__pyx_t_33;
  char const *__pyx_t_34;
  GLfloat *__pyx_t_35;
  char const *__pyx_t_36;
  char const *__pyx_t_37;
  char const *__pyx_t_38;
  char const *__pyx_t_39;
  GLchar const *__pyx_t_40;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("bind_uniforms", 0);

  /* "opengl/modern/glsl_program.pyx":160
 *         cdef size_t l
 *         cdef GLint loc
 *         cdef GLfloat * floats = NULL             # <<<<<<<<<<<<<<
 *         cdef GLint * integers
 *         cdef GLfloat mat4[16]
*/
  __pyx_v_floats = NULL;

  /* "opengl/modern/glsl_program.pyx":166
 *         cdef GLuint block_index
 * 
 *         if not self._is_valid:             # <<<<<<<<<<<<<<
 *             return
 * 
*/
  __pyx_t_1 = (!__pyx_v_self->_is_valid);
  if (__pyx_t_1) {

    /* "opengl/modern/glsl_program.pyx":167
 * 
 *         if not self._is_valid:
 *             return             # <<<<<<<<<<<<<<
 * 
 *         clear_gl_errors()
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "opengl/modern/glsl_program.pyx":166
 *         cdef GLuint block_index
 * 
 *         if not self._is_valid:             # <<<<<<<<<<<<<<
 *             return
 * 
*/
  }

  /* "opengl/modern/glsl_program.pyx":169
 *             return
 * 
 *         clear_gl_errors()             # <<<<<<<<<<<<<<
 * 
 *         for name, (uniform_type, value) in name_to_type_and_value.items():
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_clear_gl_errors); if (unlikely(!__pyx_t_4)) __PYX_ERR(30, 169, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(30, 169, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opengl/modern/glsl_program.pyx":171
 *         clear_gl_errors()
 * 
 *         for name, (uniform_type, value) in name_to_type_and_value.items():             # <<<<<<<<<<<<<<
 *             name_parts = name.split('.')
 *             uniform_name = name_parts[-1]
*/
  __pyx_t_6 = 0;
  if (unlikely(__pyx_v_name_to_type_and_value == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
    __PYX_ERR(30, 171, __pyx_L1_error)
  }
  __pyx_t_4 = __Pyx_dict_iterator(__pyx_v_name_to_type_and_value, 0, __pyx_mstate_global->__pyx_n_u_items, (&__pyx_t_7), (&__pyx_t_8)); if (unlikely(!__pyx_t_4)) __PYX_ERR(30, 171, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_2);
  __pyx_t_2 = __pyx_t_4;
  __pyx_t_4 = 0;
  while (1) {
    __pyx_t_9 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_7, &__pyx_t_6, &__pyx_t_4, &__pyx_t_3, NULL, __pyx_t_8);
    if (unlikely(__pyx_t_9 == 0)) break;
    if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(30, 171, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_4);
    __pyx_t_4 = 0;
    if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
      PyObject* sequence = __pyx_t_3;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(30, 171, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
        __Pyx_INCREF(__pyx_t_4);
        __pyx_t_10 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_10);
      } else {
        __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_4)) __PYX_ERR(30, 171, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_4);
        __pyx_t_10 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_10)) __PYX_ERR(30, 171, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_10);
      }
      #else
      __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(30, 171, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_10 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(30, 171, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      #endif
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_11 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(30, 171, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_12 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_11);
      index = 0; __pyx_t_4 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_4)) goto __pyx_L6_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_4);
      index = 1; __pyx_t_10 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_10)) goto __pyx_L6_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_10);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 2) < (0)) __PYX_ERR(30, 171, __pyx_L1_error)
      __pyx_t_12 = NULL;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      goto __pyx_L7_unpacking_done;
      __pyx_L6_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_12 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(30, 171, __pyx_L1_error)
      __pyx_L7_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_uniform_type, __pyx_t_4);
    __pyx_t_4 = 0;
    __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_10);
    __pyx_t_10 = 0;

    /* "opengl/modern/glsl_program.pyx":172
 * 
 *         for name, (uniform_type, value) in name_to_type_and_value.items():
 *             name_parts = name.split('.')             # <<<<<<<<<<<<<<
 *             uniform_name = name_parts[-1]
 * 
*/
    __pyx_t_10 = __pyx_v_name;
    __Pyx_INCREF(__pyx_t_10);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_mstate_global->__pyx_kp_u__2};
      __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_split, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(30, 172, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_XDECREF_SET(__pyx_v_name_parts, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "opengl/modern/glsl_program.pyx":173
 *         for name, (uniform_type, value) in name_to_type_and_value.items():
 *             name_parts = name.split('.')
 *             uniform_name = name_parts[-1]             # <<<<<<<<<<<<<<
 * 
 *             if len(name_parts) == 1:
*/
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_name_parts, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(30, 173, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_XDECREF_SET(__pyx_v_uniform_name, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "opengl/modern/glsl_program.pyx":175
 *             uniform_name = name_parts[-1]
 * 
 *             if len(name_parts) == 1:             # <<<<<<<<<<<<<<
 *                 loc = glGetUniformLocation(self._glsl_program,
 *                                            uniform_name.encode('ascii'))
*/
    __pyx_t_13 = PyObject_Length(__pyx_v_name_parts); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(30, 175, __pyx_L1_error)
    __pyx_t_1 = (__pyx_t_13 == 1);
    if (__pyx_t_1) {

      /* "opengl/modern/glsl_program.pyx":177
 *             if len(name_parts) == 1:
 *                 loc = glGetUniformLocation(self._glsl_program,
 *                                            uniform_name.encode('ascii'))             # <<<<<<<<<<<<<<
 *                 if uniform_type == 'int':
 *                     glUniform1i(loc, int(value))
*/
      __pyx_t_10 = __pyx_v_uniform_name;
      __Pyx_INCREF(__pyx_t_10);
      __pyx_t_5 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_mstate_global->__pyx_n_u_ascii};
        __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_encode, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(30, 177, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
      }
      __pyx_t_14 = __Pyx_PyObject_AsString(__pyx_t_3); if (unlikely((!__pyx_t_14) && PyErr_Occurred())) __PYX_ERR(30, 177, __pyx_L1_error)

      /* "opengl/modern/glsl_program.pyx":176
 * 
 *             if len(name_parts) == 1:
 *                 loc = glGetUniformLocation(self._glsl_program,             # <<<<<<<<<<<<<<
 *                                            uniform_name.encode('ascii'))
 *                 if uniform_type == 'int':
*/
      __pyx_v_loc = glGetUniformLocation(__pyx_v_self->_glsl_program, __pyx_t_14);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "opengl/modern/glsl_program.pyx":178
 *                 loc = glGetUniformLocation(self._glsl_program,
 *                                            uniform_name.encode('ascii'))
 *                 if uniform_type == 'int':             # <<<<<<<<<<<<<<
 *                     glUniform1i(loc, int(value))
 *                 elif uniform_type == 'float':
*/
      __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_uniform_type, __pyx_mstate_global->__pyx_n_u_int_2, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(30, 178, __pyx_L1_error)
      if (__pyx_t_1) {

        /* "opengl/modern/glsl_program.pyx":179
 *                                            uniform_name.encode('ascii'))
 *                 if uniform_type == 'int':
 *                     glUniform1i(loc, int(value))             # <<<<<<<<<<<<<<
 *                 elif uniform_type == 'float':
 *                     glUniform1f(loc, float(value))
*/
        __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(30, 179, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_15 = __Pyx_PyLong_As_GLint(__pyx_t_3); if (unlikely((__pyx_t_15 == ((GLint)-1)) && PyErr_Occurred())) __PYX_ERR(30, 179, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        glUniform1i(__pyx_v_loc, __pyx_t_15);

        /* "opengl/modern/glsl_program.pyx":178
 *                 loc = glGetUniformLocation(self._glsl_program,
 *                                            uniform_name.encode('ascii'))
 *                 if uniform_type == 'int':             # <<<<<<<<<<<<<<
 *                     glUniform1i(loc, int(value))
 *                 elif uniform_type == 'float':
*/
        goto __pyx_L9;
      }

      /* "opengl/modern/glsl_program.pyx":180
 *                 if uniform_type == 'int':
 *                     glUniform1i(loc, int(value))
 *                 elif uniform_type == 'float':             # <<<<<<<<<<<<<<
 *                     glUniform1f(loc, float(value))
 *                 elif uniform_type == 'bool':
*/
      __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_uniform_type, __pyx_mstate_global->__pyx_n_u_float_2, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(30, 180, __pyx_L1_error)
      if (__pyx_t_1) {

        /* "opengl/modern/glsl_program.pyx":181
 *                     glUniform1i(loc, int(value))
 *                 elif uniform_type == 'float':
 *                     glUniform1f(loc, float(value))             # <<<<<<<<<<<<<<
 *                 elif uniform_type == 'bool':
 *                     glUniform1i(loc, int(1 if value else 0))
*/
        __pyx_t_16 = __Pyx_PyObject_AsDouble(__pyx_v_value); if (unlikely(__PYX_CHECK_FLOAT_EXCEPTION(__pyx_t_16, ((double)((double)-1))) && PyErr_Occurred())) __PYX_ERR(30, 181, __pyx_L1_error)
        glUniform1f(__pyx_v_loc, __pyx_t_16);

        /* "opengl/modern/glsl_program.pyx":180
 *                 if uniform_type == 'int':
 *                     glUniform1i(loc, int(value))
 *                 elif uniform_type == 'float':             # <<<<<<<<<<<<<<
 *                     glUniform1f(loc, float(value))
 *                 elif uniform_type == 'bool':
*/
        goto __pyx_L9;
      }

      /* "opengl/modern/glsl_program.pyx":182
 *                 elif uniform_type == 'float':
 *                     glUniform1f(loc, float(value))
 *                 elif uniform_type == 'bool':             # <<<<<<<<<<<<<<
 *                     glUniform1i(loc, int(1 if value else 0))
 *                 elif uniform_type == 'vec2':
*/
      __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_uniform_type, __pyx_mstate_global->__pyx_n_u_bool, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(30, 182, __pyx_L1_error)
      if (__pyx_t_1) {

        /* "opengl/modern/glsl_program.pyx":183
 *                     glUniform1f(loc, float(value))
 *                 elif uniform_type == 'bool':
 *                     glUniform1i(loc, int(1 if value else 0))             # <<<<<<<<<<<<<<
 *                 elif uniform_type == 'vec2':
 *                     glUniform2f(loc, float(value[0]), float(value[1]))
*/
        __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(30, 183, __pyx_L1_error)
        if (__pyx_t_1) {
          __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1);
          __pyx_t_3 = __pyx_mstate_global->__pyx_int_1;
        } else {
          __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
          __pyx_t_3 = __pyx_mstate_global->__pyx_int_0;
        }
        __pyx_t_10 = __Pyx_PyNumber_Int(__pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(30, 183, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_15 = __Pyx_PyLong_As_GLint(__pyx_t_10); if (unlikely((__pyx_t_15 == ((GLint)-1)) && PyErr_Occurred())) __PYX_ERR(30, 183, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        glUniform1i(__pyx_v_loc, __pyx_t_15);

        /* "opengl/modern/glsl_program.pyx":182
 *                 elif uniform_type == 'float':
 *                     glUniform1f(loc, float(value))
 *                 elif uniform_type == 'bool':             # <<<<<<<<<<<<<<
 *                     glUniform1i(loc, int(1 if value else 0))
 *                 elif uniform_type == 'vec2':
*/
        goto __pyx_L9;
      }

      /* "opengl/modern/glsl_program.pyx":184
 *                 elif uniform_type == 'bool':
 *                     glUniform1i(loc, int(1 if value else 0))
 *                 elif uniform_type == 'vec2':             # <<<<<<<<<<<<<<
 *                     glUniform2f(loc, float(value[0]), float(value[1]))
 *                 elif uniform_type == 'ivec2':
*/
      __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_uniform_type, __pyx_mstate_global->__pyx_n_u_vec2, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(30, 184, __pyx_L1_error)
      if (__pyx_t_1) {

        /* "opengl/modern/glsl_program.pyx":185
 *                     glUniform1i(loc, int(1 if value else 0))
 *                 elif uniform_type == 'vec2':
 *                     glUniform2f(loc, float(value[0]), float(value[1]))             # <<<<<<<<<<<<<<
 *                 elif uniform_type == 'ivec2':
 *                     glUniform2i(loc, int(value[0]), int(value[1]))
*/
        __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_value, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_10)) __PYX_ERR(30, 185, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_16 = __Pyx_PyObject_AsDouble(__pyx_t_10); if (unlikely(__PYX_CHECK_FLOAT_EXCEPTION(__pyx_t_16, ((double)((double)-1))) && PyErr_Occurred())) __PYX_ERR(30, 185, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_value, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_10)) __PYX_ERR(30, 185, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_17 = __Pyx_PyObject_AsDouble(__pyx_t_10); if (unlikely(__PYX_CHECK_FLOAT_EXCEPTION(__pyx_t_17, ((double)((double)-1))) && PyErr_Occurred())) __PYX_ERR(30, 185, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        glUniform2f(__pyx_v_loc, __pyx_t_16, __pyx_t_17);

        /* "opengl/modern/glsl_program.pyx":184
 *                 elif uniform_type == 'bool':
 *                     glUniform1i(loc, int(1 if value else 0))
 *                 elif uniform_type == 'vec2':             # <<<<<<<<<<<<<<
 *                     glUniform2f(loc, float(value[0]), float(value[1]))
 *                 elif uniform_type == 'ivec2':
*/
        goto __pyx_L9;
      }

      /* "opengl/modern/glsl_program.pyx":186
 *                 elif uniform_type == 'vec2':
 *                     glUniform2f(loc, float(value[0]), float(value[1]))
 *                 elif uniform_type == 'ivec2':             # <<<<<<<<<<<<<<
 *                     glUniform2i(loc, int(value[0]), int(value[1]))
 *                 elif uniform_type == 'mat4':
*/
      __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_uniform_type, __pyx_mstate_global->__pyx_n_u_ivec2, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(30, 186, __pyx_L1_error)
      if (__pyx_t_1) {

        /* "opengl/modern/glsl_program.pyx":187
 *                     glUniform2f(loc, float(value[0]), float(value[1]))
 *                 elif uniform_type == 'ivec2':
 *                     glUniform2i(loc, int(value[0]), int(value[1]))             # <<<<<<<<<<<<<<
 *                 elif uniform_type == 'mat4':
 *                     for i in range(4):
*/
        __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_value, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_10)) __PYX_ERR(30, 187, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(30, 187, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_15 = __Pyx_PyLong_As_GLint(__pyx_t_3); if (unlikely((__pyx_t_15 == ((GLint)-1)) && PyErr_Occurred())) __PYX_ERR(30, 187, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_value, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(30, 187, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_10 = __Pyx_PyNumber_Int(__pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(30, 187, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_18 = __Pyx_PyLong_As_GLint(__pyx_t_10); if (unlikely((__pyx_t_18 == ((GLint)-1)) && PyErr_Occurred())) __PYX_ERR(30, 187, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        glUniform2i(__pyx_v_loc, __pyx_t_15, __pyx_t_18);

        /* "opengl/modern/glsl_program.pyx":186
 *                 elif uniform_type == 'vec2':
 *                     glUniform2f(loc, float(value[0]), float(value[1]))
 *                 elif uniform_type == 'ivec2':             # <<<<<<<<<<<<<<
 *                     glUniform2i(loc, int(value[0]), int(value[1]))
 *                 elif uniform_type == 'mat4':
*/
        goto __pyx_L9;
      }

      /* "opengl/modern/glsl_program.pyx":188
 *                 elif uniform_type == 'ivec2':
 *                     glUniform2i(loc, int(value[0]), int(value[1]))
 *                 elif uniform_type == 'mat4':             # <<<<<<<<<<<<<<
 *                     for i in range(4):
 *                         for j in range(4):
*/
      __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_uniform_type, __pyx_mstate_global->__pyx_n_u_mat4_2, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(30, 188, __pyx_L1_error)
      if (__pyx_t_1) {

        /* "opengl/modern/glsl_program.pyx":189
 *                     glUniform2i(loc, int(value[0]), int(value[1]))
 *                 elif uniform_type == 'mat4':
 *                     for i in range(4):             # <<<<<<<<<<<<<<
 *                         for j in range(4):
 *                             mat4[4*i + j] = value[i][j]
*/
        for (__pyx_t_5 = 0; __pyx_t_5 < 4; __pyx_t_5+=1) {
          __pyx_v_i = __pyx_t_5;

          /* "opengl/modern/glsl_program.pyx":190
 *                 elif uniform_type == 'mat4':
 *                     for i in range(4):
 *                         for j in range(4):             # <<<<<<<<<<<<<<
 *                             mat4[4*i + j] = value[i][j]
 *                     glUniformMatrix4fv(loc, 1,
*/
          for (__pyx_t_19 = 0; __pyx_t_19 < 4; __pyx_t_19+=1) {
            __pyx_v_j = __pyx_t_19;

            /* "opengl/modern/glsl_program.pyx":191
 *                     for i in range(4):
 *                         for j in range(4):
 *                             mat4[4*i + j] = value[i][j]             # <<<<<<<<<<<<<<
 *                     glUniformMatrix4fv(loc, 1,
 *                                        0, # transpose = false
*/
            __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_value, __pyx_v_i, size_t, 0, __Pyx_PyLong_FromSize_t, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_10)) __PYX_ERR(30, 191, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_10);
            __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_10, __pyx_v_j, size_t, 0, __Pyx_PyLong_FromSize_t, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(30, 191, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __pyx_t_20 = __Pyx_PyFloat_AsFloat(__pyx_t_3); if (unlikely((__pyx_t_20 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(30, 191, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            (__pyx_v_mat4[((4 * __pyx_v_i) + __pyx_v_j)]) = __pyx_t_20;
          }
        }

        /* "opengl/modern/glsl_program.pyx":192
 *                         for j in range(4):
 *                             mat4[4*i + j] = value[i][j]
 *                     glUniformMatrix4fv(loc, 1,             # <<<<<<<<<<<<<<
 *                                        0, # transpose = false
 *                                        mat4)
*/
        glUniformMatrix4fv(__pyx_v_loc, 1, 0, __pyx_v_mat4);

        /* "opengl/modern/glsl_program.pyx":188
 *                 elif uniform_type == 'ivec2':
 *                     glUniform2i(loc, int(value[0]), int(value[1]))
 *                 elif uniform_type == 'mat4':             # <<<<<<<<<<<<<<
 *                     for i in range(4):
 *                         for j in range(4):
*/
        goto __pyx_L9;
      }

      /* "opengl/modern/glsl_program.pyx":195
 *                                        0, # transpose = false
 *                                        mat4)
 *                 elif uniform_type == 'int[]':             # <<<<<<<<<<<<<<
 *                     l = len(value)
 *                     integers = <GLint *> malloc(l * sizeof(GLint))
*/
      __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_uniform_type, __pyx_mstate_global->__pyx_kp_u_int, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(30, 195, __pyx_L1_error)
      if (__pyx_t_1) {

        /* "opengl/modern/glsl_program.pyx":196
 *                                        mat4)
 *                 elif uniform_type == 'int[]':
 *                     l = len(value)             # <<<<<<<<<<<<<<
 *                     integers = <GLint *> malloc(l * sizeof(GLint))
 *                     try:
*/
        __pyx_t_13 = PyObject_Length(__pyx_v_value); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(30, 196, __pyx_L1_error)
        __pyx_v_l = __pyx_t_13;

        /* "opengl/modern/glsl_program.pyx":197
 *                 elif uniform_type == 'int[]':
 *                     l = len(value)
 *                     integers = <GLint *> malloc(l * sizeof(GLint))             # <<<<<<<<<<<<<<
 *                     try:
 *                         for i in range(l):
*/
        __pyx_v_integers = ((GLint *)malloc((__pyx_v_l * (sizeof(GLint)))));

        /* "opengl/modern/glsl_program.pyx":198
 *                     l = len(value)
 *                     integers = <GLint *> malloc(l * sizeof(GLint))
 *                     try:             # <<<<<<<<<<<<<<
 *                         for i in range(l):
 *                             integers[i] = value[i]
*/
        /*try:*/ {

          /* "opengl/modern/glsl_program.pyx":199
 *                     integers = <GLint *> malloc(l * sizeof(GLint))
 *                     try:
 *                         for i in range(l):             # <<<<<<<<<<<<<<
 *                             integers[i] = value[i]
 *                         glUniform1iv(loc, l, integers)
*/
          __pyx_t_5 = __pyx_v_l;
          __pyx_t_19 = __pyx_t_5;
          for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_19; __pyx_t_21+=1) {
            __pyx_v_i = __pyx_t_21;

            /* "opengl/modern/glsl_program.pyx":200
 *                     try:
 *                         for i in range(l):
 *                             integers[i] = value[i]             # <<<<<<<<<<<<<<
 *                         glUniform1iv(loc, l, integers)
 *                     finally:
*/
            __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_value, __pyx_v_i, size_t, 0, __Pyx_PyLong_FromSize_t, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(30, 200, __pyx_L17_error)
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_18 = __Pyx_PyLong_As_GLint(__pyx_t_3); if (unlikely((__pyx_t_18 == ((GLint)-1)) && PyErr_Occurred())) __PYX_ERR(30, 200, __pyx_L17_error)
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            (__pyx_v_integers[__pyx_v_i]) = __pyx_t_18;
          }

          /* "opengl/modern/glsl_program.pyx":201
 *                         for i in range(l):
 *                             integers[i] = value[i]
 *                         glUniform1iv(loc, l, integers)             # <<<<<<<<<<<<<<
 *                     finally:
 *                         free(integers)
*/
          glUniform1iv(__pyx_v_loc, __pyx_v_l, __pyx_v_integers);
        }

        /* "opengl/modern/glsl_program.pyx":203
 *                         glUniform1iv(loc, l, integers)
 *                     finally:
 *                         free(integers)             # <<<<<<<<<<<<<<
 *                 elif uniform_type == 'float[]':
 *                     l = len(value)
*/
        /*finally:*/ {
          /*normal exit:*/{
            free(__pyx_v_integers);
            goto __pyx_L18;
          }
          __pyx_L17_error:;
          /*exception exit:*/{
            __Pyx_PyThreadState_declare
            __Pyx_PyThreadState_assign
            __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0; __pyx_t_27 = 0; __pyx_t_28 = 0; __pyx_t_29 = 0;
            __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
            __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
             __Pyx_ExceptionSwap(&__pyx_t_27, &__pyx_t_28, &__pyx_t_29);
            if ( unlikely(__Pyx_GetException(&__pyx_t_24, &__pyx_t_25, &__pyx_t_26) < 0)) __Pyx_ErrFetch(&__pyx_t_24, &__pyx_t_25, &__pyx_t_26);
            __Pyx_XGOTREF(__pyx_t_24);
            __Pyx_XGOTREF(__pyx_t_25);
            __Pyx_XGOTREF(__pyx_t_26);
            __Pyx_XGOTREF(__pyx_t_27);
            __Pyx_XGOTREF(__pyx_t_28);
            __Pyx_XGOTREF(__pyx_t_29);
            __pyx_t_9 = __pyx_lineno; __pyx_t_22 = __pyx_clineno; __pyx_t_23 = __pyx_filename;
            {
              free(__pyx_v_integers);
            }
            __Pyx_XGIVEREF(__pyx_t_27);
            __Pyx_XGIVEREF(__pyx_t_28);
            __Pyx_XGIVEREF(__pyx_t_29);
            __Pyx_ExceptionReset(__pyx_t_27, __pyx_t_28, __pyx_t_29);
            __Pyx_XGIVEREF(__pyx_t_24);
            __Pyx_XGIVEREF(__pyx_t_25);
            __Pyx_XGIVEREF(__pyx_t_26);
            __Pyx_ErrRestore(__pyx_t_24, __pyx_t_25, __pyx_t_26);
            __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0; __pyx_t_27 = 0; __pyx_t_28 = 0; __pyx_t_29 = 0;
            __pyx_lineno = __pyx_t_9; __pyx_clineno = __pyx_t_22; __pyx_filename = __pyx_t_23;
            goto __pyx_L1_error;
          }
          __pyx_L18:;
        }

        /* "opengl/modern/glsl_program.pyx":195
 *                                        0, # transpose = false
 *                                        mat4)
 *                 elif uniform_type == 'int[]':             # <<<<<<<<<<<<<<
 *                     l = len(value)
 *                     integers = <GLint *> malloc(l * sizeof(GLint))
*/
        goto __pyx_L9;
      }

      /* "opengl/modern/glsl_program.pyx":204
 *                     finally:
 *                         free(integers)
 *                 elif uniform_type == 'float[]':             # <<<<<<<<<<<<<<
 *                     l = len(value)
 *                     floats = <GLfloat *> malloc(l * sizeof(GLfloat))
*/
      __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_uniform_type, __pyx_mstate_global->__pyx_kp_u_float, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(30, 204, __pyx_L1_error)
      if (__pyx_t_1) {

        /* "opengl/modern/glsl_program.pyx":205
 *                         free(integers)
 *                 elif uniform_type == 'float[]':
 *                     l = len(value)             # <<<<<<<<<<<<<<
 *                     floats = <GLfloat *> malloc(l * sizeof(GLfloat))
 *                     try:
*/
        __pyx_t_13 = PyObject_Length(__pyx_v_value); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(30, 205, __pyx_L1_error)
        __pyx_v_l = __pyx_t_13;

        /* "opengl/modern/glsl_program.pyx":206
 *                 elif uniform_type == 'float[]':
 *                     l = len(value)
 *                     floats = <GLfloat *> malloc(l * sizeof(GLfloat))             # <<<<<<<<<<<<<<
 *                     try:
 *                         for i in range(l):
*/
        __pyx_v_floats = ((GLfloat *)malloc((__pyx_v_l * (sizeof(GLfloat)))));

        /* "opengl/modern/glsl_program.pyx":207
 *                     l = len(value)
 *                     floats = <GLfloat *> malloc(l * sizeof(GLfloat))
 *                     try:             # <<<<<<<<<<<<<<
 *                         for i in range(l):
 *                             floats[i] = value[i]
*/
        /*try:*/ {

          /* "opengl/modern/glsl_program.pyx":208
 *                     floats = <GLfloat *> malloc(l * sizeof(GLfloat))
 *                     try:
 *                         for i in range(l):             # <<<<<<<<<<<<<<
 *                             floats[i] = value[i]
 *                         glUniform1fv(loc, l, floats)
*/
          __pyx_t_5 = __pyx_v_l;
          __pyx_t_19 = __pyx_t_5;
          for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_19; __pyx_t_21+=1) {
            __pyx_v_i = __pyx_t_21;

            /* "opengl/modern/glsl_program.pyx":209
 *                     try:
 *                         for i in range(l):
 *                             floats[i] = value[i]             # <<<<<<<<<<<<<<
 *                         glUniform1fv(loc, l, floats)
 *                     finally:
*/
            __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_value, __pyx_v_i, size_t, 0, __Pyx_PyLong_FromSize_t, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(30, 209, __pyx_L28_error)
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_20 = __Pyx_PyFloat_AsFloat(__pyx_t_3); if (unlikely((__pyx_t_20 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(30, 209, __pyx_L28_error)
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            (__pyx_v_floats[__pyx_v_i]) = __pyx_t_20;
          }

          /* "opengl/modern/glsl_program.pyx":210
 *                         for i in range(l):
 *                             floats[i] = value[i]
 *                         glUniform1fv(loc, l, floats)             # <<<<<<<<<<<<<<
 *                     finally:
 *                         free(floats)
*/
          glUniform1fv(__pyx_v_loc, __pyx_v_l, __pyx_v_floats);
        }

        /* "opengl/modern/glsl_program.pyx":212
 *                         glUniform1fv(loc, l, floats)
 *                     finally:
 *                         free(floats)             # <<<<<<<<<<<<<<
 *                 elif uniform_type == 'vec2[]':
 *                     l = len(value)
*/
        /*finally:*/ {
          /*normal exit:*/{
            free(__pyx_v_floats);
            goto __pyx_L29;
          }
          __pyx_L28_error:;
          /*exception exit:*/{
            __Pyx_PyThreadState_declare
            __Pyx_PyThreadState_assign
            __pyx_t_29 = 0; __pyx_t_28 = 0; __pyx_t_27 = 0; __pyx_t_26 = 0; __pyx_t_25 = 0; __pyx_t_24 = 0;
            __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
            __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
             __Pyx_ExceptionSwap(&__pyx_t_26, &__pyx_t_25, &__pyx_t_24);
            if ( unlikely(__Pyx_GetException(&__pyx_t_29, &__pyx_t_28, &__pyx_t_27) < 0)) __Pyx_ErrFetch(&__pyx_t_29, &__pyx_t_28, &__pyx_t_27);
            __Pyx_XGOTREF(__pyx_t_29);
            __Pyx_XGOTREF(__pyx_t_28);
            __Pyx_XGOTREF(__pyx_t_27);
            __Pyx_XGOTREF(__pyx_t_26);
            __Pyx_XGOTREF(__pyx_t_25);
            __Pyx_XGOTREF(__pyx_t_24);
            __pyx_t_22 = __pyx_lineno; __pyx_t_9 = __pyx_clineno; __pyx_t_30 = __pyx_filename;
            {
              free(__pyx_v_floats);
            }
            __Pyx_XGIVEREF(__pyx_t_26);
            __Pyx_XGIVEREF(__pyx_t_25);
            __Pyx_XGIVEREF(__pyx_t_24);
            __Pyx_ExceptionReset(__pyx_t_26, __pyx_t_25, __pyx_t_24);
            __Pyx_XGIVEREF(__pyx_t_29);
            __Pyx_XGIVEREF(__pyx_t_28);
            __Pyx_XGIVEREF(__pyx_t_27);
            __Pyx_ErrRestore(__pyx_t_29, __pyx_t_28, __pyx_t_27);
            __pyx_t_29 = 0; __pyx_t_28 = 0; __pyx_t_27 = 0; __pyx_t_26 = 0; __pyx_t_25 = 0; __pyx_t_24 = 0;
            __pyx_lineno = __pyx_t_22; __pyx_clineno = __pyx_t_9; __pyx_filename = __pyx_t_30;
            goto __pyx_L1_error;
          }
          __pyx_L29:;
        }

        /* "opengl/modern/glsl_program.pyx":204
 *                     finally:
 *                         free(integers)
 *                 elif uniform_type == 'float[]':             # <<<<<<<<<<<<<<
 *                     l = len(value)
 *                     floats = <GLfloat *> malloc(l * sizeof(GLfloat))
*/
        goto __pyx_L9;
      }

      /* "opengl/modern/glsl_program.pyx":213
 *                     finally:
 *                         free(floats)
 *                 elif uniform_type == 'vec2[]':             # <<<<<<<<<<<<<<
 *                     l = len(value)
 *                     floats = <GLfloat *> malloc(2 * l * sizeof(GLfloat))
*/
      __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_uniform_type, __pyx_mstate_global->__pyx_kp_u_vec2_2, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(30, 213, __pyx_L1_error)
      if (__pyx_t_1) {

        /* "opengl/modern/glsl_program.pyx":214
 *                         free(floats)
 *                 elif uniform_type == 'vec2[]':
 *                     l = len(value)             # <<<<<<<<<<<<<<
 *                     floats = <GLfloat *> malloc(2 * l * sizeof(GLfloat))
 *                     try:
*/
        __pyx_t_13 = PyObject_Length(__pyx_v_value); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(30, 214, __pyx_L1_error)
        __pyx_v_l = __pyx_t_13;

        /* "opengl/modern/glsl_program.pyx":215
 *                 elif uniform_type == 'vec2[]':
 *                     l = len(value)
 *                     floats = <GLfloat *> malloc(2 * l * sizeof(GLfloat))             # <<<<<<<<<<<<<<
 *                     try:
 *                         for i in range(l):
*/
        __pyx_v_floats = ((GLfloat *)malloc(((2 * __pyx_v_l) * (sizeof(GLfloat)))));

        /* "opengl/modern/glsl_program.pyx":216
 *                     l = len(value)
 *                     floats = <GLfloat *> malloc(2 * l * sizeof(GLfloat))
 *                     try:             # <<<<<<<<<<<<<<
 *                         for i in range(l):
 *                             for j in range(2):
*/
        /*try:*/ {

          /* "opengl/modern/glsl_program.pyx":217
 *                     floats = <GLfloat *> malloc(2 * l * sizeof(GLfloat))
 *                     try:
 *                         for i in range(l):             # <<<<<<<<<<<<<<
 *                             for j in range(2):
 *                                 floats[2 * i + j] = value[i][j]
*/
          __pyx_t_5 = __pyx_v_l;
          __pyx_t_19 = __pyx_t_5;
          for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_19; __pyx_t_21+=1) {
            __pyx_v_i = __pyx_t_21;

            /* "opengl/modern/glsl_program.pyx":218
 *                     try:
 *                         for i in range(l):
 *                             for j in range(2):             # <<<<<<<<<<<<<<
 *                                 floats[2 * i + j] = value[i][j]
 *                         glUniform2fv(loc, l, floats)
*/
            for (__pyx_t_31 = 0; __pyx_t_31 < 2; __pyx_t_31+=1) {
              __pyx_v_j = __pyx_t_31;

              /* "opengl/modern/glsl_program.pyx":219
 *                         for i in range(l):
 *                             for j in range(2):
 *                                 floats[2 * i + j] = value[i][j]             # <<<<<<<<<<<<<<
 *                         glUniform2fv(loc, l, floats)
 *                     finally:
*/
              __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_value, __pyx_v_i, size_t, 0, __Pyx_PyLong_FromSize_t, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(30, 219, __pyx_L39_error)
              __Pyx_GOTREF(__pyx_t_3);
              __pyx_t_10 = __Pyx_GetItemInt(__pyx_t_3, __pyx_v_j, size_t, 0, __Pyx_PyLong_FromSize_t, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_10)) __PYX_ERR(30, 219, __pyx_L39_error)
              __Pyx_GOTREF(__pyx_t_10);
              __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
              __pyx_t_20 = __Pyx_PyFloat_AsFloat(__pyx_t_10); if (unlikely((__pyx_t_20 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(30, 219, __pyx_L39_error)
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
              (__pyx_v_floats[((2 * __pyx_v_i) + __pyx_v_j)]) = __pyx_t_20;
            }
          }

          /* "opengl/modern/glsl_program.pyx":220
 *                             for j in range(2):
 *                                 floats[2 * i + j] = value[i][j]
 *                         glUniform2fv(loc, l, floats)             # <<<<<<<<<<<<<<
 *                     finally:
 *                         free(floats)
*/
          glUniform2fv(__pyx_v_loc, __pyx_v_l, __pyx_v_floats);
        }

        /* "opengl/modern/glsl_program.pyx":222
 *                         glUniform2fv(loc, l, floats)
 *                     finally:
 *                         free(floats)             # <<<<<<<<<<<<<<
 *                 elif uniform_type == 'vec3[]':
 *                     l = len(value)
*/
        /*finally:*/ {
          /*normal exit:*/{
            free(__pyx_v_floats);
            goto __pyx_L40;
          }
          __pyx_L39_error:;
          /*exception exit:*/{
            __Pyx_PyThreadState_declare
            __Pyx_PyThreadState_assign
            __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0; __pyx_t_27 = 0; __pyx_t_28 = 0; __pyx_t_29 = 0;
            __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
            __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
             __Pyx_ExceptionSwap(&__pyx_t_27, &__pyx_t_28, &__pyx_t_29);
            if ( unlikely(__Pyx_GetException(&__pyx_t_24, &__pyx_t_25, &__pyx_t_26) < 0)) __Pyx_ErrFetch(&__pyx_t_24, &__pyx_t_25, &__pyx_t_26);
            __Pyx_XGOTREF(__pyx_t_24);
            __Pyx_XGOTREF(__pyx_t_25);
            __Pyx_XGOTREF(__pyx_t_26);
            __Pyx_XGOTREF(__pyx_t_27);
            __Pyx_XGOTREF(__pyx_t_28);
            __Pyx_XGOTREF(__pyx_t_29);
            __pyx_t_9 = __pyx_lineno; __pyx_t_22 = __pyx_clineno; __pyx_t_32 = __pyx_filename;
            {
              free(__pyx_v_floats);
            }
            __Pyx_XGIVEREF(__pyx_t_27);
            __Pyx_XGIVEREF(__pyx_t_28);
            __Pyx_XGIVEREF(__pyx_t_29);
            __Pyx_ExceptionReset(__pyx_t_27, __pyx_t_28, __pyx_t_29);
            __Pyx_XGIVEREF(__pyx_t_24);
            __Pyx_XGIVEREF(__pyx_t_25);
            __Pyx_XGIVEREF(__pyx_t_26);
            __Pyx_ErrRestore(__pyx_t_24, __pyx_t_25, __pyx_t_26);
            __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0; __pyx_t_27 = 0; __pyx_t_28 = 0; __pyx_t_29 = 0;
            __pyx_lineno = __pyx_t_9; __pyx_clineno = __pyx_t_22; __pyx_filename = __pyx_t_32;
            goto __pyx_L1_error;
          }
          __pyx_L40:;
        }

        /* "opengl/modern/glsl_program.pyx":213
 *                     finally:
 *                         free(floats)
 *                 elif uniform_type == 'vec2[]':             # <<<<<<<<<<<<<<
 *                     l = len(value)
 *                     floats = <GLfloat *> malloc(2 * l * sizeof(GLfloat))
*/
        goto __pyx_L9;
      }

      /* "opengl/modern/glsl_program.pyx":223
 *                     finally:
 *                         free(floats)
 *                 elif uniform_type == 'vec3[]':             # <<<<<<<<<<<<<<
 *                     l = len(value)
 *                     floats = <GLfloat *> malloc(3 * l * sizeof(GLfloat))
*/
      __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_uniform_type, __pyx_mstate_global->__pyx_kp_u_vec3, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(30, 223, __pyx_L1_error)
      if (__pyx_t_1) {

        /* "opengl/modern/glsl_program.pyx":224
 *                         free(floats)
 *                 elif uniform_type == 'vec3[]':
 *                     l = len(value)             # <<<<<<<<<<<<<<
 *                     floats = <GLfloat *> malloc(3 * l * sizeof(GLfloat))
 *                     try:
*/
        __pyx_t_13 = PyObject_Length(__pyx_v_value); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(30, 224, __pyx_L1_error)
        __pyx_v_l = __pyx_t_13;

        /* "opengl/modern/glsl_program.pyx":225
 *                 elif uniform_type == 'vec3[]':
 *                     l = len(value)
 *                     floats = <GLfloat *> malloc(3 * l * sizeof(GLfloat))             # <<<<<<<<<<<<<<
 *                     try:
 *                         for i in range(l):
*/
        __pyx_v_floats = ((GLfloat *)malloc(((3 * __pyx_v_l) * (sizeof(GLfloat)))));

        /* "opengl/modern/glsl_program.pyx":226
 *                     l = len(value)
 *                     floats = <GLfloat *> malloc(3 * l * sizeof(GLfloat))
 *                     try:             # <<<<<<<<<<<<<<
 *                         for i in range(l):
 *                             for j in range(3):
*/
        /*try:*/ {

          /* "opengl/modern/glsl_program.pyx":227
 *                     floats = <GLfloat *> malloc(3 * l * sizeof(GLfloat))
 *                     try:
 *                         for i in range(l):             # <<<<<<<<<<<<<<
 *                             for j in range(3):
 *                                 floats[3 * i + j] = value[i][j]
*/
          __pyx_t_5 = __pyx_v_l;
          __pyx_t_19 = __pyx_t_5;
          for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_19; __pyx_t_21+=1) {
            __pyx_v_i = __pyx_t_21;

            /* "opengl/modern/glsl_program.pyx":228
 *                     try:
 *                         for i in range(l):
 *                             for j in range(3):             # <<<<<<<<<<<<<<
 *                                 floats[3 * i + j] = value[i][j]
 *                         glUniform3fv(loc, l, floats)
*/
            for (__pyx_t_31 = 0; __pyx_t_31 < 3; __pyx_t_31+=1) {
              __pyx_v_j = __pyx_t_31;

              /* "opengl/modern/glsl_program.pyx":229
 *                         for i in range(l):
 *                             for j in range(3):
 *                                 floats[3 * i + j] = value[i][j]             # <<<<<<<<<<<<<<
 *                         glUniform3fv(loc, l, floats)
 *                     finally:
*/
              __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_value, __pyx_v_i, size_t, 0, __Pyx_PyLong_FromSize_t, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_10)) __PYX_ERR(30, 229, __pyx_L52_error)
              __Pyx_GOTREF(__pyx_t_10);
              __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_10, __pyx_v_j, size_t, 0, __Pyx_PyLong_FromSize_t, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(30, 229, __pyx_L52_error)
              __Pyx_GOTREF(__pyx_t_3);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
              __pyx_t_20 = __Pyx_PyFloat_AsFloat(__pyx_t_3); if (unlikely((__pyx_t_20 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(30, 229, __pyx_L52_error)
              __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
              (__pyx_v_floats[((3 * __pyx_v_i) + __pyx_v_j)]) = __pyx_t_20;
            }
          }

          /* "opengl/modern/glsl_program.pyx":230
 *                             for j in range(3):
 *                                 floats[3 * i + j] = value[i][j]
 *                         glUniform3fv(loc, l, floats)             # <<<<<<<<<<<<<<
 *                     finally:
 *                         free(floats)
*/
          glUniform3fv(__pyx_v_loc, __pyx_v_l, __pyx_v_floats);
        }

        /* "opengl/modern/glsl_program.pyx":232
 *                         glUniform3fv(loc, l, floats)
 *                     finally:
 *                         free(floats)             # <<<<<<<<<<<<<<
 *                 elif uniform_type == 'vec4[]':
 *                     l = len(value)
*/
        /*finally:*/ {
          /*normal exit:*/{
            free(__pyx_v_floats);
            goto __pyx_L53;
          }
          __pyx_L52_error:;
          /*exception exit:*/{
            __Pyx_PyThreadState_declare
            __Pyx_PyThreadState_assign
            __pyx_t_29 = 0; __pyx_t_28 = 0; __pyx_t_27 = 0; __pyx_t_26 = 0; __pyx_t_25 = 0; __pyx_t_24 = 0;
            __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
            __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
             __Pyx_ExceptionSwap(&__pyx_t_26, &__pyx_t_25, &__pyx_t_24);
            if ( unlikely(__Pyx_GetException(&__pyx_t_29, &__pyx_t_28, &__pyx_t_27) < 0)) __Pyx_ErrFetch(&__pyx_t_29, &__pyx_t_28, &__pyx_t_27);
            __Pyx_XGOTREF(__pyx_t_29);
            __Pyx_XGOTREF(__pyx_t_28);
            __Pyx_XGOTREF(__pyx_t_27);
            __Pyx_XGOTREF(__pyx_t_26);
            __Pyx_XGOTREF(__pyx_t_25);
            __Pyx_XGOTREF(__pyx_t_24);
            __pyx_t_22 = __pyx_lineno; __pyx_t_9 = __pyx_clineno; __pyx_t_33 = __pyx_filename;
            {
              free(__pyx_v_floats);
            }
            __Pyx_XGIVEREF(__pyx_t_26);
            __Pyx_XGIVEREF(__pyx_t_25);
            __Pyx_XGIVEREF(__pyx_t_24);
            __Pyx_ExceptionReset(__pyx_t_26, __pyx_t_25, __pyx_t_24);
            __Pyx_XGIVEREF(__pyx_t_29);
            __Pyx_XGIVEREF(__pyx_t_28);
            __Pyx_XGIVEREF(__pyx_t_27);
            __Pyx_ErrRestore(__pyx_t_29, __pyx_t_28, __pyx_t_27);
            __pyx_t_29 = 0; __pyx_t_28 = 0; __pyx_t_27 = 0; __pyx_t_26 = 0; __pyx_t_25 = 0; __pyx_t_24 = 0;
            __pyx_lineno = __pyx_t_22; __pyx_clineno = __pyx_t_9; __pyx_filename = __pyx_t_33;
            goto __pyx_L1_error;
          }
          __pyx_L53:;
        }

        /* "opengl/modern/glsl_program.pyx":223
 *                     finally:
 *                         free(floats)
 *                 elif uniform_type == 'vec3[]':             # <<<<<<<<<<<<<<
 *                     l = len(value)
 *                     floats = <GLfloat *> malloc(3 * l * sizeof(GLfloat))
*/
        goto __pyx_L9;
      }

      /* "opengl/modern/glsl_program.pyx":233
 *                     finally:
 *                         free(floats)
 *                 elif uniform_type == 'vec4[]':             # <<<<<<<<<<<<<<
 *                     l = len(value)
 *                     floats = <GLfloat *> malloc(4 * l * sizeof(GLfloat))
*/
      __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_uniform_type, __pyx_mstate_global->__pyx_kp_u_vec4, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(30, 233, __pyx_L1_error)
      if (__pyx_t_1) {

        /* "opengl/modern/glsl_program.pyx":234
 *                         free(floats)
 *                 elif uniform_type == 'vec4[]':
 *                     l = len(value)             # <<<<<<<<<<<<<<
 *                     floats = <GLfloat *> malloc(4 * l * sizeof(GLfloat))
 *                     try:
*/
        __pyx_t_13 = PyObject_Length(__pyx_v_value); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(30, 234, __pyx_L1_error)
        __pyx_v_l = __pyx_t_13;

        /* "opengl/modern/glsl_program.pyx":235
 *                 elif uniform_type == 'vec4[]':
 *                     l = len(value)
 *                     floats = <GLfloat *> malloc(4 * l * sizeof(GLfloat))             # <<<<<<<<<<<<<<
 *                     try:
 *                         for i in range(l):
*/
        __pyx_v_floats = ((GLfloat *)malloc(((4 * __pyx_v_l) * (sizeof(GLfloat)))));

        /* "opengl/modern/glsl_program.pyx":236
 *                     l = len(value)
 *                     floats = <GLfloat *> malloc(4 * l * sizeof(GLfloat))
 *                     try:             # <<<<<<<<<<<<<<
 *                         for i in range(l):
 *                             for j in range(4):
*/
        /*try:*/ {

          /* "opengl/modern/glsl_program.pyx":237
 *                     floats = <GLfloat *> malloc(4 * l * sizeof(GLfloat))
 *                     try:
 *                         for i in range(l):             # <<<<<<<<<<<<<<
 *                             for j in range(4):
 *                                 floats[4 * i + j] = value[i][j]
*/
          __pyx_t_5 = __pyx_v_l;
          __pyx_t_19 = __pyx_t_5;
          for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_19; __pyx_t_21+=1) {
            __pyx_v_i = __pyx_t_21;

            /* "opengl/modern/glsl_program.pyx":238
 *                     try:
 *                         for i in range(l):
 *                             for j in range(4):             # <<<<<<<<<<<<<<
 *                                 floats[4 * i + j] = value[i][j]
 *                         glUniform4fv(loc, l, floats)
*/
            for (__pyx_t_31 = 0; __pyx_t_31 < 4; __pyx_t_31+=1) {
              __pyx_v_j = __pyx_t_31;

              /* "opengl/modern/glsl_program.pyx":239
 *                         for i in range(l):
 *                             for j in range(4):
 *                                 floats[4 * i + j] = value[i][j]             # <<<<<<<<<<<<<<
 *                         glUniform4fv(loc, l, floats)
 *                     finally:
*/
              __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_value, __pyx_v_i, size_t, 0, __Pyx_PyLong_FromSize_t, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(30, 239, __pyx_L65_error)
              __Pyx_GOTREF(__pyx_t_3);
              __pyx_t_10 = __Pyx_GetItemInt(__pyx_t_3, __pyx_v_j, size_t, 0, __Pyx_PyLong_FromSize_t, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_10)) __PYX_ERR(30, 239, __pyx_L65_error)
              __Pyx_GOTREF(__pyx_t_10);
              __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
              __pyx_t_20 = __Pyx_PyFloat_AsFloat(__pyx_t_10); if (unlikely((__pyx_t_20 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(30, 239, __pyx_L65_error)
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
              (__pyx_v_floats[((4 * __pyx_v_i) + __pyx_v_j)]) = __pyx_t_20;
            }
          }

          /* "opengl/modern/glsl_program.pyx":240
 *                             for j in range(4):
 *                                 floats[4 * i + j] = value[i][j]
 *                         glUniform4fv(loc, l, floats)             # <<<<<<<<<<<<<<
 *                     finally:
 *                         free(floats)
*/
          glUniform4fv(__pyx_v_loc, __pyx_v_l, __pyx_v_floats);
        }

        /* "opengl/modern/glsl_program.pyx":242
 *                         glUniform4fv(loc, l, floats)
 *                     finally:
 *                         free(floats)             # <<<<<<<<<<<<<<
 *                 elif uniform_type == 'mat2[]':
 *                     l = len(value)
*/
        /*finally:*/ {
          /*normal exit:*/{
            free(__pyx_v_floats);
            goto __pyx_L66;
          }
          __pyx_L65_error:;
          /*exception exit:*/{
            __Pyx_PyThreadState_declare
            __Pyx_PyThreadState_assign
            __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0; __pyx_t_27 = 0; __pyx_t_28 = 0; __pyx_t_29 = 0;
            __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
            __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
             __Pyx_ExceptionSwap(&__pyx_t_27, &__pyx_t_28, &__pyx_t_29);
            if ( unlikely(__Pyx_GetException(&__pyx_t_24, &__pyx_t_25, &__pyx_t_26) < 0)) __Pyx_ErrFetch(&__pyx_t_24, &__pyx_t_25, &__pyx_t_26);
            __Pyx_XGOTREF(__pyx_t_24);
            __Pyx_XGOTREF(__pyx_t_25);
            __Pyx_XGOTREF(__pyx_t_26);
            __Pyx_XGOTREF(__pyx_t_27);
            __Pyx_XGOTREF(__pyx_t_28);
            __Pyx_XGOTREF(__pyx_t_29);
            __pyx_t_9 = __pyx_lineno; __pyx_t_22 = __pyx_clineno; __pyx_t_34 = __pyx_filename;
            {
              free(__pyx_v_floats);
            }
            __Pyx_XGIVEREF(__pyx_t_27);
            __Pyx_XGIVEREF(__pyx_t_28);
            __Pyx_XGIVEREF(__pyx_t_29);
            __Pyx_ExceptionReset(__pyx_t_27, __pyx_t_28, __pyx_t_29);
            __Pyx_XGIVEREF(__pyx_t_24);
            __Pyx_XGIVEREF(__pyx_t_25);
            __Pyx_XGIVEREF(__pyx_t_26);
            __Pyx_ErrRestore(__pyx_t_24, __pyx_t_25, __pyx_t_26);
            __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0; __pyx_t_27 = 0; __pyx_t_28 = 0; __pyx_t_29 = 0;
            __pyx_lineno = __pyx_t_9; __pyx_clineno = __pyx_t_22; __pyx_filename = __pyx_t_34;
            goto __pyx_L1_error;
          }
          __pyx_L66:;
        }

        /* "opengl/modern/glsl_program.pyx":233
 *                     finally:
 *                         free(floats)
 *                 elif uniform_type == 'vec4[]':             # <<<<<<<<<<<<<<
 *                     l = len(value)
 *                     floats = <GLfloat *> malloc(4 * l * sizeof(GLfloat))
*/
        goto __pyx_L9;
      }

      /* "opengl/modern/glsl_program.pyx":243
 *                     finally:
 *                         free(floats)
 *                 elif uniform_type == 'mat2[]':             # <<<<<<<<<<<<<<
 *                     l = len(value)
 *                     try:
*/
      __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_uniform_type, __pyx_mstate_global->__pyx_kp_u_mat2, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(30, 243, __pyx_L1_error)
      if (__pyx_t_1) {

        /* "opengl/modern/glsl_program.pyx":244
 *                         free(floats)
 *                 elif uniform_type == 'mat2[]':
 *                     l = len(value)             # <<<<<<<<<<<<<<
 *                     try:
 *                         floats = _convert_matrices_to_floats(
*/
        __pyx_t_13 = PyObject_Length(__pyx_v_value); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(30, 244, __pyx_L1_error)
        __pyx_v_l = __pyx_t_13;

        /* "opengl/modern/glsl_program.pyx":245
 *                 elif uniform_type == 'mat2[]':
 *                     l = len(value)
 *                     try:             # <<<<<<<<<<<<<<
 *                         floats = _convert_matrices_to_floats(
 *                             value, l, 2, 2)
*/
        /*try:*/ {

          /* "opengl/modern/glsl_program.pyx":247
 *                     try:
 *                         floats = _convert_matrices_to_floats(
 *                             value, l, 2, 2)             # <<<<<<<<<<<<<<
 *                         glUniformMatrix2fv(loc, l,
 *                                            0, # transpose = false
*/
          __pyx_t_10 = __Pyx_PyLong_FromSize_t(__pyx_v_l); if (unlikely(!__pyx_t_10)) __PYX_ERR(30, 247, __pyx_L78_error)
          __Pyx_GOTREF(__pyx_t_10);

          /* "opengl/modern/glsl_program.pyx":246
 *                     l = len(value)
 *                     try:
 *                         floats = _convert_matrices_to_floats(             # <<<<<<<<<<<<<<
 *                             value, l, 2, 2)
 *                         glUniformMatrix2fv(loc, l,
*/
          __pyx_t_35 = __pyx_f_8CyOpenGL__convert_matrices_to_floats(__pyx_v_value, __pyx_t_10, __pyx_mstate_global->__pyx_int_2, __pyx_mstate_global->__pyx_int_2); if (unlikely(__pyx_t_35 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(30, 246, __pyx_L78_error)
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_v_floats = __pyx_t_35;

          /* "opengl/modern/glsl_program.pyx":248
 *                         floats = _convert_matrices_to_floats(
 *                             value, l, 2, 2)
 *                         glUniformMatrix2fv(loc, l,             # <<<<<<<<<<<<<<
 *                                            0, # transpose = false
 *                                            floats)
*/
          glUniformMatrix2fv(__pyx_v_loc, __pyx_v_l, 0, __pyx_v_floats);
        }

        /* "opengl/modern/glsl_program.pyx":252
 *                                            floats)
 *                     finally:
 *                         free(floats)             # <<<<<<<<<<<<<<
 *                 elif uniform_type == 'mat2x3[]':
 *                     l = len(value)
*/
        /*finally:*/ {
          /*normal exit:*/{
            free(__pyx_v_floats);
            goto __pyx_L79;
          }
          __pyx_L78_error:;
          /*exception exit:*/{
            __Pyx_PyThreadState_declare
            __Pyx_PyThreadState_assign
            __pyx_t_29 = 0; __pyx_t_28 = 0; __pyx_t_27 = 0; __pyx_t_26 = 0; __pyx_t_25 = 0; __pyx_t_24 = 0;
            __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
            __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
             __Pyx_ExceptionSwap(&__pyx_t_26, &__pyx_t_25, &__pyx_t_24);
            if ( unlikely(__Pyx_GetException(&__pyx_t_29, &__pyx_t_28, &__pyx_t_27) < 0)) __Pyx_ErrFetch(&__pyx_t_29, &__pyx_t_28, &__pyx_t_27);
            __Pyx_XGOTREF(__pyx_t_29);
            __Pyx_XGOTREF(__pyx_t_28);
            __Pyx_XGOTREF(__pyx_t_27);
            __Pyx_XGOTREF(__pyx_t_26);
            __Pyx_XGOTREF(__pyx_t_25);
            __Pyx_XGOTREF(__pyx_t_24);
            __pyx_t_22 = __pyx_lineno; __pyx_t_9 = __pyx_clineno; __pyx_t_36 = __pyx_filename;
            {
              free(__pyx_v_floats);
            }
            __Pyx_XGIVEREF(__pyx_t_26);
            __Pyx_XGIVEREF(__pyx_t_25);
            __Pyx_XGIVEREF(__pyx_t_24);
            __Pyx_ExceptionReset(__pyx_t_26, __pyx_t_25, __pyx_t_24);
            __Pyx_XGIVEREF(__pyx_t_29);
            __Pyx_XGIVEREF(__pyx_t_28);
            __Pyx_XGIVEREF(__pyx_t_27);
            __Pyx_ErrRestore(__pyx_t_29, __pyx_t_28, __pyx_t_27);
            __pyx_t_29 = 0; __pyx_t_28 = 0; __pyx_t_27 = 0; __pyx_t_26 = 0; __pyx_t_25 = 0; __pyx_t_24 = 0;
            __pyx_lineno = __pyx_t_22; __pyx_clineno = __pyx_t_9; __pyx_filename = __pyx_t_36;
            goto __pyx_L1_error;
          }
          __pyx_L79:;
        }

        /* "opengl/modern/glsl_program.pyx":243
 *                     finally:
 *                         free(floats)
 *                 elif uniform_type == 'mat2[]':             # <<<<<<<<<<<<<<
 *                     l = len(value)
 *                     try:
*/
        goto __pyx_L9;
      }

      /* "opengl/modern/glsl_program.pyx":253
 *                     finally:
 *                         free(floats)
 *                 elif uniform_type == 'mat2x3[]':             # <<<<<<<<<<<<<<
 *                     l = len(value)
 *                     try:
*/
      __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_uniform_type, __pyx_mstate_global->__pyx_kp_u_mat2x3, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(30, 253, __pyx_L1_error)
      if (__pyx_t_1) {

        /* "opengl/modern/glsl_program.pyx":254
 *                         free(floats)
 *                 elif uniform_type == 'mat2x3[]':
 *                     l = len(value)             # <<<<<<<<<<<<<<
 *                     try:
 *                         floats = _convert_matrices_to_floats(
*/
        __pyx_t_13 = PyObject_Length(__pyx_v_value); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(30, 254, __pyx_L1_error)
        __pyx_v_l = __pyx_t_13;

        /* "opengl/modern/glsl_program.pyx":255
 *                 elif uniform_type == 'mat2x3[]':
 *                     l = len(value)
 *                     try:             # <<<<<<<<<<<<<<
 *                         floats = _convert_matrices_to_floats(
 *                             value, l, 2, 3)
*/
        /*try:*/ {

          /* "opengl/modern/glsl_program.pyx":257
 *                     try:
 *                         floats = _convert_matrices_to_floats(
 *                             value, l, 2, 3)             # <<<<<<<<<<<<<<
 *                         glUniformMatrix2x3fv(loc, l,
 *                                              0, # transpose = false
*/
          __pyx_t_10 = __Pyx_PyLong_FromSize_t(__pyx_v_l); if (unlikely(!__pyx_t_10)) __PYX_ERR(30, 257, __pyx_L87_error)
          __Pyx_GOTREF(__pyx_t_10);

          /* "opengl/modern/glsl_program.pyx":256
 *                     l = len(value)
 *                     try:
 *                         floats = _convert_matrices_to_floats(             # <<<<<<<<<<<<<<
 *                             value, l, 2, 3)
 *                         glUniformMatrix2x3fv(loc, l,
*/
          __pyx_t_35 = __pyx_f_8CyOpenGL__convert_matrices_to_floats(__pyx_v_value, __pyx_t_10, __pyx_mstate_global->__pyx_int_2, __pyx_mstate_global->__pyx_int_3); if (unlikely(__pyx_t_35 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(30, 256, __pyx_L87_error)
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_v_floats = __pyx_t_35;

          /* "opengl/modern/glsl_program.pyx":258
 *                         floats = _convert_matrices_to_floats(
 *                             value, l, 2, 3)
 *                         glUniformMatrix2x3fv(loc, l,             # <<<<<<<<<<<<<<
 *                                              0, # transpose = false
 *                                              floats)
*/
          glUniformMatrix2x3fv(__pyx_v_loc, __pyx_v_l, 0, __pyx_v_floats);
        }

        /* "opengl/modern/glsl_program.pyx":262
 *                                              floats)
 *                     finally:
 *                         free(floats)             # <<<<<<<<<<<<<<
 *                 elif uniform_type == 'mat3x2[]':
 *                     l = len(value)
*/
        /*finally:*/ {
          /*normal exit:*/{
            free(__pyx_v_floats);
            goto __pyx_L88;
          }
          __pyx_L87_error:;
          /*exception exit:*/{
            __Pyx_PyThreadState_declare
            __Pyx_PyThreadState_assign
            __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0; __pyx_t_27 = 0; __pyx_t_28 = 0; __pyx_t_29 = 0;
            __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
            __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
             __Pyx_ExceptionSwap(&__pyx_t_27, &__pyx_t_28, &__pyx_t_29);
            if ( unlikely(__Pyx_GetException(&__pyx_t_24, &__pyx_t_25, &__pyx_t_26) < 0)) __Pyx_ErrFetch(&__pyx_t_24, &__pyx_t_25, &__pyx_t_26);
            __Pyx_XGOTREF(__pyx_t_24);
            __Pyx_XGOTREF(__pyx_t_25);
            __Pyx_XGOTREF(__pyx_t_26);
            __Pyx_XGOTREF(__pyx_t_27);
            __Pyx_XGOTREF(__pyx_t_28);
            __Pyx_XGOTREF(__pyx_t_29);
            __pyx_t_9 = __pyx_lineno; __pyx_t_22 = __pyx_clineno; __pyx_t_37 = __pyx_filename;
            {
              free(__pyx_v_floats);
            }
            __Pyx_XGIVEREF(__pyx_t_27);
            __Pyx_XGIVEREF(__pyx_t_28);
            __Pyx_XGIVEREF(__pyx_t_29);
            __Pyx_ExceptionReset(__pyx_t_27, __pyx_t_28, __pyx_t_29);
            __Pyx_XGIVEREF(__pyx_t_24);
            __Pyx_XGIVEREF(__pyx_t_25);
            __Pyx_XGIVEREF(__pyx_t_26);
            __Pyx_ErrRestore(__pyx_t_24, __pyx_t_25, __pyx_t_26);
            __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0; __pyx_t_27 = 0; __pyx_t_28 = 0; __pyx_t_29 = 0;
            __pyx_lineno = __pyx_t_9; __pyx_clineno = __pyx_t_22; __pyx_filename = __pyx_t_37;
            goto __pyx_L1_error;
          }
          __pyx_L88:;
        }

        /* "opengl/modern/glsl_program.pyx":253
 *                     finally:
 *                         free(floats)
 *                 elif uniform_type == 'mat2x3[]':             # <<<<<<<<<<<<<<
 *                     l = len(value)
 *                     try:
*/
        goto __pyx_L9;
      }

      /* "opengl/modern/glsl_program.pyx":263
 *                     finally:
 *                         free(floats)
 *                 elif uniform_type == 'mat3x2[]':             # <<<<<<<<<<<<<<
 *                     l = len(value)
 *                     try:
*/
      __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_uniform_type, __pyx_mstate_global->__pyx_kp_u_mat3x2, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(30, 263, __pyx_L1_error)
      if (__pyx_t_1) {

        /* "opengl/modern/glsl_program.pyx":264
 *                         free(floats)
 *                 elif uniform_type == 'mat3x2[]':
 *                     l = len(value)             # <<<<<<<<<<<<<<
 *                     try:
 *                         floats = _convert_matrices_to_floats(
*/
        __pyx_t_13 = PyObject_Length(__pyx_v_value); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(30, 264, __pyx_L1_error)
        __pyx_v_l = __pyx_t_13;

        /* "opengl/modern/glsl_program.pyx":265
 *                 elif uniform_type == 'mat3x2[]':
 *                     l = len(value)
 *                     try:             # <<<<<<<<<<<<<<
 *                         floats = _convert_matrices_to_floats(
 *                             value, l, 3, 2)
*/
        /*try:*/ {

          /* "opengl/modern/glsl_program.pyx":267
 *                     try:
 *                         floats = _convert_matrices_to_floats(
 *                             value, l, 3, 2)             # <<<<<<<<<<<<<<
 *                         glUniformMatrix3x2fv(loc, l,
 *                                              0, # transpose = false
*/
          __pyx_t_10 = __Pyx_PyLong_FromSize_t(__pyx_v_l); if (unlikely(!__pyx_t_10)) __PYX_ERR(30, 267, __pyx_L96_error)
          __Pyx_GOTREF(__pyx_t_10);

          /* "opengl/modern/glsl_program.pyx":266
 *                     l = len(value)
 *                     try:
 *                         floats = _convert_matrices_to_floats(             # <<<<<<<<<<<<<<
 *                             value, l, 3, 2)
 *                         glUniformMatrix3x2fv(loc, l,
*/
          __pyx_t_35 = __pyx_f_8CyOpenGL__convert_matrices_to_floats(__pyx_v_value, __pyx_t_10, __pyx_mstate_global->__pyx_int_3, __pyx_mstate_global->__pyx_int_2); if (unlikely(__pyx_t_35 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(30, 266, __pyx_L96_error)
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_v_floats = __pyx_t_35;

          /* "opengl/modern/glsl_program.pyx":268
 *                         floats = _convert_matrices_to_floats(
 *                             value, l, 3, 2)
 *                         glUniformMatrix3x2fv(loc, l,             # <<<<<<<<<<<<<<
 *                                              0, # transpose = false
 *                                              floats)
*/
          glUniformMatrix3x2fv(__pyx_v_loc, __pyx_v_l, 0, __pyx_v_floats);
        }

        /* "opengl/modern/glsl_program.pyx":272
 *                                              floats)
 *                     finally:
 *                         free(floats)             # <<<<<<<<<<<<<<
 *                 elif uniform_type == 'mat4[]':
 *                     l = len(value)
*/
        /*finally:*/ {
          /*normal exit:*/{
            free(__pyx_v_floats);
            goto __pyx_L97;
          }
          __pyx_L96_error:;
          /*exception exit:*/{
            __Pyx_PyThreadState_declare
            __Pyx_PyThreadState_assign
            __pyx_t_29 = 0; __pyx_t_28 = 0; __pyx_t_27 = 0; __pyx_t_26 = 0; __pyx_t_25 = 0; __pyx_t_24 = 0;
            __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
            __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
             __Pyx_ExceptionSwap(&__pyx_t_26, &__pyx_t_25, &__pyx_t_24);
            if ( unlikely(__Pyx_GetException(&__pyx_t_29, &__pyx_t_28, &__pyx_t_27) < 0)) __Pyx_ErrFetch(&__pyx_t_29, &__pyx_t_28, &__pyx_t_27);
            __Pyx_XGOTREF(__pyx_t_29);
            __Pyx_XGOTREF(__pyx_t_28);
            __Pyx_XGOTREF(__pyx_t_27);
            __Pyx_XGOTREF(__pyx_t_26);
            __Pyx_XGOTREF(__pyx_t_25);
            __Pyx_XGOTREF(__pyx_t_24);
            __pyx_t_22 = __pyx_lineno; __pyx_t_9 = __pyx_clineno; __pyx_t_38 = __pyx_filename;
            {
              free(__pyx_v_floats);
            }
            __Pyx_XGIVEREF(__pyx_t_26);
            __Pyx_XGIVEREF(__pyx_t_25);
            __Pyx_XGIVEREF(__pyx_t_24);
            __Pyx_ExceptionReset(__pyx_t_26, __pyx_t_25, __pyx_t_24);
            __Pyx_XGIVEREF(__pyx_t_29);
            __Pyx_XGIVEREF(__pyx_t_28);
            __Pyx_XGIVEREF(__pyx_t_27);
            __Pyx_ErrRestore(__pyx_t_29, __pyx_t_28, __pyx_t_27);
            __pyx_t_29 = 0; __pyx_t_28 = 0; __pyx_t_27 = 0; __pyx_t_26 = 0; __pyx_t_25 = 0; __pyx_t_24 = 0;
            __pyx_lineno = __pyx_t_22; __pyx_clineno = __pyx_t_9; __pyx_filename = __pyx_t_38;
            goto __pyx_L1_error;
          }
          __pyx_L97:;
        }

        /* "opengl/modern/glsl_program.pyx":263
 *                     finally:
 *                         free(floats)
 *                 elif uniform_type == 'mat3x2[]':             # <<<<<<<<<<<<<<
 *                     l = len(value)
 *                     try:
*/
        goto __pyx_L9;
      }

      /* "opengl/modern/glsl_program.pyx":273
 *                     finally:
 *                         free(floats)
 *                 elif uniform_type == 'mat4[]':             # <<<<<<<<<<<<<<
 *                     l = len(value)
 *                     try:
*/
      __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_uniform_type, __pyx_mstate_global->__pyx_kp_u_mat4, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(30, 273, __pyx_L1_error)
      if (likely(__pyx_t_1)) {

        /* "opengl/modern/glsl_program.pyx":274
 *                         free(floats)
 *                 elif uniform_type == 'mat4[]':
 *                     l = len(value)             # <<<<<<<<<<<<<<
 *                     try:
 *                         floats = _convert_matrices_to_floats(
*/
        __pyx_t_13 = PyObject_Length(__pyx_v_value); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(30, 274, __pyx_L1_error)
        __pyx_v_l = __pyx_t_13;

        /* "opengl/modern/glsl_program.pyx":275
 *                 elif uniform_type == 'mat4[]':
 *                     l = len(value)
 *                     try:             # <<<<<<<<<<<<<<
 *                         floats = _convert_matrices_to_floats(
 *                             value, l, 4, 4)
*/
        /*try:*/ {

          /* "opengl/modern/glsl_program.pyx":277
 *                     try:
 *                         floats = _convert_matrices_to_floats(
 *                             value, l, 4, 4)             # <<<<<<<<<<<<<<
 *                         glUniformMatrix4fv(loc, l,
 *                                            0, # transpose = false
*/
          __pyx_t_10 = __Pyx_PyLong_FromSize_t(__pyx_v_l); if (unlikely(!__pyx_t_10)) __PYX_ERR(30, 277, __pyx_L105_error)
          __Pyx_GOTREF(__pyx_t_10);

          /* "opengl/modern/glsl_program.pyx":276
 *                     l = len(value)
 *                     try:
 *                         floats = _convert_matrices_to_floats(             # <<<<<<<<<<<<<<
 *                             value, l, 4, 4)
 *                         glUniformMatrix4fv(loc, l,
*/
          __pyx_t_35 = __pyx_f_8CyOpenGL__convert_matrices_to_floats(__pyx_v_value, __pyx_t_10, __pyx_mstate_global->__pyx_int_4, __pyx_mstate_global->__pyx_int_4); if (unlikely(__pyx_t_35 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(30, 276, __pyx_L105_error)
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_v_floats = __pyx_t_35;

          /* "opengl/modern/glsl_program.pyx":278
 *                         floats = _convert_matrices_to_floats(
 *                             value, l, 4, 4)
 *                         glUniformMatrix4fv(loc, l,             # <<<<<<<<<<<<<<
 *                                            0, # transpose = false
 *                                            floats)
*/
          glUniformMatrix4fv(__pyx_v_loc, __pyx_v_l, 0, __pyx_v_floats);
        }

        /* "opengl/modern/glsl_program.pyx":282
 *                                            floats)
 *                     finally:
 *                         free(floats)             # <<<<<<<<<<<<<<
 *                 else:
 *                     raise Exception(
*/
        /*finally:*/ {
          /*normal exit:*/{
            free(__pyx_v_floats);
            goto __pyx_L106;
          }
          __pyx_L105_error:;
          /*exception exit:*/{
            __Pyx_PyThreadState_declare
            __Pyx_PyThreadState_assign
            __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0; __pyx_t_27 = 0; __pyx_t_28 = 0; __pyx_t_29 = 0;
            __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
            __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
             __Pyx_ExceptionSwap(&__pyx_t_27, &__pyx_t_28, &__pyx_t_29);
            if ( unlikely(__Pyx_GetException(&__pyx_t_24, &__pyx_t_25, &__pyx_t_26) < 0)) __Pyx_ErrFetch(&__pyx_t_24, &__pyx_t_25, &__pyx_t_26);
            __Pyx_XGOTREF(__pyx_t_24);
            __Pyx_XGOTREF(__pyx_t_25);
            __Pyx_XGOTREF(__pyx_t_26);
            __Pyx_XGOTREF(__pyx_t_27);
            __Pyx_XGOTREF(__pyx_t_28);
            __Pyx_XGOTREF(__pyx_t_29);
            __pyx_t_9 = __pyx_lineno; __pyx_t_22 = __pyx_clineno; __pyx_t_39 = __pyx_filename;
            {
              free(__pyx_v_floats);
            }
            __Pyx_XGIVEREF(__pyx_t_27);
            __Pyx_XGIVEREF(__pyx_t_28);
            __Pyx_XGIVEREF(__pyx_t_29);
            __Pyx_ExceptionReset(__pyx_t_27, __pyx_t_28, __pyx_t_29);
            __Pyx_XGIVEREF(__pyx_t_24);
            __Pyx_XGIVEREF(__pyx_t_25);
            __Pyx_XGIVEREF(__pyx_t_26);
            __Pyx_ErrRestore(__pyx_t_24, __pyx_t_25, __pyx_t_26);
            __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0; __pyx_t_27 = 0; __pyx_t_28 = 0; __pyx_t_29 = 0;
            __pyx_lineno = __pyx_t_9; __pyx_clineno = __pyx_t_22; __pyx_filename = __pyx_t_39;
            goto __pyx_L1_error;
          }
          __pyx_L106:;
        }

        /* "opengl/modern/glsl_program.pyx":273
 *                     finally:
 *                         free(floats)
 *                 elif uniform_type == 'mat4[]':             # <<<<<<<<<<<<<<
 *                     l = len(value)
 *                     try:
*/
        goto __pyx_L9;
      }

      /* "opengl/modern/glsl_program.pyx":284
 *                         free(floats)
 *                 else:
 *                     raise Exception(             # <<<<<<<<<<<<<<
 *                         "Unsupported uniform type %s" % uniform_type)
 * 
*/
      /*else*/ {
        __pyx_t_3 = NULL;

        /* "opengl/modern/glsl_program.pyx":285
 *                 else:
 *                     raise Exception(
 *                         "Unsupported uniform type %s" % uniform_type)             # <<<<<<<<<<<<<<
 * 
 *                 print_gl_errors("uniform")
*/
        __pyx_t_4 = __Pyx_PyUnicode_FormatSafe(__pyx_mstate_global->__pyx_kp_u_Unsupported_uniform_type_s, __pyx_v_uniform_type); if (unlikely(!__pyx_t_4)) __PYX_ERR(30, 285, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = 1;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4};
          __pyx_t_10 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_Exception)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_10)) __PYX_ERR(30, 284, __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(30, 284, __pyx_L1_error)
      }
      __pyx_L9:;

      /* "opengl/modern/glsl_program.pyx":287
 *                         "Unsupported uniform type %s" % uniform_type)
 * 
 *                 print_gl_errors("uniform")             # <<<<<<<<<<<<<<
 * 
 *             else:
*/
      __pyx_t_4 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_print_gl_errors); if (unlikely(!__pyx_t_3)) __PYX_ERR(30, 287, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        assert(__pyx_t_4);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
        __pyx_t_5 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_n_u_uniform};
        __pyx_t_10 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_10)) __PYX_ERR(30, 287, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
      }
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

      /* "opengl/modern/glsl_program.pyx":175
 *             uniform_name = name_parts[-1]
 * 
 *             if len(name_parts) == 1:             # <<<<<<<<<<<<<<
 *                 loc = glGetUniformLocation(self._glsl_program,
 *                                            uniform_name.encode('ascii'))
*/
      goto __pyx_L8;
    }

    /* "opengl/modern/glsl_program.pyx":291
 *             else:
 * 
 *                 block_name = name_parts[0]             # <<<<<<<<<<<<<<
 *                 self._name_to_uniform_block[block_name].set(
 *                     uniform_name, uniform_type, value)
*/
    /*else*/ {
      __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_name_parts, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_10)) __PYX_ERR(30, 291, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_XDECREF_SET(__pyx_v_block_name, __pyx_t_10);
      __pyx_t_10 = 0;

      /* "opengl/modern/glsl_program.pyx":292
 * 
 *                 block_name = name_parts[0]
 *                 self._name_to_uniform_block[block_name].set(             # <<<<<<<<<<<<<<
 *                     uniform_name, uniform_type, value)
 * 
*/
      __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_self->_name_to_uniform_block, __pyx_v_block_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(30, 292, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __pyx_t_4;
      __Pyx_INCREF(__pyx_t_3);

      /* "opengl/modern/glsl_program.pyx":293
 *                 block_name = name_parts[0]
 *                 self._name_to_uniform_block[block_name].set(
 *                     uniform_name, uniform_type, value)             # <<<<<<<<<<<<<<
 * 
 *         for i, (block_name, buffer_object) in enumerate(
*/
      __pyx_t_5 = 0;
      {
        PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_v_uniform_name, __pyx_v_uniform_type, __pyx_v_value};
        __pyx_t_10 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_set, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_10)) __PYX_ERR(30, 292, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
      }
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    }
    __pyx_L8:;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opengl/modern/glsl_program.pyx":295
 *                     uniform_name, uniform_type, value)
 * 
 *         for i, (block_name, buffer_object) in enumerate(             # <<<<<<<<<<<<<<
 *                                     self._name_to_uniform_block.items()):
 *             block_index = glGetUniformBlockIndex(
*/
  __pyx_t_5 = 0;
  __pyx_t_7 = 0;

  /* "opengl/modern/glsl_program.pyx":296
 * 
 *         for i, (block_name, buffer_object) in enumerate(
 *                                     self._name_to_uniform_block.items()):             # <<<<<<<<<<<<<<
 *             block_index = glGetUniformBlockIndex(
 *                 self._glsl_program, block_name.encode('ascii'))
*/
  if (unlikely(__pyx_v_self->_name_to_uniform_block == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
    __PYX_ERR(30, 296, __pyx_L1_error)
  }

  /* "opengl/modern/glsl_program.pyx":295
 *                     uniform_name, uniform_type, value)
 * 
 *         for i, (block_name, buffer_object) in enumerate(             # <<<<<<<<<<<<<<
 *                                     self._name_to_uniform_block.items()):
 *             block_index = glGetUniformBlockIndex(
*/
  __pyx_t_10 = __Pyx_dict_iterator(__pyx_v_self->_name_to_uniform_block, 0, __pyx_mstate_global->__pyx_n_u_items, (&__pyx_t_6), (&__pyx_t_8)); if (unlikely(!__pyx_t_10)) __PYX_ERR(30, 296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_2);
  __pyx_t_2 = __pyx_t_10;
  __pyx_t_10 = 0;
  while (1) {

    /* "opengl/modern/glsl_program.pyx":296
 * 
 *         for i, (block_name, buffer_object) in enumerate(
 *                                     self._name_to_uniform_block.items()):             # <<<<<<<<<<<<<<
 *             block_index = glGetUniformBlockIndex(
 *                 self._glsl_program, block_name.encode('ascii'))
*/
    __pyx_t_22 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_6, &__pyx_t_7, &__pyx_t_10, &__pyx_t_4, NULL, __pyx_t_8);
    if (unlikely(__pyx_t_22 == 0)) break;
    if (unlikely(__pyx_t_22 == -1)) __PYX_ERR(30, 296, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_GOTREF(__pyx_t_4);

    /* "opengl/modern/glsl_program.pyx":295
 *                     uniform_name, uniform_type, value)
 * 
 *         for i, (block_name, buffer_object) in enumerate(             # <<<<<<<<<<<<<<
 *                                     self._name_to_uniform_block.items()):
 *             block_index = glGetUniformBlockIndex(
*/
    __Pyx_XDECREF_SET(__pyx_v_block_name, __pyx_t_10);
    __pyx_t_10 = 0;
    __Pyx_XDECREF_SET(__pyx_v_buffer_object, __pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_v_i = __pyx_t_5;
    __pyx_t_5 = (__pyx_t_5 + 1);

    /* "opengl/modern/glsl_program.pyx":298
 *                                     self._name_to_uniform_block.items()):
 *             block_index = glGetUniformBlockIndex(
 *                 self._glsl_program, block_name.encode('ascii'))             # <<<<<<<<<<<<<<
 * 
 *             if block_index != GL_INVALID_INDEX:
*/
    __pyx_t_10 = __pyx_v_block_name;
    __Pyx_INCREF(__pyx_t_10);
    __pyx_t_19 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_mstate_global->__pyx_n_u_ascii};
      __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_encode, __pyx_callargs+__pyx_t_19, (2-__pyx_t_19) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(30, 298, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __pyx_t_40 = __Pyx_PyObject_AsString(__pyx_t_4); if (unlikely((!__pyx_t_40) && PyErr_Occurred())) __PYX_ERR(30, 298, __pyx_L1_error)

    /* "opengl/modern/glsl_program.pyx":297
 *         for i, (block_name, buffer_object) in enumerate(
 *                                     self._name_to_uniform_block.items()):
 *             block_index = glGetUniformBlockIndex(             # <<<<<<<<<<<<<<
 *                 self._glsl_program, block_name.encode('ascii'))
 * 
*/
    __pyx_v_block_index = glGetUniformBlockIndex(__pyx_v_self->_glsl_program, __pyx_t_40);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "opengl/modern/glsl_program.pyx":300
 *                 self._glsl_program, block_name.encode('ascii'))
 * 
 *             if block_index != GL_INVALID_INDEX:             # <<<<<<<<<<<<<<
 *                 glUniformBlockBinding(
 *                     self._glsl_program, block_index, i)
*/
    __pyx_t_1 = (__pyx_v_block_index != GL_INVALID_INDEX);
    if (__pyx_t_1) {

      /* "opengl/modern/glsl_program.pyx":301
 * 
 *             if block_index != GL_INVALID_INDEX:
 *                 glUniformBlockBinding(             # <<<<<<<<<<<<<<
 *                     self._glsl_program, block_index, i)
 * 
*/
      glUniformBlockBinding(__pyx_v_self->_glsl_program, __pyx_v_block_index, __pyx_v_i);

      /* "opengl/modern/glsl_program.pyx":304
 *                     self._glsl_program, block_index, i)
 * 
 *                 buffer_object.commit()             # <<<<<<<<<<<<<<
 *                 buffer_object.bind_block(i)
 * 
*/
      __pyx_t_10 = __pyx_v_buffer_object;
      __Pyx_INCREF(__pyx_t_10);
      __pyx_t_19 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_10, NULL};
        __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_commit, __pyx_callargs+__pyx_t_19, (1-__pyx_t_19) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(30, 304, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "opengl/modern/glsl_program.pyx":305
 * 
 *                 buffer_object.commit()
 *                 buffer_object.bind_block(i)             # <<<<<<<<<<<<<<
 * 
 *         print_gl_errors("uniform blocks")
*/
      __pyx_t_10 = __pyx_v_buffer_object;
      __Pyx_INCREF(__pyx_t_10);
      __pyx_t_3 = __Pyx_PyLong_FromSize_t(__pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(30, 305, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_19 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_3};
        __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_bind_block, __pyx_callargs+__pyx_t_19, (2-__pyx_t_19) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __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(30, 305, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "opengl/modern/glsl_program.pyx":300
 *                 self._glsl_program, block_name.encode('ascii'))
 * 
 *             if block_index != GL_INVALID_INDEX:             # <<<<<<<<<<<<<<
 *                 glUniformBlockBinding(
 *                     self._glsl_program, block_index, i)
*/
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opengl/modern/glsl_program.pyx":307
 *                 buffer_object.bind_block(i)
 * 
 *         print_gl_errors("uniform blocks")             # <<<<<<<<<<<<<<
 * 
 *     def use_program(self):
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_print_gl_errors); if (unlikely(!__pyx_t_3)) __PYX_ERR(30, 307, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_uniform_blocks};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(30, 307, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opengl/modern/glsl_program.pyx":141
 *         return self._is_valid
 * 
 *     def bind_uniforms(self, name_to_type_and_value):             # <<<<<<<<<<<<<<
 *         """
 *         Bind uniforms. This method can only be used after use_program
*/

  /* 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_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("CyOpenGL.GLSLProgram.bind_uniforms", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XDECREF(__pyx_v_uniform_type);
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XDECREF(__pyx_v_name_parts);
  __Pyx_XDECREF(__pyx_v_uniform_name);
  __Pyx_XDECREF(__pyx_v_block_name);
  __Pyx_XDECREF(__pyx_v_buffer_object);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opengl/modern/glsl_program.pyx":309
 *         print_gl_errors("uniform blocks")
 * 
 *     def use_program(self):             # <<<<<<<<<<<<<<
 *         """
 *         Use program. Assumes that the current GL context is the context
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_11GLSLProgram_9use_program(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_11GLSLProgram_8use_program, "GLSLProgram.use_program(self)\n\nUse program. Assumes that the current GL context is the context\nin which the program was constructed.");
static PyMethodDef __pyx_mdef_8CyOpenGL_11GLSLProgram_9use_program = {"use_program", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_11GLSLProgram_9use_program, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_11GLSLProgram_8use_program};
static PyObject *__pyx_pw_8CyOpenGL_11GLSLProgram_9use_program(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("use_program (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("use_program", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("use_program", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8CyOpenGL_11GLSLProgram_8use_program(((struct __pyx_obj_8CyOpenGL_GLSLProgram *)__pyx_v_self));

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

static PyObject *__pyx_pf_8CyOpenGL_11GLSLProgram_8use_program(struct __pyx_obj_8CyOpenGL_GLSLProgram *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("use_program", 0);

  /* "opengl/modern/glsl_program.pyx":315
 *         """
 * 
 *         glUseProgram(self._glsl_program)             # <<<<<<<<<<<<<<
 * 
 *     def delete_resource(self):
*/
  glUseProgram(__pyx_v_self->_glsl_program);

  /* "opengl/modern/glsl_program.pyx":309
 *         print_gl_errors("uniform blocks")
 * 
 *     def use_program(self):             # <<<<<<<<<<<<<<
 *         """
 *         Use program. Assumes that the current GL context is the context
*/

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

/* "opengl/modern/glsl_program.pyx":317
 *         glUseProgram(self._glsl_program)
 * 
 *     def delete_resource(self):             # <<<<<<<<<<<<<<
 *         """
 *         Delete shaders associated to program.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_11GLSLProgram_11delete_resource(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_11GLSLProgram_10delete_resource, "GLSLProgram.delete_resource(self)\n\nDelete shaders associated to program.\nNote that this happens implicitly when the GL context (widget) is\ndestroyed, but it won't happen when destroying the python object.");
static PyMethodDef __pyx_mdef_8CyOpenGL_11GLSLProgram_11delete_resource = {"delete_resource", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_11GLSLProgram_11delete_resource, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_11GLSLProgram_10delete_resource};
static PyObject *__pyx_pw_8CyOpenGL_11GLSLProgram_11delete_resource(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("delete_resource (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("delete_resource", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("delete_resource", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8CyOpenGL_11GLSLProgram_10delete_resource(((struct __pyx_obj_8CyOpenGL_GLSLProgram *)__pyx_v_self));

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

static PyObject *__pyx_pf_8CyOpenGL_11GLSLProgram_10delete_resource(struct __pyx_obj_8CyOpenGL_GLSLProgram *__pyx_v_self) {
  PyObject *__pyx_v_uniform_block = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  size_t __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("delete_resource", 0);

  /* "opengl/modern/glsl_program.pyx":324
 *         """
 * 
 *         for uniform_block in self._name_to_uniform_block.values():             # <<<<<<<<<<<<<<
 *             uniform_block.delete_resource()
 * 
*/
  __pyx_t_2 = 0;
  if (unlikely(__pyx_v_self->_name_to_uniform_block == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "values");
    __PYX_ERR(30, 324, __pyx_L1_error)
  }
  __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_self->_name_to_uniform_block, 0, __pyx_mstate_global->__pyx_n_u_values, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(30, 324, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_1);
  __pyx_t_1 = __pyx_t_5;
  __pyx_t_5 = 0;
  while (1) {
    __pyx_t_6 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, NULL, &__pyx_t_5, NULL, __pyx_t_4);
    if (unlikely(__pyx_t_6 == 0)) break;
    if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(30, 324, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_XDECREF_SET(__pyx_v_uniform_block, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "opengl/modern/glsl_program.pyx":325
 * 
 *         for uniform_block in self._name_to_uniform_block.values():
 *             uniform_block.delete_resource()             # <<<<<<<<<<<<<<
 * 
 *         glDeleteShader(self._vertex_shader)
*/
    __pyx_t_7 = __pyx_v_uniform_block;
    __Pyx_INCREF(__pyx_t_7);
    __pyx_t_8 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
      __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_delete_resource, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(30, 325, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/modern/glsl_program.pyx":327
 *             uniform_block.delete_resource()
 * 
 *         glDeleteShader(self._vertex_shader)             # <<<<<<<<<<<<<<
 *         glDeleteShader(self._fragment_shader)
 *         glDeleteProgram(self._glsl_program)
*/
  glDeleteShader(__pyx_v_self->_vertex_shader);

  /* "opengl/modern/glsl_program.pyx":328
 * 
 *         glDeleteShader(self._vertex_shader)
 *         glDeleteShader(self._fragment_shader)             # <<<<<<<<<<<<<<
 *         glDeleteProgram(self._glsl_program)
 * 
*/
  glDeleteShader(__pyx_v_self->_fragment_shader);

  /* "opengl/modern/glsl_program.pyx":329
 *         glDeleteShader(self._vertex_shader)
 *         glDeleteShader(self._fragment_shader)
 *         glDeleteProgram(self._glsl_program)             # <<<<<<<<<<<<<<
 * 
 *         self._vertex_shader = 0
*/
  glDeleteProgram(__pyx_v_self->_glsl_program);

  /* "opengl/modern/glsl_program.pyx":331
 *         glDeleteProgram(self._glsl_program)
 * 
 *         self._vertex_shader = 0             # <<<<<<<<<<<<<<
 *         self._fragment_shader = 0
 *         self._glsl_program = 0
*/
  __pyx_v_self->_vertex_shader = 0;

  /* "opengl/modern/glsl_program.pyx":332
 * 
 *         self._vertex_shader = 0
 *         self._fragment_shader = 0             # <<<<<<<<<<<<<<
 *         self._glsl_program = 0
 *         self._name_to_uniform_block = {}
*/
  __pyx_v_self->_fragment_shader = 0;

  /* "opengl/modern/glsl_program.pyx":333
 *         self._vertex_shader = 0
 *         self._fragment_shader = 0
 *         self._glsl_program = 0             # <<<<<<<<<<<<<<
 *         self._name_to_uniform_block = {}
*/
  __pyx_v_self->_glsl_program = 0;

  /* "opengl/modern/glsl_program.pyx":334
 *         self._fragment_shader = 0
 *         self._glsl_program = 0
 *         self._name_to_uniform_block = {}             # <<<<<<<<<<<<<<
*/
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(30, 334, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->_name_to_uniform_block);
  __Pyx_DECREF(__pyx_v_self->_name_to_uniform_block);
  __pyx_v_self->_name_to_uniform_block = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "opengl/modern/glsl_program.pyx":317
 *         glUseProgram(self._glsl_program)
 * 
 *     def delete_resource(self):             # <<<<<<<<<<<<<<
 *         """
 *         Delete shaders associated to program.
*/

  /* 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_7);
  __Pyx_AddTraceback("CyOpenGL.GLSLProgram.delete_resource", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_uniform_block);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opengl/modern/vertex_buffer.pyx":28
 *     cdef unsigned int _dimension
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         # Set the indices to zero so that it is safe to call bind and
 *         # delete on them when glGen... fails.
*/

/* Python wrapper */
static int __pyx_pw_8CyOpenGL_12VertexBuffer_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_8CyOpenGL_12VertexBuffer_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return -1;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__cinit__", __pyx_kwds); return -1;}
  __pyx_r = __pyx_pf_8CyOpenGL_12VertexBuffer___cinit__(((struct __pyx_obj_8CyOpenGL_VertexBuffer *)__pyx_v_self));

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

static int __pyx_pf_8CyOpenGL_12VertexBuffer___cinit__(struct __pyx_obj_8CyOpenGL_VertexBuffer *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "opengl/modern/vertex_buffer.pyx":31
 *         # Set the indices to zero so that it is safe to call bind and
 *         # delete on them when glGen... fails.
 *         self._vao = 0             # <<<<<<<<<<<<<<
 *         self._vbo = 0
 * 
*/
  __pyx_v_self->_vao = 0;

  /* "opengl/modern/vertex_buffer.pyx":32
 *         # delete on them when glGen... fails.
 *         self._vao = 0
 *         self._vbo = 0             # <<<<<<<<<<<<<<
 * 
 *         self._dimension = 4
*/
  __pyx_v_self->_vbo = 0;

  /* "opengl/modern/vertex_buffer.pyx":34
 *         self._vbo = 0
 * 
 *         self._dimension = 4             # <<<<<<<<<<<<<<
 * 
 *         clear_gl_errors()
*/
  __pyx_v_self->_dimension = 4;

  /* "opengl/modern/vertex_buffer.pyx":36
 *         self._dimension = 4
 * 
 *         clear_gl_errors()             # <<<<<<<<<<<<<<
 * 
 *         # Note that vertex array objects have some issues
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_clear_gl_errors); if (unlikely(!__pyx_t_3)) __PYX_ERR(31, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 36, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/modern/vertex_buffer.pyx":41
 *         # on Mac OS X. Checking for errors here.
 * 
 *         glGenVertexArrays(1, &self._vao)             # <<<<<<<<<<<<<<
 *         print_gl_errors("glGenVertexArrays")
 * 
*/
  glGenVertexArrays(1, (&__pyx_v_self->_vao));

  /* "opengl/modern/vertex_buffer.pyx":42
 * 
 *         glGenVertexArrays(1, &self._vao)
 *         print_gl_errors("glGenVertexArrays")             # <<<<<<<<<<<<<<
 * 
 *         glBindVertexArray(self._vao)
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_print_gl_errors); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 42, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
    __pyx_t_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_n_u_glGenVertexArrays};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 42, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/modern/vertex_buffer.pyx":44
 *         print_gl_errors("glGenVertexArrays")
 * 
 *         glBindVertexArray(self._vao)             # <<<<<<<<<<<<<<
 *         print_gl_errors("glBindVertexArray")
 * 
*/
  glBindVertexArray(__pyx_v_self->_vao);

  /* "opengl/modern/vertex_buffer.pyx":45
 * 
 *         glBindVertexArray(self._vao)
 *         print_gl_errors("glBindVertexArray")             # <<<<<<<<<<<<<<
 * 
 *         glGenBuffers(1, &self._vbo)
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_print_gl_errors); if (unlikely(!__pyx_t_3)) __PYX_ERR(31, 45, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_n_u_glBindVertexArray};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 45, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/modern/vertex_buffer.pyx":47
 *         print_gl_errors("glBindVertexArray")
 * 
 *         glGenBuffers(1, &self._vbo)             # <<<<<<<<<<<<<<
 *         print_gl_errors("glGenBuffers")
 * 
*/
  glGenBuffers(1, (&__pyx_v_self->_vbo));

  /* "opengl/modern/vertex_buffer.pyx":48
 * 
 *         glGenBuffers(1, &self._vbo)
 *         print_gl_errors("glGenBuffers")             # <<<<<<<<<<<<<<
 * 
 *     def bind(self):
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_print_gl_errors); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 48, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
    __pyx_t_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_n_u_glGenBuffers};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 48, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/modern/vertex_buffer.pyx":28
 *     cdef unsigned int _dimension
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         # Set the indices to zero so that it is safe to call bind and
 *         # delete on them when glGen... fails.
*/

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

/* "opengl/modern/vertex_buffer.pyx":50
 *         print_gl_errors("glGenBuffers")
 * 
 *     def bind(self):             # <<<<<<<<<<<<<<
 *         clear_gl_errors()
 *         glBindVertexArray(self._vao)
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_12VertexBuffer_3bind(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_12VertexBuffer_2bind, "VertexBuffer.bind(self)");
static PyMethodDef __pyx_mdef_8CyOpenGL_12VertexBuffer_3bind = {"bind", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_12VertexBuffer_3bind, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_12VertexBuffer_2bind};
static PyObject *__pyx_pw_8CyOpenGL_12VertexBuffer_3bind(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("bind (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("bind", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("bind", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8CyOpenGL_12VertexBuffer_2bind(((struct __pyx_obj_8CyOpenGL_VertexBuffer *)__pyx_v_self));

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

static PyObject *__pyx_pf_8CyOpenGL_12VertexBuffer_2bind(struct __pyx_obj_8CyOpenGL_VertexBuffer *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("bind", 0);

  /* "opengl/modern/vertex_buffer.pyx":51
 * 
 *     def bind(self):
 *         clear_gl_errors()             # <<<<<<<<<<<<<<
 *         glBindVertexArray(self._vao)
 *         print_gl_errors("glBindVertexArray")
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_clear_gl_errors); if (unlikely(!__pyx_t_3)) __PYX_ERR(31, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 51, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/modern/vertex_buffer.pyx":52
 *     def bind(self):
 *         clear_gl_errors()
 *         glBindVertexArray(self._vao)             # <<<<<<<<<<<<<<
 *         print_gl_errors("glBindVertexArray")
 * 
*/
  glBindVertexArray(__pyx_v_self->_vao);

  /* "opengl/modern/vertex_buffer.pyx":53
 *         clear_gl_errors()
 *         glBindVertexArray(self._vao)
 *         print_gl_errors("glBindVertexArray")             # <<<<<<<<<<<<<<
 * 
 *         glBindBuffer(GL_ARRAY_BUFFER, self._vbo)
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_print_gl_errors); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 53, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
    __pyx_t_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_n_u_glBindVertexArray};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 53, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/modern/vertex_buffer.pyx":55
 *         print_gl_errors("glBindVertexArray")
 * 
 *         glBindBuffer(GL_ARRAY_BUFFER, self._vbo)             # <<<<<<<<<<<<<<
 * 
 *         # Use that vertex buffer as vertex attribute 0
*/
  glBindBuffer(GL_ARRAY_BUFFER, __pyx_v_self->_vbo);

  /* "opengl/modern/vertex_buffer.pyx":60
 *         # (i.e., the shader's first "in vec4" will be fed by the
 *         # buffer).
 *         glEnableVertexAttribArray(0)             # <<<<<<<<<<<<<<
 *         print_gl_errors("glEnableVertexAttribArray")
 * 
*/
  glEnableVertexAttribArray(0);

  /* "opengl/modern/vertex_buffer.pyx":61
 *         # buffer).
 *         glEnableVertexAttribArray(0)
 *         print_gl_errors("glEnableVertexAttribArray")             # <<<<<<<<<<<<<<
 * 
 *         # Specify that the buffer is interpreted as pairs of floats (x,y)
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_print_gl_errors); if (unlikely(!__pyx_t_3)) __PYX_ERR(31, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_n_u_glEnableVertexAttribArray};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 61, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/modern/vertex_buffer.pyx":65
 *         # Specify that the buffer is interpreted as pairs of floats (x,y)
 *         # GLSL will complete this to (x,y,0,1)
 *         glVertexAttribPointer(0, self._dimension,             # <<<<<<<<<<<<<<
 *                               GL_FLOAT, GL_FALSE,
 *                               sizeof(GLfloat) * self._dimension,
*/
  glVertexAttribPointer(0, __pyx_v_self->_dimension, GL_FLOAT, GL_FALSE, ((sizeof(GLfloat)) * __pyx_v_self->_dimension), NULL);

  /* "opengl/modern/vertex_buffer.pyx":69
 *                               sizeof(GLfloat) * self._dimension,
 *                               NULL)
 *         print_gl_errors("glVertexAttribPointer")             # <<<<<<<<<<<<<<
 * 
 *     def load(self, vertex_data):
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_print_gl_errors); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 69, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
    __pyx_t_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_n_u_glVertexAttribPointer};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 69, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/modern/vertex_buffer.pyx":50
 *         print_gl_errors("glGenBuffers")
 * 
 *     def bind(self):             # <<<<<<<<<<<<<<
 *         clear_gl_errors()
 *         glBindVertexArray(self._vao)
*/

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

/* "opengl/modern/vertex_buffer.pyx":71
 *         print_gl_errors("glVertexAttribPointer")
 * 
 *     def load(self, vertex_data):             # <<<<<<<<<<<<<<
 *         """
 *         Load data into GL vertex buffer objects.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_12VertexBuffer_5load(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_12VertexBuffer_4load, "VertexBuffer.load(self, vertex_data)\n\nLoad data into GL vertex buffer objects.\nvertex_data needs to be something like\n[[0,0,0],[1,1,0],[0,1,1],[1,0,1]].");
static PyMethodDef __pyx_mdef_8CyOpenGL_12VertexBuffer_5load = {"load", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_12VertexBuffer_5load, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_12VertexBuffer_4load};
static PyObject *__pyx_pw_8CyOpenGL_12VertexBuffer_5load(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_vertex_data = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("load (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_vertex_data,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(31, 71, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(31, 71, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "load", 0) < (0)) __PYX_ERR(31, 71, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("load", 1, 1, 1, i); __PYX_ERR(31, 71, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(31, 71, __pyx_L3_error)
    }
    __pyx_v_vertex_data = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("load", 1, 1, 1, __pyx_nargs); __PYX_ERR(31, 71, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("CyOpenGL.VertexBuffer.load", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_12VertexBuffer_4load(((struct __pyx_obj_8CyOpenGL_VertexBuffer *)__pyx_v_self), __pyx_v_vertex_data);

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

static PyObject *__pyx_pf_8CyOpenGL_12VertexBuffer_4load(struct __pyx_obj_8CyOpenGL_VertexBuffer *__pyx_v_self, PyObject *__pyx_v_vertex_data) {
  unsigned int __pyx_v_i;
  unsigned int __pyx_v_j;
  size_t __pyx_v_num_bytes;
  GLfloat *__pyx_v_verts;
  PyObject *__pyx_v_vertex = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  unsigned int __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  unsigned int __pyx_t_6;
  unsigned int __pyx_t_7;
  unsigned int __pyx_t_8;
  GLfloat __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  size_t __pyx_t_11;
  int __pyx_t_12;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("load", 0);

  /* "opengl/modern/vertex_buffer.pyx":81
 *         cdef unsigned int j
 * 
 *         self._dimension = len(vertex_data[0])             # <<<<<<<<<<<<<<
 * 
 *         cdef size_t num_bytes = (
*/
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_vertex_data, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 81, __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(31, 81, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_self->_dimension = __pyx_t_2;

  /* "opengl/modern/vertex_buffer.pyx":84
 * 
 *         cdef size_t num_bytes = (
 *             sizeof(GLfloat) * self._dimension * len(vertex_data))             # <<<<<<<<<<<<<<
 * 
 *         cdef GLfloat * verts = <GLfloat *> malloc(num_bytes)
*/
  __pyx_t_2 = PyObject_Length(__pyx_v_vertex_data); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(31, 84, __pyx_L1_error)
  __pyx_v_num_bytes = (((sizeof(GLfloat)) * __pyx_v_self->_dimension) * __pyx_t_2);

  /* "opengl/modern/vertex_buffer.pyx":86
 *             sizeof(GLfloat) * self._dimension * len(vertex_data))
 * 
 *         cdef GLfloat * verts = <GLfloat *> malloc(num_bytes)             # <<<<<<<<<<<<<<
 *         try:
 *             for i, vertex in enumerate(vertex_data):
*/
  __pyx_v_verts = ((GLfloat *)malloc(__pyx_v_num_bytes));

  /* "opengl/modern/vertex_buffer.pyx":87
 * 
 *         cdef GLfloat * verts = <GLfloat *> malloc(num_bytes)
 *         try:             # <<<<<<<<<<<<<<
 *             for i, vertex in enumerate(vertex_data):
 *                 for j in range(self._dimension):
*/
  /*try:*/ {

    /* "opengl/modern/vertex_buffer.pyx":88
 *         cdef GLfloat * verts = <GLfloat *> malloc(num_bytes)
 *         try:
 *             for i, vertex in enumerate(vertex_data):             # <<<<<<<<<<<<<<
 *                 for j in range(self._dimension):
 *                     verts[self._dimension * i + j] = vertex[j]
*/
    __pyx_t_3 = 0;
    if (likely(PyList_CheckExact(__pyx_v_vertex_data)) || PyTuple_CheckExact(__pyx_v_vertex_data)) {
      __pyx_t_1 = __pyx_v_vertex_data; __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_vertex_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 88, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(31, 88, __pyx_L4_error)
    }
    for (;;) {
      if (likely(!__pyx_t_4)) {
        if (likely(PyList_CheckExact(__pyx_t_1))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(31, 88, __pyx_L4_error)
            #endif
            if (__pyx_t_2 >= __pyx_temp) break;
          }
          __pyx_t_5 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference);
          ++__pyx_t_2;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(31, 88, __pyx_L4_error)
            #endif
            if (__pyx_t_2 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_5 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2));
          #else
          __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2);
          #endif
          ++__pyx_t_2;
        }
        if (unlikely(!__pyx_t_5)) __PYX_ERR(31, 88, __pyx_L4_error)
      } else {
        __pyx_t_5 = __pyx_t_4(__pyx_t_1);
        if (unlikely(!__pyx_t_5)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(31, 88, __pyx_L4_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_XDECREF_SET(__pyx_v_vertex, __pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_v_i = __pyx_t_3;
      __pyx_t_3 = (__pyx_t_3 + 1);

      /* "opengl/modern/vertex_buffer.pyx":89
 *         try:
 *             for i, vertex in enumerate(vertex_data):
 *                 for j in range(self._dimension):             # <<<<<<<<<<<<<<
 *                     verts[self._dimension * i + j] = vertex[j]
 * 
*/
      __pyx_t_6 = __pyx_v_self->_dimension;
      __pyx_t_7 = __pyx_t_6;
      for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
        __pyx_v_j = __pyx_t_8;

        /* "opengl/modern/vertex_buffer.pyx":90
 *             for i, vertex in enumerate(vertex_data):
 *                 for j in range(self._dimension):
 *                     verts[self._dimension * i + j] = vertex[j]             # <<<<<<<<<<<<<<
 * 
 *             clear_gl_errors()
*/
        __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_vertex, __pyx_v_j, unsigned int, 0, __Pyx_PyLong_From_unsigned_int, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_5)) __PYX_ERR(31, 90, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_9 = __Pyx_PyFloat_AsFloat(__pyx_t_5); if (unlikely((__pyx_t_9 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(31, 90, __pyx_L4_error)
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        (__pyx_v_verts[((__pyx_v_self->_dimension * __pyx_v_i) + __pyx_v_j)]) = __pyx_t_9;
      }

      /* "opengl/modern/vertex_buffer.pyx":88
 *         cdef GLfloat * verts = <GLfloat *> malloc(num_bytes)
 *         try:
 *             for i, vertex in enumerate(vertex_data):             # <<<<<<<<<<<<<<
 *                 for j in range(self._dimension):
 *                     verts[self._dimension * i + j] = vertex[j]
*/
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "opengl/modern/vertex_buffer.pyx":92
 *                     verts[self._dimension * i + j] = vertex[j]
 * 
 *             clear_gl_errors()             # <<<<<<<<<<<<<<
 *             # This is not really necessary to push data to
 *             # the GL_ARRAY_BUFFER.
*/
    __pyx_t_5 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_clear_gl_errors); if (unlikely(!__pyx_t_10)) __PYX_ERR(31, 92, __pyx_L4_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_11 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_10))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_10);
      assert(__pyx_t_5);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_10, __pyx__function);
      __pyx_t_11 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_10, __pyx_callargs+__pyx_t_11, (1-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 92, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "opengl/modern/vertex_buffer.pyx":95
 *             # This is not really necessary to push data to
 *             # the GL_ARRAY_BUFFER.
 *             glBindVertexArray(self._vao)             # <<<<<<<<<<<<<<
 *             print_gl_errors("glBindVertexArray")
 * 
*/
    glBindVertexArray(__pyx_v_self->_vao);

    /* "opengl/modern/vertex_buffer.pyx":96
 *             # the GL_ARRAY_BUFFER.
 *             glBindVertexArray(self._vao)
 *             print_gl_errors("glBindVertexArray")             # <<<<<<<<<<<<<<
 * 
 *             glBindBuffer(GL_ARRAY_BUFFER, self._vbo)
*/
    __pyx_t_10 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_print_gl_errors); if (unlikely(!__pyx_t_5)) __PYX_ERR(31, 96, __pyx_L4_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_11 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_10);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_10);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_11 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_mstate_global->__pyx_n_u_glBindVertexArray};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 96, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "opengl/modern/vertex_buffer.pyx":98
 *             print_gl_errors("glBindVertexArray")
 * 
 *             glBindBuffer(GL_ARRAY_BUFFER, self._vbo)             # <<<<<<<<<<<<<<
 * 
 *             glBufferData(GL_ARRAY_BUFFER,
*/
    glBindBuffer(GL_ARRAY_BUFFER, __pyx_v_self->_vbo);

    /* "opengl/modern/vertex_buffer.pyx":100
 *             glBindBuffer(GL_ARRAY_BUFFER, self._vbo)
 * 
 *             glBufferData(GL_ARRAY_BUFFER,             # <<<<<<<<<<<<<<
 *                          <GLsizeiptr>num_bytes,
 *                          verts,
*/
    glBufferData(GL_ARRAY_BUFFER, ((GLsizeiptr)__pyx_v_num_bytes), __pyx_v_verts, GL_STATIC_DRAW);
  }

  /* "opengl/modern/vertex_buffer.pyx":106
 * 
 *         finally:
 *             free(verts)             # <<<<<<<<<<<<<<
 * 
 *     def delete_resource(self):
*/
  /*finally:*/ {
    /*normal exit:*/{
      free(__pyx_v_verts);
      goto __pyx_L5;
    }
    __pyx_L4_error:;
    /*exception exit:*/{
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
       __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
      if ( unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
      __Pyx_XGOTREF(__pyx_t_15);
      __Pyx_XGOTREF(__pyx_t_16);
      __Pyx_XGOTREF(__pyx_t_17);
      __Pyx_XGOTREF(__pyx_t_18);
      __Pyx_XGOTREF(__pyx_t_19);
      __Pyx_XGOTREF(__pyx_t_20);
      __pyx_t_12 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
      {
        free(__pyx_v_verts);
      }
      __Pyx_XGIVEREF(__pyx_t_18);
      __Pyx_XGIVEREF(__pyx_t_19);
      __Pyx_XGIVEREF(__pyx_t_20);
      __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
      __Pyx_XGIVEREF(__pyx_t_15);
      __Pyx_XGIVEREF(__pyx_t_16);
      __Pyx_XGIVEREF(__pyx_t_17);
      __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
      __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
      __pyx_lineno = __pyx_t_12; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
      goto __pyx_L1_error;
    }
    __pyx_L5:;
  }

  /* "opengl/modern/vertex_buffer.pyx":71
 *         print_gl_errors("glVertexAttribPointer")
 * 
 *     def load(self, vertex_data):             # <<<<<<<<<<<<<<
 *         """
 *         Load data into GL vertex buffer objects.
*/

  /* 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_10);
  __Pyx_AddTraceback("CyOpenGL.VertexBuffer.load", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_vertex);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opengl/modern/vertex_buffer.pyx":108
 *             free(verts)
 * 
 *     def delete_resource(self):             # <<<<<<<<<<<<<<
 *         # Same comments as for GLSLProgram.delete_resource apply
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_12VertexBuffer_7delete_resource(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_12VertexBuffer_6delete_resource, "VertexBuffer.delete_resource(self)");
static PyMethodDef __pyx_mdef_8CyOpenGL_12VertexBuffer_7delete_resource = {"delete_resource", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_12VertexBuffer_7delete_resource, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_12VertexBuffer_6delete_resource};
static PyObject *__pyx_pw_8CyOpenGL_12VertexBuffer_7delete_resource(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("delete_resource (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("delete_resource", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("delete_resource", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8CyOpenGL_12VertexBuffer_6delete_resource(((struct __pyx_obj_8CyOpenGL_VertexBuffer *)__pyx_v_self));

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

static PyObject *__pyx_pf_8CyOpenGL_12VertexBuffer_6delete_resource(struct __pyx_obj_8CyOpenGL_VertexBuffer *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("delete_resource", 0);

  /* "opengl/modern/vertex_buffer.pyx":111
 *         # Same comments as for GLSLProgram.delete_resource apply
 * 
 *         glDeleteBuffers(1, &self._vbo)             # <<<<<<<<<<<<<<
 *         glDeleteVertexArrays(1, &self._vao)
 * 
*/
  glDeleteBuffers(1, (&__pyx_v_self->_vbo));

  /* "opengl/modern/vertex_buffer.pyx":112
 * 
 *         glDeleteBuffers(1, &self._vbo)
 *         glDeleteVertexArrays(1, &self._vao)             # <<<<<<<<<<<<<<
 * 
 *         self._vbo = 0
*/
  glDeleteVertexArrays(1, (&__pyx_v_self->_vao));

  /* "opengl/modern/vertex_buffer.pyx":114
 *         glDeleteVertexArrays(1, &self._vao)
 * 
 *         self._vbo = 0             # <<<<<<<<<<<<<<
 *         self._vao = 0
*/
  __pyx_v_self->_vbo = 0;

  /* "opengl/modern/vertex_buffer.pyx":115
 * 
 *         self._vbo = 0
 *         self._vao = 0             # <<<<<<<<<<<<<<
*/
  __pyx_v_self->_vao = 0;

  /* "opengl/modern/vertex_buffer.pyx":108
 *             free(verts)
 * 
 *     def delete_resource(self):             # <<<<<<<<<<<<<<
 *         # Same comments as for GLSLProgram.delete_resource apply
 * 
*/

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

/* "opengl/modern/simple_image_shader_widget.pyx":46
 *     report_gl_errors = False
 * 
 *     def __init__(self, parent, **kw):             # <<<<<<<<<<<<<<
 *         super().__init__(parent, **kw)
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_23SimpleImageShaderWidget_1__init__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_23SimpleImageShaderWidget___init__, "SimpleImageShaderWidget.__init__(self, parent, **kw)");
static PyMethodDef __pyx_mdef_8CyOpenGL_23SimpleImageShaderWidget_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_23SimpleImageShaderWidget_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_23SimpleImageShaderWidget___init__};
static PyObject *__pyx_pw_8CyOpenGL_23SimpleImageShaderWidget_1__init__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_parent = 0;
  PyObject *__pyx_v_kw = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  __pyx_v_kw = PyDict_New(); if (unlikely(!__pyx_v_kw)) return NULL;
  __Pyx_GOTREF(__pyx_v_kw);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_parent,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(32, 46, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(32, 46, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(32, 46, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, __pyx_v_kw, values, kwd_pos_args, __pyx_kwds_len, "__init__", 1) < (0)) __PYX_ERR(32, 46, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, i); __PYX_ERR(32, 46, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(32, 46, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(32, 46, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
    __pyx_v_parent = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(32, 46, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_DECREF(__pyx_v_kw); __pyx_v_kw = 0;
  __Pyx_AddTraceback("CyOpenGL.SimpleImageShaderWidget.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_23SimpleImageShaderWidget___init__(__pyx_self, __pyx_v_self, __pyx_v_parent, __pyx_v_kw);

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

static PyObject *__pyx_pf_8CyOpenGL_23SimpleImageShaderWidget___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_parent, PyObject *__pyx_v_kw) {
  char *__pyx_v_missing_gl_function;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8[5];
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "opengl/modern/simple_image_shader_widget.pyx":47
 * 
 *     def __init__(self, parent, **kw):
 *         super().__init__(parent, **kw)             # <<<<<<<<<<<<<<
 * 
 *         self._vertex_buffer = VertexBuffer()
*/
  __pyx_t_2 = NULL;
  __pyx_t_4 = NULL;
  __pyx_t_5 = __Pyx_CyFunction_GetClassObj(__pyx_self);
  if (!__pyx_t_5) { PyErr_SetString(PyExc_RuntimeError, "super(): empty __class__ cell"); __PYX_ERR(32, 47, __pyx_L1_error) }
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_t_5, __pyx_v_self};
    __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_super, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(32, 47, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_init); if (unlikely(!__pyx_t_5)) __PYX_ERR(32, 47, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyDict_Copy(__pyx_v_kw); if (unlikely(!__pyx_t_3)) __PYX_ERR(32, 47, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = 1;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_6 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_parent};
    __pyx_t_1 = __Pyx_PyObject_FastCallDict((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_3);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(32, 47, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/modern/simple_image_shader_widget.pyx":49
 *         super().__init__(parent, **kw)
 * 
 *         self._vertex_buffer = VertexBuffer()             # <<<<<<<<<<<<<<
 *         self._vertex_buffer.load(((3,-1), (-1,3), (-1,-1)))
 * 
*/
  __pyx_t_5 = NULL;
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8CyOpenGL_VertexBuffer, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(32, 49, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_vertex_buffer, ((PyObject *)__pyx_t_1)) < (0)) __PYX_ERR(32, 49, __pyx_L1_error)
  __Pyx_DECREF((PyObject *)__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/modern/simple_image_shader_widget.pyx":50
 * 
 *         self._vertex_buffer = VertexBuffer()
 *         self._vertex_buffer.load(((3,-1), (-1,3), (-1,-1)))             # <<<<<<<<<<<<<<
 * 
 *         self.image_shader = GLSLProgram(
*/
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_vertex_buffer); if (unlikely(!__pyx_t_3)) __PYX_ERR(32, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __pyx_t_3;
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_tuple[12]};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_load, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(32, 50, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/modern/simple_image_shader_widget.pyx":52
 *         self._vertex_buffer.load(((3,-1), (-1,3), (-1,-1)))
 * 
 *         self.image_shader = GLSLProgram(             # <<<<<<<<<<<<<<
 *             self.vertex_shader_source,
 *             self.fragment_shader_source,
*/
  __pyx_t_3 = NULL;

  /* "opengl/modern/simple_image_shader_widget.pyx":53
 * 
 *         self.image_shader = GLSLProgram(
 *             self.vertex_shader_source,             # <<<<<<<<<<<<<<
 *             self.fragment_shader_source,
 *             name = "fallback image shader")
*/
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_vertex_shader_source); if (unlikely(!__pyx_t_5)) __PYX_ERR(32, 53, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "opengl/modern/simple_image_shader_widget.pyx":54
 *         self.image_shader = GLSLProgram(
 *             self.vertex_shader_source,
 *             self.fragment_shader_source,             # <<<<<<<<<<<<<<
 *             name = "fallback image shader")
 *         self.textures = []
*/
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_fragment_shader_source); if (unlikely(!__pyx_t_2)) __PYX_ERR(32, 54, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[3 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, __pyx_t_5, __pyx_t_2};
    __pyx_t_4 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(32, 52, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_kp_u_fallback_image_shader, __pyx_t_4, __pyx_callargs+3, 0) < (0)) __PYX_ERR(32, 52, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_ptype_8CyOpenGL_GLSLProgram, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(32, 52, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }

  /* "opengl/modern/simple_image_shader_widget.pyx":52
 *         self._vertex_buffer.load(((3,-1), (-1,3), (-1,-1)))
 * 
 *         self.image_shader = GLSLProgram(             # <<<<<<<<<<<<<<
 *             self.vertex_shader_source,
 *             self.fragment_shader_source,
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_image_shader, ((PyObject *)__pyx_t_1)) < (0)) __PYX_ERR(32, 52, __pyx_L1_error)
  __Pyx_DECREF((PyObject *)__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/modern/simple_image_shader_widget.pyx":56
 *             self.fragment_shader_source,
 *             name = "fallback image shader")
 *         self.textures = []             # <<<<<<<<<<<<<<
 *         self.report_time_callback = None
 * 
*/
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(32, 56, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_textures, __pyx_t_1) < (0)) __PYX_ERR(32, 56, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/modern/simple_image_shader_widget.pyx":57
 *             name = "fallback image shader")
 *         self.textures = []
 *         self.report_time_callback = None             # <<<<<<<<<<<<<<
 * 
 *         self.make_current()
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_report_time_callback, Py_None) < (0)) __PYX_ERR(32, 57, __pyx_L1_error)

  /* "opengl/modern/simple_image_shader_widget.pyx":59
 *         self.report_time_callback = None
 * 
 *         self.make_current()             # <<<<<<<<<<<<<<
 * 
 *         cdef char * missing_gl_function
*/
  __pyx_t_4 = __pyx_v_self;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_make_current, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(32, 59, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/modern/simple_image_shader_widget.pyx":62
 * 
 *         cdef char * missing_gl_function
 *         missing_gl_function = checkGlewForModernOpenGL()             # <<<<<<<<<<<<<<
 *         if missing_gl_function:
 *             raise Exception(
*/
  __pyx_v_missing_gl_function = checkGlewForModernOpenGL();

  /* "opengl/modern/simple_image_shader_widget.pyx":63
 *         cdef char * missing_gl_function
 *         missing_gl_function = checkGlewForModernOpenGL()
 *         if missing_gl_function:             # <<<<<<<<<<<<<<
 *             raise Exception(
 *                 ("Missing gl function: %s. Your graphics card probably does "
*/
  __pyx_t_7 = (__pyx_v_missing_gl_function != 0);
  if (unlikely(__pyx_t_7)) {

    /* "opengl/modern/simple_image_shader_widget.pyx":64
 *         missing_gl_function = checkGlewForModernOpenGL()
 *         if missing_gl_function:
 *             raise Exception(             # <<<<<<<<<<<<<<
 *                 ("Missing gl function: %s. Your graphics card probably does "
 *                  "not support the required OpenGL version (3.2 or later). Your "
*/
    __pyx_t_4 = NULL;

    /* "opengl/modern/simple_image_shader_widget.pyx":67
 *                 ("Missing gl function: %s. Your graphics card probably does "
 *                  "not support the required OpenGL version (3.2 or later). Your "
 *                  "OpenGL version is %s.") % (missing_gl_function,             # <<<<<<<<<<<<<<
 *                                              get_gl_string('GL_VERSION')))
 * 
*/
    __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_missing_gl_function); if (unlikely(!__pyx_t_2)) __PYX_ERR(32, 67, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_2), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(32, 67, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "opengl/modern/simple_image_shader_widget.pyx":68
 *                  "not support the required OpenGL version (3.2 or later). Your "
 *                  "OpenGL version is %s.") % (missing_gl_function,
 *                                              get_gl_string('GL_VERSION')))             # <<<<<<<<<<<<<<
 * 
 *     def set_textures(self, texture_files):
*/
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_get_gl_string); if (unlikely(!__pyx_t_2)) __PYX_ERR(32, 68, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[8], NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(32, 68, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_3), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(32, 68, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_8[0] = __pyx_mstate_global->__pyx_kp_u_Missing_gl_function;
    __pyx_t_8[1] = __pyx_t_5;
    __pyx_t_8[2] = __pyx_mstate_global->__pyx_kp_u_Your_graphics_card_probably_doe_2;
    __pyx_t_8[3] = __pyx_t_2;
    __pyx_t_8[4] = __pyx_mstate_global->__pyx_kp_u__2;

    /* "opengl/modern/simple_image_shader_widget.pyx":65
 *         if missing_gl_function:
 *             raise Exception(
 *                 ("Missing gl function: %s. Your graphics card probably does "             # <<<<<<<<<<<<<<
 *                  "not support the required OpenGL version (3.2 or later). Your "
 *                  "OpenGL version is %s.") % (missing_gl_function,
*/
    __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_8, 5, 21 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5) + 114 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + 1, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2));
    if (unlikely(!__pyx_t_3)) __PYX_ERR(32, 65, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_Exception)), __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(32, 64, __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(32, 64, __pyx_L1_error)

    /* "opengl/modern/simple_image_shader_widget.pyx":63
 *         cdef char * missing_gl_function
 *         missing_gl_function = checkGlewForModernOpenGL()
 *         if missing_gl_function:             # <<<<<<<<<<<<<<
 *             raise Exception(
 *                 ("Missing gl function: %s. Your graphics card probably does "
*/
  }

  /* "opengl/modern/simple_image_shader_widget.pyx":46
 *     report_gl_errors = False
 * 
 *     def __init__(self, parent, **kw):             # <<<<<<<<<<<<<<
 *         super().__init__(parent, **kw)
 * 
*/

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

/* "opengl/modern/simple_image_shader_widget.pyx":70
 *                                              get_gl_string('GL_VERSION')))
 * 
 *     def set_textures(self, texture_files):             # <<<<<<<<<<<<<<
 *         self.make_current()
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_23SimpleImageShaderWidget_3set_textures(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_23SimpleImageShaderWidget_2set_textures, "SimpleImageShaderWidget.set_textures(self, texture_files)");
static PyMethodDef __pyx_mdef_8CyOpenGL_23SimpleImageShaderWidget_3set_textures = {"set_textures", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_23SimpleImageShaderWidget_3set_textures, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_23SimpleImageShaderWidget_2set_textures};
static PyObject *__pyx_pw_8CyOpenGL_23SimpleImageShaderWidget_3set_textures(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_texture_files = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_textures (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_texture_files,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(32, 70, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(32, 70, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(32, 70, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "set_textures", 0) < (0)) __PYX_ERR(32, 70, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("set_textures", 1, 2, 2, i); __PYX_ERR(32, 70, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(32, 70, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(32, 70, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
    __pyx_v_texture_files = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_textures", 1, 2, 2, __pyx_nargs); __PYX_ERR(32, 70, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("CyOpenGL.SimpleImageShaderWidget.set_textures", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_23SimpleImageShaderWidget_2set_textures(__pyx_self, __pyx_v_self, __pyx_v_texture_files);

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

static PyObject *__pyx_pf_8CyOpenGL_23SimpleImageShaderWidget_2set_textures(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_texture_files) {
  PyObject *__pyx_v_texture = NULL;
  PyObject *__pyx_v_texture_file = NULL;
  PyObject *__pyx_v_e = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  int __pyx_t_15;
  char const *__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;
  PyObject *__pyx_t_22 = NULL;
  int __pyx_t_23;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_textures", 0);

  /* "opengl/modern/simple_image_shader_widget.pyx":71
 * 
 *     def set_textures(self, texture_files):
 *         self.make_current()             # <<<<<<<<<<<<<<
 * 
 *         for texture in self.textures:
*/
  __pyx_t_2 = __pyx_v_self;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_make_current, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(32, 71, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/modern/simple_image_shader_widget.pyx":73
 *         self.make_current()
 * 
 *         for texture in self.textures:             # <<<<<<<<<<<<<<
 *             texture.delete_resource()
 * 
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_textures); if (unlikely(!__pyx_t_1)) __PYX_ERR(32, 73, __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_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(32, 73, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(32, 73, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(32, 73, __pyx_L1_error)
          #endif
          if (__pyx_t_4 >= __pyx_temp) break;
        }
        __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_2, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference);
        ++__pyx_t_4;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(32, 73, __pyx_L1_error)
          #endif
          if (__pyx_t_4 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4));
        #else
        __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_4);
        #endif
        ++__pyx_t_4;
      }
      if (unlikely(!__pyx_t_1)) __PYX_ERR(32, 73, __pyx_L1_error)
    } else {
      __pyx_t_1 = __pyx_t_5(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(32, 73, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_texture, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "opengl/modern/simple_image_shader_widget.pyx":74
 * 
 *         for texture in self.textures:
 *             texture.delete_resource()             # <<<<<<<<<<<<<<
 * 
 *         self.textures = []
*/
    __pyx_t_6 = __pyx_v_texture;
    __Pyx_INCREF(__pyx_t_6);
    __pyx_t_3 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_delete_resource, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(32, 74, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "opengl/modern/simple_image_shader_widget.pyx":73
 *         self.make_current()
 * 
 *         for texture in self.textures:             # <<<<<<<<<<<<<<
 *             texture.delete_resource()
 * 
*/
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opengl/modern/simple_image_shader_widget.pyx":76
 *             texture.delete_resource()
 * 
 *         self.textures = []             # <<<<<<<<<<<<<<
 *         for texture_file in texture_files:
 *             texture = None
*/
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(32, 76, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_textures, __pyx_t_2) < (0)) __PYX_ERR(32, 76, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opengl/modern/simple_image_shader_widget.pyx":77
 * 
 *         self.textures = []
 *         for texture_file in texture_files:             # <<<<<<<<<<<<<<
 *             texture = None
 *             try:
*/
  if (likely(PyList_CheckExact(__pyx_v_texture_files)) || PyTuple_CheckExact(__pyx_v_texture_files)) {
    __pyx_t_2 = __pyx_v_texture_files; __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_texture_files); if (unlikely(!__pyx_t_2)) __PYX_ERR(32, 77, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(32, 77, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(32, 77, __pyx_L1_error)
          #endif
          if (__pyx_t_4 >= __pyx_temp) break;
        }
        __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_2, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference);
        ++__pyx_t_4;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(32, 77, __pyx_L1_error)
          #endif
          if (__pyx_t_4 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4));
        #else
        __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_4);
        #endif
        ++__pyx_t_4;
      }
      if (unlikely(!__pyx_t_1)) __PYX_ERR(32, 77, __pyx_L1_error)
    } else {
      __pyx_t_1 = __pyx_t_5(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(32, 77, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_texture_file, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "opengl/modern/simple_image_shader_widget.pyx":78
 *         self.textures = []
 *         for texture_file in texture_files:
 *             texture = None             # <<<<<<<<<<<<<<
 *             try:
 *                 texture = ImageBasedTexture(texture_file)
*/
    __Pyx_INCREF(Py_None);
    __Pyx_XDECREF_SET(__pyx_v_texture, Py_None);

    /* "opengl/modern/simple_image_shader_widget.pyx":79
 *         for texture_file in texture_files:
 *             texture = None
 *             try:             # <<<<<<<<<<<<<<
 *                 texture = ImageBasedTexture(texture_file)
 *             except Exception as e:
*/
    {
      __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:*/ {

        /* "opengl/modern/simple_image_shader_widget.pyx":80
 *             texture = None
 *             try:
 *                 texture = ImageBasedTexture(texture_file)             # <<<<<<<<<<<<<<
 *             except Exception as e:
 *                 print("Warning could not read texture %s" % texture_file)
*/
        __pyx_t_6 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_ImageBasedTexture); if (unlikely(!__pyx_t_10)) __PYX_ERR(32, 80, __pyx_L8_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_3 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_10))) {
          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_10);
          assert(__pyx_t_6);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_10);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_10, __pyx__function);
          __pyx_t_3 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_texture_file};
          __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_10, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(32, 80, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_1);
        }
        __Pyx_DECREF_SET(__pyx_v_texture, __pyx_t_1);
        __pyx_t_1 = 0;

        /* "opengl/modern/simple_image_shader_widget.pyx":79
 *         for texture_file in texture_files:
 *             texture = None
 *             try:             # <<<<<<<<<<<<<<
 *                 texture = ImageBasedTexture(texture_file)
 *             except Exception as e:
*/
      }
      __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_L15_try_end;
      __pyx_L8_error:;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "opengl/modern/simple_image_shader_widget.pyx":81
 *             try:
 *                 texture = ImageBasedTexture(texture_file)
 *             except Exception as e:             # <<<<<<<<<<<<<<
 *                 print("Warning could not read texture %s" % texture_file)
 *                 print(e)
*/
      __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
      if (__pyx_t_11) {
        __Pyx_AddTraceback("CyOpenGL.SimpleImageShaderWidget.set_textures", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_10, &__pyx_t_6) < 0) __PYX_ERR(32, 81, __pyx_L10_except_error)
        __Pyx_XGOTREF(__pyx_t_1);
        __Pyx_XGOTREF(__pyx_t_10);
        __Pyx_XGOTREF(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_10);
        __pyx_v_e = __pyx_t_10;
        /*try:*/ {

          /* "opengl/modern/simple_image_shader_widget.pyx":82
 *                 texture = ImageBasedTexture(texture_file)
 *             except Exception as e:
 *                 print("Warning could not read texture %s" % texture_file)             # <<<<<<<<<<<<<<
 *                 print(e)
 * 
*/
          __pyx_t_13 = NULL;
          __pyx_t_14 = __Pyx_PyUnicode_FormatSafe(__pyx_mstate_global->__pyx_kp_u_Warning_could_not_read_texture_s, __pyx_v_texture_file); if (unlikely(!__pyx_t_14)) __PYX_ERR(32, 82, __pyx_L21_error)
          __Pyx_GOTREF(__pyx_t_14);
          __pyx_t_3 = 1;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_t_14};
            __pyx_t_12 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_print, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
            if (unlikely(!__pyx_t_12)) __PYX_ERR(32, 82, __pyx_L21_error)
            __Pyx_GOTREF(__pyx_t_12);
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

          /* "opengl/modern/simple_image_shader_widget.pyx":83
 *             except Exception as e:
 *                 print("Warning could not read texture %s" % texture_file)
 *                 print(e)             # <<<<<<<<<<<<<<
 * 
 *             self.textures.append(texture)
*/
          __pyx_t_14 = NULL;
          __pyx_t_3 = 1;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_14, __pyx_v_e};
            __pyx_t_12 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_print, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
            if (unlikely(!__pyx_t_12)) __PYX_ERR(32, 83, __pyx_L21_error)
            __Pyx_GOTREF(__pyx_t_12);
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        }

        /* "opengl/modern/simple_image_shader_widget.pyx":81
 *             try:
 *                 texture = ImageBasedTexture(texture_file)
 *             except Exception as e:             # <<<<<<<<<<<<<<
 *                 print("Warning could not read texture %s" % texture_file)
 *                 print(e)
*/
        /*finally:*/ {
          /*normal exit:*/{
            __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0;
            goto __pyx_L22;
          }
          __pyx_L21_error:;
          /*exception exit:*/{
            __Pyx_PyThreadState_declare
            __Pyx_PyThreadState_assign
            __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 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_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
            if ( unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
            __Pyx_XGOTREF(__pyx_t_17);
            __Pyx_XGOTREF(__pyx_t_18);
            __Pyx_XGOTREF(__pyx_t_19);
            __Pyx_XGOTREF(__pyx_t_20);
            __Pyx_XGOTREF(__pyx_t_21);
            __Pyx_XGOTREF(__pyx_t_22);
            __pyx_t_11 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
            {
              __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0;
            }
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
            __Pyx_XGIVEREF(__pyx_t_17);
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
            __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
            __pyx_lineno = __pyx_t_11; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
            goto __pyx_L10_except_error;
          }
          __pyx_L22:;
        }
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        goto __pyx_L9_exception_handled;
      }
      goto __pyx_L10_except_error;

      /* "opengl/modern/simple_image_shader_widget.pyx":79
 *         for texture_file in texture_files:
 *             texture = None
 *             try:             # <<<<<<<<<<<<<<
 *                 texture = ImageBasedTexture(texture_file)
 *             except Exception as e:
*/
      __pyx_L10_except_error:;
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
      goto __pyx_L1_error;
      __pyx_L9_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_L15_try_end:;
    }

    /* "opengl/modern/simple_image_shader_widget.pyx":85
 *                 print(e)
 * 
 *             self.textures.append(texture)             # <<<<<<<<<<<<<<
 * 
 *     def set_fragment_shader_source(self,
*/
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_textures); if (unlikely(!__pyx_t_6)) __PYX_ERR(32, 85, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_23 = __Pyx_PyObject_Append(__pyx_t_6, __pyx_v_texture); if (unlikely(__pyx_t_23 == ((int)-1))) __PYX_ERR(32, 85, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "opengl/modern/simple_image_shader_widget.pyx":77
 * 
 *         self.textures = []
 *         for texture_file in texture_files:             # <<<<<<<<<<<<<<
 *             texture = None
 *             try:
*/
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opengl/modern/simple_image_shader_widget.pyx":70
 *                                              get_gl_string('GL_VERSION')))
 * 
 *     def set_textures(self, texture_files):             # <<<<<<<<<<<<<<
 *         self.make_current()
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_AddTraceback("CyOpenGL.SimpleImageShaderWidget.set_textures", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_texture);
  __Pyx_XDECREF(__pyx_v_texture_file);
  __Pyx_XDECREF(__pyx_v_e);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opengl/modern/simple_image_shader_widget.pyx":87
 *             self.textures.append(texture)
 * 
 *     def set_fragment_shader_source(self,             # <<<<<<<<<<<<<<
 *                                    source,
 *                                    uniform_block_names_sizes_and_offsets = []):
*/

static PyObject *__pyx_pf_8CyOpenGL_12__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__defaults__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(32, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_self)->arg0);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_self)->arg0);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_self)->arg0) != (0)) __PYX_ERR(32, 87, __pyx_L1_error);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(32, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1) != (0)) __PYX_ERR(32, 87, __pyx_L1_error);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None) != (0)) __PYX_ERR(32, 87, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("CyOpenGL.__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_8CyOpenGL_23SimpleImageShaderWidget_5set_fragment_shader_source(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_23SimpleImageShaderWidget_4set_fragment_shader_source, "SimpleImageShaderWidget.set_fragment_shader_source(self, source, uniform_block_names_sizes_and_offsets=[])");
static PyMethodDef __pyx_mdef_8CyOpenGL_23SimpleImageShaderWidget_5set_fragment_shader_source = {"set_fragment_shader_source", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_23SimpleImageShaderWidget_5set_fragment_shader_source, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_23SimpleImageShaderWidget_4set_fragment_shader_source};
static PyObject *__pyx_pw_8CyOpenGL_23SimpleImageShaderWidget_5set_fragment_shader_source(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_source = 0;
  PyObject *__pyx_v_uniform_block_names_sizes_and_offsets = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_fragment_shader_source (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_source,&__pyx_mstate_global->__pyx_n_u_uniform_block_names_sizes_and_of,0};
    struct __pyx_defaults *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_self);
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(32, 87, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(32, 87, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(32, 87, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(32, 87, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "set_fragment_shader_source", 0) < (0)) __PYX_ERR(32, 87, __pyx_L3_error)
      if (!values[2]) values[2] = __Pyx_NewRef(__pyx_dynamic_args->arg0);
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("set_fragment_shader_source", 0, 2, 3, i); __PYX_ERR(32, 87, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(32, 87, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(32, 87, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(32, 87, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef(__pyx_dynamic_args->arg0);
    }
    __pyx_v_self = values[0];
    __pyx_v_source = values[1];
    __pyx_v_uniform_block_names_sizes_and_offsets = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_fragment_shader_source", 0, 2, 3, __pyx_nargs); __PYX_ERR(32, 87, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("CyOpenGL.SimpleImageShaderWidget.set_fragment_shader_source", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_23SimpleImageShaderWidget_4set_fragment_shader_source(__pyx_self, __pyx_v_self, __pyx_v_source, __pyx_v_uniform_block_names_sizes_and_offsets);

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

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

  /* "opengl/modern/simple_image_shader_widget.pyx":90
 *                                    source,
 *                                    uniform_block_names_sizes_and_offsets = []):
 *         self.image_shader.delete_resource()             # <<<<<<<<<<<<<<
 *         self.image_shader = GLSLProgram(
 *             self.vertex_shader_source,
*/
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_image_shader); if (unlikely(!__pyx_t_3)) __PYX_ERR(32, 90, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __pyx_t_3;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_delete_resource, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(32, 90, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/modern/simple_image_shader_widget.pyx":91
 *                                    uniform_block_names_sizes_and_offsets = []):
 *         self.image_shader.delete_resource()
 *         self.image_shader = GLSLProgram(             # <<<<<<<<<<<<<<
 *             self.vertex_shader_source,
 *             source,
*/
  __pyx_t_3 = NULL;

  /* "opengl/modern/simple_image_shader_widget.pyx":92
 *         self.image_shader.delete_resource()
 *         self.image_shader = GLSLProgram(
 *             self.vertex_shader_source,             # <<<<<<<<<<<<<<
 *             source,
 *             uniform_block_names_sizes_and_offsets = uniform_block_names_sizes_and_offsets,
*/
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_vertex_shader_source); if (unlikely(!__pyx_t_2)) __PYX_ERR(32, 92, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "opengl/modern/simple_image_shader_widget.pyx":94
 *             self.vertex_shader_source,
 *             source,
 *             uniform_block_names_sizes_and_offsets = uniform_block_names_sizes_and_offsets,             # <<<<<<<<<<<<<<
 *             name = "image shader")
 * 
*/
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[3 + ((CYTHON_VECTORCALL) ? 2 : 0)] = {__pyx_t_3, __pyx_t_2, __pyx_v_source};
    __pyx_t_5 = __Pyx_MakeVectorcallBuilderKwds(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(32, 91, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_uniform_block_names_sizes_and_of, __pyx_v_uniform_block_names_sizes_and_offsets, __pyx_t_5, __pyx_callargs+3, 0) < (0)) __PYX_ERR(32, 91, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_kp_u_image_shader_2, __pyx_t_5, __pyx_callargs+3, 1) < (0)) __PYX_ERR(32, 91, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_ptype_8CyOpenGL_GLSLProgram, __pyx_callargs+__pyx_t_4, (3-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_5);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(32, 91, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }

  /* "opengl/modern/simple_image_shader_widget.pyx":91
 *                                    uniform_block_names_sizes_and_offsets = []):
 *         self.image_shader.delete_resource()
 *         self.image_shader = GLSLProgram(             # <<<<<<<<<<<<<<
 *             self.vertex_shader_source,
 *             source,
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_image_shader, ((PyObject *)__pyx_t_1)) < (0)) __PYX_ERR(32, 91, __pyx_L1_error)
  __Pyx_DECREF((PyObject *)__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/modern/simple_image_shader_widget.pyx":87
 *             self.textures.append(texture)
 * 
 *     def set_fragment_shader_source(self,             # <<<<<<<<<<<<<<
 *                                    source,
 *                                    uniform_block_names_sizes_and_offsets = []):
*/

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

/* "opengl/modern/simple_image_shader_widget.pyx":97
 *             name = "image shader")
 * 
 *     def render_to_array(self, width, height, as_float = False):             # <<<<<<<<<<<<<<
 *         """
 *         Renders the image into an off-screen framebuffer
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_23SimpleImageShaderWidget_7render_to_array(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_23SimpleImageShaderWidget_6render_to_array, "SimpleImageShaderWidget.render_to_array(self, width, height, as_float=False)\n\nRenders the image into an off-screen framebuffer\nof given width and height and returns the result as an array.\n\nThe array either holds unsigned byte or float RGB.");
static PyMethodDef __pyx_mdef_8CyOpenGL_23SimpleImageShaderWidget_7render_to_array = {"render_to_array", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_23SimpleImageShaderWidget_7render_to_array, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_23SimpleImageShaderWidget_6render_to_array};
static PyObject *__pyx_pw_8CyOpenGL_23SimpleImageShaderWidget_7render_to_array(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_width = 0;
  PyObject *__pyx_v_height = 0;
  PyObject *__pyx_v_as_float = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[4] = {0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("render_to_array (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_width,&__pyx_mstate_global->__pyx_n_u_height,&__pyx_mstate_global->__pyx_n_u_as_float,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(32, 97, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(32, 97, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(32, 97, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(32, 97, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(32, 97, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "render_to_array", 0) < (0)) __PYX_ERR(32, 97, __pyx_L3_error)
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False)));
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("render_to_array", 0, 3, 4, i); __PYX_ERR(32, 97, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(32, 97, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(32, 97, __pyx_L3_error)
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(32, 97, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(32, 97, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False)));
    }
    __pyx_v_self = values[0];
    __pyx_v_width = values[1];
    __pyx_v_height = values[2];
    __pyx_v_as_float = values[3];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("render_to_array", 0, 3, 4, __pyx_nargs); __PYX_ERR(32, 97, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("CyOpenGL.SimpleImageShaderWidget.render_to_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_23SimpleImageShaderWidget_6render_to_array(__pyx_self, __pyx_v_self, __pyx_v_width, __pyx_v_height, __pyx_v_as_float);

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

static PyObject *__pyx_pf_8CyOpenGL_23SimpleImageShaderWidget_6render_to_array(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_width, PyObject *__pyx_v_height, PyObject *__pyx_v_as_float) {
  GLuint __pyx_v_fbo;
  GLenum __pyx_v_color_texture_type;
  GLuint __pyx_v_color_texture;
  GLuint __pyx_v_depth_texture;
  PyObject *__pyx_v_array_type = 0;
  arrayobject *__pyx_v_c_array = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_t_4;
  GLsizei __pyx_t_5;
  GLsizei __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("render_to_array", 0);

  /* "opengl/modern/simple_image_shader_widget.pyx":112
 *         cdef array.array c_array
 * 
 *         self.make_current()             # <<<<<<<<<<<<<<
 * 
 *         if as_float:
*/
  __pyx_t_2 = __pyx_v_self;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_make_current, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(32, 112, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/modern/simple_image_shader_widget.pyx":114
 *         self.make_current()
 * 
 *         if as_float:             # <<<<<<<<<<<<<<
 *             array_type = 'f'
 *             color_texture_type = GL_FLOAT
*/
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_as_float); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(32, 114, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "opengl/modern/simple_image_shader_widget.pyx":115
 * 
 *         if as_float:
 *             array_type = 'f'             # <<<<<<<<<<<<<<
 *             color_texture_type = GL_FLOAT
 *         else:
*/
    __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_f);
    __pyx_v_array_type = __pyx_mstate_global->__pyx_n_u_f;

    /* "opengl/modern/simple_image_shader_widget.pyx":116
 *         if as_float:
 *             array_type = 'f'
 *             color_texture_type = GL_FLOAT             # <<<<<<<<<<<<<<
 *         else:
 *             array_type = 'B'
*/
    __pyx_v_color_texture_type = GL_FLOAT;

    /* "opengl/modern/simple_image_shader_widget.pyx":114
 *         self.make_current()
 * 
 *         if as_float:             # <<<<<<<<<<<<<<
 *             array_type = 'f'
 *             color_texture_type = GL_FLOAT
*/
    goto __pyx_L3;
  }

  /* "opengl/modern/simple_image_shader_widget.pyx":118
 *             color_texture_type = GL_FLOAT
 *         else:
 *             array_type = 'B'             # <<<<<<<<<<<<<<
 *             color_texture_type = GL_UNSIGNED_BYTE
 * 
*/
  /*else*/ {
    __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_B);
    __pyx_v_array_type = __pyx_mstate_global->__pyx_n_u_B;

    /* "opengl/modern/simple_image_shader_widget.pyx":119
 *         else:
 *             array_type = 'B'
 *             color_texture_type = GL_UNSIGNED_BYTE             # <<<<<<<<<<<<<<
 * 
 *         # Create texture for color attachment
*/
    __pyx_v_color_texture_type = GL_UNSIGNED_BYTE;
  }
  __pyx_L3:;

  /* "opengl/modern/simple_image_shader_widget.pyx":122
 * 
 *         # Create texture for color attachment
 *         glGenTextures(1, &color_texture)             # <<<<<<<<<<<<<<
 *         glBindTexture(GL_TEXTURE_2D, color_texture)
 *         glTexImage2D(GL_TEXTURE_2D, 0,
*/
  glGenTextures(1, (&__pyx_v_color_texture));

  /* "opengl/modern/simple_image_shader_widget.pyx":123
 *         # Create texture for color attachment
 *         glGenTextures(1, &color_texture)
 *         glBindTexture(GL_TEXTURE_2D, color_texture)             # <<<<<<<<<<<<<<
 *         glTexImage2D(GL_TEXTURE_2D, 0,
 *                      GL_RGB, width, height,
*/
  glBindTexture(GL_TEXTURE_2D, __pyx_v_color_texture);

  /* "opengl/modern/simple_image_shader_widget.pyx":125
 *         glBindTexture(GL_TEXTURE_2D, color_texture)
 *         glTexImage2D(GL_TEXTURE_2D, 0,
 *                      GL_RGB, width, height,             # <<<<<<<<<<<<<<
 *                      0,
 *                      GL_RGB,
*/
  __pyx_t_5 = __Pyx_PyLong_As_GLsizei(__pyx_v_width); if (unlikely((__pyx_t_5 == ((GLsizei)-1)) && PyErr_Occurred())) __PYX_ERR(32, 125, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyLong_As_GLsizei(__pyx_v_height); if (unlikely((__pyx_t_6 == ((GLsizei)-1)) && PyErr_Occurred())) __PYX_ERR(32, 125, __pyx_L1_error)

  /* "opengl/modern/simple_image_shader_widget.pyx":124
 *         glGenTextures(1, &color_texture)
 *         glBindTexture(GL_TEXTURE_2D, color_texture)
 *         glTexImage2D(GL_TEXTURE_2D, 0,             # <<<<<<<<<<<<<<
 *                      GL_RGB, width, height,
 *                      0,
*/
  glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, __pyx_t_5, __pyx_t_6, 0, GL_RGB, __pyx_v_color_texture_type, NULL);

  /* "opengl/modern/simple_image_shader_widget.pyx":130
 *                      color_texture_type,
 *                      NULL)
 *         glTexParameteri(GL_TEXTURE_2D,             # <<<<<<<<<<<<<<
 *                         GL_TEXTURE_MIN_FILTER,
 *                         GL_LINEAR)
*/
  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);

  /* "opengl/modern/simple_image_shader_widget.pyx":133
 *                         GL_TEXTURE_MIN_FILTER,
 *                         GL_LINEAR)
 *         glTexParameteri(GL_TEXTURE_2D,             # <<<<<<<<<<<<<<
 *                         GL_TEXTURE_MAG_FILTER,
 *                         GL_LINEAR)
*/
  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);

  /* "opengl/modern/simple_image_shader_widget.pyx":138
 * 
 *         # Create texture for depth attachment
 *         glGenTextures(1, &depth_texture)             # <<<<<<<<<<<<<<
 *         glBindTexture(GL_TEXTURE_2D, depth_texture)
 *         glTexImage2D(GL_TEXTURE_2D, 0,
*/
  glGenTextures(1, (&__pyx_v_depth_texture));

  /* "opengl/modern/simple_image_shader_widget.pyx":139
 *         # Create texture for depth attachment
 *         glGenTextures(1, &depth_texture)
 *         glBindTexture(GL_TEXTURE_2D, depth_texture)             # <<<<<<<<<<<<<<
 *         glTexImage2D(GL_TEXTURE_2D, 0,
 *                      GL_DEPTH_COMPONENT, width, height,
*/
  glBindTexture(GL_TEXTURE_2D, __pyx_v_depth_texture);

  /* "opengl/modern/simple_image_shader_widget.pyx":141
 *         glBindTexture(GL_TEXTURE_2D, depth_texture)
 *         glTexImage2D(GL_TEXTURE_2D, 0,
 *                      GL_DEPTH_COMPONENT, width, height,             # <<<<<<<<<<<<<<
 *                      0,
 *                      GL_DEPTH_COMPONENT,
*/
  __pyx_t_6 = __Pyx_PyLong_As_GLsizei(__pyx_v_width); if (unlikely((__pyx_t_6 == ((GLsizei)-1)) && PyErr_Occurred())) __PYX_ERR(32, 141, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyLong_As_GLsizei(__pyx_v_height); if (unlikely((__pyx_t_5 == ((GLsizei)-1)) && PyErr_Occurred())) __PYX_ERR(32, 141, __pyx_L1_error)

  /* "opengl/modern/simple_image_shader_widget.pyx":140
 *         glGenTextures(1, &depth_texture)
 *         glBindTexture(GL_TEXTURE_2D, depth_texture)
 *         glTexImage2D(GL_TEXTURE_2D, 0,             # <<<<<<<<<<<<<<
 *                      GL_DEPTH_COMPONENT, width, height,
 *                      0,
*/
  glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, __pyx_t_6, __pyx_t_5, 0, GL_DEPTH_COMPONENT, GL_FLOAT, NULL);

  /* "opengl/modern/simple_image_shader_widget.pyx":146
 *                      GL_FLOAT,
 *                      NULL)
 *         glTexParameteri(GL_TEXTURE_2D,             # <<<<<<<<<<<<<<
 *                         GL_TEXTURE_MIN_FILTER,
 *                         GL_LINEAR)
*/
  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);

  /* "opengl/modern/simple_image_shader_widget.pyx":149
 *                         GL_TEXTURE_MIN_FILTER,
 *                         GL_LINEAR)
 *         glTexParameteri(GL_TEXTURE_2D,             # <<<<<<<<<<<<<<
 *                         GL_TEXTURE_MAG_FILTER,
 *                         GL_LINEAR)
*/
  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);

  /* "opengl/modern/simple_image_shader_widget.pyx":154
 * 
 *         # Create framebuffer
 *         glGenFramebuffers(1, &fbo)             # <<<<<<<<<<<<<<
 *         glBindFramebuffer(GL_FRAMEBUFFER, fbo)
 *         glFramebufferTexture2D(GL_FRAMEBUFFER,
*/
  glGenFramebuffers(1, (&__pyx_v_fbo));

  /* "opengl/modern/simple_image_shader_widget.pyx":155
 *         # Create framebuffer
 *         glGenFramebuffers(1, &fbo)
 *         glBindFramebuffer(GL_FRAMEBUFFER, fbo)             # <<<<<<<<<<<<<<
 *         glFramebufferTexture2D(GL_FRAMEBUFFER,
 *                                GL_COLOR_ATTACHMENT0,
*/
  glBindFramebuffer(GL_FRAMEBUFFER, __pyx_v_fbo);

  /* "opengl/modern/simple_image_shader_widget.pyx":156
 *         glGenFramebuffers(1, &fbo)
 *         glBindFramebuffer(GL_FRAMEBUFFER, fbo)
 *         glFramebufferTexture2D(GL_FRAMEBUFFER,             # <<<<<<<<<<<<<<
 *                                GL_COLOR_ATTACHMENT0,
 *                                GL_TEXTURE_2D,
*/
  glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, __pyx_v_color_texture, 0);

  /* "opengl/modern/simple_image_shader_widget.pyx":160
 *                                GL_TEXTURE_2D,
 *                                color_texture, 0)
 *         glFramebufferTexture2D(GL_FRAMEBUFFER,             # <<<<<<<<<<<<<<
 *                                GL_DEPTH_ATTACHMENT,
 *                                GL_TEXTURE_2D,
*/
  glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, __pyx_v_depth_texture, 0);

  /* "opengl/modern/simple_image_shader_widget.pyx":164
 *                                GL_TEXTURE_2D,
 *                                depth_texture, 0)
 *         if glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE:             # <<<<<<<<<<<<<<
 *             raise Exception("Incomplete framebuffer")
 * 
*/
  __pyx_t_4 = (glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE);
  if (unlikely(__pyx_t_4)) {

    /* "opengl/modern/simple_image_shader_widget.pyx":165
 *                                depth_texture, 0)
 *         if glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE:
 *             raise Exception("Incomplete framebuffer")             # <<<<<<<<<<<<<<
 * 
 *         # Render into the framebuffer
*/
    __pyx_t_2 = NULL;
    __pyx_t_3 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_Incomplete_framebuffer};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_Exception)), __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(32, 165, __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(32, 165, __pyx_L1_error)

    /* "opengl/modern/simple_image_shader_widget.pyx":164
 *                                GL_TEXTURE_2D,
 *                                depth_texture, 0)
 *         if glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE:             # <<<<<<<<<<<<<<
 *             raise Exception("Incomplete framebuffer")
 * 
*/
  }

  /* "opengl/modern/simple_image_shader_widget.pyx":168
 * 
 *         # Render into the framebuffer
 *         self.draw_impl(width, height)             # <<<<<<<<<<<<<<
 *         glFinish()
 * 
*/
  __pyx_t_2 = __pyx_v_self;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_width, __pyx_v_height};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_draw_impl, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(32, 168, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/modern/simple_image_shader_widget.pyx":169
 *         # Render into the framebuffer
 *         self.draw_impl(width, height)
 *         glFinish()             # <<<<<<<<<<<<<<
 * 
 *         # Allocate memory and read framebuffer into it
*/
  glFinish();

  /* "opengl/modern/simple_image_shader_widget.pyx":172
 * 
 *         # Allocate memory and read framebuffer into it
 *         c_array = array.array(array_type)             # <<<<<<<<<<<<<<
 *         array.resize(c_array, 3 * width * height)
 *         glPixelStorei(GL_PACK_ALIGNMENT, 1)
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_array_type};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7cpython_5array_array, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(32, 172, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_c_array = ((arrayobject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "opengl/modern/simple_image_shader_widget.pyx":173
 *         # Allocate memory and read framebuffer into it
 *         c_array = array.array(array_type)
 *         array.resize(c_array, 3 * width * height)             # <<<<<<<<<<<<<<
 *         glPixelStorei(GL_PACK_ALIGNMENT, 1)
 *         glReadPixels(0, 0, width, height,
*/
  __pyx_t_1 = __Pyx_PyLong_MultiplyCObj(__pyx_mstate_global->__pyx_int_3, __pyx_v_width, 3, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(32, 173, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Multiply(__pyx_t_1, __pyx_v_height); if (unlikely(!__pyx_t_2)) __PYX_ERR(32, 173, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(32, 173, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_8 = resize(__pyx_v_c_array, __pyx_t_7); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(32, 173, __pyx_L1_error)

  /* "opengl/modern/simple_image_shader_widget.pyx":174
 *         c_array = array.array(array_type)
 *         array.resize(c_array, 3 * width * height)
 *         glPixelStorei(GL_PACK_ALIGNMENT, 1)             # <<<<<<<<<<<<<<
 *         glReadPixels(0, 0, width, height,
 *                      GL_RGB,
*/
  glPixelStorei(GL_PACK_ALIGNMENT, 1);

  /* "opengl/modern/simple_image_shader_widget.pyx":175
 *         array.resize(c_array, 3 * width * height)
 *         glPixelStorei(GL_PACK_ALIGNMENT, 1)
 *         glReadPixels(0, 0, width, height,             # <<<<<<<<<<<<<<
 *                      GL_RGB,
 *                      color_texture_type,
*/
  __pyx_t_5 = __Pyx_PyLong_As_GLsizei(__pyx_v_width); if (unlikely((__pyx_t_5 == ((GLsizei)-1)) && PyErr_Occurred())) __PYX_ERR(32, 175, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyLong_As_GLsizei(__pyx_v_height); if (unlikely((__pyx_t_6 == ((GLsizei)-1)) && PyErr_Occurred())) __PYX_ERR(32, 175, __pyx_L1_error)

  /* "opengl/modern/simple_image_shader_widget.pyx":178
 *                      GL_RGB,
 *                      color_texture_type,
 *                      c_array.data.as_voidptr)             # <<<<<<<<<<<<<<
 * 
 *         # Unbind framebuffer so that stuff is rendered
*/
  glReadPixels(0, 0, __pyx_t_5, __pyx_t_6, GL_RGB, __pyx_v_color_texture_type, __pyx_f_7cpython_5array_5array_4data_data(__pyx_v_c_array).as_voidptr);

  /* "opengl/modern/simple_image_shader_widget.pyx":182
 *         # Unbind framebuffer so that stuff is rendered
 *         # to screen again.
 *         glBindFramebuffer(GL_FRAMEBUFFER, 0)             # <<<<<<<<<<<<<<
 * 
 *         glDeleteFramebuffers(1, &fbo)
*/
  glBindFramebuffer(GL_FRAMEBUFFER, 0);

  /* "opengl/modern/simple_image_shader_widget.pyx":184
 *         glBindFramebuffer(GL_FRAMEBUFFER, 0)
 * 
 *         glDeleteFramebuffers(1, &fbo)             # <<<<<<<<<<<<<<
 *         glDeleteTextures(1, &color_texture)
 *         glDeleteTextures(1, &depth_texture)
*/
  glDeleteFramebuffers(1, (&__pyx_v_fbo));

  /* "opengl/modern/simple_image_shader_widget.pyx":185
 * 
 *         glDeleteFramebuffers(1, &fbo)
 *         glDeleteTextures(1, &color_texture)             # <<<<<<<<<<<<<<
 *         glDeleteTextures(1, &depth_texture)
 * 
*/
  glDeleteTextures(1, (&__pyx_v_color_texture));

  /* "opengl/modern/simple_image_shader_widget.pyx":186
 *         glDeleteFramebuffers(1, &fbo)
 *         glDeleteTextures(1, &color_texture)
 *         glDeleteTextures(1, &depth_texture)             # <<<<<<<<<<<<<<
 * 
 *         print_gl_errors("Render to off-screen area")
*/
  glDeleteTextures(1, (&__pyx_v_depth_texture));

  /* "opengl/modern/simple_image_shader_widget.pyx":188
 *         glDeleteTextures(1, &depth_texture)
 * 
 *         print_gl_errors("Render to off-screen area")             # <<<<<<<<<<<<<<
 * 
 *         return c_array
*/
  __pyx_t_1 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_print_gl_errors); if (unlikely(!__pyx_t_9)) __PYX_ERR(32, 188, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_3 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_9))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_9);
    assert(__pyx_t_1);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_9);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_9, __pyx__function);
    __pyx_t_3 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_mstate_global->__pyx_kp_u_Render_to_off_screen_area};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_9, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(32, 188, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opengl/modern/simple_image_shader_widget.pyx":190
 *         print_gl_errors("Render to off-screen area")
 * 
 *         return c_array             # <<<<<<<<<<<<<<
 * 
 *     def save_image(self, width, height, outfile):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_c_array);
  __pyx_r = ((PyObject *)__pyx_v_c_array);
  goto __pyx_L0;

  /* "opengl/modern/simple_image_shader_widget.pyx":97
 *             name = "image shader")
 * 
 *     def render_to_array(self, width, height, as_float = False):             # <<<<<<<<<<<<<<
 *         """
 *         Renders the image into an off-screen framebuffer
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("CyOpenGL.SimpleImageShaderWidget.render_to_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_array_type);
  __Pyx_XDECREF((PyObject *)__pyx_v_c_array);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opengl/modern/simple_image_shader_widget.pyx":192
 *         return c_array
 * 
 *     def save_image(self, width, height, outfile):             # <<<<<<<<<<<<<<
 *         """
 *         Writes image of given width and height
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_23SimpleImageShaderWidget_9save_image(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_23SimpleImageShaderWidget_8save_image, "SimpleImageShaderWidget.save_image(self, width, height, outfile)\n\nWrites image of given width and height\nas png to given outfile (file object returned by,\n.e.g, open(\"myFile.png\", \"wb\")).");
static PyMethodDef __pyx_mdef_8CyOpenGL_23SimpleImageShaderWidget_9save_image = {"save_image", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_23SimpleImageShaderWidget_9save_image, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_23SimpleImageShaderWidget_8save_image};
static PyObject *__pyx_pw_8CyOpenGL_23SimpleImageShaderWidget_9save_image(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_width = 0;
  PyObject *__pyx_v_height = 0;
  PyObject *__pyx_v_outfile = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[4] = {0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("save_image (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_width,&__pyx_mstate_global->__pyx_n_u_height,&__pyx_mstate_global->__pyx_n_u_outfile,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(32, 192, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(32, 192, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(32, 192, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(32, 192, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(32, 192, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "save_image", 0) < (0)) __PYX_ERR(32, 192, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 4; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("save_image", 1, 4, 4, i); __PYX_ERR(32, 192, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 4)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(32, 192, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(32, 192, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(32, 192, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(32, 192, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
    __pyx_v_width = values[1];
    __pyx_v_height = values[2];
    __pyx_v_outfile = values[3];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("save_image", 1, 4, 4, __pyx_nargs); __PYX_ERR(32, 192, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("CyOpenGL.SimpleImageShaderWidget.save_image", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_23SimpleImageShaderWidget_8save_image(__pyx_self, __pyx_v_self, __pyx_v_width, __pyx_v_height, __pyx_v_outfile);

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

static PyObject *__pyx_pf_8CyOpenGL_23SimpleImageShaderWidget_8save_image(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_width, PyObject *__pyx_v_height, PyObject *__pyx_v_outfile) {
  PyObject *__pyx_v_data = NULL;
  PyObject *__pyx_v_stride = NULL;
  PyObject *__pyx_v_rows = NULL;
  PyObject *__pyx_v_writer = NULL;
  PyObject *__pyx_9genexpr14__pyx_v_i = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *(*__pyx_t_6)(PyObject *);
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("save_image", 0);

  /* "opengl/modern/simple_image_shader_widget.pyx":199
 *         """
 * 
 *         data = self.render_to_array(width, height)             # <<<<<<<<<<<<<<
 * 
 *         # Png writer expects row - we also need to
*/
  __pyx_t_2 = __pyx_v_self;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_width, __pyx_v_height};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_render_to_array, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(32, 199, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_data = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "opengl/modern/simple_image_shader_widget.pyx":203
 *         # Png writer expects row - we also need to
 *         # flip the image vertically.
 *         stride = 3 * width             # <<<<<<<<<<<<<<
 *         rows = [ data[i * stride : (i+1) * stride]
 *                  for i in range(height - 1, -1, -1) ]
*/
  __pyx_t_1 = __Pyx_PyLong_MultiplyCObj(__pyx_mstate_global->__pyx_int_3, __pyx_v_width, 3, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(32, 203, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_stride = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "opengl/modern/simple_image_shader_widget.pyx":204
 *         # flip the image vertically.
 *         stride = 3 * width
 *         rows = [ data[i * stride : (i+1) * stride]             # <<<<<<<<<<<<<<
 *                  for i in range(height - 1, -1, -1) ]
 * 
*/
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(32, 204, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "opengl/modern/simple_image_shader_widget.pyx":205
 *         stride = 3 * width
 *         rows = [ data[i * stride : (i+1) * stride]
 *                  for i in range(height - 1, -1, -1) ]             # <<<<<<<<<<<<<<
 * 
 *         writer = png.Writer(
*/
    __pyx_t_4 = NULL;
    __pyx_t_5 = __Pyx_PyLong_SubtractObjC(__pyx_v_height, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(32, 205, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = 1;
    {
      PyObject *__pyx_callargs[4] = {__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_int_neg_1, __pyx_mstate_global->__pyx_int_neg_1};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(&PyRange_Type), __pyx_callargs+__pyx_t_3, (4-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(32, 205, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_t_5 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(32, 205, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(32, 205, __pyx_L5_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    for (;;) {
      {
        __pyx_t_2 = __pyx_t_6(__pyx_t_5);
        if (unlikely(!__pyx_t_2)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(32, 205, __pyx_L5_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_XDECREF_SET(__pyx_9genexpr14__pyx_v_i, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "opengl/modern/simple_image_shader_widget.pyx":204
 *         # flip the image vertically.
 *         stride = 3 * width
 *         rows = [ data[i * stride : (i+1) * stride]             # <<<<<<<<<<<<<<
 *                  for i in range(height - 1, -1, -1) ]
 * 
*/
      __pyx_t_2 = PyNumber_Multiply(__pyx_9genexpr14__pyx_v_i, __pyx_v_stride); if (unlikely(!__pyx_t_2)) __PYX_ERR(32, 204, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = __Pyx_PyLong_AddObjC(__pyx_9genexpr14__pyx_v_i, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(32, 204, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_7 = PyNumber_Multiply(__pyx_t_4, __pyx_v_stride); if (unlikely(!__pyx_t_7)) __PYX_ERR(32, 204, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_v_data, 0, 0, &__pyx_t_2, &__pyx_t_7, NULL, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(32, 204, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) __PYX_ERR(32, 204, __pyx_L5_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "opengl/modern/simple_image_shader_widget.pyx":205
 *         stride = 3 * width
 *         rows = [ data[i * stride : (i+1) * stride]
 *                  for i in range(height - 1, -1, -1) ]             # <<<<<<<<<<<<<<
 * 
 *         writer = png.Writer(
*/
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_9genexpr14__pyx_v_i); __pyx_9genexpr14__pyx_v_i = 0;
    goto __pyx_L9_exit_scope;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_9genexpr14__pyx_v_i); __pyx_9genexpr14__pyx_v_i = 0;
    goto __pyx_L1_error;
    __pyx_L9_exit_scope:;
  } /* exit inner scope */
  __pyx_v_rows = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "opengl/modern/simple_image_shader_widget.pyx":207
 *                  for i in range(height - 1, -1, -1) ]
 * 
 *         writer = png.Writer(             # <<<<<<<<<<<<<<
 *             width, height,
 *             greyscale = False,
*/
  __pyx_t_5 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_png); if (unlikely(!__pyx_t_4)) __PYX_ERR(32, 207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_Writer); if (unlikely(!__pyx_t_7)) __PYX_ERR(32, 207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opengl/modern/simple_image_shader_widget.pyx":211
 *             greyscale = False,
 *             bitdepth = 8,
 *             alpha = False)             # <<<<<<<<<<<<<<
 *         writer.write(outfile, rows)
 * 
*/
  __pyx_t_3 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
    assert(__pyx_t_5);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
    __pyx_t_3 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[3 + ((CYTHON_VECTORCALL) ? 3 : 0)] = {__pyx_t_5, __pyx_v_width, __pyx_v_height};
    __pyx_t_4 = __Pyx_MakeVectorcallBuilderKwds(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(32, 207, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_greyscale, Py_False, __pyx_t_4, __pyx_callargs+3, 0) < (0)) __PYX_ERR(32, 207, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_bitdepth, __pyx_mstate_global->__pyx_int_8, __pyx_t_4, __pyx_callargs+3, 1) < (0)) __PYX_ERR(32, 207, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_alpha, Py_False, __pyx_t_4, __pyx_callargs+3, 2) < (0)) __PYX_ERR(32, 207, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(32, 207, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_writer = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "opengl/modern/simple_image_shader_widget.pyx":212
 *             bitdepth = 8,
 *             alpha = False)
 *         writer.write(outfile, rows)             # <<<<<<<<<<<<<<
 * 
 *     def read_depth_value(self, x, y):
*/
  __pyx_t_7 = __pyx_v_writer;
  __Pyx_INCREF(__pyx_t_7);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_v_outfile, __pyx_v_rows};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_write, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(32, 212, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/modern/simple_image_shader_widget.pyx":192
 *         return c_array
 * 
 *     def save_image(self, width, height, outfile):             # <<<<<<<<<<<<<<
 *         """
 *         Writes image of given width and height
*/

  /* 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_7);
  __Pyx_AddTraceback("CyOpenGL.SimpleImageShaderWidget.save_image", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_data);
  __Pyx_XDECREF(__pyx_v_stride);
  __Pyx_XDECREF(__pyx_v_rows);
  __Pyx_XDECREF(__pyx_v_writer);
  __Pyx_XDECREF(__pyx_9genexpr14__pyx_v_i);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opengl/modern/simple_image_shader_widget.pyx":214
 *         writer.write(outfile, rows)
 * 
 *     def read_depth_value(self, x, y):             # <<<<<<<<<<<<<<
 * 
 *         cdef GLfloat depth
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_23SimpleImageShaderWidget_11read_depth_value(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_23SimpleImageShaderWidget_10read_depth_value, "SimpleImageShaderWidget.read_depth_value(self, x, y)");
static PyMethodDef __pyx_mdef_8CyOpenGL_23SimpleImageShaderWidget_11read_depth_value = {"read_depth_value", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_23SimpleImageShaderWidget_11read_depth_value, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_23SimpleImageShaderWidget_10read_depth_value};
static PyObject *__pyx_pw_8CyOpenGL_23SimpleImageShaderWidget_11read_depth_value(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_x = 0;
  PyObject *__pyx_v_y = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("read_depth_value (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_y,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(32, 214, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(32, 214, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(32, 214, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(32, 214, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "read_depth_value", 0) < (0)) __PYX_ERR(32, 214, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("read_depth_value", 1, 3, 3, i); __PYX_ERR(32, 214, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(32, 214, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(32, 214, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(32, 214, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
    __pyx_v_x = values[1];
    __pyx_v_y = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("read_depth_value", 1, 3, 3, __pyx_nargs); __PYX_ERR(32, 214, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("CyOpenGL.SimpleImageShaderWidget.read_depth_value", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_23SimpleImageShaderWidget_10read_depth_value(__pyx_self, __pyx_v_self, __pyx_v_x, __pyx_v_y);

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

static PyObject *__pyx_pf_8CyOpenGL_23SimpleImageShaderWidget_10read_depth_value(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y) {
  GLfloat __pyx_v_depth;
  PyObject *__pyx_v_width = NULL;
  PyObject *__pyx_v_height = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  GLint __pyx_t_5;
  GLint __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("read_depth_value", 0);

  /* "opengl/modern/simple_image_shader_widget.pyx":218
 *         cdef GLfloat depth
 * 
 *         width = self.winfo_width()             # <<<<<<<<<<<<<<
 *         height = self.winfo_height()
 * 
*/
  __pyx_t_2 = __pyx_v_self;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_winfo_width, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(32, 218, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_width = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "opengl/modern/simple_image_shader_widget.pyx":219
 * 
 *         width = self.winfo_width()
 *         height = self.winfo_height()             # <<<<<<<<<<<<<<
 * 
 *         self.make_current()
*/
  __pyx_t_2 = __pyx_v_self;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_winfo_height, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(32, 219, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_height = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "opengl/modern/simple_image_shader_widget.pyx":221
 *         height = self.winfo_height()
 * 
 *         self.make_current()             # <<<<<<<<<<<<<<
 * 
 *         self.draw_impl(width, height,
*/
  __pyx_t_2 = __pyx_v_self;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_make_current, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(32, 221, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/modern/simple_image_shader_widget.pyx":223
 *         self.make_current()
 * 
 *         self.draw_impl(width, height,             # <<<<<<<<<<<<<<
 *                        include_depth_value = True)
 *         glFinish()
*/
  __pyx_t_2 = __pyx_v_self;
  __Pyx_INCREF(__pyx_t_2);

  /* "opengl/modern/simple_image_shader_widget.pyx":224
 * 
 *         self.draw_impl(width, height,
 *                        include_depth_value = True)             # <<<<<<<<<<<<<<
 *         glFinish()
 * 
*/
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[3 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, __pyx_v_width, __pyx_v_height};
    __pyx_t_4 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(32, 223, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_include_depth_value, Py_True, __pyx_t_4, __pyx_callargs+3, 0) < (0)) __PYX_ERR(32, 223, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_draw_impl, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(32, 223, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/modern/simple_image_shader_widget.pyx":225
 *         self.draw_impl(width, height,
 *                        include_depth_value = True)
 *         glFinish()             # <<<<<<<<<<<<<<
 * 
 *         glReadPixels(x, height - y, 1, 1,
*/
  glFinish();

  /* "opengl/modern/simple_image_shader_widget.pyx":227
 *         glFinish()
 * 
 *         glReadPixels(x, height - y, 1, 1,             # <<<<<<<<<<<<<<
 *                      GL_DEPTH_COMPONENT,
 *                      GL_FLOAT, &depth)
*/
  __pyx_t_5 = __Pyx_PyLong_As_GLint(__pyx_v_x); if (unlikely((__pyx_t_5 == ((GLint)-1)) && PyErr_Occurred())) __PYX_ERR(32, 227, __pyx_L1_error)
  __pyx_t_1 = PyNumber_Subtract(__pyx_v_height, __pyx_v_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(32, 227, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_PyLong_As_GLint(__pyx_t_1); if (unlikely((__pyx_t_6 == ((GLint)-1)) && PyErr_Occurred())) __PYX_ERR(32, 227, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/modern/simple_image_shader_widget.pyx":229
 *         glReadPixels(x, height - y, 1, 1,
 *                      GL_DEPTH_COMPONENT,
 *                      GL_FLOAT, &depth)             # <<<<<<<<<<<<<<
 * 
 *         return (depth, width, height)
*/
  glReadPixels(__pyx_t_5, __pyx_t_6, 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT, (&__pyx_v_depth));

  /* "opengl/modern/simple_image_shader_widget.pyx":231
 *                      GL_FLOAT, &depth)
 * 
 *         return (depth, width, height)             # <<<<<<<<<<<<<<
 * 
 *     def draw_impl(self, width, height,
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_depth); if (unlikely(!__pyx_t_1)) __PYX_ERR(32, 231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(32, 231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1) != (0)) __PYX_ERR(32, 231, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_width);
  __Pyx_GIVEREF(__pyx_v_width);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_width) != (0)) __PYX_ERR(32, 231, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_height);
  __Pyx_GIVEREF(__pyx_v_height);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_height) != (0)) __PYX_ERR(32, 231, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "opengl/modern/simple_image_shader_widget.pyx":214
 *         writer.write(outfile, rows)
 * 
 *     def read_depth_value(self, x, y):             # <<<<<<<<<<<<<<
 * 
 *         cdef GLfloat depth
*/

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

/* "opengl/modern/simple_image_shader_widget.pyx":233
 *         return (depth, width, height)
 * 
 *     def draw_impl(self, width, height,             # <<<<<<<<<<<<<<
 *                   include_depth_value = False):
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_23SimpleImageShaderWidget_13draw_impl(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_23SimpleImageShaderWidget_12draw_impl, "SimpleImageShaderWidget.draw_impl(self, width, height, include_depth_value=False)");
static PyMethodDef __pyx_mdef_8CyOpenGL_23SimpleImageShaderWidget_13draw_impl = {"draw_impl", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_23SimpleImageShaderWidget_13draw_impl, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_23SimpleImageShaderWidget_12draw_impl};
static PyObject *__pyx_pw_8CyOpenGL_23SimpleImageShaderWidget_13draw_impl(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_width = 0;
  PyObject *__pyx_v_height = 0;
  PyObject *__pyx_v_include_depth_value = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[4] = {0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("draw_impl (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_width,&__pyx_mstate_global->__pyx_n_u_height,&__pyx_mstate_global->__pyx_n_u_include_depth_value,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(32, 233, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(32, 233, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(32, 233, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(32, 233, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(32, 233, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "draw_impl", 0) < (0)) __PYX_ERR(32, 233, __pyx_L3_error)

      /* "opengl/modern/simple_image_shader_widget.pyx":234
 * 
 *     def draw_impl(self, width, height,
 *                   include_depth_value = False):             # <<<<<<<<<<<<<<
 * 
 *         if self.report_time_callback:
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False)));
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("draw_impl", 0, 3, 4, i); __PYX_ERR(32, 233, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(32, 233, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(32, 233, __pyx_L3_error)
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(32, 233, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(32, 233, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False)));
    }
    __pyx_v_self = values[0];
    __pyx_v_width = values[1];
    __pyx_v_height = values[2];
    __pyx_v_include_depth_value = values[3];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("draw_impl", 0, 3, 4, __pyx_nargs); __PYX_ERR(32, 233, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("CyOpenGL.SimpleImageShaderWidget.draw_impl", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_23SimpleImageShaderWidget_12draw_impl(__pyx_self, __pyx_v_self, __pyx_v_width, __pyx_v_height, __pyx_v_include_depth_value);

  /* "opengl/modern/simple_image_shader_widget.pyx":233
 *         return (depth, width, height)
 * 
 *     def draw_impl(self, width, height,             # <<<<<<<<<<<<<<
 *                   include_depth_value = False):
 * 
*/

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

static PyObject *__pyx_pf_8CyOpenGL_23SimpleImageShaderWidget_12draw_impl(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_width, PyObject *__pyx_v_height, PyObject *__pyx_v_include_depth_value) {
  PyObject *__pyx_v_start_time = NULL;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_texture = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  GLsizei __pyx_t_7;
  GLsizei __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  PyObject *(*__pyx_t_10)(PyObject *);
  GLenum __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("draw_impl", 0);

  /* "opengl/modern/simple_image_shader_widget.pyx":236
 *                   include_depth_value = False):
 * 
 *         if self.report_time_callback:             # <<<<<<<<<<<<<<
 *             start_time = time.time()
 * 
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_report_time_callback); if (unlikely(!__pyx_t_1)) __PYX_ERR(32, 236, __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(32, 236, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "opengl/modern/simple_image_shader_widget.pyx":237
 * 
 *         if self.report_time_callback:
 *             start_time = time.time()             # <<<<<<<<<<<<<<
 * 
 *         glViewport(0, 0, width, height)
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_time); if (unlikely(!__pyx_t_4)) __PYX_ERR(32, 237, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_time); if (unlikely(!__pyx_t_5)) __PYX_ERR(32, 237, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(32, 237, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __pyx_v_start_time = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "opengl/modern/simple_image_shader_widget.pyx":236
 *                   include_depth_value = False):
 * 
 *         if self.report_time_callback:             # <<<<<<<<<<<<<<
 *             start_time = time.time()
 * 
*/
  }

  /* "opengl/modern/simple_image_shader_widget.pyx":239
 *             start_time = time.time()
 * 
 *         glViewport(0, 0, width, height)             # <<<<<<<<<<<<<<
 *         if include_depth_value:
 *             # Writes to z-buffer are only done when GL_DEPTH_TEST
*/
  __pyx_t_7 = __Pyx_PyLong_As_GLsizei(__pyx_v_width); if (unlikely((__pyx_t_7 == ((GLsizei)-1)) && PyErr_Occurred())) __PYX_ERR(32, 239, __pyx_L1_error)
  __pyx_t_8 = __Pyx_PyLong_As_GLsizei(__pyx_v_height); if (unlikely((__pyx_t_8 == ((GLsizei)-1)) && PyErr_Occurred())) __PYX_ERR(32, 239, __pyx_L1_error)
  glViewport(0, 0, __pyx_t_7, __pyx_t_8);

  /* "opengl/modern/simple_image_shader_widget.pyx":240
 * 
 *         glViewport(0, 0, width, height)
 *         if include_depth_value:             # <<<<<<<<<<<<<<
 *             # Writes to z-buffer are only done when GL_DEPTH_TEST
 *             # is enabled
*/
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_include_depth_value); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(32, 240, __pyx_L1_error)
  if (__pyx_t_2) {

    /* "opengl/modern/simple_image_shader_widget.pyx":243
 *             # Writes to z-buffer are only done when GL_DEPTH_TEST
 *             # is enabled
 *             glClear(GL_DEPTH_BUFFER_BIT)             # <<<<<<<<<<<<<<
 *             glEnable(GL_DEPTH_TEST)
 *         else:
*/
    glClear(GL_DEPTH_BUFFER_BIT);

    /* "opengl/modern/simple_image_shader_widget.pyx":244
 *             # is enabled
 *             glClear(GL_DEPTH_BUFFER_BIT)
 *             glEnable(GL_DEPTH_TEST)             # <<<<<<<<<<<<<<
 *         else:
 *             glDisable(GL_DEPTH_TEST)
*/
    glEnable(GL_DEPTH_TEST);

    /* "opengl/modern/simple_image_shader_widget.pyx":240
 * 
 *         glViewport(0, 0, width, height)
 *         if include_depth_value:             # <<<<<<<<<<<<<<
 *             # Writes to z-buffer are only done when GL_DEPTH_TEST
 *             # is enabled
*/
    goto __pyx_L4;
  }

  /* "opengl/modern/simple_image_shader_widget.pyx":246
 *             glEnable(GL_DEPTH_TEST)
 *         else:
 *             glDisable(GL_DEPTH_TEST)             # <<<<<<<<<<<<<<
 *         glDisable(GL_BLEND)
 *         glDisable(GL_CULL_FACE)
*/
  /*else*/ {
    glDisable(GL_DEPTH_TEST);
  }
  __pyx_L4:;

  /* "opengl/modern/simple_image_shader_widget.pyx":247
 *         else:
 *             glDisable(GL_DEPTH_TEST)
 *         glDisable(GL_BLEND)             # <<<<<<<<<<<<<<
 *         glDisable(GL_CULL_FACE)
 * 
*/
  glDisable(GL_BLEND);

  /* "opengl/modern/simple_image_shader_widget.pyx":248
 *             glDisable(GL_DEPTH_TEST)
 *         glDisable(GL_BLEND)
 *         glDisable(GL_CULL_FACE)             # <<<<<<<<<<<<<<
 * 
 *         if self.image_shader.is_valid():
*/
  glDisable(GL_CULL_FACE);

  /* "opengl/modern/simple_image_shader_widget.pyx":250
 *         glDisable(GL_CULL_FACE)
 * 
 *         if self.image_shader.is_valid():             # <<<<<<<<<<<<<<
 *             for i, texture in enumerate(self.textures):
 *                 if texture:
*/
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_image_shader); if (unlikely(!__pyx_t_3)) __PYX_ERR(32, 250, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __pyx_t_3;
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_is_valid, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(32, 250, __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(32, 250, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "opengl/modern/simple_image_shader_widget.pyx":251
 * 
 *         if self.image_shader.is_valid():
 *             for i, texture in enumerate(self.textures):             # <<<<<<<<<<<<<<
 *                 if texture:
 *                     glActiveTexture(GL_TEXTURE0 + i)
*/
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
    __pyx_t_1 = __pyx_mstate_global->__pyx_int_0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_textures); if (unlikely(!__pyx_t_3)) __PYX_ERR(32, 251, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    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(32, 251, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(32, 251, __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))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_5);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(32, 251, __pyx_L1_error)
            #endif
            if (__pyx_t_9 >= __pyx_temp) break;
          }
          __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_5, __pyx_t_9, __Pyx_ReferenceSharing_OwnStrongReference);
          ++__pyx_t_9;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_5);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(32, 251, __pyx_L1_error)
            #endif
            if (__pyx_t_9 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_9));
          #else
          __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_9);
          #endif
          ++__pyx_t_9;
        }
        if (unlikely(!__pyx_t_3)) __PYX_ERR(32, 251, __pyx_L1_error)
      } else {
        __pyx_t_3 = __pyx_t_10(__pyx_t_5);
        if (unlikely(!__pyx_t_3)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(32, 251, __pyx_L1_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_XDECREF_SET(__pyx_v_texture, __pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1);
      __pyx_t_3 = __Pyx_PyLong_AddObjC(__pyx_t_1, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(32, 251, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1);
      __pyx_t_1 = __pyx_t_3;
      __pyx_t_3 = 0;

      /* "opengl/modern/simple_image_shader_widget.pyx":252
 *         if self.image_shader.is_valid():
 *             for i, texture in enumerate(self.textures):
 *                 if texture:             # <<<<<<<<<<<<<<
 *                     glActiveTexture(GL_TEXTURE0 + i)
 *                     texture.bind()
*/
      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_texture); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(32, 252, __pyx_L1_error)
      if (__pyx_t_2) {

        /* "opengl/modern/simple_image_shader_widget.pyx":253
 *             for i, texture in enumerate(self.textures):
 *                 if texture:
 *                     glActiveTexture(GL_TEXTURE0 + i)             # <<<<<<<<<<<<<<
 *                     texture.bind()
 * 
*/
        __pyx_t_3 = __Pyx_PyLong_From___pyx_anon_enum(GL_TEXTURE0); if (unlikely(!__pyx_t_3)) __PYX_ERR(32, 253, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_v_i); if (unlikely(!__pyx_t_4)) __PYX_ERR(32, 253, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_11 = __Pyx_PyLong_As_GLenum(__pyx_t_4); if (unlikely((__pyx_t_11 == ((GLenum)-1)) && PyErr_Occurred())) __PYX_ERR(32, 253, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        glActiveTexture(__pyx_t_11);

        /* "opengl/modern/simple_image_shader_widget.pyx":254
 *                 if texture:
 *                     glActiveTexture(GL_TEXTURE0 + i)
 *                     texture.bind()             # <<<<<<<<<<<<<<
 * 
 *             self.image_shader.use_program()
*/
        __pyx_t_3 = __pyx_v_texture;
        __Pyx_INCREF(__pyx_t_3);
        __pyx_t_6 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
          __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_bind, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          if (unlikely(!__pyx_t_4)) __PYX_ERR(32, 254, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
        }
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "opengl/modern/simple_image_shader_widget.pyx":252
 *         if self.image_shader.is_valid():
 *             for i, texture in enumerate(self.textures):
 *                 if texture:             # <<<<<<<<<<<<<<
 *                     glActiveTexture(GL_TEXTURE0 + i)
 *                     texture.bind()
*/
      }

      /* "opengl/modern/simple_image_shader_widget.pyx":251
 * 
 *         if self.image_shader.is_valid():
 *             for i, texture in enumerate(self.textures):             # <<<<<<<<<<<<<<
 *                 if texture:
 *                     glActiveTexture(GL_TEXTURE0 + i)
*/
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "opengl/modern/simple_image_shader_widget.pyx":256
 *                     texture.bind()
 * 
 *             self.image_shader.use_program()             # <<<<<<<<<<<<<<
 *             self.image_shader.bind_uniforms(
 *                 self.get_uniform_bindings(width, height))
*/
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_image_shader); if (unlikely(!__pyx_t_4)) __PYX_ERR(32, 256, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __pyx_t_4;
    __Pyx_INCREF(__pyx_t_5);
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_use_program, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(32, 256, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "opengl/modern/simple_image_shader_widget.pyx":257
 * 
 *             self.image_shader.use_program()
 *             self.image_shader.bind_uniforms(             # <<<<<<<<<<<<<<
 *                 self.get_uniform_bindings(width, height))
 *             self._vertex_buffer.bind()
*/
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_image_shader); if (unlikely(!__pyx_t_5)) __PYX_ERR(32, 257, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __pyx_t_5;
    __Pyx_INCREF(__pyx_t_4);

    /* "opengl/modern/simple_image_shader_widget.pyx":258
 *             self.image_shader.use_program()
 *             self.image_shader.bind_uniforms(
 *                 self.get_uniform_bindings(width, height))             # <<<<<<<<<<<<<<
 *             self._vertex_buffer.bind()
 * 
*/
    __pyx_t_12 = __pyx_v_self;
    __Pyx_INCREF(__pyx_t_12);
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_12, __pyx_v_width, __pyx_v_height};
      __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_uniform_bindings, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(32, 258, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_bind_uniforms, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(32, 257, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "opengl/modern/simple_image_shader_widget.pyx":259
 *             self.image_shader.bind_uniforms(
 *                 self.get_uniform_bindings(width, height))
 *             self._vertex_buffer.bind()             # <<<<<<<<<<<<<<
 * 
 *             glDrawArrays(GL_TRIANGLES, 0, 3)
*/
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_vertex_buffer); if (unlikely(!__pyx_t_3)) __PYX_ERR(32, 259, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __pyx_t_3;
    __Pyx_INCREF(__pyx_t_5);
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_bind, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(32, 259, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "opengl/modern/simple_image_shader_widget.pyx":261
 *             self._vertex_buffer.bind()
 * 
 *             glDrawArrays(GL_TRIANGLES, 0, 3)             # <<<<<<<<<<<<<<
 * 
 *             for i, texture in enumerate(self.textures):
*/
    glDrawArrays(GL_TRIANGLES, 0, 3);

    /* "opengl/modern/simple_image_shader_widget.pyx":263
 *             glDrawArrays(GL_TRIANGLES, 0, 3)
 * 
 *             for i, texture in enumerate(self.textures):             # <<<<<<<<<<<<<<
 *                 if texture:
 *                     glActiveTexture(GL_TEXTURE0 + i)
*/
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
    __pyx_t_1 = __pyx_mstate_global->__pyx_int_0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_textures); if (unlikely(!__pyx_t_3)) __PYX_ERR(32, 263, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    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(32, 263, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(32, 263, __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))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_5);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(32, 263, __pyx_L1_error)
            #endif
            if (__pyx_t_9 >= __pyx_temp) break;
          }
          __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_5, __pyx_t_9, __Pyx_ReferenceSharing_OwnStrongReference);
          ++__pyx_t_9;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_5);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(32, 263, __pyx_L1_error)
            #endif
            if (__pyx_t_9 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_9));
          #else
          __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_9);
          #endif
          ++__pyx_t_9;
        }
        if (unlikely(!__pyx_t_3)) __PYX_ERR(32, 263, __pyx_L1_error)
      } else {
        __pyx_t_3 = __pyx_t_10(__pyx_t_5);
        if (unlikely(!__pyx_t_3)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(32, 263, __pyx_L1_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_XDECREF_SET(__pyx_v_texture, __pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1);
      __pyx_t_3 = __Pyx_PyLong_AddObjC(__pyx_t_1, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(32, 263, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1);
      __pyx_t_1 = __pyx_t_3;
      __pyx_t_3 = 0;

      /* "opengl/modern/simple_image_shader_widget.pyx":264
 * 
 *             for i, texture in enumerate(self.textures):
 *                 if texture:             # <<<<<<<<<<<<<<
 *                     glActiveTexture(GL_TEXTURE0 + i)
 *                     texture.unbind()
*/
      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_texture); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(32, 264, __pyx_L1_error)
      if (__pyx_t_2) {

        /* "opengl/modern/simple_image_shader_widget.pyx":265
 *             for i, texture in enumerate(self.textures):
 *                 if texture:
 *                     glActiveTexture(GL_TEXTURE0 + i)             # <<<<<<<<<<<<<<
 *                     texture.unbind()
 *             glActiveTexture(GL_TEXTURE0)
*/
        __pyx_t_3 = __Pyx_PyLong_From___pyx_anon_enum(GL_TEXTURE0); if (unlikely(!__pyx_t_3)) __PYX_ERR(32, 265, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_v_i); if (unlikely(!__pyx_t_4)) __PYX_ERR(32, 265, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_11 = __Pyx_PyLong_As_GLenum(__pyx_t_4); if (unlikely((__pyx_t_11 == ((GLenum)-1)) && PyErr_Occurred())) __PYX_ERR(32, 265, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        glActiveTexture(__pyx_t_11);

        /* "opengl/modern/simple_image_shader_widget.pyx":266
 *                 if texture:
 *                     glActiveTexture(GL_TEXTURE0 + i)
 *                     texture.unbind()             # <<<<<<<<<<<<<<
 *             glActiveTexture(GL_TEXTURE0)
 * 
*/
        __pyx_t_3 = __pyx_v_texture;
        __Pyx_INCREF(__pyx_t_3);
        __pyx_t_6 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
          __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_unbind, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          if (unlikely(!__pyx_t_4)) __PYX_ERR(32, 266, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
        }
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "opengl/modern/simple_image_shader_widget.pyx":264
 * 
 *             for i, texture in enumerate(self.textures):
 *                 if texture:             # <<<<<<<<<<<<<<
 *                     glActiveTexture(GL_TEXTURE0 + i)
 *                     texture.unbind()
*/
      }

      /* "opengl/modern/simple_image_shader_widget.pyx":263
 *             glDrawArrays(GL_TRIANGLES, 0, 3)
 * 
 *             for i, texture in enumerate(self.textures):             # <<<<<<<<<<<<<<
 *                 if texture:
 *                     glActiveTexture(GL_TEXTURE0 + i)
*/
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "opengl/modern/simple_image_shader_widget.pyx":267
 *                     glActiveTexture(GL_TEXTURE0 + i)
 *                     texture.unbind()
 *             glActiveTexture(GL_TEXTURE0)             # <<<<<<<<<<<<<<
 * 
 *         if self.report_time_callback:
*/
    glActiveTexture(GL_TEXTURE0);

    /* "opengl/modern/simple_image_shader_widget.pyx":250
 *         glDisable(GL_CULL_FACE)
 * 
 *         if self.image_shader.is_valid():             # <<<<<<<<<<<<<<
 *             for i, texture in enumerate(self.textures):
 *                 if texture:
*/
  }

  /* "opengl/modern/simple_image_shader_widget.pyx":269
 *             glActiveTexture(GL_TEXTURE0)
 * 
 *         if self.report_time_callback:             # <<<<<<<<<<<<<<
 *             glFinish()
 *             self.report_time_callback(time.time() - start_time)
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_report_time_callback); if (unlikely(!__pyx_t_1)) __PYX_ERR(32, 269, __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(32, 269, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "opengl/modern/simple_image_shader_widget.pyx":270
 * 
 *         if self.report_time_callback:
 *             glFinish()             # <<<<<<<<<<<<<<
 *             self.report_time_callback(time.time() - start_time)
 * 
*/
    glFinish();

    /* "opengl/modern/simple_image_shader_widget.pyx":271
 *         if self.report_time_callback:
 *             glFinish()
 *             self.report_time_callback(time.time() - start_time)             # <<<<<<<<<<<<<<
 * 
 *     def draw(self):
*/
    __pyx_t_5 = __pyx_v_self;
    __Pyx_INCREF(__pyx_t_5);
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_time); if (unlikely(!__pyx_t_12)) __PYX_ERR(32, 271, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_time); if (unlikely(!__pyx_t_13)) __PYX_ERR(32, 271, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_13))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_13);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_13);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_13, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_13, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(32, 271, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    if (unlikely(!__pyx_v_start_time)) { __Pyx_RaiseUnboundLocalError("start_time"); __PYX_ERR(32, 271, __pyx_L1_error) }
    __pyx_t_13 = PyNumber_Subtract(__pyx_t_4, __pyx_v_start_time); if (unlikely(!__pyx_t_13)) __PYX_ERR(32, 271, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_13};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_report_time_callback, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(32, 271, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "opengl/modern/simple_image_shader_widget.pyx":269
 *             glActiveTexture(GL_TEXTURE0)
 * 
 *         if self.report_time_callback:             # <<<<<<<<<<<<<<
 *             glFinish()
 *             self.report_time_callback(time.time() - start_time)
*/
  }

  /* "opengl/modern/simple_image_shader_widget.pyx":233
 *         return (depth, width, height)
 * 
 *     def draw_impl(self, width, height,             # <<<<<<<<<<<<<<
 *                   include_depth_value = False):
 * 
*/

  /* 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_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("CyOpenGL.SimpleImageShaderWidget.draw_impl", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_start_time);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_texture);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opengl/modern/simple_image_shader_widget.pyx":273
 *             self.report_time_callback(time.time() - start_time)
 * 
 *     def draw(self):             # <<<<<<<<<<<<<<
 *         width = self.winfo_width()
 *         height = self.winfo_height()
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_23SimpleImageShaderWidget_15draw(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_23SimpleImageShaderWidget_14draw, "SimpleImageShaderWidget.draw(self)");
static PyMethodDef __pyx_mdef_8CyOpenGL_23SimpleImageShaderWidget_15draw = {"draw", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_23SimpleImageShaderWidget_15draw, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_23SimpleImageShaderWidget_14draw};
static PyObject *__pyx_pw_8CyOpenGL_23SimpleImageShaderWidget_15draw(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("draw (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(32, 273, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(32, 273, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "draw", 0) < (0)) __PYX_ERR(32, 273, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("draw", 1, 1, 1, i); __PYX_ERR(32, 273, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(32, 273, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("draw", 1, 1, 1, __pyx_nargs); __PYX_ERR(32, 273, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("CyOpenGL.SimpleImageShaderWidget.draw", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_23SimpleImageShaderWidget_14draw(__pyx_self, __pyx_v_self);

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

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

  /* "opengl/modern/simple_image_shader_widget.pyx":274
 * 
 *     def draw(self):
 *         width = self.winfo_width()             # <<<<<<<<<<<<<<
 *         height = self.winfo_height()
 *         if width <= 1 or height <= 1:
*/
  __pyx_t_2 = __pyx_v_self;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_winfo_width, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(32, 274, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_width = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "opengl/modern/simple_image_shader_widget.pyx":275
 *     def draw(self):
 *         width = self.winfo_width()
 *         height = self.winfo_height()             # <<<<<<<<<<<<<<
 *         if width <= 1 or height <= 1:
 *             return
*/
  __pyx_t_2 = __pyx_v_self;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_winfo_height, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(32, 275, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_height = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "opengl/modern/simple_image_shader_widget.pyx":276
 *         width = self.winfo_width()
 *         height = self.winfo_height()
 *         if width <= 1 or height <= 1:             # <<<<<<<<<<<<<<
 *             return
 * 
*/
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_width, __pyx_mstate_global->__pyx_int_1, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(32, 276, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(32, 276, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (!__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_height, __pyx_mstate_global->__pyx_int_1, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(32, 276, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(32, 276, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = __pyx_t_5;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_4) {

    /* "opengl/modern/simple_image_shader_widget.pyx":277
 *         height = self.winfo_height()
 *         if width <= 1 or height <= 1:
 *             return             # <<<<<<<<<<<<<<
 * 
 *         self.make_current()
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "opengl/modern/simple_image_shader_widget.pyx":276
 *         width = self.winfo_width()
 *         height = self.winfo_height()
 *         if width <= 1 or height <= 1:             # <<<<<<<<<<<<<<
 *             return
 * 
*/
  }

  /* "opengl/modern/simple_image_shader_widget.pyx":279
 *             return
 * 
 *         self.make_current()             # <<<<<<<<<<<<<<
 *         self.draw_impl(width, height)
 *         self.swap_buffers()
*/
  __pyx_t_2 = __pyx_v_self;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_make_current, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(32, 279, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/modern/simple_image_shader_widget.pyx":280
 * 
 *         self.make_current()
 *         self.draw_impl(width, height)             # <<<<<<<<<<<<<<
 *         self.swap_buffers()
 * 
*/
  __pyx_t_2 = __pyx_v_self;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_width, __pyx_v_height};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_draw_impl, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(32, 280, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/modern/simple_image_shader_widget.pyx":281
 *         self.make_current()
 *         self.draw_impl(width, height)
 *         self.swap_buffers()             # <<<<<<<<<<<<<<
 * 
 *         if self.report_gl_errors:
*/
  __pyx_t_2 = __pyx_v_self;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_swap_buffers, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(32, 281, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/modern/simple_image_shader_widget.pyx":283
 *         self.swap_buffers()
 * 
 *         if self.report_gl_errors:             # <<<<<<<<<<<<<<
 *             print_gl_errors("draw")
 * 
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_report_gl_errors); if (unlikely(!__pyx_t_1)) __PYX_ERR(32, 283, __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(32, 283, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

    /* "opengl/modern/simple_image_shader_widget.pyx":284
 * 
 *         if self.report_gl_errors:
 *             print_gl_errors("draw")             # <<<<<<<<<<<<<<
 * 
 *     def get_uniform_bindings(self, view_width, view_height):
*/
    __pyx_t_2 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_print_gl_errors); if (unlikely(!__pyx_t_6)) __PYX_ERR(32, 284, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_3 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6);
      assert(__pyx_t_2);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
      __pyx_t_3 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_n_u_draw};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(32, 284, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "opengl/modern/simple_image_shader_widget.pyx":283
 *         self.swap_buffers()
 * 
 *         if self.report_gl_errors:             # <<<<<<<<<<<<<<
 *             print_gl_errors("draw")
 * 
*/
  }

  /* "opengl/modern/simple_image_shader_widget.pyx":273
 *             self.report_time_callback(time.time() - start_time)
 * 
 *     def draw(self):             # <<<<<<<<<<<<<<
 *         width = self.winfo_width()
 *         height = self.winfo_height()
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("CyOpenGL.SimpleImageShaderWidget.draw", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_width);
  __Pyx_XDECREF(__pyx_v_height);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opengl/modern/simple_image_shader_widget.pyx":286
 *             print_gl_errors("draw")
 * 
 *     def get_uniform_bindings(self, view_width, view_height):             # <<<<<<<<<<<<<<
 *         return {
 *             'viewportSize' : ('vec2', (view_width, view_height))
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_23SimpleImageShaderWidget_17get_uniform_bindings(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_23SimpleImageShaderWidget_16get_uniform_bindings, "SimpleImageShaderWidget.get_uniform_bindings(self, view_width, view_height)");
static PyMethodDef __pyx_mdef_8CyOpenGL_23SimpleImageShaderWidget_17get_uniform_bindings = {"get_uniform_bindings", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_23SimpleImageShaderWidget_17get_uniform_bindings, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_23SimpleImageShaderWidget_16get_uniform_bindings};
static PyObject *__pyx_pw_8CyOpenGL_23SimpleImageShaderWidget_17get_uniform_bindings(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_view_width = 0;
  PyObject *__pyx_v_view_height = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_uniform_bindings (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_view_width,&__pyx_mstate_global->__pyx_n_u_view_height,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(32, 286, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(32, 286, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(32, 286, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(32, 286, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "get_uniform_bindings", 0) < (0)) __PYX_ERR(32, 286, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("get_uniform_bindings", 1, 3, 3, i); __PYX_ERR(32, 286, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(32, 286, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(32, 286, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(32, 286, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
    __pyx_v_view_width = values[1];
    __pyx_v_view_height = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_uniform_bindings", 1, 3, 3, __pyx_nargs); __PYX_ERR(32, 286, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("CyOpenGL.SimpleImageShaderWidget.get_uniform_bindings", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_23SimpleImageShaderWidget_16get_uniform_bindings(__pyx_self, __pyx_v_self, __pyx_v_view_width, __pyx_v_view_height);

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

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

  /* "opengl/modern/simple_image_shader_widget.pyx":287
 * 
 *     def get_uniform_bindings(self, view_width, view_height):
 *         return {             # <<<<<<<<<<<<<<
 *             'viewportSize' : ('vec2', (view_width, view_height))
 *             }
*/
  __Pyx_XDECREF(__pyx_r);

  /* "opengl/modern/simple_image_shader_widget.pyx":288
 *     def get_uniform_bindings(self, view_width, view_height):
 *         return {
 *             'viewportSize' : ('vec2', (view_width, view_height))             # <<<<<<<<<<<<<<
 *             }
*/
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(32, 288, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(32, 288, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_view_width);
  __Pyx_GIVEREF(__pyx_v_view_width);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_view_width) != (0)) __PYX_ERR(32, 288, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_view_height);
  __Pyx_GIVEREF(__pyx_v_view_height);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_view_height) != (0)) __PYX_ERR(32, 288, __pyx_L1_error);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(32, 288, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_vec2);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_vec2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_mstate_global->__pyx_n_u_vec2) != (0)) __PYX_ERR(32, 288, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2) != (0)) __PYX_ERR(32, 288, __pyx_L1_error);
  __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_viewportSize, __pyx_t_3) < (0)) __PYX_ERR(32, 288, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "opengl/modern/simple_image_shader_widget.pyx":286
 *             print_gl_errors("draw")
 * 
 *     def get_uniform_bindings(self, view_width, view_height):             # <<<<<<<<<<<<<<
 *         return {
 *             'viewportSize' : ('vec2', (view_width, view_height))
*/

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

/* "opengl/modern/glsl_perspective_view.pyx":5
 * # 1-dimensional arrays in column-major order (M[i,j] = A[i + 4*j]).
 * 
 * cdef mat4_multiply(GLfloat *left, GLfloat *right, GLfloat *result):             # <<<<<<<<<<<<<<
 *     """
 *     Multiply two 4x4 matrices represented as 1-dimensional arrays in
*/

static PyObject *__pyx_f_8CyOpenGL_mat4_multiply(GLfloat *__pyx_v_left, GLfloat *__pyx_v_right, GLfloat *__pyx_v_result) {
  GLfloat __pyx_v_temp[16];
  GLfloat *__pyx_v_product;
  int __pyx_v_i;
  int __pyx_v_j;
  int __pyx_v_k;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  __Pyx_RefNannySetupContext("mat4_multiply", 0);

  /* "opengl/modern/glsl_perspective_view.pyx":12
 *     """
 *     cdef GLfloat temp[16]
 *     cdef GLfloat *product = result             # <<<<<<<<<<<<<<
 *     if result == right or result == left:
 *         product = temp
*/
  __pyx_v_product = __pyx_v_result;

  /* "opengl/modern/glsl_perspective_view.pyx":13
 *     cdef GLfloat temp[16]
 *     cdef GLfloat *product = result
 *     if result == right or result == left:             # <<<<<<<<<<<<<<
 *         product = temp
 *     cdef int i, j, k
*/
  __pyx_t_2 = (__pyx_v_result == __pyx_v_right);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_result == __pyx_v_left);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "opengl/modern/glsl_perspective_view.pyx":14
 *     cdef GLfloat *product = result
 *     if result == right or result == left:
 *         product = temp             # <<<<<<<<<<<<<<
 *     cdef int i, j, k
 *     for i in range(4):
*/
    __pyx_v_product = __pyx_v_temp;

    /* "opengl/modern/glsl_perspective_view.pyx":13
 *     cdef GLfloat temp[16]
 *     cdef GLfloat *product = result
 *     if result == right or result == left:             # <<<<<<<<<<<<<<
 *         product = temp
 *     cdef int i, j, k
*/
  }

  /* "opengl/modern/glsl_perspective_view.pyx":16
 *         product = temp
 *     cdef int i, j, k
 *     for i in range(4):             # <<<<<<<<<<<<<<
 *         for j in range(0, 16, 4):
 *             product[i + j] = 0
*/
  for (__pyx_t_3 = 0; __pyx_t_3 < 4; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "opengl/modern/glsl_perspective_view.pyx":17
 *     cdef int i, j, k
 *     for i in range(4):
 *         for j in range(0, 16, 4):             # <<<<<<<<<<<<<<
 *             product[i + j] = 0
 *             for k in range(4):
*/
    for (__pyx_t_4 = 0; __pyx_t_4 < 16; __pyx_t_4+=4) {
      __pyx_v_j = __pyx_t_4;

      /* "opengl/modern/glsl_perspective_view.pyx":18
 *     for i in range(4):
 *         for j in range(0, 16, 4):
 *             product[i + j] = 0             # <<<<<<<<<<<<<<
 *             for k in range(4):
 *                 product[i + j] += left[i + 4*k] * right[k + j]
*/
      (__pyx_v_product[(__pyx_v_i + __pyx_v_j)]) = 0.0;

      /* "opengl/modern/glsl_perspective_view.pyx":19
 *         for j in range(0, 16, 4):
 *             product[i + j] = 0
 *             for k in range(4):             # <<<<<<<<<<<<<<
 *                 product[i + j] += left[i + 4*k] * right[k + j]
 *     if product == temp:
*/
      for (__pyx_t_5 = 0; __pyx_t_5 < 4; __pyx_t_5+=1) {
        __pyx_v_k = __pyx_t_5;

        /* "opengl/modern/glsl_perspective_view.pyx":20
 *             product[i + j] = 0
 *             for k in range(4):
 *                 product[i + j] += left[i + 4*k] * right[k + j]             # <<<<<<<<<<<<<<
 *     if product == temp:
 *         for i in range(16):
*/
        __pyx_t_6 = (__pyx_v_i + __pyx_v_j);
        (__pyx_v_product[__pyx_t_6]) = ((__pyx_v_product[__pyx_t_6]) + ((__pyx_v_left[(__pyx_v_i + (4 * __pyx_v_k))]) * (__pyx_v_right[(__pyx_v_k + __pyx_v_j)])));
      }
    }
  }

  /* "opengl/modern/glsl_perspective_view.pyx":21
 *             for k in range(4):
 *                 product[i + j] += left[i + 4*k] * right[k + j]
 *     if product == temp:             # <<<<<<<<<<<<<<
 *         for i in range(16):
 *             result[i] = temp[i]
*/
  __pyx_t_1 = (__pyx_v_product == __pyx_v_temp);
  if (__pyx_t_1) {

    /* "opengl/modern/glsl_perspective_view.pyx":22
 *                 product[i + j] += left[i + 4*k] * right[k + j]
 *     if product == temp:
 *         for i in range(16):             # <<<<<<<<<<<<<<
 *             result[i] = temp[i]
 * 
*/
    for (__pyx_t_3 = 0; __pyx_t_3 < 16; __pyx_t_3+=1) {
      __pyx_v_i = __pyx_t_3;

      /* "opengl/modern/glsl_perspective_view.pyx":23
 *     if product == temp:
 *         for i in range(16):
 *             result[i] = temp[i]             # <<<<<<<<<<<<<<
 * 
 * cdef inline mat4_set_to_identity(GLfloat *matrix):
*/
      (__pyx_v_result[__pyx_v_i]) = (__pyx_v_temp[__pyx_v_i]);
    }

    /* "opengl/modern/glsl_perspective_view.pyx":21
 *             for k in range(4):
 *                 product[i + j] += left[i + 4*k] * right[k + j]
 *     if product == temp:             # <<<<<<<<<<<<<<
 *         for i in range(16):
 *             result[i] = temp[i]
*/
  }

  /* "opengl/modern/glsl_perspective_view.pyx":5
 * # 1-dimensional arrays in column-major order (M[i,j] = A[i + 4*j]).
 * 
 * cdef mat4_multiply(GLfloat *left, GLfloat *right, GLfloat *result):             # <<<<<<<<<<<<<<
 *     """
 *     Multiply two 4x4 matrices represented as 1-dimensional arrays in
*/

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

/* "opengl/modern/glsl_perspective_view.pyx":25
 *             result[i] = temp[i]
 * 
 * cdef inline mat4_set_to_identity(GLfloat *matrix):             # <<<<<<<<<<<<<<
 *     """
 *     Set a 4x4 matrix to the identity.
*/

static CYTHON_INLINE PyObject *__pyx_f_8CyOpenGL_mat4_set_to_identity(GLfloat *__pyx_v_matrix) {
  int __pyx_v_i;
  int __pyx_v_j;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  double __pyx_t_3;
  int __pyx_t_4;
  __Pyx_RefNannySetupContext("mat4_set_to_identity", 0);

  /* "opengl/modern/glsl_perspective_view.pyx":30
 *     """
 *     cdef int i, j
 *     for i in range(4):             # <<<<<<<<<<<<<<
 *         for j in range(4):
 *             matrix[i + 4*j] = 1.0 if i == j else 0.0
*/
  for (__pyx_t_1 = 0; __pyx_t_1 < 4; __pyx_t_1+=1) {
    __pyx_v_i = __pyx_t_1;

    /* "opengl/modern/glsl_perspective_view.pyx":31
 *     cdef int i, j
 *     for i in range(4):
 *         for j in range(4):             # <<<<<<<<<<<<<<
 *             matrix[i + 4*j] = 1.0 if i == j else 0.0
 * 
*/
    for (__pyx_t_2 = 0; __pyx_t_2 < 4; __pyx_t_2+=1) {
      __pyx_v_j = __pyx_t_2;

      /* "opengl/modern/glsl_perspective_view.pyx":32
 *     for i in range(4):
 *         for j in range(4):
 *             matrix[i + 4*j] = 1.0 if i == j else 0.0             # <<<<<<<<<<<<<<
 * 
 * cdef class GLSLPerspectiveView:
*/
      __pyx_t_4 = (__pyx_v_i == __pyx_v_j);
      if (__pyx_t_4) {
        __pyx_t_3 = 1.0;
      } else {
        __pyx_t_3 = 0.0;
      }
      (__pyx_v_matrix[(__pyx_v_i + (4 * __pyx_v_j))]) = __pyx_t_3;
    }
  }

  /* "opengl/modern/glsl_perspective_view.pyx":25
 *             result[i] = temp[i]
 * 
 * cdef inline mat4_set_to_identity(GLfloat *matrix):             # <<<<<<<<<<<<<<
 *     """
 *     Set a 4x4 matrix to the identity.
*/

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

/* "opengl/modern/glsl_perspective_view.pyx":55
 *     cdef GLfloat _center[3]
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self._vertical_fov = 30.0
 *         self._near = 1.0
*/

/* Python wrapper */
static int __pyx_pw_8CyOpenGL_19GLSLPerspectiveView_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_8CyOpenGL_19GLSLPerspectiveView_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return -1;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__cinit__", __pyx_kwds); return -1;}
  __pyx_r = __pyx_pf_8CyOpenGL_19GLSLPerspectiveView___cinit__(((struct __pyx_obj_8CyOpenGL_GLSLPerspectiveView *)__pyx_v_self));

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

static int __pyx_pf_8CyOpenGL_19GLSLPerspectiveView___cinit__(struct __pyx_obj_8CyOpenGL_GLSLPerspectiveView *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  GLfloat __pyx_t_1[3];
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "opengl/modern/glsl_perspective_view.pyx":56
 * 
 *     def __cinit__(self):
 *         self._vertical_fov = 30.0             # <<<<<<<<<<<<<<
 *         self._near = 1.0
 *         self._far = 100.0
*/
  __pyx_v_self->_vertical_fov = 30.0;

  /* "opengl/modern/glsl_perspective_view.pyx":57
 *     def __cinit__(self):
 *         self._vertical_fov = 30.0
 *         self._near = 1.0             # <<<<<<<<<<<<<<
 *         self._far = 100.0
 *         self._distance = 10.0
*/
  __pyx_v_self->_near = 1.0;

  /* "opengl/modern/glsl_perspective_view.pyx":58
 *         self._vertical_fov = 30.0
 *         self._near = 1.0
 *         self._far = 100.0             # <<<<<<<<<<<<<<
 *         self._distance = 10.0
 *         self._center = [0.0, 0.0, 0.0]
*/
  __pyx_v_self->_far = 100.0;

  /* "opengl/modern/glsl_perspective_view.pyx":59
 *         self._near = 1.0
 *         self._far = 100.0
 *         self._distance = 10.0             # <<<<<<<<<<<<<<
 *         self._center = [0.0, 0.0, 0.0]
 *         mat4_set_to_identity(self._rotation)
*/
  __pyx_v_self->_distance = 10.0;

  /* "opengl/modern/glsl_perspective_view.pyx":60
 *         self._far = 100.0
 *         self._distance = 10.0
 *         self._center = [0.0, 0.0, 0.0]             # <<<<<<<<<<<<<<
 *         mat4_set_to_identity(self._rotation)
 *         mat4_set_to_identity(self._model_view)
*/
  __pyx_t_1[0] = 0.0;
  __pyx_t_1[1] = 0.0;
  __pyx_t_1[2] = 0.0;
  memcpy(&(__pyx_v_self->_center[0]), __pyx_t_1, sizeof(__pyx_v_self->_center[0]) * (3));

  /* "opengl/modern/glsl_perspective_view.pyx":61
 *         self._distance = 10.0
 *         self._center = [0.0, 0.0, 0.0]
 *         mat4_set_to_identity(self._rotation)             # <<<<<<<<<<<<<<
 *         mat4_set_to_identity(self._model_view)
 *         mat4_set_to_identity(self._projection)
*/
  __pyx_t_2 = __pyx_f_8CyOpenGL_mat4_set_to_identity(__pyx_v_self->_rotation); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opengl/modern/glsl_perspective_view.pyx":62
 *         self._center = [0.0, 0.0, 0.0]
 *         mat4_set_to_identity(self._rotation)
 *         mat4_set_to_identity(self._model_view)             # <<<<<<<<<<<<<<
 *         mat4_set_to_identity(self._projection)
 * 
*/
  __pyx_t_2 = __pyx_f_8CyOpenGL_mat4_set_to_identity(__pyx_v_self->_model_view); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 62, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opengl/modern/glsl_perspective_view.pyx":63
 *         mat4_set_to_identity(self._rotation)
 *         mat4_set_to_identity(self._model_view)
 *         mat4_set_to_identity(self._projection)             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __pyx_t_2 = __pyx_f_8CyOpenGL_mat4_set_to_identity(__pyx_v_self->_projection); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opengl/modern/glsl_perspective_view.pyx":55
 *     cdef GLfloat _center[3]
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self._vertical_fov = 30.0
 *         self._near = 1.0
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("CyOpenGL.GLSLPerspectiveView.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opengl/modern/glsl_perspective_view.pyx":65
 *         mat4_set_to_identity(self._projection)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def vertical_fov(self):
 *         return self._vertical_fov
*/

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

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

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

  /* "opengl/modern/glsl_perspective_view.pyx":67
 *     @property
 *     def vertical_fov(self):
 *         return self._vertical_fov             # <<<<<<<<<<<<<<
 *     @vertical_fov.setter
 *     def vertical_fov(self, GLfloat value):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->_vertical_fov); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 67, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "opengl/modern/glsl_perspective_view.pyx":65
 *         mat4_set_to_identity(self._projection)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def vertical_fov(self):
 *         return self._vertical_fov
*/

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

/* "opengl/modern/glsl_perspective_view.pyx":68
 *     def vertical_fov(self):
 *         return self._vertical_fov
 *     @vertical_fov.setter             # <<<<<<<<<<<<<<
 *     def vertical_fov(self, GLfloat value):
 *         self._vertical_fov = value
*/

/* Python wrapper */
static int __pyx_pw_8CyOpenGL_19GLSLPerspectiveView_12vertical_fov_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value); /*proto*/
static int __pyx_pw_8CyOpenGL_19GLSLPerspectiveView_12vertical_fov_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value) {
  GLfloat __pyx_v_value;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  assert(__pyx_arg_value); {
    __pyx_v_value = __Pyx_PyFloat_AsFloat(__pyx_arg_value); if (unlikely((__pyx_v_value == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(33, 69, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("CyOpenGL.GLSLPerspectiveView.vertical_fov.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_19GLSLPerspectiveView_12vertical_fov_2__set__(((struct __pyx_obj_8CyOpenGL_GLSLPerspectiveView *)__pyx_v_self), ((GLfloat)__pyx_v_value));

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

static int __pyx_pf_8CyOpenGL_19GLSLPerspectiveView_12vertical_fov_2__set__(struct __pyx_obj_8CyOpenGL_GLSLPerspectiveView *__pyx_v_self, GLfloat __pyx_v_value) {
  int __pyx_r;

  /* "opengl/modern/glsl_perspective_view.pyx":70
 *     @vertical_fov.setter
 *     def vertical_fov(self, GLfloat value):
 *         self._vertical_fov = value             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __pyx_v_self->_vertical_fov = __pyx_v_value;

  /* "opengl/modern/glsl_perspective_view.pyx":68
 *     def vertical_fov(self):
 *         return self._vertical_fov
 *     @vertical_fov.setter             # <<<<<<<<<<<<<<
 *     def vertical_fov(self, GLfloat value):
 *         self._vertical_fov = value
*/

  /* function exit code */
  __pyx_r = 0;
  return __pyx_r;
}

/* "opengl/modern/glsl_perspective_view.pyx":72
 *         self._vertical_fov = value
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def near(self):
 *         return self._near
*/

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

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

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

  /* "opengl/modern/glsl_perspective_view.pyx":74
 *     @property
 *     def near(self):
 *         return self._near             # <<<<<<<<<<<<<<
 *     @near.setter
 *     def near(self, GLfloat value):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->_near); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 74, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "opengl/modern/glsl_perspective_view.pyx":72
 *         self._vertical_fov = value
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def near(self):
 *         return self._near
*/

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

/* "opengl/modern/glsl_perspective_view.pyx":75
 *     def near(self):
 *         return self._near
 *     @near.setter             # <<<<<<<<<<<<<<
 *     def near(self, GLfloat value):
 *         self._near = value
*/

/* Python wrapper */
static int __pyx_pw_8CyOpenGL_19GLSLPerspectiveView_4near_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value); /*proto*/
static int __pyx_pw_8CyOpenGL_19GLSLPerspectiveView_4near_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value) {
  GLfloat __pyx_v_value;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  assert(__pyx_arg_value); {
    __pyx_v_value = __Pyx_PyFloat_AsFloat(__pyx_arg_value); if (unlikely((__pyx_v_value == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(33, 76, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("CyOpenGL.GLSLPerspectiveView.near.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_19GLSLPerspectiveView_4near_2__set__(((struct __pyx_obj_8CyOpenGL_GLSLPerspectiveView *)__pyx_v_self), ((GLfloat)__pyx_v_value));

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

static int __pyx_pf_8CyOpenGL_19GLSLPerspectiveView_4near_2__set__(struct __pyx_obj_8CyOpenGL_GLSLPerspectiveView *__pyx_v_self, GLfloat __pyx_v_value) {
  int __pyx_r;

  /* "opengl/modern/glsl_perspective_view.pyx":77
 *     @near.setter
 *     def near(self, GLfloat value):
 *         self._near = value             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __pyx_v_self->_near = __pyx_v_value;

  /* "opengl/modern/glsl_perspective_view.pyx":75
 *     def near(self):
 *         return self._near
 *     @near.setter             # <<<<<<<<<<<<<<
 *     def near(self, GLfloat value):
 *         self._near = value
*/

  /* function exit code */
  __pyx_r = 0;
  return __pyx_r;
}

/* "opengl/modern/glsl_perspective_view.pyx":79
 *         self._near = value
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def far(self):
 *         return self._far
*/

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

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

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

  /* "opengl/modern/glsl_perspective_view.pyx":81
 *     @property
 *     def far(self):
 *         return self._far             # <<<<<<<<<<<<<<
 *     @far.setter
 *     def far(self, GLfloat value):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->_far); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 81, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "opengl/modern/glsl_perspective_view.pyx":79
 *         self._near = value
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def far(self):
 *         return self._far
*/

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

/* "opengl/modern/glsl_perspective_view.pyx":82
 *     def far(self):
 *         return self._far
 *     @far.setter             # <<<<<<<<<<<<<<
 *     def far(self, GLfloat value):
 *         self._far = value
*/

/* Python wrapper */
static int __pyx_pw_8CyOpenGL_19GLSLPerspectiveView_3far_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value); /*proto*/
static int __pyx_pw_8CyOpenGL_19GLSLPerspectiveView_3far_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value) {
  GLfloat __pyx_v_value;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  assert(__pyx_arg_value); {
    __pyx_v_value = __Pyx_PyFloat_AsFloat(__pyx_arg_value); if (unlikely((__pyx_v_value == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(33, 83, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("CyOpenGL.GLSLPerspectiveView.far.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_19GLSLPerspectiveView_3far_2__set__(((struct __pyx_obj_8CyOpenGL_GLSLPerspectiveView *)__pyx_v_self), ((GLfloat)__pyx_v_value));

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

static int __pyx_pf_8CyOpenGL_19GLSLPerspectiveView_3far_2__set__(struct __pyx_obj_8CyOpenGL_GLSLPerspectiveView *__pyx_v_self, GLfloat __pyx_v_value) {
  int __pyx_r;

  /* "opengl/modern/glsl_perspective_view.pyx":84
 *     @far.setter
 *     def far(self, GLfloat value):
 *         self._far = value             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __pyx_v_self->_far = __pyx_v_value;

  /* "opengl/modern/glsl_perspective_view.pyx":82
 *     def far(self):
 *         return self._far
 *     @far.setter             # <<<<<<<<<<<<<<
 *     def far(self, GLfloat value):
 *         self._far = value
*/

  /* function exit code */
  __pyx_r = 0;
  return __pyx_r;
}

/* "opengl/modern/glsl_perspective_view.pyx":86
 *         self._far = value
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def distance(self):
 *         return self._distance
*/

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

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

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

  /* "opengl/modern/glsl_perspective_view.pyx":88
 *     @property
 *     def distance(self):
 *         return self._distance             # <<<<<<<<<<<<<<
 *     @distance.setter
 *     def distance(self, GLfloat value):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->_distance); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 88, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "opengl/modern/glsl_perspective_view.pyx":86
 *         self._far = value
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def distance(self):
 *         return self._distance
*/

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

/* "opengl/modern/glsl_perspective_view.pyx":89
 *     def distance(self):
 *         return self._distance
 *     @distance.setter             # <<<<<<<<<<<<<<
 *     def distance(self, GLfloat value):
 *         self._distance = value
*/

/* Python wrapper */
static int __pyx_pw_8CyOpenGL_19GLSLPerspectiveView_8distance_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value); /*proto*/
static int __pyx_pw_8CyOpenGL_19GLSLPerspectiveView_8distance_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value) {
  GLfloat __pyx_v_value;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  assert(__pyx_arg_value); {
    __pyx_v_value = __Pyx_PyFloat_AsFloat(__pyx_arg_value); if (unlikely((__pyx_v_value == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(33, 90, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("CyOpenGL.GLSLPerspectiveView.distance.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_19GLSLPerspectiveView_8distance_2__set__(((struct __pyx_obj_8CyOpenGL_GLSLPerspectiveView *)__pyx_v_self), ((GLfloat)__pyx_v_value));

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

static int __pyx_pf_8CyOpenGL_19GLSLPerspectiveView_8distance_2__set__(struct __pyx_obj_8CyOpenGL_GLSLPerspectiveView *__pyx_v_self, GLfloat __pyx_v_value) {
  int __pyx_r;

  /* "opengl/modern/glsl_perspective_view.pyx":91
 *     @distance.setter
 *     def distance(self, GLfloat value):
 *         self._distance = value             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __pyx_v_self->_distance = __pyx_v_value;

  /* "opengl/modern/glsl_perspective_view.pyx":89
 *     def distance(self):
 *         return self._distance
 *     @distance.setter             # <<<<<<<<<<<<<<
 *     def distance(self, GLfloat value):
 *         self._distance = value
*/

  /* function exit code */
  __pyx_r = 0;
  return __pyx_r;
}

/* "opengl/modern/glsl_perspective_view.pyx":93
 *         self._distance = value
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def center(self):
 *         cdef int i
*/

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

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

static PyObject *__pyx_pf_8CyOpenGL_19GLSLPerspectiveView_6center___get__(struct __pyx_obj_8CyOpenGL_GLSLPerspectiveView *__pyx_v_self) {
  int __pyx_9genexpr15__pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "opengl/modern/glsl_perspective_view.pyx":96
 *     def center(self):
 *         cdef int i
 *         return [self._center[i] for i in range(3)]             # <<<<<<<<<<<<<<
 *     @center.setter
 *     def center(self, vector):
*/
  __Pyx_XDECREF(__pyx_r);
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 96, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    for (__pyx_t_2 = 0; __pyx_t_2 < 3; __pyx_t_2+=1) {
      __pyx_9genexpr15__pyx_v_i = __pyx_t_2;
      __pyx_t_3 = PyFloat_FromDouble((__pyx_v_self->_center[__pyx_9genexpr15__pyx_v_i])); if (unlikely(!__pyx_t_3)) __PYX_ERR(33, 96, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) __PYX_ERR(33, 96, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
  } /* exit inner scope */
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "opengl/modern/glsl_perspective_view.pyx":93
 *         self._distance = value
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def center(self):
 *         cdef int i
*/

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

/* "opengl/modern/glsl_perspective_view.pyx":97
 *         cdef int i
 *         return [self._center[i] for i in range(3)]
 *     @center.setter             # <<<<<<<<<<<<<<
 *     def center(self, vector):
 *         cdef int i
*/

/* Python wrapper */
static int __pyx_pw_8CyOpenGL_19GLSLPerspectiveView_6center_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_vector); /*proto*/
static int __pyx_pw_8CyOpenGL_19GLSLPerspectiveView_6center_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_vector) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_8CyOpenGL_19GLSLPerspectiveView_6center_2__set__(((struct __pyx_obj_8CyOpenGL_GLSLPerspectiveView *)__pyx_v_self), ((PyObject *)__pyx_v_vector));

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

static int __pyx_pf_8CyOpenGL_19GLSLPerspectiveView_6center_2__set__(struct __pyx_obj_8CyOpenGL_GLSLPerspectiveView *__pyx_v_self, PyObject *__pyx_v_vector) {
  int __pyx_v_i;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  GLfloat __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "opengl/modern/glsl_perspective_view.pyx":100
 *     def center(self, vector):
 *         cdef int i
 *         for i in range(3):             # <<<<<<<<<<<<<<
 *             self._center[i] = vector[i]
 * 
*/
  for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) {
    __pyx_v_i = __pyx_t_1;

    /* "opengl/modern/glsl_perspective_view.pyx":101
 *         cdef int i
 *         for i in range(3):
 *             self._center[i] = vector[i]             # <<<<<<<<<<<<<<
 * 
 *     cdef compute_mvp(self, width, height):
*/
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_vector, __pyx_v_i, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 101, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_3 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(33, 101, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    (__pyx_v_self->_center[__pyx_v_i]) = __pyx_t_3;
  }

  /* "opengl/modern/glsl_perspective_view.pyx":97
 *         cdef int i
 *         return [self._center[i] for i in range(3)]
 *     @center.setter             # <<<<<<<<<<<<<<
 *     def center(self, vector):
 *         cdef int i
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("CyOpenGL.GLSLPerspectiveView.center.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opengl/modern/glsl_perspective_view.pyx":103
 *             self._center[i] = vector[i]
 * 
 *     cdef compute_mvp(self, width, height):             # <<<<<<<<<<<<<<
 *         """
 *         First compute the so-called projection matrix, which is actually
*/

static PyObject *__pyx_f_8CyOpenGL_19GLSLPerspectiveView_compute_mvp(struct __pyx_obj_8CyOpenGL_GLSLPerspectiveView *__pyx_v_self, PyObject *__pyx_v_width, PyObject *__pyx_v_height) {
  GLfloat __pyx_v_ymax;
  GLfloat __pyx_v_aspect;
  GLfloat __pyx_v_xmax;
  GLfloat __pyx_v_n;
  GLfloat __pyx_v_f;
  GLfloat *__pyx_v_M;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  size_t __pyx_t_8;
  GLfloat __pyx_t_9;
  double __pyx_t_10;
  double __pyx_t_11;
  GLfloat *__pyx_t_12;
  GLfloat __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("compute_mvp", 0);

  /* "opengl/modern/glsl_perspective_view.pyx":138
 *         on the negative z-axis) and the rotation matrix.
 *         """
 *         cdef GLfloat ymax = self._near * tan(self._vertical_fov *pi/360.0)             # <<<<<<<<<<<<<<
 *         cdef GLfloat aspect = float(width)/float(height)
 *         cdef GLfloat xmax = ymax * aspect
*/
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->_near); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_tan); if (unlikely(!__pyx_t_4)) __PYX_ERR(33, 138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyFloat_FromDouble(__pyx_v_self->_vertical_fov); if (unlikely(!__pyx_t_5)) __PYX_ERR(33, 138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_pi); if (unlikely(!__pyx_t_6)) __PYX_ERR(33, 138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = PyNumber_Multiply(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(33, 138, __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 = __Pyx_PyFloat_TrueDivideObjC(__pyx_t_7, __pyx_mstate_global->__pyx_float_360_0, 360.0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(33, 138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_8 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_8 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_6};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 138, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_t_4 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(33, 138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_9 = __Pyx_PyFloat_AsFloat(__pyx_t_4); if (unlikely((__pyx_t_9 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(33, 138, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_ymax = __pyx_t_9;

  /* "opengl/modern/glsl_perspective_view.pyx":139
 *         """
 *         cdef GLfloat ymax = self._near * tan(self._vertical_fov *pi/360.0)
 *         cdef GLfloat aspect = float(width)/float(height)             # <<<<<<<<<<<<<<
 *         cdef GLfloat xmax = ymax * aspect
 *         cdef GLfloat n = self._near, f = self._far
*/
  __pyx_t_10 = __Pyx_PyObject_AsDouble(__pyx_v_width); if (unlikely(__PYX_CHECK_FLOAT_EXCEPTION(__pyx_t_10, ((double)((double)-1))) && PyErr_Occurred())) __PYX_ERR(33, 139, __pyx_L1_error)
  __pyx_t_11 = __Pyx_PyObject_AsDouble(__pyx_v_height); if (unlikely(__PYX_CHECK_FLOAT_EXCEPTION(__pyx_t_11, ((double)((double)-1))) && PyErr_Occurred())) __PYX_ERR(33, 139, __pyx_L1_error)
  if (unlikely(__pyx_t_11 == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "float division");
    __PYX_ERR(33, 139, __pyx_L1_error)
  }
  __pyx_v_aspect = (__pyx_t_10 / __pyx_t_11);

  /* "opengl/modern/glsl_perspective_view.pyx":140
 *         cdef GLfloat ymax = self._near * tan(self._vertical_fov *pi/360.0)
 *         cdef GLfloat aspect = float(width)/float(height)
 *         cdef GLfloat xmax = ymax * aspect             # <<<<<<<<<<<<<<
 *         cdef GLfloat n = self._near, f = self._far
 *         cdef GLfloat *M = self._projection
*/
  __pyx_v_xmax = (__pyx_v_ymax * __pyx_v_aspect);

  /* "opengl/modern/glsl_perspective_view.pyx":141
 *         cdef GLfloat aspect = float(width)/float(height)
 *         cdef GLfloat xmax = ymax * aspect
 *         cdef GLfloat n = self._near, f = self._far             # <<<<<<<<<<<<<<
 *         cdef GLfloat *M = self._projection
 *         # Fill in the entries of the "projection" in column-major order.
*/
  __pyx_t_9 = __pyx_v_self->_near;
  __pyx_v_n = __pyx_t_9;
  __pyx_t_9 = __pyx_v_self->_far;
  __pyx_v_f = __pyx_t_9;

  /* "opengl/modern/glsl_perspective_view.pyx":142
 *         cdef GLfloat xmax = ymax * aspect
 *         cdef GLfloat n = self._near, f = self._far
 *         cdef GLfloat *M = self._projection             # <<<<<<<<<<<<<<
 *         # Fill in the entries of the "projection" in column-major order.
 *         M[0] = n/xmax; M[1] = M[2] = M[3] = 0.0
*/
  __pyx_t_12 = __pyx_v_self->_projection;
  __pyx_v_M = __pyx_t_12;

  /* "opengl/modern/glsl_perspective_view.pyx":144
 *         cdef GLfloat *M = self._projection
 *         # Fill in the entries of the "projection" in column-major order.
 *         M[0] = n/xmax; M[1] = M[2] = M[3] = 0.0             # <<<<<<<<<<<<<<
 *         M[4] = 0; M[5] = n/ymax; M[6] = M[7] = 0.0
 *         M[8] = M[9] = 0.0; M[10] = -(f + n)/(f - n); M[11] = -1.0
*/
  if (unlikely(__pyx_v_xmax == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "float division");
    __PYX_ERR(33, 144, __pyx_L1_error)
  }
  (__pyx_v_M[0]) = (__pyx_v_n / __pyx_v_xmax);
  (__pyx_v_M[1]) = 0.0;
  (__pyx_v_M[2]) = 0.0;
  (__pyx_v_M[3]) = 0.0;

  /* "opengl/modern/glsl_perspective_view.pyx":145
 *         # Fill in the entries of the "projection" in column-major order.
 *         M[0] = n/xmax; M[1] = M[2] = M[3] = 0.0
 *         M[4] = 0; M[5] = n/ymax; M[6] = M[7] = 0.0             # <<<<<<<<<<<<<<
 *         M[8] = M[9] = 0.0; M[10] = -(f + n)/(f - n); M[11] = -1.0
 *         M[12] = M[13] = 0.0; M[14] = -2.0*n*f/(f - n); M[15] = 0.0
*/
  (__pyx_v_M[4]) = 0.0;
  if (unlikely(__pyx_v_ymax == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "float division");
    __PYX_ERR(33, 145, __pyx_L1_error)
  }
  (__pyx_v_M[5]) = (__pyx_v_n / __pyx_v_ymax);
  (__pyx_v_M[6]) = 0.0;
  (__pyx_v_M[7]) = 0.0;

  /* "opengl/modern/glsl_perspective_view.pyx":146
 *         M[0] = n/xmax; M[1] = M[2] = M[3] = 0.0
 *         M[4] = 0; M[5] = n/ymax; M[6] = M[7] = 0.0
 *         M[8] = M[9] = 0.0; M[10] = -(f + n)/(f - n); M[11] = -1.0             # <<<<<<<<<<<<<<
 *         M[12] = M[13] = 0.0; M[14] = -2.0*n*f/(f - n); M[15] = 0.0
 *         # Construct the model view matrix.
*/
  (__pyx_v_M[8]) = 0.0;
  (__pyx_v_M[9]) = 0.0;
  __pyx_t_9 = (-(__pyx_v_f + __pyx_v_n));
  __pyx_t_13 = (__pyx_v_f - __pyx_v_n);
  if (unlikely(__pyx_t_13 == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "float division");
    __PYX_ERR(33, 146, __pyx_L1_error)
  }
  (__pyx_v_M[10]) = (__pyx_t_9 / __pyx_t_13);
  (__pyx_v_M[11]) = -1.0;

  /* "opengl/modern/glsl_perspective_view.pyx":147
 *         M[4] = 0; M[5] = n/ymax; M[6] = M[7] = 0.0
 *         M[8] = M[9] = 0.0; M[10] = -(f + n)/(f - n); M[11] = -1.0
 *         M[12] = M[13] = 0.0; M[14] = -2.0*n*f/(f - n); M[15] = 0.0             # <<<<<<<<<<<<<<
 *         # Construct the model view matrix.
 *         mat4_set_to_identity(self._model_view)
*/
  (__pyx_v_M[12]) = 0.0;
  (__pyx_v_M[13]) = 0.0;
  __pyx_t_11 = ((-2.0 * __pyx_v_n) * __pyx_v_f);
  __pyx_t_13 = (__pyx_v_f - __pyx_v_n);
  if (unlikely(__pyx_t_13 == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "float division");
    __PYX_ERR(33, 147, __pyx_L1_error)
  }
  (__pyx_v_M[14]) = (__pyx_t_11 / ((double)__pyx_t_13));
  (__pyx_v_M[15]) = 0.0;

  /* "opengl/modern/glsl_perspective_view.pyx":149
 *         M[12] = M[13] = 0.0; M[14] = -2.0*n*f/(f - n); M[15] = 0.0
 *         # Construct the model view matrix.
 *         mat4_set_to_identity(self._model_view)             # <<<<<<<<<<<<<<
 *         self.translate(-self._center[0], -self._center[1], -self._center[2])
 *         mat4_multiply(self._rotation, self._model_view, self._model_view)
*/
  __pyx_t_4 = __pyx_f_8CyOpenGL_mat4_set_to_identity(__pyx_v_self->_model_view); if (unlikely(!__pyx_t_4)) __PYX_ERR(33, 149, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opengl/modern/glsl_perspective_view.pyx":150
 *         # Construct the model view matrix.
 *         mat4_set_to_identity(self._model_view)
 *         self.translate(-self._center[0], -self._center[1], -self._center[2])             # <<<<<<<<<<<<<<
 *         mat4_multiply(self._rotation, self._model_view, self._model_view)
 *         self.translate(0, 0, -self._distance)
*/
  __pyx_t_4 = ((struct __pyx_vtabstruct_8CyOpenGL_GLSLPerspectiveView *)__pyx_v_self->__pyx_vtab)->translate(__pyx_v_self, (-(__pyx_v_self->_center[0])), (-(__pyx_v_self->_center[1])), (-(__pyx_v_self->_center[2])), 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(33, 150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opengl/modern/glsl_perspective_view.pyx":151
 *         mat4_set_to_identity(self._model_view)
 *         self.translate(-self._center[0], -self._center[1], -self._center[2])
 *         mat4_multiply(self._rotation, self._model_view, self._model_view)             # <<<<<<<<<<<<<<
 *         self.translate(0, 0, -self._distance)
 *         # Construct the MVP matrix.
*/
  __pyx_t_4 = __pyx_f_8CyOpenGL_mat4_multiply(__pyx_v_self->_rotation, __pyx_v_self->_model_view, __pyx_v_self->_model_view); if (unlikely(!__pyx_t_4)) __PYX_ERR(33, 151, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opengl/modern/glsl_perspective_view.pyx":152
 *         self.translate(-self._center[0], -self._center[1], -self._center[2])
 *         mat4_multiply(self._rotation, self._model_view, self._model_view)
 *         self.translate(0, 0, -self._distance)             # <<<<<<<<<<<<<<
 *         # Construct the MVP matrix.
 *         mat4_multiply(self._projection, self._model_view, self._mvp)
*/
  __pyx_t_4 = ((struct __pyx_vtabstruct_8CyOpenGL_GLSLPerspectiveView *)__pyx_v_self->__pyx_vtab)->translate(__pyx_v_self, 0.0, 0.0, (-__pyx_v_self->_distance), 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(33, 152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opengl/modern/glsl_perspective_view.pyx":154
 *         self.translate(0, 0, -self._distance)
 *         # Construct the MVP matrix.
 *         mat4_multiply(self._projection, self._model_view, self._mvp)             # <<<<<<<<<<<<<<
 * 
 *     cpdef translate(self, GLfloat x, GLfloat y, GLfloat z):
*/
  __pyx_t_4 = __pyx_f_8CyOpenGL_mat4_multiply(__pyx_v_self->_projection, __pyx_v_self->_model_view, __pyx_v_self->_mvp); if (unlikely(!__pyx_t_4)) __PYX_ERR(33, 154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opengl/modern/glsl_perspective_view.pyx":103
 *             self._center[i] = vector[i]
 * 
 *     cdef compute_mvp(self, width, height):             # <<<<<<<<<<<<<<
 *         """
 *         First compute the so-called projection matrix, which is actually
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("CyOpenGL.GLSLPerspectiveView.compute_mvp", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opengl/modern/glsl_perspective_view.pyx":156
 *         mat4_multiply(self._projection, self._model_view, self._mvp)
 * 
 *     cpdef translate(self, GLfloat x, GLfloat y, GLfloat z):             # <<<<<<<<<<<<<<
 *         """
 *         Multiply the model view matrix by a translation matrix, without
*/

static PyObject *__pyx_pw_8CyOpenGL_19GLSLPerspectiveView_3translate(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_f_8CyOpenGL_19GLSLPerspectiveView_translate(struct __pyx_obj_8CyOpenGL_GLSLPerspectiveView *__pyx_v_self, GLfloat __pyx_v_x, GLfloat __pyx_v_y, GLfloat __pyx_v_z, int __pyx_skip_dispatch) {
  int __pyx_v_i;
  GLfloat __pyx_v_a;
  GLfloat *__pyx_v_M;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  size_t __pyx_t_8;
  GLfloat *__pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  long __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("translate", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_8CyOpenGL_GLSLPerspectiveView &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_translate); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 156, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_8CyOpenGL_19GLSLPerspectiveView_3translate)) {
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = PyFloat_FromDouble(__pyx_v_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(33, 156, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_6 = PyFloat_FromDouble(__pyx_v_y); if (unlikely(!__pyx_t_6)) __PYX_ERR(33, 156, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_7 = PyFloat_FromDouble(__pyx_v_z); if (unlikely(!__pyx_t_7)) __PYX_ERR(33, 156, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_8 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_8 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_t_5, __pyx_t_6, __pyx_t_7};
          __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_8, (4-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 156, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __pyx_r = __pyx_t_2;
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "opengl/modern/glsl_perspective_view.pyx":163
 *         cdef int i
 *         cdef GLfloat a
 *         cdef GLfloat *M = self._model_view             # <<<<<<<<<<<<<<
 *         for i in range(0,16,4):
 *             a = M[i+3]
*/
  __pyx_t_9 = __pyx_v_self->_model_view;
  __pyx_v_M = __pyx_t_9;

  /* "opengl/modern/glsl_perspective_view.pyx":164
 *         cdef GLfloat a
 *         cdef GLfloat *M = self._model_view
 *         for i in range(0,16,4):             # <<<<<<<<<<<<<<
 *             a = M[i+3]
 *             M[i] += x*a
*/
  for (__pyx_t_10 = 0; __pyx_t_10 < 16; __pyx_t_10+=4) {
    __pyx_v_i = __pyx_t_10;

    /* "opengl/modern/glsl_perspective_view.pyx":165
 *         cdef GLfloat *M = self._model_view
 *         for i in range(0,16,4):
 *             a = M[i+3]             # <<<<<<<<<<<<<<
 *             M[i] += x*a
 *             M[i+1] += y*a
*/
    __pyx_v_a = (__pyx_v_M[(__pyx_v_i + 3)]);

    /* "opengl/modern/glsl_perspective_view.pyx":166
 *         for i in range(0,16,4):
 *             a = M[i+3]
 *             M[i] += x*a             # <<<<<<<<<<<<<<
 *             M[i+1] += y*a
 *             M[i+2] += z*a
*/
    __pyx_t_11 = __pyx_v_i;
    (__pyx_v_M[__pyx_t_11]) = ((__pyx_v_M[__pyx_t_11]) + (__pyx_v_x * __pyx_v_a));

    /* "opengl/modern/glsl_perspective_view.pyx":167
 *             a = M[i+3]
 *             M[i] += x*a
 *             M[i+1] += y*a             # <<<<<<<<<<<<<<
 *             M[i+2] += z*a
 * 
*/
    __pyx_t_12 = (__pyx_v_i + 1);
    (__pyx_v_M[__pyx_t_12]) = ((__pyx_v_M[__pyx_t_12]) + (__pyx_v_y * __pyx_v_a));

    /* "opengl/modern/glsl_perspective_view.pyx":168
 *             M[i] += x*a
 *             M[i+1] += y*a
 *             M[i+2] += z*a             # <<<<<<<<<<<<<<
 * 
 *     cpdef rotate(self, GLfloat theta, GLfloat x, GLfloat y, GLfloat z):
*/
    __pyx_t_12 = (__pyx_v_i + 2);
    (__pyx_v_M[__pyx_t_12]) = ((__pyx_v_M[__pyx_t_12]) + (__pyx_v_z * __pyx_v_a));
  }

  /* "opengl/modern/glsl_perspective_view.pyx":156
 *         mat4_multiply(self._projection, self._model_view, self._mvp)
 * 
 *     cpdef translate(self, GLfloat x, GLfloat y, GLfloat z):             # <<<<<<<<<<<<<<
 *         """
 *         Multiply the model view matrix by a translation matrix, without
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("CyOpenGL.GLSLPerspectiveView.translate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_19GLSLPerspectiveView_3translate(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_19GLSLPerspectiveView_2translate, "GLSLPerspectiveView.translate(self, GLfloat x, GLfloat y, GLfloat z)\n\nMultiply the model view matrix by a translation matrix, without\ndoing unnecessary arithmetic.");
static PyMethodDef __pyx_mdef_8CyOpenGL_19GLSLPerspectiveView_3translate = {"translate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_19GLSLPerspectiveView_3translate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_19GLSLPerspectiveView_2translate};
static PyObject *__pyx_pw_8CyOpenGL_19GLSLPerspectiveView_3translate(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  GLfloat __pyx_v_x;
  GLfloat __pyx_v_y;
  GLfloat __pyx_v_z;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("translate (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_y,&__pyx_mstate_global->__pyx_n_u_z,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(33, 156, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(33, 156, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(33, 156, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(33, 156, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "translate", 0) < (0)) __PYX_ERR(33, 156, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("translate", 1, 3, 3, i); __PYX_ERR(33, 156, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(33, 156, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(33, 156, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(33, 156, __pyx_L3_error)
    }
    __pyx_v_x = __Pyx_PyFloat_AsFloat(values[0]); if (unlikely((__pyx_v_x == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(33, 156, __pyx_L3_error)
    __pyx_v_y = __Pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_y == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(33, 156, __pyx_L3_error)
    __pyx_v_z = __Pyx_PyFloat_AsFloat(values[2]); if (unlikely((__pyx_v_z == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(33, 156, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("translate", 1, 3, 3, __pyx_nargs); __PYX_ERR(33, 156, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("CyOpenGL.GLSLPerspectiveView.translate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_19GLSLPerspectiveView_2translate(((struct __pyx_obj_8CyOpenGL_GLSLPerspectiveView *)__pyx_v_self), __pyx_v_x, __pyx_v_y, __pyx_v_z);

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

static PyObject *__pyx_pf_8CyOpenGL_19GLSLPerspectiveView_2translate(struct __pyx_obj_8CyOpenGL_GLSLPerspectiveView *__pyx_v_self, GLfloat __pyx_v_x, GLfloat __pyx_v_y, GLfloat __pyx_v_z) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("translate", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8CyOpenGL_19GLSLPerspectiveView_translate(__pyx_v_self, __pyx_v_x, __pyx_v_y, __pyx_v_z, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 156, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "opengl/modern/glsl_perspective_view.pyx":170
 *             M[i+2] += z*a
 * 
 *     cpdef rotate(self, GLfloat theta, GLfloat x, GLfloat y, GLfloat z):             # <<<<<<<<<<<<<<
 *         """
 *         Update self._rotation by multiplying by a rotation matrix with
*/

static PyObject *__pyx_pw_8CyOpenGL_19GLSLPerspectiveView_5rotate(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_f_8CyOpenGL_19GLSLPerspectiveView_rotate(struct __pyx_obj_8CyOpenGL_GLSLPerspectiveView *__pyx_v_self, GLfloat __pyx_v_theta, GLfloat __pyx_v_x, GLfloat __pyx_v_y, GLfloat __pyx_v_z, int __pyx_skip_dispatch) {
  GLfloat __pyx_v_c;
  GLfloat __pyx_v_s;
  GLfloat __pyx_v_h;
  GLfloat __pyx_v_xs;
  GLfloat __pyx_v_ys;
  GLfloat __pyx_v_zs;
  GLfloat __pyx_v_xx;
  GLfloat __pyx_v_xh;
  GLfloat __pyx_v_xxh;
  GLfloat __pyx_v_xyh;
  GLfloat __pyx_v_xzh;
  GLfloat __pyx_v_yy;
  GLfloat __pyx_v_yh;
  GLfloat __pyx_v_yyh;
  GLfloat __pyx_v_yzh;
  GLfloat __pyx_v_zzh;
  GLfloat __pyx_v_rot[16];
  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;
  size_t __pyx_t_9;
  GLfloat __pyx_t_10;
  GLfloat *__pyx_t_11;
  GLfloat __pyx_t_12;
  GLfloat __pyx_t_13;
  GLfloat __pyx_t_14;
  GLfloat __pyx_t_15;
  GLfloat __pyx_t_16;
  GLfloat __pyx_t_17;
  GLfloat __pyx_t_18;
  GLfloat __pyx_t_19;
  GLfloat __pyx_t_20;
  GLfloat __pyx_t_21;
  GLfloat __pyx_t_22;
  GLfloat __pyx_t_23;
  GLfloat __pyx_t_24;
  GLfloat __pyx_t_25;
  double __pyx_t_26;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("rotate", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_8CyOpenGL_GLSLPerspectiveView &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_rotate); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 170, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_8CyOpenGL_19GLSLPerspectiveView_5rotate)) {
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = PyFloat_FromDouble(__pyx_v_theta); if (unlikely(!__pyx_t_5)) __PYX_ERR(33, 170, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_6 = PyFloat_FromDouble(__pyx_v_x); if (unlikely(!__pyx_t_6)) __PYX_ERR(33, 170, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_7 = PyFloat_FromDouble(__pyx_v_y); if (unlikely(!__pyx_t_7)) __PYX_ERR(33, 170, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_8 = PyFloat_FromDouble(__pyx_v_z); if (unlikely(!__pyx_t_8)) __PYX_ERR(33, 170, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_9 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_9 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[5] = {__pyx_t_3, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_t_8};
          __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_9, (5-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 170, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __pyx_r = __pyx_t_2;
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "opengl/modern/glsl_perspective_view.pyx":177
 *         """
 *         # 1 - cos(theta) = 2*haversine(theta)
 *         cdef GLfloat c = cos(theta), s = sin(theta), h = 1 - c             # <<<<<<<<<<<<<<
 *         cdef GLfloat xs = x*s, ys = y*s, zs = z*s
 *         cdef GLfloat xx = x*x, xh = x*h, xxh = xx*h, xyh = y*xh, xzh = z*xh
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_cos); if (unlikely(!__pyx_t_4)) __PYX_ERR(33, 177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_8 = PyFloat_FromDouble(__pyx_v_theta); if (unlikely(!__pyx_t_8)) __PYX_ERR(33, 177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_9 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_8};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 177, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_10 = __Pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_10 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(33, 177, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_c = __pyx_t_10;
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_sin); if (unlikely(!__pyx_t_8)) __PYX_ERR(33, 177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_theta); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_9 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_8))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_8);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_8, __pyx__function);
    __pyx_t_9 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 177, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_10 = __Pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_10 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(33, 177, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_s = __pyx_t_10;
  __pyx_v_h = (1.0 - __pyx_v_c);

  /* "opengl/modern/glsl_perspective_view.pyx":178
 *         # 1 - cos(theta) = 2*haversine(theta)
 *         cdef GLfloat c = cos(theta), s = sin(theta), h = 1 - c
 *         cdef GLfloat xs = x*s, ys = y*s, zs = z*s             # <<<<<<<<<<<<<<
 *         cdef GLfloat xx = x*x, xh = x*h, xxh = xx*h, xyh = y*xh, xzh = z*xh
 *         cdef GLfloat yy = y*y, yh = y*h, yyh = yy*h, yzh = z*yh, zzh = z*z*h
*/
  __pyx_v_xs = (__pyx_v_x * __pyx_v_s);
  __pyx_v_ys = (__pyx_v_y * __pyx_v_s);
  __pyx_v_zs = (__pyx_v_z * __pyx_v_s);

  /* "opengl/modern/glsl_perspective_view.pyx":179
 *         cdef GLfloat c = cos(theta), s = sin(theta), h = 1 - c
 *         cdef GLfloat xs = x*s, ys = y*s, zs = z*s
 *         cdef GLfloat xx = x*x, xh = x*h, xxh = xx*h, xyh = y*xh, xzh = z*xh             # <<<<<<<<<<<<<<
 *         cdef GLfloat yy = y*y, yh = y*h, yyh = yy*h, yzh = z*yh, zzh = z*z*h
 *         cdef GLfloat rot[16]
*/
  __pyx_v_xx = (__pyx_v_x * __pyx_v_x);
  __pyx_v_xh = (__pyx_v_x * __pyx_v_h);
  __pyx_v_xxh = (__pyx_v_xx * __pyx_v_h);
  __pyx_v_xyh = (__pyx_v_y * __pyx_v_xh);
  __pyx_v_xzh = (__pyx_v_z * __pyx_v_xh);

  /* "opengl/modern/glsl_perspective_view.pyx":180
 *         cdef GLfloat xs = x*s, ys = y*s, zs = z*s
 *         cdef GLfloat xx = x*x, xh = x*h, xxh = xx*h, xyh = y*xh, xzh = z*xh
 *         cdef GLfloat yy = y*y, yh = y*h, yyh = yy*h, yzh = z*yh, zzh = z*z*h             # <<<<<<<<<<<<<<
 *         cdef GLfloat rot[16]
 *         # entries in column-major order
*/
  __pyx_v_yy = (__pyx_v_y * __pyx_v_y);
  __pyx_v_yh = (__pyx_v_y * __pyx_v_h);
  __pyx_v_yyh = (__pyx_v_yy * __pyx_v_h);
  __pyx_v_yzh = (__pyx_v_z * __pyx_v_yh);
  __pyx_v_zzh = ((__pyx_v_z * __pyx_v_z) * __pyx_v_h);

  /* "opengl/modern/glsl_perspective_view.pyx":183
 *         cdef GLfloat rot[16]
 *         # entries in column-major order
 *         rot = (xxh + c,  xyh - zs, xzh + ys, 0,             # <<<<<<<<<<<<<<
 *                xyh + zs, yyh + c,  yzh - xs, 0,
 *                xzh - ys, yzh + xs, zzh + c,  0,
*/
  __pyx_t_11 = __pyx_v_rot;
  __pyx_t_10 = (__pyx_v_xxh + __pyx_v_c);
  __pyx_t_12 = (__pyx_v_xyh - __pyx_v_zs);
  __pyx_t_13 = (__pyx_v_xzh + __pyx_v_ys);
  __pyx_t_14 = 0.0;

  /* "opengl/modern/glsl_perspective_view.pyx":184
 *         # entries in column-major order
 *         rot = (xxh + c,  xyh - zs, xzh + ys, 0,
 *                xyh + zs, yyh + c,  yzh - xs, 0,             # <<<<<<<<<<<<<<
 *                xzh - ys, yzh + xs, zzh + c,  0,
 *                0, 0, 0, 1.0)
*/
  __pyx_t_15 = (__pyx_v_xyh + __pyx_v_zs);
  __pyx_t_16 = (__pyx_v_yyh + __pyx_v_c);
  __pyx_t_17 = (__pyx_v_yzh - __pyx_v_xs);
  __pyx_t_18 = 0.0;

  /* "opengl/modern/glsl_perspective_view.pyx":185
 *         rot = (xxh + c,  xyh - zs, xzh + ys, 0,
 *                xyh + zs, yyh + c,  yzh - xs, 0,
 *                xzh - ys, yzh + xs, zzh + c,  0,             # <<<<<<<<<<<<<<
 *                0, 0, 0, 1.0)
 *         mat4_multiply(rot, self._rotation, self._rotation)
*/
  __pyx_t_19 = (__pyx_v_xzh - __pyx_v_ys);
  __pyx_t_20 = (__pyx_v_yzh + __pyx_v_xs);
  __pyx_t_21 = (__pyx_v_zzh + __pyx_v_c);
  __pyx_t_22 = 0.0;

  /* "opengl/modern/glsl_perspective_view.pyx":186
 *                xyh + zs, yyh + c,  yzh - xs, 0,
 *                xzh - ys, yzh + xs, zzh + c,  0,
 *                0, 0, 0, 1.0)             # <<<<<<<<<<<<<<
 *         mat4_multiply(rot, self._rotation, self._rotation)
 * 
*/
  __pyx_t_23 = 0.0;
  __pyx_t_24 = 0.0;
  __pyx_t_25 = 0.0;
  __pyx_t_26 = 1.0;
  (__pyx_t_11[0]) = __pyx_t_10;
  (__pyx_t_11[1]) = __pyx_t_12;
  (__pyx_t_11[2]) = __pyx_t_13;
  (__pyx_t_11[3]) = __pyx_t_14;
  (__pyx_t_11[4]) = __pyx_t_15;
  (__pyx_t_11[5]) = __pyx_t_16;
  (__pyx_t_11[6]) = __pyx_t_17;
  (__pyx_t_11[7]) = __pyx_t_18;
  (__pyx_t_11[8]) = __pyx_t_19;
  (__pyx_t_11[9]) = __pyx_t_20;
  (__pyx_t_11[10]) = __pyx_t_21;
  (__pyx_t_11[11]) = __pyx_t_22;
  (__pyx_t_11[12]) = __pyx_t_23;
  (__pyx_t_11[13]) = __pyx_t_24;
  (__pyx_t_11[14]) = __pyx_t_25;
  (__pyx_t_11[15]) = __pyx_t_26;

  /* "opengl/modern/glsl_perspective_view.pyx":187
 *                xzh - ys, yzh + xs, zzh + c,  0,
 *                0, 0, 0, 1.0)
 *         mat4_multiply(rot, self._rotation, self._rotation)             # <<<<<<<<<<<<<<
 * 
 *     def get_uniform_bindings(self, view_width, view_height):
*/
  __pyx_t_1 = __pyx_f_8CyOpenGL_mat4_multiply(__pyx_v_rot, __pyx_v_self->_rotation, __pyx_v_self->_rotation); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 187, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/modern/glsl_perspective_view.pyx":170
 *             M[i+2] += z*a
 * 
 *     cpdef rotate(self, GLfloat theta, GLfloat x, GLfloat y, GLfloat z):             # <<<<<<<<<<<<<<
 *         """
 *         Update self._rotation by multiplying by a rotation matrix with
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("CyOpenGL.GLSLPerspectiveView.rotate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_19GLSLPerspectiveView_5rotate(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_19GLSLPerspectiveView_4rotate, "GLSLPerspectiveView.rotate(self, GLfloat theta, GLfloat x, GLfloat y, GLfloat z)\n\nUpdate self._rotation by multiplying by a rotation matrix with\nangle theta and axis given by a unit vector <x,y,z>.  The caller\nis responsible for normalizing the axial vector.");
static PyMethodDef __pyx_mdef_8CyOpenGL_19GLSLPerspectiveView_5rotate = {"rotate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_19GLSLPerspectiveView_5rotate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_19GLSLPerspectiveView_4rotate};
static PyObject *__pyx_pw_8CyOpenGL_19GLSLPerspectiveView_5rotate(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  GLfloat __pyx_v_theta;
  GLfloat __pyx_v_x;
  GLfloat __pyx_v_y;
  GLfloat __pyx_v_z;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[4] = {0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("rotate (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_theta,&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_y,&__pyx_mstate_global->__pyx_n_u_z,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(33, 170, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(33, 170, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(33, 170, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(33, 170, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(33, 170, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "rotate", 0) < (0)) __PYX_ERR(33, 170, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 4; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("rotate", 1, 4, 4, i); __PYX_ERR(33, 170, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 4)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(33, 170, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(33, 170, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(33, 170, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(33, 170, __pyx_L3_error)
    }
    __pyx_v_theta = __Pyx_PyFloat_AsFloat(values[0]); if (unlikely((__pyx_v_theta == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(33, 170, __pyx_L3_error)
    __pyx_v_x = __Pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_x == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(33, 170, __pyx_L3_error)
    __pyx_v_y = __Pyx_PyFloat_AsFloat(values[2]); if (unlikely((__pyx_v_y == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(33, 170, __pyx_L3_error)
    __pyx_v_z = __Pyx_PyFloat_AsFloat(values[3]); if (unlikely((__pyx_v_z == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(33, 170, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("rotate", 1, 4, 4, __pyx_nargs); __PYX_ERR(33, 170, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("CyOpenGL.GLSLPerspectiveView.rotate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_19GLSLPerspectiveView_4rotate(((struct __pyx_obj_8CyOpenGL_GLSLPerspectiveView *)__pyx_v_self), __pyx_v_theta, __pyx_v_x, __pyx_v_y, __pyx_v_z);

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

static PyObject *__pyx_pf_8CyOpenGL_19GLSLPerspectiveView_4rotate(struct __pyx_obj_8CyOpenGL_GLSLPerspectiveView *__pyx_v_self, GLfloat __pyx_v_theta, GLfloat __pyx_v_x, GLfloat __pyx_v_y, GLfloat __pyx_v_z) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("rotate", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8CyOpenGL_19GLSLPerspectiveView_rotate(__pyx_v_self, __pyx_v_theta, __pyx_v_x, __pyx_v_y, __pyx_v_z, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 170, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "opengl/modern/glsl_perspective_view.pyx":189
 *         mat4_multiply(rot, self._rotation, self._rotation)
 * 
 *     def get_uniform_bindings(self, view_width, view_height):             # <<<<<<<<<<<<<<
 *         self.compute_mvp(view_width, view_height)
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_19GLSLPerspectiveView_7get_uniform_bindings(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_19GLSLPerspectiveView_6get_uniform_bindings, "GLSLPerspectiveView.get_uniform_bindings(self, view_width, view_height)");
static PyMethodDef __pyx_mdef_8CyOpenGL_19GLSLPerspectiveView_7get_uniform_bindings = {"get_uniform_bindings", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_19GLSLPerspectiveView_7get_uniform_bindings, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_19GLSLPerspectiveView_6get_uniform_bindings};
static PyObject *__pyx_pw_8CyOpenGL_19GLSLPerspectiveView_7get_uniform_bindings(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_view_width = 0;
  PyObject *__pyx_v_view_height = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_uniform_bindings (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_view_width,&__pyx_mstate_global->__pyx_n_u_view_height,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(33, 189, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(33, 189, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(33, 189, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "get_uniform_bindings", 0) < (0)) __PYX_ERR(33, 189, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("get_uniform_bindings", 1, 2, 2, i); __PYX_ERR(33, 189, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(33, 189, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(33, 189, __pyx_L3_error)
    }
    __pyx_v_view_width = values[0];
    __pyx_v_view_height = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_uniform_bindings", 1, 2, 2, __pyx_nargs); __PYX_ERR(33, 189, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("CyOpenGL.GLSLPerspectiveView.get_uniform_bindings", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_19GLSLPerspectiveView_6get_uniform_bindings(((struct __pyx_obj_8CyOpenGL_GLSLPerspectiveView *)__pyx_v_self), __pyx_v_view_width, __pyx_v_view_height);

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

/* "opengl/modern/glsl_perspective_view.pyx":192
 *         self.compute_mvp(view_width, view_height)
 * 
 *         def to_py(m):             # <<<<<<<<<<<<<<
 *             return [ [ float(m[4 * i + j]) for j in range(4) ]
 *                      for i in range(4) ]
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_19GLSLPerspectiveView_20get_uniform_bindings_1to_py(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8CyOpenGL_19GLSLPerspectiveView_20get_uniform_bindings_1to_py = {"to_py", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_19GLSLPerspectiveView_20get_uniform_bindings_1to_py, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8CyOpenGL_19GLSLPerspectiveView_20get_uniform_bindings_1to_py(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_m = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_py (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_m,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(33, 192, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(33, 192, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "to_py", 0) < (0)) __PYX_ERR(33, 192, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("to_py", 1, 1, 1, i); __PYX_ERR(33, 192, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(33, 192, __pyx_L3_error)
    }
    __pyx_v_m = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("to_py", 1, 1, 1, __pyx_nargs); __PYX_ERR(33, 192, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("CyOpenGL.GLSLPerspectiveView.get_uniform_bindings.to_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_19GLSLPerspectiveView_20get_uniform_bindings_to_py(__pyx_self, __pyx_v_m);

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

static PyObject *__pyx_pf_8CyOpenGL_19GLSLPerspectiveView_20get_uniform_bindings_to_py(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_m) {
  long __pyx_9genexpr16__pyx_v_i;
  long __pyx_9genexpr17__pyx_v_j;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  long __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  long __pyx_t_4;
  long __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_py", 0);

  /* "opengl/modern/glsl_perspective_view.pyx":193
 * 
 *         def to_py(m):
 *             return [ [ float(m[4 * i + j]) for j in range(4) ]             # <<<<<<<<<<<<<<
 *                      for i in range(4) ]
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 193, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "opengl/modern/glsl_perspective_view.pyx":194
 *         def to_py(m):
 *             return [ [ float(m[4 * i + j]) for j in range(4) ]
 *                      for i in range(4) ]             # <<<<<<<<<<<<<<
 * 
 *         return {
*/
    for (__pyx_t_2 = 0; __pyx_t_2 < 4; __pyx_t_2+=1) {
      __pyx_9genexpr16__pyx_v_i = __pyx_t_2;
      { /* enter inner scope */

        /* "opengl/modern/glsl_perspective_view.pyx":193
 * 
 *         def to_py(m):
 *             return [ [ float(m[4 * i + j]) for j in range(4) ]             # <<<<<<<<<<<<<<
 *                      for i in range(4) ]
 * 
*/
        __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(33, 193, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        for (__pyx_t_4 = 0; __pyx_t_4 < 4; __pyx_t_4+=1) {
          __pyx_9genexpr17__pyx_v_j = __pyx_t_4;
          __pyx_t_5 = ((4 * __pyx_9genexpr16__pyx_v_i) + __pyx_9genexpr17__pyx_v_j);
          __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_m, __pyx_t_5, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_6)) __PYX_ERR(33, 193, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_7 = __Pyx_PyNumber_Float(__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(33, 193, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_7))) __PYX_ERR(33, 193, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        }
      } /* exit inner scope */
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) __PYX_ERR(33, 193, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
  } /* exit inner scope */
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "opengl/modern/glsl_perspective_view.pyx":192
 *         self.compute_mvp(view_width, view_height)
 * 
 *         def to_py(m):             # <<<<<<<<<<<<<<
 *             return [ [ float(m[4 * i + j]) for j in range(4) ]
 *                      for i in range(4) ]
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("CyOpenGL.GLSLPerspectiveView.get_uniform_bindings.to_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opengl/modern/glsl_perspective_view.pyx":189
 *         mat4_multiply(rot, self._rotation, self._rotation)
 * 
 *     def get_uniform_bindings(self, view_width, view_height):             # <<<<<<<<<<<<<<
 *         self.compute_mvp(view_width, view_height)
 * 
*/

static PyObject *__pyx_pf_8CyOpenGL_19GLSLPerspectiveView_6get_uniform_bindings(struct __pyx_obj_8CyOpenGL_GLSLPerspectiveView *__pyx_v_self, PyObject *__pyx_v_view_width, PyObject *__pyx_v_view_height) {
  PyObject *__pyx_v_to_py = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_uniform_bindings", 0);

  /* "opengl/modern/glsl_perspective_view.pyx":190
 * 
 *     def get_uniform_bindings(self, view_width, view_height):
 *         self.compute_mvp(view_width, view_height)             # <<<<<<<<<<<<<<
 * 
 *         def to_py(m):
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_8CyOpenGL_GLSLPerspectiveView *)__pyx_v_self->__pyx_vtab)->compute_mvp(__pyx_v_self, __pyx_v_view_width, __pyx_v_view_height); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 190, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/modern/glsl_perspective_view.pyx":192
 *         self.compute_mvp(view_width, view_height)
 * 
 *         def to_py(m):             # <<<<<<<<<<<<<<
 *             return [ [ float(m[4 * i + j]) for j in range(4) ]
 *                      for i in range(4) ]
*/
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_19GLSLPerspectiveView_20get_uniform_bindings_1to_py, 0, __pyx_mstate_global->__pyx_n_u_get_uniform_bindings_locals_to_p, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2])); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_to_py = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "opengl/modern/glsl_perspective_view.pyx":196
 *                      for i in range(4) ]
 * 
 *         return {             # <<<<<<<<<<<<<<
 *             'MVPMatrix': ('mat4', to_py(self._mvp)),
 *             'ModelViewMatrix': ('mat4', to_py(self._model_view)),
*/
  __Pyx_XDECREF(__pyx_r);

  /* "opengl/modern/glsl_perspective_view.pyx":197
 * 
 *         return {
 *             'MVPMatrix': ('mat4', to_py(self._mvp)),             # <<<<<<<<<<<<<<
 *             'ModelViewMatrix': ('mat4', to_py(self._model_view)),
 *             'ProjectionMatrix': ('mat4', to_py(self._projection)) }
*/
  __pyx_t_1 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_carray_to_py_GLfloat(__pyx_v_self->_mvp, 16); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __pyx_pf_8CyOpenGL_19GLSLPerspectiveView_20get_uniform_bindings_to_py(__pyx_v_to_py, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(33, 197, __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(33, 197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_mat4_2);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_mat4_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_mstate_global->__pyx_n_u_mat4_2) != (0)) __PYX_ERR(33, 197, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3) != (0)) __PYX_ERR(33, 197, __pyx_L1_error);
  __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_MVPMatrix, __pyx_t_2) < (0)) __PYX_ERR(33, 197, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opengl/modern/glsl_perspective_view.pyx":198
 *         return {
 *             'MVPMatrix': ('mat4', to_py(self._mvp)),
 *             'ModelViewMatrix': ('mat4', to_py(self._model_view)),             # <<<<<<<<<<<<<<
 *             'ProjectionMatrix': ('mat4', to_py(self._projection)) }
*/
  __pyx_t_2 = __Pyx_carray_to_py_GLfloat(__pyx_v_self->_model_view, 16); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 198, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __pyx_pf_8CyOpenGL_19GLSLPerspectiveView_20get_uniform_bindings_to_py(__pyx_v_to_py, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(33, 198, __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(33, 198, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_mat4_2);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_mat4_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_mstate_global->__pyx_n_u_mat4_2) != (0)) __PYX_ERR(33, 198, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3) != (0)) __PYX_ERR(33, 198, __pyx_L1_error);
  __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_ModelViewMatrix, __pyx_t_2) < (0)) __PYX_ERR(33, 197, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "opengl/modern/glsl_perspective_view.pyx":199
 *             'MVPMatrix': ('mat4', to_py(self._mvp)),
 *             'ModelViewMatrix': ('mat4', to_py(self._model_view)),
 *             'ProjectionMatrix': ('mat4', to_py(self._projection)) }             # <<<<<<<<<<<<<<
*/
  __pyx_t_2 = __Pyx_carray_to_py_GLfloat(__pyx_v_self->_projection, 16); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 199, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __pyx_pf_8CyOpenGL_19GLSLPerspectiveView_20get_uniform_bindings_to_py(__pyx_v_to_py, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(33, 199, __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(33, 199, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_mat4_2);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_mat4_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_mstate_global->__pyx_n_u_mat4_2) != (0)) __PYX_ERR(33, 199, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3) != (0)) __PYX_ERR(33, 199, __pyx_L1_error);
  __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_ProjectionMatrix, __pyx_t_2) < (0)) __PYX_ERR(33, 197, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "opengl/modern/glsl_perspective_view.pyx":189
 *         mat4_multiply(rot, self._rotation, self._rotation)
 * 
 *     def get_uniform_bindings(self, view_width, view_height):             # <<<<<<<<<<<<<<
 *         self.compute_mvp(view_width, view_height)
 * 
*/

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

/* "opengl/modern/glsl_perspective_widget.pyx":8
 *     profile = '3_2'
 * 
 *     def __init__(self, master, cnf={}, **kw):             # <<<<<<<<<<<<<<
 *         RawOpenGLWidget.__init__(self, master, cnf={}, **kw)
 *         GLSLPerspectiveView.__init__(self)
*/

static PyObject *__pyx_pf_8CyOpenGL_14__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__defaults__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(34, 8, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_self)->arg0);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_self)->arg0);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_self)->arg0) != (0)) __PYX_ERR(34, 8, __pyx_L1_error);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(34, 8, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1) != (0)) __PYX_ERR(34, 8, __pyx_L1_error);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None) != (0)) __PYX_ERR(34, 8, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("CyOpenGL.__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_8CyOpenGL_21GLSLPerspectiveWidget_1__init__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_21GLSLPerspectiveWidget___init__, "GLSLPerspectiveWidget.__init__(self, master, cnf={}, **kw)");
static PyMethodDef __pyx_mdef_8CyOpenGL_21GLSLPerspectiveWidget_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_21GLSLPerspectiveWidget_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_21GLSLPerspectiveWidget___init__};
static PyObject *__pyx_pw_8CyOpenGL_21GLSLPerspectiveWidget_1__init__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_master = 0;
  CYTHON_UNUSED PyObject *__pyx_v_cnf = 0;
  PyObject *__pyx_v_kw = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  __pyx_v_kw = PyDict_New(); if (unlikely(!__pyx_v_kw)) return NULL;
  __Pyx_GOTREF(__pyx_v_kw);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_master,&__pyx_mstate_global->__pyx_n_u_cnf,0};
    struct __pyx_defaults *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_self);
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(34, 8, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(34, 8, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(34, 8, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(34, 8, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, __pyx_v_kw, values, kwd_pos_args, __pyx_kwds_len, "__init__", 1) < (0)) __PYX_ERR(34, 8, __pyx_L3_error)
      if (!values[2]) values[2] = __Pyx_NewRef(__pyx_dynamic_args->arg0);
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, i); __PYX_ERR(34, 8, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(34, 8, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(34, 8, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(34, 8, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef(__pyx_dynamic_args->arg0);
    }
    __pyx_v_self = values[0];
    __pyx_v_master = values[1];
    __pyx_v_cnf = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, __pyx_nargs); __PYX_ERR(34, 8, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_DECREF(__pyx_v_kw); __pyx_v_kw = 0;
  __Pyx_AddTraceback("CyOpenGL.GLSLPerspectiveWidget.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_21GLSLPerspectiveWidget___init__(__pyx_self, __pyx_v_self, __pyx_v_master, __pyx_v_cnf, __pyx_v_kw);

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

static PyObject *__pyx_pf_8CyOpenGL_21GLSLPerspectiveWidget___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_master, CYTHON_UNUSED PyObject *__pyx_v_cnf, PyObject *__pyx_v_kw) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "opengl/modern/glsl_perspective_widget.pyx":9
 * 
 *     def __init__(self, master, cnf={}, **kw):
 *         RawOpenGLWidget.__init__(self, master, cnf={}, **kw)             # <<<<<<<<<<<<<<
 *         GLSLPerspectiveView.__init__(self)
 *         self.make_current()
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_RawOpenGLWidget); if (unlikely(!__pyx_t_3)) __PYX_ERR(34, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_init); if (unlikely(!__pyx_t_4)) __PYX_ERR(34, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(34, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(34, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_cnf, __pyx_t_6) < (0)) __PYX_ERR(34, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_3 = __pyx_t_5;
  __pyx_t_5 = 0;
  if (__Pyx_MergeKeywords(__pyx_t_3, __pyx_v_kw) < (0)) __PYX_ERR(34, 9, __pyx_L1_error)
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_self, __pyx_v_master};
    __pyx_t_1 = __Pyx_PyObject_FastCallDict((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_3);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(34, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/modern/glsl_perspective_widget.pyx":10
 *     def __init__(self, master, cnf={}, **kw):
 *         RawOpenGLWidget.__init__(self, master, cnf={}, **kw)
 *         GLSLPerspectiveView.__init__(self)             # <<<<<<<<<<<<<<
 *         self.make_current()
 *         self.objects = []
*/
  __pyx_t_4 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_8CyOpenGL_GLSLPerspectiveView);
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_7 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_self};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_init, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(34, 10, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/modern/glsl_perspective_widget.pyx":11
 *         RawOpenGLWidget.__init__(self, master, cnf={}, **kw)
 *         GLSLPerspectiveView.__init__(self)
 *         self.make_current()             # <<<<<<<<<<<<<<
 *         self.objects = []
 *         glDisable(GL_CULL_FACE)
*/
  __pyx_t_4 = __pyx_v_self;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_7 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_make_current, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(34, 11, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/modern/glsl_perspective_widget.pyx":12
 *         GLSLPerspectiveView.__init__(self)
 *         self.make_current()
 *         self.objects = []             # <<<<<<<<<<<<<<
 *         glDisable(GL_CULL_FACE)
 * 
*/
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(34, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_objects, __pyx_t_1) < (0)) __PYX_ERR(34, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/modern/glsl_perspective_widget.pyx":13
 *         self.make_current()
 *         self.objects = []
 *         glDisable(GL_CULL_FACE)             # <<<<<<<<<<<<<<
 * 
 *     def add_object(self, obj):
*/
  glDisable(GL_CULL_FACE);

  /* "opengl/modern/glsl_perspective_widget.pyx":8
 *     profile = '3_2'
 * 
 *     def __init__(self, master, cnf={}, **kw):             # <<<<<<<<<<<<<<
 *         RawOpenGLWidget.__init__(self, master, cnf={}, **kw)
 *         GLSLPerspectiveView.__init__(self)
*/

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

/* "opengl/modern/glsl_perspective_widget.pyx":15
 *         glDisable(GL_CULL_FACE)
 * 
 *     def add_object(self, obj):             # <<<<<<<<<<<<<<
 *         self.objects.append(obj)
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_21GLSLPerspectiveWidget_3add_object(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_21GLSLPerspectiveWidget_2add_object, "GLSLPerspectiveWidget.add_object(self, obj)");
static PyMethodDef __pyx_mdef_8CyOpenGL_21GLSLPerspectiveWidget_3add_object = {"add_object", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_21GLSLPerspectiveWidget_3add_object, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_21GLSLPerspectiveWidget_2add_object};
static PyObject *__pyx_pw_8CyOpenGL_21GLSLPerspectiveWidget_3add_object(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_obj = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add_object (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_obj,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(34, 15, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(34, 15, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(34, 15, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "add_object", 0) < (0)) __PYX_ERR(34, 15, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("add_object", 1, 2, 2, i); __PYX_ERR(34, 15, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(34, 15, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(34, 15, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
    __pyx_v_obj = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("add_object", 1, 2, 2, __pyx_nargs); __PYX_ERR(34, 15, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("CyOpenGL.GLSLPerspectiveWidget.add_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_21GLSLPerspectiveWidget_2add_object(__pyx_self, __pyx_v_self, __pyx_v_obj);

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

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

  /* "opengl/modern/glsl_perspective_widget.pyx":16
 * 
 *     def add_object(self, obj):
 *         self.objects.append(obj)             # <<<<<<<<<<<<<<
 * 
 *     def redraw(self, width, height, skip_swap_buffers = False):
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_objects); if (unlikely(!__pyx_t_1)) __PYX_ERR(34, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_v_obj); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(34, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/modern/glsl_perspective_widget.pyx":15
 *         glDisable(GL_CULL_FACE)
 * 
 *     def add_object(self, obj):             # <<<<<<<<<<<<<<
 *         self.objects.append(obj)
 * 
*/

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

/* "opengl/modern/glsl_perspective_widget.pyx":18
 *         self.objects.append(obj)
 * 
 *     def redraw(self, width, height, skip_swap_buffers = False):             # <<<<<<<<<<<<<<
 *         glViewport(0, 0, width, height)
 *         glClearColor(0.0, 0.0, 0.0, 1.0);
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_21GLSLPerspectiveWidget_5redraw(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_21GLSLPerspectiveWidget_4redraw, "GLSLPerspectiveWidget.redraw(self, width, height, skip_swap_buffers=False)");
static PyMethodDef __pyx_mdef_8CyOpenGL_21GLSLPerspectiveWidget_5redraw = {"redraw", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_21GLSLPerspectiveWidget_5redraw, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_21GLSLPerspectiveWidget_4redraw};
static PyObject *__pyx_pw_8CyOpenGL_21GLSLPerspectiveWidget_5redraw(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_width = 0;
  PyObject *__pyx_v_height = 0;
  PyObject *__pyx_v_skip_swap_buffers = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[4] = {0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("redraw (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_width,&__pyx_mstate_global->__pyx_n_u_height,&__pyx_mstate_global->__pyx_n_u_skip_swap_buffers,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(34, 18, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(34, 18, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(34, 18, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(34, 18, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(34, 18, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "redraw", 0) < (0)) __PYX_ERR(34, 18, __pyx_L3_error)
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False)));
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("redraw", 0, 3, 4, i); __PYX_ERR(34, 18, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(34, 18, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(34, 18, __pyx_L3_error)
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(34, 18, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(34, 18, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False)));
    }
    __pyx_v_self = values[0];
    __pyx_v_width = values[1];
    __pyx_v_height = values[2];
    __pyx_v_skip_swap_buffers = values[3];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("redraw", 0, 3, 4, __pyx_nargs); __PYX_ERR(34, 18, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("CyOpenGL.GLSLPerspectiveWidget.redraw", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_21GLSLPerspectiveWidget_4redraw(__pyx_self, __pyx_v_self, __pyx_v_width, __pyx_v_height, __pyx_v_skip_swap_buffers);

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

static PyObject *__pyx_pf_8CyOpenGL_21GLSLPerspectiveWidget_4redraw(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_width, PyObject *__pyx_v_height, PyObject *__pyx_v_skip_swap_buffers) {
  PyObject *__pyx_v_object = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  GLsizei __pyx_t_1;
  GLsizei __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;
  size_t __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("redraw", 0);

  /* "opengl/modern/glsl_perspective_widget.pyx":19
 * 
 *     def redraw(self, width, height, skip_swap_buffers = False):
 *         glViewport(0, 0, width, height)             # <<<<<<<<<<<<<<
 *         glClearColor(0.0, 0.0, 0.0, 1.0);
 *         glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
*/
  __pyx_t_1 = __Pyx_PyLong_As_GLsizei(__pyx_v_width); if (unlikely((__pyx_t_1 == ((GLsizei)-1)) && PyErr_Occurred())) __PYX_ERR(34, 19, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_As_GLsizei(__pyx_v_height); if (unlikely((__pyx_t_2 == ((GLsizei)-1)) && PyErr_Occurred())) __PYX_ERR(34, 19, __pyx_L1_error)
  glViewport(0, 0, __pyx_t_1, __pyx_t_2);

  /* "opengl/modern/glsl_perspective_widget.pyx":20
 *     def redraw(self, width, height, skip_swap_buffers = False):
 *         glViewport(0, 0, width, height)
 *         glClearColor(0.0, 0.0, 0.0, 1.0);             # <<<<<<<<<<<<<<
 *         glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
 *         for object in self.objects:
*/
  glClearColor(0.0, 0.0, 0.0, 1.0);

  /* "opengl/modern/glsl_perspective_widget.pyx":21
 *         glViewport(0, 0, width, height)
 *         glClearColor(0.0, 0.0, 0.0, 1.0);
 *         glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);             # <<<<<<<<<<<<<<
 *         for object in self.objects:
 *             object.draw(width, height)
*/
  glClear((GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT));

  /* "opengl/modern/glsl_perspective_widget.pyx":22
 *         glClearColor(0.0, 0.0, 0.0, 1.0);
 *         glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
 *         for object in self.objects:             # <<<<<<<<<<<<<<
 *             object.draw(width, height)
 *         if not skip_swap_buffers:
*/
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_objects); if (unlikely(!__pyx_t_3)) __PYX_ERR(34, 22, __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(34, 22, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(34, 22, __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))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(34, 22, __pyx_L1_error)
          #endif
          if (__pyx_t_5 >= __pyx_temp) break;
        }
        __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_4, __pyx_t_5, __Pyx_ReferenceSharing_OwnStrongReference);
        ++__pyx_t_5;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(34, 22, __pyx_L1_error)
          #endif
          if (__pyx_t_5 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5));
        #else
        __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_5);
        #endif
        ++__pyx_t_5;
      }
      if (unlikely(!__pyx_t_3)) __PYX_ERR(34, 22, __pyx_L1_error)
    } else {
      __pyx_t_3 = __pyx_t_6(__pyx_t_4);
      if (unlikely(!__pyx_t_3)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(34, 22, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_XDECREF_SET(__pyx_v_object, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "opengl/modern/glsl_perspective_widget.pyx":23
 *         glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
 *         for object in self.objects:
 *             object.draw(width, height)             # <<<<<<<<<<<<<<
 *         if not skip_swap_buffers:
 *             self.swap_buffers()
*/
    __pyx_t_7 = __pyx_v_object;
    __Pyx_INCREF(__pyx_t_7);
    __pyx_t_8 = 0;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_v_width, __pyx_v_height};
      __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_draw, __pyx_callargs+__pyx_t_8, (3-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(34, 23, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "opengl/modern/glsl_perspective_widget.pyx":22
 *         glClearColor(0.0, 0.0, 0.0, 1.0);
 *         glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
 *         for object in self.objects:             # <<<<<<<<<<<<<<
 *             object.draw(width, height)
 *         if not skip_swap_buffers:
*/
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opengl/modern/glsl_perspective_widget.pyx":24
 *         for object in self.objects:
 *             object.draw(width, height)
 *         if not skip_swap_buffers:             # <<<<<<<<<<<<<<
 *             self.swap_buffers()
 * 
*/
  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_skip_swap_buffers); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(34, 24, __pyx_L1_error)
  __pyx_t_10 = (!__pyx_t_9);
  if (__pyx_t_10) {

    /* "opengl/modern/glsl_perspective_widget.pyx":25
 *             object.draw(width, height)
 *         if not skip_swap_buffers:
 *             self.swap_buffers()             # <<<<<<<<<<<<<<
 * 
*/
    __pyx_t_3 = __pyx_v_self;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_8 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_swap_buffers, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(34, 25, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "opengl/modern/glsl_perspective_widget.pyx":24
 *         for object in self.objects:
 *             object.draw(width, height)
 *         if not skip_swap_buffers:             # <<<<<<<<<<<<<<
 *             self.swap_buffers()
 * 
*/
  }

  /* "opengl/modern/glsl_perspective_widget.pyx":18
 *         self.objects.append(obj)
 * 
 *     def redraw(self, width, height, skip_swap_buffers = False):             # <<<<<<<<<<<<<<
 *         glViewport(0, 0, width, height)
 *         glClearColor(0.0, 0.0, 0.0, 1.0);
*/

  /* 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_7);
  __Pyx_AddTraceback("CyOpenGL.GLSLPerspectiveWidget.redraw", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_object);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opengl/modern/triangle.pyx":10
 *     cdef _vertex_buffer
 * 
 *     def __init__(self, gl_widget, program, vertices):             # <<<<<<<<<<<<<<
 *         """
 *         Constructed from GL widget, GLSLProgram and vertices
*/

/* Python wrapper */
static int __pyx_pw_8CyOpenGL_8Triangle_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_8Triangle___init__, "\n        Constructed from GL widget, GLSLProgram and vertices\n        such as [[0,0,0],[1,1,0],[0,1,1]].\n        ");
#if CYTHON_UPDATE_DESCRIPTOR_DOC
struct wrapperbase __pyx_wrapperbase_8CyOpenGL_8Triangle___init__;
#endif
static int __pyx_pw_8CyOpenGL_8Triangle_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_gl_widget = 0;
  PyObject *__pyx_v_program = 0;
  PyObject *__pyx_v_vertices = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_gl_widget,&__pyx_mstate_global->__pyx_n_u_program,&__pyx_mstate_global->__pyx_n_u_vertices,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(35, 10, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(35, 10, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(35, 10, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(35, 10, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(35, 10, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, i); __PYX_ERR(35, 10, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(35, 10, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(35, 10, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(35, 10, __pyx_L3_error)
    }
    __pyx_v_gl_widget = values[0];
    __pyx_v_program = values[1];
    __pyx_v_vertices = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, __pyx_nargs); __PYX_ERR(35, 10, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("CyOpenGL.Triangle.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_8Triangle___init__(((struct __pyx_obj_8CyOpenGL_Triangle *)__pyx_v_self), __pyx_v_gl_widget, __pyx_v_program, __pyx_v_vertices);

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

static int __pyx_pf_8CyOpenGL_8Triangle___init__(struct __pyx_obj_8CyOpenGL_Triangle *__pyx_v_self, PyObject *__pyx_v_gl_widget, PyObject *__pyx_v_program, PyObject *__pyx_v_vertices) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "opengl/modern/triangle.pyx":16
 *         """
 * 
 *         self._gl_widget = gl_widget             # <<<<<<<<<<<<<<
 *         self._program = program
 *         self._vertex_buffer = VertexBuffer()
*/
  __Pyx_INCREF(__pyx_v_gl_widget);
  __Pyx_GIVEREF(__pyx_v_gl_widget);
  __Pyx_GOTREF(__pyx_v_self->_gl_widget);
  __Pyx_DECREF(__pyx_v_self->_gl_widget);
  __pyx_v_self->_gl_widget = __pyx_v_gl_widget;

  /* "opengl/modern/triangle.pyx":17
 * 
 *         self._gl_widget = gl_widget
 *         self._program = program             # <<<<<<<<<<<<<<
 *         self._vertex_buffer = VertexBuffer()
 *         self._vertex_buffer.load(vertices)
*/
  __Pyx_INCREF(__pyx_v_program);
  __Pyx_GIVEREF(__pyx_v_program);
  __Pyx_GOTREF(__pyx_v_self->_program);
  __Pyx_DECREF(__pyx_v_self->_program);
  __pyx_v_self->_program = __pyx_v_program;

  /* "opengl/modern/triangle.pyx":18
 *         self._gl_widget = gl_widget
 *         self._program = program
 *         self._vertex_buffer = VertexBuffer()             # <<<<<<<<<<<<<<
 *         self._vertex_buffer.load(vertices)
 * 
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8CyOpenGL_VertexBuffer, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(35, 18, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __Pyx_GIVEREF((PyObject *)__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->_vertex_buffer);
  __Pyx_DECREF(__pyx_v_self->_vertex_buffer);
  __pyx_v_self->_vertex_buffer = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "opengl/modern/triangle.pyx":19
 *         self._program = program
 *         self._vertex_buffer = VertexBuffer()
 *         self._vertex_buffer.load(vertices)             # <<<<<<<<<<<<<<
 * 
 *     def draw(self, view_width, view_height):
*/
  __pyx_t_2 = __pyx_v_self->_vertex_buffer;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_vertices};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_load, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(35, 19, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/modern/triangle.pyx":10
 *     cdef _vertex_buffer
 * 
 *     def __init__(self, gl_widget, program, vertices):             # <<<<<<<<<<<<<<
 *         """
 *         Constructed from GL widget, GLSLProgram and vertices
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("CyOpenGL.Triangle.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "opengl/modern/triangle.pyx":21
 *         self._vertex_buffer.load(vertices)
 * 
 *     def draw(self, view_width, view_height):             # <<<<<<<<<<<<<<
 *         """
 *         Draw the object (given size of viewport) by binding
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_8Triangle_3draw(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_8Triangle_2draw, "Triangle.draw(self, view_width, view_height)\n\nDraw the object (given size of viewport) by binding\nthe program and the uniforms and calling draw_impl() which\nis implemented by some subclass.");
static PyMethodDef __pyx_mdef_8CyOpenGL_8Triangle_3draw = {"draw", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_8Triangle_3draw, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_8Triangle_2draw};
static PyObject *__pyx_pw_8CyOpenGL_8Triangle_3draw(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_view_width = 0;
  PyObject *__pyx_v_view_height = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("draw (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_view_width,&__pyx_mstate_global->__pyx_n_u_view_height,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(35, 21, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(35, 21, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(35, 21, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "draw", 0) < (0)) __PYX_ERR(35, 21, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("draw", 1, 2, 2, i); __PYX_ERR(35, 21, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(35, 21, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(35, 21, __pyx_L3_error)
    }
    __pyx_v_view_width = values[0];
    __pyx_v_view_height = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("draw", 1, 2, 2, __pyx_nargs); __PYX_ERR(35, 21, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("CyOpenGL.Triangle.draw", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_8Triangle_2draw(((struct __pyx_obj_8CyOpenGL_Triangle *)__pyx_v_self), __pyx_v_view_width, __pyx_v_view_height);

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

static PyObject *__pyx_pf_8CyOpenGL_8Triangle_2draw(struct __pyx_obj_8CyOpenGL_Triangle *__pyx_v_self, PyObject *__pyx_v_view_width, PyObject *__pyx_v_view_height) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("draw", 0);

  /* "opengl/modern/triangle.pyx":28
 *         """
 * 
 *         self._program.use_program()             # <<<<<<<<<<<<<<
 *         self._program.bind_uniforms(
 *             self.get_uniform_bindings(view_width, view_height))
*/
  __pyx_t_2 = __pyx_v_self->_program;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_use_program, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(35, 28, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/modern/triangle.pyx":29
 * 
 *         self._program.use_program()
 *         self._program.bind_uniforms(             # <<<<<<<<<<<<<<
 *             self.get_uniform_bindings(view_width, view_height))
 * 
*/
  __pyx_t_2 = __pyx_v_self->_program;
  __Pyx_INCREF(__pyx_t_2);

  /* "opengl/modern/triangle.pyx":30
 *         self._program.use_program()
 *         self._program.bind_uniforms(
 *             self.get_uniform_bindings(view_width, view_height))             # <<<<<<<<<<<<<<
 * 
 *         self._vertex_buffer.bind()
*/
  __pyx_t_5 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_v_view_width, __pyx_v_view_height};
    __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_uniform_bindings, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(35, 30, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_bind_uniforms, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(35, 29, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/modern/triangle.pyx":32
 *             self.get_uniform_bindings(view_width, view_height))
 * 
 *         self._vertex_buffer.bind()             # <<<<<<<<<<<<<<
 * 
 *         # Draw the triangle
*/
  __pyx_t_4 = __pyx_v_self->_vertex_buffer;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_bind, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(35, 32, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/modern/triangle.pyx":35
 * 
 *         # Draw the triangle
 *         glDrawArrays(GL_TRIANGLES, 0, 3)             # <<<<<<<<<<<<<<
 * 
 *     def delete_resource(self):
*/
  glDrawArrays(GL_TRIANGLES, 0, 3);

  /* "opengl/modern/triangle.pyx":21
 *         self._vertex_buffer.load(vertices)
 * 
 *     def draw(self, view_width, view_height):             # <<<<<<<<<<<<<<
 *         """
 *         Draw the object (given size of viewport) by binding
*/

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

/* "opengl/modern/triangle.pyx":37
 *         glDrawArrays(GL_TRIANGLES, 0, 3)
 * 
 *     def delete_resource(self):             # <<<<<<<<<<<<<<
 *         self._vertex_buffer.delete_resource()
 *         self._program.delete_resource()
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_8Triangle_5delete_resource(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_8Triangle_4delete_resource, "Triangle.delete_resource(self)");
static PyMethodDef __pyx_mdef_8CyOpenGL_8Triangle_5delete_resource = {"delete_resource", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_8Triangle_5delete_resource, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_8Triangle_4delete_resource};
static PyObject *__pyx_pw_8CyOpenGL_8Triangle_5delete_resource(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("delete_resource (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("delete_resource", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("delete_resource", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8CyOpenGL_8Triangle_4delete_resource(((struct __pyx_obj_8CyOpenGL_Triangle *)__pyx_v_self));

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

static PyObject *__pyx_pf_8CyOpenGL_8Triangle_4delete_resource(struct __pyx_obj_8CyOpenGL_Triangle *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("delete_resource", 0);

  /* "opengl/modern/triangle.pyx":38
 * 
 *     def delete_resource(self):
 *         self._vertex_buffer.delete_resource()             # <<<<<<<<<<<<<<
 *         self._program.delete_resource()
 * 
*/
  __pyx_t_2 = __pyx_v_self->_vertex_buffer;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_delete_resource, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(35, 38, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/modern/triangle.pyx":39
 *     def delete_resource(self):
 *         self._vertex_buffer.delete_resource()
 *         self._program.delete_resource()             # <<<<<<<<<<<<<<
 * 
 *     def get_uniform_bindings(self, view_width, view_height):
*/
  __pyx_t_2 = __pyx_v_self->_program;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_delete_resource, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(35, 39, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "opengl/modern/triangle.pyx":37
 *         glDrawArrays(GL_TRIANGLES, 0, 3)
 * 
 *     def delete_resource(self):             # <<<<<<<<<<<<<<
 *         self._vertex_buffer.delete_resource()
 *         self._program.delete_resource()
*/

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

/* "opengl/modern/triangle.pyx":41
 *         self._program.delete_resource()
 * 
 *     def get_uniform_bindings(self, view_width, view_height):             # <<<<<<<<<<<<<<
 *         """
 *         Override to bind the uniforms you want.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_8Triangle_7get_uniform_bindings(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8CyOpenGL_8Triangle_6get_uniform_bindings, "Triangle.get_uniform_bindings(self, view_width, view_height)\n\nOverride to bind the uniforms you want.\n\nArguments are size of viewport.");
static PyMethodDef __pyx_mdef_8CyOpenGL_8Triangle_7get_uniform_bindings = {"get_uniform_bindings", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_8Triangle_7get_uniform_bindings, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_8Triangle_6get_uniform_bindings};
static PyObject *__pyx_pw_8CyOpenGL_8Triangle_7get_uniform_bindings(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_view_width = 0;
  PyObject *__pyx_v_view_height = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_uniform_bindings (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_view_width,&__pyx_mstate_global->__pyx_n_u_view_height,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(35, 41, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(35, 41, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(35, 41, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "get_uniform_bindings", 0) < (0)) __PYX_ERR(35, 41, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("get_uniform_bindings", 1, 2, 2, i); __PYX_ERR(35, 41, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(35, 41, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(35, 41, __pyx_L3_error)
    }
    __pyx_v_view_width = values[0];
    __pyx_v_view_height = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_uniform_bindings", 1, 2, 2, __pyx_nargs); __PYX_ERR(35, 41, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("CyOpenGL.Triangle.get_uniform_bindings", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_8Triangle_6get_uniform_bindings(((struct __pyx_obj_8CyOpenGL_Triangle *)__pyx_v_self), __pyx_v_view_width, __pyx_v_view_height);

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

static PyObject *__pyx_pf_8CyOpenGL_8Triangle_6get_uniform_bindings(struct __pyx_obj_8CyOpenGL_Triangle *__pyx_v_self, PyObject *__pyx_v_view_width, PyObject *__pyx_v_view_height) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_uniform_bindings", 0);

  /* "opengl/modern/triangle.pyx":48
 *         """
 * 
 *         return self._gl_widget.get_uniform_bindings(view_width, view_height)             # <<<<<<<<<<<<<<
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_v_self->_gl_widget;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_view_width, __pyx_v_view_height};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_uniform_bindings, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(35, 48, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "opengl/modern/triangle.pyx":41
 *         self._program.delete_resource()
 * 
 *     def get_uniform_bindings(self, view_width, view_height):             # <<<<<<<<<<<<<<
 *         """
 *         Override to bind the uniforms you want.
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("CyOpenGL.Triangle.get_uniform_bindings", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* #### Code section: module_exttypes ### */

static PyObject *__pyx_tp_new_8CyOpenGL_vector3(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o;
  o = __Pyx_AllocateExtensionType(t, 0);
  if (unlikely(!o)) return 0;
  if (unlikely(__pyx_pw_8CyOpenGL_7vector3_1__cinit__(o, a, k) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_8CyOpenGL_vector3(PyObject *o) {
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_8CyOpenGL_vector3) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyTypeObject *tp = Py_TYPE(o);
  #if CYTHON_USE_TYPE_SLOTS
  (*tp->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  Py_DECREF(tp);
  #endif
}

static CYTHON_INLINE PyObject *__pyx_nb_add_8CyOpenGL_vector3_maybe_call_slot(PyTypeObject* type, PyObject *left, PyObject *right ) {
    binaryfunc slot;
#if CYTHON_USE_TYPE_SLOTS
    slot = type->tp_as_number ? type->tp_as_number->nb_add : NULL;
#else
    slot = (binaryfunc) PyType_GetSlot(type, Py_nb_add);
#endif
    return slot ? slot(left, right ) : __Pyx_NewRef(Py_NotImplemented);
}
static PyObject *__pyx_nb_add_8CyOpenGL_vector3(PyObject *left, PyObject *right ) {
    int maybe_self_is_left, maybe_self_is_right = 0;
    maybe_self_is_left = Py_TYPE(left) == Py_TYPE(right)
#if CYTHON_USE_TYPE_SLOTS
            || (Py_TYPE(left)->tp_as_number && Py_TYPE(left)->tp_as_number->nb_add == &__pyx_nb_add_8CyOpenGL_vector3)
#endif
            || __Pyx_TypeCheck(left, __pyx_mstate_global->__pyx_ptype_8CyOpenGL_vector3);
    if (maybe_self_is_left) {
        PyObject *res;
        res = __pyx_pw_8CyOpenGL_7vector3_5__add__(left, right);
        if (res != Py_NotImplemented) return res;
        Py_DECREF(res);
    }
    maybe_self_is_right = Py_TYPE(left) == Py_TYPE(right)
#if CYTHON_USE_TYPE_SLOTS
            || (Py_TYPE(right)->tp_as_number && Py_TYPE(right)->tp_as_number->nb_add == &__pyx_nb_add_8CyOpenGL_vector3)
#endif
            || PyType_IsSubtype(Py_TYPE(right), __pyx_mstate_global->__pyx_ptype_8CyOpenGL_vector3);
    if (maybe_self_is_right) {
        return __pyx_nb_add_8CyOpenGL_vector3_maybe_call_slot(__Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_8CyOpenGL_vector3, tp_base, PyTypeObject*), left, right );
    }
    return __Pyx_NewRef(Py_NotImplemented);
}



static CYTHON_INLINE PyObject *__pyx_nb_subtract_8CyOpenGL_vector3_maybe_call_slot(PyTypeObject* type, PyObject *left, PyObject *right ) {
    binaryfunc slot;
#if CYTHON_USE_TYPE_SLOTS
    slot = type->tp_as_number ? type->tp_as_number->nb_subtract : NULL;
#else
    slot = (binaryfunc) PyType_GetSlot(type, Py_nb_subtract);
#endif
    return slot ? slot(left, right ) : __Pyx_NewRef(Py_NotImplemented);
}
static PyObject *__pyx_nb_subtract_8CyOpenGL_vector3(PyObject *left, PyObject *right ) {
    int maybe_self_is_left, maybe_self_is_right = 0;
    maybe_self_is_left = Py_TYPE(left) == Py_TYPE(right)
#if CYTHON_USE_TYPE_SLOTS
            || (Py_TYPE(left)->tp_as_number && Py_TYPE(left)->tp_as_number->nb_subtract == &__pyx_nb_subtract_8CyOpenGL_vector3)
#endif
            || __Pyx_TypeCheck(left, __pyx_mstate_global->__pyx_ptype_8CyOpenGL_vector3);
    if (maybe_self_is_left) {
        PyObject *res;
        res = __pyx_pw_8CyOpenGL_7vector3_7__sub__(left, right);
        if (res != Py_NotImplemented) return res;
        Py_DECREF(res);
    }
    maybe_self_is_right = Py_TYPE(left) == Py_TYPE(right)
#if CYTHON_USE_TYPE_SLOTS
            || (Py_TYPE(right)->tp_as_number && Py_TYPE(right)->tp_as_number->nb_subtract == &__pyx_nb_subtract_8CyOpenGL_vector3)
#endif
            || PyType_IsSubtype(Py_TYPE(right), __pyx_mstate_global->__pyx_ptype_8CyOpenGL_vector3);
    if (maybe_self_is_right) {
        return __pyx_nb_subtract_8CyOpenGL_vector3_maybe_call_slot(__Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_8CyOpenGL_vector3, tp_base, PyTypeObject*), left, right );
    }
    return __Pyx_NewRef(Py_NotImplemented);
}



static CYTHON_INLINE PyObject *__pyx_nb_multiply_8CyOpenGL_vector3_maybe_call_slot(PyTypeObject* type, PyObject *left, PyObject *right ) {
    binaryfunc slot;
#if CYTHON_USE_TYPE_SLOTS
    slot = type->tp_as_number ? type->tp_as_number->nb_multiply : NULL;
#else
    slot = (binaryfunc) PyType_GetSlot(type, Py_nb_multiply);
#endif
    return slot ? slot(left, right ) : __Pyx_NewRef(Py_NotImplemented);
}
static PyObject *__pyx_nb_multiply_8CyOpenGL_vector3(PyObject *left, PyObject *right ) {
    int maybe_self_is_left, maybe_self_is_right = 0;
    maybe_self_is_left = Py_TYPE(left) == Py_TYPE(right)
#if CYTHON_USE_TYPE_SLOTS
            || (Py_TYPE(left)->tp_as_number && Py_TYPE(left)->tp_as_number->nb_multiply == &__pyx_nb_multiply_8CyOpenGL_vector3)
#endif
            || __Pyx_TypeCheck(left, __pyx_mstate_global->__pyx_ptype_8CyOpenGL_vector3);
    if (maybe_self_is_left) {
        PyObject *res;
        res = __pyx_pw_8CyOpenGL_7vector3_9__mul__(left, right);
        if (res != Py_NotImplemented) return res;
        Py_DECREF(res);
    }
    maybe_self_is_right = Py_TYPE(left) == Py_TYPE(right)
#if CYTHON_USE_TYPE_SLOTS
            || (Py_TYPE(right)->tp_as_number && Py_TYPE(right)->tp_as_number->nb_multiply == &__pyx_nb_multiply_8CyOpenGL_vector3)
#endif
            || PyType_IsSubtype(Py_TYPE(right), __pyx_mstate_global->__pyx_ptype_8CyOpenGL_vector3);
    if (maybe_self_is_right) {
        return __pyx_nb_multiply_8CyOpenGL_vector3_maybe_call_slot(__Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_8CyOpenGL_vector3, tp_base, PyTypeObject*), left, right );
    }
    return __Pyx_NewRef(Py_NotImplemented);
}



static CYTHON_INLINE PyObject *__pyx_nb_true_divide_8CyOpenGL_vector3_maybe_call_slot(PyTypeObject* type, PyObject *left, PyObject *right ) {
    binaryfunc slot;
#if CYTHON_USE_TYPE_SLOTS
    slot = type->tp_as_number ? type->tp_as_number->nb_true_divide : NULL;
#else
    slot = (binaryfunc) PyType_GetSlot(type, Py_nb_true_divide);
#endif
    return slot ? slot(left, right ) : __Pyx_NewRef(Py_NotImplemented);
}
static PyObject *__pyx_nb_true_divide_8CyOpenGL_vector3(PyObject *left, PyObject *right ) {
    int maybe_self_is_left, maybe_self_is_right = 0;
    maybe_self_is_left = Py_TYPE(left) == Py_TYPE(right)
#if CYTHON_USE_TYPE_SLOTS
            || (Py_TYPE(left)->tp_as_number && Py_TYPE(left)->tp_as_number->nb_true_divide == &__pyx_nb_true_divide_8CyOpenGL_vector3)
#endif
            || __Pyx_TypeCheck(left, __pyx_mstate_global->__pyx_ptype_8CyOpenGL_vector3);
    if (maybe_self_is_left) {
        PyObject *res;
        res = __pyx_pw_8CyOpenGL_7vector3_13__truediv__(left, right);
        if (res != Py_NotImplemented) return res;
        Py_DECREF(res);
    }
    maybe_self_is_right = Py_TYPE(left) == Py_TYPE(right)
#if CYTHON_USE_TYPE_SLOTS
            || (Py_TYPE(right)->tp_as_number && Py_TYPE(right)->tp_as_number->nb_true_divide == &__pyx_nb_true_divide_8CyOpenGL_vector3)
#endif
            || PyType_IsSubtype(Py_TYPE(right), __pyx_mstate_global->__pyx_ptype_8CyOpenGL_vector3);
    if (maybe_self_is_right) {
        return __pyx_nb_true_divide_8CyOpenGL_vector3_maybe_call_slot(__Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_8CyOpenGL_vector3, tp_base, PyTypeObject*), left, right );
    }
    return __Pyx_NewRef(Py_NotImplemented);
}



static PyObject *__pyx_getprop_8CyOpenGL_7vector3_x(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_8CyOpenGL_7vector3_1x_1__get__(o);
}

static PyObject *__pyx_getprop_8CyOpenGL_7vector3_y(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_8CyOpenGL_7vector3_1y_1__get__(o);
}

static PyObject *__pyx_getprop_8CyOpenGL_7vector3_z(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_8CyOpenGL_7vector3_1z_1__get__(o);
}

static PyObject *__pyx_getprop_8CyOpenGL_7vector3_norm_squared(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_8CyOpenGL_7vector3_12norm_squared_1__get__(o);
}

static PyObject *__pyx_getprop_8CyOpenGL_7vector3_norm(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_8CyOpenGL_7vector3_4norm_1__get__(o);
}

static PyMethodDef __pyx_methods_8CyOpenGL_vector3[] = {
  {"__add__", (PyCFunction)__pyx_pw_8CyOpenGL_7vector3_5__add__, METH_O|METH_COEXIST, 0},
  {"__sub__", (PyCFunction)__pyx_pw_8CyOpenGL_7vector3_7__sub__, METH_O|METH_COEXIST, 0},
  {"__mul__", (PyCFunction)__pyx_pw_8CyOpenGL_7vector3_9__mul__, METH_O|METH_COEXIST, 0},
  {"__div__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_7vector3_11__div__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_7vector3_10__div__},
  {"__truediv__", (PyCFunction)__pyx_pw_8CyOpenGL_7vector3_13__truediv__, METH_O|METH_COEXIST, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_8CyOpenGL_vector3[] = {
  {"x", __pyx_getprop_8CyOpenGL_7vector3_x, 0, 0, 0},
  {"y", __pyx_getprop_8CyOpenGL_7vector3_y, 0, 0, 0},
  {"z", __pyx_getprop_8CyOpenGL_7vector3_z, 0, 0, 0},
  {"norm_squared", __pyx_getprop_8CyOpenGL_7vector3_norm_squared, 0, 0, 0},
  {"norm", __pyx_getprop_8CyOpenGL_7vector3_norm, 0, 0, 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_8CyOpenGL_vector3_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8CyOpenGL_vector3},
  {Py_tp_repr, (void *)__pyx_pw_8CyOpenGL_7vector3_3__repr__},
  {Py_nb_add, (void *)__pyx_nb_add_8CyOpenGL_vector3},
  {Py_nb_subtract, (void *)__pyx_nb_subtract_8CyOpenGL_vector3},
  {Py_nb_multiply, (void *)__pyx_nb_multiply_8CyOpenGL_vector3},
  {Py_nb_true_divide, (void *)__pyx_nb_true_divide_8CyOpenGL_vector3},
  {Py_tp_doc, (void *)PyDoc_STR("\n    A simple real 3-dimensional vector which supports addition,\n    subtraction and right multiplication or division by scalars.\n    Attributes include its norm and the square of its norm.\n    ")},
  {Py_tp_methods, (void *)__pyx_methods_8CyOpenGL_vector3},
  {Py_tp_getset, (void *)__pyx_getsets_8CyOpenGL_vector3},
  {Py_tp_new, (void *)__pyx_tp_new_8CyOpenGL_vector3},
  {0, 0},
};
static PyType_Spec __pyx_type_8CyOpenGL_vector3_spec = {
  "CyOpenGL.vector3",
  sizeof(struct __pyx_obj_8CyOpenGL_vector3),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_8CyOpenGL_vector3_slots,
};
#else

static PyNumberMethods __pyx_tp_as_number_vector3 = {
  __pyx_nb_add_8CyOpenGL_vector3, /*nb_add*/
  __pyx_nb_subtract_8CyOpenGL_vector3, /*nb_subtract*/
  __pyx_nb_multiply_8CyOpenGL_vector3, /*nb_multiply*/
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_bool*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  0, /*nb_int*/
  0, /*nb_long (reserved)*/
  0, /*nb_float*/
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  __pyx_nb_true_divide_8CyOpenGL_vector3, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  0, /*nb_index*/
  0, /*nb_matrix_multiply*/
  0, /*nb_inplace_matrix_multiply*/
};

static PyTypeObject __pyx_type_8CyOpenGL_vector3 = {
  PyVarObject_HEAD_INIT(0, 0)
  "CyOpenGL.""vector3", /*tp_name*/
  sizeof(struct __pyx_obj_8CyOpenGL_vector3), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8CyOpenGL_vector3, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  __pyx_pw_8CyOpenGL_7vector3_3__repr__, /*tp_repr*/
  &__pyx_tp_as_number_vector3, /*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*/
  PyDoc_STR("\n    A simple real 3-dimensional vector which supports addition,\n    subtraction and right multiplication or division by scalars.\n    Attributes include its norm and the square of its norm.\n    "), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_8CyOpenGL_vector3, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_8CyOpenGL_vector3, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_8CyOpenGL_vector3, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_8CyOpenGL_GLobject __pyx_vtable_8CyOpenGL_GLobject;

static PyObject *__pyx_tp_new_8CyOpenGL_GLobject(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_8CyOpenGL_GLobject *p;
  PyObject *o;
  o = __Pyx_AllocateExtensionType(t, 0);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_8CyOpenGL_GLobject *)o);
  p->__pyx_vtab = __pyx_vtabptr_8CyOpenGL_GLobject;
  p->togl_widget = Py_None; Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_8CyOpenGL_8GLobject_1__cinit__(o, a, k) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_8CyOpenGL_GLobject(PyObject *o) {
  struct __pyx_obj_8CyOpenGL_GLobject *p = (struct __pyx_obj_8CyOpenGL_GLobject *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_8CyOpenGL_GLobject) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->togl_widget);
  PyTypeObject *tp = Py_TYPE(o);
  #if CYTHON_USE_TYPE_SLOTS
  (*tp->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  Py_DECREF(tp);
  #endif
}

static int __pyx_tp_traverse_8CyOpenGL_GLobject(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8CyOpenGL_GLobject *p = (struct __pyx_obj_8CyOpenGL_GLobject *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->togl_widget) {
    e = (*v)(p->togl_widget, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_8CyOpenGL_GLobject(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_8CyOpenGL_GLobject *p = (struct __pyx_obj_8CyOpenGL_GLobject *)o;
  tmp = ((PyObject*)p->togl_widget);
  p->togl_widget = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_8CyOpenGL_GLobject[] = {
  {"delete_resource", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_8GLobject_3delete_resource, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_8GLobject_2delete_resource},
  {"draw", (PyCFunction)(void(*)(void))(PyCFunctionWithKeywords)__pyx_pw_8CyOpenGL_8GLobject_5draw, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8CyOpenGL_8GLobject_4draw},
  {"build_display_list", (PyCFunction)(void(*)(void))(PyCFunctionWithKeywords)__pyx_pw_8CyOpenGL_8GLobject_7build_display_list, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8CyOpenGL_8GLobject_6build_display_list},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_8CyOpenGL_GLobject_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8CyOpenGL_GLobject},
  {Py_tp_doc, (void *)PyDoc_STR("\n    Base class for the objects in our OpenGL scene.  Think of a\n    GLobject as a helper who knows how to draw a certain type of\n    geometrical object with specific color and material characteristics.\n    The geometrical characteristics, e.g. radius or vertex locations,\n    should be passed as arguments to the object's draw method.\n    ")},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_8CyOpenGL_GLobject},
  {Py_tp_clear, (void *)__pyx_tp_clear_8CyOpenGL_GLobject},
  {Py_tp_methods, (void *)__pyx_methods_8CyOpenGL_GLobject},
  {Py_tp_new, (void *)__pyx_tp_new_8CyOpenGL_GLobject},
  {0, 0},
};
static PyType_Spec __pyx_type_8CyOpenGL_GLobject_spec = {
  "CyOpenGL.GLobject",
  sizeof(struct __pyx_obj_8CyOpenGL_GLobject),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
  __pyx_type_8CyOpenGL_GLobject_slots,
};
#else

static PyTypeObject __pyx_type_8CyOpenGL_GLobject = {
  PyVarObject_HEAD_INIT(0, 0)
  "CyOpenGL.""GLobject", /*tp_name*/
  sizeof(struct __pyx_obj_8CyOpenGL_GLobject), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8CyOpenGL_GLobject, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  PyDoc_STR("\n    Base class for the objects in our OpenGL scene.  Think of a\n    GLobject as a helper who knows how to draw a certain type of\n    geometrical object with specific color and material characteristics.\n    The geometrical characteristics, e.g. radius or vertex locations,\n    should be passed as arguments to the object's draw method.\n    "), /*tp_doc*/
  __pyx_tp_traverse_8CyOpenGL_GLobject, /*tp_traverse*/
  __pyx_tp_clear_8CyOpenGL_GLobject, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_8CyOpenGL_GLobject, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_8CyOpenGL_GLobject, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_8CyOpenGL_WireframeSphere __pyx_vtable_8CyOpenGL_WireframeSphere;

static PyObject *__pyx_tp_new_8CyOpenGL_WireframeSphere(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_8CyOpenGL_WireframeSphere *p;
  PyObject *o = __pyx_tp_new_8CyOpenGL_GLobject(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_8CyOpenGL_WireframeSphere *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8CyOpenGL_GLobject*)__pyx_vtabptr_8CyOpenGL_WireframeSphere;
  return o;
}

static PyMethodDef __pyx_methods_8CyOpenGL_WireframeSphere[] = {
  {"draw", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_15WireframeSphere_1draw, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_15WireframeSphere_draw},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_8CyOpenGL_WireframeSphere_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8CyOpenGL_GLobject},
  {Py_tp_doc, (void *)PyDoc_STR("\n    A wireframe sphere.\n    ")},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_8CyOpenGL_GLobject},
  {Py_tp_clear, (void *)__pyx_tp_clear_8CyOpenGL_GLobject},
  {Py_tp_methods, (void *)__pyx_methods_8CyOpenGL_WireframeSphere},
  {Py_tp_new, (void *)__pyx_tp_new_8CyOpenGL_WireframeSphere},
  {0, 0},
};
static PyType_Spec __pyx_type_8CyOpenGL_WireframeSphere_spec = {
  "CyOpenGL.WireframeSphere",
  sizeof(struct __pyx_obj_8CyOpenGL_WireframeSphere),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
  __pyx_type_8CyOpenGL_WireframeSphere_slots,
};
#else

static PyTypeObject __pyx_type_8CyOpenGL_WireframeSphere = {
  PyVarObject_HEAD_INIT(0, 0)
  "CyOpenGL.""WireframeSphere", /*tp_name*/
  sizeof(struct __pyx_obj_8CyOpenGL_WireframeSphere), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8CyOpenGL_GLobject, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  PyDoc_STR("\n    A wireframe sphere.\n    "), /*tp_doc*/
  __pyx_tp_traverse_8CyOpenGL_GLobject, /*tp_traverse*/
  __pyx_tp_clear_8CyOpenGL_GLobject, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_8CyOpenGL_WireframeSphere, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_8CyOpenGL_WireframeSphere, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_8CyOpenGL_MeshedSurface __pyx_vtable_8CyOpenGL_MeshedSurface;

static PyObject *__pyx_tp_new_8CyOpenGL_MeshedSurface(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_8CyOpenGL_MeshedSurface *p;
  PyObject *o = __pyx_tp_new_8CyOpenGL_GLobject(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_8CyOpenGL_MeshedSurface *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8CyOpenGL_GLobject*)__pyx_vtabptr_8CyOpenGL_MeshedSurface;
  p->vertices = Py_None; Py_INCREF(Py_None);
  p->normals = Py_None; Py_INCREF(Py_None);
  p->triangles = Py_None; Py_INCREF(Py_None);
  p->count = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_8CyOpenGL_MeshedSurface(PyObject *o) {
  struct __pyx_obj_8CyOpenGL_MeshedSurface *p = (struct __pyx_obj_8CyOpenGL_MeshedSurface *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_8CyOpenGL_MeshedSurface) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    __Pyx_DeallocKeepAliveBegin(o);
    __pyx_pw_8CyOpenGL_13MeshedSurface_1__dealloc__(o);
    __Pyx_DeallocKeepAliveEnd(o);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->vertices);
  Py_CLEAR(p->normals);
  Py_CLEAR(p->triangles);
  Py_CLEAR(p->count);
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_8CyOpenGL_GLobject(o);
}

static int __pyx_tp_traverse_8CyOpenGL_MeshedSurface(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8CyOpenGL_MeshedSurface *p = (struct __pyx_obj_8CyOpenGL_MeshedSurface *)o;
  e = __pyx_tp_traverse_8CyOpenGL_GLobject(o, v, a); if (e) return e;
  if (p->vertices) {
    e = (*v)(p->vertices, a); if (e) return e;
  }
  if (p->normals) {
    e = (*v)(p->normals, a); if (e) return e;
  }
  if (p->triangles) {
    e = (*v)(p->triangles, a); if (e) return e;
  }
  if (p->count) {
    e = (*v)(p->count, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_8CyOpenGL_MeshedSurface(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_8CyOpenGL_MeshedSurface *p = (struct __pyx_obj_8CyOpenGL_MeshedSurface *)o;
  __pyx_tp_clear_8CyOpenGL_GLobject(o);
  tmp = ((PyObject*)p->vertices);
  p->vertices = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->normals);
  p->normals = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->triangles);
  p->triangles = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->count);
  p->count = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_8CyOpenGL_MeshedSurface[] = {
  {"build_arrays", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_13MeshedSurface_3build_arrays, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_13MeshedSurface_2build_arrays},
  {"draw", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_13MeshedSurface_5draw, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_13MeshedSurface_4draw},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_8CyOpenGL_MeshedSurface_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8CyOpenGL_MeshedSurface},
  {Py_tp_doc, (void *)PyDoc_STR("\n    An object made out of a triangular mesh. See the subclass\n    Horosphere below for a typical example.\n    ")},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_8CyOpenGL_MeshedSurface},
  {Py_tp_clear, (void *)__pyx_tp_clear_8CyOpenGL_MeshedSurface},
  {Py_tp_methods, (void *)__pyx_methods_8CyOpenGL_MeshedSurface},
  {Py_tp_new, (void *)__pyx_tp_new_8CyOpenGL_MeshedSurface},
  {0, 0},
};
static PyType_Spec __pyx_type_8CyOpenGL_MeshedSurface_spec = {
  "CyOpenGL.MeshedSurface",
  sizeof(struct __pyx_obj_8CyOpenGL_MeshedSurface),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
  __pyx_type_8CyOpenGL_MeshedSurface_slots,
};
#else

static PyTypeObject __pyx_type_8CyOpenGL_MeshedSurface = {
  PyVarObject_HEAD_INIT(0, 0)
  "CyOpenGL.""MeshedSurface", /*tp_name*/
  sizeof(struct __pyx_obj_8CyOpenGL_MeshedSurface), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8CyOpenGL_MeshedSurface, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  PyDoc_STR("\n    An object made out of a triangular mesh. See the subclass\n    Horosphere below for a typical example.\n    "), /*tp_doc*/
  __pyx_tp_traverse_8CyOpenGL_MeshedSurface, /*tp_traverse*/
  __pyx_tp_clear_8CyOpenGL_MeshedSurface, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_8CyOpenGL_MeshedSurface, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_8CyOpenGL_MeshedSurface, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_8CyOpenGL_PoincareTriangle __pyx_vtable_8CyOpenGL_PoincareTriangle;

static PyObject *__pyx_tp_new_8CyOpenGL_PoincareTriangle(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_8CyOpenGL_PoincareTriangle *p;
  PyObject *o = __pyx_tp_new_8CyOpenGL_MeshedSurface(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_8CyOpenGL_PoincareTriangle *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8CyOpenGL_GLobject*)__pyx_vtabptr_8CyOpenGL_PoincareTriangle;
  p->center = Py_None; Py_INCREF(Py_None);
  p->mesh = Py_None; Py_INCREF(Py_None);
  p->original_vertices = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_8CyOpenGL_PoincareTriangle(PyObject *o) {
  struct __pyx_obj_8CyOpenGL_PoincareTriangle *p = (struct __pyx_obj_8CyOpenGL_PoincareTriangle *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_8CyOpenGL_PoincareTriangle) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->center);
  Py_CLEAR(p->mesh);
  Py_CLEAR(p->original_vertices);
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_8CyOpenGL_MeshedSurface(o);
}

static int __pyx_tp_traverse_8CyOpenGL_PoincareTriangle(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8CyOpenGL_PoincareTriangle *p = (struct __pyx_obj_8CyOpenGL_PoincareTriangle *)o;
  e = __pyx_tp_traverse_8CyOpenGL_MeshedSurface(o, v, a); if (e) return e;
  if (p->center) {
    e = (*v)(p->center, a); if (e) return e;
  }
  if (p->mesh) {
    e = (*v)(p->mesh, a); if (e) return e;
  }
  if (p->original_vertices) {
    e = (*v)(p->original_vertices, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_8CyOpenGL_PoincareTriangle(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_8CyOpenGL_PoincareTriangle *p = (struct __pyx_obj_8CyOpenGL_PoincareTriangle *)o;
  __pyx_tp_clear_8CyOpenGL_MeshedSurface(o);
  tmp = ((PyObject*)p->center);
  p->center = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->mesh);
  p->mesh = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->original_vertices);
  p->original_vertices = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_8CyOpenGL_PoincareTriangle[] = {
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_8CyOpenGL_PoincareTriangle_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8CyOpenGL_PoincareTriangle},
  {Py_tp_doc, (void *)PyDoc_STR("PoincareTriangle(vertices, center, subdivision_depth=4, **kwargs)\n\nA geodesic triangle in the Poincare model.  The geometric\nparameters are the vertex coordinates in the Klein model plus the\ncoordinates of the center of the sphere which represents the plane\nof the triangle in the Poincare model.  The Poincare vertices are\nconstructed by projecting the Klein vertices onto the sphere from\nthe center.\n\nThe triangle is drawn as a mesh, using vertex and index arrays.")},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_8CyOpenGL_PoincareTriangle},
  {Py_tp_clear, (void *)__pyx_tp_clear_8CyOpenGL_PoincareTriangle},
  {Py_tp_methods, (void *)__pyx_methods_8CyOpenGL_PoincareTriangle},
  {Py_tp_init, (void *)__pyx_pw_8CyOpenGL_16PoincareTriangle_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_8CyOpenGL_PoincareTriangle},
  {0, 0},
};
static PyType_Spec __pyx_type_8CyOpenGL_PoincareTriangle_spec = {
  "CyOpenGL.PoincareTriangle",
  sizeof(struct __pyx_obj_8CyOpenGL_PoincareTriangle),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
  __pyx_type_8CyOpenGL_PoincareTriangle_slots,
};
#else

static PyTypeObject __pyx_type_8CyOpenGL_PoincareTriangle = {
  PyVarObject_HEAD_INIT(0, 0)
  "CyOpenGL.""PoincareTriangle", /*tp_name*/
  sizeof(struct __pyx_obj_8CyOpenGL_PoincareTriangle), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8CyOpenGL_PoincareTriangle, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  PyDoc_STR("PoincareTriangle(vertices, center, subdivision_depth=4, **kwargs)\n\nA geodesic triangle in the Poincare model.  The geometric\nparameters are the vertex coordinates in the Klein model plus the\ncoordinates of the center of the sphere which represents the plane\nof the triangle in the Poincare model.  The Poincare vertices are\nconstructed by projecting the Klein vertices onto the sphere from\nthe center.\n\nThe triangle is drawn as a mesh, using vertex and index arrays."), /*tp_doc*/
  __pyx_tp_traverse_8CyOpenGL_PoincareTriangle, /*tp_traverse*/
  __pyx_tp_clear_8CyOpenGL_PoincareTriangle, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_8CyOpenGL_PoincareTriangle, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_8CyOpenGL_16PoincareTriangle_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_8CyOpenGL_PoincareTriangle, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_8CyOpenGL_PoincarePolygon __pyx_vtable_8CyOpenGL_PoincarePolygon;

static PyObject *__pyx_tp_new_8CyOpenGL_PoincarePolygon(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_8CyOpenGL_PoincarePolygon *p;
  PyObject *o = __pyx_tp_new_8CyOpenGL_GLobject(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_8CyOpenGL_PoincarePolygon *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8CyOpenGL_GLobject*)__pyx_vtabptr_8CyOpenGL_PoincarePolygon;
  p->vertices = Py_None; Py_INCREF(Py_None);
  p->center = Py_None; Py_INCREF(Py_None);
  p->triangles = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_8CyOpenGL_PoincarePolygon(PyObject *o) {
  struct __pyx_obj_8CyOpenGL_PoincarePolygon *p = (struct __pyx_obj_8CyOpenGL_PoincarePolygon *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_8CyOpenGL_PoincarePolygon) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->vertices);
  Py_CLEAR(p->center);
  Py_CLEAR(p->triangles);
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_8CyOpenGL_GLobject(o);
}

static int __pyx_tp_traverse_8CyOpenGL_PoincarePolygon(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8CyOpenGL_PoincarePolygon *p = (struct __pyx_obj_8CyOpenGL_PoincarePolygon *)o;
  e = __pyx_tp_traverse_8CyOpenGL_GLobject(o, v, a); if (e) return e;
  if (p->vertices) {
    e = (*v)(p->vertices, a); if (e) return e;
  }
  if (p->center) {
    e = (*v)(p->center, a); if (e) return e;
  }
  if (p->triangles) {
    e = (*v)(p->triangles, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_8CyOpenGL_PoincarePolygon(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_8CyOpenGL_PoincarePolygon *p = (struct __pyx_obj_8CyOpenGL_PoincarePolygon *)o;
  __pyx_tp_clear_8CyOpenGL_GLobject(o);
  tmp = ((PyObject*)p->vertices);
  p->vertices = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->center);
  p->center = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->triangles);
  p->triangles = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_8CyOpenGL_PoincarePolygon[] = {
  {"draw", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_15PoincarePolygon_3draw, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_15PoincarePolygon_2draw},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_8CyOpenGL_PoincarePolygon_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8CyOpenGL_PoincarePolygon},
  {Py_tp_doc, (void *)PyDoc_STR("PoincarePolygon(vertices, center, **kwargs)\n\nA geodesic polygon in the Poincare model. The geometric parameters\nare the vertex coordinates in the Klein model plus the coordinates\nof the center of the sphere which represents the plane of the\ntriangle in the Poincare model.  The polygon is drawn by\nsubdividing into Poincare Triangles by coning from the barycenter,\nthen drawing each triangle.")},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_8CyOpenGL_PoincarePolygon},
  {Py_tp_clear, (void *)__pyx_tp_clear_8CyOpenGL_PoincarePolygon},
  {Py_tp_methods, (void *)__pyx_methods_8CyOpenGL_PoincarePolygon},
  {Py_tp_init, (void *)__pyx_pw_8CyOpenGL_15PoincarePolygon_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_8CyOpenGL_PoincarePolygon},
  {0, 0},
};
static PyType_Spec __pyx_type_8CyOpenGL_PoincarePolygon_spec = {
  "CyOpenGL.PoincarePolygon",
  sizeof(struct __pyx_obj_8CyOpenGL_PoincarePolygon),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
  __pyx_type_8CyOpenGL_PoincarePolygon_slots,
};
#else

static PyTypeObject __pyx_type_8CyOpenGL_PoincarePolygon = {
  PyVarObject_HEAD_INIT(0, 0)
  "CyOpenGL.""PoincarePolygon", /*tp_name*/
  sizeof(struct __pyx_obj_8CyOpenGL_PoincarePolygon), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8CyOpenGL_PoincarePolygon, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  PyDoc_STR("PoincarePolygon(vertices, center, **kwargs)\n\nA geodesic polygon in the Poincare model. The geometric parameters\nare the vertex coordinates in the Klein model plus the coordinates\nof the center of the sphere which represents the plane of the\ntriangle in the Poincare model.  The polygon is drawn by\nsubdividing into Poincare Triangles by coning from the barycenter,\nthen drawing each triangle."), /*tp_doc*/
  __pyx_tp_traverse_8CyOpenGL_PoincarePolygon, /*tp_traverse*/
  __pyx_tp_clear_8CyOpenGL_PoincarePolygon, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_8CyOpenGL_PoincarePolygon, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_8CyOpenGL_15PoincarePolygon_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_8CyOpenGL_PoincarePolygon, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_8CyOpenGL_KleinPolygon __pyx_vtable_8CyOpenGL_KleinPolygon;

static PyObject *__pyx_tp_new_8CyOpenGL_KleinPolygon(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_8CyOpenGL_KleinPolygon *p;
  PyObject *o = __pyx_tp_new_8CyOpenGL_GLobject(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_8CyOpenGL_KleinPolygon *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8CyOpenGL_GLobject*)__pyx_vtabptr_8CyOpenGL_KleinPolygon;
  p->vertices = Py_None; Py_INCREF(Py_None);
  p->closest = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_8CyOpenGL_KleinPolygon(PyObject *o) {
  struct __pyx_obj_8CyOpenGL_KleinPolygon *p = (struct __pyx_obj_8CyOpenGL_KleinPolygon *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_8CyOpenGL_KleinPolygon) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->vertices);
  Py_CLEAR(p->closest);
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_8CyOpenGL_GLobject(o);
}

static int __pyx_tp_traverse_8CyOpenGL_KleinPolygon(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8CyOpenGL_KleinPolygon *p = (struct __pyx_obj_8CyOpenGL_KleinPolygon *)o;
  e = __pyx_tp_traverse_8CyOpenGL_GLobject(o, v, a); if (e) return e;
  if (p->vertices) {
    e = (*v)(p->vertices, a); if (e) return e;
  }
  if (p->closest) {
    e = (*v)(p->closest, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_8CyOpenGL_KleinPolygon(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_8CyOpenGL_KleinPolygon *p = (struct __pyx_obj_8CyOpenGL_KleinPolygon *)o;
  __pyx_tp_clear_8CyOpenGL_GLobject(o);
  tmp = ((PyObject*)p->vertices);
  p->vertices = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->closest);
  p->closest = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_8CyOpenGL_KleinPolygon[] = {
  {"draw", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_12KleinPolygon_3draw, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_12KleinPolygon_2draw},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_8CyOpenGL_KleinPolygon_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8CyOpenGL_KleinPolygon},
  {Py_tp_doc, (void *)PyDoc_STR("KleinPolygon(vertices, closest, **kwargs)\n\nA geodesic polygon in the Klein model. The geometric parameters\nare the vertex coordinates in the Klein model plus the coordinates\nof the nearest point to origin which lies on the plane containing\nthe polygon.  The polygon is drawn as an OpenGL Polygon.")},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_8CyOpenGL_KleinPolygon},
  {Py_tp_clear, (void *)__pyx_tp_clear_8CyOpenGL_KleinPolygon},
  {Py_tp_methods, (void *)__pyx_methods_8CyOpenGL_KleinPolygon},
  {Py_tp_init, (void *)__pyx_pw_8CyOpenGL_12KleinPolygon_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_8CyOpenGL_KleinPolygon},
  {0, 0},
};
static PyType_Spec __pyx_type_8CyOpenGL_KleinPolygon_spec = {
  "CyOpenGL.KleinPolygon",
  sizeof(struct __pyx_obj_8CyOpenGL_KleinPolygon),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
  __pyx_type_8CyOpenGL_KleinPolygon_slots,
};
#else

static PyTypeObject __pyx_type_8CyOpenGL_KleinPolygon = {
  PyVarObject_HEAD_INIT(0, 0)
  "CyOpenGL.""KleinPolygon", /*tp_name*/
  sizeof(struct __pyx_obj_8CyOpenGL_KleinPolygon), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8CyOpenGL_KleinPolygon, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  PyDoc_STR("KleinPolygon(vertices, closest, **kwargs)\n\nA geodesic polygon in the Klein model. The geometric parameters\nare the vertex coordinates in the Klein model plus the coordinates\nof the nearest point to origin which lies on the plane containing\nthe polygon.  The polygon is drawn as an OpenGL Polygon."), /*tp_doc*/
  __pyx_tp_traverse_8CyOpenGL_KleinPolygon, /*tp_traverse*/
  __pyx_tp_clear_8CyOpenGL_KleinPolygon, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_8CyOpenGL_KleinPolygon, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_8CyOpenGL_12KleinPolygon_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_8CyOpenGL_KleinPolygon, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_8CyOpenGL_Colorizer __pyx_vtable_8CyOpenGL_Colorizer;

static PyObject *__pyx_tp_new_8CyOpenGL_Colorizer(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_8CyOpenGL_Colorizer *p;
  PyObject *o;
  o = __Pyx_AllocateExtensionType(t, 0);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_8CyOpenGL_Colorizer *)o);
  p->__pyx_vtab = __pyx_vtabptr_8CyOpenGL_Colorizer;
  if (unlikely(__pyx_pw_8CyOpenGL_9Colorizer_1__cinit__(o, __pyx_mstate_global->__pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_8CyOpenGL_Colorizer(PyObject *o) {
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_8CyOpenGL_Colorizer) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyTypeObject *tp = Py_TYPE(o);
  #if CYTHON_USE_TYPE_SLOTS
  (*tp->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  Py_DECREF(tp);
  #endif
}

static PyMethodDef __pyx_methods_8CyOpenGL_Colorizer[] = {
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_8CyOpenGL_Colorizer_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8CyOpenGL_Colorizer},
  {Py_tp_call, (void *)__pyx_pw_8CyOpenGL_9Colorizer_5__call__},
  {Py_tp_doc, (void *)PyDoc_STR("Colorizer(lightness=0.6, saturation=0.9, alpha=0.8)\n\nCallable class which returns a color when passed an index.\nUses the same algorithm as the SnapPea kernel.")},
  {Py_tp_methods, (void *)__pyx_methods_8CyOpenGL_Colorizer},
  {Py_tp_init, (void *)__pyx_pw_8CyOpenGL_9Colorizer_3__init__},
  {Py_tp_new, (void *)__pyx_tp_new_8CyOpenGL_Colorizer},
  {0, 0},
};
static PyType_Spec __pyx_type_8CyOpenGL_Colorizer_spec = {
  "CyOpenGL.Colorizer",
  sizeof(struct __pyx_obj_8CyOpenGL_Colorizer),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_8CyOpenGL_Colorizer_slots,
};
#else

static PyTypeObject __pyx_type_8CyOpenGL_Colorizer = {
  PyVarObject_HEAD_INIT(0, 0)
  "CyOpenGL.""Colorizer", /*tp_name*/
  sizeof(struct __pyx_obj_8CyOpenGL_Colorizer), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8CyOpenGL_Colorizer, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  __pyx_pw_8CyOpenGL_9Colorizer_5__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, /*tp_flags*/
  PyDoc_STR("Colorizer(lightness=0.6, saturation=0.9, alpha=0.8)\n\nCallable class which returns a color when passed an index.\nUses the same algorithm as the SnapPea kernel."), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_8CyOpenGL_Colorizer, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_8CyOpenGL_9Colorizer_3__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_8CyOpenGL_Colorizer, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_8CyOpenGL_Horosphere __pyx_vtable_8CyOpenGL_Horosphere;

static PyObject *__pyx_tp_new_8CyOpenGL_Horosphere(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_8CyOpenGL_Horosphere *p;
  PyObject *o = __pyx_tp_new_8CyOpenGL_MeshedSurface(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_8CyOpenGL_Horosphere *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8CyOpenGL_GLobject*)__pyx_vtabptr_8CyOpenGL_Horosphere;
  return o;
}

static PyMethodDef __pyx_methods_8CyOpenGL_Horosphere[] = {
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_8CyOpenGL_Horosphere_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8CyOpenGL_MeshedSurface},
  {Py_tp_doc, (void *)PyDoc_STR("Horosphere(color=[0.8, 0.0, 0.0, 0.3], radius=1.0, front_specular=[0.8, 0.8, 0.8, 1.0], back_specular=[0.8, 0.8, 0.8, 1.0], front_shininess=50.0, back_shininess=0.0)\n\nA horosphere.")},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_8CyOpenGL_MeshedSurface},
  {Py_tp_clear, (void *)__pyx_tp_clear_8CyOpenGL_MeshedSurface},
  {Py_tp_methods, (void *)__pyx_methods_8CyOpenGL_Horosphere},
  {Py_tp_init, (void *)__pyx_pw_8CyOpenGL_10Horosphere_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_8CyOpenGL_Horosphere},
  {0, 0},
};
static PyType_Spec __pyx_type_8CyOpenGL_Horosphere_spec = {
  "CyOpenGL.Horosphere",
  sizeof(struct __pyx_obj_8CyOpenGL_Horosphere),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
  __pyx_type_8CyOpenGL_Horosphere_slots,
};
#else

static PyTypeObject __pyx_type_8CyOpenGL_Horosphere = {
  PyVarObject_HEAD_INIT(0, 0)
  "CyOpenGL.""Horosphere", /*tp_name*/
  sizeof(struct __pyx_obj_8CyOpenGL_Horosphere), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8CyOpenGL_MeshedSurface, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  PyDoc_STR("Horosphere(color=[0.8, 0.0, 0.0, 0.3], radius=1.0, front_specular=[0.8, 0.8, 0.8, 1.0], back_specular=[0.8, 0.8, 0.8, 1.0], front_shininess=50.0, back_shininess=0.0)\n\nA horosphere."), /*tp_doc*/
  __pyx_tp_traverse_8CyOpenGL_MeshedSurface, /*tp_traverse*/
  __pyx_tp_clear_8CyOpenGL_MeshedSurface, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_8CyOpenGL_Horosphere, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_8CyOpenGL_10Horosphere_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_8CyOpenGL_Horosphere, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_8CyOpenGL_HoroballGroup __pyx_vtable_8CyOpenGL_HoroballGroup;

static PyObject *__pyx_tp_new_8CyOpenGL_HoroballGroup(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_8CyOpenGL_HoroballGroup *p;
  PyObject *o = __pyx_tp_new_8CyOpenGL_GLobject(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_8CyOpenGL_HoroballGroup *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8CyOpenGL_GLobject*)__pyx_vtabptr_8CyOpenGL_HoroballGroup;
  p->horoballs = Py_None; Py_INCREF(Py_None);
  p->meridian = Py_None; Py_INCREF(Py_None);
  p->longitude = Py_None; Py_INCREF(Py_None);
  p->keys = Py_None; Py_INCREF(Py_None);
  p->centers = Py_None; Py_INCREF(Py_None);
  p->spheres = Py_None; Py_INCREF(Py_None);
  p->original_indices = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_8CyOpenGL_HoroballGroup(PyObject *o) {
  struct __pyx_obj_8CyOpenGL_HoroballGroup *p = (struct __pyx_obj_8CyOpenGL_HoroballGroup *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_8CyOpenGL_HoroballGroup) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->horoballs);
  Py_CLEAR(p->meridian);
  Py_CLEAR(p->longitude);
  Py_CLEAR(p->keys);
  Py_CLEAR(p->centers);
  Py_CLEAR(p->spheres);
  Py_CLEAR(p->original_indices);
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_8CyOpenGL_GLobject(o);
}

static int __pyx_tp_traverse_8CyOpenGL_HoroballGroup(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8CyOpenGL_HoroballGroup *p = (struct __pyx_obj_8CyOpenGL_HoroballGroup *)o;
  e = __pyx_tp_traverse_8CyOpenGL_GLobject(o, v, a); if (e) return e;
  if (p->horoballs) {
    e = (*v)(p->horoballs, a); if (e) return e;
  }
  if (p->meridian) {
    e = (*v)(p->meridian, a); if (e) return e;
  }
  if (p->longitude) {
    e = (*v)(p->longitude, a); if (e) return e;
  }
  if (p->keys) {
    e = (*v)(p->keys, a); if (e) return e;
  }
  if (p->centers) {
    e = (*v)(p->centers, a); if (e) return e;
  }
  if (p->spheres) {
    e = (*v)(p->spheres, a); if (e) return e;
  }
  if (p->original_indices) {
    e = (*v)(p->original_indices, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_8CyOpenGL_HoroballGroup(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_8CyOpenGL_HoroballGroup *p = (struct __pyx_obj_8CyOpenGL_HoroballGroup *)o;
  __pyx_tp_clear_8CyOpenGL_GLobject(o);
  tmp = ((PyObject*)p->horoballs);
  p->horoballs = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->meridian);
  p->meridian = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->longitude);
  p->longitude = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->keys);
  p->keys = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->centers);
  p->centers = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->spheres);
  p->spheres = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->original_indices);
  p->original_indices = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_8CyOpenGL_HoroballGroup[] = {
  {"draw", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_13HoroballGroup_3draw, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_13HoroballGroup_2draw},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_8CyOpenGL_HoroballGroup_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8CyOpenGL_HoroballGroup},
  {Py_tp_doc, (void *)PyDoc_STR("HoroballGroup(horoballs, indices, meridian, longitude)\n\nA fundamental set of horoballs for a single cusp.  The paremeters\nR and T for the draw method are the coordinates of the right top\ncorner of the visible rectangle with margins.  For each horoball,\nall meridian and longitude translations centered in the rectangle\nare drawn.")},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_8CyOpenGL_HoroballGroup},
  {Py_tp_clear, (void *)__pyx_tp_clear_8CyOpenGL_HoroballGroup},
  {Py_tp_methods, (void *)__pyx_methods_8CyOpenGL_HoroballGroup},
  {Py_tp_init, (void *)__pyx_pw_8CyOpenGL_13HoroballGroup_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_8CyOpenGL_HoroballGroup},
  {0, 0},
};
static PyType_Spec __pyx_type_8CyOpenGL_HoroballGroup_spec = {
  "CyOpenGL.HoroballGroup",
  sizeof(struct __pyx_obj_8CyOpenGL_HoroballGroup),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
  __pyx_type_8CyOpenGL_HoroballGroup_slots,
};
#else

static PyTypeObject __pyx_type_8CyOpenGL_HoroballGroup = {
  PyVarObject_HEAD_INIT(0, 0)
  "CyOpenGL.""HoroballGroup", /*tp_name*/
  sizeof(struct __pyx_obj_8CyOpenGL_HoroballGroup), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8CyOpenGL_HoroballGroup, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  PyDoc_STR("HoroballGroup(horoballs, indices, meridian, longitude)\n\nA fundamental set of horoballs for a single cusp.  The paremeters\nR and T for the draw method are the coordinates of the right top\ncorner of the visible rectangle with margins.  For each horoball,\nall meridian and longitude translations centered in the rectangle\nare drawn."), /*tp_doc*/
  __pyx_tp_traverse_8CyOpenGL_HoroballGroup, /*tp_traverse*/
  __pyx_tp_clear_8CyOpenGL_HoroballGroup, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_8CyOpenGL_HoroballGroup, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_8CyOpenGL_13HoroballGroup_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_8CyOpenGL_HoroballGroup, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_8CyOpenGL_Parallelogram __pyx_vtable_8CyOpenGL_Parallelogram;

static PyObject *__pyx_tp_new_8CyOpenGL_Parallelogram(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_8CyOpenGL_Parallelogram *p;
  PyObject *o = __pyx_tp_new_8CyOpenGL_GLobject(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_8CyOpenGL_Parallelogram *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8CyOpenGL_GLobject*)__pyx_vtabptr_8CyOpenGL_Parallelogram;
  return o;
}

static PyMethodDef __pyx_methods_8CyOpenGL_Parallelogram[] = {
  {"draw", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_13Parallelogram_1draw, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_13Parallelogram_draw},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_8CyOpenGL_Parallelogram_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8CyOpenGL_GLobject},
  {Py_tp_doc, (void *)PyDoc_STR("\n    A parallelogram on the xy-plane centered at (0,0). The geometric\n    parameters are complex numbers corresponding to the two side vectors.\n    ")},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_8CyOpenGL_GLobject},
  {Py_tp_clear, (void *)__pyx_tp_clear_8CyOpenGL_GLobject},
  {Py_tp_methods, (void *)__pyx_methods_8CyOpenGL_Parallelogram},
  {Py_tp_new, (void *)__pyx_tp_new_8CyOpenGL_Parallelogram},
  {0, 0},
};
static PyType_Spec __pyx_type_8CyOpenGL_Parallelogram_spec = {
  "CyOpenGL.Parallelogram",
  sizeof(struct __pyx_obj_8CyOpenGL_Parallelogram),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
  __pyx_type_8CyOpenGL_Parallelogram_slots,
};
#else

static PyTypeObject __pyx_type_8CyOpenGL_Parallelogram = {
  PyVarObject_HEAD_INIT(0, 0)
  "CyOpenGL.""Parallelogram", /*tp_name*/
  sizeof(struct __pyx_obj_8CyOpenGL_Parallelogram), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8CyOpenGL_GLobject, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  PyDoc_STR("\n    A parallelogram on the xy-plane centered at (0,0). The geometric\n    parameters are complex numbers corresponding to the two side vectors.\n    "), /*tp_doc*/
  __pyx_tp_traverse_8CyOpenGL_GLobject, /*tp_traverse*/
  __pyx_tp_clear_8CyOpenGL_GLobject, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_8CyOpenGL_Parallelogram, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_8CyOpenGL_Parallelogram, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_8CyOpenGL_EdgeSet __pyx_vtable_8CyOpenGL_EdgeSet;

static PyObject *__pyx_tp_new_8CyOpenGL_EdgeSet(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_8CyOpenGL_EdgeSet *p;
  PyObject *o = __pyx_tp_new_8CyOpenGL_GLobject(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_8CyOpenGL_EdgeSet *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8CyOpenGL_GLobject*)__pyx_vtabptr_8CyOpenGL_EdgeSet;
  p->segments = Py_None; Py_INCREF(Py_None);
  p->longitude = Py_None; Py_INCREF(Py_None);
  p->meridian = Py_None; Py_INCREF(Py_None);
  p->stipple = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_8CyOpenGL_EdgeSet(PyObject *o) {
  struct __pyx_obj_8CyOpenGL_EdgeSet *p = (struct __pyx_obj_8CyOpenGL_EdgeSet *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_8CyOpenGL_EdgeSet) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->segments);
  Py_CLEAR(p->longitude);
  Py_CLEAR(p->meridian);
  Py_CLEAR(p->stipple);
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_8CyOpenGL_GLobject(o);
}

static int __pyx_tp_traverse_8CyOpenGL_EdgeSet(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8CyOpenGL_EdgeSet *p = (struct __pyx_obj_8CyOpenGL_EdgeSet *)o;
  e = __pyx_tp_traverse_8CyOpenGL_GLobject(o, v, a); if (e) return e;
  if (p->segments) {
    e = (*v)(p->segments, a); if (e) return e;
  }
  if (p->longitude) {
    e = (*v)(p->longitude, a); if (e) return e;
  }
  if (p->meridian) {
    e = (*v)(p->meridian, a); if (e) return e;
  }
  if (p->stipple) {
    e = (*v)(p->stipple, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_8CyOpenGL_EdgeSet(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_8CyOpenGL_EdgeSet *p = (struct __pyx_obj_8CyOpenGL_EdgeSet *)o;
  __pyx_tp_clear_8CyOpenGL_GLobject(o);
  tmp = ((PyObject*)p->segments);
  p->segments = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->longitude);
  p->longitude = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->meridian);
  p->meridian = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->stipple);
  p->stipple = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_8CyOpenGL_EdgeSet[] = {
  {"draw", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_7EdgeSet_3draw, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_7EdgeSet_2draw},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_8CyOpenGL_EdgeSet_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8CyOpenGL_EdgeSet},
  {Py_tp_doc, (void *)PyDoc_STR("EdgeSet(segments, longitude, meridian, togl_widget=None)\n\nBase class for collections of segments to be drawn into a\nhoroball scene.\n\nThe geometric parameter for the draw method is a list\nof shifts (M,L), meaning that each segment should be drawn\ntranslated by M meridians and L longitudes.")},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_8CyOpenGL_EdgeSet},
  {Py_tp_clear, (void *)__pyx_tp_clear_8CyOpenGL_EdgeSet},
  {Py_tp_methods, (void *)__pyx_methods_8CyOpenGL_EdgeSet},
  {Py_tp_init, (void *)__pyx_pw_8CyOpenGL_7EdgeSet_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_8CyOpenGL_EdgeSet},
  {0, 0},
};
static PyType_Spec __pyx_type_8CyOpenGL_EdgeSet_spec = {
  "CyOpenGL.EdgeSet",
  sizeof(struct __pyx_obj_8CyOpenGL_EdgeSet),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
  __pyx_type_8CyOpenGL_EdgeSet_slots,
};
#else

static PyTypeObject __pyx_type_8CyOpenGL_EdgeSet = {
  PyVarObject_HEAD_INIT(0, 0)
  "CyOpenGL.""EdgeSet", /*tp_name*/
  sizeof(struct __pyx_obj_8CyOpenGL_EdgeSet), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8CyOpenGL_EdgeSet, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  PyDoc_STR("EdgeSet(segments, longitude, meridian, togl_widget=None)\n\nBase class for collections of segments to be drawn into a\nhoroball scene.\n\nThe geometric parameter for the draw method is a list\nof shifts (M,L), meaning that each segment should be drawn\ntranslated by M meridians and L longitudes."), /*tp_doc*/
  __pyx_tp_traverse_8CyOpenGL_EdgeSet, /*tp_traverse*/
  __pyx_tp_clear_8CyOpenGL_EdgeSet, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_8CyOpenGL_EdgeSet, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_8CyOpenGL_7EdgeSet_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_8CyOpenGL_EdgeSet, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_8CyOpenGL_FordEdgeSet __pyx_vtable_8CyOpenGL_FordEdgeSet;

static PyObject *__pyx_tp_new_8CyOpenGL_FordEdgeSet(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_8CyOpenGL_FordEdgeSet *p;
  PyObject *o = __pyx_tp_new_8CyOpenGL_EdgeSet(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_8CyOpenGL_FordEdgeSet *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8CyOpenGL_GLobject*)__pyx_vtabptr_8CyOpenGL_FordEdgeSet;
  return o;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_8CyOpenGL_FordEdgeSet_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8CyOpenGL_EdgeSet},
  {Py_tp_doc, (void *)PyDoc_STR("\n    A fundamental set of edges for the component of the Ford domain\n    associated to a given cusp, projected to the xy-plane in upper\n    half-space.\n    ")},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_8CyOpenGL_EdgeSet},
  {Py_tp_clear, (void *)__pyx_tp_clear_8CyOpenGL_EdgeSet},
  {Py_tp_new, (void *)__pyx_tp_new_8CyOpenGL_FordEdgeSet},
  {0, 0},
};
static PyType_Spec __pyx_type_8CyOpenGL_FordEdgeSet_spec = {
  "CyOpenGL.FordEdgeSet",
  sizeof(struct __pyx_obj_8CyOpenGL_FordEdgeSet),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
  __pyx_type_8CyOpenGL_FordEdgeSet_slots,
};
#else

static PyTypeObject __pyx_type_8CyOpenGL_FordEdgeSet = {
  PyVarObject_HEAD_INIT(0, 0)
  "CyOpenGL.""FordEdgeSet", /*tp_name*/
  sizeof(struct __pyx_obj_8CyOpenGL_FordEdgeSet), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8CyOpenGL_EdgeSet, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  PyDoc_STR("\n    A fundamental set of edges for the component of the Ford domain\n    associated to a given cusp, projected to the xy-plane in upper\n    half-space.\n    "), /*tp_doc*/
  __pyx_tp_traverse_8CyOpenGL_EdgeSet, /*tp_traverse*/
  __pyx_tp_clear_8CyOpenGL_EdgeSet, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY || 0
  __pyx_pw_8CyOpenGL_7EdgeSet_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_8CyOpenGL_FordEdgeSet, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_8CyOpenGL_TriangulationEdgeSet __pyx_vtable_8CyOpenGL_TriangulationEdgeSet;

static PyObject *__pyx_tp_new_8CyOpenGL_TriangulationEdgeSet(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_8CyOpenGL_TriangulationEdgeSet *p;
  PyObject *o = __pyx_tp_new_8CyOpenGL_EdgeSet(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_8CyOpenGL_TriangulationEdgeSet *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8CyOpenGL_GLobject*)__pyx_vtabptr_8CyOpenGL_TriangulationEdgeSet;
  return o;
}

static PyMethodDef __pyx_methods_8CyOpenGL_TriangulationEdgeSet[] = {
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_8CyOpenGL_TriangulationEdgeSet_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8CyOpenGL_EdgeSet},
  {Py_tp_doc, (void *)PyDoc_STR("TriangulationEdgeSet(triangulation, longitude, meridian, togl_widget=None)\n\nA fundamental set of edges for the 1-skeleton of the canonical\ntriangulation dual to the Ford domain, projected to the\nxy-plane in upper half-space.")},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_8CyOpenGL_EdgeSet},
  {Py_tp_clear, (void *)__pyx_tp_clear_8CyOpenGL_EdgeSet},
  {Py_tp_methods, (void *)__pyx_methods_8CyOpenGL_TriangulationEdgeSet},
  {Py_tp_init, (void *)__pyx_pw_8CyOpenGL_20TriangulationEdgeSet_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_8CyOpenGL_TriangulationEdgeSet},
  {0, 0},
};
static PyType_Spec __pyx_type_8CyOpenGL_TriangulationEdgeSet_spec = {
  "CyOpenGL.TriangulationEdgeSet",
  sizeof(struct __pyx_obj_8CyOpenGL_TriangulationEdgeSet),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
  __pyx_type_8CyOpenGL_TriangulationEdgeSet_slots,
};
#else

static PyTypeObject __pyx_type_8CyOpenGL_TriangulationEdgeSet = {
  PyVarObject_HEAD_INIT(0, 0)
  "CyOpenGL.""TriangulationEdgeSet", /*tp_name*/
  sizeof(struct __pyx_obj_8CyOpenGL_TriangulationEdgeSet), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8CyOpenGL_EdgeSet, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  PyDoc_STR("TriangulationEdgeSet(triangulation, longitude, meridian, togl_widget=None)\n\nA fundamental set of edges for the 1-skeleton of the canonical\ntriangulation dual to the Ford domain, projected to the\nxy-plane in upper half-space."), /*tp_doc*/
  __pyx_tp_traverse_8CyOpenGL_EdgeSet, /*tp_traverse*/
  __pyx_tp_clear_8CyOpenGL_EdgeSet, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_8CyOpenGL_TriangulationEdgeSet, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_8CyOpenGL_20TriangulationEdgeSet_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_8CyOpenGL_TriangulationEdgeSet, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_8CyOpenGL_Label __pyx_vtable_8CyOpenGL_Label;

static PyObject *__pyx_tp_new_8CyOpenGL_Label(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_8CyOpenGL_Label *p;
  PyObject *o;
  o = __Pyx_AllocateExtensionType(t, 0);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_8CyOpenGL_Label *)o);
  p->__pyx_vtab = __pyx_vtabptr_8CyOpenGL_Label;
  p->codes = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_8CyOpenGL_Label(PyObject *o) {
  struct __pyx_obj_8CyOpenGL_Label *p = (struct __pyx_obj_8CyOpenGL_Label *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_8CyOpenGL_Label) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->codes);
  PyTypeObject *tp = Py_TYPE(o);
  #if CYTHON_USE_TYPE_SLOTS
  (*tp->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  Py_DECREF(tp);
  #endif
}

static int __pyx_tp_traverse_8CyOpenGL_Label(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8CyOpenGL_Label *p = (struct __pyx_obj_8CyOpenGL_Label *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->codes) {
    e = (*v)(p->codes, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_8CyOpenGL_Label(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_8CyOpenGL_Label *p = (struct __pyx_obj_8CyOpenGL_Label *)o;
  tmp = ((PyObject*)p->codes);
  p->codes = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_8CyOpenGL_Label[] = {
  {"draw", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_5Label_3draw, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_5Label_2draw},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_8CyOpenGL_Label_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8CyOpenGL_Label},
  {Py_tp_doc, (void *)PyDoc_STR("Label(position, int_label)\n\nA numeric label drawn onto a GL image using a SnapPy glyph.")},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_8CyOpenGL_Label},
  {Py_tp_clear, (void *)__pyx_tp_clear_8CyOpenGL_Label},
  {Py_tp_methods, (void *)__pyx_methods_8CyOpenGL_Label},
  {Py_tp_init, (void *)__pyx_pw_8CyOpenGL_5Label_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_8CyOpenGL_Label},
  {0, 0},
};
static PyType_Spec __pyx_type_8CyOpenGL_Label_spec = {
  "CyOpenGL.Label",
  sizeof(struct __pyx_obj_8CyOpenGL_Label),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
  __pyx_type_8CyOpenGL_Label_slots,
};
#else

static PyTypeObject __pyx_type_8CyOpenGL_Label = {
  PyVarObject_HEAD_INIT(0, 0)
  "CyOpenGL.""Label", /*tp_name*/
  sizeof(struct __pyx_obj_8CyOpenGL_Label), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8CyOpenGL_Label, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  PyDoc_STR("Label(position, int_label)\n\nA numeric label drawn onto a GL image using a SnapPy glyph."), /*tp_doc*/
  __pyx_tp_traverse_8CyOpenGL_Label, /*tp_traverse*/
  __pyx_tp_clear_8CyOpenGL_Label, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_8CyOpenGL_Label, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_8CyOpenGL_5Label_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_8CyOpenGL_Label, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_8CyOpenGL_LabelSet __pyx_vtable_8CyOpenGL_LabelSet;

static PyObject *__pyx_tp_new_8CyOpenGL_LabelSet(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_8CyOpenGL_LabelSet *p;
  PyObject *o = __pyx_tp_new_8CyOpenGL_GLobject(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_8CyOpenGL_LabelSet *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8CyOpenGL_GLobject*)__pyx_vtabptr_8CyOpenGL_LabelSet;
  p->segments = Py_None; Py_INCREF(Py_None);
  p->vertices = Py_None; Py_INCREF(Py_None);
  p->longitude = Py_None; Py_INCREF(Py_None);
  p->meridian = Py_None; Py_INCREF(Py_None);
  p->codes = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_8CyOpenGL_LabelSet(PyObject *o) {
  struct __pyx_obj_8CyOpenGL_LabelSet *p = (struct __pyx_obj_8CyOpenGL_LabelSet *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_8CyOpenGL_LabelSet) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->segments);
  Py_CLEAR(p->vertices);
  Py_CLEAR(p->longitude);
  Py_CLEAR(p->meridian);
  Py_CLEAR(p->codes);
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_8CyOpenGL_GLobject(o);
}

static int __pyx_tp_traverse_8CyOpenGL_LabelSet(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8CyOpenGL_LabelSet *p = (struct __pyx_obj_8CyOpenGL_LabelSet *)o;
  e = __pyx_tp_traverse_8CyOpenGL_GLobject(o, v, a); if (e) return e;
  if (p->segments) {
    e = (*v)(p->segments, a); if (e) return e;
  }
  if (p->vertices) {
    e = (*v)(p->vertices, a); if (e) return e;
  }
  if (p->longitude) {
    e = (*v)(p->longitude, a); if (e) return e;
  }
  if (p->meridian) {
    e = (*v)(p->meridian, a); if (e) return e;
  }
  if (p->codes) {
    e = (*v)(p->codes, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_8CyOpenGL_LabelSet(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_8CyOpenGL_LabelSet *p = (struct __pyx_obj_8CyOpenGL_LabelSet *)o;
  __pyx_tp_clear_8CyOpenGL_GLobject(o);
  tmp = ((PyObject*)p->segments);
  p->segments = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->vertices);
  p->vertices = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->longitude);
  p->longitude = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->meridian);
  p->meridian = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->codes);
  p->codes = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_8CyOpenGL_LabelSet[] = {
  {"draw", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_8LabelSet_3draw, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_8LabelSet_2draw},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_8CyOpenGL_LabelSet_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8CyOpenGL_LabelSet},
  {Py_tp_doc, (void *)PyDoc_STR("LabelSet(triangulation, longitude, meridian, togl_widget=None)\n\nA set of edge and vertex labels in the SnapPy font.")},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_8CyOpenGL_LabelSet},
  {Py_tp_clear, (void *)__pyx_tp_clear_8CyOpenGL_LabelSet},
  {Py_tp_methods, (void *)__pyx_methods_8CyOpenGL_LabelSet},
  {Py_tp_init, (void *)__pyx_pw_8CyOpenGL_8LabelSet_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_8CyOpenGL_LabelSet},
  {0, 0},
};
static PyType_Spec __pyx_type_8CyOpenGL_LabelSet_spec = {
  "CyOpenGL.LabelSet",
  sizeof(struct __pyx_obj_8CyOpenGL_LabelSet),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
  __pyx_type_8CyOpenGL_LabelSet_slots,
};
#else

static PyTypeObject __pyx_type_8CyOpenGL_LabelSet = {
  PyVarObject_HEAD_INIT(0, 0)
  "CyOpenGL.""LabelSet", /*tp_name*/
  sizeof(struct __pyx_obj_8CyOpenGL_LabelSet), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8CyOpenGL_LabelSet, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  PyDoc_STR("LabelSet(triangulation, longitude, meridian, togl_widget=None)\n\nA set of edge and vertex labels in the SnapPy font."), /*tp_doc*/
  __pyx_tp_traverse_8CyOpenGL_LabelSet, /*tp_traverse*/
  __pyx_tp_clear_8CyOpenGL_LabelSet, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_8CyOpenGL_LabelSet, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_8CyOpenGL_8LabelSet_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_8CyOpenGL_LabelSet, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_8CyOpenGL_HoroballScene __pyx_vtable_8CyOpenGL_HoroballScene;

static PyObject *__pyx_tp_new_8CyOpenGL_HoroballScene(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_8CyOpenGL_HoroballScene *p;
  PyObject *o;
  o = __Pyx_AllocateExtensionType(t, 0);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_8CyOpenGL_HoroballScene *)o);
  p->__pyx_vtab = __pyx_vtabptr_8CyOpenGL_HoroballScene;
  p->nbhd = Py_None; Py_INCREF(Py_None);
  p->meridian = Py_None; Py_INCREF(Py_None);
  p->longitude = Py_None; Py_INCREF(Py_None);
  p->offset = Py_None; Py_INCREF(Py_None);
  p->flipped = Py_None; Py_INCREF(Py_None);
  p->cusp_view = Py_None; Py_INCREF(Py_None);
  p->light_Ford = Py_None; Py_INCREF(Py_None);
  p->dark_Ford = Py_None; Py_INCREF(Py_None);
  p->light_tri = Py_None; Py_INCREF(Py_None);
  p->dark_tri = Py_None; Py_INCREF(Py_None);
  p->pgram = Py_None; Py_INCREF(Py_None);
  p->labels = Py_None; Py_INCREF(Py_None);
  p->shifts = Py_None; Py_INCREF(Py_None);
  p->pgram_var = Py_None; Py_INCREF(Py_None);
  p->Ford_var = Py_None; Py_INCREF(Py_None);
  p->tri_var = Py_None; Py_INCREF(Py_None);
  p->horo_var = Py_None; Py_INCREF(Py_None);
  p->label_var = Py_None; Py_INCREF(Py_None);
  p->togl_widget = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_8CyOpenGL_HoroballScene(PyObject *o) {
  struct __pyx_obj_8CyOpenGL_HoroballScene *p = (struct __pyx_obj_8CyOpenGL_HoroballScene *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_8CyOpenGL_HoroballScene) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->nbhd);
  Py_CLEAR(p->meridian);
  Py_CLEAR(p->longitude);
  Py_CLEAR(p->offset);
  Py_CLEAR(p->flipped);
  Py_CLEAR(p->cusp_view);
  Py_CLEAR(p->light_Ford);
  Py_CLEAR(p->dark_Ford);
  Py_CLEAR(p->light_tri);
  Py_CLEAR(p->dark_tri);
  Py_CLEAR(p->pgram);
  Py_CLEAR(p->labels);
  Py_CLEAR(p->shifts);
  Py_CLEAR(p->pgram_var);
  Py_CLEAR(p->Ford_var);
  Py_CLEAR(p->tri_var);
  Py_CLEAR(p->horo_var);
  Py_CLEAR(p->label_var);
  Py_CLEAR(p->togl_widget);
  PyTypeObject *tp = Py_TYPE(o);
  #if CYTHON_USE_TYPE_SLOTS
  (*tp->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  Py_DECREF(tp);
  #endif
}

static int __pyx_tp_traverse_8CyOpenGL_HoroballScene(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8CyOpenGL_HoroballScene *p = (struct __pyx_obj_8CyOpenGL_HoroballScene *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->nbhd) {
    e = (*v)(p->nbhd, a); if (e) return e;
  }
  if (p->meridian) {
    e = (*v)(p->meridian, a); if (e) return e;
  }
  if (p->longitude) {
    e = (*v)(p->longitude, a); if (e) return e;
  }
  if (p->offset) {
    e = (*v)(p->offset, a); if (e) return e;
  }
  if (p->flipped) {
    e = (*v)(p->flipped, a); if (e) return e;
  }
  if (p->cusp_view) {
    e = (*v)(p->cusp_view, a); if (e) return e;
  }
  if (p->light_Ford) {
    e = (*v)(p->light_Ford, a); if (e) return e;
  }
  if (p->dark_Ford) {
    e = (*v)(p->dark_Ford, a); if (e) return e;
  }
  if (p->light_tri) {
    e = (*v)(p->light_tri, a); if (e) return e;
  }
  if (p->dark_tri) {
    e = (*v)(p->dark_tri, a); if (e) return e;
  }
  if (p->pgram) {
    e = (*v)(p->pgram, a); if (e) return e;
  }
  if (p->labels) {
    e = (*v)(p->labels, a); if (e) return e;
  }
  if (p->shifts) {
    e = (*v)(p->shifts, a); if (e) return e;
  }
  if (p->pgram_var) {
    e = (*v)(p->pgram_var, a); if (e) return e;
  }
  if (p->Ford_var) {
    e = (*v)(p->Ford_var, a); if (e) return e;
  }
  if (p->tri_var) {
    e = (*v)(p->tri_var, a); if (e) return e;
  }
  if (p->horo_var) {
    e = (*v)(p->horo_var, a); if (e) return e;
  }
  if (p->label_var) {
    e = (*v)(p->label_var, a); if (e) return e;
  }
  if (p->togl_widget) {
    e = (*v)(p->togl_widget, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_8CyOpenGL_HoroballScene(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_8CyOpenGL_HoroballScene *p = (struct __pyx_obj_8CyOpenGL_HoroballScene *)o;
  tmp = ((PyObject*)p->nbhd);
  p->nbhd = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->meridian);
  p->meridian = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->longitude);
  p->longitude = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->offset);
  p->offset = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->flipped);
  p->flipped = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->cusp_view);
  p->cusp_view = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->light_Ford);
  p->light_Ford = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->dark_Ford);
  p->dark_Ford = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->light_tri);
  p->light_tri = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->dark_tri);
  p->dark_tri = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->pgram);
  p->pgram = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->labels);
  p->labels = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->shifts);
  p->shifts = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->pgram_var);
  p->pgram_var = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->Ford_var);
  p->Ford_var = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->tri_var);
  p->tri_var = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->horo_var);
  p->horo_var = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->label_var);
  p->label_var = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->togl_widget);
  p->togl_widget = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_8CyOpenGL_HoroballScene[] = {
  {"set_cutoff", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_13HoroballScene_3set_cutoff, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_13HoroballScene_2set_cutoff},
  {"flip", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_13HoroballScene_5flip, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_13HoroballScene_4flip},
  {"build_scene", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_13HoroballScene_7build_scene, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_13HoroballScene_6build_scene},
  {"delete_resource", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_13HoroballScene_9delete_resource, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_13HoroballScene_8delete_resource},
  {"translate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_13HoroballScene_11translate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_13HoroballScene_10translate},
  {"draw", (PyCFunction)(void(*)(void))(PyCFunctionWithKeywords)__pyx_pw_8CyOpenGL_13HoroballScene_13draw, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8CyOpenGL_13HoroballScene_12draw},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_8CyOpenGL_HoroballScene_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8CyOpenGL_HoroballScene},
  {Py_tp_doc, (void *)PyDoc_STR("HoroballScene(nbhd, pgram_var, Ford_var, tri_var, horo_var, label_var, flipped=False, cutoff=0.1, which_cusp=0, togl_widget=None)\n\nA family of translations of a Horoball Group which fill the\nscreen.  The horoballs are viewed by an observer sitting on one of\nthe horoballs.  The variable which_cusp selects which cusp the\nviewer's horoball corresponds to.")},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_8CyOpenGL_HoroballScene},
  {Py_tp_clear, (void *)__pyx_tp_clear_8CyOpenGL_HoroballScene},
  {Py_tp_methods, (void *)__pyx_methods_8CyOpenGL_HoroballScene},
  {Py_tp_init, (void *)__pyx_pw_8CyOpenGL_13HoroballScene_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_8CyOpenGL_HoroballScene},
  {0, 0},
};
static PyType_Spec __pyx_type_8CyOpenGL_HoroballScene_spec = {
  "CyOpenGL.HoroballScene",
  sizeof(struct __pyx_obj_8CyOpenGL_HoroballScene),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
  __pyx_type_8CyOpenGL_HoroballScene_slots,
};
#else

static PyTypeObject __pyx_type_8CyOpenGL_HoroballScene = {
  PyVarObject_HEAD_INIT(0, 0)
  "CyOpenGL.""HoroballScene", /*tp_name*/
  sizeof(struct __pyx_obj_8CyOpenGL_HoroballScene), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8CyOpenGL_HoroballScene, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  PyDoc_STR("HoroballScene(nbhd, pgram_var, Ford_var, tri_var, horo_var, label_var, flipped=False, cutoff=0.1, which_cusp=0, togl_widget=None)\n\nA family of translations of a Horoball Group which fill the\nscreen.  The horoballs are viewed by an observer sitting on one of\nthe horoballs.  The variable which_cusp selects which cusp the\nviewer's horoball corresponds to."), /*tp_doc*/
  __pyx_tp_traverse_8CyOpenGL_HoroballScene, /*tp_traverse*/
  __pyx_tp_clear_8CyOpenGL_HoroballScene, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_8CyOpenGL_HoroballScene, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_8CyOpenGL_13HoroballScene_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_8CyOpenGL_HoroballScene, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new_8CyOpenGL_DataBasedTexture(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  o = __Pyx_AllocateExtensionType(t, 0);
  if (unlikely(!o)) return 0;
  if (unlikely(__pyx_pw_8CyOpenGL_16DataBasedTexture_1__cinit__(o, __pyx_mstate_global->__pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_8CyOpenGL_DataBasedTexture(PyObject *o) {
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_8CyOpenGL_DataBasedTexture) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyTypeObject *tp = Py_TYPE(o);
  #if CYTHON_USE_TYPE_SLOTS
  (*tp->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  Py_DECREF(tp);
  #endif
}

static PyMethodDef __pyx_methods_8CyOpenGL_DataBasedTexture[] = {
  {"bind", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_16DataBasedTexture_5bind, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_16DataBasedTexture_4bind},
  {"unbind", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_16DataBasedTexture_7unbind, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_16DataBasedTexture_6unbind},
  {"delete_resource", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_16DataBasedTexture_9delete_resource, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_16DataBasedTexture_8delete_resource},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_8CyOpenGL_DataBasedTexture_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8CyOpenGL_DataBasedTexture},
  {Py_tp_doc, (void *)PyDoc_STR("DataBasedTexture(unsigned int width, unsigned int height, unsigned char[:] rgba_data)")},
  {Py_tp_methods, (void *)__pyx_methods_8CyOpenGL_DataBasedTexture},
  {Py_tp_init, (void *)__pyx_pw_8CyOpenGL_16DataBasedTexture_3__init__},
  {Py_tp_new, (void *)__pyx_tp_new_8CyOpenGL_DataBasedTexture},
  {0, 0},
};
static PyType_Spec __pyx_type_8CyOpenGL_DataBasedTexture_spec = {
  "CyOpenGL.DataBasedTexture",
  sizeof(struct __pyx_obj_8CyOpenGL_DataBasedTexture),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_8CyOpenGL_DataBasedTexture_slots,
};
#else

static PyTypeObject __pyx_type_8CyOpenGL_DataBasedTexture = {
  PyVarObject_HEAD_INIT(0, 0)
  "CyOpenGL.""DataBasedTexture", /*tp_name*/
  sizeof(struct __pyx_obj_8CyOpenGL_DataBasedTexture), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8CyOpenGL_DataBasedTexture, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  PyDoc_STR("DataBasedTexture(unsigned int width, unsigned int height, unsigned char[:] rgba_data)"), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_8CyOpenGL_DataBasedTexture, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_8CyOpenGL_16DataBasedTexture_3__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_8CyOpenGL_DataBasedTexture, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new_8CyOpenGL_UniformBufferObject(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_8CyOpenGL_UniformBufferObject *p;
  PyObject *o;
  o = __Pyx_AllocateExtensionType(t, 0);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_8CyOpenGL_UniformBufferObject *)o);
  p->_name_to_offset = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_8CyOpenGL_UniformBufferObject(PyObject *o) {
  struct __pyx_obj_8CyOpenGL_UniformBufferObject *p = (struct __pyx_obj_8CyOpenGL_UniformBufferObject *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_8CyOpenGL_UniformBufferObject) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    __Pyx_DeallocKeepAliveBegin(o);
    __pyx_pw_8CyOpenGL_19UniformBufferObject_9__dealloc__(o);
    __Pyx_DeallocKeepAliveEnd(o);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->_name_to_offset);
  PyTypeObject *tp = Py_TYPE(o);
  #if CYTHON_USE_TYPE_SLOTS
  (*tp->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  Py_DECREF(tp);
  #endif
}

static int __pyx_tp_traverse_8CyOpenGL_UniformBufferObject(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8CyOpenGL_UniformBufferObject *p = (struct __pyx_obj_8CyOpenGL_UniformBufferObject *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->_name_to_offset) {
    e = (*v)(p->_name_to_offset, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_8CyOpenGL_UniformBufferObject(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_8CyOpenGL_UniformBufferObject *p = (struct __pyx_obj_8CyOpenGL_UniformBufferObject *)o;
  tmp = ((PyObject*)p->_name_to_offset);
  p->_name_to_offset = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_8CyOpenGL_UniformBufferObject[] = {
  {"set", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_19UniformBufferObject_3set, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_19UniformBufferObject_2set},
  {"commit", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_19UniformBufferObject_5commit, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_19UniformBufferObject_4commit},
  {"bind_block", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_19UniformBufferObject_7bind_block, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_19UniformBufferObject_6bind_block},
  {"delete_resource", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_19UniformBufferObject_11delete_resource, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_19UniformBufferObject_10delete_resource},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_8CyOpenGL_UniformBufferObject_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8CyOpenGL_UniformBufferObject},
  {Py_tp_doc, (void *)PyDoc_STR("UniformBufferObject(buffer_size, name_to_offset)")},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_8CyOpenGL_UniformBufferObject},
  {Py_tp_clear, (void *)__pyx_tp_clear_8CyOpenGL_UniformBufferObject},
  {Py_tp_methods, (void *)__pyx_methods_8CyOpenGL_UniformBufferObject},
  {Py_tp_init, (void *)__pyx_pw_8CyOpenGL_19UniformBufferObject_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_8CyOpenGL_UniformBufferObject},
  {0, 0},
};
static PyType_Spec __pyx_type_8CyOpenGL_UniformBufferObject_spec = {
  "CyOpenGL.UniformBufferObject",
  sizeof(struct __pyx_obj_8CyOpenGL_UniformBufferObject),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
  __pyx_type_8CyOpenGL_UniformBufferObject_slots,
};
#else

static PyTypeObject __pyx_type_8CyOpenGL_UniformBufferObject = {
  PyVarObject_HEAD_INIT(0, 0)
  "CyOpenGL.""UniformBufferObject", /*tp_name*/
  sizeof(struct __pyx_obj_8CyOpenGL_UniformBufferObject), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8CyOpenGL_UniformBufferObject, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  PyDoc_STR("UniformBufferObject(buffer_size, name_to_offset)"), /*tp_doc*/
  __pyx_tp_traverse_8CyOpenGL_UniformBufferObject, /*tp_traverse*/
  __pyx_tp_clear_8CyOpenGL_UniformBufferObject, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_8CyOpenGL_UniformBufferObject, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_8CyOpenGL_19UniformBufferObject_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_8CyOpenGL_UniformBufferObject, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new_8CyOpenGL_GLSLProgram(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_8CyOpenGL_GLSLProgram *p;
  PyObject *o;
  o = __Pyx_AllocateExtensionType(t, 0);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_8CyOpenGL_GLSLProgram *)o);
  p->_name_to_uniform_block = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_8CyOpenGL_GLSLProgram(PyObject *o) {
  struct __pyx_obj_8CyOpenGL_GLSLProgram *p = (struct __pyx_obj_8CyOpenGL_GLSLProgram *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_8CyOpenGL_GLSLProgram) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->_name_to_uniform_block);
  PyTypeObject *tp = Py_TYPE(o);
  #if CYTHON_USE_TYPE_SLOTS
  (*tp->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  Py_DECREF(tp);
  #endif
}

static int __pyx_tp_traverse_8CyOpenGL_GLSLProgram(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8CyOpenGL_GLSLProgram *p = (struct __pyx_obj_8CyOpenGL_GLSLProgram *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->_name_to_uniform_block) {
    e = (*v)(p->_name_to_uniform_block, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_8CyOpenGL_GLSLProgram(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_8CyOpenGL_GLSLProgram *p = (struct __pyx_obj_8CyOpenGL_GLSLProgram *)o;
  tmp = ((PyObject*)p->_name_to_uniform_block);
  p->_name_to_uniform_block = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_8CyOpenGL_GLSLProgram[] = {
  {"_compile_and_link", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_11GLSLProgram_3_compile_and_link, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_11GLSLProgram_2_compile_and_link},
  {"is_valid", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_11GLSLProgram_5is_valid, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_11GLSLProgram_4is_valid},
  {"bind_uniforms", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_11GLSLProgram_7bind_uniforms, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_11GLSLProgram_6bind_uniforms},
  {"use_program", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_11GLSLProgram_9use_program, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_11GLSLProgram_8use_program},
  {"delete_resource", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_11GLSLProgram_11delete_resource, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_11GLSLProgram_10delete_resource},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_8CyOpenGL_GLSLProgram_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8CyOpenGL_GLSLProgram},
  {Py_tp_doc, (void *)PyDoc_STR("GLSLProgram(vertex_shader_source, fragment_shader_source, uniform_block_names_sizes_and_offsets=[], name='unnamed')\n\nA Cython class representing a GLSL program.  Given GLSL source for a\nvertex and fragment shader, a GLSLProgram object compiles the shaders\nand links them to a GLSL program in the current GL context.\n\nTo use the program for drawing, call the object's use_program method.\nAfter use_program, you can bind uniform's by bind_uniforms.")},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_8CyOpenGL_GLSLProgram},
  {Py_tp_clear, (void *)__pyx_tp_clear_8CyOpenGL_GLSLProgram},
  {Py_tp_methods, (void *)__pyx_methods_8CyOpenGL_GLSLProgram},
  {Py_tp_init, (void *)__pyx_pw_8CyOpenGL_11GLSLProgram_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_8CyOpenGL_GLSLProgram},
  {0, 0},
};
static PyType_Spec __pyx_type_8CyOpenGL_GLSLProgram_spec = {
  "CyOpenGL.GLSLProgram",
  sizeof(struct __pyx_obj_8CyOpenGL_GLSLProgram),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
  __pyx_type_8CyOpenGL_GLSLProgram_slots,
};
#else

static PyTypeObject __pyx_type_8CyOpenGL_GLSLProgram = {
  PyVarObject_HEAD_INIT(0, 0)
  "CyOpenGL.""GLSLProgram", /*tp_name*/
  sizeof(struct __pyx_obj_8CyOpenGL_GLSLProgram), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8CyOpenGL_GLSLProgram, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  PyDoc_STR("GLSLProgram(vertex_shader_source, fragment_shader_source, uniform_block_names_sizes_and_offsets=[], name='unnamed')\n\nA Cython class representing a GLSL program.  Given GLSL source for a\nvertex and fragment shader, a GLSLProgram object compiles the shaders\nand links them to a GLSL program in the current GL context.\n\nTo use the program for drawing, call the object's use_program method.\nAfter use_program, you can bind uniform's by bind_uniforms."), /*tp_doc*/
  __pyx_tp_traverse_8CyOpenGL_GLSLProgram, /*tp_traverse*/
  __pyx_tp_clear_8CyOpenGL_GLSLProgram, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_8CyOpenGL_GLSLProgram, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_8CyOpenGL_11GLSLProgram_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_8CyOpenGL_GLSLProgram, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new_8CyOpenGL_VertexBuffer(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  o = __Pyx_AllocateExtensionType(t, 0);
  if (unlikely(!o)) return 0;
  if (unlikely(__pyx_pw_8CyOpenGL_12VertexBuffer_1__cinit__(o, __pyx_mstate_global->__pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_8CyOpenGL_VertexBuffer(PyObject *o) {
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_8CyOpenGL_VertexBuffer) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyTypeObject *tp = Py_TYPE(o);
  #if CYTHON_USE_TYPE_SLOTS
  (*tp->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  Py_DECREF(tp);
  #endif
}

static PyMethodDef __pyx_methods_8CyOpenGL_VertexBuffer[] = {
  {"bind", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_12VertexBuffer_3bind, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_12VertexBuffer_2bind},
  {"load", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_12VertexBuffer_5load, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_12VertexBuffer_4load},
  {"delete_resource", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_12VertexBuffer_7delete_resource, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_12VertexBuffer_6delete_resource},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_8CyOpenGL_VertexBuffer_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8CyOpenGL_VertexBuffer},
  {Py_tp_doc, (void *)PyDoc_STR("\n    Encapsulates a vertex array and vertex buffer object.\n\n    Data can be put into the vertex buffer object with load.\n    To bind the GL objects so that a shader can consume them (as vertex\n    attribute 0), call bind.\n\n    For now, it only supports a single vertex buffer object holding\n    float 1-, 2-, 3-, or 4-vectors. In the future, we might\n    support having several vertex buffer objects.\n    ")},
  {Py_tp_methods, (void *)__pyx_methods_8CyOpenGL_VertexBuffer},
  {Py_tp_new, (void *)__pyx_tp_new_8CyOpenGL_VertexBuffer},
  {0, 0},
};
static PyType_Spec __pyx_type_8CyOpenGL_VertexBuffer_spec = {
  "CyOpenGL.VertexBuffer",
  sizeof(struct __pyx_obj_8CyOpenGL_VertexBuffer),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_8CyOpenGL_VertexBuffer_slots,
};
#else

static PyTypeObject __pyx_type_8CyOpenGL_VertexBuffer = {
  PyVarObject_HEAD_INIT(0, 0)
  "CyOpenGL.""VertexBuffer", /*tp_name*/
  sizeof(struct __pyx_obj_8CyOpenGL_VertexBuffer), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8CyOpenGL_VertexBuffer, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  PyDoc_STR("\n    Encapsulates a vertex array and vertex buffer object.\n\n    Data can be put into the vertex buffer object with load.\n    To bind the GL objects so that a shader can consume them (as vertex\n    attribute 0), call bind.\n\n    For now, it only supports a single vertex buffer object holding\n    float 1-, 2-, 3-, or 4-vectors. In the future, we might\n    support having several vertex buffer objects.\n    "), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_8CyOpenGL_VertexBuffer, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_8CyOpenGL_VertexBuffer, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_8CyOpenGL_GLSLPerspectiveView __pyx_vtable_8CyOpenGL_GLSLPerspectiveView;

static PyObject *__pyx_tp_new_8CyOpenGL_GLSLPerspectiveView(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_8CyOpenGL_GLSLPerspectiveView *p;
  PyObject *o;
  o = __Pyx_AllocateExtensionType(t, 0);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_8CyOpenGL_GLSLPerspectiveView *)o);
  p->__pyx_vtab = __pyx_vtabptr_8CyOpenGL_GLSLPerspectiveView;
  if (unlikely(__pyx_pw_8CyOpenGL_19GLSLPerspectiveView_1__cinit__(o, __pyx_mstate_global->__pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_8CyOpenGL_GLSLPerspectiveView(PyObject *o) {
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_8CyOpenGL_GLSLPerspectiveView) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyTypeObject *tp = Py_TYPE(o);
  #if CYTHON_USE_TYPE_SLOTS
  (*tp->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  Py_DECREF(tp);
  #endif
}

static PyObject *__pyx_getprop_8CyOpenGL_19GLSLPerspectiveView_vertical_fov(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_8CyOpenGL_19GLSLPerspectiveView_12vertical_fov_1__get__(o);
}

static int __pyx_setprop_8CyOpenGL_19GLSLPerspectiveView_vertical_fov(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_8CyOpenGL_19GLSLPerspectiveView_12vertical_fov_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_8CyOpenGL_19GLSLPerspectiveView_near(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_8CyOpenGL_19GLSLPerspectiveView_4near_1__get__(o);
}

static int __pyx_setprop_8CyOpenGL_19GLSLPerspectiveView_near(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_8CyOpenGL_19GLSLPerspectiveView_4near_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_8CyOpenGL_19GLSLPerspectiveView_far(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_8CyOpenGL_19GLSLPerspectiveView_3far_1__get__(o);
}

static int __pyx_setprop_8CyOpenGL_19GLSLPerspectiveView_far(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_8CyOpenGL_19GLSLPerspectiveView_3far_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_8CyOpenGL_19GLSLPerspectiveView_distance(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_8CyOpenGL_19GLSLPerspectiveView_8distance_1__get__(o);
}

static int __pyx_setprop_8CyOpenGL_19GLSLPerspectiveView_distance(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_8CyOpenGL_19GLSLPerspectiveView_8distance_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_8CyOpenGL_19GLSLPerspectiveView_center(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_8CyOpenGL_19GLSLPerspectiveView_6center_1__get__(o);
}

static int __pyx_setprop_8CyOpenGL_19GLSLPerspectiveView_center(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_8CyOpenGL_19GLSLPerspectiveView_6center_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyMethodDef __pyx_methods_8CyOpenGL_GLSLPerspectiveView[] = {
  {"get_uniform_bindings", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_19GLSLPerspectiveView_7get_uniform_bindings, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_19GLSLPerspectiveView_6get_uniform_bindings},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_8CyOpenGL_GLSLPerspectiveView[] = {
  {"vertical_fov", __pyx_getprop_8CyOpenGL_19GLSLPerspectiveView_vertical_fov, __pyx_setprop_8CyOpenGL_19GLSLPerspectiveView_vertical_fov, 0, 0},
  {"near", __pyx_getprop_8CyOpenGL_19GLSLPerspectiveView_near, __pyx_setprop_8CyOpenGL_19GLSLPerspectiveView_near, 0, 0},
  {"far", __pyx_getprop_8CyOpenGL_19GLSLPerspectiveView_far, __pyx_setprop_8CyOpenGL_19GLSLPerspectiveView_far, 0, 0},
  {"distance", __pyx_getprop_8CyOpenGL_19GLSLPerspectiveView_distance, __pyx_setprop_8CyOpenGL_19GLSLPerspectiveView_distance, 0, 0},
  {"center", __pyx_getprop_8CyOpenGL_19GLSLPerspectiveView_center, __pyx_setprop_8CyOpenGL_19GLSLPerspectiveView_center, 0, 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_8CyOpenGL_GLSLPerspectiveView_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8CyOpenGL_GLSLPerspectiveView},
  {Py_tp_doc, (void *)PyDoc_STR("\n    Mixin class to create a perspective view using GLSL.  An object of\n    this class maintains a model view matrix, a projection matrix and the\n    product of the two.  These are made available to the shaders by\n    get_uniform_bindings.\n    ")},
  {Py_tp_methods, (void *)__pyx_methods_8CyOpenGL_GLSLPerspectiveView},
  {Py_tp_getset, (void *)__pyx_getsets_8CyOpenGL_GLSLPerspectiveView},
  {Py_tp_new, (void *)__pyx_tp_new_8CyOpenGL_GLSLPerspectiveView},
  {0, 0},
};
static PyType_Spec __pyx_type_8CyOpenGL_GLSLPerspectiveView_spec = {
  "CyOpenGL.GLSLPerspectiveView",
  sizeof(struct __pyx_obj_8CyOpenGL_GLSLPerspectiveView),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_8CyOpenGL_GLSLPerspectiveView_slots,
};
#else

static PyTypeObject __pyx_type_8CyOpenGL_GLSLPerspectiveView = {
  PyVarObject_HEAD_INIT(0, 0)
  "CyOpenGL.""GLSLPerspectiveView", /*tp_name*/
  sizeof(struct __pyx_obj_8CyOpenGL_GLSLPerspectiveView), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8CyOpenGL_GLSLPerspectiveView, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  PyDoc_STR("\n    Mixin class to create a perspective view using GLSL.  An object of\n    this class maintains a model view matrix, a projection matrix and the\n    product of the two.  These are made available to the shaders by\n    get_uniform_bindings.\n    "), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_8CyOpenGL_GLSLPerspectiveView, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_8CyOpenGL_GLSLPerspectiveView, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_8CyOpenGL_GLSLPerspectiveView, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new_8CyOpenGL_Triangle(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_8CyOpenGL_Triangle *p;
  PyObject *o;
  o = __Pyx_AllocateExtensionType(t, 0);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_8CyOpenGL_Triangle *)o);
  p->_gl_widget = Py_None; Py_INCREF(Py_None);
  p->_program = Py_None; Py_INCREF(Py_None);
  p->_vertex_buffer = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_8CyOpenGL_Triangle(PyObject *o) {
  struct __pyx_obj_8CyOpenGL_Triangle *p = (struct __pyx_obj_8CyOpenGL_Triangle *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_8CyOpenGL_Triangle) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->_gl_widget);
  Py_CLEAR(p->_program);
  Py_CLEAR(p->_vertex_buffer);
  PyTypeObject *tp = Py_TYPE(o);
  #if CYTHON_USE_TYPE_SLOTS
  (*tp->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  Py_DECREF(tp);
  #endif
}

static int __pyx_tp_traverse_8CyOpenGL_Triangle(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8CyOpenGL_Triangle *p = (struct __pyx_obj_8CyOpenGL_Triangle *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->_gl_widget) {
    e = (*v)(p->_gl_widget, a); if (e) return e;
  }
  if (p->_program) {
    e = (*v)(p->_program, a); if (e) return e;
  }
  if (p->_vertex_buffer) {
    e = (*v)(p->_vertex_buffer, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_8CyOpenGL_Triangle(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_8CyOpenGL_Triangle *p = (struct __pyx_obj_8CyOpenGL_Triangle *)o;
  tmp = ((PyObject*)p->_gl_widget);
  p->_gl_widget = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_program);
  p->_program = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_vertex_buffer);
  p->_vertex_buffer = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_8CyOpenGL_Triangle[] = {
  {"draw", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_8Triangle_3draw, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_8Triangle_2draw},
  {"delete_resource", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_8Triangle_5delete_resource, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_8Triangle_4delete_resource},
  {"get_uniform_bindings", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8CyOpenGL_8Triangle_7get_uniform_bindings, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8CyOpenGL_8Triangle_6get_uniform_bindings},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_8CyOpenGL_Triangle_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8CyOpenGL_Triangle},
  {Py_tp_doc, (void *)PyDoc_STR("Triangle(gl_widget, program, vertices)\n\nA triangle with given vertices.")},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_8CyOpenGL_Triangle},
  {Py_tp_clear, (void *)__pyx_tp_clear_8CyOpenGL_Triangle},
  {Py_tp_methods, (void *)__pyx_methods_8CyOpenGL_Triangle},
  {Py_tp_init, (void *)__pyx_pw_8CyOpenGL_8Triangle_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_8CyOpenGL_Triangle},
  {0, 0},
};
static PyType_Spec __pyx_type_8CyOpenGL_Triangle_spec = {
  "CyOpenGL.Triangle",
  sizeof(struct __pyx_obj_8CyOpenGL_Triangle),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
  __pyx_type_8CyOpenGL_Triangle_slots,
};
#else

static PyTypeObject __pyx_type_8CyOpenGL_Triangle = {
  PyVarObject_HEAD_INIT(0, 0)
  "CyOpenGL.""Triangle", /*tp_name*/
  sizeof(struct __pyx_obj_8CyOpenGL_Triangle), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8CyOpenGL_Triangle, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  PyDoc_STR("Triangle(gl_widget, program, vertices)\n\nA triangle with given vertices."), /*tp_doc*/
  __pyx_tp_traverse_8CyOpenGL_Triangle, /*tp_traverse*/
  __pyx_tp_clear_8CyOpenGL_Triangle, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_8CyOpenGL_Triangle, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_8CyOpenGL_8Triangle_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_8CyOpenGL_Triangle, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new_8CyOpenGL___pyx_defaults(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  o = __Pyx_AllocateExtensionType(t, 1);
  if (unlikely(!o)) return 0;
  return o;
}

static void __pyx_tp_dealloc_8CyOpenGL___pyx_defaults(PyObject *o) {
  struct __pyx_defaults *p = (struct __pyx_defaults *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_8CyOpenGL___pyx_defaults) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->arg0);
  PyTypeObject *tp = Py_TYPE(o);
  #if CYTHON_USE_TYPE_SLOTS
  (*tp->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  Py_DECREF(tp);
  #endif
}

static int __pyx_tp_traverse_8CyOpenGL___pyx_defaults(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_defaults *p = (struct __pyx_defaults *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->arg0) {
    e = (*v)(p->arg0, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_8CyOpenGL___pyx_defaults(PyObject *o) {
  PyObject* tmp;
  struct __pyx_defaults *p = (struct __pyx_defaults *)o;
  tmp = ((PyObject*)p->arg0);
  p->arg0 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_8CyOpenGL___pyx_defaults_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8CyOpenGL___pyx_defaults},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_8CyOpenGL___pyx_defaults},
  {Py_tp_clear, (void *)__pyx_tp_clear_8CyOpenGL___pyx_defaults},
  {Py_tp_new, (void *)__pyx_tp_new_8CyOpenGL___pyx_defaults},
  {0, 0},
};
static PyType_Spec __pyx_type_8CyOpenGL___pyx_defaults_spec = {
  "CyOpenGL.__pyx_defaults",
  sizeof(struct __pyx_defaults),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
  __pyx_type_8CyOpenGL___pyx_defaults_slots,
};
#else

static PyTypeObject __pyx_type_8CyOpenGL___pyx_defaults = {
  PyVarObject_HEAD_INIT(0, 0)
  "CyOpenGL.""__pyx_defaults", /*tp_name*/
  sizeof(struct __pyx_defaults), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8CyOpenGL___pyx_defaults, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_8CyOpenGL___pyx_defaults, /*tp_traverse*/
  __pyx_tp_clear_8CyOpenGL___pyx_defaults, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_8CyOpenGL___pyx_defaults, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new_8CyOpenGL___pyx_scope_struct__draw(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_8CyOpenGL___pyx_scope_struct__draw > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_8CyOpenGL___pyx_scope_struct__draw, sizeof(struct __pyx_obj_8CyOpenGL___pyx_scope_struct__draw))))
  {
    o = (PyObject*)__pyx_mstate_global->__pyx_freelist_8CyOpenGL___pyx_scope_struct__draw[--__pyx_mstate_global->__pyx_freecount_8CyOpenGL___pyx_scope_struct__draw];
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(Py_TYPE(o));
    #endif
    memset(o, 0, sizeof(struct __pyx_obj_8CyOpenGL___pyx_scope_struct__draw));
    #if CYTHON_COMPILING_IN_LIMITED_API
    (void) PyObject_Init(o, t);
    #else
    (void) PyObject_INIT(o, t);
    #endif
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = __Pyx_AllocateExtensionType(t, 1);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_8CyOpenGL___pyx_scope_struct__draw(PyObject *o) {
  struct __pyx_obj_8CyOpenGL___pyx_scope_struct__draw *p = (struct __pyx_obj_8CyOpenGL___pyx_scope_struct__draw *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_8CyOpenGL___pyx_scope_struct__draw) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_r);
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_8CyOpenGL___pyx_scope_struct__draw < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_8CyOpenGL___pyx_scope_struct__draw, sizeof(struct __pyx_obj_8CyOpenGL___pyx_scope_struct__draw))))
  {
    __pyx_mstate_global->__pyx_freelist_8CyOpenGL___pyx_scope_struct__draw[__pyx_mstate_global->__pyx_freecount_8CyOpenGL___pyx_scope_struct__draw++] = ((struct __pyx_obj_8CyOpenGL___pyx_scope_struct__draw *)o);
  } else
  #endif
  {
    PyTypeObject *tp = Py_TYPE(o);
    #if CYTHON_USE_TYPE_SLOTS
    (*tp->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(tp);
    #endif
  }
}

static int __pyx_tp_traverse_8CyOpenGL___pyx_scope_struct__draw(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8CyOpenGL___pyx_scope_struct__draw *p = (struct __pyx_obj_8CyOpenGL___pyx_scope_struct__draw *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->__pyx_v_r) {
    e = (*v)(p->__pyx_v_r, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_8CyOpenGL___pyx_scope_struct__draw(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_8CyOpenGL___pyx_scope_struct__draw *p = (struct __pyx_obj_8CyOpenGL___pyx_scope_struct__draw *)o;
  tmp = ((PyObject*)p->__pyx_v_r);
  p->__pyx_v_r = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_8CyOpenGL___pyx_scope_struct__draw_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8CyOpenGL___pyx_scope_struct__draw},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_8CyOpenGL___pyx_scope_struct__draw},
  {Py_tp_clear, (void *)__pyx_tp_clear_8CyOpenGL___pyx_scope_struct__draw},
  {Py_tp_new, (void *)__pyx_tp_new_8CyOpenGL___pyx_scope_struct__draw},
  {0, 0},
};
static PyType_Spec __pyx_type_8CyOpenGL___pyx_scope_struct__draw_spec = {
  "CyOpenGL.__pyx_scope_struct__draw",
  sizeof(struct __pyx_obj_8CyOpenGL___pyx_scope_struct__draw),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
  __pyx_type_8CyOpenGL___pyx_scope_struct__draw_slots,
};
#else

static PyTypeObject __pyx_type_8CyOpenGL___pyx_scope_struct__draw = {
  PyVarObject_HEAD_INIT(0, 0)
  "CyOpenGL.""__pyx_scope_struct__draw", /*tp_name*/
  sizeof(struct __pyx_obj_8CyOpenGL___pyx_scope_struct__draw), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8CyOpenGL___pyx_scope_struct__draw, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_8CyOpenGL___pyx_scope_struct__draw, /*tp_traverse*/
  __pyx_tp_clear_8CyOpenGL___pyx_scope_struct__draw, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_8CyOpenGL___pyx_scope_struct__draw, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new_8CyOpenGL___pyx_scope_struct_1_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_8CyOpenGL___pyx_scope_struct_1_genexpr > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_8CyOpenGL___pyx_scope_struct_1_genexpr, sizeof(struct __pyx_obj_8CyOpenGL___pyx_scope_struct_1_genexpr))))
  {
    o = (PyObject*)__pyx_mstate_global->__pyx_freelist_8CyOpenGL___pyx_scope_struct_1_genexpr[--__pyx_mstate_global->__pyx_freecount_8CyOpenGL___pyx_scope_struct_1_genexpr];
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(Py_TYPE(o));
    #endif
    memset(o, 0, sizeof(struct __pyx_obj_8CyOpenGL___pyx_scope_struct_1_genexpr));
    #if CYTHON_COMPILING_IN_LIMITED_API
    (void) PyObject_Init(o, t);
    #else
    (void) PyObject_INIT(o, t);
    #endif
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = __Pyx_AllocateExtensionType(t, 1);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_8CyOpenGL___pyx_scope_struct_1_genexpr(PyObject *o) {
  struct __pyx_obj_8CyOpenGL___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_8CyOpenGL___pyx_scope_struct_1_genexpr *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_8CyOpenGL___pyx_scope_struct_1_genexpr) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_genexpr_arg_0);
  Py_CLEAR(p->__pyx_v_z);
  Py_CLEAR(p->__pyx_t_0);
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_8CyOpenGL___pyx_scope_struct_1_genexpr < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_8CyOpenGL___pyx_scope_struct_1_genexpr, sizeof(struct __pyx_obj_8CyOpenGL___pyx_scope_struct_1_genexpr))))
  {
    __pyx_mstate_global->__pyx_freelist_8CyOpenGL___pyx_scope_struct_1_genexpr[__pyx_mstate_global->__pyx_freecount_8CyOpenGL___pyx_scope_struct_1_genexpr++] = ((struct __pyx_obj_8CyOpenGL___pyx_scope_struct_1_genexpr *)o);
  } else
  #endif
  {
    PyTypeObject *tp = Py_TYPE(o);
    #if CYTHON_USE_TYPE_SLOTS
    (*tp->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(tp);
    #endif
  }
}

static int __pyx_tp_traverse_8CyOpenGL___pyx_scope_struct_1_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8CyOpenGL___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_8CyOpenGL___pyx_scope_struct_1_genexpr *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->__pyx_genexpr_arg_0) {
    e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e;
  }
  if (p->__pyx_v_z) {
    e = (*v)(p->__pyx_v_z, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_8CyOpenGL___pyx_scope_struct_1_genexpr_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8CyOpenGL___pyx_scope_struct_1_genexpr},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_8CyOpenGL___pyx_scope_struct_1_genexpr},
  {Py_tp_new, (void *)__pyx_tp_new_8CyOpenGL___pyx_scope_struct_1_genexpr},
  {0, 0},
};
static PyType_Spec __pyx_type_8CyOpenGL___pyx_scope_struct_1_genexpr_spec = {
  "CyOpenGL.__pyx_scope_struct_1_genexpr",
  sizeof(struct __pyx_obj_8CyOpenGL___pyx_scope_struct_1_genexpr),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
  __pyx_type_8CyOpenGL___pyx_scope_struct_1_genexpr_slots,
};
#else

static PyTypeObject __pyx_type_8CyOpenGL___pyx_scope_struct_1_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "CyOpenGL.""__pyx_scope_struct_1_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_8CyOpenGL___pyx_scope_struct_1_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8CyOpenGL___pyx_scope_struct_1_genexpr, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_8CyOpenGL___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*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_8CyOpenGL___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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_array __pyx_vtable_array;

static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_array_obj *p;
  PyObject *o;
  o = __Pyx_AllocateExtensionType(t, 0);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_array_obj *)o);
  p->__pyx_vtab = __pyx_vtabptr_array;
  p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
  if (unlikely(__pyx_array___cinit__(o, a, k) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_array(PyObject *o) {
  struct __pyx_array_obj *p = (struct __pyx_array_obj *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_array) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    __Pyx_DeallocKeepAliveBegin(o);
    __pyx_array___dealloc__(o);
    __Pyx_DeallocKeepAliveEnd(o);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->mode);
  Py_CLEAR(p->_format);
  PyTypeObject *tp = Py_TYPE(o);
  #if CYTHON_USE_TYPE_SLOTS
  (*tp->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  Py_DECREF(tp);
  #endif
}

static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyLong_FromSsize_t(i); if(!x) return 0;
  #if CYTHON_USE_TYPE_SLOTS || (!CYTHON_USE_TYPE_SPECS && __PYX_LIMITED_VERSION_HEX < 0x030A0000)
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  #else
  r = ((binaryfunc)PyType_GetSlot(Py_TYPE(o), Py_mp_subscript))(o, x);
  #endif
  Py_DECREF(x);
  return r;
}

static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) {
  if (v) {
    return __pyx_array___setitem__(o, i, v);
  }
  else {
    __Pyx_TypeName o_type_name;
    o_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(o));
    PyErr_Format(PyExc_NotImplementedError,
      "Subscript deletion not supported by " __Pyx_FMT_TYPENAME, o_type_name);
    __Pyx_DECREF_TypeName(o_type_name);
    return -1;
  }
}

static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) {
  PyObject *v = PyObject_GenericGetAttr(o, n);
  if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
    PyErr_Clear();
    v = __pyx_array___getattr__(o, n);
  }
  return v;
}

static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
}

static PyMethodDef __pyx_methods_array[] = {
  {"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_array_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_array_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_array[] = {
  {"memview", __pyx_getprop___pyx_array_memview, 0, 0, 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
#if !CYTHON_COMPILING_IN_LIMITED_API

static PyBufferProcs __pyx_tp_as_buffer_array = {
  __pyx_array_getbuffer, /*bf_getbuffer*/
  0, /*bf_releasebuffer*/
};
#endif
static PyType_Slot __pyx_type___pyx_array_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_array},
  {Py_sq_length, (void *)__pyx_array___len__},
  {Py_sq_item, (void *)__pyx_sq_item_array},
  {Py_mp_length, (void *)__pyx_array___len__},
  {Py_mp_subscript, (void *)__pyx_array___getitem__},
  {Py_mp_ass_subscript, (void *)__pyx_mp_ass_subscript_array},
  {Py_tp_getattro, (void *)__pyx_tp_getattro_array},
  #if defined(Py_bf_getbuffer)
  {Py_bf_getbuffer, (void *)__pyx_array_getbuffer},
  #endif
  {Py_tp_methods, (void *)__pyx_methods_array},
  {Py_tp_getset, (void *)__pyx_getsets_array},
  {Py_tp_new, (void *)__pyx_tp_new_array},
  {0, 0},
};
static PyType_Spec __pyx_type___pyx_array_spec = {
  "CyOpenGL.array",
  sizeof(struct __pyx_array_obj),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_SEQUENCE,
  __pyx_type___pyx_array_slots,
};
#else

static PySequenceMethods __pyx_tp_as_sequence_array = {
  __pyx_array___len__, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_array, /*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_array = {
  __pyx_array___len__, /*mp_length*/
  __pyx_array___getitem__, /*mp_subscript*/
  __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_array = {
  __pyx_array_getbuffer, /*bf_getbuffer*/
  0, /*bf_releasebuffer*/
};

static PyTypeObject __pyx_type___pyx_array = {
  PyVarObject_HEAD_INIT(0, 0)
  "CyOpenGL.""array", /*tp_name*/
  sizeof(struct __pyx_array_obj), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_array, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence_array, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_array, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  __pyx_tp_getattro_array, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_array, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_SEQUENCE, /*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_array, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_array, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_array, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_MemviewEnum_obj *p;
  PyObject *o;
  o = __Pyx_AllocateExtensionType(t, 0);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_MemviewEnum_obj *)o);
  p->name = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_Enum(PyObject *o) {
  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_Enum) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->name);
  PyTypeObject *tp = Py_TYPE(o);
  #if CYTHON_USE_TYPE_SLOTS
  (*tp->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  Py_DECREF(tp);
  #endif
}

static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->name) {
    e = (*v)(p->name, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_Enum(PyObject *o) {
  PyObject* tmp;
  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
  tmp = ((PyObject*)p->name);
  p->name = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_Enum[] = {
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type___pyx_MemviewEnum_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_Enum},
  {Py_tp_repr, (void *)__pyx_MemviewEnum___repr__},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_Enum},
  {Py_tp_clear, (void *)__pyx_tp_clear_Enum},
  {Py_tp_methods, (void *)__pyx_methods_Enum},
  {Py_tp_init, (void *)__pyx_MemviewEnum___init__},
  {Py_tp_new, (void *)__pyx_tp_new_Enum},
  {0, 0},
};
static PyType_Spec __pyx_type___pyx_MemviewEnum_spec = {
  "CyOpenGL.Enum",
  sizeof(struct __pyx_MemviewEnum_obj),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
  __pyx_type___pyx_MemviewEnum_slots,
};
#else

static PyTypeObject __pyx_type___pyx_MemviewEnum = {
  PyVarObject_HEAD_INIT(0, 0)
  "CyOpenGL.""Enum", /*tp_name*/
  sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_Enum, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  __pyx_MemviewEnum___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_Enum, /*tp_traverse*/
  __pyx_tp_clear_Enum, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_Enum, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_MemviewEnum___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_Enum, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;

static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_memoryview_obj *p;
  PyObject *o;
  o = __Pyx_AllocateExtensionType(t, 0);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_memoryview_obj *)o);
  p->__pyx_vtab = __pyx_vtabptr_memoryview;
  p->obj = Py_None; Py_INCREF(Py_None);
  p->_size = Py_None; Py_INCREF(Py_None);
  p->view.obj = NULL;
  if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_memoryview(PyObject *o) {
  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_memoryview) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    __Pyx_DeallocKeepAliveBegin(o);
    __pyx_memoryview___dealloc__(o);
    __Pyx_DeallocKeepAliveEnd(o);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->obj);
  Py_CLEAR(p->_size);
  PyTypeObject *tp = Py_TYPE(o);
  #if CYTHON_USE_TYPE_SLOTS
  (*tp->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  Py_DECREF(tp);
  #endif
}

static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->obj) {
    e = (*v)(p->obj, a); if (e) return e;
  }
  if (p->_size) {
    e = (*v)(p->_size, a); if (e) return e;
  }
  if (p->view.obj) {
    e = (*v)(p->view.obj, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_memoryview(PyObject *o) {
  PyObject* tmp;
  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
  tmp = ((PyObject*)p->obj);
  p->obj = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_size);
  p->_size = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  Py_CLEAR(p->view.obj);
  return 0;
}

static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyLong_FromSsize_t(i); if(!x) return 0;
  #if CYTHON_USE_TYPE_SLOTS || (!CYTHON_USE_TYPE_SPECS && __PYX_LIMITED_VERSION_HEX < 0x030A0000)
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  #else
  r = ((binaryfunc)PyType_GetSlot(Py_TYPE(o), Py_mp_subscript))(o, x);
  #endif
  Py_DECREF(x);
  return r;
}

static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) {
  if (v) {
    return __pyx_memoryview___setitem__(o, i, v);
  }
  else {
    __Pyx_TypeName o_type_name;
    o_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(o));
    PyErr_Format(PyExc_NotImplementedError,
      "Subscript deletion not supported by " __Pyx_FMT_TYPENAME, o_type_name);
    __Pyx_DECREF_TypeName(o_type_name);
    return -1;
  }
}

static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
}

static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
}

static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
}

static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
}

static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
}

static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
}

static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
}

static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
}

static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
}

static PyMethodDef __pyx_methods_memoryview[] = {
  {"is_c_contig", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_memoryview_is_c_contig, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"is_f_contig", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_memoryview_is_f_contig, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"copy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_memoryview_copy, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"copy_fortran", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_memoryview_copy_fortran, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_memoryview_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_memoryview_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_memoryview[] = {
  {"T", __pyx_getprop___pyx_memoryview_T, 0, 0, 0},
  {"base", __pyx_getprop___pyx_memoryview_base, 0, 0, 0},
  {"shape", __pyx_getprop___pyx_memoryview_shape, 0, 0, 0},
  {"strides", __pyx_getprop___pyx_memoryview_strides, 0, 0, 0},
  {"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, 0, 0},
  {"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, 0, 0},
  {"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, 0, 0},
  {"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, 0, 0},
  {"size", __pyx_getprop___pyx_memoryview_size, 0, 0, 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
#if !CYTHON_COMPILING_IN_LIMITED_API

static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
  __pyx_memoryview_getbuffer, /*bf_getbuffer*/
  0, /*bf_releasebuffer*/
};
#endif
static PyType_Slot __pyx_type___pyx_memoryview_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_memoryview},
  {Py_tp_repr, (void *)__pyx_memoryview___repr__},
  {Py_sq_length, (void *)__pyx_memoryview___len__},
  {Py_sq_item, (void *)__pyx_sq_item_memoryview},
  {Py_mp_length, (void *)__pyx_memoryview___len__},
  {Py_mp_subscript, (void *)__pyx_memoryview___getitem__},
  {Py_mp_ass_subscript, (void *)__pyx_mp_ass_subscript_memoryview},
  {Py_tp_str, (void *)__pyx_memoryview___str__},
  #if defined(Py_bf_getbuffer)
  {Py_bf_getbuffer, (void *)__pyx_memoryview_getbuffer},
  #endif
  {Py_tp_traverse, (void *)__pyx_tp_traverse_memoryview},
  {Py_tp_clear, (void *)__pyx_tp_clear_memoryview},
  {Py_tp_methods, (void *)__pyx_methods_memoryview},
  {Py_tp_getset, (void *)__pyx_getsets_memoryview},
  {Py_tp_new, (void *)__pyx_tp_new_memoryview},
  {0, 0},
};
static PyType_Spec __pyx_type___pyx_memoryview_spec = {
  "CyOpenGL.memoryview",
  sizeof(struct __pyx_memoryview_obj),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
  __pyx_type___pyx_memoryview_slots,
};
#else

static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
  __pyx_memoryview___len__, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_memoryview, /*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_memoryview = {
  __pyx_memoryview___len__, /*mp_length*/
  __pyx_memoryview___getitem__, /*mp_subscript*/
  __pyx_mp_ass_subscript_memoryview, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
  __pyx_memoryview_getbuffer, /*bf_getbuffer*/
  0, /*bf_releasebuffer*/
};

static PyTypeObject __pyx_type___pyx_memoryview = {
  PyVarObject_HEAD_INIT(0, 0)
  "CyOpenGL.""memoryview", /*tp_name*/
  sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_memoryview, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  __pyx_memoryview___repr__, /*tp_repr*/
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence_memoryview, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_memoryview, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  __pyx_memoryview___str__, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_memoryview, /*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_memoryview, /*tp_traverse*/
  __pyx_tp_clear_memoryview, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_memoryview, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_memoryview, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_memoryview, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;

static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_memoryviewslice_obj *p;
  PyObject *o = __pyx_tp_new_memoryview(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_memoryviewslice_obj *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
  p->from_object = Py_None; Py_INCREF(Py_None);
  p->from_slice.memview = NULL;
  return o;
}

static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc__memoryviewslice) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    __Pyx_DeallocKeepAliveBegin(o);
    __pyx_memoryviewslice___dealloc__(o);
    __Pyx_DeallocKeepAliveEnd(o);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->from_object);
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_memoryview(o);
}

static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
  e = __pyx_tp_traverse_memoryview(o, v, a); if (e) return e;
  if (p->from_object) {
    e = (*v)(p->from_object, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
  PyObject* tmp;
  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
  __pyx_tp_clear_memoryview(o);
  tmp = ((PyObject*)p->from_object);
  p->from_object = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  __PYX_XCLEAR_MEMVIEW(&p->from_slice, 1);
  return 0;
}

static PyMethodDef __pyx_methods__memoryviewslice[] = {
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type___pyx_memoryviewslice_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc__memoryviewslice},
  {Py_tp_doc, (void *)PyDoc_STR("Internal class for passing memoryview slices to Python")},
  {Py_tp_traverse, (void *)__pyx_tp_traverse__memoryviewslice},
  {Py_tp_clear, (void *)__pyx_tp_clear__memoryviewslice},
  {Py_tp_methods, (void *)__pyx_methods__memoryviewslice},
  {Py_tp_new, (void *)__pyx_tp_new__memoryviewslice},
  {0, 0},
};
static PyType_Spec __pyx_type___pyx_memoryviewslice_spec = {
  "CyOpenGL._memoryviewslice",
  sizeof(struct __pyx_memoryviewslice_obj),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_SEQUENCE,
  __pyx_type___pyx_memoryviewslice_slots,
};
#else

static PyTypeObject __pyx_type___pyx_memoryviewslice = {
  PyVarObject_HEAD_INIT(0, 0)
  "CyOpenGL.""_memoryviewslice", /*tp_name*/
  sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  #if CYTHON_COMPILING_IN_PYPY || 0
  __pyx_memoryview___repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY || 0
  __pyx_memoryview___str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_SEQUENCE, /*tp_flags*/
  PyDoc_STR("Internal class for passing memoryview slices to Python"), /*tp_doc*/
  __pyx_tp_traverse__memoryviewslice, /*tp_traverse*/
  __pyx_tp_clear__memoryviewslice, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods__memoryviewslice, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new__memoryviewslice, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyMethodDef __pyx_methods[] = {
  {0, 0, 0, 0}
};
/* #### Code section: initfunc_declarations ### */
static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate); /*proto*/
/* #### Code section: init_module ### */

static int __Pyx_modinit_global_init_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
  /*--- Global init code ---*/
  __pyx_collections_abc_Sequence = Py_None; Py_INCREF(Py_None);
  generic = Py_None; Py_INCREF(Py_None);
  strided = Py_None; Py_INCREF(Py_None);
  indirect = Py_None; Py_INCREF(Py_None);
  contiguous = Py_None; Py_INCREF(Py_None);
  indirect_contiguous = Py_None; Py_INCREF(Py_None);
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_variable_export_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
  /*--- Variable export code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_function_export_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
  /*--- Function export code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
  /*--- Type init code ---*/
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_8CyOpenGL_vector3 = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8CyOpenGL_vector3_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_8CyOpenGL_vector3)) __PYX_ERR(11, 1, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8CyOpenGL_vector3_spec, __pyx_mstate->__pyx_ptype_8CyOpenGL_vector3) < (0)) __PYX_ERR(11, 1, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8CyOpenGL_vector3 = &__pyx_type_8CyOpenGL_vector3;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8CyOpenGL_vector3) < (0)) __PYX_ERR(11, 1, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8CyOpenGL_vector3);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8CyOpenGL_vector3->tp_dictoffset && __pyx_mstate->__pyx_ptype_8CyOpenGL_vector3->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8CyOpenGL_vector3->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  #if CYTHON_UPDATE_DESCRIPTOR_DOC
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)__pyx_mstate->__pyx_ptype_8CyOpenGL_vector3, "__repr__"); if (unlikely(!wrapper)) __PYX_ERR(11, 1, __pyx_L1_error)
    if (__Pyx_IS_TYPE(wrapper, &PyWrapperDescr_Type)) {
      __pyx_wrapperbase_8CyOpenGL_7vector3_2__repr__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_8CyOpenGL_7vector3_2__repr__.doc = __pyx_doc_8CyOpenGL_7vector3_2__repr__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8CyOpenGL_7vector3_2__repr__;
    }
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_vector3, (PyObject *) __pyx_mstate->__pyx_ptype_8CyOpenGL_vector3) < (0)) __PYX_ERR(11, 1, __pyx_L1_error)
  __pyx_vtabptr_8CyOpenGL_GLobject = &__pyx_vtable_8CyOpenGL_GLobject;
  __pyx_vtable_8CyOpenGL_GLobject.set_material = (PyObject *(*)(struct __pyx_obj_8CyOpenGL_GLobject *))__pyx_f_8CyOpenGL_8GLobject_set_material;
  __pyx_vtable_8CyOpenGL_GLobject.display = (PyObject *(*)(struct __pyx_obj_8CyOpenGL_GLobject *, int __pyx_skip_dispatch))__pyx_f_8CyOpenGL_8GLobject_display;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_8CyOpenGL_GLobject = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8CyOpenGL_GLobject_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_8CyOpenGL_GLobject)) __PYX_ERR(12, 1, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8CyOpenGL_GLobject_spec, __pyx_mstate->__pyx_ptype_8CyOpenGL_GLobject) < (0)) __PYX_ERR(12, 1, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8CyOpenGL_GLobject = &__pyx_type_8CyOpenGL_GLobject;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8CyOpenGL_GLobject) < (0)) __PYX_ERR(12, 1, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8CyOpenGL_GLobject);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8CyOpenGL_GLobject->tp_dictoffset && __pyx_mstate->__pyx_ptype_8CyOpenGL_GLobject->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8CyOpenGL_GLobject->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_8CyOpenGL_GLobject, __pyx_vtabptr_8CyOpenGL_GLobject) < (0)) __PYX_ERR(12, 1, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_8CyOpenGL_GLobject) < (0)) __PYX_ERR(12, 1, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_GLobject, (PyObject *) __pyx_mstate->__pyx_ptype_8CyOpenGL_GLobject) < (0)) __PYX_ERR(12, 1, __pyx_L1_error)
  __pyx_vtabptr_8CyOpenGL_WireframeSphere = &__pyx_vtable_8CyOpenGL_WireframeSphere;
  __pyx_vtable_8CyOpenGL_WireframeSphere.__pyx_base = *__pyx_vtabptr_8CyOpenGL_GLobject;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_8CyOpenGL_GLobject); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_ptype_8CyOpenGL_WireframeSphere = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8CyOpenGL_WireframeSphere_spec, __pyx_t_1);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_8CyOpenGL_WireframeSphere)) __PYX_ERR(13, 1, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8CyOpenGL_WireframeSphere_spec, __pyx_mstate->__pyx_ptype_8CyOpenGL_WireframeSphere) < (0)) __PYX_ERR(13, 1, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8CyOpenGL_WireframeSphere = &__pyx_type_8CyOpenGL_WireframeSphere;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_8CyOpenGL_WireframeSphere->tp_base = __pyx_mstate_global->__pyx_ptype_8CyOpenGL_GLobject;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8CyOpenGL_WireframeSphere) < (0)) __PYX_ERR(13, 1, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8CyOpenGL_WireframeSphere);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8CyOpenGL_WireframeSphere->tp_dictoffset && __pyx_mstate->__pyx_ptype_8CyOpenGL_WireframeSphere->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8CyOpenGL_WireframeSphere->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_8CyOpenGL_WireframeSphere, __pyx_vtabptr_8CyOpenGL_WireframeSphere) < (0)) __PYX_ERR(13, 1, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_8CyOpenGL_WireframeSphere) < (0)) __PYX_ERR(13, 1, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_WireframeSphere, (PyObject *) __pyx_mstate->__pyx_ptype_8CyOpenGL_WireframeSphere) < (0)) __PYX_ERR(13, 1, __pyx_L1_error)
  __pyx_vtabptr_8CyOpenGL_MeshedSurface = &__pyx_vtable_8CyOpenGL_MeshedSurface;
  __pyx_vtable_8CyOpenGL_MeshedSurface.__pyx_base = *__pyx_vtabptr_8CyOpenGL_GLobject;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_8CyOpenGL_GLobject); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_ptype_8CyOpenGL_MeshedSurface = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8CyOpenGL_MeshedSurface_spec, __pyx_t_1);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_8CyOpenGL_MeshedSurface)) __PYX_ERR(2, 2, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8CyOpenGL_MeshedSurface_spec, __pyx_mstate->__pyx_ptype_8CyOpenGL_MeshedSurface) < (0)) __PYX_ERR(2, 2, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8CyOpenGL_MeshedSurface = &__pyx_type_8CyOpenGL_MeshedSurface;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_8CyOpenGL_MeshedSurface->tp_base = __pyx_mstate_global->__pyx_ptype_8CyOpenGL_GLobject;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8CyOpenGL_MeshedSurface) < (0)) __PYX_ERR(2, 2, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8CyOpenGL_MeshedSurface);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8CyOpenGL_MeshedSurface->tp_dictoffset && __pyx_mstate->__pyx_ptype_8CyOpenGL_MeshedSurface->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8CyOpenGL_MeshedSurface->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_8CyOpenGL_MeshedSurface, __pyx_vtabptr_8CyOpenGL_MeshedSurface) < (0)) __PYX_ERR(2, 2, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_8CyOpenGL_MeshedSurface) < (0)) __PYX_ERR(2, 2, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_MeshedSurface, (PyObject *) __pyx_mstate->__pyx_ptype_8CyOpenGL_MeshedSurface) < (0)) __PYX_ERR(2, 2, __pyx_L1_error)
  __pyx_vtabptr_8CyOpenGL_PoincareTriangle = &__pyx_vtable_8CyOpenGL_PoincareTriangle;
  __pyx_vtable_8CyOpenGL_PoincareTriangle.__pyx_base = *__pyx_vtabptr_8CyOpenGL_MeshedSurface;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_8CyOpenGL_MeshedSurface); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_ptype_8CyOpenGL_PoincareTriangle = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8CyOpenGL_PoincareTriangle_spec, __pyx_t_1);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_8CyOpenGL_PoincareTriangle)) __PYX_ERR(15, 1, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8CyOpenGL_PoincareTriangle_spec, __pyx_mstate->__pyx_ptype_8CyOpenGL_PoincareTriangle) < (0)) __PYX_ERR(15, 1, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8CyOpenGL_PoincareTriangle = &__pyx_type_8CyOpenGL_PoincareTriangle;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_8CyOpenGL_PoincareTriangle->tp_base = __pyx_mstate_global->__pyx_ptype_8CyOpenGL_MeshedSurface;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8CyOpenGL_PoincareTriangle) < (0)) __PYX_ERR(15, 1, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8CyOpenGL_PoincareTriangle);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8CyOpenGL_PoincareTriangle->tp_dictoffset && __pyx_mstate->__pyx_ptype_8CyOpenGL_PoincareTriangle->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8CyOpenGL_PoincareTriangle->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_8CyOpenGL_PoincareTriangle, __pyx_vtabptr_8CyOpenGL_PoincareTriangle) < (0)) __PYX_ERR(15, 1, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_8CyOpenGL_PoincareTriangle) < (0)) __PYX_ERR(15, 1, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_PoincareTriangle, (PyObject *) __pyx_mstate->__pyx_ptype_8CyOpenGL_PoincareTriangle) < (0)) __PYX_ERR(15, 1, __pyx_L1_error)
  __pyx_vtabptr_8CyOpenGL_PoincarePolygon = &__pyx_vtable_8CyOpenGL_PoincarePolygon;
  __pyx_vtable_8CyOpenGL_PoincarePolygon.__pyx_base = *__pyx_vtabptr_8CyOpenGL_GLobject;
  __pyx_vtable_8CyOpenGL_PoincarePolygon.triangulate = (PyObject *(*)(struct __pyx_obj_8CyOpenGL_PoincarePolygon *))__pyx_f_8CyOpenGL_15PoincarePolygon_triangulate;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_8CyOpenGL_GLobject); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_ptype_8CyOpenGL_PoincarePolygon = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8CyOpenGL_PoincarePolygon_spec, __pyx_t_1);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_8CyOpenGL_PoincarePolygon)) __PYX_ERR(3, 1, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8CyOpenGL_PoincarePolygon_spec, __pyx_mstate->__pyx_ptype_8CyOpenGL_PoincarePolygon) < (0)) __PYX_ERR(3, 1, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8CyOpenGL_PoincarePolygon = &__pyx_type_8CyOpenGL_PoincarePolygon;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_8CyOpenGL_PoincarePolygon->tp_base = __pyx_mstate_global->__pyx_ptype_8CyOpenGL_GLobject;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8CyOpenGL_PoincarePolygon) < (0)) __PYX_ERR(3, 1, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8CyOpenGL_PoincarePolygon);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8CyOpenGL_PoincarePolygon->tp_dictoffset && __pyx_mstate->__pyx_ptype_8CyOpenGL_PoincarePolygon->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8CyOpenGL_PoincarePolygon->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_8CyOpenGL_PoincarePolygon, __pyx_vtabptr_8CyOpenGL_PoincarePolygon) < (0)) __PYX_ERR(3, 1, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_8CyOpenGL_PoincarePolygon) < (0)) __PYX_ERR(3, 1, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_PoincarePolygon, (PyObject *) __pyx_mstate->__pyx_ptype_8CyOpenGL_PoincarePolygon) < (0)) __PYX_ERR(3, 1, __pyx_L1_error)
  __pyx_vtabptr_8CyOpenGL_KleinPolygon = &__pyx_vtable_8CyOpenGL_KleinPolygon;
  __pyx_vtable_8CyOpenGL_KleinPolygon.__pyx_base = *__pyx_vtabptr_8CyOpenGL_GLobject;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_8CyOpenGL_GLobject); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_ptype_8CyOpenGL_KleinPolygon = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8CyOpenGL_KleinPolygon_spec, __pyx_t_1);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_8CyOpenGL_KleinPolygon)) __PYX_ERR(16, 1, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8CyOpenGL_KleinPolygon_spec, __pyx_mstate->__pyx_ptype_8CyOpenGL_KleinPolygon) < (0)) __PYX_ERR(16, 1, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8CyOpenGL_KleinPolygon = &__pyx_type_8CyOpenGL_KleinPolygon;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_8CyOpenGL_KleinPolygon->tp_base = __pyx_mstate_global->__pyx_ptype_8CyOpenGL_GLobject;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8CyOpenGL_KleinPolygon) < (0)) __PYX_ERR(16, 1, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8CyOpenGL_KleinPolygon);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8CyOpenGL_KleinPolygon->tp_dictoffset && __pyx_mstate->__pyx_ptype_8CyOpenGL_KleinPolygon->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8CyOpenGL_KleinPolygon->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_8CyOpenGL_KleinPolygon, __pyx_vtabptr_8CyOpenGL_KleinPolygon) < (0)) __PYX_ERR(16, 1, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_8CyOpenGL_KleinPolygon) < (0)) __PYX_ERR(16, 1, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_KleinPolygon, (PyObject *) __pyx_mstate->__pyx_ptype_8CyOpenGL_KleinPolygon) < (0)) __PYX_ERR(16, 1, __pyx_L1_error)
  __pyx_vtabptr_8CyOpenGL_Colorizer = &__pyx_vtable_8CyOpenGL_Colorizer;
  __pyx_vtable_8CyOpenGL_Colorizer.index_to_hue = (double (*)(struct __pyx_obj_8CyOpenGL_Colorizer *, int))__pyx_f_8CyOpenGL_9Colorizer_index_to_hue;
  __pyx_vtable_8CyOpenGL_Colorizer.hls_to_rgb = (PyObject *(*)(struct __pyx_obj_8CyOpenGL_Colorizer *, double, double, double))__pyx_f_8CyOpenGL_9Colorizer_hls_to_rgb;
  __pyx_vtable_8CyOpenGL_Colorizer.hls_interp = (PyObject *(*)(struct __pyx_obj_8CyOpenGL_Colorizer *, double, double, double))__pyx_f_8CyOpenGL_9Colorizer_hls_interp;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_8CyOpenGL_Colorizer = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8CyOpenGL_Colorizer_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_8CyOpenGL_Colorizer)) __PYX_ERR(18, 1, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8CyOpenGL_Colorizer_spec, __pyx_mstate->__pyx_ptype_8CyOpenGL_Colorizer) < (0)) __PYX_ERR(18, 1, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8CyOpenGL_Colorizer = &__pyx_type_8CyOpenGL_Colorizer;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8CyOpenGL_Colorizer) < (0)) __PYX_ERR(18, 1, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8CyOpenGL_Colorizer);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8CyOpenGL_Colorizer->tp_dictoffset && __pyx_mstate->__pyx_ptype_8CyOpenGL_Colorizer->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8CyOpenGL_Colorizer->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_8CyOpenGL_Colorizer, __pyx_vtabptr_8CyOpenGL_Colorizer) < (0)) __PYX_ERR(18, 1, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_8CyOpenGL_Colorizer) < (0)) __PYX_ERR(18, 1, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_Colorizer, (PyObject *) __pyx_mstate->__pyx_ptype_8CyOpenGL_Colorizer) < (0)) __PYX_ERR(18, 1, __pyx_L1_error)
  __pyx_vtabptr_8CyOpenGL_Horosphere = &__pyx_vtable_8CyOpenGL_Horosphere;
  __pyx_vtable_8CyOpenGL_Horosphere.__pyx_base = *__pyx_vtabptr_8CyOpenGL_MeshedSurface;
  __pyx_vtable_8CyOpenGL_Horosphere.build_vertices_and_normals = (PyObject *(*)(struct __pyx_obj_8CyOpenGL_Horosphere *))__pyx_f_8CyOpenGL_10Horosphere_build_vertices_and_normals;
  __pyx_vtable_8CyOpenGL_Horosphere.build_triangles = (PyObject *(*)(struct __pyx_obj_8CyOpenGL_Horosphere *))__pyx_f_8CyOpenGL_10Horosphere_build_triangles;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_8CyOpenGL_MeshedSurface); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_ptype_8CyOpenGL_Horosphere = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8CyOpenGL_Horosphere_spec, __pyx_t_1);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_8CyOpenGL_Horosphere)) __PYX_ERR(19, 1, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8CyOpenGL_Horosphere_spec, __pyx_mstate->__pyx_ptype_8CyOpenGL_Horosphere) < (0)) __PYX_ERR(19, 1, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8CyOpenGL_Horosphere = &__pyx_type_8CyOpenGL_Horosphere;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_8CyOpenGL_Horosphere->tp_base = __pyx_mstate_global->__pyx_ptype_8CyOpenGL_MeshedSurface;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8CyOpenGL_Horosphere) < (0)) __PYX_ERR(19, 1, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8CyOpenGL_Horosphere);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8CyOpenGL_Horosphere->tp_dictoffset && __pyx_mstate->__pyx_ptype_8CyOpenGL_Horosphere->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8CyOpenGL_Horosphere->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_8CyOpenGL_Horosphere, __pyx_vtabptr_8CyOpenGL_Horosphere) < (0)) __PYX_ERR(19, 1, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_8CyOpenGL_Horosphere) < (0)) __PYX_ERR(19, 1, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_Horosphere, (PyObject *) __pyx_mstate->__pyx_ptype_8CyOpenGL_Horosphere) < (0)) __PYX_ERR(19, 1, __pyx_L1_error)
  __pyx_vtabptr_8CyOpenGL_HoroballGroup = &__pyx_vtable_8CyOpenGL_HoroballGroup;
  __pyx_vtable_8CyOpenGL_HoroballGroup.__pyx_base = *__pyx_vtabptr_8CyOpenGL_GLobject;
  __pyx_vtable_8CyOpenGL_HoroballGroup.build_spheres = (PyObject *(*)(struct __pyx_obj_8CyOpenGL_HoroballGroup *))__pyx_f_8CyOpenGL_13HoroballGroup_build_spheres;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_8CyOpenGL_GLobject); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_ptype_8CyOpenGL_HoroballGroup = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8CyOpenGL_HoroballGroup_spec, __pyx_t_1);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_8CyOpenGL_HoroballGroup)) __PYX_ERR(4, 1, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8CyOpenGL_HoroballGroup_spec, __pyx_mstate->__pyx_ptype_8CyOpenGL_HoroballGroup) < (0)) __PYX_ERR(4, 1, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8CyOpenGL_HoroballGroup = &__pyx_type_8CyOpenGL_HoroballGroup;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_8CyOpenGL_HoroballGroup->tp_base = __pyx_mstate_global->__pyx_ptype_8CyOpenGL_GLobject;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8CyOpenGL_HoroballGroup) < (0)) __PYX_ERR(4, 1, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8CyOpenGL_HoroballGroup);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8CyOpenGL_HoroballGroup->tp_dictoffset && __pyx_mstate->__pyx_ptype_8CyOpenGL_HoroballGroup->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8CyOpenGL_HoroballGroup->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_8CyOpenGL_HoroballGroup, __pyx_vtabptr_8CyOpenGL_HoroballGroup) < (0)) __PYX_ERR(4, 1, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_8CyOpenGL_HoroballGroup) < (0)) __PYX_ERR(4, 1, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_HoroballGroup, (PyObject *) __pyx_mstate->__pyx_ptype_8CyOpenGL_HoroballGroup) < (0)) __PYX_ERR(4, 1, __pyx_L1_error)
  __pyx_vtabptr_8CyOpenGL_Parallelogram = &__pyx_vtable_8CyOpenGL_Parallelogram;
  __pyx_vtable_8CyOpenGL_Parallelogram.__pyx_base = *__pyx_vtabptr_8CyOpenGL_GLobject;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_8CyOpenGL_GLobject); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_ptype_8CyOpenGL_Parallelogram = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8CyOpenGL_Parallelogram_spec, __pyx_t_1);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_8CyOpenGL_Parallelogram)) __PYX_ERR(20, 1, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8CyOpenGL_Parallelogram_spec, __pyx_mstate->__pyx_ptype_8CyOpenGL_Parallelogram) < (0)) __PYX_ERR(20, 1, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8CyOpenGL_Parallelogram = &__pyx_type_8CyOpenGL_Parallelogram;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_8CyOpenGL_Parallelogram->tp_base = __pyx_mstate_global->__pyx_ptype_8CyOpenGL_GLobject;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8CyOpenGL_Parallelogram) < (0)) __PYX_ERR(20, 1, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8CyOpenGL_Parallelogram);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8CyOpenGL_Parallelogram->tp_dictoffset && __pyx_mstate->__pyx_ptype_8CyOpenGL_Parallelogram->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8CyOpenGL_Parallelogram->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_8CyOpenGL_Parallelogram, __pyx_vtabptr_8CyOpenGL_Parallelogram) < (0)) __PYX_ERR(20, 1, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_8CyOpenGL_Parallelogram) < (0)) __PYX_ERR(20, 1, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_Parallelogram, (PyObject *) __pyx_mstate->__pyx_ptype_8CyOpenGL_Parallelogram) < (0)) __PYX_ERR(20, 1, __pyx_L1_error)
  __pyx_vtabptr_8CyOpenGL_EdgeSet = &__pyx_vtable_8CyOpenGL_EdgeSet;
  __pyx_vtable_8CyOpenGL_EdgeSet.__pyx_base = *__pyx_vtabptr_8CyOpenGL_GLobject;
  __pyx_vtable_8CyOpenGL_EdgeSet.set_dark_color = (PyObject *(*)(struct __pyx_obj_8CyOpenGL_EdgeSet *))__pyx_f_8CyOpenGL_7EdgeSet_set_dark_color;
  __pyx_vtable_8CyOpenGL_EdgeSet.set_light_color = (PyObject *(*)(struct __pyx_obj_8CyOpenGL_EdgeSet *))__pyx_f_8CyOpenGL_7EdgeSet_set_light_color;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_8CyOpenGL_GLobject); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_ptype_8CyOpenGL_EdgeSet = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8CyOpenGL_EdgeSet_spec, __pyx_t_1);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_8CyOpenGL_EdgeSet)) __PYX_ERR(21, 1, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8CyOpenGL_EdgeSet_spec, __pyx_mstate->__pyx_ptype_8CyOpenGL_EdgeSet) < (0)) __PYX_ERR(21, 1, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8CyOpenGL_EdgeSet = &__pyx_type_8CyOpenGL_EdgeSet;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_8CyOpenGL_EdgeSet->tp_base = __pyx_mstate_global->__pyx_ptype_8CyOpenGL_GLobject;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8CyOpenGL_EdgeSet) < (0)) __PYX_ERR(21, 1, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8CyOpenGL_EdgeSet);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8CyOpenGL_EdgeSet->tp_dictoffset && __pyx_mstate->__pyx_ptype_8CyOpenGL_EdgeSet->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8CyOpenGL_EdgeSet->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_8CyOpenGL_EdgeSet, __pyx_vtabptr_8CyOpenGL_EdgeSet) < (0)) __PYX_ERR(21, 1, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_8CyOpenGL_EdgeSet) < (0)) __PYX_ERR(21, 1, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_EdgeSet, (PyObject *) __pyx_mstate->__pyx_ptype_8CyOpenGL_EdgeSet) < (0)) __PYX_ERR(21, 1, __pyx_L1_error)
  __pyx_vtabptr_8CyOpenGL_FordEdgeSet = &__pyx_vtable_8CyOpenGL_FordEdgeSet;
  __pyx_vtable_8CyOpenGL_FordEdgeSet.__pyx_base = *__pyx_vtabptr_8CyOpenGL_EdgeSet;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_8CyOpenGL_EdgeSet); if (unlikely(!__pyx_t_1)) __PYX_ERR(36, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_ptype_8CyOpenGL_FordEdgeSet = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8CyOpenGL_FordEdgeSet_spec, __pyx_t_1);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_8CyOpenGL_FordEdgeSet)) __PYX_ERR(36, 1, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8CyOpenGL_FordEdgeSet_spec, __pyx_mstate->__pyx_ptype_8CyOpenGL_FordEdgeSet) < (0)) __PYX_ERR(36, 1, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8CyOpenGL_FordEdgeSet = &__pyx_type_8CyOpenGL_FordEdgeSet;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_8CyOpenGL_FordEdgeSet->tp_base = __pyx_mstate_global->__pyx_ptype_8CyOpenGL_EdgeSet;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8CyOpenGL_FordEdgeSet) < (0)) __PYX_ERR(36, 1, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8CyOpenGL_FordEdgeSet);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8CyOpenGL_FordEdgeSet->tp_dictoffset && __pyx_mstate->__pyx_ptype_8CyOpenGL_FordEdgeSet->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8CyOpenGL_FordEdgeSet->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_8CyOpenGL_FordEdgeSet, __pyx_vtabptr_8CyOpenGL_FordEdgeSet) < (0)) __PYX_ERR(36, 1, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_8CyOpenGL_FordEdgeSet) < (0)) __PYX_ERR(36, 1, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_FordEdgeSet, (PyObject *) __pyx_mstate->__pyx_ptype_8CyOpenGL_FordEdgeSet) < (0)) __PYX_ERR(36, 1, __pyx_L1_error)
  __pyx_vtabptr_8CyOpenGL_TriangulationEdgeSet = &__pyx_vtable_8CyOpenGL_TriangulationEdgeSet;
  __pyx_vtable_8CyOpenGL_TriangulationEdgeSet.__pyx_base = *__pyx_vtabptr_8CyOpenGL_EdgeSet;
  __pyx_vtable_8CyOpenGL_TriangulationEdgeSet.__pyx_base.set_light_color = (PyObject *(*)(struct __pyx_obj_8CyOpenGL_EdgeSet *))__pyx_f_8CyOpenGL_20TriangulationEdgeSet_set_light_color;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_8CyOpenGL_EdgeSet); if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_ptype_8CyOpenGL_TriangulationEdgeSet = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8CyOpenGL_TriangulationEdgeSet_spec, __pyx_t_1);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_8CyOpenGL_TriangulationEdgeSet)) __PYX_ERR(22, 1, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8CyOpenGL_TriangulationEdgeSet_spec, __pyx_mstate->__pyx_ptype_8CyOpenGL_TriangulationEdgeSet) < (0)) __PYX_ERR(22, 1, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8CyOpenGL_TriangulationEdgeSet = &__pyx_type_8CyOpenGL_TriangulationEdgeSet;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_8CyOpenGL_TriangulationEdgeSet->tp_base = __pyx_mstate_global->__pyx_ptype_8CyOpenGL_EdgeSet;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8CyOpenGL_TriangulationEdgeSet) < (0)) __PYX_ERR(22, 1, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8CyOpenGL_TriangulationEdgeSet);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8CyOpenGL_TriangulationEdgeSet->tp_dictoffset && __pyx_mstate->__pyx_ptype_8CyOpenGL_TriangulationEdgeSet->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8CyOpenGL_TriangulationEdgeSet->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_8CyOpenGL_TriangulationEdgeSet, __pyx_vtabptr_8CyOpenGL_TriangulationEdgeSet) < (0)) __PYX_ERR(22, 1, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_8CyOpenGL_TriangulationEdgeSet) < (0)) __PYX_ERR(22, 1, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_TriangulationEdgeSet, (PyObject *) __pyx_mstate->__pyx_ptype_8CyOpenGL_TriangulationEdgeSet) < (0)) __PYX_ERR(22, 1, __pyx_L1_error)
  __pyx_vtabptr_8CyOpenGL_Label = &__pyx_vtable_8CyOpenGL_Label;
  __pyx_vtable_8CyOpenGL_Label.get_shape = (PyObject *(*)(struct __pyx_obj_8CyOpenGL_Label *))__pyx_f_8CyOpenGL_5Label_get_shape;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_8CyOpenGL_Label = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8CyOpenGL_Label_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_8CyOpenGL_Label)) __PYX_ERR(23, 1, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8CyOpenGL_Label_spec, __pyx_mstate->__pyx_ptype_8CyOpenGL_Label) < (0)) __PYX_ERR(23, 1, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8CyOpenGL_Label = &__pyx_type_8CyOpenGL_Label;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8CyOpenGL_Label) < (0)) __PYX_ERR(23, 1, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8CyOpenGL_Label);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8CyOpenGL_Label->tp_dictoffset && __pyx_mstate->__pyx_ptype_8CyOpenGL_Label->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8CyOpenGL_Label->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_8CyOpenGL_Label, __pyx_vtabptr_8CyOpenGL_Label) < (0)) __PYX_ERR(23, 1, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_8CyOpenGL_Label) < (0)) __PYX_ERR(23, 1, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_Label, (PyObject *) __pyx_mstate->__pyx_ptype_8CyOpenGL_Label) < (0)) __PYX_ERR(23, 1, __pyx_L1_error)
  __pyx_vtabptr_8CyOpenGL_LabelSet = &__pyx_vtable_8CyOpenGL_LabelSet;
  __pyx_vtable_8CyOpenGL_LabelSet.__pyx_base = *__pyx_vtabptr_8CyOpenGL_GLobject;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_8CyOpenGL_GLobject); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_ptype_8CyOpenGL_LabelSet = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8CyOpenGL_LabelSet_spec, __pyx_t_1);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_8CyOpenGL_LabelSet)) __PYX_ERR(24, 1, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8CyOpenGL_LabelSet_spec, __pyx_mstate->__pyx_ptype_8CyOpenGL_LabelSet) < (0)) __PYX_ERR(24, 1, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8CyOpenGL_LabelSet = &__pyx_type_8CyOpenGL_LabelSet;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_8CyOpenGL_LabelSet->tp_base = __pyx_mstate_global->__pyx_ptype_8CyOpenGL_GLobject;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8CyOpenGL_LabelSet) < (0)) __PYX_ERR(24, 1, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8CyOpenGL_LabelSet);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8CyOpenGL_LabelSet->tp_dictoffset && __pyx_mstate->__pyx_ptype_8CyOpenGL_LabelSet->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8CyOpenGL_LabelSet->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_8CyOpenGL_LabelSet, __pyx_vtabptr_8CyOpenGL_LabelSet) < (0)) __PYX_ERR(24, 1, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_8CyOpenGL_LabelSet) < (0)) __PYX_ERR(24, 1, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_LabelSet, (PyObject *) __pyx_mstate->__pyx_ptype_8CyOpenGL_LabelSet) < (0)) __PYX_ERR(24, 1, __pyx_L1_error)
  __pyx_vtabptr_8CyOpenGL_HoroballScene = &__pyx_vtable_8CyOpenGL_HoroballScene;
  __pyx_vtable_8CyOpenGL_HoroballScene.build_shifts = (PyObject *(*)(struct __pyx_obj_8CyOpenGL_HoroballScene *, PyObject *, PyObject *))__pyx_f_8CyOpenGL_13HoroballScene_build_shifts;
  __pyx_vtable_8CyOpenGL_HoroballScene.right_top = (PyObject *(*)(struct __pyx_obj_8CyOpenGL_HoroballScene *))__pyx_f_8CyOpenGL_13HoroballScene_right_top;
  __pyx_vtable_8CyOpenGL_HoroballScene.gl_compile = (PyObject *(*)(struct __pyx_obj_8CyOpenGL_HoroballScene *))__pyx_f_8CyOpenGL_13HoroballScene_gl_compile;
  __pyx_vtable_8CyOpenGL_HoroballScene.draw_segments = (PyObject *(*)(struct __pyx_obj_8CyOpenGL_HoroballScene *, PyObject *, PyObject *))__pyx_f_8CyOpenGL_13HoroballScene_draw_segments;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_8CyOpenGL_HoroballScene = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8CyOpenGL_HoroballScene_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_8CyOpenGL_HoroballScene)) __PYX_ERR(25, 1, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8CyOpenGL_HoroballScene_spec, __pyx_mstate->__pyx_ptype_8CyOpenGL_HoroballScene) < (0)) __PYX_ERR(25, 1, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8CyOpenGL_HoroballScene = &__pyx_type_8CyOpenGL_HoroballScene;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8CyOpenGL_HoroballScene) < (0)) __PYX_ERR(25, 1, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8CyOpenGL_HoroballScene);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8CyOpenGL_HoroballScene->tp_dictoffset && __pyx_mstate->__pyx_ptype_8CyOpenGL_HoroballScene->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8CyOpenGL_HoroballScene->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_8CyOpenGL_HoroballScene, __pyx_vtabptr_8CyOpenGL_HoroballScene) < (0)) __PYX_ERR(25, 1, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_8CyOpenGL_HoroballScene) < (0)) __PYX_ERR(25, 1, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_HoroballScene, (PyObject *) __pyx_mstate->__pyx_ptype_8CyOpenGL_HoroballScene) < (0)) __PYX_ERR(25, 1, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_8CyOpenGL_DataBasedTexture = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8CyOpenGL_DataBasedTexture_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_8CyOpenGL_DataBasedTexture)) __PYX_ERR(28, 1, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8CyOpenGL_DataBasedTexture_spec, __pyx_mstate->__pyx_ptype_8CyOpenGL_DataBasedTexture) < (0)) __PYX_ERR(28, 1, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8CyOpenGL_DataBasedTexture = &__pyx_type_8CyOpenGL_DataBasedTexture;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8CyOpenGL_DataBasedTexture) < (0)) __PYX_ERR(28, 1, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8CyOpenGL_DataBasedTexture);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8CyOpenGL_DataBasedTexture->tp_dictoffset && __pyx_mstate->__pyx_ptype_8CyOpenGL_DataBasedTexture->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8CyOpenGL_DataBasedTexture->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_DataBasedTexture, (PyObject *) __pyx_mstate->__pyx_ptype_8CyOpenGL_DataBasedTexture) < (0)) __PYX_ERR(28, 1, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_8CyOpenGL_UniformBufferObject = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8CyOpenGL_UniformBufferObject_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_8CyOpenGL_UniformBufferObject)) __PYX_ERR(29, 13, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8CyOpenGL_UniformBufferObject_spec, __pyx_mstate->__pyx_ptype_8CyOpenGL_UniformBufferObject) < (0)) __PYX_ERR(29, 13, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8CyOpenGL_UniformBufferObject = &__pyx_type_8CyOpenGL_UniformBufferObject;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8CyOpenGL_UniformBufferObject) < (0)) __PYX_ERR(29, 13, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8CyOpenGL_UniformBufferObject);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8CyOpenGL_UniformBufferObject->tp_dictoffset && __pyx_mstate->__pyx_ptype_8CyOpenGL_UniformBufferObject->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8CyOpenGL_UniformBufferObject->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_UniformBufferObject, (PyObject *) __pyx_mstate->__pyx_ptype_8CyOpenGL_UniformBufferObject) < (0)) __PYX_ERR(29, 13, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_8CyOpenGL_GLSLProgram = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8CyOpenGL_GLSLProgram_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_8CyOpenGL_GLSLProgram)) __PYX_ERR(30, 63, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8CyOpenGL_GLSLProgram_spec, __pyx_mstate->__pyx_ptype_8CyOpenGL_GLSLProgram) < (0)) __PYX_ERR(30, 63, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8CyOpenGL_GLSLProgram = &__pyx_type_8CyOpenGL_GLSLProgram;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8CyOpenGL_GLSLProgram) < (0)) __PYX_ERR(30, 63, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8CyOpenGL_GLSLProgram);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8CyOpenGL_GLSLProgram->tp_dictoffset && __pyx_mstate->__pyx_ptype_8CyOpenGL_GLSLProgram->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8CyOpenGL_GLSLProgram->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_GLSLProgram, (PyObject *) __pyx_mstate->__pyx_ptype_8CyOpenGL_GLSLProgram) < (0)) __PYX_ERR(30, 63, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_8CyOpenGL_VertexBuffer = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8CyOpenGL_VertexBuffer_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_8CyOpenGL_VertexBuffer)) __PYX_ERR(31, 1, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8CyOpenGL_VertexBuffer_spec, __pyx_mstate->__pyx_ptype_8CyOpenGL_VertexBuffer) < (0)) __PYX_ERR(31, 1, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8CyOpenGL_VertexBuffer = &__pyx_type_8CyOpenGL_VertexBuffer;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8CyOpenGL_VertexBuffer) < (0)) __PYX_ERR(31, 1, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8CyOpenGL_VertexBuffer);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8CyOpenGL_VertexBuffer->tp_dictoffset && __pyx_mstate->__pyx_ptype_8CyOpenGL_VertexBuffer->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8CyOpenGL_VertexBuffer->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_VertexBuffer, (PyObject *) __pyx_mstate->__pyx_ptype_8CyOpenGL_VertexBuffer) < (0)) __PYX_ERR(31, 1, __pyx_L1_error)
  __pyx_vtabptr_8CyOpenGL_GLSLPerspectiveView = &__pyx_vtable_8CyOpenGL_GLSLPerspectiveView;
  __pyx_vtable_8CyOpenGL_GLSLPerspectiveView.compute_mvp = (PyObject *(*)(struct __pyx_obj_8CyOpenGL_GLSLPerspectiveView *, PyObject *, PyObject *))__pyx_f_8CyOpenGL_19GLSLPerspectiveView_compute_mvp;
  __pyx_vtable_8CyOpenGL_GLSLPerspectiveView.translate = (PyObject *(*)(struct __pyx_obj_8CyOpenGL_GLSLPerspectiveView *, GLfloat, GLfloat, GLfloat, int __pyx_skip_dispatch))__pyx_f_8CyOpenGL_19GLSLPerspectiveView_translate;
  __pyx_vtable_8CyOpenGL_GLSLPerspectiveView.rotate = (PyObject *(*)(struct __pyx_obj_8CyOpenGL_GLSLPerspectiveView *, GLfloat, GLfloat, GLfloat, GLfloat, int __pyx_skip_dispatch))__pyx_f_8CyOpenGL_19GLSLPerspectiveView_rotate;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_8CyOpenGL_GLSLPerspectiveView = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8CyOpenGL_GLSLPerspectiveView_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_8CyOpenGL_GLSLPerspectiveView)) __PYX_ERR(33, 34, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8CyOpenGL_GLSLPerspectiveView_spec, __pyx_mstate->__pyx_ptype_8CyOpenGL_GLSLPerspectiveView) < (0)) __PYX_ERR(33, 34, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8CyOpenGL_GLSLPerspectiveView = &__pyx_type_8CyOpenGL_GLSLPerspectiveView;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8CyOpenGL_GLSLPerspectiveView) < (0)) __PYX_ERR(33, 34, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8CyOpenGL_GLSLPerspectiveView);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8CyOpenGL_GLSLPerspectiveView->tp_dictoffset && __pyx_mstate->__pyx_ptype_8CyOpenGL_GLSLPerspectiveView->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8CyOpenGL_GLSLPerspectiveView->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_8CyOpenGL_GLSLPerspectiveView, __pyx_vtabptr_8CyOpenGL_GLSLPerspectiveView) < (0)) __PYX_ERR(33, 34, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_8CyOpenGL_GLSLPerspectiveView) < (0)) __PYX_ERR(33, 34, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_GLSLPerspectiveView, (PyObject *) __pyx_mstate->__pyx_ptype_8CyOpenGL_GLSLPerspectiveView) < (0)) __PYX_ERR(33, 34, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_8CyOpenGL_Triangle = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8CyOpenGL_Triangle_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_8CyOpenGL_Triangle)) __PYX_ERR(35, 1, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8CyOpenGL_Triangle_spec, __pyx_mstate->__pyx_ptype_8CyOpenGL_Triangle) < (0)) __PYX_ERR(35, 1, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8CyOpenGL_Triangle = &__pyx_type_8CyOpenGL_Triangle;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8CyOpenGL_Triangle) < (0)) __PYX_ERR(35, 1, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8CyOpenGL_Triangle);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8CyOpenGL_Triangle->tp_dictoffset && __pyx_mstate->__pyx_ptype_8CyOpenGL_Triangle->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8CyOpenGL_Triangle->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  #if CYTHON_UPDATE_DESCRIPTOR_DOC
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)__pyx_mstate->__pyx_ptype_8CyOpenGL_Triangle, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(35, 1, __pyx_L1_error)
    if (__Pyx_IS_TYPE(wrapper, &PyWrapperDescr_Type)) {
      __pyx_wrapperbase_8CyOpenGL_8Triangle___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_8CyOpenGL_8Triangle___init__.doc = __pyx_doc_8CyOpenGL_8Triangle___init__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8CyOpenGL_8Triangle___init__;
    }
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_Triangle, (PyObject *) __pyx_mstate->__pyx_ptype_8CyOpenGL_Triangle) < (0)) __PYX_ERR(35, 1, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_8CyOpenGL___pyx_defaults = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8CyOpenGL___pyx_defaults_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_8CyOpenGL___pyx_defaults)) __PYX_ERR(5, 19, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8CyOpenGL___pyx_defaults_spec, __pyx_mstate->__pyx_ptype_8CyOpenGL___pyx_defaults) < (0)) __PYX_ERR(5, 19, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8CyOpenGL___pyx_defaults = &__pyx_type_8CyOpenGL___pyx_defaults;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8CyOpenGL___pyx_defaults) < (0)) __PYX_ERR(5, 19, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8CyOpenGL___pyx_defaults);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8CyOpenGL___pyx_defaults->tp_dictoffset && __pyx_mstate->__pyx_ptype_8CyOpenGL___pyx_defaults->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8CyOpenGL___pyx_defaults->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_8CyOpenGL___pyx_scope_struct__draw = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8CyOpenGL___pyx_scope_struct__draw_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_8CyOpenGL___pyx_scope_struct__draw)) __PYX_ERR(13, 6, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8CyOpenGL___pyx_scope_struct__draw_spec, __pyx_mstate->__pyx_ptype_8CyOpenGL___pyx_scope_struct__draw) < (0)) __PYX_ERR(13, 6, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8CyOpenGL___pyx_scope_struct__draw = &__pyx_type_8CyOpenGL___pyx_scope_struct__draw;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8CyOpenGL___pyx_scope_struct__draw) < (0)) __PYX_ERR(13, 6, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8CyOpenGL___pyx_scope_struct__draw);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8CyOpenGL___pyx_scope_struct__draw->tp_dictoffset && __pyx_mstate->__pyx_ptype_8CyOpenGL___pyx_scope_struct__draw->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8CyOpenGL___pyx_scope_struct__draw->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_8CyOpenGL___pyx_scope_struct_1_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8CyOpenGL___pyx_scope_struct_1_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_8CyOpenGL___pyx_scope_struct_1_genexpr)) __PYX_ERR(25, 52, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8CyOpenGL___pyx_scope_struct_1_genexpr_spec, __pyx_mstate->__pyx_ptype_8CyOpenGL___pyx_scope_struct_1_genexpr) < (0)) __PYX_ERR(25, 52, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8CyOpenGL___pyx_scope_struct_1_genexpr = &__pyx_type_8CyOpenGL___pyx_scope_struct_1_genexpr;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8CyOpenGL___pyx_scope_struct_1_genexpr) < (0)) __PYX_ERR(25, 52, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8CyOpenGL___pyx_scope_struct_1_genexpr);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8CyOpenGL___pyx_scope_struct_1_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_8CyOpenGL___pyx_scope_struct_1_genexpr->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8CyOpenGL___pyx_scope_struct_1_genexpr->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  __pyx_vtabptr_array = &__pyx_vtable_array;
  __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_array_type = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type___pyx_array_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_array_type)) __PYX_ERR(7, 118, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate->__pyx_array_type->tp_as_buffer = &__pyx_tp_as_buffer_array;
  if (!__pyx_mstate->__pyx_array_type->tp_as_buffer->bf_releasebuffer && __pyx_mstate->__pyx_array_type->tp_base->tp_as_buffer && __pyx_mstate->__pyx_array_type->tp_base->tp_as_buffer->bf_releasebuffer) {
    __pyx_mstate->__pyx_array_type->tp_as_buffer->bf_releasebuffer = __pyx_mstate->__pyx_array_type->tp_base->tp_as_buffer->bf_releasebuffer;
  }
  #elif defined(Py_bf_getbuffer) && defined(Py_bf_releasebuffer)
  /* PY_VERSION_HEX >= 0x03090000 || Py_LIMITED_API >= 0x030B0000 */
  #elif defined(_MSC_VER)
  #pragma message ("The buffer protocol is not supported in the Limited C-API < 3.11.")
  #else
  #warning "The buffer protocol is not supported in the Limited C-API < 3.11."
  #endif
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type___pyx_array_spec, __pyx_mstate->__pyx_array_type) < (0)) __PYX_ERR(7, 118, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_array_type = &__pyx_type___pyx_array;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_array_type) < (0)) __PYX_ERR(7, 118, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_array_type);
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_array_type, __pyx_vtabptr_array) < (0)) __PYX_ERR(7, 118, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_array_type) < (0)) __PYX_ERR(7, 118, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_array_type) < (0)) __PYX_ERR(7, 118, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_MemviewEnum_type = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type___pyx_MemviewEnum_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_MemviewEnum_type)) __PYX_ERR(7, 307, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type___pyx_MemviewEnum_spec, __pyx_mstate->__pyx_MemviewEnum_type) < (0)) __PYX_ERR(7, 307, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_MemviewEnum_type) < (0)) __PYX_ERR(7, 307, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_MemviewEnum_type);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_MemviewEnum_type->tp_dictoffset && __pyx_mstate->__pyx_MemviewEnum_type->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_MemviewEnum_type->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_MemviewEnum_type) < (0)) __PYX_ERR(7, 307, __pyx_L1_error)
  __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
  __pyx_vtable_memoryview.get_item_pointer = (char *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
  __pyx_vtable_memoryview.is_slice = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
  __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
  __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
  __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
  __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryview_convert_item_to_object;
  __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryview_assign_item_from_object;
  __pyx_vtable_memoryview._get_base = (PyObject *(*)(struct __pyx_memoryview_obj *))__pyx_memoryview__get_base;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_memoryview_type = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type___pyx_memoryview_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_memoryview_type)) __PYX_ERR(7, 342, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate->__pyx_memoryview_type->tp_as_buffer = &__pyx_tp_as_buffer_memoryview;
  if (!__pyx_mstate->__pyx_memoryview_type->tp_as_buffer->bf_releasebuffer && __pyx_mstate->__pyx_memoryview_type->tp_base->tp_as_buffer && __pyx_mstate->__pyx_memoryview_type->tp_base->tp_as_buffer->bf_releasebuffer) {
    __pyx_mstate->__pyx_memoryview_type->tp_as_buffer->bf_releasebuffer = __pyx_mstate->__pyx_memoryview_type->tp_base->tp_as_buffer->bf_releasebuffer;
  }
  #elif defined(Py_bf_getbuffer) && defined(Py_bf_releasebuffer)
  /* PY_VERSION_HEX >= 0x03090000 || Py_LIMITED_API >= 0x030B0000 */
  #elif defined(_MSC_VER)
  #pragma message ("The buffer protocol is not supported in the Limited C-API < 3.11.")
  #else
  #warning "The buffer protocol is not supported in the Limited C-API < 3.11."
  #endif
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type___pyx_memoryview_spec, __pyx_mstate->__pyx_memoryview_type) < (0)) __PYX_ERR(7, 342, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_memoryview_type = &__pyx_type___pyx_memoryview;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_memoryview_type) < (0)) __PYX_ERR(7, 342, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_memoryview_type);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_memoryview_type->tp_dictoffset && __pyx_mstate->__pyx_memoryview_type->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_memoryview_type->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_memoryview_type, __pyx_vtabptr_memoryview) < (0)) __PYX_ERR(7, 342, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_memoryview_type) < (0)) __PYX_ERR(7, 342, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_memoryview_type) < (0)) __PYX_ERR(7, 342, __pyx_L1_error)
  __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
  __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
  __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object;
  __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
  __pyx_vtable__memoryviewslice.__pyx_base._get_base = (PyObject *(*)(struct __pyx_memoryview_obj *))__pyx_memoryviewslice__get_base;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_memoryview_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 856, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_memoryviewslice_type = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type___pyx_memoryviewslice_spec, __pyx_t_1);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_mstate->__pyx_memoryviewslice_type)) __PYX_ERR(7, 856, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type___pyx_memoryviewslice_spec, __pyx_mstate->__pyx_memoryviewslice_type) < (0)) __PYX_ERR(7, 856, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_memoryviewslice_type->tp_base = __pyx_mstate_global->__pyx_memoryview_type;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_memoryviewslice_type) < (0)) __PYX_ERR(7, 856, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_memoryviewslice_type);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_memoryviewslice_type->tp_dictoffset && __pyx_mstate->__pyx_memoryviewslice_type->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_memoryviewslice_type->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_memoryviewslice_type, __pyx_vtabptr__memoryviewslice) < (0)) __PYX_ERR(7, 856, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_memoryviewslice_type) < (0)) __PYX_ERR(7, 856, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_memoryviewslice_type) < (0)) __PYX_ERR(7, 856, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_type_import_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
  /*--- Type import code ---*/
  __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(37, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_2_8(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_8(PyTypeObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  0, 0,
  #else
  sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_8(PyHeapTypeObject),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_8); if (!__pyx_mstate->__pyx_ptype_7cpython_4type_type) __PYX_ERR(37, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 8, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType_3_2_8(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "bool",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyLongObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_8(PyLongObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  0, 0,
  #else
  sizeof(PyLongObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_8(PyLongObject),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_8); if (!__pyx_mstate->__pyx_ptype_7cpython_4bool_bool) __PYX_ERR(38, 8, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType_3_2_8(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "complex",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyComplexObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_8(PyComplexObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  0, 0,
  #else
  sizeof(PyComplexObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_8(PyComplexObject),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_8); if (!__pyx_mstate->__pyx_ptype_7cpython_7complex_complex) __PYX_ERR(39, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyImport_ImportModule("array"); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 69, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_ptype_7cpython_5array_array = __Pyx_ImportType_3_2_8(__pyx_t_1, "array", "array",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(arrayobject), __PYX_GET_STRUCT_ALIGNMENT_3_2_8(arrayobject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(arrayobject), __PYX_GET_STRUCT_ALIGNMENT_3_2_8(arrayobject),
  #else
  sizeof(arrayobject), __PYX_GET_STRUCT_ALIGNMENT_3_2_8(arrayobject),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_8); if (!__pyx_mstate->__pyx_ptype_7cpython_5array_array) __PYX_ERR(9, 69, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_variable_import_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
  /*--- Variable import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_function_import_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
  /*--- Function import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

#if CYTHON_PEP489_MULTI_PHASE_INIT
static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
static int __pyx_pymod_exec_CyOpenGL(PyObject* module); /*proto*/
static PyModuleDef_Slot __pyx_moduledef_slots[] = {
  {Py_mod_create, (void*)__pyx_pymod_create},
  {Py_mod_exec, (void*)__pyx_pymod_exec_CyOpenGL},
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
  {Py_mod_gil, __Pyx_FREETHREADING_COMPATIBLE},
  #endif
  #if PY_VERSION_HEX >= 0x030C0000 && CYTHON_USE_MODULE_STATE
  {Py_mod_multiple_interpreters, Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED},
  #endif
  {0, NULL}
};
#endif

#ifdef __cplusplus
namespace {
  struct PyModuleDef __pyx_moduledef =
  #else
  static struct PyModuleDef __pyx_moduledef =
  #endif
  {
      PyModuleDef_HEAD_INIT,
      "CyOpenGL",
      0, /* m_doc */
    #if CYTHON_USE_MODULE_STATE
      sizeof(__pyx_mstatetype), /* m_size */
    #else
      (CYTHON_PEP489_MULTI_PHASE_INIT) ? 0 : -1, /* m_size */
    #endif
      __pyx_methods /* m_methods */,
    #if CYTHON_PEP489_MULTI_PHASE_INIT
      __pyx_moduledef_slots, /* m_slots */
    #else
      NULL, /* m_reload */
    #endif
    #if CYTHON_USE_MODULE_STATE
      __pyx_m_traverse, /* m_traverse */
      __pyx_m_clear, /* m_clear */
      NULL /* m_free */
    #else
      NULL, /* m_traverse */
      NULL, /* m_clear */
      NULL /* m_free */
    #endif
  };
  #ifdef __cplusplus
} /* anonymous namespace */
#endif

/* PyModInitFuncType */
#ifndef CYTHON_NO_PYINIT_EXPORT
  #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
#else
  #ifdef __cplusplus
  #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
  #else
  #define __Pyx_PyMODINIT_FUNC PyObject *
  #endif
#endif

__Pyx_PyMODINIT_FUNC PyInit_CyOpenGL(void) CYTHON_SMALL_CODE; /*proto*/
__Pyx_PyMODINIT_FUNC PyInit_CyOpenGL(void)
#if CYTHON_PEP489_MULTI_PHASE_INIT
{
  return PyModuleDef_Init(&__pyx_moduledef);
}
/* ModuleCreationPEP489 */
#if CYTHON_COMPILING_IN_LIMITED_API && (__PYX_LIMITED_VERSION_HEX < 0x03090000\
      || ((defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)) && __PYX_LIMITED_VERSION_HEX < 0x030A0000))
static PY_INT64_T __Pyx_GetCurrentInterpreterId(void) {
    {
        PyObject *module = PyImport_ImportModule("_interpreters"); // 3.13+ I think
        if (!module) {
            PyErr_Clear(); // just try the 3.8-3.12 version
            module = PyImport_ImportModule("_xxsubinterpreters");
            if (!module) goto bad;
        }
        PyObject *current = PyObject_CallMethod(module, "get_current", NULL);
        Py_DECREF(module);
        if (!current) goto bad;
        if (PyTuple_Check(current)) {
            PyObject *new_current = PySequence_GetItem(current, 0);
            Py_DECREF(current);
            current = new_current;
            if (!new_current) goto bad;
        }
        long long as_c_int = PyLong_AsLongLong(current);
        Py_DECREF(current);
        return as_c_int;
    }
  bad:
    PySys_WriteStderr("__Pyx_GetCurrentInterpreterId failed. Try setting the C define CYTHON_PEP489_MULTI_PHASE_INIT=0\n");
    return -1;
}
#endif
#if !CYTHON_USE_MODULE_STATE
static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
    static PY_INT64_T main_interpreter_id = -1;
#if CYTHON_COMPILING_IN_GRAAL && defined(GRAALPY_VERSION_NUM) && GRAALPY_VERSION_NUM > 0x19000000
    PY_INT64_T current_id = GraalPyInterpreterState_GetIDFromThreadState(PyThreadState_Get());
#elif CYTHON_COMPILING_IN_GRAAL
    PY_INT64_T current_id = PyInterpreterState_GetIDFromThreadState(PyThreadState_Get());
#elif CYTHON_COMPILING_IN_LIMITED_API && (__PYX_LIMITED_VERSION_HEX < 0x03090000\
      || ((defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)) && __PYX_LIMITED_VERSION_HEX < 0x030A0000))
    PY_INT64_T current_id = __Pyx_GetCurrentInterpreterId();
#elif CYTHON_COMPILING_IN_LIMITED_API
    PY_INT64_T current_id = PyInterpreterState_GetID(PyInterpreterState_Get());
#else
    PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
#endif
    if (unlikely(current_id == -1)) {
        return -1;
    }
    if (main_interpreter_id == -1) {
        main_interpreter_id = current_id;
        return 0;
    } else if (unlikely(main_interpreter_id != current_id)) {
        PyErr_SetString(
            PyExc_ImportError,
            "Interpreter change detected - this module can only be loaded into one interpreter per process.");
        return -1;
    }
    return 0;
}
#endif
static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none)
{
    PyObject *value = PyObject_GetAttrString(spec, from_name);
    int result = 0;
    if (likely(value)) {
        if (allow_none || value != Py_None) {
            result = PyDict_SetItemString(moddict, to_name, value);
        }
        Py_DECREF(value);
    } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
        PyErr_Clear();
    } else {
        result = -1;
    }
    return result;
}
static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) {
    PyObject *module = NULL, *moddict, *modname;
    CYTHON_UNUSED_VAR(def);
    #if !CYTHON_USE_MODULE_STATE
    if (__Pyx_check_single_interpreter())
        return NULL;
    #endif
    if (__pyx_m)
        return __Pyx_NewRef(__pyx_m);
    modname = PyObject_GetAttrString(spec, "name");
    if (unlikely(!modname)) goto bad;
    module = PyModule_NewObject(modname);
    Py_DECREF(modname);
    if (unlikely(!module)) goto bad;
    moddict = PyModule_GetDict(module);
    if (unlikely(!moddict)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
    return module;
bad:
    Py_XDECREF(module);
    return NULL;
}


static CYTHON_SMALL_CODE int __pyx_pymod_exec_CyOpenGL(PyObject *__pyx_pyinit_module)
#endif
{
  int stringtab_initialized = 0;
  #if CYTHON_USE_MODULE_STATE
  int pystate_addmodule_run = 0;
  #endif
  __pyx_mstatetype *__pyx_mstate = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  static PyThread_type_lock __pyx_t_7[8];
  int __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  if (__pyx_m) {
    if (__pyx_m == __pyx_pyinit_module) return 0;
    PyErr_SetString(PyExc_RuntimeError, "Module 'CyOpenGL' has already been imported. Re-initialisation is not supported.");
    return -1;
  }
  #else
  if (__pyx_m) return __Pyx_NewRef(__pyx_m);
  #endif
  /*--- Module creation code ---*/
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  __pyx_t_1 = __pyx_pyinit_module;
  Py_INCREF(__pyx_t_1);
  #else
  __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #if CYTHON_USE_MODULE_STATE
  {
    int add_module_result = __Pyx_State_AddModule(__pyx_t_1, &__pyx_moduledef);
    __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "CyOpenGL" pseudovariable */
    if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
    pystate_addmodule_run = 1;
  }
  #else
  __pyx_m = __pyx_t_1;
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
  PyUnstable_Module_SetGIL(__pyx_m, Py_MOD_GIL_USED);
  #endif
  __pyx_mstate = __pyx_mstate_global;
  CYTHON_UNUSED_VAR(__pyx_t_1);
  __pyx_mstate->__pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_mstate->__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
  Py_INCREF(__pyx_mstate->__pyx_d);
  __pyx_mstate->__pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_mstate->__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_cython_runtime = __Pyx_PyImport_AddModuleRef("cython_runtime"); if (unlikely(!__pyx_mstate->__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_mstate->__pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  /* ImportRefnannyAPI */
  #if CYTHON_REFNANNY
  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
  if (!__Pyx_RefNanny) {
    PyErr_Clear();
    __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
    if (!__Pyx_RefNanny)
        Py_FatalError("failed to import 'refnanny' module");
  }
  #endif
  
__Pyx_RefNannySetupContext("PyInit_CyOpenGL", 0);
  __Pyx_init_runtime_version();
  if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_mstate->__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Library function declarations ---*/
  /*--- Initialize various global constants etc. ---*/
  if (__Pyx_InitConstants(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
  stringtab_initialized = 1;
  if (__Pyx_InitGlobals() < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__pyx_module_is_main_CyOpenGL) {
    if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_name_2, __pyx_mstate_global->__pyx_n_u_main) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
  }
  {
    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
    if (!PyDict_GetItemString(modules, "CyOpenGL")) {
      if (unlikely((PyDict_SetItemString(modules, "CyOpenGL", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
    }
  }
  /*--- Builtin init code ---*/
  if (__Pyx_InitCachedBuiltins(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Constants init code ---*/
  if (__Pyx_InitCachedConstants(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_CreateCodeObjects(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Global type/function init code ---*/
  (void)__Pyx_modinit_global_init_code(__pyx_mstate);
  (void)__Pyx_modinit_variable_export_code(__pyx_mstate);
  (void)__Pyx_modinit_function_export_code(__pyx_mstate);
  if (unlikely((__Pyx_modinit_type_init_code(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  if (unlikely((__Pyx_modinit_type_import_code(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  (void)__Pyx_modinit_variable_import_code(__pyx_mstate);
  (void)__Pyx_modinit_function_import_code(__pyx_mstate);
  /*--- Execution code ---*/

  /* "View.MemoryView":108
 * 
 * cdef object __pyx_collections_abc_Sequence "__pyx_collections_abc_Sequence"
 * try:             # <<<<<<<<<<<<<<
 *     __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
 * except:
*/
  {
    __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:*/ {

      /* "View.MemoryView":109
 * cdef object __pyx_collections_abc_Sequence "__pyx_collections_abc_Sequence"
 * try:
 *     __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence             # <<<<<<<<<<<<<<
 * except:
 * 
*/
      __pyx_t_5 = NULL;
      __pyx_t_6 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_collections_abc};
        __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin___import__, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 109, __pyx_L2_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_abc); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 109, __pyx_L2_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_mstate_global->__pyx_n_u_Sequence); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 109, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XGOTREF(__pyx_collections_abc_Sequence);
      __Pyx_DECREF_SET(__pyx_collections_abc_Sequence, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      __pyx_t_4 = 0;

      /* "View.MemoryView":108
 * 
 * cdef object __pyx_collections_abc_Sequence "__pyx_collections_abc_Sequence"
 * try:             # <<<<<<<<<<<<<<
 *     __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
 * except:
*/
    }
    __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_L7_try_end;
    __pyx_L2_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "View.MemoryView":110
 * try:
 *     __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
 * except:             # <<<<<<<<<<<<<<
 * 
 *     __pyx_collections_abc_Sequence = None
*/
    /*except:*/ {
      __Pyx_ErrRestore(0,0,0);

      /* "View.MemoryView":112
 * except:
 * 
 *     __pyx_collections_abc_Sequence = None             # <<<<<<<<<<<<<<
 * 
 * 
*/
      __Pyx_INCREF(Py_None);
      __Pyx_XGOTREF(__pyx_collections_abc_Sequence);
      __Pyx_DECREF_SET(__pyx_collections_abc_Sequence, Py_None);
      __Pyx_GIVEREF(Py_None);
      goto __pyx_L3_exception_handled;
    }
    __pyx_L3_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_L7_try_end:;
  }

  /* "View.MemoryView":247
 * 
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         count = __pyx_collections_abc_Sequence.count
 *         index = __pyx_collections_abc_Sequence.index
*/
  {
    __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:*/ {

      /* "View.MemoryView":248
 * 
 *     try:
 *         count = __pyx_collections_abc_Sequence.count             # <<<<<<<<<<<<<<
 *         index = __pyx_collections_abc_Sequence.index
 *     except:
*/
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_collections_abc_Sequence, __pyx_mstate_global->__pyx_n_u_count); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 248, __pyx_L10_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_array_type, __pyx_mstate_global->__pyx_n_u_count, __pyx_t_4) < (0)) __PYX_ERR(7, 248, __pyx_L10_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "View.MemoryView":249
 *     try:
 *         count = __pyx_collections_abc_Sequence.count
 *         index = __pyx_collections_abc_Sequence.index             # <<<<<<<<<<<<<<
 *     except:
 *         pass
*/
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_collections_abc_Sequence, __pyx_mstate_global->__pyx_n_u_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 249, __pyx_L10_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_array_type, __pyx_mstate_global->__pyx_n_u_index, __pyx_t_4) < (0)) __PYX_ERR(7, 249, __pyx_L10_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "View.MemoryView":247
 * 
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         count = __pyx_collections_abc_Sequence.count
 *         index = __pyx_collections_abc_Sequence.index
*/
    }
    __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_L15_try_end;
    __pyx_L10_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "View.MemoryView":250
 *         count = __pyx_collections_abc_Sequence.count
 *         index = __pyx_collections_abc_Sequence.index
 *     except:             # <<<<<<<<<<<<<<
 *         pass
 * 
*/
    /*except:*/ {
      __Pyx_ErrRestore(0,0,0);
      goto __pyx_L11_exception_handled;
    }
    __pyx_L11_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_L15_try_end:;
  }

  /* "View.MemoryView":315
 *         return self.name
 * 
 * cdef generic = Enum("<strided and direct or indirect>")             # <<<<<<<<<<<<<<
 * cdef strided = Enum("<strided and direct>") # default
 * cdef indirect = Enum("<strided and indirect>")
*/
  __pyx_t_5 = NULL;
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_strided_and_direct_or_indirect};
    __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_MemviewEnum_type, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 315, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_4);
  }
  __Pyx_XGOTREF(generic);
  __Pyx_DECREF_SET(generic, ((PyObject *)__pyx_t_4));
  __Pyx_GIVEREF((PyObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "View.MemoryView":316
 * 
 * cdef generic = Enum("<strided and direct or indirect>")
 * cdef strided = Enum("<strided and direct>") # default             # <<<<<<<<<<<<<<
 * cdef indirect = Enum("<strided and indirect>")
 * 
*/
  __pyx_t_5 = NULL;
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_strided_and_direct};
    __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_MemviewEnum_type, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 316, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_4);
  }
  __Pyx_XGOTREF(strided);
  __Pyx_DECREF_SET(strided, ((PyObject *)__pyx_t_4));
  __Pyx_GIVEREF((PyObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "View.MemoryView":317
 * cdef generic = Enum("<strided and direct or indirect>")
 * cdef strided = Enum("<strided and direct>") # default
 * cdef indirect = Enum("<strided and indirect>")             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_5 = NULL;
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_strided_and_indirect};
    __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_MemviewEnum_type, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 317, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_4);
  }
  __Pyx_XGOTREF(indirect);
  __Pyx_DECREF_SET(indirect, ((PyObject *)__pyx_t_4));
  __Pyx_GIVEREF((PyObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "View.MemoryView":320
 * 
 * 
 * cdef contiguous = Enum("<contiguous and direct>")             # <<<<<<<<<<<<<<
 * cdef indirect_contiguous = Enum("<contiguous and indirect>")
 * 
*/
  __pyx_t_5 = NULL;
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_contiguous_and_direct};
    __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_MemviewEnum_type, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 320, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_4);
  }
  __Pyx_XGOTREF(contiguous);
  __Pyx_DECREF_SET(contiguous, ((PyObject *)__pyx_t_4));
  __Pyx_GIVEREF((PyObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "View.MemoryView":321
 * 
 * cdef contiguous = Enum("<contiguous and direct>")
 * cdef indirect_contiguous = Enum("<contiguous and indirect>")             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_5 = NULL;
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_contiguous_and_indirect};
    __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_MemviewEnum_type, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 321, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_4);
  }
  __Pyx_XGOTREF(indirect_contiguous);
  __Pyx_DECREF_SET(indirect_contiguous, ((PyObject *)__pyx_t_4));
  __Pyx_GIVEREF((PyObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "View.MemoryView":329
 * 
 * 
 * cdef int __pyx_memoryview_thread_locks_used = 0             # <<<<<<<<<<<<<<
 * cdef PyThread_type_lock[8] __pyx_memoryview_thread_locks = [
 *     PyThread_allocate_lock(),
*/
  __pyx_memoryview_thread_locks_used = 0;

  /* "View.MemoryView":330
 * 
 * cdef int __pyx_memoryview_thread_locks_used = 0
 * cdef PyThread_type_lock[8] __pyx_memoryview_thread_locks = [             # <<<<<<<<<<<<<<
 *     PyThread_allocate_lock(),
 *     PyThread_allocate_lock(),
*/
  __pyx_t_7[0] = PyThread_allocate_lock();
  __pyx_t_7[1] = PyThread_allocate_lock();
  __pyx_t_7[2] = PyThread_allocate_lock();
  __pyx_t_7[3] = PyThread_allocate_lock();
  __pyx_t_7[4] = PyThread_allocate_lock();
  __pyx_t_7[5] = PyThread_allocate_lock();
  __pyx_t_7[6] = PyThread_allocate_lock();
  __pyx_t_7[7] = PyThread_allocate_lock();
  memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_7, sizeof(__pyx_memoryview_thread_locks[0]) * (8));

  /* "View.MemoryView":888
 * 
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         count = __pyx_collections_abc_Sequence.count
 *         index = __pyx_collections_abc_Sequence.index
*/
  {
    __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:*/ {

      /* "View.MemoryView":889
 * 
 *     try:
 *         count = __pyx_collections_abc_Sequence.count             # <<<<<<<<<<<<<<
 *         index = __pyx_collections_abc_Sequence.index
 *     except:
*/
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_collections_abc_Sequence, __pyx_mstate_global->__pyx_n_u_count); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 889, __pyx_L18_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_memoryviewslice_type, __pyx_mstate_global->__pyx_n_u_count, __pyx_t_4) < (0)) __PYX_ERR(7, 889, __pyx_L18_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "View.MemoryView":890
 *     try:
 *         count = __pyx_collections_abc_Sequence.count
 *         index = __pyx_collections_abc_Sequence.index             # <<<<<<<<<<<<<<
 *     except:
 *         pass
*/
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_collections_abc_Sequence, __pyx_mstate_global->__pyx_n_u_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 890, __pyx_L18_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_memoryviewslice_type, __pyx_mstate_global->__pyx_n_u_index, __pyx_t_4) < (0)) __PYX_ERR(7, 890, __pyx_L18_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "View.MemoryView":888
 * 
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         count = __pyx_collections_abc_Sequence.count
 *         index = __pyx_collections_abc_Sequence.index
*/
    }
    __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_L23_try_end;
    __pyx_L18_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "View.MemoryView":891
 *         count = __pyx_collections_abc_Sequence.count
 *         index = __pyx_collections_abc_Sequence.index
 *     except:             # <<<<<<<<<<<<<<
 *         pass
 * 
*/
    /*except:*/ {
      __Pyx_ErrRestore(0,0,0);
      goto __pyx_L19_exception_handled;
    }
    __pyx_L19_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_L23_try_end:;
  }

  /* "View.MemoryView":894
 *         pass
 * 
 * try:             # <<<<<<<<<<<<<<
 *     if __pyx_collections_abc_Sequence:
 * 
*/
  {
    __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:*/ {

      /* "View.MemoryView":895
 * 
 * try:
 *     if __pyx_collections_abc_Sequence:             # <<<<<<<<<<<<<<
 * 
 * 
*/
      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_collections_abc_Sequence); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(7, 895, __pyx_L26_error)
      if (__pyx_t_8) {

        /* "View.MemoryView":899
 * 
 * 
 *         __pyx_collections_abc_Sequence.register(_memoryviewslice)             # <<<<<<<<<<<<<<
 *         __pyx_collections_abc_Sequence.register(array)
 * except:
*/
        __pyx_t_5 = __pyx_collections_abc_Sequence;
        __Pyx_INCREF(__pyx_t_5);
        __pyx_t_6 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_5, ((PyObject *)__pyx_mstate_global->__pyx_memoryviewslice_type)};
          __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_register, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 899, __pyx_L26_error)
          __Pyx_GOTREF(__pyx_t_4);
        }
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "View.MemoryView":900
 * 
 *         __pyx_collections_abc_Sequence.register(_memoryviewslice)
 *         __pyx_collections_abc_Sequence.register(array)             # <<<<<<<<<<<<<<
 * except:
 *     pass  # ignore failure, it's a minor issue
*/
        __pyx_t_5 = __pyx_collections_abc_Sequence;
        __Pyx_INCREF(__pyx_t_5);
        __pyx_t_6 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_5, ((PyObject *)__pyx_mstate_global->__pyx_array_type)};
          __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_register, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 900, __pyx_L26_error)
          __Pyx_GOTREF(__pyx_t_4);
        }
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "View.MemoryView":895
 * 
 * try:
 *     if __pyx_collections_abc_Sequence:             # <<<<<<<<<<<<<<
 * 
 * 
*/
      }

      /* "View.MemoryView":894
 *         pass
 * 
 * try:             # <<<<<<<<<<<<<<
 *     if __pyx_collections_abc_Sequence:
 * 
*/
    }
    __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_L31_try_end;
    __pyx_L26_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "View.MemoryView":901
 *         __pyx_collections_abc_Sequence.register(_memoryviewslice)
 *         __pyx_collections_abc_Sequence.register(array)
 * except:             # <<<<<<<<<<<<<<
 *     pass  # ignore failure, it's a minor issue
 * 
*/
    /*except:*/ {
      __Pyx_ErrRestore(0,0,0);
      goto __pyx_L27_exception_handled;
    }
    __pyx_L27_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_L31_try_end:;
  }

  /* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x82a3537, 0x6ae9995, 0xb068931, b'name')
*/
  __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_mstate_global->__pyx_n_u_View_MemoryView); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_Enum, __pyx_t_4) < (0)) __PYX_ERR(7, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "CyOpenGL.pyx":12
 * include "CySnapPyfont.pxi"
 * 
 * from .infowindow import InfoWindow             # <<<<<<<<<<<<<<
 * 
 * from cpython cimport array
*/
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_InfoWindow};
    __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_infowindow, __pyx_imported_names, 1, __pyx_mstate_global->__pyx_kp_u_infowindow_2, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error)
  }
  __pyx_t_4 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_4);
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_InfoWindow};
    __pyx_t_9 = 0; {
      __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_4, __pyx_imported_names[__pyx_t_9]); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 12, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_9], __pyx_t_5) < (0)) __PYX_ERR(0, 12, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "CyOpenGL.pyx":17
 * from libc.stdlib cimport malloc, free
 * 
 * import os             # <<<<<<<<<<<<<<
 * import sys
 * import platform, png
*/
  __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_os, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error)
  __pyx_t_4 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_os, __pyx_t_4) < (0)) __PYX_ERR(0, 17, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "CyOpenGL.pyx":18
 * 
 * import os
 * import sys             # <<<<<<<<<<<<<<
 * import platform, png
 * from colorsys import hls_to_rgb
*/
  __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_sys, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 18, __pyx_L1_error)
  __pyx_t_4 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_sys, __pyx_t_4) < (0)) __PYX_ERR(0, 18, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "CyOpenGL.pyx":19
 * import os
 * import sys
 * import platform, png             # <<<<<<<<<<<<<<
 * from colorsys import hls_to_rgb
 * from math import sqrt, ceil, floor, pi, sin, cos, tan
*/
  __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_platform, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error)
  __pyx_t_4 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_platform, __pyx_t_4) < (0)) __PYX_ERR(0, 19, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_png, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error)
  __pyx_t_4 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_png, __pyx_t_4) < (0)) __PYX_ERR(0, 19, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "CyOpenGL.pyx":20
 * import sys
 * import platform, png
 * from colorsys import hls_to_rgb             # <<<<<<<<<<<<<<
 * from math import sqrt, ceil, floor, pi, sin, cos, tan
 * from random import random
*/
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_hls_to_rgb};
    __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_colorsys, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 20, __pyx_L1_error)
  }
  __pyx_t_4 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_4);
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_hls_to_rgb};
    __pyx_t_9 = 0; {
      __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_4, __pyx_imported_names[__pyx_t_9]); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 20, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_9], __pyx_t_5) < (0)) __PYX_ERR(0, 20, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "CyOpenGL.pyx":21
 * import platform, png
 * from colorsys import hls_to_rgb
 * from math import sqrt, ceil, floor, pi, sin, cos, tan             # <<<<<<<<<<<<<<
 * from random import random
 * import time
*/
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_sqrt,__pyx_mstate_global->__pyx_n_u_ceil,__pyx_mstate_global->__pyx_n_u_floor,__pyx_mstate_global->__pyx_n_u_pi,__pyx_mstate_global->__pyx_n_u_sin,__pyx_mstate_global->__pyx_n_u_cos,__pyx_mstate_global->__pyx_n_u_tan};
    __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_math, __pyx_imported_names, 7, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 21, __pyx_L1_error)
  }
  __pyx_t_4 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_4);
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_sqrt,__pyx_mstate_global->__pyx_n_u_ceil,__pyx_mstate_global->__pyx_n_u_floor,__pyx_mstate_global->__pyx_n_u_pi,__pyx_mstate_global->__pyx_n_u_sin,__pyx_mstate_global->__pyx_n_u_cos,__pyx_mstate_global->__pyx_n_u_tan};
    for (__pyx_t_9=0; __pyx_t_9 < 7; __pyx_t_9++) {
      __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_4, __pyx_imported_names[__pyx_t_9]); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 21, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_9], __pyx_t_5) < (0)) __PYX_ERR(0, 21, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "CyOpenGL.pyx":22
 * from colorsys import hls_to_rgb
 * from math import sqrt, ceil, floor, pi, sin, cos, tan
 * from random import random             # <<<<<<<<<<<<<<
 * import time
 * 
*/
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_random};
    __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_random, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 22, __pyx_L1_error)
  }
  __pyx_t_4 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_4);
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_random};
    __pyx_t_9 = 0; {
      __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_4, __pyx_imported_names[__pyx_t_9]); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 22, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_9], __pyx_t_5) < (0)) __PYX_ERR(0, 22, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "CyOpenGL.pyx":23
 * from math import sqrt, ceil, floor, pi, sin, cos, tan
 * from random import random
 * import time             # <<<<<<<<<<<<<<
 * 
 * from tkinter_gl import GLCanvas
*/
  __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_time, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error)
  __pyx_t_4 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_time, __pyx_t_4) < (0)) __PYX_ERR(0, 23, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "CyOpenGL.pyx":25
 * import time
 * 
 * from tkinter_gl import GLCanvas             # <<<<<<<<<<<<<<
 * 
 * ##############################################################################
*/
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_GLCanvas};
    __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_tkinter_gl, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error)
  }
  __pyx_t_4 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_4);
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_GLCanvas};
    __pyx_t_9 = 0; {
      __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_4, __pyx_imported_names[__pyx_t_9]); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 25, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_9], __pyx_t_5) < (0)) __PYX_ERR(0, 25, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opengl/common/string.pyx":1
 * def get_gl_string(string):             # <<<<<<<<<<<<<<
 *     cdef const char* str
 *     gl_string_enums = {
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_1get_gl_string, 0, __pyx_mstate_global->__pyx_n_u_get_gl_string, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[3])); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_get_gl_string, __pyx_t_4) < (0)) __PYX_ERR(10, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opengl/common/error.pyx":1
 * def clear_gl_errors():             # <<<<<<<<<<<<<<
 *     """
 *     Clears any previous OpenGL errors.
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_3clear_gl_errors, 0, __pyx_mstate_global->__pyx_n_u_clear_gl_errors, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[4])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_clear_gl_errors, __pyx_t_4) < (0)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opengl/common/error.pyx":9
 *         pass
 * 
 * def print_gl_errors(msg):             # <<<<<<<<<<<<<<
 *     """
 *     Prints all OpenGL errors using given message.
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_5print_gl_errors, 0, __pyx_mstate_global->__pyx_n_u_print_gl_errors, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[5])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_print_gl_errors, __pyx_t_4) < (0)) __PYX_ERR(1, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opengl/vector3.pyx":30
 *         return vector3([self.x*scalar, self.y*scalar, self.z*scalar])
 * 
 *     def __div__(self, scalar):             # <<<<<<<<<<<<<<
 *         return vector3([self.x/scalar, self.y/scalar, self.z/scalar])
 * 
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_7vector3_11__div__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_vector3___div, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[6])); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8CyOpenGL_vector3, __pyx_mstate_global->__pyx_n_u_div, __pyx_t_4) < (0)) __PYX_ERR(11, 30, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opengl/legacy/lighting.pyx":1
 * def cyglSetStandardLighting():             # <<<<<<<<<<<<<<
 *     """
 *     Sets up our default OpenGL environment.
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_7cyglSetStandardLighting, 0, __pyx_mstate_global->__pyx_n_u_cyglSetStandardLighting, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[7])); if (unlikely(!__pyx_t_4)) __PYX_ERR(40, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_cyglSetStandardLighting, __pyx_t_4) < (0)) __PYX_ERR(40, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opengl/legacy/object.pyx":19
 * 
 *     def __cinit__(self, *args,
 *                   color = [0.8, 0.8, 0.8, 1.0],             # <<<<<<<<<<<<<<
 *                   front_specular = [0.8, 0.8, 0.8, 1.0],
 *                   back_specular = [0.8, 0.8, 0.8, 1.0],
*/
  __pyx_t_4 = __Pyx_PyList_Pack(4, __pyx_mstate_global->__pyx_float_0_8, __pyx_mstate_global->__pyx_float_0_8, __pyx_mstate_global->__pyx_float_0_8, __pyx_mstate_global->__pyx_float_1_0); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_mstate_global->__pyx_k__9 = __pyx_t_4;
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;

  /* "opengl/legacy/object.pyx":20
 *     def __cinit__(self, *args,
 *                   color = [0.8, 0.8, 0.8, 1.0],
 *                   front_specular = [0.8, 0.8, 0.8, 1.0],             # <<<<<<<<<<<<<<
 *                   back_specular = [0.8, 0.8, 0.8, 1.0],
 *                   front_shininess = 0.0,
*/
  __pyx_t_4 = __Pyx_PyList_Pack(4, __pyx_mstate_global->__pyx_float_0_8, __pyx_mstate_global->__pyx_float_0_8, __pyx_mstate_global->__pyx_float_0_8, __pyx_mstate_global->__pyx_float_1_0); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_mstate_global->__pyx_k__10 = __pyx_t_4;
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;

  /* "opengl/legacy/object.pyx":21
 *                   color = [0.8, 0.8, 0.8, 1.0],
 *                   front_specular = [0.8, 0.8, 0.8, 1.0],
 *                   back_specular = [0.8, 0.8, 0.8, 1.0],             # <<<<<<<<<<<<<<
 *                   front_shininess = 0.0,
 *                   back_shininess = 0.0,
*/
  __pyx_t_4 = __Pyx_PyList_Pack(4, __pyx_mstate_global->__pyx_float_0_8, __pyx_mstate_global->__pyx_float_0_8, __pyx_mstate_global->__pyx_float_0_8, __pyx_mstate_global->__pyx_float_1_0); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_mstate_global->__pyx_k__11 = __pyx_t_4;
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;

  /* "opengl/legacy/object.pyx":36
 *         self.togl_widget = kwargs.get('togl_widget', None)
 * 
 *     def delete_resource(self):             # <<<<<<<<<<<<<<
 *         old_widget = RawOpenGLWidget.current_widget
 *         if self.togl_widget:
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_8GLobject_3delete_resource, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_GLobject_delete_resource, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[8])); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8CyOpenGL_GLobject, __pyx_mstate_global->__pyx_n_u_delete_resource, __pyx_t_4) < (0)) __PYX_ERR(12, 36, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opengl/legacy/object.pyx":52
 *         glColor4fv(self.color)
 * 
 *     def draw(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         """
 *         Subclasses must override this.
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_8GLobject_5draw, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_GLobject_draw, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[9])); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 52, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8CyOpenGL_GLobject, __pyx_mstate_global->__pyx_n_u_draw, __pyx_t_4) < (0)) __PYX_ERR(12, 52, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opengl/legacy/object.pyx":59
 *         """
 * 
 *     def build_display_list(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         """
 *         Generate a display list containing the commands to draw this object.
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_8GLobject_7build_display_list, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_GLobject_build_display_list, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[10])); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8CyOpenGL_GLobject, __pyx_mstate_global->__pyx_n_u_build_display_list, __pyx_t_4) < (0)) __PYX_ERR(12, 59, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opengl/legacy/object.pyx":69
 *         glEndList()
 * 
 *     cpdef display(self):             # <<<<<<<<<<<<<<
 *         if glIsList(self.list_id) == GL_TRUE:
 *             glCallList(self.list_id)
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_8GLobject_9display, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_GLobject_display, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[11])); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 69, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8CyOpenGL_GLobject, __pyx_mstate_global->__pyx_n_u_display, __pyx_t_4) < (0)) __PYX_ERR(12, 69, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opengl/legacy/wireframe_sphere.pyx":6
 *     """
 * 
 *     def draw(self, GLfloat radius, GLint slices, GLint stacks):             # <<<<<<<<<<<<<<
 *         assert slices % 2 == 0 and stacks % 2 == 0
 *         self.set_material()
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_15WireframeSphere_1draw, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_WireframeSphere_draw, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[12])); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8CyOpenGL_WireframeSphere, __pyx_mstate_global->__pyx_n_u_draw, __pyx_t_4) < (0)) __PYX_ERR(13, 6, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opengl/legacy/triangle_mesh.pyx":1
 * class TriangleMesh:             # <<<<<<<<<<<<<<
 *     """
 *     A triangle which can tessellate itself.
*/
  __pyx_t_4 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_mstate_global->__pyx_empty_tuple, __pyx_mstate_global->__pyx_n_u_TriangleMesh, __pyx_mstate_global->__pyx_n_u_TriangleMesh, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_kp_u_A_triangle_which_can_tessellate); if (unlikely(!__pyx_t_4)) __PYX_ERR(14, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "opengl/legacy/triangle_mesh.pyx":5
 *     A triangle which can tessellate itself.
 *     """
 *     def __init__(self, vertices):             # <<<<<<<<<<<<<<
 *         self.vertices = vertices
 *         self.triangles = [(0,1,2)]
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_12TriangleMesh_1__init__, 0, __pyx_mstate_global->__pyx_n_u_TriangleMesh___init, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[13])); if (unlikely(!__pyx_t_5)) __PYX_ERR(14, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_5) < (0)) __PYX_ERR(14, 5, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "opengl/legacy/triangle_mesh.pyx":9
 *         self.triangles = [(0,1,2)]
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return str(self.triangles)
 * 
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_12TriangleMesh_3__repr__, 0, __pyx_mstate_global->__pyx_n_u_TriangleMesh___repr, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[14])); if (unlikely(!__pyx_t_5)) __PYX_ERR(14, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_repr, __pyx_t_5) < (0)) __PYX_ERR(14, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "opengl/legacy/triangle_mesh.pyx":12
 *         return str(self.triangles)
 * 
 *     def __getitem__(self, n):             # <<<<<<<<<<<<<<
 *         x, y, z = self.triangles[n]
 *         return (self.vertices[x], self.vertices[y], self.vertices[z])
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_12TriangleMesh_5__getitem__, 0, __pyx_mstate_global->__pyx_n_u_TriangleMesh___getitem, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[15])); if (unlikely(!__pyx_t_5)) __PYX_ERR(14, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_getitem, __pyx_t_5) < (0)) __PYX_ERR(14, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "opengl/legacy/triangle_mesh.pyx":16
 *         return (self.vertices[x], self.vertices[y], self.vertices[z])
 * 
 *     def subdivide(self):             # <<<<<<<<<<<<<<
 *         """
 *         Replace each triangle by four triangles:
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_12TriangleMesh_7subdivide, 0, __pyx_mstate_global->__pyx_n_u_TriangleMesh_subdivide, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[16])); if (unlikely(!__pyx_t_5)) __PYX_ERR(14, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_subdivide, __pyx_t_5) < (0)) __PYX_ERR(14, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "opengl/legacy/triangle_mesh.pyx":1
 * class TriangleMesh:             # <<<<<<<<<<<<<<
 *     """
 *     A triangle which can tessellate itself.
*/
  __pyx_t_5 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_mstate_global->__pyx_n_u_TriangleMesh, __pyx_mstate_global->__pyx_empty_tuple, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(14, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_TriangleMesh, __pyx_t_5) < (0)) __PYX_ERR(14, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opengl/legacy/meshed_surface.pyx":16
 *         free(self.indices)
 * 
 *     def build_arrays(self):             # <<<<<<<<<<<<<<
 *         cdef double scale
 *         cdef vector3 V, N
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_13MeshedSurface_3build_arrays, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MeshedSurface_build_arrays, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[17])); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8CyOpenGL_MeshedSurface, __pyx_mstate_global->__pyx_n_u_build_arrays, __pyx_t_4) < (0)) __PYX_ERR(2, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opengl/legacy/meshed_surface.pyx":35
 *             T += 3
 * 
 *     def draw(self, use_material=True):             # <<<<<<<<<<<<<<
 *         glNormalPointer(GL_FLOAT, 6*sizeof(GLfloat), self.nv_array)
 *         glVertexPointer(3, GL_FLOAT, 6*sizeof(GLfloat), self.nv_array+3)
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_13MeshedSurface_5draw, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MeshedSurface_draw, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[18])); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[13]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8CyOpenGL_MeshedSurface, __pyx_mstate_global->__pyx_n_u_draw, __pyx_t_4) < (0)) __PYX_ERR(2, 35, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opengl/legacy/poincare_polygon.pyx":27
 *             self.triangles.append(PoincareTriangle(vertices, self.center))
 * 
 *     def draw(self):             # <<<<<<<<<<<<<<
 *         self.set_material()
 *         for triangle in self.triangles:
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_15PoincarePolygon_3draw, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PoincarePolygon_draw, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[19])); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8CyOpenGL_PoincarePolygon, __pyx_mstate_global->__pyx_n_u_draw, __pyx_t_4) < (0)) __PYX_ERR(3, 27, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opengl/legacy/klein_polygon.pyx":15
 *         self.closest = closest
 * 
 *     def draw(self):             # <<<<<<<<<<<<<<
 *         N = self.closest/self.closest.norm
 *         self.set_material()
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_12KleinPolygon_3draw, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_KleinPolygon_draw, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[20])); if (unlikely(!__pyx_t_4)) __PYX_ERR(16, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8CyOpenGL_KleinPolygon, __pyx_mstate_global->__pyx_n_u_draw, __pyx_t_4) < (0)) __PYX_ERR(16, 15, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opengl/legacy/hyperbolic_polyhedron.pyx":1
 * class HyperbolicPolyhedron:             # <<<<<<<<<<<<<<
 *     """
 *     A hyperbolic polyhedron for display in OpenGL, either in the Klein
*/
  __pyx_t_4 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_mstate_global->__pyx_empty_tuple, __pyx_mstate_global->__pyx_n_u_HyperbolicPolyhedron, __pyx_mstate_global->__pyx_n_u_HyperbolicPolyhedron, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_kp_u_A_hyperbolic_polyhedron_for_dis); if (unlikely(!__pyx_t_4)) __PYX_ERR(17, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "opengl/legacy/hyperbolic_polyhedron.pyx":10
 *     """
 * 
 *     def __init__(self, facedicts, model_var, sphere_var, togl_widget=None):             # <<<<<<<<<<<<<<
 *         self.facedicts = facedicts
 *         self.model = model_var
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_20HyperbolicPolyhedron_1__init__, 0, __pyx_mstate_global->__pyx_n_u_HyperbolicPolyhedron___init, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[21])); if (unlikely(!__pyx_t_5)) __PYX_ERR(17, 10, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[14]);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_5) < (0)) __PYX_ERR(17, 10, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "opengl/legacy/hyperbolic_polyhedron.pyx":50
 *             face.build_display_list()
 * 
 *     def draw(self, *args):             # <<<<<<<<<<<<<<
 *         model = self.model.get()
 *         if model == 'Klein':
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_20HyperbolicPolyhedron_3draw, 0, __pyx_mstate_global->__pyx_n_u_HyperbolicPolyhedron_draw, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[22])); if (unlikely(!__pyx_t_5)) __PYX_ERR(17, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_draw, __pyx_t_5) < (0)) __PYX_ERR(17, 50, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "opengl/legacy/hyperbolic_polyhedron.pyx":1
 * class HyperbolicPolyhedron:             # <<<<<<<<<<<<<<
 *     """
 *     A hyperbolic polyhedron for display in OpenGL, either in the Klein
*/
  __pyx_t_5 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_mstate_global->__pyx_n_u_HyperbolicPolyhedron, __pyx_mstate_global->__pyx_empty_tuple, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(17, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_HyperbolicPolyhedron, __pyx_t_5) < (0)) __PYX_ERR(17, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opengl/legacy/colorizer.pyx":60
 *         return m1
 * 
 * GetColor = Colorizer()             # <<<<<<<<<<<<<<
*/
  __pyx_t_5 = NULL;
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
    __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8CyOpenGL_Colorizer, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(18, 60, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_4);
  }
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_GetColor, ((PyObject *)__pyx_t_4)) < (0)) __PYX_ERR(18, 60, __pyx_L1_error)
  __Pyx_DECREF((PyObject *)__pyx_t_4); __pyx_t_4 = 0;

  /* "opengl/legacy/horosphere.pyx":10
 * 
 *     def __init__(self,
 *                  color=[0.8,0.0,0.0,0.3],             # <<<<<<<<<<<<<<
 *                  radius=1.0,
 *                  front_specular = [0.8, 0.8, 0.8, 1.0],
*/
  __pyx_t_4 = __Pyx_PyList_Pack(4, __pyx_mstate_global->__pyx_float_0_8, __pyx_mstate_global->__pyx_float_0_0, __pyx_mstate_global->__pyx_float_0_0, __pyx_mstate_global->__pyx_float_0_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(19, 10, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_mstate_global->__pyx_k__12 = __pyx_t_4;
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;

  /* "opengl/legacy/horosphere.pyx":12
 *                  color=[0.8,0.0,0.0,0.3],
 *                  radius=1.0,
 *                  front_specular = [0.8, 0.8, 0.8, 1.0],             # <<<<<<<<<<<<<<
 *                  back_specular = [0.8, 0.8, 0.8, 1.0],
 *                  front_shininess = 50.0,
*/
  __pyx_t_4 = __Pyx_PyList_Pack(4, __pyx_mstate_global->__pyx_float_0_8, __pyx_mstate_global->__pyx_float_0_8, __pyx_mstate_global->__pyx_float_0_8, __pyx_mstate_global->__pyx_float_1_0); if (unlikely(!__pyx_t_4)) __PYX_ERR(19, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_mstate_global->__pyx_k__13 = __pyx_t_4;
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;

  /* "opengl/legacy/horosphere.pyx":13
 *                  radius=1.0,
 *                  front_specular = [0.8, 0.8, 0.8, 1.0],
 *                  back_specular = [0.8, 0.8, 0.8, 1.0],             # <<<<<<<<<<<<<<
 *                  front_shininess = 50.0,
 *                  back_shininess = 0.0
*/
  __pyx_t_4 = __Pyx_PyList_Pack(4, __pyx_mstate_global->__pyx_float_0_8, __pyx_mstate_global->__pyx_float_0_8, __pyx_mstate_global->__pyx_float_0_8, __pyx_mstate_global->__pyx_float_1_0); if (unlikely(!__pyx_t_4)) __PYX_ERR(19, 13, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_mstate_global->__pyx_k__14 = __pyx_t_4;
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;

  /* "opengl/legacy/horoball_group.pyx":44
 *             spheres[key].build_display_list()
 * 
 *     def draw(self, R, T):             # <<<<<<<<<<<<<<
 *         vx, vy = self.meridian.real, self.meridian.imag
 *         ux = self.longitude.real
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_13HoroballGroup_3draw, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_HoroballGroup_draw, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[23])); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 44, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8CyOpenGL_HoroballGroup, __pyx_mstate_global->__pyx_n_u_draw, __pyx_t_4) < (0)) __PYX_ERR(4, 44, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opengl/legacy/parallelogram.pyx":7
 *     """
 * 
 *     def draw(self, s1, s2):             # <<<<<<<<<<<<<<
 *         glDisable(GL_LIGHTING)
 *         glLineWidth(2.0)
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_13Parallelogram_1draw, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Parallelogram_draw, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[24])); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8CyOpenGL_Parallelogram, __pyx_mstate_global->__pyx_n_u_draw, __pyx_t_4) < (0)) __PYX_ERR(20, 7, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opengl/legacy/edge_set.pyx":24
 *         glColor4f(0.7, 0.7, 0.7, 1.0)
 * 
 *     def draw(self, shifts, dark=True):             # <<<<<<<<<<<<<<
 *         glDisable(GL_LIGHTING)
 *         glLineWidth(2.0)
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_7EdgeSet_3draw, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_EdgeSet_draw, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[25])); if (unlikely(!__pyx_t_4)) __PYX_ERR(21, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[13]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8CyOpenGL_EdgeSet, __pyx_mstate_global->__pyx_n_u_draw, __pyx_t_4) < (0)) __PYX_ERR(21, 24, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opengl/legacy/label.pyx":22
 *         return width, height
 * 
 *     def draw(self):             # <<<<<<<<<<<<<<
 *         cdef SnapPy_glyph* glyph
 *         glRasterPos2f(self.x, self.y)
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_5Label_3draw, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Label_draw, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[26])); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8CyOpenGL_Label, __pyx_mstate_global->__pyx_n_u_draw, __pyx_t_4) < (0)) __PYX_ERR(23, 22, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opengl/legacy/label_set.pyx":22
 *         self.vertices = [Label(*v) for v in set(vertices)]
 * 
 *     def draw(self, shifts):             # <<<<<<<<<<<<<<
 *         glRasterPos3f(0.0, 0.0, 0.0)
 *         for M, L in shifts:
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_8LabelSet_3draw, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_LabelSet_draw, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[27])); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8CyOpenGL_LabelSet, __pyx_mstate_global->__pyx_n_u_draw, __pyx_t_4) < (0)) __PYX_ERR(24, 22, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opengl/legacy/horoball_scene.pyx":35
 *         self.build_scene()
 * 
 *     def set_cutoff(self, cutoff):             # <<<<<<<<<<<<<<
 *         self.cutoff = cutoff
 * 
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_13HoroballScene_3set_cutoff, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_HoroballScene_set_cutoff, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[28])); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8CyOpenGL_HoroballScene, __pyx_mstate_global->__pyx_n_u_set_cutoff, __pyx_t_4) < (0)) __PYX_ERR(25, 35, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opengl/legacy/horoball_scene.pyx":38
 *         self.cutoff = cutoff
 * 
 *     def flip(self, boolean_value):             # <<<<<<<<<<<<<<
 *         self.flipped = boolean_value
 * 
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_13HoroballScene_5flip, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_HoroballScene_flip, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[29])); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 38, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8CyOpenGL_HoroballScene, __pyx_mstate_global->__pyx_n_u_flip, __pyx_t_4) < (0)) __PYX_ERR(25, 38, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opengl/legacy/horoball_scene.pyx":41
 *         self.flipped = boolean_value
 * 
 *     def build_scene(self, which_cusp=None, full_list=True):             # <<<<<<<<<<<<<<
 *         if self.nbhd is None:
 *             self.cusp_view = self.labels = None
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_13HoroballScene_7build_scene, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_HoroballScene_build_scene, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[30])); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 41, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[15]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8CyOpenGL_HoroballScene, __pyx_mstate_global->__pyx_n_u_build_scene, __pyx_t_4) < (0)) __PYX_ERR(25, 41, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opengl/legacy/horoball_scene.pyx":75
 *         self.gl_compile()
 * 
 *     def delete_resource(self):             # <<<<<<<<<<<<<<
 *         self.cusp_view.delete_resource()
 *         self.light_Ford.delete_resource()
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_13HoroballScene_9delete_resource, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_HoroballScene_delete_resource, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[31])); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 75, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8CyOpenGL_HoroballScene, __pyx_mstate_global->__pyx_n_u_delete_resource, __pyx_t_4) < (0)) __PYX_ERR(25, 75, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opengl/legacy/horoball_scene.pyx":97
 *                 self.shifts.append((m,n))
 * 
 *     def translate(self, z):             # <<<<<<<<<<<<<<
 *         """
 *         Translate modulo the cusp stabilizer.
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_13HoroballScene_11translate, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_HoroballScene_translate, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[32])); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 97, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8CyOpenGL_HoroballScene, __pyx_mstate_global->__pyx_n_u_translate, __pyx_t_4) < (0)) __PYX_ERR(25, 97, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opengl/legacy/horoball_scene.pyx":162
 *             glPopMatrix()
 * 
 *     def draw(self, *args):             # <<<<<<<<<<<<<<
 *         """
 *         The scene is drawn translated by self.offset, but the
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_13HoroballScene_13draw, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_HoroballScene_draw, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[33])); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 162, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8CyOpenGL_HoroballScene, __pyx_mstate_global->__pyx_n_u_draw, __pyx_t_4) < (0)) __PYX_ERR(25, 162, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opengl/legacy/raw_openGL_widget.pyx":1
 * class RawOpenGLWidget(GLCanvas):             # <<<<<<<<<<<<<<
 *     """
 *     Widget with an OpenGL context and some Tkinter bindings
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_GLCanvas); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_Pack(1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PEP560_update_bases(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_10 = __Pyx_CalculateMetaclass(NULL, __pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(5, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_11 = __Pyx_Py3MetaclassPrepare(__pyx_t_10, __pyx_t_4, __pyx_mstate_global->__pyx_n_u_RawOpenGLWidget, __pyx_mstate_global->__pyx_n_u_RawOpenGLWidget, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_kp_u_Widget_with_an_OpenGL_context_a); if (unlikely(!__pyx_t_11)) __PYX_ERR(5, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__pyx_t_4 != __pyx_t_5) {
    if (unlikely((PyDict_SetItemString(__pyx_t_11, "__orig_bases__", __pyx_t_5) < 0))) __PYX_ERR(5, 1, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "opengl/legacy/raw_openGL_widget.pyx":17
 * 
 *     # Which of these widgets has the current openGL context.
 *     current_widget = None             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, parent, cnf={}, **kw):
*/
  if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_current_widget, Py_None) < (0)) __PYX_ERR(5, 17, __pyx_L1_error)

  /* "opengl/legacy/raw_openGL_widget.pyx":19
 *     current_widget = None
 * 
 *     def __init__(self, parent, cnf={}, **kw):             # <<<<<<<<<<<<<<
 *         """
 *         Create an OpenGL widget, arguments are passed down to
*/
  __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_15RawOpenGLWidget_1__init__, 0, __pyx_mstate_global->__pyx_n_u_RawOpenGLWidget___init, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[34])); if (unlikely(!__pyx_t_12)) __PYX_ERR(5, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_12);
  #endif
  PyList_Append(__pyx_t_5, __pyx_t_12);
  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_12, __pyx_mstate_global->__pyx_ptype_8CyOpenGL___pyx_defaults)) __PYX_ERR(5, 19, __pyx_L1_error)
  __pyx_t_13 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_13)) __PYX_ERR(5, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_t_12)->arg0 = __pyx_t_13;
  __Pyx_GIVEREF(__pyx_t_13);
  __pyx_t_13 = 0;
  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_12, __pyx_pf_8CyOpenGL_8__defaults__);
  if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_12) < (0)) __PYX_ERR(5, 19, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

  /* "opengl/legacy/raw_openGL_widget.pyx":45
 *                                              get_gl_string('GL_VERSION')))
 * 
 *     def make_current(self):             # <<<<<<<<<<<<<<
 *         """
 *         Makes this RawOpenGLWidget's GL context the current context
*/
  __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_15RawOpenGLWidget_3make_current, 0, __pyx_mstate_global->__pyx_n_u_RawOpenGLWidget_make_current, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[35])); if (unlikely(!__pyx_t_12)) __PYX_ERR(5, 45, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_12);
  #endif
  PyList_Append(__pyx_t_5, __pyx_t_12);
  if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_make_current, __pyx_t_12) < (0)) __PYX_ERR(5, 45, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

  /* "opengl/legacy/raw_openGL_widget.pyx":53
 *         RawOpenGLWidget.current_widget =  self
 * 
 *     def redraw(self):             # <<<<<<<<<<<<<<
 *         """
 *         Some clients want to update state and do a redraw but the
*/
  __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_15RawOpenGLWidget_5redraw, 0, __pyx_mstate_global->__pyx_n_u_RawOpenGLWidget_redraw, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[36])); if (unlikely(!__pyx_t_12)) __PYX_ERR(5, 53, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_12);
  #endif
  if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_redraw, __pyx_t_12) < (0)) __PYX_ERR(5, 53, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

  /* "opengl/legacy/raw_openGL_widget.pyx":64
 *             self.draw()
 * 
 *     def draw(self):             # <<<<<<<<<<<<<<
 *         self._initialized = True
 *         self.make_current()
*/
  __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_15RawOpenGLWidget_7draw, 0, __pyx_mstate_global->__pyx_n_u_RawOpenGLWidget_draw, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[37])); if (unlikely(!__pyx_t_12)) __PYX_ERR(5, 64, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_12);
  #endif
  if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_draw, __pyx_t_12) < (0)) __PYX_ERR(5, 64, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

  /* "opengl/legacy/raw_openGL_widget.pyx":71
 *         self.swap_buffers()
 * 
 *     def save_image_window_resolution(self, outfile):             # <<<<<<<<<<<<<<
 *         cdef array.array c_array
 * 
*/
  __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_15RawOpenGLWidget_9save_image_window_resolution, 0, __pyx_mstate_global->__pyx_n_u_RawOpenGLWidget_save_image_windo, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[38])); if (unlikely(!__pyx_t_12)) __PYX_ERR(5, 71, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_12);
  #endif
  if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_save_image_window_resolution, __pyx_t_12) < (0)) __PYX_ERR(5, 71, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

  /* "opengl/legacy/raw_openGL_widget.pyx":1
 * class RawOpenGLWidget(GLCanvas):             # <<<<<<<<<<<<<<
 *     """
 *     Widget with an OpenGL context and some Tkinter bindings
*/
  __pyx_t_12 = __Pyx_Py3ClassCreate(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_RawOpenGLWidget, __pyx_t_4, __pyx_t_11, NULL, 0, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(5, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_12);
  #endif
  if (__Pyx_CyFunction_InitClassCell(__pyx_t_5, __pyx_t_12) < (0)) __PYX_ERR(5, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_RawOpenGLWidget, __pyx_t_12) < (0)) __PYX_ERR(5, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opengl/legacy/perspectiveWidget.pyx":24
 *     glMultMatrixd(mat)
 * 
 * class OpenGLPerspectiveWidget(RawOpenGLWidget):             # <<<<<<<<<<<<<<
 *     """
 *     Create an OpenGL widget with a perspective view and mouse behaviors
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_RawOpenGLWidget); if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_10 = PyTuple_Pack(1, __pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(26, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PEP560_update_bases(__pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_11 = __Pyx_CalculateMetaclass(NULL, __pyx_t_4); if (unlikely(!__pyx_t_11)) __PYX_ERR(26, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_12 = __Pyx_Py3MetaclassPrepare(__pyx_t_11, __pyx_t_4, __pyx_mstate_global->__pyx_n_u_OpenGLPerspectiveWidget, __pyx_mstate_global->__pyx_n_u_OpenGLPerspectiveWidget, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_kp_u_Create_an_OpenGL_widget_with_a); if (unlikely(!__pyx_t_12)) __PYX_ERR(26, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  if (__pyx_t_4 != __pyx_t_10) {
    if (unlikely((PyDict_SetItemString(__pyx_t_12, "__orig_bases__", __pyx_t_10) < 0))) __PYX_ERR(26, 24, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "opengl/legacy/perspectiveWidget.pyx":38
 *     http://www.yorvic.york.ac.uk/~mjh/
 *     """
 *     def __init__(self, master=None, help='No help is available.',             # <<<<<<<<<<<<<<
 *                  mouse_pick=False, mouse_rotate=True, mouse_translate=False,
 *                  mouse_scale=False,
*/
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_23OpenGLPerspectiveWidget_1__init__, 0, __pyx_mstate_global->__pyx_n_u_OpenGLPerspectiveWidget___init, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[39])); if (unlikely(!__pyx_t_10)) __PYX_ERR(26, 38, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_10, __pyx_mstate_global->__pyx_ptype_8CyOpenGL___pyx_defaults)) __PYX_ERR(26, 38, __pyx_L1_error)

  /* "opengl/legacy/perspectiveWidget.pyx":42
 *                  mouse_scale=False,
 *                  fovy=30.0, near=1.0, far=100.0,
 *                  cnf={}, **kw):             # <<<<<<<<<<<<<<
 *         """
 *         Create an opengl widget with given view parameters and mouse behaviors.
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(26, 42, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_t_10)->arg0 = __pyx_t_5;
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_10, __pyx_pf_8CyOpenGL_10__defaults__);
  if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_10) < (0)) __PYX_ERR(26, 38, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "opengl/legacy/perspectiveWidget.pyx":115
 *             self.bind('<KeyPress>', self.tkKeyPress)
 * 
 *     def help(self):             # <<<<<<<<<<<<<<
 *         """
 *         Help message for the widget.
*/
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_23OpenGLPerspectiveWidget_3help, 0, __pyx_mstate_global->__pyx_n_u_OpenGLPerspectiveWidget_help, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[40])); if (unlikely(!__pyx_t_10)) __PYX_ERR(26, 115, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_help, __pyx_t_10) < (0)) __PYX_ERR(26, 115, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "opengl/legacy/perspectiveWidget.pyx":121
 *         InfoWindow(self, 'Viewer Help', self.help_text, 'viewer_help')
 * 
 *     def set_background(self, r, g, b):             # <<<<<<<<<<<<<<
 *         """
 *         Change the background colour of the widget.
*/
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_23OpenGLPerspectiveWidget_5set_background, 0, __pyx_mstate_global->__pyx_n_u_OpenGLPerspectiveWidget_set_back, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[41])); if (unlikely(!__pyx_t_10)) __PYX_ERR(26, 121, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_set_background, __pyx_t_10) < (0)) __PYX_ERR(26, 121, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "opengl/legacy/perspectiveWidget.pyx":130
 *         self.redraw()
 * 
 *     def set_centerpoint(self, x, y, z):             # <<<<<<<<<<<<<<
 *         """
 *         Set the new center point for the model.
*/
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_23OpenGLPerspectiveWidget_7set_centerpoint, 0, __pyx_mstate_global->__pyx_n_u_OpenGLPerspectiveWidget_set_cent, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[42])); if (unlikely(!__pyx_t_10)) __PYX_ERR(26, 130, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_set_centerpoint, __pyx_t_10) < (0)) __PYX_ERR(26, 130, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "opengl/legacy/perspectiveWidget.pyx":140
 *         self.redraw()
 * 
 *     def set_eyepoint(self, distance):             # <<<<<<<<<<<<<<
 *         """
 *         Set how far the eye is from the position we are looking.
*/
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_23OpenGLPerspectiveWidget_9set_eyepoint, 0, __pyx_mstate_global->__pyx_n_u_OpenGLPerspectiveWidget_set_eyep, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[43])); if (unlikely(!__pyx_t_10)) __PYX_ERR(26, 140, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_set_eyepoint, __pyx_t_10) < (0)) __PYX_ERR(26, 140, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "opengl/legacy/perspectiveWidget.pyx":147
 *         self.redraw()
 * 
 *     def reset(self, redraw=True):             # <<<<<<<<<<<<<<
 *         """
 *         Reset rotation matrix for this widget.
*/
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_23OpenGLPerspectiveWidget_11reset, 0, __pyx_mstate_global->__pyx_n_u_OpenGLPerspectiveWidget_reset, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[44])); if (unlikely(!__pyx_t_10)) __PYX_ERR(26, 147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_mstate_global->__pyx_tuple[13]);
  if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_reset, __pyx_t_10) < (0)) __PYX_ERR(26, 147, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "opengl/legacy/perspectiveWidget.pyx":158
 *             self.redraw()
 * 
 *     def tkHandlePick(self, event):             # <<<<<<<<<<<<<<
 *         """
 *         Handle a pick on the scene.
*/
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_23OpenGLPerspectiveWidget_13tkHandlePick, 0, __pyx_mstate_global->__pyx_n_u_OpenGLPerspectiveWidget_tkHandle, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[45])); if (unlikely(!__pyx_t_10)) __PYX_ERR(26, 158, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_tkHandlePick, __pyx_t_10) < (0)) __PYX_ERR(26, 158, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "opengl/legacy/perspectiveWidget.pyx":190
 *             #     self.redraw()
 * 
 *     def tkRecordMouse(self, event):             # <<<<<<<<<<<<<<
 *         """
 *         Record the current mouse position.
*/
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_23OpenGLPerspectiveWidget_15tkRecordMouse, 0, __pyx_mstate_global->__pyx_n_u_OpenGLPerspectiveWidget_tkRecord, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[46])); if (unlikely(!__pyx_t_10)) __PYX_ERR(26, 190, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_tkRecordMouse, __pyx_t_10) < (0)) __PYX_ERR(26, 190, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "opengl/legacy/perspectiveWidget.pyx":197
 *         self.xmouse, self.ymouse, self.tmouse = event.x, event.y, event.time
 * 
 *     def StartRotate(self, event):             # <<<<<<<<<<<<<<
 *         # Switch off any autospinning if it was happening
 *         self.autospin = 0
*/
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_23OpenGLPerspectiveWidget_17StartRotate, 0, __pyx_mstate_global->__pyx_n_u_OpenGLPerspectiveWidget_StartRot, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[47])); if (unlikely(!__pyx_t_10)) __PYX_ERR(26, 197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_StartRotate, __pyx_t_10) < (0)) __PYX_ERR(26, 197, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "opengl/legacy/perspectiveWidget.pyx":202
 *         self.tkRecordMouse(event)
 * 
 *     def tkScale(self, event):             # <<<<<<<<<<<<<<
 *         """
 *         Scale the scene.  Achieved by moving the eye position
*/
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_23OpenGLPerspectiveWidget_19tkScale, 0, __pyx_mstate_global->__pyx_n_u_OpenGLPerspectiveWidget_tkScale, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[48])); if (unlikely(!__pyx_t_10)) __PYX_ERR(26, 202, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_tkScale, __pyx_t_10) < (0)) __PYX_ERR(26, 202, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "opengl/legacy/perspectiveWidget.pyx":212
 *         self.tkRecordMouse(event)
 * 
 *     def zoom(self, x):             # <<<<<<<<<<<<<<
 *         t = float(x)/100.0
 *         self.distance = t*2.0 + (1-t)*10.0
*/
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_23OpenGLPerspectiveWidget_21zoom, 0, __pyx_mstate_global->__pyx_n_u_OpenGLPerspectiveWidget_zoom, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[49])); if (unlikely(!__pyx_t_10)) __PYX_ERR(26, 212, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_zoom, __pyx_t_10) < (0)) __PYX_ERR(26, 212, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "opengl/legacy/perspectiveWidget.pyx":217
 *         self.redraw()
 * 
 *     def do_AutoSpin(self):             # <<<<<<<<<<<<<<
 *         self.make_current()
 *         cyglRotateScene(self.xcenter, self.ycenter, self.zcenter,
*/
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_23OpenGLPerspectiveWidget_23do_AutoSpin, 0, __pyx_mstate_global->__pyx_n_u_OpenGLPerspectiveWidget_do_AutoS, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[50])); if (unlikely(!__pyx_t_10)) __PYX_ERR(26, 217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_do_AutoSpin, __pyx_t_10) < (0)) __PYX_ERR(26, 217, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "opengl/legacy/perspectiveWidget.pyx":226
 *             self.after(10, self.do_AutoSpin)
 * 
 *     def tkAutoSpin(self, event):             # <<<<<<<<<<<<<<
 *         """
 *         Perform autospin of scene.
*/
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_23OpenGLPerspectiveWidget_25tkAutoSpin, 0, __pyx_mstate_global->__pyx_n_u_OpenGLPerspectiveWidget_tkAutoSp, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[51])); if (unlikely(!__pyx_t_10)) __PYX_ERR(26, 226, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_tkAutoSpin, __pyx_t_10) < (0)) __PYX_ERR(26, 226, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "opengl/legacy/perspectiveWidget.pyx":235
 *         self.update_idletasks()
 * 
 *     def tkRotate(self, event):             # <<<<<<<<<<<<<<
 *         """
 *         Perform rotation of scene.
*/
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_23OpenGLPerspectiveWidget_27tkRotate, 0, __pyx_mstate_global->__pyx_n_u_OpenGLPerspectiveWidget_tkRotate, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[52])); if (unlikely(!__pyx_t_10)) __PYX_ERR(26, 235, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_tkRotate, __pyx_t_10) < (0)) __PYX_ERR(26, 235, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "opengl/legacy/perspectiveWidget.pyx":248
 *         self.tkRecordMouse(event)
 * 
 *     def tkTranslate(self, event):             # <<<<<<<<<<<<<<
 *         """
 *         Perform translation of scene.
*/
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_23OpenGLPerspectiveWidget_29tkTranslate, 0, __pyx_mstate_global->__pyx_n_u_OpenGLPerspectiveWidget_tkTransl, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[53])); if (unlikely(!__pyx_t_10)) __PYX_ERR(26, 248, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_tkTranslate, __pyx_t_10) < (0)) __PYX_ERR(26, 248, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "opengl/legacy/perspectiveWidget.pyx":257
 *         self.tkRecordMouse(event)
 * 
 *     def mouse_update(self, event):             # <<<<<<<<<<<<<<
 *         """
 *         Redraw the scene and save the mouse coordinates.
*/
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_23OpenGLPerspectiveWidget_31mouse_update, 0, __pyx_mstate_global->__pyx_n_u_OpenGLPerspectiveWidget_mouse_up, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[54])); if (unlikely(!__pyx_t_10)) __PYX_ERR(26, 257, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_mouse_update, __pyx_t_10) < (0)) __PYX_ERR(26, 257, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "opengl/legacy/perspectiveWidget.pyx":264
 *         self.tkRecordMouse(event)
 * 
 *     def draw_impl(self, width, height):             # <<<<<<<<<<<<<<
 *         """
 *         Implements redrawing by calling redraw_impl to draw the scene
*/
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_23OpenGLPerspectiveWidget_33draw_impl, 0, __pyx_mstate_global->__pyx_n_u_OpenGLPerspectiveWidget_draw_imp, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[55])); if (unlikely(!__pyx_t_10)) __PYX_ERR(26, 264, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_draw_impl, __pyx_t_10) < (0)) __PYX_ERR(26, 264, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "opengl/legacy/perspectiveWidget.pyx":286
 *         glPopMatrix()              # Restore the matrix
 * 
 *     def draw_projection_impl(self):             # <<<<<<<<<<<<<<
 *         """
 *         To be implemented by subclass.
*/
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_23OpenGLPerspectiveWidget_35draw_projection_impl, 0, __pyx_mstate_global->__pyx_n_u_OpenGLPerspectiveWidget_draw_pro, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[56])); if (unlikely(!__pyx_t_10)) __PYX_ERR(26, 286, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_draw_projection_impl, __pyx_t_10) < (0)) __PYX_ERR(26, 286, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "opengl/legacy/perspectiveWidget.pyx":291
 *         """
 * 
 *     def build_projection(self, width, height):             # <<<<<<<<<<<<<<
 *         self.make_current()
 *         cdef GLdouble xmax, ymax, near, far
*/
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_23OpenGLPerspectiveWidget_37build_projection, 0, __pyx_mstate_global->__pyx_n_u_OpenGLPerspectiveWidget_build_pr, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[57])); if (unlikely(!__pyx_t_10)) __PYX_ERR(26, 291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_build_projection, __pyx_t_10) < (0)) __PYX_ERR(26, 291, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "opengl/legacy/perspectiveWidget.pyx":303
 *         glTranslatef(-self.xcenter, -self.ycenter, -(self.zcenter+self.distance))
 * 
 *     def tkKeyPress(self, event):             # <<<<<<<<<<<<<<
 *         """
 *         Handle keyboard events.
*/
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_23OpenGLPerspectiveWidget_39tkKeyPress, 0, __pyx_mstate_global->__pyx_n_u_OpenGLPerspectiveWidget_tkKeyPre, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[58])); if (unlikely(!__pyx_t_10)) __PYX_ERR(26, 303, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_tkKeyPress, __pyx_t_10) < (0)) __PYX_ERR(26, 303, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "opengl/legacy/perspectiveWidget.pyx":314
 *             self.redraw()
 * 
 *     def tkPrint(self, file):             # <<<<<<<<<<<<<<
 *         """
 *         Turn the current scene into PostScript via the feedback buffer.
*/
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_23OpenGLPerspectiveWidget_41tkPrint, 0, __pyx_mstate_global->__pyx_n_u_OpenGLPerspectiveWidget_tkPrint, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[59])); if (unlikely(!__pyx_t_10)) __PYX_ERR(26, 314, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_tkPrint, __pyx_t_10) < (0)) __PYX_ERR(26, 314, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "opengl/legacy/perspectiveWidget.pyx":24
 *     glMultMatrixd(mat)
 * 
 * class OpenGLPerspectiveWidget(RawOpenGLWidget):             # <<<<<<<<<<<<<<
 *     """
 *     Create an OpenGL widget with a perspective view and mouse behaviors
*/
  __pyx_t_10 = __Pyx_Py3ClassCreate(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_OpenGLPerspectiveWidget, __pyx_t_4, __pyx_t_12, NULL, 0, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(26, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_OpenGLPerspectiveWidget, __pyx_t_10) < (0)) __PYX_ERR(26, 24, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opengl/legacy/orthoWidget.pyx":1
 * class OpenGLOrthoWidget(OpenGLPerspectiveWidget):             # <<<<<<<<<<<<<<
 *     """
 *     A version of the widget that uses orthographic projection instead
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_OpenGLPerspectiveWidget); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_11 = PyTuple_Pack(1, __pyx_t_4); if (unlikely(!__pyx_t_11)) __PYX_ERR(27, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PEP560_update_bases(__pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_12 = __Pyx_CalculateMetaclass(NULL, __pyx_t_4); if (unlikely(!__pyx_t_12)) __PYX_ERR(27, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_10 = __Pyx_Py3MetaclassPrepare(__pyx_t_12, __pyx_t_4, __pyx_mstate_global->__pyx_n_u_OpenGLOrthoWidget, __pyx_mstate_global->__pyx_n_u_OpenGLOrthoWidget, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_kp_u_A_version_of_the_widget_that_us); if (unlikely(!__pyx_t_10)) __PYX_ERR(27, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__pyx_t_4 != __pyx_t_11) {
    if (unlikely((PyDict_SetItemString(__pyx_t_10, "__orig_bases__", __pyx_t_11) < 0))) __PYX_ERR(27, 1, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "opengl/legacy/orthoWidget.pyx":7
 *     """
 * 
 *     def build_projection(self, width, height, t=1.0):             # <<<<<<<<<<<<<<
 *         aspect = float(width)/float(height)
 *         top = self.fovy/2
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_17OpenGLOrthoWidget_1build_projection, 0, __pyx_mstate_global->__pyx_n_u_OpenGLOrthoWidget_build_projecti, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[60])); if (unlikely(!__pyx_t_11)) __PYX_ERR(27, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_11, __pyx_mstate_global->__pyx_tuple[4]);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_build_projection, __pyx_t_11) < (0)) __PYX_ERR(27, 7, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "opengl/legacy/orthoWidget.pyx":23
 *             glOrtho(-right, right, -top, top, -3.0, 3.0)
 * 
 *     def tkTranslate(self, event):             # <<<<<<<<<<<<<<
 *         """
 *         Perform translation of scene.
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_17OpenGLOrthoWidget_3tkTranslate, 0, __pyx_mstate_global->__pyx_n_u_OpenGLOrthoWidget_tkTranslate, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[61])); if (unlikely(!__pyx_t_11)) __PYX_ERR(27, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_tkTranslate, __pyx_t_11) < (0)) __PYX_ERR(27, 23, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "opengl/legacy/orthoWidget.pyx":1
 * class OpenGLOrthoWidget(OpenGLPerspectiveWidget):             # <<<<<<<<<<<<<<
 *     """
 *     A version of the widget that uses orthographic projection instead
*/
  __pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_OpenGLOrthoWidget, __pyx_t_4, __pyx_t_10, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(27, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_OpenGLOrthoWidget, __pyx_t_11) < (0)) __PYX_ERR(27, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opengl/modern/data_based_texture.pyx":37
 *         glBindTexture(GL_TEXTURE_2D, 0)
 * 
 *     def bind(self):             # <<<<<<<<<<<<<<
 *         glBindTexture(GL_TEXTURE_2D, self._textureName)
 * 
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_16DataBasedTexture_5bind, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DataBasedTexture_bind, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[62])); if (unlikely(!__pyx_t_4)) __PYX_ERR(28, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8CyOpenGL_DataBasedTexture, __pyx_mstate_global->__pyx_n_u_bind, __pyx_t_4) < (0)) __PYX_ERR(28, 37, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opengl/modern/data_based_texture.pyx":40
 *         glBindTexture(GL_TEXTURE_2D, self._textureName)
 * 
 *     def unbind(self):             # <<<<<<<<<<<<<<
 *         glBindTexture(GL_TEXTURE_2D, 0)
 * 
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_16DataBasedTexture_7unbind, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DataBasedTexture_unbind, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[63])); if (unlikely(!__pyx_t_4)) __PYX_ERR(28, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8CyOpenGL_DataBasedTexture, __pyx_mstate_global->__pyx_n_u_unbind, __pyx_t_4) < (0)) __PYX_ERR(28, 40, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opengl/modern/data_based_texture.pyx":43
 *         glBindTexture(GL_TEXTURE_2D, 0)
 * 
 *     def delete_resource(self):             # <<<<<<<<<<<<<<
 *         glDeleteTextures(1, &self._textureName)
 *         self._textureName = 0
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_16DataBasedTexture_9delete_resource, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DataBasedTexture_delete_resource, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[64])); if (unlikely(!__pyx_t_4)) __PYX_ERR(28, 43, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8CyOpenGL_DataBasedTexture, __pyx_mstate_global->__pyx_n_u_delete_resource, __pyx_t_4) < (0)) __PYX_ERR(28, 43, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opengl/modern/image_based_texture.pyx":1
 * class ImageBasedTexture(DataBasedTexture):             # <<<<<<<<<<<<<<
 *     def __init__(self, texture_file):
 *         w, h, rows, info = png.Reader(texture_file).asRGBA8()
*/
  __pyx_t_4 = PyTuple_Pack(1, ((PyObject *)__pyx_mstate_global->__pyx_ptype_8CyOpenGL_DataBasedTexture)); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_12 = __Pyx_PEP560_update_bases(__pyx_t_4); if (unlikely(!__pyx_t_12)) __PYX_ERR(6, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_10 = __Pyx_CalculateMetaclass(NULL, __pyx_t_12); if (unlikely(!__pyx_t_10)) __PYX_ERR(6, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_11 = __Pyx_Py3MetaclassPrepare(__pyx_t_10, __pyx_t_12, __pyx_mstate_global->__pyx_n_u_ImageBasedTexture, __pyx_mstate_global->__pyx_n_u_ImageBasedTexture, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, (PyObject *) NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(6, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__pyx_t_12 != __pyx_t_4) {
    if (unlikely((PyDict_SetItemString(__pyx_t_11, "__orig_bases__", __pyx_t_4) < 0))) __PYX_ERR(6, 1, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "opengl/modern/image_based_texture.pyx":2
 * class ImageBasedTexture(DataBasedTexture):
 *     def __init__(self, texture_file):             # <<<<<<<<<<<<<<
 *         w, h, rows, info = png.Reader(texture_file).asRGBA8()
 *         data = bytearray(4 * w * h)
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_17ImageBasedTexture_1__init__, 0, __pyx_mstate_global->__pyx_n_u_ImageBasedTexture___init, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[65])); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  PyList_Append(__pyx_t_4, __pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_5) < (0)) __PYX_ERR(6, 2, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "opengl/modern/image_based_texture.pyx":1
 * class ImageBasedTexture(DataBasedTexture):             # <<<<<<<<<<<<<<
 *     def __init__(self, texture_file):
 *         w, h, rows, info = png.Reader(texture_file).asRGBA8()
*/
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_ImageBasedTexture, __pyx_t_12, __pyx_t_11, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  if (__Pyx_CyFunction_InitClassCell(__pyx_t_4, __pyx_t_5) < (0)) __PYX_ERR(6, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ImageBasedTexture, __pyx_t_5) < (0)) __PYX_ERR(6, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

  /* "opengl/modern/uniform_buffer_object.pyx":38
 *         print_gl_errors("UniformBufferObject.__init__")
 * 
 *     def set(self, name, uniform_type, value):             # <<<<<<<<<<<<<<
 *         cdef size_t offset
 *         cdef size_t l
*/
  __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_19UniformBufferObject_3set, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_UniformBufferObject_set, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[66])); if (unlikely(!__pyx_t_12)) __PYX_ERR(29, 38, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_12);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8CyOpenGL_UniformBufferObject, __pyx_mstate_global->__pyx_n_u_set, __pyx_t_12) < (0)) __PYX_ERR(29, 38, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

  /* "opengl/modern/uniform_buffer_object.pyx":101
 *                     uniform_type, name))
 * 
 *     def commit(self):             # <<<<<<<<<<<<<<
 *         glBindBuffer(GL_UNIFORM_BUFFER, self._uniform_buffer_object)
 *         glBufferData(GL_UNIFORM_BUFFER,
*/
  __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_19UniformBufferObject_5commit, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_UniformBufferObject_commit, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[67])); if (unlikely(!__pyx_t_12)) __PYX_ERR(29, 101, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_12);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8CyOpenGL_UniformBufferObject, __pyx_mstate_global->__pyx_n_u_commit, __pyx_t_12) < (0)) __PYX_ERR(29, 101, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

  /* "opengl/modern/uniform_buffer_object.pyx":108
 *                      GL_STATIC_DRAW)
 * 
 *     def bind_block(self, GLuint binding_point):             # <<<<<<<<<<<<<<
 *         glBindBufferBase(GL_UNIFORM_BUFFER,
 *                          binding_point,
*/
  __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_19UniformBufferObject_7bind_block, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_UniformBufferObject_bind_block, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[68])); if (unlikely(!__pyx_t_12)) __PYX_ERR(29, 108, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_12);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8CyOpenGL_UniformBufferObject, __pyx_mstate_global->__pyx_n_u_bind_block, __pyx_t_12) < (0)) __PYX_ERR(29, 108, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

  /* "opengl/modern/uniform_buffer_object.pyx":117
 *         self._buffer = NULL
 * 
 *     def delete_resource(self):             # <<<<<<<<<<<<<<
 *         glDeleteBuffers(1, &self._uniform_buffer_object)
 *         self._uniform_buffer_object = 0
*/
  __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_19UniformBufferObject_11delete_resource, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_UniformBufferObject_delete_resou, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[69])); if (unlikely(!__pyx_t_12)) __PYX_ERR(29, 117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_12);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8CyOpenGL_UniformBufferObject, __pyx_mstate_global->__pyx_n_u_delete_resource, __pyx_t_12) < (0)) __PYX_ERR(29, 117, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

  /* "opengl/modern/glsl_program.pyx":82
 * 
 *     def __init__(self, vertex_shader_source, fragment_shader_source,
 *                  uniform_block_names_sizes_and_offsets = [],             # <<<<<<<<<<<<<<
 *                  name = "unnamed"):
 *         self._name_to_uniform_block = {}
*/
  __pyx_t_12 = PyList_New(0); if (unlikely(!__pyx_t_12)) __PYX_ERR(30, 82, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_mstate_global->__pyx_k__15 = __pyx_t_12;
  __Pyx_GIVEREF(__pyx_t_12);
  __pyx_t_12 = 0;

  /* "opengl/modern/glsl_program.pyx":123
 *                    open('/tmp/fragment.glsl', 'wb').write(fragment_shader_source)
 * 
 *     def _compile_and_link(self, name):             # <<<<<<<<<<<<<<
 *         if not _compile_shader(self._vertex_shader, name, 'vertex'):
 *             return False
*/
  __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_11GLSLProgram_3_compile_and_link, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_GLSLProgram__compile_and_link, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[70])); if (unlikely(!__pyx_t_12)) __PYX_ERR(30, 123, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_12);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8CyOpenGL_GLSLProgram, __pyx_mstate_global->__pyx_n_u_compile_and_link, __pyx_t_12) < (0)) __PYX_ERR(30, 123, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

  /* "opengl/modern/glsl_program.pyx":138
 *         return True
 * 
 *     def is_valid(self):             # <<<<<<<<<<<<<<
 *         return self._is_valid
 * 
*/
  __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_11GLSLProgram_5is_valid, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_GLSLProgram_is_valid, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[71])); if (unlikely(!__pyx_t_12)) __PYX_ERR(30, 138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_12);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8CyOpenGL_GLSLProgram, __pyx_mstate_global->__pyx_n_u_is_valid, __pyx_t_12) < (0)) __PYX_ERR(30, 138, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

  /* "opengl/modern/glsl_program.pyx":141
 *         return self._is_valid
 * 
 *     def bind_uniforms(self, name_to_type_and_value):             # <<<<<<<<<<<<<<
 *         """
 *         Bind uniforms. This method can only be used after use_program
*/
  __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_11GLSLProgram_7bind_uniforms, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_GLSLProgram_bind_uniforms, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[72])); if (unlikely(!__pyx_t_12)) __PYX_ERR(30, 141, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_12);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8CyOpenGL_GLSLProgram, __pyx_mstate_global->__pyx_n_u_bind_uniforms, __pyx_t_12) < (0)) __PYX_ERR(30, 141, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

  /* "opengl/modern/glsl_program.pyx":309
 *         print_gl_errors("uniform blocks")
 * 
 *     def use_program(self):             # <<<<<<<<<<<<<<
 *         """
 *         Use program. Assumes that the current GL context is the context
*/
  __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_11GLSLProgram_9use_program, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_GLSLProgram_use_program, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[73])); if (unlikely(!__pyx_t_12)) __PYX_ERR(30, 309, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_12);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8CyOpenGL_GLSLProgram, __pyx_mstate_global->__pyx_n_u_use_program, __pyx_t_12) < (0)) __PYX_ERR(30, 309, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

  /* "opengl/modern/glsl_program.pyx":317
 *         glUseProgram(self._glsl_program)
 * 
 *     def delete_resource(self):             # <<<<<<<<<<<<<<
 *         """
 *         Delete shaders associated to program.
*/
  __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_11GLSLProgram_11delete_resource, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_GLSLProgram_delete_resource, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[74])); if (unlikely(!__pyx_t_12)) __PYX_ERR(30, 317, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_12);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8CyOpenGL_GLSLProgram, __pyx_mstate_global->__pyx_n_u_delete_resource, __pyx_t_12) < (0)) __PYX_ERR(30, 317, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

  /* "opengl/modern/vertex_buffer.pyx":50
 *         print_gl_errors("glGenBuffers")
 * 
 *     def bind(self):             # <<<<<<<<<<<<<<
 *         clear_gl_errors()
 *         glBindVertexArray(self._vao)
*/
  __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_12VertexBuffer_3bind, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_VertexBuffer_bind, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[75])); if (unlikely(!__pyx_t_12)) __PYX_ERR(31, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_12);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8CyOpenGL_VertexBuffer, __pyx_mstate_global->__pyx_n_u_bind, __pyx_t_12) < (0)) __PYX_ERR(31, 50, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

  /* "opengl/modern/vertex_buffer.pyx":71
 *         print_gl_errors("glVertexAttribPointer")
 * 
 *     def load(self, vertex_data):             # <<<<<<<<<<<<<<
 *         """
 *         Load data into GL vertex buffer objects.
*/
  __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_12VertexBuffer_5load, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_VertexBuffer_load, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[76])); if (unlikely(!__pyx_t_12)) __PYX_ERR(31, 71, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_12);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8CyOpenGL_VertexBuffer, __pyx_mstate_global->__pyx_n_u_load, __pyx_t_12) < (0)) __PYX_ERR(31, 71, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

  /* "opengl/modern/vertex_buffer.pyx":108
 *             free(verts)
 * 
 *     def delete_resource(self):             # <<<<<<<<<<<<<<
 *         # Same comments as for GLSLProgram.delete_resource apply
 * 
*/
  __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_12VertexBuffer_7delete_resource, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_VertexBuffer_delete_resource, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[77])); if (unlikely(!__pyx_t_12)) __PYX_ERR(31, 108, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_12);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8CyOpenGL_VertexBuffer, __pyx_mstate_global->__pyx_n_u_delete_resource, __pyx_t_12) < (0)) __PYX_ERR(31, 108, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

  /* "opengl/modern/simple_image_shader_widget.pyx":1
 * class SimpleImageShaderWidget(GLCanvas):             # <<<<<<<<<<<<<<
 *     """
 *     An image shader is a GLSL program that does all of its computation in
*/
  __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_GLCanvas); if (unlikely(!__pyx_t_12)) __PYX_ERR(32, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_10 = PyTuple_Pack(1, __pyx_t_12); if (unlikely(!__pyx_t_10)) __PYX_ERR(32, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = __Pyx_PEP560_update_bases(__pyx_t_10); if (unlikely(!__pyx_t_12)) __PYX_ERR(32, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_11 = __Pyx_CalculateMetaclass(NULL, __pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(32, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_11, __pyx_t_12, __pyx_mstate_global->__pyx_n_u_SimpleImageShaderWidget, __pyx_mstate_global->__pyx_n_u_SimpleImageShaderWidget, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_kp_u_An_image_shader_is_a_GLSL_progr); if (unlikely(!__pyx_t_5)) __PYX_ERR(32, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_12 != __pyx_t_10) {
    if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_t_10) < 0))) __PYX_ERR(32, 1, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = PyList_New(0); if (unlikely(!__pyx_t_10)) __PYX_ERR(32, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);

  /* "opengl/modern/simple_image_shader_widget.pyx":16
 *     """
 * 
 *     profile = '3_2'             # <<<<<<<<<<<<<<
 * 
 *     vertex_shader_source = b"""
*/
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_profile, __pyx_mstate_global->__pyx_kp_u_3_2) < (0)) __PYX_ERR(32, 16, __pyx_L1_error)

  /* "opengl/modern/simple_image_shader_widget.pyx":18
 *     profile = '3_2'
 * 
 *     vertex_shader_source = b"""             # <<<<<<<<<<<<<<
 *     #version 150
 * 
*/
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_vertex_shader_source, __pyx_mstate_global->__pyx_kp_b_version_150_Note_that_GLSL_ES_3) < (0)) __PYX_ERR(32, 18, __pyx_L1_error)

  /* "opengl/modern/simple_image_shader_widget.pyx":33
 *     """
 * 
 *     fragment_shader_source = b"""             # <<<<<<<<<<<<<<
 *     #version 150
 * 
*/
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_fragment_shader_source, __pyx_mstate_global->__pyx_kp_b_version_150_out_vec4_out_FragCo) < (0)) __PYX_ERR(32, 33, __pyx_L1_error)

  /* "opengl/modern/simple_image_shader_widget.pyx":44
 *     """
 * 
 *     report_gl_errors = False             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, parent, **kw):
*/
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_report_gl_errors, Py_False) < (0)) __PYX_ERR(32, 44, __pyx_L1_error)

  /* "opengl/modern/simple_image_shader_widget.pyx":46
 *     report_gl_errors = False
 * 
 *     def __init__(self, parent, **kw):             # <<<<<<<<<<<<<<
 *         super().__init__(parent, **kw)
 * 
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_23SimpleImageShaderWidget_1__init__, 0, __pyx_mstate_global->__pyx_n_u_SimpleImageShaderWidget___init, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[78])); if (unlikely(!__pyx_t_4)) __PYX_ERR(32, 46, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  PyList_Append(__pyx_t_10, __pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_4) < (0)) __PYX_ERR(32, 46, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opengl/modern/simple_image_shader_widget.pyx":70
 *                                              get_gl_string('GL_VERSION')))
 * 
 *     def set_textures(self, texture_files):             # <<<<<<<<<<<<<<
 *         self.make_current()
 * 
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_23SimpleImageShaderWidget_3set_textures, 0, __pyx_mstate_global->__pyx_n_u_SimpleImageShaderWidget_set_text, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[79])); if (unlikely(!__pyx_t_4)) __PYX_ERR(32, 70, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_set_textures, __pyx_t_4) < (0)) __PYX_ERR(32, 70, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opengl/modern/simple_image_shader_widget.pyx":87
 *             self.textures.append(texture)
 * 
 *     def set_fragment_shader_source(self,             # <<<<<<<<<<<<<<
 *                                    source,
 *                                    uniform_block_names_sizes_and_offsets = []):
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_23SimpleImageShaderWidget_5set_fragment_shader_source, 0, __pyx_mstate_global->__pyx_n_u_SimpleImageShaderWidget_set_frag, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[80])); if (unlikely(!__pyx_t_4)) __PYX_ERR(32, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_4, __pyx_mstate_global->__pyx_ptype_8CyOpenGL___pyx_defaults)) __PYX_ERR(32, 87, __pyx_L1_error)

  /* "opengl/modern/simple_image_shader_widget.pyx":89
 *     def set_fragment_shader_source(self,
 *                                    source,
 *                                    uniform_block_names_sizes_and_offsets = []):             # <<<<<<<<<<<<<<
 *         self.image_shader.delete_resource()
 *         self.image_shader = GLSLProgram(
*/
  __pyx_t_13 = PyList_New(0); if (unlikely(!__pyx_t_13)) __PYX_ERR(32, 89, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_t_4)->arg0 = __pyx_t_13;
  __Pyx_GIVEREF(__pyx_t_13);
  __pyx_t_13 = 0;
  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_4, __pyx_pf_8CyOpenGL_12__defaults__);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_set_fragment_shader_source, __pyx_t_4) < (0)) __PYX_ERR(32, 87, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opengl/modern/simple_image_shader_widget.pyx":97
 *             name = "image shader")
 * 
 *     def render_to_array(self, width, height, as_float = False):             # <<<<<<<<<<<<<<
 *         """
 *         Renders the image into an off-screen framebuffer
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_23SimpleImageShaderWidget_7render_to_array, 0, __pyx_mstate_global->__pyx_n_u_SimpleImageShaderWidget_render_t, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[81])); if (unlikely(!__pyx_t_4)) __PYX_ERR(32, 97, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[16]);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_render_to_array, __pyx_t_4) < (0)) __PYX_ERR(32, 97, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opengl/modern/simple_image_shader_widget.pyx":192
 *         return c_array
 * 
 *     def save_image(self, width, height, outfile):             # <<<<<<<<<<<<<<
 *         """
 *         Writes image of given width and height
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_23SimpleImageShaderWidget_9save_image, 0, __pyx_mstate_global->__pyx_n_u_SimpleImageShaderWidget_save_ima, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[82])); if (unlikely(!__pyx_t_4)) __PYX_ERR(32, 192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_save_image, __pyx_t_4) < (0)) __PYX_ERR(32, 192, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opengl/modern/simple_image_shader_widget.pyx":214
 *         writer.write(outfile, rows)
 * 
 *     def read_depth_value(self, x, y):             # <<<<<<<<<<<<<<
 * 
 *         cdef GLfloat depth
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_23SimpleImageShaderWidget_11read_depth_value, 0, __pyx_mstate_global->__pyx_n_u_SimpleImageShaderWidget_read_dep, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[83])); if (unlikely(!__pyx_t_4)) __PYX_ERR(32, 214, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_read_depth_value, __pyx_t_4) < (0)) __PYX_ERR(32, 214, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opengl/modern/simple_image_shader_widget.pyx":233
 *         return (depth, width, height)
 * 
 *     def draw_impl(self, width, height,             # <<<<<<<<<<<<<<
 *                   include_depth_value = False):
 * 
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_23SimpleImageShaderWidget_13draw_impl, 0, __pyx_mstate_global->__pyx_n_u_SimpleImageShaderWidget_draw_imp, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[84])); if (unlikely(!__pyx_t_4)) __PYX_ERR(32, 233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[16]);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_draw_impl, __pyx_t_4) < (0)) __PYX_ERR(32, 233, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opengl/modern/simple_image_shader_widget.pyx":273
 *             self.report_time_callback(time.time() - start_time)
 * 
 *     def draw(self):             # <<<<<<<<<<<<<<
 *         width = self.winfo_width()
 *         height = self.winfo_height()
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_23SimpleImageShaderWidget_15draw, 0, __pyx_mstate_global->__pyx_n_u_SimpleImageShaderWidget_draw, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[85])); if (unlikely(!__pyx_t_4)) __PYX_ERR(32, 273, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_draw, __pyx_t_4) < (0)) __PYX_ERR(32, 273, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opengl/modern/simple_image_shader_widget.pyx":286
 *             print_gl_errors("draw")
 * 
 *     def get_uniform_bindings(self, view_width, view_height):             # <<<<<<<<<<<<<<
 *         return {
 *             'viewportSize' : ('vec2', (view_width, view_height))
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_23SimpleImageShaderWidget_17get_uniform_bindings, 0, __pyx_mstate_global->__pyx_n_u_SimpleImageShaderWidget_get_unif, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[86])); if (unlikely(!__pyx_t_4)) __PYX_ERR(32, 286, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_get_uniform_bindings, __pyx_t_4) < (0)) __PYX_ERR(32, 286, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "opengl/modern/simple_image_shader_widget.pyx":1
 * class SimpleImageShaderWidget(GLCanvas):             # <<<<<<<<<<<<<<
 *     """
 *     An image shader is a GLSL program that does all of its computation in
*/
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_SimpleImageShaderWidget, __pyx_t_12, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(32, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_CyFunction_InitClassCell(__pyx_t_10, __pyx_t_4) < (0)) __PYX_ERR(32, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_SimpleImageShaderWidget, __pyx_t_4) < (0)) __PYX_ERR(32, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

  /* "opengl/modern/glsl_perspective_view.pyx":156
 *         mat4_multiply(self._projection, self._model_view, self._mvp)
 * 
 *     cpdef translate(self, GLfloat x, GLfloat y, GLfloat z):             # <<<<<<<<<<<<<<
 *         """
 *         Multiply the model view matrix by a translation matrix, without
*/
  __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_19GLSLPerspectiveView_3translate, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_GLSLPerspectiveView_translate, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[87])); if (unlikely(!__pyx_t_12)) __PYX_ERR(33, 156, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_12);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8CyOpenGL_GLSLPerspectiveView, __pyx_mstate_global->__pyx_n_u_translate, __pyx_t_12) < (0)) __PYX_ERR(33, 156, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

  /* "opengl/modern/glsl_perspective_view.pyx":170
 *             M[i+2] += z*a
 * 
 *     cpdef rotate(self, GLfloat theta, GLfloat x, GLfloat y, GLfloat z):             # <<<<<<<<<<<<<<
 *         """
 *         Update self._rotation by multiplying by a rotation matrix with
*/
  __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_19GLSLPerspectiveView_5rotate, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_GLSLPerspectiveView_rotate, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[88])); if (unlikely(!__pyx_t_12)) __PYX_ERR(33, 170, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_12);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8CyOpenGL_GLSLPerspectiveView, __pyx_mstate_global->__pyx_n_u_rotate, __pyx_t_12) < (0)) __PYX_ERR(33, 170, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

  /* "opengl/modern/glsl_perspective_view.pyx":189
 *         mat4_multiply(rot, self._rotation, self._rotation)
 * 
 *     def get_uniform_bindings(self, view_width, view_height):             # <<<<<<<<<<<<<<
 *         self.compute_mvp(view_width, view_height)
 * 
*/
  __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_19GLSLPerspectiveView_7get_uniform_bindings, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_GLSLPerspectiveView_get_uniform, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[89])); if (unlikely(!__pyx_t_12)) __PYX_ERR(33, 189, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_12);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8CyOpenGL_GLSLPerspectiveView, __pyx_mstate_global->__pyx_n_u_get_uniform_bindings, __pyx_t_12) < (0)) __PYX_ERR(33, 189, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

  /* "opengl/modern/glsl_perspective_widget.pyx":1
 * class GLSLPerspectiveWidget(RawOpenGLWidget, GLSLPerspectiveView):             # <<<<<<<<<<<<<<
 *     """
 *     A widget which renders a collection of OpenGL objects in perspective,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_RawOpenGLWidget); if (unlikely(!__pyx_t_12)) __PYX_ERR(34, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_11 = PyTuple_Pack(2, __pyx_t_12, ((PyObject *)__pyx_mstate_global->__pyx_ptype_8CyOpenGL_GLSLPerspectiveView)); if (unlikely(!__pyx_t_11)) __PYX_ERR(34, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = __Pyx_PEP560_update_bases(__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(34, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_12); if (unlikely(!__pyx_t_5)) __PYX_ERR(34, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_12, __pyx_mstate_global->__pyx_n_u_GLSLPerspectiveWidget, __pyx_mstate_global->__pyx_n_u_GLSLPerspectiveWidget, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_kp_u_A_widget_which_renders_a_collec); if (unlikely(!__pyx_t_4)) __PYX_ERR(34, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__pyx_t_12 != __pyx_t_11) {
    if (unlikely((PyDict_SetItemString(__pyx_t_4, "__orig_bases__", __pyx_t_11) < 0))) __PYX_ERR(34, 1, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "opengl/modern/glsl_perspective_widget.pyx":6
 *     using a GLSL vertex shader to compute the projection.
 *     """
 *     profile = '3_2'             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, master, cnf={}, **kw):
*/
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_profile, __pyx_mstate_global->__pyx_kp_u_3_2) < (0)) __PYX_ERR(34, 6, __pyx_L1_error)

  /* "opengl/modern/glsl_perspective_widget.pyx":8
 *     profile = '3_2'
 * 
 *     def __init__(self, master, cnf={}, **kw):             # <<<<<<<<<<<<<<
 *         RawOpenGLWidget.__init__(self, master, cnf={}, **kw)
 *         GLSLPerspectiveView.__init__(self)
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_21GLSLPerspectiveWidget_1__init__, 0, __pyx_mstate_global->__pyx_n_u_GLSLPerspectiveWidget___init, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[90])); if (unlikely(!__pyx_t_11)) __PYX_ERR(34, 8, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_11, __pyx_mstate_global->__pyx_ptype_8CyOpenGL___pyx_defaults)) __PYX_ERR(34, 8, __pyx_L1_error)
  __pyx_t_10 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_10)) __PYX_ERR(34, 8, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_t_11)->arg0 = __pyx_t_10;
  __Pyx_GIVEREF(__pyx_t_10);
  __pyx_t_10 = 0;
  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_11, __pyx_pf_8CyOpenGL_14__defaults__);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_11) < (0)) __PYX_ERR(34, 8, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "opengl/modern/glsl_perspective_widget.pyx":15
 *         glDisable(GL_CULL_FACE)
 * 
 *     def add_object(self, obj):             # <<<<<<<<<<<<<<
 *         self.objects.append(obj)
 * 
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_21GLSLPerspectiveWidget_3add_object, 0, __pyx_mstate_global->__pyx_n_u_GLSLPerspectiveWidget_add_object, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[91])); if (unlikely(!__pyx_t_11)) __PYX_ERR(34, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_add_object, __pyx_t_11) < (0)) __PYX_ERR(34, 15, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "opengl/modern/glsl_perspective_widget.pyx":18
 *         self.objects.append(obj)
 * 
 *     def redraw(self, width, height, skip_swap_buffers = False):             # <<<<<<<<<<<<<<
 *         glViewport(0, 0, width, height)
 *         glClearColor(0.0, 0.0, 0.0, 1.0);
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_21GLSLPerspectiveWidget_5redraw, 0, __pyx_mstate_global->__pyx_n_u_GLSLPerspectiveWidget_redraw, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[92])); if (unlikely(!__pyx_t_11)) __PYX_ERR(34, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_11, __pyx_mstate_global->__pyx_tuple[16]);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_redraw, __pyx_t_11) < (0)) __PYX_ERR(34, 18, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "opengl/modern/glsl_perspective_widget.pyx":1
 * class GLSLPerspectiveWidget(RawOpenGLWidget, GLSLPerspectiveView):             # <<<<<<<<<<<<<<
 *     """
 *     A widget which renders a collection of OpenGL objects in perspective,
*/
  __pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_GLSLPerspectiveWidget, __pyx_t_12, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(34, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_GLSLPerspectiveWidget, __pyx_t_11) < (0)) __PYX_ERR(34, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

  /* "opengl/modern/triangle.pyx":21
 *         self._vertex_buffer.load(vertices)
 * 
 *     def draw(self, view_width, view_height):             # <<<<<<<<<<<<<<
 *         """
 *         Draw the object (given size of viewport) by binding
*/
  __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_8Triangle_3draw, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Triangle_draw, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[93])); if (unlikely(!__pyx_t_12)) __PYX_ERR(35, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_12);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8CyOpenGL_Triangle, __pyx_mstate_global->__pyx_n_u_draw, __pyx_t_12) < (0)) __PYX_ERR(35, 21, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

  /* "opengl/modern/triangle.pyx":37
 *         glDrawArrays(GL_TRIANGLES, 0, 3)
 * 
 *     def delete_resource(self):             # <<<<<<<<<<<<<<
 *         self._vertex_buffer.delete_resource()
 *         self._program.delete_resource()
*/
  __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_8Triangle_5delete_resource, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Triangle_delete_resource, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[94])); if (unlikely(!__pyx_t_12)) __PYX_ERR(35, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_12);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8CyOpenGL_Triangle, __pyx_mstate_global->__pyx_n_u_delete_resource, __pyx_t_12) < (0)) __PYX_ERR(35, 37, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

  /* "opengl/modern/triangle.pyx":41
 *         self._program.delete_resource()
 * 
 *     def get_uniform_bindings(self, view_width, view_height):             # <<<<<<<<<<<<<<
 *         """
 *         Override to bind the uniforms you want.
*/
  __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_8CyOpenGL_8Triangle_7get_uniform_bindings, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Triangle_get_uniform_bindings, NULL, __pyx_mstate_global->__pyx_n_u_CyOpenGL, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[95])); if (unlikely(!__pyx_t_12)) __PYX_ERR(35, 41, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_12);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8CyOpenGL_Triangle, __pyx_mstate_global->__pyx_n_u_get_uniform_bindings, __pyx_t_12) < (0)) __PYX_ERR(35, 41, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

  /* "CyOpenGL.pyx":1
 * # cython: language_level=3str             # <<<<<<<<<<<<<<
 * # cython: auto_pickle=False
 * 
*/
  __pyx_t_12 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  if (PyDict_SetItem(__pyx_t_12, __pyx_mstate_global->__pyx_kp_u_vector3___repr___line_14, __pyx_mstate_global->__pyx_kp_u_vector3_0_1_2_0_0_1_0_2_0) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test, __pyx_t_12) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

  /*--- Wrapped vars code ---*/

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  if (__pyx_m) {
    if (__pyx_mstate->__pyx_d && stringtab_initialized) {
      __Pyx_AddTraceback("init CyOpenGL", __pyx_clineno, __pyx_lineno, __pyx_filename);
    }
    #if !CYTHON_USE_MODULE_STATE
    Py_CLEAR(__pyx_m);
    #else
    Py_DECREF(__pyx_m);
    if (pystate_addmodule_run) {
      PyObject *tp, *value, *tb;
      PyErr_Fetch(&tp, &value, &tb);
      PyState_RemoveModule(&__pyx_moduledef);
      PyErr_Restore(tp, value, tb);
    }
    #endif
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init CyOpenGL");
  }
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  return (__pyx_m != NULL) ? 0 : -1;
  #else
  return __pyx_m;
  #endif
}
/* #### Code section: pystring_table ### */
/* #### Code section: cached_builtins ### */

static int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate) {
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __pyx_builtin_print = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_print); if (!__pyx_builtin_print) __PYX_ERR(1, 28, __pyx_L1_error)
  __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_zip); if (!__pyx_builtin_zip) __PYX_ERR(2, 23, __pyx_L1_error)
  __pyx_builtin_sum = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_sum); if (!__pyx_builtin_sum) __PYX_ERR(3, 22, __pyx_L1_error)
  __pyx_builtin_round = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_round); if (!__pyx_builtin_round) __PYX_ERR(4, 29, __pyx_L1_error)
  __pyx_builtin_super = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_super); if (!__pyx_builtin_super) __PYX_ERR(5, 25, __pyx_L1_error)
  __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(6, 5, __pyx_L1_error)
  __pyx_builtin___import__ = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_import); if (!__pyx_builtin___import__) __PYX_ERR(7, 109, __pyx_L1_error)
  __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(7, 418, __pyx_L1_error)
  __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_id); if (!__pyx_builtin_id) __PYX_ERR(7, 628, __pyx_L1_error)

  /* Cached unbound methods */
  __pyx_mstate->__pyx_umethod_PyDict_Type_get.type = (PyObject*)&PyDict_Type;
  __pyx_mstate->__pyx_umethod_PyDict_Type_get.method_name = &__pyx_mstate->__pyx_n_u_get;
  __pyx_mstate->__pyx_umethod_PyDict_Type_items.type = (PyObject*)&PyDict_Type;
  __pyx_mstate->__pyx_umethod_PyDict_Type_items.method_name = &__pyx_mstate->__pyx_n_u_items;
  __pyx_mstate->__pyx_umethod_PyDict_Type_keys.type = (PyObject*)&PyDict_Type;
  __pyx_mstate->__pyx_umethod_PyDict_Type_keys.method_name = &__pyx_mstate->__pyx_n_u_keys;
  __pyx_mstate->__pyx_umethod_PyDict_Type_pop.type = (PyObject*)&PyDict_Type;
  __pyx_mstate->__pyx_umethod_PyDict_Type_pop.method_name = &__pyx_mstate->__pyx_n_u_pop;
  __pyx_mstate->__pyx_umethod_PyDict_Type_values.type = (PyObject*)&PyDict_Type;
  __pyx_mstate->__pyx_umethod_PyDict_Type_values.method_name = &__pyx_mstate->__pyx_n_u_values;
  return 0;
  __pyx_L1_error:;
  return -1;
}
/* #### Code section: cached_constants ### */

static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);

  /* "View.MemoryView":592
 *     def suboffsets(self):
 *         if self.view.suboffsets == NULL:
 *             return (-1,) * self.view.ndim             # <<<<<<<<<<<<<<
 * 
 *         return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
*/
  __pyx_mstate_global->__pyx_tuple[0] = PyTuple_New(1); if (unlikely(!__pyx_mstate_global->__pyx_tuple[0])) __PYX_ERR(7, 592, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[0]);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_neg_1);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_neg_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_mstate_global->__pyx_tuple[0], 0, __pyx_mstate_global->__pyx_int_neg_1) != (0)) __PYX_ERR(7, 592, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[0]);

  /* "View.MemoryView":689
 *     tup = <tuple>index if isinstance(index, tuple) else (index,)
 * 
 *     result = [slice(None)] * ndim             # <<<<<<<<<<<<<<
 *     have_slices = False
 *     seen_ellipsis = False
*/
  __pyx_mstate_global->__pyx_slice[0] = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_slice[0])) __PYX_ERR(7, 689, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[0]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);

  /* "opengl/legacy/triangle_mesh.pyx":7
 *     def __init__(self, vertices):
 *         self.vertices = vertices
 *         self.triangles = [(0,1,2)]             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
*/
  __pyx_mstate_global->__pyx_tuple[1] = PyTuple_Pack(3, __pyx_mstate_global->__pyx_int_0, __pyx_mstate_global->__pyx_int_1, __pyx_mstate_global->__pyx_int_2); if (unlikely(!__pyx_mstate_global->__pyx_tuple[1])) __PYX_ERR(14, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[1]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[1]);

  /* "opengl/legacy/poincare_polygon.pyx":19
 *     cdef triangulate(self):
 *         Vlist = self.vertices
 *         zero = vector3((0,0,0))             # <<<<<<<<<<<<<<
 *         N = len(Vlist)
 *         self.triangles = []
*/
  __pyx_mstate_global->__pyx_tuple[2] = PyTuple_Pack(3, __pyx_mstate_global->__pyx_int_0, __pyx_mstate_global->__pyx_int_0, __pyx_mstate_global->__pyx_int_0); if (unlikely(!__pyx_mstate_global->__pyx_tuple[2])) __PYX_ERR(3, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[2]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[2]);

  /* "opengl/legacy/hyperbolic_polyhedron.pyx":21
 *                                           front_shininess=50.0,
 *                                           togl_widget=togl_widget)
 *         self.S_infinity.build_display_list(1.0, 30, 30)             # <<<<<<<<<<<<<<
 *         self.Klein_faces = []
 *         self.Poincare_faces = []
*/
  __pyx_mstate_global->__pyx_tuple[3] = PyTuple_Pack(3, __pyx_mstate_global->__pyx_float_1_0, __pyx_mstate_global->__pyx_int_30, __pyx_mstate_global->__pyx_int_30); if (unlikely(!__pyx_mstate_global->__pyx_tuple[3])) __PYX_ERR(17, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[3]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[3]);

  /* "opengl/legacy/hyperbolic_polyhedron.pyx":28
 *             closest = vector3(dict['closest'])
 *             center = closest*(1/dict['distance']**2)
 *             color = hls_to_rgb(dict['hue'], 0.5, 1.0) + (1.0,)             # <<<<<<<<<<<<<<
 *             self.Klein_faces.append(
 *                 KleinPolygon(vertices, closest,
*/
  __pyx_mstate_global->__pyx_tuple[4] = PyTuple_Pack(1, __pyx_mstate_global->__pyx_float_1_0); if (unlikely(!__pyx_mstate_global->__pyx_tuple[4])) __PYX_ERR(17, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[4]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[4]);

  /* "opengl/legacy/horosphere.pyx":38
 *                 verts.append((r*cos(theta), r*sin(theta), z))
 *                 theta += dtheta
 *         verts += [(0, 0, 1), (0, 0, -1)]             # <<<<<<<<<<<<<<
 *         assert len(verts) == a*b - b + 2
 * 
*/
  __pyx_mstate_global->__pyx_tuple[5] = PyTuple_Pack(3, __pyx_mstate_global->__pyx_int_0, __pyx_mstate_global->__pyx_int_0, __pyx_mstate_global->__pyx_int_1); if (unlikely(!__pyx_mstate_global->__pyx_tuple[5])) __PYX_ERR(19, 38, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[5]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[5]);
  __pyx_mstate_global->__pyx_tuple[6] = PyTuple_Pack(3, __pyx_mstate_global->__pyx_int_0, __pyx_mstate_global->__pyx_int_0, __pyx_mstate_global->__pyx_int_neg_1); if (unlikely(!__pyx_mstate_global->__pyx_tuple[6])) __PYX_ERR(19, 38, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[6]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[6]);

  /* "opengl/legacy/horoball_scene.pyx":121
 *         y = abs(<float>proj[5])
 *         if x < 1e-4 or y < 1e-4:
 *             return (1.0, 1.0)             # <<<<<<<<<<<<<<
 * 
 *         return (1.0/x, 1.0/y)
*/
  __pyx_mstate_global->__pyx_tuple[7] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_float_1_0, __pyx_mstate_global->__pyx_float_1_0); if (unlikely(!__pyx_mstate_global->__pyx_tuple[7])) __PYX_ERR(25, 121, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[7]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[7]);

  /* "opengl/legacy/raw_openGL_widget.pyx":43
 *                  "not support the required OpenGL version (2.1). Your "
 *                  "OpenGL version is %s.") % (missing_gl_function,
 *                                              get_gl_string('GL_VERSION')))             # <<<<<<<<<<<<<<
 * 
 *     def make_current(self):
*/
  __pyx_mstate_global->__pyx_tuple[8] = PyTuple_Pack(1, __pyx_mstate_global->__pyx_n_u_GL_VERSION); if (unlikely(!__pyx_mstate_global->__pyx_tuple[8])) __PYX_ERR(5, 43, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[8]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[8]);

  /* "opengl/modern/simple_image_shader_widget.pyx":50
 * 
 *         self._vertex_buffer = VertexBuffer()
 *         self._vertex_buffer.load(((3,-1), (-1,3), (-1,-1)))             # <<<<<<<<<<<<<<
 * 
 *         self.image_shader = GLSLProgram(
*/
  __pyx_mstate_global->__pyx_tuple[9] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_int_3, __pyx_mstate_global->__pyx_int_neg_1); if (unlikely(!__pyx_mstate_global->__pyx_tuple[9])) __PYX_ERR(32, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[9]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[9]);
  __pyx_mstate_global->__pyx_tuple[10] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_int_neg_1, __pyx_mstate_global->__pyx_int_3); if (unlikely(!__pyx_mstate_global->__pyx_tuple[10])) __PYX_ERR(32, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[10]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[10]);
  __pyx_mstate_global->__pyx_tuple[11] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_int_neg_1, __pyx_mstate_global->__pyx_int_neg_1); if (unlikely(!__pyx_mstate_global->__pyx_tuple[11])) __PYX_ERR(32, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[11]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[11]);
  __pyx_mstate_global->__pyx_tuple[12] = PyTuple_Pack(3, __pyx_mstate_global->__pyx_tuple[9], __pyx_mstate_global->__pyx_tuple[10], __pyx_mstate_global->__pyx_tuple[11]); if (unlikely(!__pyx_mstate_global->__pyx_tuple[12])) __PYX_ERR(32, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[12]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[12]);

  /* "opengl/legacy/meshed_surface.pyx":35
 *             T += 3
 * 
 *     def draw(self, use_material=True):             # <<<<<<<<<<<<<<
 *         glNormalPointer(GL_FLOAT, 6*sizeof(GLfloat), self.nv_array)
 *         glVertexPointer(3, GL_FLOAT, 6*sizeof(GLfloat), self.nv_array+3)
*/
  __pyx_mstate_global->__pyx_tuple[13] = PyTuple_Pack(1, Py_True); if (unlikely(!__pyx_mstate_global->__pyx_tuple[13])) __PYX_ERR(2, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[13]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[13]);

  /* "opengl/legacy/hyperbolic_polyhedron.pyx":10
 *     """
 * 
 *     def __init__(self, facedicts, model_var, sphere_var, togl_widget=None):             # <<<<<<<<<<<<<<
 *         self.facedicts = facedicts
 *         self.model = model_var
*/
  __pyx_mstate_global->__pyx_tuple[14] = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_tuple[14])) __PYX_ERR(17, 10, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[14]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[14]);

  /* "opengl/legacy/horoball_scene.pyx":41
 *         self.flipped = boolean_value
 * 
 *     def build_scene(self, which_cusp=None, full_list=True):             # <<<<<<<<<<<<<<
 *         if self.nbhd is None:
 *             self.cusp_view = self.labels = None
*/
  __pyx_mstate_global->__pyx_tuple[15] = PyTuple_Pack(2, Py_None, Py_True); if (unlikely(!__pyx_mstate_global->__pyx_tuple[15])) __PYX_ERR(25, 41, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[15]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[15]);

  /* "opengl/modern/simple_image_shader_widget.pyx":97
 *             name = "image shader")
 * 
 *     def render_to_array(self, width, height, as_float = False):             # <<<<<<<<<<<<<<
 *         """
 *         Renders the image into an off-screen framebuffer
*/
  __pyx_mstate_global->__pyx_tuple[16] = PyTuple_Pack(1, ((PyObject*)Py_False)); if (unlikely(!__pyx_mstate_global->__pyx_tuple[16])) __PYX_ERR(32, 97, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[16]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[16]);
  #if CYTHON_IMMORTAL_CONSTANTS
  {
    PyObject **table = __pyx_mstate->__pyx_tuple;
    for (Py_ssize_t i=0; i<17; ++i) {
      #if PY_VERSION_HEX >= 0x030F0000
      PyUnstable_SetImmortal(table[i]);
      #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
      if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL)) break;
      #if PY_VERSION_HEX < 0x030E0000
      if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1)
      #else
      if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
      #endif
      {
        Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1));
      }
      #else
      if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT)) break;
      Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
      #endif
    }
  }
  #endif
  #if CYTHON_IMMORTAL_CONSTANTS
  {
    PyObject **table = __pyx_mstate->__pyx_slice;
    for (Py_ssize_t i=0; i<1; ++i) {
      #if PY_VERSION_HEX >= 0x030F0000
      PyUnstable_SetImmortal(table[i]);
      #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
      if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL)) break;
      #if PY_VERSION_HEX < 0x030E0000
      if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1)
      #else
      if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
      #endif
      {
        Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1));
      }
      #else
      if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT)) break;
      Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
      #endif
    }
  }
  #endif
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}
/* #### Code section: init_constants ### */

static int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate) {
  CYTHON_UNUSED_VAR(__pyx_mstate);
  {
    const struct { const unsigned int length: 11; } index[] = {{2},{3},{298},{49},{95},{137},{528},{11},{11},{11},{35},{17},{17},{10},{10},{10},{54},{37},{60},{24},{52},{10},{18},{35},{389},{9},{26},{34},{6},{20},{30},{12},{61},{22},{33},{37},{45},{22},{10},{32},{33},{15},{21},{19},{21},{179},{30},{37},{25},{37},{17},{16},{38},{44},{32},{28},{25},{27},{11},{33},{323},{67},{105},{114},{1},{1},{1},{1},{1},{2},{2},{2},{8},{5},{6},{11},{15},{23},{25},{7},{6},{8},{21},{7},{13},{2},{62},{6},{35},{12},{4},{17},{11},{5},{9},{30},{6},{8},{8},{6},{50},{48},{8},{11},{23},{24},{26},{32},{32},{39},{31},{23},{27},{26},{32},{24},{29},{31},{35},{34},{35},{31},{34},{36},{39},{41},{30},{37},{44},{26},{39},{31},{18},{4},{8},{20},{32},{22},{30},{37},{14},{6},{6},{6},{68},{26},{5},{1},{9},{8},{16},{21},{32},{23},{7},{12},{8},{11},{11},{8},{8},{19},{40},{26},{29},{21},{30},{32},{28},{11},{29},{25},{27},{20},{23},{13},{15},{32},{20},{16},{11},{27},{9},{10},{8},{27},{24},{16},{13},{8},{13},{18},{13},{25},{29},{18},{18},{24},{23},{10},{20},{29},{25},{17},{26},{10},{5},{12},{17},{11},{1},{5},{8},{13},{10},{1},{9},{5},{5},{13},{26},{18},{15},{1},{2},{6},{5},{5},{17},{34},{29},{23},{35},{32},{40},{35},{33},{44},{28},{36},{29},{38},{39},{36},{34},{36},{34},{31},{37},{32},{31},{35},{28},{2},{2},{13},{18},{8},{15},{20},{16},{14},{16},{20},{1},{15},{24},{20},{28},{22},{44},{6},{10},{8},{23},{32},{28},{33},{44},{40},{39},{34},{50},{36},{11},{1},{8},{12},{24},{21},{21},{22},{24},{13},{29},{20},{5},{19},{30},{26},{35},{23},{1},{12},{17},{28},{17},{15},{15},{20},{6},{6},{6},{3},{10},{5},{15},{5},{7},{12},{6},{4},{10},{7},{8},{5},{6},{18},{8},{16},{1},{6},{14},{13},{4},{4},{10},{13},{13},{8},{11},{10},{10},{4},{13},{13},{11},{12},{18},{16},{11},{28},{1},{7},{4},{6},{9},{17},{15},{18},{5},{7},{3},{5},{13},{18},{8},{6},{17},{6},{9},{3},{5},{14},{6},{6},{23},{1},{4},{6},{4},{15},{7},{5},{13},{8},{4},{4},{7},{8},{7},{11},{7},{4},{4},{9},{24},{10},{20},{6},{15},{1},{6},{9},{9},{3},{5},{5},{1},{4},{13},{9},{3},{3},{4},{5},{5},{4},{7},{5},{11},{6},{5},{6},{7},{4},{8},{22},{15},{14},{9},{8},{1},{6},{7},{3},{13},{20},{35},{11},{12},{17},{15},{25},{12},{17},{13},{21},{15},{9},{5},{9},{1},{4},{6},{4},{9},{10},{8},{9},{3},{1},{2},{4},{12},{10},{19},{5},{7},{4},{10},{8},{11},{12},{3},{9},{9},{8},{13},{8},{5},{8},{5},{1},{1},{3},{10},{4},{6},{2},{6},{1},{5},{12},{9},{6},{12},{9},{14},{14},{13},{7},{4},{3},{9},{1},{8},{12},{6},{4},{4},{7},{8},{13},{19},{4},{5},{9},{10},{10},{12},{11},{15},{12},{15},{3},{1},{4},{8},{10},{14},{22},{4},{4},{4},{7},{13},{4},{4},{12},{9},{9},{3},{4},{4},{4},{6},{7},{6},{10},{14},{2},{7},{1},{4},{6},{9},{3},{2},{4},{8},{3},{3},{8},{11},{5},{15},{7},{7},{4},{14},{11},{10},{19},{14},{12},{1},{6},{6},{6},{16},{4},{6},{10},{17},{13},{8},{15},{16},{20},{8},{5},{9},{5},{4},{6},{5},{3},{4},{2},{2},{10},{10},{28},{6},{5},{8},{4},{4},{3},{14},{15},{10},{12},{26},{12},{12},{10},{12},{19},{5},{6},{3},{4},{17},{6},{6},{6},{10},{5},{4},{6},{5},{10},{4},{4},{3},{6},{6},{6},{9},{17},{3},{5},{12},{3},{1},{3},{8},{7},{12},{13},{8},{5},{5},{4},{10},{12},{10},{7},{13},{8},{7},{11},{10},{6},{5},{11},{3},{9},{12},{7},{8},{9},{13},{6},{6},{9},{7},{13},{37},{12},{12},{7},{6},{6},{16},{12},{11},{2},{5},{6},{4},{7},{15},{6},{14},{11},{20},{8},{5},{4},{11},{10},{11},{12},{2},{2},{1},{10},{5},{12},{11},{5},{6},{1},{7},{4},{6},{2},{2},{1},{7},{4},{6},{2},{2},{1},{7},{3},{4},{2},{2},{191},{81},{52},{48},{349},{362},{2},{43},{355},{138},{39},{202},{91},{77},{44},{99},{156},{52},{102},{18},{250},{1140},{165},{19},{519},{24},{26},{13},{23},{207},{36},{48},{182},{79},{45},{54},{266},{81},{20},{13},{56},{62},{9},{32},{9},{32},{44},{42},{79},{18},{22},{45},{86},{205},{18},{60},{11},{50},{91},{96},{29},{133},{62},{164},{22},{17},{482},{130},{97},{11},{13},{21},{134},{86},{64},{86},{14},{44},{23},{88},{13},{9},{113},{20},{35},{216},{15},{413},{131},{138},{97},{112},{77},{232},{130},{1}};
    #if (CYTHON_COMPRESS_STRINGS) == 3 && __PYX_LIMITED_VERSION_HEX >= 0x030e0000 /* compression: zstd (9187 bytes) */
const char* const cstring = "(\265/\375`RV\315\036\001\332\363\3342H\360\356\270\001\314\300\010)\017,$'< `\205\024\222\nX!\205\244\013\tU\200\266deJZ\311\266H&e\247H\251\342\250\202\263\3428\330\240\201pL/\210#F\361A\004\nh\246\312\021\207?p\024|HB\226\210\321\002\354\002G\0039\306\375\310\241\2277\334\345\3301\007\235\021h\003P,\177}\307\021\350\205\373\317\377\232#\347\377\265K\226Y\277\036\323\274n1{\347+\227\357\322\257\025\215\207\260\224\335\213]\306\254R\311 \210}8\226\374\227\033\356\251\213\271\267\313~c\014)_\312\3501\231\307[r\363\272vn\347G\375\267.[>w\231\t2.?\250\237;\266\364\316\341M\376\334\247\363\372\222;\277.\367\2311\367\346=wf,]w\213^\367\004\365\320tav\335\024\217\222\002\0335\317\013\304\037\207\037n\211\375\365\3051\363\324x\237\373\217\2315\320\324\260x[RRR\300\224\226.\217\374\373\262\347v7\324\033\317\306\2350\223\245\337\311\261\317/\374Z\356\275\004\357w\331\032\317\360\3675\224\032\314\355\001\362A}<9\036\345\302@\350L\367\316|\337\367u?\235\367\2162q\357\270\033M\260\374\346'c(}C\224\213\203?~y\221\210\245x\201\225\035\210;\030\250g\235\233\035\215F{y\231!\377\177i\000\272-\260\316=\230_\217@f\377^\307\362\353\206\3148\243\377\035\353\334\014\323=3\275\304W\213\272o\250\351\376ql'\367\034\346Z\366x\203\255r5f0\343\375\362\271\357\\\317\360+\267J\036\3037.\233\367\033\232\255o<\350G\334\177\312\255\345\030\317\273\205\277\3564\227p\024\265\367\2703;\217\345X\311KQ{\215\361\315\311%\246\306\344\222=\316;\253F\376\177iC\343s\250\373\3677{N\326\362\375|\264\2119\331\320\324\360\036\027\223\r\315\035u\t\275\372\235\223\264\254g\367\004\346Y\376\276\317\303@\276[.W\331\2721=\226\376g\357rq\357\257\313\306.7\314`/\271\247\361p\334\271\246\311k\346;\226\375\346V\313\230\263\346\240\271\311\230\3667\314\261K\303=\274\331l\341\236\307,z\375bit\177\3141\021\367\275q\314\353,\342X\376%\031\343\377\342\227\277\265\374yV<9\342\250}\331\322\342wo\016\366\034\216\271\347\031I\2068\177\237I\360\376\"q\027\371\353w_\376,\206\276\347\231\353\353\233?\336;{\2371x_\264\233\2678b\335""\177\347\263\356\030\324\341\367z\343\226Q\343\030\017\357\317\373\005\352\256q.\366\031\304\256K\352\016^\234\177H<\256h7\314%\364\306\372z\363\353Q\273>\316/\322\273\270\376\370\217\331\347N\346~\361\3659,78\356\334\333\345\216\301Q\363\237\316\357\316!\217\215:o\r\267\347\327\327\371\266\360\344\214\231\334pG}M\274I\257\303\333\271\353\216\274\207\371enN^Po\336\352\2314_\327\273\032\247/\346\316\004\373\317F\324X\306J\017\003\363\013\314\037\311Iq$I\022\223$\3519\0177\367\037<t\360\244/A\237\277Y\216a\356\270\224\371o\034=-\217y\034\303Wk\364\243\350\263\356y\227\337\267c8\226c/\217ca\371\2658b\276Cm\202\321\236\223\331\227\333\177\233\006\243\301b\246\307\237\231a0\022Z\364\031\014\265\316\345\313\373\375\312\257\327\313\233\271\213/\322\334\342\267E?\346\234\326Gm\361f\213\236\2157I\361\373\366.yw\2313\356\352\334\207\231\354e\336./\342\355r\361\226\313\273\376\230g9V\216\331\207!\317^\177\371\365Cp\006~\360\303\037\026\362\204\242\tv\356\377X~,\226$D\016z\323\203\256\021\374>{\276\301\014\342\376?\320\177[\374:\370}\337\267u\006A\260\2235\261\253\361\233\246\033q\336\234\267\306\357\353\326\327\375\250[\2550\323>\317\177\211}\036y\347\032\034M\2545\350\361\347\361\004\317&G\345q\366b\307!\231?\335\212a\374\"]\330C\207\236\277\356\034V\034B\314wP\220f\261B=\323\341\367\261<\377c._\237\3148\367\325*\203c^}\253\254*\367\014\373\334\277\014\3031\032V\251\\Y\345\363}P\343\324\314\237\357\373a\375\234~L?1\316Kt\033\203\253\0360\253\372\017\014\324?y\353d3g0\034C\262\3744\271\362>\036~\256\372\035\377U\307\202\375\r>>A>A>>~\3253j\034\373zz~\202zzxx\276\037\016;?:\277\004]\235_\345\350\374\354\277pC\320J\205\n\372P9\036P\216\217\307\363\345\370\354\340x:+\025J\205\302\361A\251P@,O\205\372\331\360\251P\0300\000\331\240z<\025\006\234\035\036/\310gg\345\263ag\345\203bu\310\276\374\274\366\260\357\313\340\327y|\303\223\323\361\354\353\034\203\327\236\324{\243\272\237W\250\261\314a\307\2621oz\347\233\337\330\354\354\334\254\274\025\031\323\315\243\336*\235\254\2710\335""\251\203\2714+w\345t[L\267\005F\345\252\334\232\232\232\030\337uw\343\222\337\220&\246\363\331\367}\376\373\266\337\242\307\255\357e\354\037\355\243}\273\227\376\3639\366_\242\336;\213\260\217,y\027\277\275\371\353\313/&\210\305\274k&\331\345\227\221\307^6\271k\370\377\332\005n\254gc\031f\260\014s\377\276\373w\211]9\274|\024\001B\246\026\023S\023\001\342\004s-\320\334\320k\336\215YT\361\346\365\261r\234iQ\345\336\013\212\"@|\314\267\013\006\342\226+{\035\216\272\206\006l\341\316\177|\2770\3045\367\322\334\226\225\224\232\356B_1u'\225k\356\026nu]\017\273FK\317{c\332\013\\\261|\027zM\313-\326\r%\325\267k\312\312\007\316\244\216\010\321\206R\010h\202\017\236\217\234F+\234\002R\351N\373\301\321z\220:L%\034\013E\002\\\210\307\272\326\010m\211\305\260\312\230\340T\014\360B,\210\217\264t\000\227Rg\236\352J=t\320\303\371\261\032\221\230\330\220\2417\250G\033\"\251\335$\r\220\266:\351\324'\255\243*\222\211\235\260\306\322\030W\3516\272e\2608\262\235\021\211\363$&\205RJK\240\223\224\236\244R\221\003\237t\340<\226\202NOR\004 \031\241T\004\005=2\000\030\030m\240\204\236\212\325\001\252\005\223\214oe\200\032\240\341\t\333\014\210n\326\020\350\005:\203\317\030\331I\340\374m\307\201\221\024U@c\005\206\t\315\301\360h\331lR\024\212\267\"w\032\301\201\200y\340J'I\324\312\324\227\221\2505\251\017H$lK\3318Dm\250M\371\300\211\332\rQ+\263\035\020\345R6\317\306q\221ZgY\005QQ'\027\000\006\264(\225\322\006\"\224Z\246(\351(-\211B\324\010i\320\202\213\320\212UfC\003\217\206\326[\341\255\300\201YC\265\2739\323\313up5\322\2246RWF+Kuy\260 \027Zq\324\226\005\013r\262\364\003\332\221\203n\200(U\347g(\255\001V\020\030\265A9\230\322R\032\212gH\270f\300 \200\232\320\r\336*Z!\250%\225E\004\3072\303\222\033\261@\335J\026\205e\311\205n\020\330\274\202\254\241\325\201:R_0Z\"C\031\\\250\020\322\274 \207w(\210p\030}\235\031ZFp<\236*Rei\211\352\202\000\347\245\td\254\014{B\325\300SRC\005(\352\374H\037\240>,Hn(V\304\312V\224\025H\375PA~\202\234,\333\210\r\241\356\244\242T\206~8/p\272\340\303\343\34365B\301""\263\002\207\252\300%\rQ\003*I\312B9V\347,\265B@\301\241\210p^jJ3\n\202\"\000\311\225\330\021\213ZKUFEJ;\212\321\024\352\241\345\251:O!\233\206T\352\245\024\320\004\030\271\021\033a\375j-\rIC\251y\212`\344Ll\211\235q\311u.-i\2243\241+'\t\257\021Jp\0142\000h\264\030\241=6\216\014\000\030-<T\301\006n\003\243\365N\035U$\0351m*\233\201\014\000\033-L\251\211\0107:Cg\007F\016\237 )ULmNh\t%\351\220\235\"\0359\214\236\240\030N\221L%\240\342\244\034\320\0174\204\216l\344L\352Oq\232JO)\t\312:7J\333\215m\243\003\327\261\321\312\320\003g\307F\316\224BM\320\021\212`#\227:\275\363c#'\263\311\330\n`\344\274\323tz`\344J\347\350\034a\344B\351\025\341Lg\255\004\251K\224(Q\302\034M\3234M\2636\326j\265Z\255\323h\346\2546{}\337\325\312\230\207y\377\3710\347\274I\376\377\353\373\357\373\377{\263g\262\364\037,;\377\236\3542\3775\211i\376#5\314\373\357\363.\3371\366'o\362\236\306\373\347\274\367\230\376\271k\261\226w\014w_\352\020\367\336\003\033\356\275\267\302\n\214\212\210;\206\357\227\034\005\311]\370h\341\376|[4\261\242rC\315g\025\356\035uw\3121\014v<9\255\314\241\204\211\031q\353z}a\272\230\273B\335\227\027\r\030\010&\223\233\351&\340\206\301\376\t\036\305!\233\310\210\312JS\354\260\"vB\nn\004\241\224j\030\300\265\036\307\351\007x\253\253\315A9\204\"\234\247\262\244\373,\255\027L\234.6\rQ\356\003IY)'\t\305f\225!!\332h\034\273\202\355\257 \200q\221\032\265$\250\314\t\016\253\335eP\302B\202\303$\241\025\004 \245\220\266-i!\302\225Xl\005.B\003H$\0228N\355\211\007J0\t\327\327\251F\273\361\304\224\340*\234&\225\024\200d:?\203\222\226\332\225\250\224\200\r\034`\2216\2043r\"\3252\033\306\256\236\300E%\261\306\350\214\324\036t#\375X\002\354\204\326\244\346MbB\003\302j\262\252\230\244>e\001\212\252\242\301\373\363\006\227\332\226\032j\020\362\220\321j\335R\267\323\255t\003b/\302\027\311\232j\311\200\036\264#)\330\236\034\260\200\323\217\223d\032\221 @\200\325\023\225\005\001\256\244\rj5P7\210\007t&\027\201\301\332R[lr0\023|;\0319\255$\030\006\204\2248x$K]Z|\316t\354\204X\200B\357&\272\231""\037$\215\260\376\021\014\024\222\014\214\266u\331\014\210x\254,\002 \252\215\310\331S#\001 \001T\007\0368f\241\001 9\231G\332W\255\352\"\322\216zh6\"x&\234$\265\304\r\345\026\262 ,k\275XI`@K\017\034\010n'u\020\202\313\200\323\030\010{D\010\016\035\216t\002\315\203C\007#B\202\216\0226GD\266\312\254\245\017j\n\217\343\t`\311\020|\324\24097#\rV\035\021Vh\310\3545r\312\260\020\250\254T\364\t\251-\233\324#E\0058G'\r\316Q\212\"u\3000\255\002J\023\006.\277\000\364\020\305\214n\322\000\0318\204 \003\300\307h\355\271\"4\351W\001\301\235\310\030&'\311\343@\377\250\212\325\301\242\304\"\304Bv\373`bW\272\252\261\372JuP\022\214\023K\362T\017\022/\365\030m\240\033\032\023<\222\004\222\001\216\324K\207\266$\270\021\013k<\023\024\300\025`\261\026Bp\246\022\352c\312\205P\036\357\006[OV\r\226\226\004\036\tI3\240\nF9l2Bq\212\210p!\226\207\001\032A\206\326J\224R\025T\203\025WZ\2169C96B(\010\016\350\202\2166\265r\250*#8\224\030\364\004^S\253\250fHOV\030\022\034\311m\306^P\301\251\234\344d\253V;\005\270\215\023'\264vi\003\366\257\032\324\220Z2\n\265\021VP\222\217\266\313\265<\030\001\323\230\324D\001M\tWJ\261\036\333@\245\236n\210m\2556xA\233RMFP@\002\224\020\240\222\222\363\326\253\000\247 \nF\200F0\233b/n0\2125A`a&\240T\003\220\220\272J/R\001\251\005\031\213Y\332*\341A\010.\244\303\2434\336v`&\350\026r\363\036\340H\322\2323\007\243\345HK\031\000\034xk\203\325\253((^\202TB\033\212\335\250\324\260\3154r\"t\210f\004\000\000\000\000S0@\340PA\241X0\243\026\3127dG\017\330\350\024)\222Q(\302\020\201\200\001\000\001\202\231$ \002\000\002\006,e\022\001uT\350\032%\200\3411(\365=y+\377D\257ym[3K\031\3656\326\016\2411\252\027\022\331\t~zI/\247\250&\021\242\354B\345\020\332\304\356\205\353\252\260\356MH\245\213\314\234&\243\336\271\316\260\006]\3715\372r\240\271\0374q\266\217\351\266\237t\235\236\351\332Y\310\364\253\006\244\330G\3279\005\355\242\251t|v\026n\241#\356\341\232\226\225,\312Nzu\3436O\0132\202\217\030\025.7\370t\362=r\256\324\014\361`N\001\"\215\340\331\210\343e\367\224\274)c.M\034F""\301\n+/\352\335\335\036V|\331\020\340V\361\240\234\rn\223\023\177\224\373\350\265i\033\006^\336%\016\324\240F\334_\260\336\370m\255f\335\nFH\312Ye\352\367M\300\366\357\351'\376\322ptq\022\265\230\374L\022P\017\325\300e\245e\005F\021\276b\322\234\372\032\324\342\322\324W+\374MH\345\361\311\277\205\352\353/\277\032#|\253\262\312{wb\215\372S\214\261\251%\"\254\211\026\267\203\310\231J8\333\266,g}\270\024\267\370\014\276\026\217\230\004\206>\327\242\033W\234\261\037k# \362\305t\272\254\013v\217\361Y\355\227x:\007\002\364L\200\204@\027\354\314J& \204\244\205\201#\022\301\275\001\324\363\304_~\363\255\ru_\237,\336\036!%T\204\261\362\204\2360/\241\340\226|\177\210\003\375\351\220\031\336Iy\237\205\036%\327Y\220{\327+\374xYc\267\263\000\217k\313\026\271\010^3\355\255\213\336\201\206\004L^\023Q\262\311\327\037GO\331\014\320\331\364\302?\305\241d\251\232\357\316\274\341\006\206\027S;&R\343\34153\235\345\273\3505.\236\327\nU\323H\262B\304\017\342\363\332\314\213c\2247\022\021\033P\340\031\374\222\203H\353t5\017\242\022eq\314\337\302\001\305\341\321t\354\260c\315RN\340\206'\030\260\216\037\240Dh\273H,\236@;\303@D\204\234\372\370\215\350\010(W\254\305\373\273\023\007\032\362\226\021\027\366\213\034a\\\3331\201\244\214\377 5\377\325\215T\032\310\210\325\214I\313\326\240%j7\366\242\037M\035~\023g\315<\334\250z\037\315\036\034?sB\344\267z\202\245\256\005d\001X\342\366\222\205Z\336\343\345\"\362n\004\2412pB)\331\307\204o\313\236\310\324 \030N\005\027Qy6\220\276\"\366\344\213\245\315\2573)M&\360\325\005\266j\035\024\252.\371T\305y6T\030\027@\337\333\373\251\347\037W\363\2123{\367\366p\270*\032ra\324n\\\220g\005\255\224\244\311\r\311a\234l\266}\2773\3678\233\357+\255[\036b\270K\361d,\361\024\230\013)\343\221\002\375~l\247\226\260\034\236\340\034?\271\204\367M\300\341\362!\334\302\3658\346\274\200+\277\n5\006\177\343T\364~\350\245%\001\027\017\322vk\014\233\037\344\237K\327\006\216\030i\200\216ow\363&O\237\252\353p\000O\252C\314S\027x\307F8\276\024\t0\312\276\205\017p\274\311\201\232f""\373\2204V\322\317\337\n\322\270w9-\357\272\363\034x\027\235\2123``zS\201P\261\267$D(\367\t\034\222\2468\024\000^\336\271Hm.\330MS\227\231\013\312G\3058S\264j\322E\263\264\360B\320r\271\303DS'\302ma\217\204\265\346\377\\Ev\002\221\257z\326\332OE\246\360\246\023\022\367\376\002\023\233\023\037\307\023\345\016\226\003[\023Y\020\"E\230\234K\207\024\272\001\367\027!\314\007\027\200*\334\333u\331\341\344d\026\332x\270\201\2579;\034\036_\365+\216\022\344O\005C\2006\33398\351U\322a\336&w\244)_\250\240D\310\241\356^\177\374\365=\254\352\260M;\321\262/\201R\250\224n\007\036\031M\344\332q6\026k\323\261s A.\266A\300\222%oX\330\346c'\353\231L\245x\306\2304V#m\321\315\237\2457N\010\266<a\t\366j\300\272\004Drm\032\030\2111\034\3172\017\022\0056F2\273G\3246\364\364P\351d\212\225\361\266\213\000\246 \230\304\377y\274\336)\264O\342\335W\202Aj\220\241\365\335`\315k\r\217\201\017\300\004\375Qa\030\3355\344PR`v\214\247Z\242\007\351H\013Ca0\010\342\301\274P\007\227\371\355\321e\322c\252\203\275\224\351Qx\020\310\014UV#\373\321\302H\225\234\211\000\260\234\255\311S\232\357g\234\245\347\323\2213\343\031\000\362:\001\232(\243\002\203K\320\0367ug\247\337\034\312t1\366r\275\375\255\353G\336zPa\005h\210:\037n\024\350\312\204K\331\307\\\334S\016@<\323k\312@2\270-L\312\242x\236\036wb\032GD\317\241\n<*\205(RE\201\333\231\302]\230\303\000\035k\2074I\031AR\271v7d\222{\2071\277\350\333e\374\363E{\270\260\240\366QS\037\310oU\035\333\216\033\023\306\317`\350\250\335%T\347b*!9\031\"n\203o\024\333\263\013Q\341j~Sm\204\303_\243\214\010\357(\300\344X\225{kaaw\221!oZ>X\367\372\254\200\322\005\230\036\344\370\230%\214\371\351)cO\373\220\362&\370\362BXi\232\307<\256\376Wx\"r\225\"\rPl\274\310\262@\356=\331\r\354R\276\302O\n\300/D\374l\367\342\376\257\352*,J~@e\034BT\312\374\301\246\213\305\322\344\002\305\000RA\276T\032+\014\363U`c\367Ch\200\352\345\343\214\326\0300\017M\213\r\304\300\005\316\020Nk\2270\345\323\362\2339\250\345\252\265\251\007\023\225\350\377n\246\370r\342\353\014H\307\024\340\010h\324!""\n\014\236\217%\337d\363\003\205Fm\341\210\327\203\350\207L\355\324\234\203\331V(\262\245\241?\033\311b\273-]\310zi\304\376\000\224R\326D\257P\331\t\006\263\302C\225\254\033\311=\240-\0160\000G\037/\370g\375\000\323\340\300`\000R\361\361\241\024\367\242@\216G\002\276\344\366\027\273\341!L\032\375t\211\225\013\314$y\213G(&\275(\223\367\027\215\327\347T\3533\226uq\201I\t\340>\321\315I\305\364\3656(\211LP7\245b\347zL\032'\256\366 \373\020W\311\345\346\302\\\264n\347\003O\274]\037\246\000\277\013I\266\355Z\333\251\254Ug\250\302\224i\010\005\205\253!\375\004\022\036T<\201\025E\301\342\276\357\271\023\036\241\264j$i\311\236(N\002\007v\304\267\276\000\206o\330\373\355\207\316\007\302:}}6\205\370\252\312e\023\310\375B\230\367H/\303\211\000\002p\306\025\227\024\225ZF\003\227\233\346\005\372-\013\247\304k\246\352\345d\220\273:\026\273\270xV:&\305r\213\3262\371A\235\223\024~\221@x\223\322}\007\332\002\252v2Qt%\201\345\226\320h3b\003\014\032{\305\203*\177\361\020\311l\200\000\373e\013\177\241\373\315\372U\032\300\334f\352\242\246am\335{\010\235\030\214\276\276\177\035j$\tQi\325+\201\013\333\247\322\300bS\371N:\254\276\232\300\276\023\263W\277\207\262#\367\231B\217J\235c\020Qj\355b\336h\274H\201\371\272\253<r\337&J\0275\0135\374\377*[0p\235\254\212\321\360\010\300 \234\337\257\006o\377\333C\355\227&\016\216\361\007\363xv\207\254\251\036\032\345\001,\346\231#\275\241\243\034dd\313E\025\365\302cuXJ\252\206\246\002\362\205\351b\335\302\255\036\342m\230\030\0134l\215\207\370>\031p\333\027\334[|\271\360\315\003\227~\032t\351\226a\004\315\303p0t\017\327c~i\232\342h\235\031\234W\246\210\021\264J\257}Nr\375\250\250.\357\004\316U\317k\334z\306\225\265\0070\216\252\305Ez\032q\217\320\342.\273\333i2\014\275_\"\226\264\224\331\256\330o\207u\233n\337\305\320%*\201\337\220\0302\214\365+\327*\253\010\314\252_\373\2762\006\262iGm>\216o9\214\251\005\3440\327\364C\252\034V\237\0206\246\332\373\207\216\362$\302\331\200\276\243-(\262J\233\240\340K\313\344<\305oy\251\344\005U\225zd\226\002\026\314]""\355\220\205\375H7\207\3609\205\307;\243\016ti\224yX~CGo\006\301\305\202\245\324.\250o\254\270>\323\371\342[48\334\020\230\031{\324`\r8\031C\3724B\225\200\001\211\200c\033\246b`\227\260\037\330\255\233\202s\261(g\033\031\301\376P\210\021\225z$\250H\352\2774FLG\301\333\370\370\303\000\261k\234x\331\365\215v(\035\211\272\2568\206\224BF;\327V\206%\022\250\254\360\256\016\002\205\024K\0102|9/\004\304JH\266\205A\035E\333\360O\347\33061\215\214rV.\370y\007\005\212\225@\022t\344\t\311\255:b\3032ai\262\224sl\037\237\345\260N\254\003\000\257'\001\314\207\010\237\361\372H?\313e\310\330\322\021o\230\322\t$J\022\025I@\267\312\016\215\317*\346\304\370LacI;\272\351\006\032\223\013\267\362\371'&5\212\337$\247\224XU\016}N\337\004\"r\276r3\017Z<\273WP\356\2754\260\021\302\017\013\321 [\214\226K\035\030\300\351\375\316\264\270\n~A\332\307\377\217A\227\250^Q\266\245\n?\207\260y\224\200\020\r\212\004[v-$\265k\247\005\300\314\013\352\255\357(xD]\031\266 \357\374)\307\304'\234l9~,?hF*\317\n\273\362n\033\221\256\262X\240\213)\313\200o9W\226\024\317\301A\367\364XER\354|)\323\216=\334\251\320\2200\001\006zbD\031`6[\330\347\021\240$\347\325{\002L\345\031\"z\347\3676M\220\271\344\320\354\350J\320\243\236:\223\037\330\266\344\223\363\236\312\271Z\327N\331\237.\255\355\373\336\350\tntM\326\214\200\311\024\261f\336\216\205*\326\326\373\373\237\212\324\306\300Pn#\350\246\254\256n\254\301\266\262\250\004k\003\216\007\214\232u\263\357O&:\255\313\242\031\234h\302\351\2241\246u\237\250\354r\010\371\203\2635\317\002\177\206X\337\314i\275%\223\377#\237v\220\2709\216^\220\240#\030\204TUE\"\236]\242e\201\357\225|\310\370\272\223}s\3564\020f\234\216\320\370\207\266F\355\366d=\201\0064\204\r\363A\223\003\203\373\216\355\242\3572\027\017\233\331B\325+K\r\331\305\000\232\373\202\271\251\231H#*s\034\245::B\242\242\340\265\200\264S`1\313\300T\302\332\031\374(\355\375Bo\335\017\231\354\223\260\254y\233\371\301\246&\321|\303\003\004\355%\006z\261\231\027\356\035\273p\362\337\372\226\216\024\3532\266a6Sj\237o(""\225\307\014\017\341\3325\234.\270'Q\000\337\354\206^b\004\321\245\263\004U\252\000\2746\2652\303\3206Q7\342\205(C3\351\210n\2325\272F\370\262\001-\350\2520\\k\004(\241hW\223\253?\373\370\004\270X\311\256\222[\301\230-\253p\217+ \376\234?M^\2747\253\372\357\317\257]-\"@\213Lf1\033S\316\033t\017lf+ h\323\307\272\235S\201\224<\244\301\026\221\216[\201e\023\301\362I\016\252!b\270v(\027>nwm\256\026\002d\321\211tM\370\355(\350O\003<\003aq\231P4\026\254&\003T\206\203\026\371PL\2404G'\200\254\005=\376\222L\217\014\275~\"wWq\343G\260>.\033\274d\255\224\003\230\213e\301\343el\2034d)\352\267^\241\363b\332\020R\226\353\357\007\t\314$u\024\3158\241\311\003\263}M\217!nh\307\037\205+\366A\341z\303\373\033\017[\217\303\254s\030\205'\336\320<\t\322\260\335\222\277\302e@\277~\323~\077\077\317(\373T\014\3737\2454f\020\365m$\005\375=\033WT\223\227M\252!\276\331\320`\007\214\375\016\204\036yOs\321w\342\005\026\216#-<Xz\252\224\363-\217,\217\214.\241,5\332\231\270vCd~\346Yn\2049Q\374.Fu\233\020\360\023\220\031\250\3645\262\026\232k.\243\003oS\203\020m\330\215\274\227:\326\006\363\205KU\245\210*\013\322D]\236\333\022'Z\361\366zoq\020\331A\353\234\312f\014H\265\344\255*\300\240\004\345\014\206\3066\304t\337\350)\017h\220R,\234\030\205\261\330\226(\221\241\237\305+imZ\213\200\340\347\2571\0053\"\257\202\254\034\024Z;\277^\301\rY\207\0340\035\\\261fg\254'\265L\331GB]\003\203\240\366\303.\177\004(\r3 \367\277\356\322\270O \203\322A\303Z\361\264\320\006;\r\030T\264$\271\272\177y\375\232n\323n\347\332\332v\227\021\256\277F[1*\337oR\322\205f-DV\241\325\202\227\214\361I\005\272\201|\005r\261Z\032fr\373\352\031\207\273\r\272\360\330\177t \214L\366*\356\256_\272!\307k~V#\r-\021tv \364b\320\237\255k\225\027\003%\316bY\016k \350\025h\262\366\235Fi\2429\036i\266z^K\373\026\262\276\"\307D\t\346\017\020,\234\3460/\226Kr`\353a\220\345\t\240\014t\027z$\253n\267\224\347+J\002\214-\267\326\3270`\036Y=e\305\030\352\233\213\232T\373z\200\344\217\017\210\273>\005\326%\t|(\360u(4h)\r\221\312\371A\004\273t\325>""\357h\247\323sj\030\"jL\204A,\310\262\205\026\240\243\025\256\316\206e\302\031\267Z\333\332d\027\260O\016\233-\256\305k\216D@\340L\207n{\351\336\2723\317l\222o\036\3049\265\354\271\321\201\026x\t%s\321\250&Njk\374\\B\300J_\000\006r\342\\\3164\263\376R\273\307\346\022/\243\033\250\360\256\334\007\026;\326LV\303\tY\227\377\235\270-r\360=\355\260\376\232\t\tW#\214\346\204n\274tHG\201\313\246\030\314$4\321\240c\261P\271)\034\001\302j\017\233E\341\256\262\205'\341\212\230i*.\005\307\014\237\266P\r{\001\026\241\270\234\006\205\335\361\243\322\301\333Z\024\335\177\201qw\372#\023\273\256\0074U:\333\303T\013\t\314X\2346\213E*\365\352\267\221\341\373\376+\004\304\td\312\343\267\336\225\034XH\335j \342\311\223-\004\305Q\347\0214cs\321!]wp \330\304D\023U1\273]N\235\0250\337=\360\253\322\013\234\326o\331+\003\036\000\277\031\027\331\033ijj\017\340\n\304!\225\360\322\t\332{x\204\002\373B\263\224\276\276UI\231W\351\327\341\253\331$\213\360^\\\233\261l\302\303\272\335\220f<\374\327\017\274\343\251\002>\207\322,\017\253\005\tR\270\374\177\327\224\312\010\267\337\353\357\251\206\215%\310\034c\030\230\2265\033\202\tK\034\2107\356\254(&\233\3763*\235\303V_6\364\345\312\002\204n\205\001\363\373\256b\002\333\355|\324\330\2023\232\355\022c\002X\231[\360\037x\302\023\r^'\240\354?\337\210I\352\263P\262\024\343\352\261\006w\335(*\371\024\216\312i4\351\006J\240\313_+\224'\374\035\177+!\212|@j\354\022\374\0361q\033\rM\344\037\035\177.\260\252P\213g\241dfPZ\244\215\242Q\r\335\n\001%\243\255\357\004\013E\324~\376o\374\255\312?M`\212\253\264\245d\205\026\312\2404\213&\224\302{\\\346\275\3309\365\340\351\210\025\321\372\316\227\005\336@\264\371V\315\265\213\201\200\232\255\275U \321\360\356Dn0D\025\322\241\306D\034&c\020(\372\266p\351\032\177A\316\375\265v!\036\240\213\271P\357\334Jh\026\217\\\344\343\362\222\2421Q;\323\222A\331\331\205:\332\2647\251(\253\362\225\341P\343Oo\367\025\010\366\274{\216\271\237i~\245P\353\240\213.v\360\300;WH\237\233:~\370=\000Q:\223*=\265\314\n\223\265 y\300@\033\264""\351!o\206\342H\254\n\361dS\236\207\344\272\365b\271\021#\004z\033t\352\006s\204\177\n\245\255?\330&d/\340\247\004\010\032\210\323B\203l\332x\277\2643\000\035\316X\244\3736\231:*\n\325\307\370\033\234\313#?\023\270\357\325}\235\026\343\207G\276\376\310\274Z=\005\330\215\334\"\371\034\231\257\362\233x]\254\203\240Q\212aeMFF\341=v\3022\251\000\203B6\035E\0074\034\367J\0379\220p?$0b/{\010e%n\334\322Qp\351h\250\271?\032\251\312rF\351;|\376\231\327\273\177>\211\246\333\013\026\316;i@\314\3332\323_\204\307\314\275\r\350.\2109V\\\274\374*\247%\000\2008F\210+,\004\243\264\021\022ME\037\366%\010!\203\007`\315\004\365\271\222S\234\323\300&\260\241xu\357\375\356L[\347\263\261\226!a7\271\204\351\337#\225L\006\265\263\377df\373\320\310fW<\202\252\034\033\3275\002\031\232\200\330\316\020\232\223\2150\325a\234\022\204_c\353\270\034y\265*~\204M\313\222\341\n\216\371'\233\205\260\\\017p@U}\232`\374\324;\024d'_4>\234\210\313x\215.\177\264N\3379\324\260\226KA\225[?\322\326\026#_2\330\206\\Y\250\003\376(\270_\211\263:9r|<2B\211\254\332\010\217bG\252l\013\021\030\323\216\350\340\356Q\265\316\223&P\336\206?\302c'\333TX\\\342\014\r=\337t5;\013w4(B\334QS\325\3159\321\255G\221`\030\313\001\033O)\253\341\206-\037\245\357\221\211~h\006\023\317\035!$\004i\327\002m\366\020\266\001#1-\270gNN\004/t\324\213\240y\230%koU\374\233gC\275\352;r\343\006\304\0230\367\275\333\277\335\373\237\226\004\2074Q-8\225\300&\305\021\261\245\202H\032\323s\250\255\206tX\243\355\033\006^ \302\303U\340\316Z\206jA\006W\355\301\r\262\344|\004k\204\205\032\025\340%y~0P\200\361\262@ \221?F\303\233\014\212\017\036K\310E\334\343s\014m\301\345\r\032<\267x\312(sC\006Y\233\2527\014\335\213\346\032\231n\357\314&K\373\316\214\273a\213\\\352\377\014\357\252\311'\355&\003\251\024\220\250R\361\360\244\227\256B\021\244\020\025c\222+{\001\264\\Dr\200\004\227\315[\325\264W\316>Z\333Odg\372(\226\220\345x`(\213t\3538\235)\277S\330\243\255w\3534\356-\334\314%\233J\251\253S\276\323\262\304:Y\020Zz!\361\222\234\331 Q\336\216'\325\342\311""\304Y\023\"\302\361d\276\2033$\237\205\025\241\234:\256\007\000\027\375O8\365\336\374\240\341\265\312\256\334\213Q\261$\\\277\322\267\333\027\023\235$\241\254\272\033+\203=>'\223m\323#\036<\340\335\372JO\254H\276=\216\227\031Z\222\351\213#\351\343dK\337\004T\033\005<\263\203\317\231\377\332I,\217F\245%\003\335\210\370 \370\026B\211!n!8\204\246\001J\277\177./\251\013au1D\357\211\365\275\312\252\243\202`Hd~\250\252\247=i\251M\020\307\231|\225\300\204\2525\260#*\371\003\322\275\377f\273\2563FT\221\224\316l\n\235\220\1774(\375\307\004\035\257\035B\257\270z\020\223'ub\361\272v\323A\260\256\257\267b\037i<\3239\313\2036n\337-\230p\030\003\001(H\266\013;\320\275&IYW\327\362'\0026\021\377\221f>\376\346\354N\274\242\270\231\256M\204\341\256xH\250\204\354\304\241h)\334\350\034\016\022\33311\221`c<\261N\264\207\r6\024\331\005/\t\265\350\347d\304\252\330W\263\365\371\205h\240~\314\2635\r\267\261ffwy\355~<\232\010#\207\r\201\230\013D\214\326\266\334\327\273\207L\342\277\340\374\251\363\260y\033\346\007\2672\331o\375\235K\246\217\020\310\212\262\034\314\253G\\\305\252h\267\r\036T;d\376W\303\357\361\247\r\336\210\365\311\226l\245\236\321\024\266\263\217\260\343\201hU\215>\330\034\\\372\303c\033\204\363\235\210\013\212\270\340\003\234`\226eU\277e'\247\312\346\223C\260\262\274\t'\347'\221)A\247y\014\353[N\352\212]\0302\372\3279]\256\355b\226D\306\203\340\272\033\005\345\255'\254\216\357p\207\370]u\211\nk%r,\376\204>T\225\341\363Ma\351\016\3563\026\272jJ\021j\351Q8\307u|\221\037\231\300\337\322\353\217\351*l\335\224L\345|\010k\273R8/J`\001\311\"G\363\311\304F\244;\251\022\201\343\006\264\271i[\310\204\373+\207\375\327\226<fc\3427\372\243\000\363\365L\261.\275n$\320\3229\0352\005.w\237\373\356\356yM\210S\224&^\223\327\024N\\-\247\270\263\337`\0223!\371Q\346nx*\223X-\02607X5F\350\026f\300\246\211\0145@\025\246n\301\204\250\301\024\346\"\tL\203\260LU\370U\366\267\315\300\006\263\201=\223\035\001e`\234\356\330\322 \326)\331\241\006/\242\265\243\204\024 \364w|\035\362\320T\002\347-\364""\344\217.\273\037I\006\025tl\230\227\233\230x\371?\350:\026&\313M}\036\305E\321\016\304H\376d\374bb\001d\376y\033|\236\017k\225\216\323\001\240G\357\227\257o\244\336\347d\304\356d\347Em\307\244\334\002\351dn\266\336\346\003\236\033\212\316\364\263\336\307\357\246?\234\332N4t\302\2538\265\2664[\241\016=\204\342\302\020MN\301w5Q\357Al\235\227\365\223\212\342f\246\232\240p\017\361\370\316\256F\370\315E\033\343\326\201AU\017\077\077\037\rJ\305\270\223Z\225p\372\006\200F\001";
    PyObject *data = __Pyx_DecompressString(cstring, 9187, 3);
    if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error)
    const char* const bytes = __Pyx_PyBytes_AsString(data);
    #if !CYTHON_ASSUME_SAFE_MACROS
    if (likely(bytes)); else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) }
    #endif
    #elif (CYTHON_COMPRESS_STRINGS) == 2 /* compression: bz2 (8754 bytes) */
const char* const cstring = "BZh91AY&SY\363\2260\350\000\n\033\377\377\377\377\377\377\377\377\377\377\277\377\377\377\277\377\377\377\300@@@@@@@@@@@@\000@\000`&\3679}\017!\353\275\331\321\207\240\004\364\006w\253\317=\033\254=:\0231\254\360!N\244\322\215d\274\260:m\207\251\000\000\355\264{\335r\202\203-\323]\214\260\036\272\035RuWw\r\350\025B\247Z\320\000(\372\037S\021\200:\222\t$@\230\004\312`\232\014\247\240\231\000\312mFS\324\362yF\032i\r\246\223!4\320h\r\000\321\344i4\320\000\004\246\210\320@\211\210\246\236\250\332h\246\365OSj4\332\217)\2653SO(<\247\2244\000\000\014\203 \000\r\003\3124\000\323\020I\022\220\323\324\3204\320\000\000\000\3204\320\0314\315OM0h\304\323E\032\r\r42i\223\32424=A&\242\" \224\360\230\325==&\247\352\236MOS4OQ\232#\324\362\200\321\223A\352=&\203@\000\036\240\032\003M\0032\236\243\324\020\022\247\250\000\320\000\000\006M2= \320\3101\014\215\000\003@z\231\250\0004\000\000\000\022$ \002\004\301\r51&#\320\251\3722\nzzH\330\243\324\311\240\000\000\000\000\000\000\r\001\222\330\026\251\305\312)C\272+\010\344\235\025N\350q:\364\224vUS/\005Vi\331\212\306RV\225X\032\323\246\361B\346*\022}\266(\010$\237\350\377o{\333$\251!\336\002\344\357\236\t\340\316](\315\232LT\\(\240\232fJ\023\3540\205\001B\356&\324B\211\2532.%\000\202\207\244=\214B\3604Q\306\311\r*\203\272d1\003C \t\200$@\023\003\0306x| \214\005\"\261O\010Td\333\r\240m\000\332\006\324+Eyw\000+\004V\253AZ++:\377\370IV\025\025\035\224&-\222d\311\256\260\206\377\031Y\026\013\005DX\"\240\241\024\001E\202\200\262AdFA\030\n)\"\301V\010\204RD`\n\002\212\003\020X)\"\305\210\220U\001AH# ,w\353d\324\323y\010\010`\013\320Z\213\311\037\363\271\332\355\211\336\023#\303\206\207=\270\236\036\347\265\365\036(\347bFO\377'\364\376\021\372\034\357\220\215\336\206\344|#\343-\200\343>\313\253\177\317\376\313s\352-C[?\001\264lq\020\330\302M\202qC\244\001\343\240,\200\244\"\202\311\025TQd\026@Y\005\200(\"E\213\006$]AH\240\240\254bl\223R\032\020\222k\031\001\301\356\220X;f\220&z\306\242$\240\224\352M\334\314@\335\223r\313%\232X\373\363@\232\006""\0044\202d\204\010R\027%\215S\000\311]dv\315uv\025L\004Q\200\212$\"\220\016\306d\305\347\236\0047\224FW\253\256b/\202&\232U\000T\222\260\013\005\346G\226\007\311\217\231\221\202\032\253\016q\204\210\014\211\030\246\215\322\222\312\022)<xJ\214\224\250t\324\200uJ8@\364\230\t\240\365\"\212\022\356\337\231\306\266h\311'\243S>\006\211\340\027\213\003\024h\371C,\203\022\333\233\0061\343\013\001\206&\271I\344\203!\031,\212|:L\204-\255$\332\315\265~A\254T(IB\361\235\362E\004a\277!\276\001\276\006\370LI\375k\300E\350z\002\320\252\364\r\270\3229X+\305x\027\213b\327\360\240\304G\267\022\360\274C1\013\357W\201\276v\0103W'e\245\030(m1\215i\316\360/\274\245\200k@\300`\322W0i<T\356kA\301\267`t\317\223#g\212\341\214\206q\214\251q\315\340vO\241\220\247\272\006\000\303]\260\013\253NSpe\26749\342i\3576\255\255k\250\207^\362=\335\212\306\274\3061\024nL\010\305\221A!\371\225\003\276\206\030\337 x\323\204\306p\262\027c\311v\331\271u\333\203F\341\204`.\315\032\353\250\312^\326\311\356u\320 [B\022\3667\\\216\016\277\321\327\364\311\321\340>\010H\017Zm\366n\006\304\037c\210\177\257,g\267\214\364\366\257\242\317\322\275.\217\327\372'/\223\353\326\215?_<\024#\371\352\347jO\331\333\256\027\216)\340o_&\277\037_\301\322\332\330\276\302\3646\225MyW?\351\245\347S\"\241\225\236#\3064?Y\372\013\031*U\037\036\264\317;\272[\243\013\270\212z4s\223\244\276\323\376\336\225\360\351QE\253\322?\353\221KY>\304\357\325.vs\3025\333/\315\301s\235i\256\276\201\021\322\226\233nD\332\225\335\0322\375\253\342\016\271&)\232z~\206UI\327h\325Sm#\226/\357\3207\353\3265\333^a\236\177\302\341\377\020m\025\351\2324k\350g\276\235\304N7E~\036\223D[\342\177&\327x\357\223\224v\266\0272&\027\332\362\337\223z:L\005\266\351o\035\352\215w\334\305\027o\213\276\222k\244mE}\"\337*}{i\177.y\347\267\036\277;z\332\035\016r\270\327\312\234\235\373\270\362\335\272\362\304\027\\\321~\256hy\223\223\321b\2361\245^y\234\026\nk/k\034\236}-\036\364\336\325\315f\211\273R\225Ns\226\277\t\373\366\037jE\357\247ON\345\367V1\325d\235\3376V\301\216""\033\202v\225\245u\320\277\035\353\237t\367\336M3\210\010\232\365\320W'\305\277\277\333\366\307:\004\357\214>\320\270x\275\256&\020v\022Gbk\313\265\306\350\304\022\tw\327yM\341\232~\020\210\035\"\320H\027\n\204\211*CQ\252pE\004\201\017S,\302\261A\226:'@9Q\303e^Z\304\240\224W\224\251\023\"\305\342(\240\026\227%\r1\341\202\013\377\034O\260 \303X\"\264W\337\356XV\212\301rJ)\247v:\313\364\205%8\250\353\233\343x4\335\236\372/\206\231H\315\311IHS\224\252\336KJU\277\022\312\372g'\340\321\3544We:\335=8C\026J\366\253\247\345\274I\331bV\014\247\212\355})\177\006c\220\275\353?\017\227\327\342\257\n+\301\243T\302\353t\025|:\213\31710e\233\020\357\272O\217\031*4\357\004V|\235?}\324\\\354<\030\221\215\271|'j\035^wq\261\031Z\232L?(B\260\236a\211\257\014\311\233\320\363\271\340\032\335\226\334\366N\367\014\273\033\031\2666=l\030*\342\270\327\277\320\252\n\263:\373ijf\223~i\340=\355I\351\307\220\2513\307\203\2161\306\337c\207\245;\257\361|Q\265]\250\252\365\267\234\255\213wD\303\262^\223\3048\250\201\377.H\357\244\322\204\010\372\013\224F\364\205\245\263\006\357\341\032\333CZV\216]UqCIRP\335\255\023h\223Th0\234\376C\360cM\263(W\317\350\354\177'\253\253\354x\276\330\264\235\271\351\032z\207\001\315\361\220b\312\200#\001%\034\266\233kS\204\344\035c\327\240\274\177\266\275\316q9\007\314\302\026\014\251\353\234\177\000\352b\330/U\234\275%\271\216!N\325\3356\277.\200\225!0@\355C\361h\032\007\243\255&\206\rB\260)\222\002\220\r\024E$e\371S\365bR\223@\206\002\272\024*pX\222\3110\211B\3546\314(\240D\206\010\247!\346U_G\332\217\213\337\363\236\342\333m\330\357H\\\317\254E\"(J\220\310\027\313n\335\277ac\017W\357\226W\0145\334\026\"\305bV\006\305\2374\313\255K\246&HS)\222\230S \360\035\377\313A\201\030\330\350dl\261\226?\2137\271\253Z\305\271\237\251\267\221o\213\205\375\357\307\375\n\3533\370\276\246)\257Y\3715\373\247\243g\260AD\253T\233\275\034\276\313\254$Y\352m\376\310\250a\346\264\217\3473\323@\322`\322\017\216\022xK\365\347\207D\263R\251:q\373,\237\032\216\373\342\216+\321\223\316\367""\327\317\2647>\177W\324\217V\266G\021\364\277\263.\267\0036\213\377\232\324\375D(\004\223\322J\372K\242\224=!n\301\005\215CC\030f>\224\212b(\263\032!\033\010\021\247\020\356K\200\310\321\031J\0134\215!I\246k\032\264\352b\231M\014\312]\246``I\201 P\023\0235V\366\233\251\311\267.\000d3\021\003\340\374bz~\217Oo\272\r\334\331\322]\3216\314\263&E\365R\251\025\210\265\026\243\361O\271\3367\265\366\216\371\267\265\245\271|\347ud\270.W\005\310\264=]v\325\tr\361\265\257;\264\024*\005B\240FDR\277'Gw\243\374z\007\022\372a\204\365U\026\346\256\003g;\365\242\301\200\014\010\014\t\030\026\005\200:\013\243f\031\257\346\252\310\n\002\211\347\322\326\352H\023n8\014\354!<_s\rY\232\272\332Uxz\252\237M\227\nuxv\373\207\247\\:\361/\345E\330`\316\300\\PqK\261q\236z\313\227k\025*w\371\034\3731:T\024\224\205<\376xz\266\257\007<\276\254\236\226\020\316\362_\217W\251\tb,,Vm\300$A\002 \330\201l\237\007K!-x\206\215%4\312dM\001\312\362Db2(\274\204\367\241\323\251\200UH\260\212\310\222\017d\004\2713\353\365\260\273\253\032'IV\005EY\340\375\230\252j\266\367N\243\360\344\324\327\026(:\246X\333|0\216\255!j\\\343\240q\005\273w\337\002xn\357Y\026\177\035\324\316\202\374\250\210\334\333\024@\272Z0\215Do9\307J\010p\261\016\336\233\341F\230\2526\2246#\017S\265fC\034\035\313%\022T\021\321[\334\333\357s7\022\322\300\256/$\327\3405\325\275=\274\346\344$ \252I*@\270\007\220\0314\363\314k\251\032\023SK\304Mqs6\312\300\341\007T\310\314Yx\230p\323\255\340\024E\220\302\032\271\260'R\231X\311\224\240U(E(\347/\213\211s\275\360\366B\353\246\330\177\016\335D\341o\"M\344\032M(4\201\241a\345\362\345\211\033D\216\354\016\344\263\341\323&1\202\334/\315t8b\215\224D\235W\236P\203\237\036\311\264\261\2064\261\2065\374\261\023\306*U\341\232\345\001\177\232\344\363\327\252\312\325h+J\264\226P\314\263\300o\345\354\332j\235\252\013\232\303H\212\332\320N\005hU\242\251\302 m\371\260\363\250\326\315\003\3729\236\360\205\370\345\250\305\344\362\274M\263\203~\270\222\356\225i\266\333\252j\245\010\026\213ww\343\034\331(\033\021""\177\207\304\351R\364F\224&H^<\037\214\343\304t\373\254\366tQjg\025\350\022y\376\310$\211v\010\257Y\263\326\365FED\301\367\313\302\223\345\361Em\264N7\271\n\275\367B+g\255\315\320]\223\250\356t}5\322S~\037\365_\256\223\357\225VR\2109\305\266\027\315\207C\315#\313.-k\276O[\026m2-\367\212\033.\016\376W\037\316{_\201C__\035\030\262K\232\217\267\"\"\304j\335\321\275I\371\324 \311|\302\345\221\304\tq\277\242\323\202\316\332\303Z\250\204qB\311\352v\304^\251\212a\n\360\273_\351\3031\256\263\210;YI_\272\373\227\210\207\032\313'G1\272\026\234G\032l.Pr\217\014\223\005\211\025\312\203A@!B\245P\357\014\373\007s\306\364[l\230z\321ok\230\357\353\243\301\333C%P\346u\\\227\032\361\326\234N\030\324\265L\032\312\252\\e\333_\334\267)GTg\215\227<\357\250\356^8\353\023\262\033M\026\276\241\350\352\253\034\032ij\251\250p\365\330V]\354E\355\023A\265\331\017_\024\006!\245\236\273\372k\322\005\032A\205s \336\20104\276\3032h\2438kW\212\244Ij\324\221e-[\250F\252\255\376Y\350\261|x%\205\022]t\202\3046\233ME\346\250\203\347\211\327\317E'\260\201\270\010\307\302\\\273\r\355\257\221\r\250_\340\221\210\357\343\261\240U\213j4\037c\255\360\330\035\273\010E\031\033\345N.\254n\313l\345O\367\213\272\363\346\3245U,X\021\300\211]n\032\353\325\371u\302\344|\242d\270\337\212W\357\244^\233nH\346z3\0302\233\33686\255m(r\320\2058k\243\342\313\311\255\024ge`\3051t\202^\362\246\356%\306G\031\300\302\354\357\000\364\211\210/*\373pK\026\333\021\022,\363\276:u\316\250\371\341A%\000\\\003\312\201\330\250g=\221\323D\254\323@\224\341h\265\2131Eku2\314e\026\361E2\224\253\234I\220\311\322u\304\372x>\256&\363#\337\333\335c\n\002\323\262GW\234\362%3\316\311$n\317\2539y$\313^ygv(\257\257@}\350\333l\033\006\322\31113\351}\343\345PU<\335X\257iba-\0348\205\272)\017\274\223\344\362\007\312c\210t\243\251\034\270q<\373\0103A\312\026\375\035\262\236\317cOUkX\026%\n\r\327\261\246\r\315\256dD\022!\217\327j\264\033L\341q\323O\373\261enp:\013x\276\232Sk\361)\323$\204\201\304\223\256o\n*\275N\340\213\327\323\276\013\336\262X\362\216V""\376\211ye\205\333\341|\343-*\266%kMi\t$&4\3306\026\264C\323(\022D\236\366\025Y\233mf\354@gBG3\232\016`s\027>v\347\210\363\200 1\210?2j;\034\312\021\023\337\"u\321\022V\206Qy\272\227P\023\032\024QF1\203\245\034\022\345L]\030\340\321\247\205${\301l\256\\q\307sQv\352\344\034\022\262\222\266\310\357\301Z:\305kH\020\232\254\01790\210\014} P\014\315\t\\\364\2519\227i\002\210vL\217n\257\265\316 \365q\215\344\364\333B\2459Nl`efd\251\002;U\3206\223i\263\324\361n\352\250\212\302\271\253\246\024\325T\216K\222G$\271 \344\034\227\273f\256/\307\331\274\226\252\251\310\232\367j\350\261\236\344\242]\366]a1\300\325/\256']S\247\213\260\2249v\264\240\366.\336k\345QQ6\323OV\355\256\364\336\224\306\344\303\250-6\213p\330Z\357\202\246\010\220S\025\021\017$a\222\010\242F\010\205\337,\033\305\357w\213f\267\304DK\014\233\r&pJ\357\235\032\017j\236\t\214\275\3321\204\333gje\354\213\000\215\033\025h\252\026\n\217\354\336\360\307\316r\275\336\324\227\257\013\360\315\350\213rA\246\253o\300\306G\312\347\000\240M\020\332k&\223\224\201\004\254CP\024\224\326\225\"\305\335\007S)\211q,\025i6v\351\303\311\026Ym\214M\0144jpN\374\236\233d\247E(@RX\356\235\301\256\271\n.\347\215\276\030\027!\261\274T\001\200\334\207\027,\017cT\237\034\321\025*\021\240\367\306\251G\203R\350\257s\217\255\265\t\0162\330D\364\\\245N\204.\245R\022\371r\304,i?$\004Y\016\301e/z\207\273\246u\312~\303\221\005\355\016\276\204\275S\234\233\350u\264o\232\327:\261u\032\333e\207=\222\224\206\005\326\345\201u\320\343\331\265\027%\301\330XUf\311M\003\016\034\364lT\343e\200\260]\302M\2002C\221\366\000iJ\362\031_\206\276\004\007L\007U\325I\314\312\225\351\350\316\275\325\207b\224\302\3234\304\355\014\305\004f\035\310x\326\363E\223\276\323\255P\351\220\2309\303\002\206Bt,\245-(\240\224\306\033x4o\026Cr\314\251\316\3728S\202$\324\230\342yRW\327\177,\364\24046\305cz\030\033\232 \311\367\n\242g\266Q'\363\2464\320}\225\337h\355\312\017B\364 \364z\027\240\353\004}\377=\357\276\360n5d3\337\316\242\255u\244+\215O\212\021\271\204\n)\023w\226L\276.""\276\376\227m\233\374\325\334\027%\200\n\313 >(\242\242\265J\314\024\307z\272\305)\274\323\313#C\274\214\001\203\005@\245\0333*P\030'S\321\014iZ\014\t\260\237G\033g@\022\331\256\245\204\357z\223\354q\206 \256j\371}\336P\204\252\301+P6\177\034!\013C\247\032A\272\240\277H\024S$\342\240\246Y\204\262\260@\033\032E\021\n\252\034\346\024\353!\257\256\262\231r\227-\201\2232\271\033\303=\341k\300\332\020\300r\325 \327$ng\235\245\3566\3201\205\265\006\316\010\353\334\256\347\225\263\371\210\364\262i1\344\344\r\032\0141d\252\312p%3>GL\327h\216\321\225J\266h\257\211\304\343\306\377=\2126\260G[=\303\246\242\002\216\251\205=;\023\220z\253(\312\373\206\255\230\236\364{\020\206\232Ba,)\324]E\276\242\300\3651\215\214i\215\242\363\274\022\255{\267r\177\004B\265\301\013\247b\351\237\276U\336K\300F\365\"\364D\271#g.\310\rX\361\205\003\222;Dh\2619c$\025?\026A?\003\"\007'\005x)u\245.'\265\243\251\337;\037\3034\246\024\354a-\246\335\007Q]\265\232\261\362[\341;:\242\350\322\310\345\023\3379Chs0\353b2y\230rou\365h.\323\214y\246\255\322Fz-\256i\347m\342i\261\214lm\r\210l\006\333\016w\\\355\323d\207\360W\200\216a\270\321\331\243\203lW\264\363\332o\343~\177\323\256@v\366P$\373$\272\322\037G,\372\025\206tZ\322\312\3251V_\313\t\224-W!\005\224\231u\023\r\365\236&\213\233sj^dy\227\230<\332W6\010h\031\223\326}1\237\245]u\335\271\003\346l,a&CA\t\021?t\361\217\307\343\246\312\324x[?E=\346\224\230r\331\250Zwzt.\275\375/\253\244\2051\0012\"d\222\221)8h\224R1NS\030\314\244\364w\313v\343\263\200_\261*\260\0276eQ\016\022\231\235\263b\"g^n\030Ca\002\032.\346EN\213\305\357B\325/\257shIqw0\032\373,k-\243S\213\024\215ay\370\266\240C\024PY\n\251\026D\206\246\007}\376:w\255\243\001$\352\311\344\204\300\325@\205\201\244\245\234V0\366\261I\373\2731G\327Y.\002'Z\323U\300AT\302\3260\334\345\271O!t\213\022\005\313O\253\251\315\310\2531\177/\237\323<\372O\203\t\357\014\354\010dI\3103&\003\032\226h\370\30108\025\23479s\362x+\247H\372\245#\321V8\336\322\301\245Z8H036$\331g\226\314;\254\213\242d\225\207\224\377\323,""\202\2756\373\037]\2758\240\303\002iU/$\215\317_Fr\3147\350H!\350z\273\246\260\242\350\215Bv\353\335\310\227\242I1\010\"\251\242\320 \371\006\0031\222\351$\036\006g\0251d\rV\013\022\024\335BB\212UQD\0359G\023\272B\023\304\237SH\226\236\332\367\243\317\334\364G\317\233_B\0243F\367&\3718rfI\202\220\250\211\212.\202\202\336\233&P\270\223\024N\033\256\022#|F\367\rc\201#/\035\225\027\265{\004J\244%$\203\276`H\222\300\rbbS60\t\025\302m\207E*\027\2133F\215\222X\244g#Sn\342\033\341[\204\033\3360\005\305X\205\212\225FC\033\032$1\250\206\333n\023\204\336\335z\357\241\251]g\010\350\356F\204\264?k+`K(\016\320\362fH\335(DGJP%\351\372\276\255\177 w\361\223\224B\373\221~\374p@e\325\315\237\013B\242,B\3624\332\264n\373\245\036}Tb\301\266\r\254>#\332/\036\326\210j\200\270X\355F\223\346M7\221a`\306\306\376;l\322UXX\306\324\247\243\210\r\272\340Y\260\304]0Nc\362\nr\314H]\324]&id\327s\224\335\366\312\223a\202V\371[9'h\333\255\233n\356\004\272-\336\347f\353XH\031\023FtGG\332\314e]\025\325\310\356.I\033\230\332/_J\006\235\347\206\351\340\256\322\013\305\246\342X\034R\276Em\365\302:.\322vujM\246\300\231\364\250\202 \361\224\r\271cY\326\341\255\310\233\340\222\367\226\253X\233]?>\332\255)v\337\0227A\024^T\032)\211\320>\231y\233\"8m\351\367\275\366v\353\2705\357X&\216\2714\300E\377d\0224CBTE\213\013\213\247\225\307.F\276d$VX\353\327\246\231\360\0146\014=7\250u\226g7L\315Xs\215:\350\333DA\225\345~\215\355\030\222\003=\347R\305+\267N\031\273Q\257\263\217\210\301s \243\276J\021u)cJPT\272)Q\353h`\225R\352v#\343\366t\375w\341'\246\326T\224\022T\201\231\014\300\370\323C\031\320\320\322c\002\372XP\016\\ \345!$T\206\024\312pA.q\212\004\223+1b\325\315D\026\027\255\311E\227SZ\306\0138\373X\370\205Te\005\024\250\261bU\001K#\313\252\010s\004\262\275\315Y\014\014\347sxz\247h\022\255Tu\244\246\rOc\017\272\033jH\242\306\344\205\330\305\210\225\331\207\033I'\030\300*\025\202\347\005\313\020[\n\252\021j\271\363\235\317\247\333|\365k\214\327\271t\274\276S\312\\\263D\223\273\240\276\376\257k4\261:\311z\325""\010\313\300\251\263N\310\014\007I\312\276\213.\250\242\2343jm&\206\326m)N\037\270[2b\302\301\306\236\377\241\222Eh\2654\n\306\201\240\215\322\264`\232\265\r\215\2616\212\216<\020\310\330*\264\354\325M\230\277\251\272\313\263\364\350\254\333D\354\214\033\346\203\330a\264W5P\230B\005\331F\363J\0260YD\234\312F\254\241Y\377[\317\036\262b\214\r\362\031Lz\223\242\035\351x\320\274\213\355m\267\237b#\033\366\277\026\262\025G\223\304\032\244\233tq{\250<\354\361ZN\321U5^n\013T\304Z/\370|\240\363\265+\233\351\246o\312\361\025\227QB\013V3\024\313\265\275\372y\205\255\365\326\027\227O\021\303h\247\217\320\234\365\241f\345\003\017\016\356\206\344\212\364\336U}Z\225\243TJ\325\303l[\221u\331:\231x\227X\304\245uz\372\321R\375U\337\237>\206\203l\315\235\031\234\0240\214\034\363\363fu\243i\325\002Lw9\347\333\240\3251\013\341\371\274\032\326\261\216u\357\344\324`\335\327N\3518w3\272\322\001&IYq\313[\003\005\032\375\036n\"\314\323\262\356/g\213c\345\270\354\2458!\\\212\320\371i\355\231j)KTeE4Y\207'z\306\377\210\310\325`\230t1\331)l&:c\263m\370\"U\014O\021\031\023\351\226\307Y\241-\010\320\032\r\005\233\303\217\037b\014\360\347\314\023\33188\376\356\363U\203\345^\352\264b\\.R\032+\246C\210I\242\210\202(E\202\310\262LB\211\271e\"0\341\206J\230!\010\251\344{N\n\324b\036\366\246\261i\270U3<\275a\320\310\2010\365\002g\334\264\325^\335\253\354\312\034y\235\330\242L\2325\271\022\3630\242L\367\3726\251b\352\310qa3\004\001\207\231w7d\360\262\010M\304\322\265\254\034\224U8\352\210\360\362o#\242\271\031\244\255Sh \261\317\013\024P\260:\206\272\302\3211\240\3614\215.o\277\010\323~A{\315\033\224\327\r\226\235\333\203\324\360\301\337\310\234\343\256\242\020\234H\354\021\rz9\025tD\331VjhA\316\034\237c\330\360tm\214\302\255\006S\236\275\211.\202\274\203\243f\356oF\355M\2301\273\313\024\222\014j,Ws\315\251N\352\352\265rJ\322\324\256D\315\2042\371\235\001\315{T;f\274\215)\024E/V{\315|\225,\322\242\312\252\322\202\226\036\0052\277\240ABf\246Qi82\031\371\035\311w \356\003\271.\341\037\005(P\335\340w\033Q""\210n\347\324\344\315l\255\257\220>\3101\244\301\231p\262D\001\230\325\r\225L\272\371J\265\304\325\362Jk\306\257^e\226\026\026Tl\356x\360\272\252\213d\342\334\323PN\332\3674\250\2244\223\020o$\351\251\024D\335\030\\\211\352kG\206\324\206n\317Z\025\240h\306%6BE\001\250\203\016dfY\226\204w\243\344\320Zs])o\362BR\242@P\031\267\204?\246I\277\302\366\366\372\367\331\214V\276\021\221\001;\243\243f\227^\245\244\204b4t\342c\251\243\241\222-i\247\22795\026`\312\262\243\207\207\207\207`o\".\326\241\312\022\224\226\312a\026\252\224\n(\356\340\363\367L\311\001d\307\000w.\370\230\026{?\205Y\264\313:\232\350\210\320\360\271\350\330\006\300\331\255z>\325\334\034]\331\312`|Uhn\250\232\2064\333\351\224L\3359P\022h\003\325\360R\243\237\321\245i\354*<\276\373,i\263\254\233\213dI\371P\037Z\243\346\315U*\216\331\3104\262\007\241\226\336\221\023u\367ks\364\207i\200\035\277Bp\\\356\n\354\210\207\253F!\243%\234ih\003N\235]\211m9o\342\200\277u\336Zn\355\333\316\352\027wI\342\361C&&z#\245\235\177/\263=_\007\254\237\275\304\3502\352\265\277\261\246I\313\272\251'4U\025R\256\255\262d\314\254A2\214\2322\344f\225\214{Fv\177\037e\374\010E\010\253\005\005\027\307J?\262\214\220U\202\200\261H\244X#\"\200\214\210\202 \214\212E\221\030)\004dI6D\020\177\242\262Q6\026'b=k\246Q\346QVJ\366!\311\031\365\0020D\022\217\347<\203\003\202\240\245=\311e\"\3239Y'U\371\000\363=j\246E\014\262DB\024 ZH\260)\207\006\024^\353\324C\350=a3Iy)\026U\025\036\270Hb\220A.)\302\027F\252G\216\240 G\361\363\273\370\273\305\205\r?~\213/B\352\"\205\271=H\274U\016\363\322\240\242}\0269\210\036\034\306\001\201\000\214\031cQ0\232 JQ:\212r+\304\355\356w\363\354\\\202yE&J-\205\3505\025\206b\264\372\003\211va\375\025\223&\265\244\235\275\264\005)\234\006\206\231\231c\030\177\177\255\351\357\036[3\346\230/\t\352\353\n\004\021\027Ms\235\n\206\231\241\252\226w=\031as\025\252l%\224\244\326[\2067\204\360\035\375\325\363=\277_S\315r\032\035z,\324\005\004E#\365J\004\345\270\255\221\004M\355p\252\354\020\220@\213\307\202\202\361&\306O\177\375{=""\327\340\330\367\032\201\353\264\251\330q\222\264F\031j\021\007\023\016\207\206\260\222\004\203\004\207.\265C4\240\2213\\\216~\264y\276\036\017\036\351\3032`wX\2669}F#>\341#B\304\\\311\021@\370\202\240\007>I\241%\tld\202\360R\032\007p\256(C\376\357\270\217t\333\374\023\257\246\356/\273\nP\024\"\037\213j,LB\005y\344Y\214\373\3103\320\315\320\3200(f];\236\326\354c\256\250\246\356\303\357\030B\356^\277\246\033\323\272~\300\241}\016\335\006\377\020\344\361\203\322\022\033^\276D\376K\025\273\374$\321;\310\336\tZ\031Q\271\305\216\275\360\302\370\037\340G\3430#\374S\237\235@\226\373\025\234\322\217\3650N\t\271G\013\302\241\344\201`\320'\377e\262l\366\341o\014-\005\300\335\243\236@\356\363\317\346\362\202&\000$\017%/\367\320\013\374\231\362\325l0WYQ\262\025\010\010\205\3506\366\315\364\250V\362\031\020\336 6J/u\302\000\203\\<\036I=\000\1777G\242\030\356\364\217\231\"\264\r\225\263\016\006\255\300\010\354\005\270\251\010\2019\201\337H!x\022208\036\241[\251\326\236\230\017\321\362\317\231\320\350\003\270//\314\236\360\343\031Vrv@\271\302<\347\325\025\216\367\215\264$\354\001Gc9\230$Y\243\261\231\327X\025)uz=?[\247\372\324>\247\246\340v:\343\256\373\n\216I\025\311\301\260\033\200hgkq\271\231\013\322\226\344\240-\r\034$\356\334\016ry\374\235q\303\304*\275c\330#\216%;\034\246\304\322~+\207\264\362\201+5Lm\003d\001\214Z 3\322\341\203\303\342v}\227\037\376\245\327\312)\002\304\245\017T\270\325\010\354`ci\3003\263~\231\340\351uc\255\326| \211B\207c\213\323\274#\273\346\273B\206\226\324{'v\362\"\025\215\013\355\215\333\354_j\306\273\377\030vx\240z\204L}~\265\216\023\022X\rv;\306\203\252\231\035\252\034\304\207\315Ej\240(\310[\266\224s}\262x\371#\275\354\233B8x\275R\007fJ\355x\034\274\247\006\014\335\254\221\332@\340\224c\372I\000\310\271\001\003\277\014\004\017\253\367\370\307!%q\317l6\313\367\274hE?\332O\253?W\376~\261\003\027@\356\260\263\255cW\021\365\233CA6\337\0368!\213\020Dk`\270\273\303\223\317\346\345}\241\025\034\240\2374\002\244\204\317s\364j\204\273&7\000\302\"Z\325\007""\263\367\233\3641\220A\034\334\243\204x<\243\267\034\277\2769;\200\201\334\224#n\333\207\013tr\2046#T;os\307\301\273x\340\343\353\361\372\375\204\317\037-\363\020\013\024:\200Y@\204>$)\035\231S$(\322\022c%\244\300\307\354\310W9\001\211\013'\026,f\022(\024\226\3601\250\335\240\020\242\247\270I\261\3341\272v\336\000\374]\236(\034\220\321\216.>@\330\345\267\222/\233P;\226\275\315\215\006\207/\340\342\343C\212$\216\317/$\n\007\226\246\034v\275\013\206j\303\2135\324\037\313\2748\3279\365\350\220\021\003\221\233\343\207Q8G2\312=.#\327>?\027Lu\000}a\302\300\341\201:\213R4\301C\260\307[\245\325\203\324G\205{\376o3\274\357\307\013\210G\016\211|\020@\376_w\311\312\344x\370GA\013y\330l\017\375R8\215\271\266\032\242*\002\352L\337N7\323\035X\034\376\217<s\372\037\347\2472,x\007\253\347\n\201\241t\224\220I\347\207\307\342\3618no'\271\360\357\363=E\314\177\256?\016\362o{\223\363\374\334\317\030h\310\374\216\216I\024b\361\363E\t\337\344\345n_c\221\320@\016g\362\214\343\371\267\203\220\343e\321a\313+\201\374\217s{\204*\000Q\253\022\206\025\236\027D4\305X\232\213\024\017\220\240\t\223\370\020\221\001R!\007\005\201\236|w\332*x\365\330\275\002y\236Ff\227\000\034\001t\322%\356\261\250\031\007wk\242\030\231\233\215P\341]\032\025\254H\227\"\013.\000\344']&H\002\203}\320[Z8\\\020XQ\203g-\354\0043[\345\023\366\326\373\\\274\215\240\225\213V\217\331\341co\207gOS\267\361j\375\276\306S\027\230\362\365\316\016Em\376\355\221C\\\315\023iD\321zOH\036\3333\t\230$\321\352Q\014Joo\376\031\376\365,cf\250\357*\r&\016/}\264s\370\205\315\343\306\353L\214\r\364\334c\364\374\306\351\204!\367[\021\316\353y'\326\315To\3051 \361\316\036\231\241\201\252\274\022\356\301\034\352\027\245\243ET\334\336[\315,\251:\233P\313\031\226\310\233J\344\233\322\252\226)\2275S\016\031\nM\263@\200\310rEPsw\23151xic\014\205~\027\270Z\022A\275f\305\031WN\336\323t\316f\001M\204\332\003\232\365bF\244!-\014\312\223\244n\360\343\241S\215\007\010\340\re\330D\214\244*\303\336\233\026\t\037]f\254\006\271\336\020\367C\203k\340\330\035""\373\246H\226\267`se\322\225uYm\320sd\320\253\207se@8M\025\223\026(\347\320Y\032\364\225\255\200\226\264\t\243\244\2462\\\202v\236\222\315P\323L\260\203\030\344\034w2.cA\326 \252\244\315\204`\232\304A\224$\225\211\325X\213\002h\333\313\215R\320\310Y\262{\025\3437\263\264\344\260\226\032h!'\275\232\"\204\272q&\251k,\320IMNf^U\352\203\225n\241\301?\201\205P\204`\201r\215\3420=XU\240C\263\327q\251k\020Y\214Z\224%C\007j\327\030,\256W\203 \211\372,@\371\200\254^\225E-p\232?x\250\305\2014\330\234\232\312c\321\022EF\362\036\235pK\315\210\355\213\221\310\004\353e\225\276q33\267\307\177'2\366\332v\254\033g:C&\314\340:C\000\264(::\325]\353P\357K\331\351\004RG\272g\243\312\350\2656p]\002\205\251\215\014\323\013AV\005\241\026\241=)\017\035\322I=S1\013Y\270C3\351\004\315Xk/\377\027rE8P\220\363\2260\350";
    PyObject *data = __Pyx_DecompressString(cstring, 8754, 2);
    if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error)
    const char* const bytes = __Pyx_PyBytes_AsString(data);
    #if !CYTHON_ASSUME_SAFE_MACROS
    if (likely(bytes)); else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) }
    #endif
    #elif (CYTHON_COMPRESS_STRINGS) != 0 /* compression: zlib (9373 bytes) */
const char* const cstring = "x\332\345|I{\023\327\266v\234\230\304\020;X\306\006C\200\224\301\016M\260\300\r\234\034B8\217\000c\234\230\306\0359\2449\365\224\244\262T\261\244\222\253J\266\305i.C\0175\324\260\206\032j\250\241\207\031j\250\241~B~\302}\327Z\273J\215esN\356}\276op\363`iw\265\367\332k\257\346]kWt_\233\323gOi\370/\246\245\213y\323\211\333\031+\241\345\355L1m&\035;\247m\332\216\226\264\334|\306(jVN{\2317s\213\313\2674\323\362\322\246C-\370\326\276\317\230V\216\247\311\332I3\243\341\031j~e[\271\204\341\230\322\032\325\264\245\\\"SH\232\256fh\216\231wL\327\314y\206ga\031{\223\236\340)\334<f65\303\303\354\233V\316\362\212\364$j\256F5\313\310Xo\315\244\266\013\nx\225\265\234\221\177e\032\032\346M8V\236\246\343ydJm\323H`AT\014\355\211\345X\211t\306\364\264\244\2355\254\334\255\026\025\230\320 \2622\226\353a0O\220\264\0224\231\341X\246\033\345\026\305)\317\261\214\\*cj\273i\314\247%\014p\301t]3\2231<S\263<\2246;\036\3301\035\267\265K\220\236L\201\010/\215=\026\\\242\316\361\322v\3121\362ib\276c\377j\362\312\330\257\353\231F2\330\016\316\307\315S\327\216\3311\275\232O\250q\314\\\022\343\260\227\204\235\311\250\211\360\260\234\234f\307irbe\373t\267x\246\202k\345Rxpqym\231h\366\314=\315M\033\230N\363lL\227\315\027\260?\332A\213\306vB@p\326H\231\3013\226\033\314\205\341\330]Vv\234\264I\0002\031\"\n\274R\363\032j\303<\023\237\233c\244\2628\0315[\364\024\367\254\2471\253\332\257\022KL\026,\2342s\246c\320a\306\213a\253\010\225L\202\347M-\351\030\273Z\326\004\313\223\232ke\363\231\"7\021\265\341\311&l\354\237\270\021H%(\261 \225\0201\323\204\340\004'\317\307\327\203\\bX\334\324\234\002x/{21aQ\313[{\320\017\2456\273V.i\357\nQ\335\317\273v\301I@\013rImZ\316\237%\033|+j\323 \373-1\021\235\366\346\246k\202\213\244\247\205\234\205\257\254\026/lnb\212x\306Nl\271$\236<\001\310qIJHoP\320\203\025uYQ\227\025C>\233\341t;fbV\333\261\314\335<\344t\r+\203;\320[\010'\357\202z4\352b\252D\036\036<\232\231~n\023\301\017\037<\232m\025\347\202\342#!\221\237e\201\310\331\236f\356\345m\027T\342\024\240\314\017\036\025<""\317\316\255\232\031\323p\315\351\231\207]\rsAC\253kz6,\315=|l\020\357\301.\034\031\351\245\021\360\205\245\320ry\027V\252`\027X\033\262f\326v\212Q<E\244\030\256k\245rt\212x89\315\363\310\010\"Y\rR\023\357:\226g\304!42@6\265\351\330\331\343\236\305\321C\273\304\210\301\360j\327T\273\347\0309\227\331\320zD\206\341\tH`\202\344\036\307F\366\304}\014\325\2612$\246\017\036c3\216\235\231n\261\344pK7C\371\250\036+\356\004\266=\264&\264\246\321n$dc$tY\360\314\204@\245\215\035\313v\\\321Y\260\312\206\032\233\267y\013l\nI<\224\226B'\335\004\324S\311\327Z!\236\310\200\311$\305P+\234<\326\300\030\314B\032i\262*8&\351\345\022\352\324\316jK3\362<<\013\321B\326W\036\357\262L\334\313$g\rH\324\236RI\210\276\242\341\245c\245,h\224f\024`\013\234\373\334\370\334\3322\265g\206\343\271h\022\305yb\346Qg\212`\262\036\247\315,\234\204S\344\276\215\234\305\306\335+R\337\033\333\331\272\245m|\317]i\317\313\337\277}{ww7Z\264\235\035+A_[Q#\021-l\335\376W\366\327\364m\231\335\360\014\326\336'\301\261jSI\022O\222\0069\361\205l\036\363CM!'^\001\334\341\361\211\"\250\316E\r\3071\212\013\216\203\026\262\265\257\304\324Fu\235\234\245\256\323\022\334q_\323f\242w\357hm\377M\271\213\313\372\302\213\215\347\332\235\275\251=\034=i^.%K\033;\206\225a\261\236&j<q\312Z\242\3408\304\t%,\244C\346\236\367\027xv\233\316\315cK\2265E\325\226\016\213,\317\355\026\362d0\314\344Rn\007\356<\251\205kG\265\347\005x`\234\223\2353\211\245Sn4\030D(\342VKT\256%\256\021\320\270\006^\220\304]\273\245\2450u0X\270\005\2756\366@\375\203\357\315\342+xz\367\341\262\231KA\2601\263\223\212\033z\222\270O$AF\022i\020\260l\345\266H\241:\374\326\265)\367\032\200\204\2251\223\321\007\317Y/_\223`a\226\347\226\313^3\225\3216\0139\026\274\373\332s\033{\310@\222\310\372\260\217\270\377\302\326\322f&\317N1\340l\364\205\315J\002s\364\230\017\223z\201\224\2548{1<LL\301f\331f\345\264W\013\257\246\347\277\236g\301vL\361\343nK\221@M\274`e<\362.0)nT[\332\324\212vA\313\231\242Yy\214k\177\000g\232c\237@\212s\215\355\017\273a\035\217cO\327\224\370\221""\352\343\351\247F\3065\243\2447|\364\220\247\271\350\254\326)O/\013\254#q\273\220K\202\240\\`r\215\004@\230\253]\347\303Xe\204BS\302yM\213G%+``\212Us\273\200E\223!d\342\377\336\3005\005-\017\326\322\326\2467\335\346`TC`\346\326l\307)\336\302\236\0100\006\266D\340\305.0\236\203\343\333\301\0027\331\307\211\303/d\244?\215~\317\266!\014\271\" \035\304\212P\260\261\221c=`\014\224#\\\004\334bfy\003\214\2466\304Q\212O{\311M\241\376m\344Ba\017\035*\033\374#;\246\\\222-0\350\031\344\345\007\303\311\221x%\354B&\311\202J>E#\235+84\226m\310\017\355&;\327\245\233,.\256\2355\265uH6\tS\234\\\t\364<\264\333lg\201i\314\\;>\005\377\304#'I\317\240=\204\273\243\377\251\371\356ml]\261\266\353p\222k\211\364.`\215\351\334:\365\377\307\002C\024X\300\024\000'\304\344$[\250D\035\023s\306\t\304S\261X\311d4\332k\006X\2178\004\247\370\037M\245]\237\215\316\334P\363uu\341@\3767\027\"\365\305\301\222\247v\216^\361/\321\207\327n\334\322\036h\332C#\231\324s\266'\250\224\002\264;{\364)\020\264-\334p\243F<\361\240\r^\321x\261%\017\273\233\003T\363\0208\201\264\314\024]S\306v\023\202\0217\022[\035\201\305f\3066\274\237~\351\200\274\251\004\316\361z\n\242 \"\234+daDI\"\324\010\227,a7\343\024\233\\\354\376:9\217\024\273\\\322b\3229\350\016$\216\301a\350\277\272\"\034\330'\374\205\270\233\000w\024Q\253-\310\036\332\366\323/\226+[J\222\315 \025\322\036|\253\3359\344\301\341\177f\177\372\205>\367\346\370{nO\352\363?\375\222\003\37017\215B\306\323t\035'YH\230p\354\311\002\233\244\034\214\036\254\330\016\342b\364&\224\327'!\330\264<\217\366\0012\354\356\330@\014\027\361\207IR\365\207\324\220Q\036\022\222\220\312\334\206[\317\332\271\333&\001\214h\276\270\327\331\254\234v\253=c\246\214D\361\266\t\003\242\023\322:\324\003\235\206\260f2z\312\261\013\371c\372\005-\036\356\017\263\024z+Kqx\330\026e$xD\252W7\334\257\2319\242\2717\335\031+\225\366z\3565k\272\240Bw\013\016\245\032\016\367\013k{\264S\320/\226\373p'\354\035\331\304\214\200\271\303\335-T~\344\014*\371r4\023`\234u\233\365]\337=b\222 \036\326i\223\207""\273w\241\272\014\367tI\332\264\215 \260\346\344n\023\276\322\343\0107\222\272\362Y\207\307\2442nFo\333\221N\240\375\337\030v\210\350\216\201N7\353T/+\360\373H\342\264\200\251\313X\025\037\037\265\\\300\243\303=J\347t\3219\375\220 \250a\222iQ\243\332\272\021w{\2663G-\014@\225\321y \361q\262\303\252\036n#\323\036\032\327\216\376\260\265\020\342\032\310\232\235\3400\220l\221F\247\026\355\321+\240\232\361\204\304\350\321\016\323\347R\246\340\247_\3609\307\2370]\247\002l\370\360\341CMm\350\272v\375\316-m\346\2266{C\273\021\016x\240\335\211R3}\314F\357h\017\303\236\200\017d\373\362\016\214\333u\204\274\24663\177#\266\366xi\351\321c;c;\260b\316\343\242\270/\n\251\036\321\001\257\313\371v\327\243\004\200\0165\002x#|\301\032\222\0109\324_\310\321c\013\020\2025\323S_QB8\013\231\214\225w-\367\251\355\004\335T\324%\311\310\305\035\303Y\\F\204\277c\270\034\244\265\244\230\260^\217\246(DM\017\345G\341\265^\343$\346\356\325\023\206\341]\235b0z6\206\250\265w/\371\177\021\342\336\375\002\370\332\242\320\216\2004\301\311\nS\207\370\3508\300\255\366N\332a\260]\267\275\243\353P\332\273,W\347P\257\275\r\241V\240\371\024\332\376u}\341\305\332\322\313\027k\250,\275x\035[^z\302\361n[\365\351j\354\371\302\243\215\247O\027V\365\227\257\026Vc\353\030\337\326\337\253\r\237\033\013\250\257.\274x\262\260\272\260\212\342\332\263\330\223\245\027\213\372r\354\305\342FlqA\177\275\260\272&O\275\306\250\227\253\\PM\001\017\225A\240\240\r\322\"y\022\2352\320a\327\241\355\007\3552\270U'\276\233\036k\3023\345A\027\311\301vTxX\320\262F\376\265\243\242\010q\017wt\221\321\325\331=it\023\372\320\331B\371\306D\301\003R\354l\017e\224\232\305\207<\013\035\374\253\320\277\367j\013e\265g\247$\216`\275\333U\370PC8\307\0220\333\017\214\331\370*\203?^\211\337l/\363\264\334\240\363\265\302\3622\001\006\376\200\322\007\337<\212+\\z\376\374\365\253\347\234\201z\256g\r\372\260r\317\0313\254\td\350\250\250C`;\354v\366\360dt\223B\352-3\276x\361\372\305kBp/h\352\0274\265\230\300\227-pq\250A-\321\312\224\035\036\341m\255""\007'#\235\207\224\375\210\346\350\232\207Hm\225\215\322QC\002\246\037\325\337\233\274\303\343\222\266\036\203L\255\345\255\243\207\020\306!_~\354\200\326R\307\216\245\374\315Q}\234\021\325\013\371\3441\373\246\233\246#\371F\032B\221\016\301\342\\\362\270Q\t\272\256r\010\336\035;\231Y4\217\035\343m\275\217y\336\3263\330\352\214\371\312Jl\035=&\310\254\035=\342\225s,\031\253f\002.\36291\360\230A\307J\224\267\265\22602\307t\277O\232\243om;\373j\346\325\354\253v\334\335QaQ\tn4[\337l\027\272\252\035C\327\025<\014\352b9^\205\"'\212\254\353\257\212{\370{b%<\375\005\254\323\252\271\271\272j\354\n\275BdW5\324\243\356vZ\275\273-kl\231\272\312\335v\367\211\333\356nu\215\235\000\000K4\313\346?S \232WMB\242kzpA\273fn\027\314\\\302\\c\330\314fv\215\301\252\314uDs\270\201\243\372\211\254\343\372X[\217\032\320\013@\0355\226rjz\322\314{i\202\024\005\363\350q\224\271\324=[\354\363Q\303Z\254;r\304\221\367o\307=\241\302\025\267\315\306\256\007\342\025|\223\313h/\203\311x\234r\017\272\336\325.\314\357j\024\210\335\321\350\026\342Ik\007p?h\355\306\003\255v\034JX\351u\000\353\355\351V\205\225\327\311\177\365H\241\366\312\2522N\344X\243W/%%\254\236\317u\021\334k\010\030\374\3725Gb\322\334^\346u;\032\272&\354\350\313\330F\222\021x\353\246\340\207 P^c\214\323Ue\276\375\340\340\220\234\2772\357\336\360\247\021O\264\020\267\261\211\336 \020S\261\242\221\311\247\r#\033\267H\212t\225\2777Q\312C\221\223\206\223rYL)\235o\032\356\352\342\243\330\327\206\253s\372\314p\023\226e\260\0214\334b.a\331\340\036\\\217\207\310\3125\340\030\\8\206\340[\247uw\315d<\316.\212\376 \264\020\037\214u\245\206\211p\252\016\205\325\304\253\3269u {%\006:;\246\270\345\261\312\3610\235\357C\245\230\243\373#.\221d\304m;C\177\246\221\023\345\354\210\246U\205\007\266\001\247\303\220\272\033T\264a\335\266b\364\00118\343>\214\322\253\004{y'\221\220\031\023\246\225\021\307\253\353\234\371\326\365\240\020\252W\0024:z*\243s\262\314MP\224\212}\351\000\271\t\223\330\224\310\330\256\311\037\256\227\310m&\010\255\363G\240\331\035""\025>6nq\213\256\210\366\241\030*a\303\002\247\360\371k!\205\243O\330\030X\310y\312\320\253\224\005j.\026b\370\235(\246\010\242\302\202\220\200$\227UV+\211\312\026\376\310\322C8\272\244\033U\317\320\345\264\304J\006$\352\364\216\214|\022\263\025\303\361\205\371\023\334\275\203\217\026N\243J\002\037\371\264E2\037\032q\276(\010y/\240\214d\244\273\324\t\324\222^\332\004\261\304'\035\321\240H\204\tG\004\220\014\005\340\347\\3W\310\362u\032N\205\017\306\334\001k6\311\013\323_(\272T\241}\270\233(\307\355M\260y3c\244\334\315\214\t\374\215\210\206\376\362f\222\325\207?D2\270\210Q\266\355\220\214\243O\356#7\355\235b`\342{\233\372M\004*^K\221T5 \247\220\311\260\340\352:\335+\302\212\247\004\037\212\\\342X\311\276B\330$\005\333\313\330\366jk1\031N,_ls\016\\t\305\200\2442\217B\203\027\243M\2462\362\252\201\362I\251\314\002'\207\324\010\017$\304\325\270E3'f\320\345r\333\034h\240\313U\025\252\2472\355\017\0238\362h^\265\035\235N\r\017(\tNe\212\371t\3121\241\007\200y\3514\2047m\222\350\022$\247?\026\310t\306%\327\354\244\342\224D\246\234K\220Lv\323\005\323\262\222\344\222;Rz$E8-r\205\374bZ;\006`\203D\\\003Z\243\224~+\255\037x\316\340m4\312$\266\275\231\206\235\340\237\010\007\0258\251L\333K\201)$\247\241\241\r2\030r3\240\256\007,J\242\375\272\265e\026\361O7X\332Qr\351\257\230\335\332\335\332%\303\236\341Y%_-\254\22026\315\005\227\363\325t\227\001X\315e\0221.\344m\254\205I\357t\324f\270\026H\037\013\236\225$O\006y\311\330\271\224\345\201?\020\023Ji\321g\013Nf\r\027GG7\025\370Kg\315,\245o\241r\330\227AC\241\242\312bf\345\256\234\2446\270+\247\024(\277\035\310\037D>\206\331\311\002l\234.1U\036\321\207\224$\325%e\026\004)\2069\204\366\030\014OC\004@\035\275\274\207\212\233\312\221[\321\365\266O\272St\271\004\251\221K\254\240\306&\205\214,\213B.\236NB\020\2629\262\357z\316\334\225\217 \361\353B#\275\034\264\214\376tw\273\000\224\237\204\374\352\361\242\207N\024\022\0057\357\302<\341\337_\361\367\006\177?\212\265R\257\343\311\3526\334\220\010\274\255nK\305-\332\260\027\036\031\244|\036""\026\000dc_yR\"\342\027Li\336\"&\301\362\222\355\311\346s\251\274\235\017\316U\207\321\244\333S\223\n\220B\376h9)XT\236X\224\222\354+\306!\022I\244\315\304\226\013\322\271\246\314\002\025\2313\\*\344hU\034\324B.\030\267\303\357A\221-\001\0232\302j\307a\273\345\030I\253\340\342\250\222v\266\033n\243\236\221 \244u\275\025\226\344\222\254\255\301\334\243b\312\"\251\353\002\344\330)\251s\270;U\367,\020\222PW\211\001\304\345h<|\007\304!\351wl\333\023!\343 \334\261w\361\317ug\334Y\327\200\273c\320\332\302\366\307\005H$\236\206\303B\352\232l\372\351\365P\234q.Io\353u\304\372]1}+U\326\036\305\037\0350\350t_\245\304\272=H@Y]\032r\273:\302\266r\300XN\352\273\364\016\005i'\277Y\270e\345uw\327\310+\234I\206\203\336\337\340\365$K'\237$\177\360\370\226\347n;4+D\306\245\330\204?\230\3558\244\274\353\331\370s\324\225\201\274b\3449\005\210}\020X\250\002]\260\212\\@\362\334\002\335\365\264\023Qt=\217,\n\224\312\323\203}\006H\204\244\270\275\354\006|`\214\340\245q\222DO+\353\321\236\335he1T\266\242#+\021d\037T\226\241-\233\340\311\013\025\0208\217\215\017\373T\317\016\375\0266\036Z\247\240@\322\001\036\020\353\002\003\022\032\222\216\267QPA$(\267\016\020\023\023\2416\024@\374y\350\326\t&wTX\022\\\006\304.[0\365\202h0\210\272\2032\351r\201\355\"\346%\323\"\266SYP\230\177p\316\205\025\200U\315\222R\300\301\265%\330\013{\254\274\374\3017?\352\236\246u]\303\350O\335nu\\r\251\n)\236*v\2104\265\221\300\321\267K\336\204\376\224\233\343\"\270\353\245w\370-\031\235\334\177\373\313\251;{;\305]~=\227\315.\017\335%\347\255&\220\2624S\310\305\037\316\336\236\250\340^\326\330\333\343\263\334\313\355\025\213Ei-\242\265\310\255\305\\\361\355\333\267\322\372\326\312S\332\350\355^i\246\336\257\371}\215\201H)R\232h\014\234)\315\224b\215\201O\367\347\367\267\033\203\243\245Xi\2451x\276\034)_-\257P\363Lcp\270t\272\274\335\034\034\256\017\363\203\203\373\217\367\013xf\220\037-\255\227/\370\263\376\212o\370^\005\203\307\313}\374Q\036-\377\340?\251|R\331\246\t\372KO\313\223e\2431|\256\264\215\001\303\027""\312\023\345Y\014x\344\247*+\207\252cD\003F\206d\241\241d4\006\206K}\245H\275\377\252?\363\373\340\007'?\333_\335/b\241q\377\\\205\311zV\2125\007\006\353\203\027\313\261\337\007>89\264\377\274\034\371\375\324\007'\277\250_\276W5\324fFJ7\3123\215\310Hs:\332\230\276_\233\250\315\360\204\215\201s\245\242\337\347\237\365\367*^\365^-\322\030\370\274\374g?\346\257\320\314\230\210\276\276'\222\230o\373}\264\375\331\322j\251P\216\225W\312F\331\361G\300\206U0a\276R\250.\324\"\265\211\306\330\371\362X\331\364g\374X\275\177\252>u\267\272\";\332)\255\021\227\206KC\345u\377B\205Y\374Y9\351O\013\263\250\365\"\37008D\303\277)%\260:\216d\264\274\322\344\201\206\320\342a\037gF\205\274K\276AO\236(\375X\336\366\373\375\245\312\317\330\301\340\320\376zi\254d\343p\022\225\321\312Fu\252\272]\353\257-\034\\\370\215\227\354\223\017L\360\242\374\0256:<ZZ(_\304\350de\202*\313\230\351\373\312?j\363\265mY\345s?\366\336A\365\363\323\0255\325e\177\273\322_\211\365\030\265\\\037\277U\211\275o\324w\2454\211\314\361\203p&\365\376?\327\"m\307\264TZ\221\307\211Q\365\301K8\037\323\277[9QY\341\372\027\345m\376\276,\214|Q\276]\211T\276\254\366U\307\252f\355\356A_\343&\246\253M\325\n\007\013\277E\0327!#\215\233,?X\254~\356fe\242r\267\332_\215Q\375%\216\240m\252g\244\025$\341\237\340\024\006@\360w\325$IXc\360l)\005*\222\376\004$\r\322\374C\371\021D\206N*\346\377T\375\260:A\232\367\035\232<\010\313\263\312\002HI\320\001\016\227\006\313\213xd\030\"]\376\321\337n\\\"Q\275t\253\362\244\332\327\270\364\025D\rM\323\225\365j$l\274Q\211\210\306\356B$\206\261W\377\024\016J\373\0225\3556D{\246\241E+I\254\250\335\341]\004\215t\036\274\205',\232\365aV\212\256\206w\261w\261\346\367\313\352\240i)\321\267\357\375m%PC\215\301\371\252\330\206w}\320\322\023\227@\371k\377^\345,H\355\237\360#\376\224_\300\006#\215\376+\340\006\235\312Fu\342\367\217?81\211\255/T\306*&\250!\215D\345le\247\272\002U>1\264\037\333_\241A\\h\364\237\336\337&=h\366\017J\235\277\302\201\315~\254^\037\275\006\242\244\247\331\317\226\243\311\317\3655""\373\207\366W\366\r\232n\004\346d\344\253\312L\263?B\245\333\225\355f\377Hi\242~\206\333\324\3444z\2135L\025!\375\035\2554\356\247\372\370,\230\032\224oW\266;\333y\311\377\225\271\324f\032D\350\273X\267\035\247\332\024\214\322\202\217\263\341\355\322a=\332\217\343\2313l\334\007\360\034\306.\226gX\264\006\260\370\377\254\215\311y\307&\367\024I\301\247\350]\360\307!\034\247\207\233l\357\274\022\333\233OJ\333\030\006\203<B$\227\346J\006l\330}r\035l\023\312'\312?\223\230TC\037\363\030\252\324\017\341b\307\362\331\276\201\211f\341\t\222\345+\020\252\r\210\317\274\230\005\262\225\357\351\006\341M1\rX\325\205\273\231'+ \216i\202\265\230-\352\267\225\217+FEl\024\226\216\221\r]\331O\362\256\241\007p\213Sxn0\302\033\376\354\203\223gx\037\211\3629\277\017\362tr\214\375\341y\177\322\267\240U\177\256\305\370\014\352\303\223\360l$p'\207\304\034\245\374\225`8\0308J\007\007=\232\2403#\321\355\237\204\241e^\253\271yLi\003\213\027\374\2169\305\316%\313\023\264\303)\261<\241\327$O\262\362\216\235\373\034\3660Y\372\025\016.\"\273^bsDtn\303\014<\251\235<\210\034L\004c7q\302sD\244\237\255~\r\363\205\005\311\321\216\300G\257\302\321E\344|vK\026\254\2138\221\322\010;C\007\376.\356\177\350_\205#t*#0\224}M\010\211\370\3513\345\307\345m\221\223A\020\370wF\030\342\343\024\271}\245\013e\226\252u\3107\276\326\3202Zz#.T\3448\301\362\355\300\031\276\3617q\264d\372\016\217\014\032~dS\337\361\330\217\376Ne\205\r`8*\360\026!m\365\323\023\376(oa\264\362S\255O\354p\214\276>f\231\235W\036\344R\300\336\371\375\377\"\343]\277:_}\nwA\326\257\331\336|\257\272Y\213\251\346\2634E\375s1\336\0355y\344\237\020\336\365\372\304\0146&\017\340\264A\331\260pm[\334<\255;r\246\031\260\216\300\001\004\276\331)3\300;\220\262\241Q\266\014\002\355\232\001\224RV\203\277\202u\227`\2130\373G\245o\312V\340oAAc\224\254\3612\273\251\321\317\313w\375\276&\213\326\317\342i\206\312\177\203z\016\217\326G\341\017*\327\252\312\375@P\233\214\003/\373ne\242\371\376y\377\344\203q\237\303v\304\232mh\224=\317\024\303\215\251\212[\275R\205""\007\372\375\313\017NN\370\344]\230%l]\206\232\000p\333\244\342\213\245\207\376\205\372W\261\203\263\007\2123\257Y(0\367}\234)\200\354\351}\027lzPv\261\342\360\331\372Yr\351t\030_\375\251\272[3\000+@\335\267\376G0p\243\344?O\370k\225>\354u\354\n\344z%h\333\300C3]m4n\254\262U\3535\366\256\002\0303\300_P\265\236O\032@\216\217\201\321N\324VjF8b\034\206q\203\221\303\370E\030\3261 \355\355\306E\215t\031\255\2049\331\241\022o\0000G\341\351\321\020k\\\273N\377Z\223|D\254\245\365\336\262\221\375\220\3067F\307:&\205\335\001\261Sl\203\307\245r\265\262\322\034'\370\261rx\256K\312`\367\234+p\357+\025\343?\235\353Q5\016\255\353\232O\013\231N`\206\315\313leUa\355+\265Xm\345\377\3362\230s\242>\361\000\266\345\342U\177\016(?\322\030\027\200\332\327\370\352\026\376\375GO\002\002\022\030kPd\024\375\177\364d/j\233\243\027\3127H\334\357\021\347\232\014b\373`\232#\227\t\003#\326#c\003\204V\371\276\352\301;\215^\361\243\344g\006\367\237\224\006\353\027\243\025\253\272\335\230\274^\277\376\227\332\316\001,\332\205\372\205;Uyh\322\377\256\222\252\256T\r2\002\377\200\217\003D\236b\032\353\343\327+C\325\225\346\360%\204\241\260O\227\312?\221\322\263U)\367\tl\031l\205nC\312k\207\256\013h\264\274C\366\023\026LEi\354\253\251.\303\212\202':\342\343E\330\235\335j\252\306v\367T\371:\231\3000\356}K\021\337q\017|R\332#0\302\017\020\336f\367E\210\344^\371\013X\331\345Z_\275\377\\\351\237\240\"r\225|\220\201\260\267\021\271X\376\016\270a\354,\r\036\017c\336]\tpT\004\365R\210\236\333\377\225\316Na7\302\026\315VQ\005_\214j\030\203\334D\270\177\252:Y\335:\210\004\260\344\246\037\223~\216\234\007\333\276\202\307\214V\244F_\322\274\\\356\223\002\002\252\260\320`\333>\243P\224\346\367u\215}Q\2460\002\2074\243\\d\375\254\204DA\355\333\332:Q\366i\375\323\317\331\203K{)\007\262\203A\210\225\327\311\253\221\207\270IpE\242\317H\375\202\304LAMb\246\216ZSj\345h\020\247R\3456\000\304J\327SC\237\035\267\262\242U\320\301\261C\203\334\314\2613I\017$c\2048\363'\226\215\010a\305\233\244h\002^\276fl{\212\225u\220\361H""\231di0\200\263\021\0326\316\000\016\310\304\017b\276\230 \340\013\334\374s\345\014L\300\317\265\221\332,ds\200\36293\345g\224>\361\323\004\250\t\323\2677Z\025\007\036\353\006\274a\254\366\343\301\366o}\210\264\3377\340\267\211\337\370\364\207\031\347\257C\037V\021/\3173J[i\234>\363o7\216\224\256\262\026\017\020\0262!\013\377 n\323.\241\323\365\261\353|\202\003\222\n\033#$\270B\231\0348\365\263\357b\301\346\333\224\005b\013E\364\374\0078\261s\032b\372\347\325 \033\001\026\215~p\362|\231#\232'\022\213\251\270\202Dl\262d\010\340b\2006\\:\t\334\366!yz\3771h\215\3004\316q4\362\207\273\372!xg8A\225`\260\000\201\271\004^\270\000\376\233\320\r\212\377\277\270\n\306\024P\371\250:\023R-\344\016\260\321\371k[\nL\005\224#a<4J\271/\352^`\034\315\342C1\033\013\212\317\030{E\246[\000\322\274\"\361\016\361\200B\251IE\325l\020\002.\262\021\203\245\215\224>\304`\242}\301?\2038\207rM\212u\337\371q\311\366a\260\244o&H\\\003\032\336 lY\257\234\027x\277.\361\004\215\235/q\032q\275<\316t\261\271\235,\247\331\031\003\356\315\227v@\361Y\252\320\341r\276e\r\020\360\0364iX\214\357\032\230|\205b.\0324\016J\036\253\234\037\021\017\025_,?\304\340\321\363\034&QFp\273\253r\221\271B\333\211W>\202\367\212Q\323\023,B\020\316e,\000_\371I\371_\220\321q\366y\020\275\037Y\017&\252\363\360i\004\010\004\025\254W\316\341\360\026\341\374\306/\323&\032\343\224\255\031\376\\8\321J\267B\273\357Q\330O\373\035`\271\003\241\317\3605t\206\302\357C\315\354wv%\236\244@\376k_y\225\241\036\354~\306y\000e\006\206\020Z\377\354\253\364\333\337H\320\024n\317T9\360~IqC\020\363\376\r\336\337\220I\276\253\237\375\322\017rk\224\261\351hk\225\226\352cS\"\210\213\3653\234\211\352\010\332z\270\222P\240\224\307\021\311\352\341\212Z\2227 \375\205\362S\234\364\023\021\263%\025\320\377Z=Q]\257\215\325\222\007S\007ms\275\245\374mE%^n\210\264- \032\376\232\212\234&\220\363X\226\224\373h\351\027\322\n9\226G\034\250Q\234A\341K\207=\331-\007\3568\014\206>W\314\036P^\257c\177\252\376\\\305\350\333\365~\230\257\216\241<\271\3304\n:C\367!I""\231\001\322\271N*\233\301\372-\212\316Qj\227\362=M\236i\r\302\352@\240\037\343\330\306\3166\306Xf\233\0034'F\277c\327}\304\254-\273\3116\263O\315z\016jH\006e\210\246\177\303\251\204/+\037\222\362\217\221W\344\204\243\254\374\021\307\213\264*\376\021\256\006\241\021\316B\254\220\231rJ\347T\302\202\021#\274\323#\204!\2211\316\241l\373\237\260+X\257\362CgH\2169\326V`\213\000\025\307\236\003\237\355o2!\330L\263\305\3456\035 Cv\321_i\016\234T\351\257\013\000qS*\310\005H\031\340\000\210\240\303\340\204?\316!\0360\300\273\326\375D[Q\034\340=D\010\024\353zP\371\342A\377A\354\260\255\023\331\013\271\230,_E|x\225\357\036fz6\235c\233\374\035\346\275Y}\202X\0040{I0D/3\252\016].\030\006\317\260\272\265v/\336\217\014=\241\340a\200\353\257X\001\006)f\356\343\273\233\372\331\373\024\302p\271d4\225\213B\270\372\256\335m*?(@i\332\337n[<R\032\203l\354p\336\236\3639t\016O m\036%\035\333\205\370\364~\201\325\210\234\t\215\025\363\254\232\2034\0070\317Y\034\372\307\360yO\3111\360\004\202N\301\205\013\325Y(\3668\202\362\311\003\243\215\302\3670\255\331\302\376aRH\334=A\321\253\240}\213|1$\243\001\216=*'\375[\22589\331*D\351\013@\216{d\327\033\324M\010\340~\371\215x\026\342\307\230\334\004\220\377\240\215e*W \276q\030\240\327\204\207\232d\n(\261sY\256\024\202\254\t\to\375\374\315\312d\305\220\314K\244q\236l\346\371\013\370G\343#\222\250e\200O)\247\231\226a\r ^\204Gs^\2132N#\245Q\356\366\r\332\356\267A0\240\000\313iv\025\223\254\246b/\207\317RN\020:\331\204_J@\340\201\267\232\320\211\257\330'S\222\200a\351\006\247\\\303\255nK\026D\334k\\n\004p(\010\323\032C\027$K\330\261f\032\273\226\241\014\265\377\350\232my\025\nG\223\212\313A\310~\242\266q0q0{\260r\020gx\332\223\2248X\"IQB\211\275I\031/\237D\357\033L\335\327A\n\035\356\025H\006\335MQ~\351\017/p\324^I,\036\341tT\246\241\331\272\373D\310<A&m\214\365`\222\245\210\223\274$\360F\223S\372gJ\217K.\013\262\311\320r\233S\343nu\242\r\356\215\226\276\227\024\360i\025\0303p\332\360\257S\016\251q\211|\367\245k\234\215\032\036W\031`\027fi\243r\275z""\265\312B'\020\374\356\037\275W>\305\231\374\277\223\314\323\331.\201\177\243t\351j\260\025\017\026\260\375\225V\021*,&\224\356\217\377I\240\347\034\337\352\275\343\274\261\244\252/\260\305\243{\275\214 O\202/\204\261\347|\023\326\356\021]RQ\246\256\331}\375\305\037g\304\244\006\366\022\200My=r\210\357\271\214Vh\212r\313\353\365\211\257k\237\324(\211\311wm*uL\300\",\210\221\2125[\227\220\034\032\007\331i\376\376R\260\326XI\367\3333\026\203\345\347\022EJj\342\2312\206s nP\354\316\257\025\306\372\323l\330@\325\347\202)\351\364\311>;\024ZH\332>\302\001\201\272-\331d\363jH\305@\304\3601\007\005}\207\032\210*\230\277\313e\313\377\007;\305\217)#\261\315\351\242'\264\tA\341\004\203W\232\352zU\276\350\311s\355#[\333\344l\210\320o\310 A+\365\261/)\214\240\203\277\"\241\t\367\221\367\275\314\361\021\351\327\345\353\330\362\345(T\225B\243\313_4\202\364\017i\007%\215\347E\250NS\322Y\230\202h\224=\244\277X\231\241\311F\332A\010\224\004\032\374!{\032\272\204\037\201$\377O@\210Z\260\364M\375\362\034$p\371@\221\266\253\302.\272U\336\203\276\314\002t\244\253II$\006C\210\220\253\034\t\377\211M]\242\332~i\036kJF\353l\3406'E/\233\312\207\316\312\275\001\355\212o\016NR\202`H\211\002\223*\027i\242\275-;\364'\230\352\230\274\341\001\017)h\0273J\316F\236v\313\023\341c#\024\024\227\266[\317s\216\216\236\276\013\007N\036\222\236\226|W\037\016\363\304\247\3737\331PM\324\373\201N\177\277\254\240QS\024\214\302v\272Wk\206%Z\370,\366B\230a\"4\017\002\nHA\306$\001\250\220%\377\023!h\214\237\247\177\355\225\367\316u\003qZ\337\277?\327\005y\355\206\004\367<%\214n\222\361\271\314\336\352\013\215\377Ea\347z\264|Z\377\024\"X\237\234'\243\244\314J9\026\346\330$\234\200\242\212\206\375q\214M\002~AQ\326\014\3253\322J\017\255\264\025\233\201\366\321\005V_\263\377\004\257\2404\224\305\214\316d\200\257\351?y\347\355\177\303\007\017q\317\220<\014Q\343\356~\212\236\370l\377WR\211y\370\345dm\212.hFJ\327\030\335\257\003-\3235\240N\267*\215\376S\373\323\245\277\303L\377\005\000b\246\321O\031LLP\312\3707+\261z?""\263\252\007\266L\362\315)\307 \342y{\207K\355/H\311-\232\362T?\224\027\331\205\363\273\013\315#\207\310\353\r\233\325\230\010\356\307\301\276xj\030\227\360.\224\313\344I\206\"A\360~d\271\311\227m|'\013\353Z\377\214s\356\352\r/b\377)\0028\365\311\273\200\270\221\300f\362\225{\375\332\327\265\376\332\022\340\215A\257:Q\202>\370\222\364}\020 \016\225\205\005\245\177\301?\214\303f\234\343\224\266\032\304_\373}A>K\220\270AWk\376\327\234\207\362\304S\326\006\016>:\2309\220\310ApE\220-\352\353LQ\361O)\\\r~\324g\346\356\035\371\245\245\333\267\265\326/\220\361\017\236-\254is\321;\364\263?\374\003\031\364\013^\334>\027\235\273\303\277\373P\240V\372\355\232\037\314\370\3422\375PC4\230\212\007\362O\314%\214\254)?F\245~Nh.:\253~\006\312\312\321\3179\314k\301\353\311\337H\363\216M\277\357fX\271\353\362\203\020\177\017\177\374!\225\321_\251\261\332\267\255\307x\305\234=m\347y\344?O\265~\206\364\360>\355\202'\253\242\240?u\214\024\377\177\362\357]\272c4\026\247)\256\363\357S\334\t?P\275\361\215\"\201\177\346\352\277\001ns>\272";
    PyObject *data = __Pyx_DecompressString(cstring, 9373, 1);
    if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error)
    const char* const bytes = __Pyx_PyBytes_AsString(data);
    #if !CYTHON_ASSUME_SAFE_MACROS
    if (likely(bytes)); else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) }
    #endif
    #else /* compression: none (22354 bytes) */
const char* const bytes = ": 3_2\n    A hyperbolic polyhedron for display in OpenGL, either in the Klein\n    model or the Poincare model.  Includes a representation of the\n    sphere at infinity.  It is initialized with the SnapPea description\n    of the faces of a Dirichlet domain, represented as a list of\n    dictionaries.\n    \n    A triangle which can tessellate itself.\n    \n    A version of the widget that uses orthographic projection instead\n    of perspective.\n    \n    A widget which renders a collection of OpenGL objects in perspective,\n    using a GLSL vertex shader to compute the projection.\n    \n    An image shader is a GLSL program that does all of its computation in\n    the fragment shader.\n\n    This widget displays an image generated by an image\n    shader. The draw method simply draws a triangle covering the\n    entire screen, which causes the fragment shader to be run on\n    every pixel in the window. The fragment shader source and -\n    optionally - sizes and offsets for uniform buffer blocks can\n    be set with set_fragment_shader_source.\n\n    The uniform vec2 viewportSize contains the view port size.\n    <B1-Motion><B2-Motion><B3-Motion>Buffer view does not expose strides<ButtonRelease-1><ButtonRelease-3><Button-1><Button-2><Button-3>Can only create a buffer that is contiguous in memory.Cannot assign to read-only memoryviewCannot create writable memory view from read-only memoryviewCannot index with type 'Cannot transpose memoryview with indirect dimensionsCompiling <Control-Button-1><Control-Button-1><ButtonRelease-1>\n    Create an OpenGL widget with a perspective view and mouse behaviors\n    to rotate/translate the displayed scene.\n\n    Subclasses are expected to implement redrawImpl to draw the scene\n    and can expect the projection and view matrix to be set.\n\n    Original author:\n    Mike Hartshorn\n    Department of Chemistry\n    University of York, UK\n    http://www.yorvic.york.ac.uk/~mjh/\n    Data for Dimension %d is not directEmpt""y shape tuple for cython.arrayError GLSLProgram.__init__     GLSL:  1.50            %sGL_ENUM 0x%xGL strings not available - is there a current OpenGL context?Incomplete framebufferIndirect dimensions not supportedInvalid GL string. Must be one of %s.Invalid mode, expected 'c' or 'fortran', got Invalid shape in axis <KeyPress>Length of rgba_data not matchingLinking GLSL program '%s' failed.<MemoryView of Missing gl function: Most likely causes:No help is available.Note that Cython is deliberately stricter than PEP-484 and rejects subclasses of builtin types. If you need to pass subclasses then set the 'annotation_typing' directive to False.   OpenGL:  3.2             %sOut of bounds on buffer access (axis Render to off-screen area   Required version      Your version<Shift-B1-Motion><Shift-Button-1>Sorry, this implementation was removed * The triangulation has too many tetrahedraUnable to convert item to objectUniformBufferObject.__init__Unsupported uniform type Unsupported uniform type %sViewer HelpWarning could not read texture %s\n    Widget with an OpenGL context and some Tkinter bindings\n    to redraw when the widget is exposed or resized.\n    Subclasses are expected to implement redraw.\n\n    Original authors:\n    Tom Schwaller,\n\n    Mike Hartshorn\n    Department of Chemistry\n    University of York, UK\n    http://www.yorvic.york.ac.uk/~mjh/\n     * Your graphics card does not support the required OpenGL version.. Your graphics card probably does not support the required OpenGL version (2.1). Your OpenGL version is . Your graphics card probably does not support the required OpenGL version (3.2 or later). Your OpenGL version is ?.>'), <  >add_note and  at 0x at offset collections.abc<contiguous and direct><contiguous and indirect>disableenable failed.fallback image shaderfloat[] for uniform gc   (given the number of uniforms your graphics card supports). (got got differing extents in dimension image shader in  in uniform block.infowindowint[]isenabledit""emsize <= 0 for cython.arraymat2[]mat2x3[]mat3x2[]mat4[]no default __reduce__ due to non-trivial __cinit__ not fitting into uniform buffer object of size  object> of length opengl/common/error.pyxopengl/common/string.pyxopengl/legacy/edge_set.pyxopengl/legacy/horoball_group.pyxopengl/legacy/horoball_scene.pyxopengl/legacy/hyperbolic_polyhedron.pyxopengl/legacy/klein_polygon.pyxopengl/legacy/label.pyxopengl/legacy/label_set.pyxopengl/legacy/lighting.pyxopengl/legacy/meshed_surface.pyxopengl/legacy/object.pyxopengl/legacy/orthoWidget.pyxopengl/legacy/parallelogram.pyxopengl/legacy/perspectiveWidget.pyxopengl/legacy/poincare_polygon.pyxopengl/legacy/raw_openGL_widget.pyxopengl/legacy/triangle_mesh.pyxopengl/legacy/wireframe_sphere.pyxopengl/modern/data_based_texture.pyxopengl/modern/glsl_perspective_view.pyxopengl/modern/glsl_perspective_widget.pyxopengl/modern/glsl_program.pyxopengl/modern/image_based_texture.pyxopengl/modern/simple_image_shader_widget.pyxopengl/modern/triangle.pyxopengl/modern/uniform_buffer_object.pyxopengl/modern/vertex_buffer.pyxopengl/vector3.pyx'%s' shader <strided and direct><strided and direct or indirect><strided and indirect>unable to allocate array data.unable to allocate shape and strides.uniform blocksvec2[]vec3[]vec4[]\n        >>> vector3( (0, 1, 2) )\n        < 0.0, 1.0, 2.0 >\n        vector3.__repr__ (line 14)ASCIIBColorizerCyOpenGLDataBasedTextureDataBasedTexture.bindDataBasedTexture.delete_resourceDataBasedTexture.unbindEdgeSetEdgeSet.drawEllipsisFordEdgeSetFord_domainFord_varGLCanvasGLSLPerspectiveViewGLSLPerspectiveView.get_uniform_bindingsGLSLPerspectiveView.rotateGLSLPerspectiveView.translateGLSLPerspectiveWidgetGLSLPerspectiveWidget.__init__GLSLPerspectiveWidget.add_objectGLSLPerspectiveWidget.redrawGLSLProgramGLSLProgram._compile_and_linkGLSLProgram.bind_uniformsGLSLProgram.delete_resourceGLSLProgram.is_validGLSLProgram.use_programGL_EXTENSIONSGL_INVALID_ENUMGL_INVALID_FRAMEBUFFER_OPERATIONGL_INVALID_OPERATIONGL_INVALID_VALUE""GL_RENDERERGL_SHADING_LANGUAGE_VERSIONGL_VENDORGL_VERSIONGLobjectGLobject.build_display_listGLobject.delete_resourceGLobject.displayGLobject.drawGetColorHoroballGroupHoroballGroup.drawHoroballSceneHoroballScene.build_sceneHoroballScene.delete_resourceHoroballScene.drawHoroballScene.flipHoroballScene.set_cutoffHoroballScene.translateHorosphereHyperbolicPolyhedronHyperbolicPolyhedron.__init__HyperbolicPolyhedron.drawImageBasedTextureImageBasedTexture.__init__InfoWindowKleinKleinPolygonKleinPolygon.drawKlein_facesLLabelLabelSetLabelSet.drawLabel.drawMMVPMatrixM_maxM_minMeshedSurfaceMeshedSurface.build_arraysMeshedSurface.drawModelViewMatrixNNVNVsizeN_maxN_minOpenGLOrthoWidgetOpenGLOrthoWidget.build_projectionOpenGLOrthoWidget.tkTranslateOpenGLPerspectiveWidgetOpenGLPerspectiveWidget.StartRotateOpenGLPerspectiveWidget.__init__OpenGLPerspectiveWidget.build_projectionOpenGLPerspectiveWidget.do_AutoSpinOpenGLPerspectiveWidget.draw_implOpenGLPerspectiveWidget.draw_projection_implOpenGLPerspectiveWidget.helpOpenGLPerspectiveWidget.mouse_updateOpenGLPerspectiveWidget.resetOpenGLPerspectiveWidget.set_backgroundOpenGLPerspectiveWidget.set_centerpointOpenGLPerspectiveWidget.set_eyepointOpenGLPerspectiveWidget.tkAutoSpinOpenGLPerspectiveWidget.tkHandlePickOpenGLPerspectiveWidget.tkKeyPressOpenGLPerspectiveWidget.tkPrintOpenGLPerspectiveWidget.tkRecordMouseOpenGLPerspectiveWidget.tkRotateOpenGLPerspectiveWidget.tkScaleOpenGLPerspectiveWidget.tkTranslateOpenGLPerspectiveWidget.zoomP1P2ParallelogramParallelogram.drawPoincarePoincarePolygonPoincarePolygon.drawPoincareTrianglePoincare_facesProjectionMatrix__Pyx_PyDict_NextRefRRawOpenGLWidgetRawOpenGLWidget.__init__RawOpenGLWidget.drawRawOpenGLWidget.make_currentRawOpenGLWidget.redrawRawOpenGLWidget.save_image_window_resolutionReaderS_infinitySequenceSimpleImageShaderWidgetSimpleImageShaderWidget.__init__SimpleImageShaderWidget.drawSimpleImageShaderWidget.draw_implSimpleImageShaderWidget.get_uniform_bindingsSimpleImageShaderWidget.read""_depth_valueSimpleImageShaderWidget.render_to_arraySimpleImageShaderWidget.save_imageSimpleImageShaderWidget.set_fragment_shader_sourceSimpleImageShaderWidget.set_texturesStartRotateTTriangleTriangleMeshTriangleMesh.__getitem__TriangleMesh.__init__TriangleMesh.__repr__TriangleMesh.subdivideTriangle.delete_resourceTriangle.drawTriangle.get_uniform_bindingsTriangulationEdgeSetTsizeUniformBufferObjectUniformBufferObject.bind_blockUniformBufferObject.commitUniformBufferObject.delete_resourceUniformBufferObject.setVVertexBufferVertexBuffer.bindVertexBuffer.delete_resourceVertexBuffer.loadView.MemoryViewWireframeSphereWireframeSphere.drawWriterXangleYangleabcadd_objectafterallocate_bufferalphaambient__annotate__appendargsarray_typeasRGBA8as_floatasciiaspectasyncio.coroutinesautospinautospin_allowedbb_backback_shininessback_specularbasebindbind_blockbind_uniformsbinding_pointbitdepthblock_indexblock_nameblock_sizeboolboolean_valuebuffer_objectbuffer_sizebuild_arraysbuild_display_listbuild_projectionbuild_scenebuild_scene.<locals>.genexprcc_arrayceilcenter__class____class_getitem__clear_gl_errorscline_in_tracebackcloseclosestcnfcolorcolor_texturecolor_texture_typecolorsyscommit_compile_and_linkconfigconjugatecoscountcurrent_widgetcursorcutoffcyglSetStandardLightingddarkdarwindatadelete_resourcedelta_tdepthdepth_texture__dict__dictdispdisplaydistance__div__do_AutoSpin__doc__dphidrawdraw_impldraw.<locals>.draw_pointdraw_pointdraw_projection_impldthetadtype_is_objecteencodeendpointsenumerateerrerroreventffaceface_specularfacedictsfarfbofileflagsfleurflipflippedfloatfloat_arrayfloatsfloorformatfortranfovyfragmentfragment_shader_sourcefront_shininessfront_specularfull_list__func__gg_backgenexprgetget_gl_stringget_uniform_bindingsget_uniform_bindings.<locals>.to_py__getitem____getstate__glBindVertexArrayglCompileShaderglEnableVertexAttribArrayglGenBuffersglGenVertexArraysglLinkProgramglVertexAttribPointergl_string_enumsgl_widgetglyphgreyscalehhandheighthelphelp_texthls_to_rgbhoro""_varhoroballshueiidimagimage_shader__import__include_depth_valueindexindicesinfoinfowindow__init__initialised_initializedintint_arrayint_labelintegers_is_coroutineis_validitemsitemsizeivec2jkkeykey_actionkeyskeysymkwkwargsllabellabel_heightlabel_varlabelslightdiffuselightnesslightposition0lightposition1lightspecularlist_idloadloclongitudem__main__make_currentmastermat4mathmemviewmeridian__metaclass__missing_gl_functionmodemodelmodel_var__module__mouse_pickmouse_rotatemouse_scalemouse_translatemouse_update__mro_entries__msgnname__name__name_partsname_to_offsetname_to_type_and_valuenbhdndimnear__new__new_trianglesnextnormnorm_squarednum_bytesnum_cuspsobjobjXobjYobjZobjectobjectsoffsetold_widgetoriginal_indexosoutfileppackparentpgram_varphipipickplatformpngpopposition__prepare__printprint_gl_errorsprofileprogramproj__pyx_checksum__pyx_state__pyx_type__pyx_unpickle_Enum__pyx_vtable____qualname__rr_backradiusrandomread_depth_valuerealredraw__reduce____reduce_cython____reduce_ex__registerrender_to_arrayreport_gl_errorsreport_time_callback__repr__resetrgba_datarightrootrotateroundrowrowss1s2saturationsave_imagesave_image_window_resolutionscalarscalesegmentsselfsendsetset_backgroundset_centerpointset_cutoffset_eyepointset_fragment_shader_source__set_name__set_texturessetdefault__setstate____setstate_cython__shapeshiftssinsizeskip_swap_buffersslicessourcespheresphere_varsplitsqrtstacksstartstart_timestepstopstrstridestringstructsubdividesubdivision_depthsumsuperswap_bufferssysttan__test__texturetexture_filetexture_filestexturesthetathrowtimetkAutoSpintkHandlePicktkKeyPresstkPrinttkRecordMousetkRotatetkScaletkTranslatetkinter_gltmouseto_pytogl_widgettoptranslatetranslationstri_vartriangletrianglestriangulationtripleunbindundefineduniformuniform_blockuniform_block_names_sizes_and_offsetsuniform_nameuniform_typeunnamedunpackupdateupdate_idletasksuse_materialuse_programuxvaluevaluesvec2vector3vector3.__div__vertex_vertex_buffervertex_datavertex_shader_sourceverticesvertsviewview""_heightview_widthviewer_helpviewportSizevxvywwhich_cuspwidthwinfo_heightwinfo_widthwritewriterxxcenterxmaxxmousexnxyyycenterymaxymouseynyzzzcenterzipzoomzx\2201\320\004 \240\001\330\010\021\220\021\220!\330\010\023\2201\220A\330\010\013\2104\210q\330\014\024\220A\220Q\330\014\031\230\021\230#\230Q\330\010\013\2101\330\014\020\220\017\230q\340\014\020\320\020 \240\001\330\010\014\210C\210u\220A\330\014\023\2201\220A\220T\230\032\2402\240Q\240a\240t\2501\330\014\030\230\001\330\014\030\230\001\230\024\230W\240D\250\007\250q\330\014\020\220\004\220F\230$\230a\330\020\027\220q\230\001\330\020\032\230!\2302\230W\240B\240g\250Q\330\020\032\230!\2302\230W\240B\240g\250Q\330\020\025\220Q\330\014\027\220q\330\010\013\2104\210q\330\014\025\220Q\220a\330\010\020\220\001\220\021\320\004#\2401\360\014\000\t\016\210R\210y\230\001\230\030\240\027\250\001\330\010\014\210H\220A\340\010\014\320\014\034\230A\360\010\000\t\r\210M\230\021\360\n\000\t\037\320\0366\260a\330\010\013\2101\330\014\022\220)\2301\330\021\022\340-.\330-:\270!\2701\320\004#\2401\330\010\027\220y\240\001\240\026\240x\250t\2606\270\021\330\010\033\2309\240A\240Q\330\010\014\210M\230\021\330\010\014\210K\220q\330\010\021\220\021\220!\210\001\330\014\023\2202\220R\220u\230A\230Q\230a\230r\240\022\2402\240R\240t\2504\250u\260E\270\021\270!\330\025\031\230\025\230e\2401\240A\320\004%\320%5\260Q\330\010\013\2104\210v\220S\230\001\330\014\020\220\r\230T\240\032\2501\330\014\020\220\016\230d\240-\250q\330\014\020\220\r\230T\240\034\250Q\330\014\r\330\010\013\210;\220c\230\021\330\014\031\230\024\230Q\340\014\020\220\016\230a\330\010\014\210K\220t\2301\330\023\024\330\010\014\210M\230\035\240a\330\014\020\220\005\220Z\230q\240\004\240I\250\\\270\021\330\014\r\210T\220\025\220o\240Q\240c\250\024\250U\260%\260q\270\004\270E\300\032\3101\330\014\020\220\001\330\014\020\220\001\330\010\014\210N\230+\240Q\330\020\024\220E\230\034\240Q\240d\250!\330\020\024\220L\240\004\240K\250|\2704\270q\330\010\014\210M\230\033\240A\330\020""\024\220E\230\034\240Q\240d\250!\330\020\024\220L\240\004\240K\250|\2704\270q\330\010\014\210M\320\031-\250Q\330\020\024\220E\230\036\240q\250\004\250A\330\020\024\220L\240\004\240K\250|\2704\270q\330\010\014\210L\320\030,\250A\330\020\024\220E\230\036\240q\250\004\250A\330\020\024\220L\240\004\240K\250|\2704\270q\330\010\014\210J\220h\230a\330\020\024\220E\230\036\240q\250\004\250A\330\020\024\220L\240\004\240K\250|\2704\270q\330\010\014\210K\220q\320\0049\270\021\330\010\014\210M\230\021\330\010\014\210I\220Q\330\010\014\210J\220a\330\010\014\320\014\035\230Q\230e\2405\250\005\250Q\330\010\014\320\014\037\230q\330\010\014\320\014\036\230a\330\010\014\210N\230/\250\021\250&\260\001\260\025\260e\2705\300\001\330*9\270\021\270%\270u\300E\310\021\330*:\270!\330*6\260a\330\010\014\210K\320\027*\250!\2505\260\004\260A\330\010\014\210O\2301\330\010\014\320\014\036\230a\330\010\014\210H\220A\330\014\027\220q\230\007\230q\240\010\250\004\250J\260d\270!\2701\330\014\026\220g\230Q\230d\240!\2401\330\014\025\220W\230B\230a\230q\240\004\240A\240[\260\002\260!\330\014\024\220J\230a\230t\2401\240H\250E\260\025\260c\270\021\330\014\020\220\014\230G\2401\330\020\034\230A\230Z\240q\330\035#\2401\330\035,\250D\260\001\330\035+\2504\250q\330\035-\250T\260\021\330\035,\250D\260\001\330\035)\250\021\330\014\020\220\017\230w\240a\330\020\037\230q\240\n\250!\330 &\240a\330 /\250t\2601\330 .\250d\260!\330 0\260\004\260A\330 /\250t\2601\330 ,\250A\330\010\014\210H\220D\230\001\330\014\020\320\020#\2401\330\010\014\210H\220D\230\001\330\014\020\320\020#\2401\200A\200A\340KL\330\010\014\210M\320\031)\250\021\330\010\014\320\014\034\230K\240q\330\014\020\220\001\330\014\r\330\0144\260A\330\014\023\2201\200\001\360\014\000\005\035\230A\230V\2406\250\026\250q\330\004!\240\021\240%\240u\250E\260\021\330\004\"\240!\2405\250\005\250U\260!\360\006\000\005$\2401\240E\250\025\250e\2601\330\004#\2401\240E\250\026\250v\260Q\360\010\000\005\r\210A\210Q\360\006\000\005\r\210A\210Q\330\004\017\210q\220""\016\230a\340\004\014\210A\210Q\330\004\014\210A\210Q\360\010\000\005\r\210A\210Q\340\004\023\2201\320\024'\240q\330\004\014\210A\210Q\340\004\020\220\001\220\021\340\004\017\210q\220\001\340\004\r\210Q\210a\360\006\000\005\022\220\021\320\022+\2501\340\004\021\220\021\320\022/\250q\340\004\022\220!\320\023+\2501\340\004\014\210A\210Q\330\004\r\210Q\210k\230\035\240a\330\004\r\210Q\210k\230\034\240Q\330\004\r\210Q\210k\230\035\240a\330\004\014\210A\210[\320\0302\260!\330\004\014\210A\210[\320\030/\250q\330\004\014\210A\210[\320\0302\260!\330\004\r\210Q\210a\330\004\r\210Q\210k\230\035\240a\330\004\r\210Q\210k\230\034\240Q\330\004\r\210Q\210k\230\035\240a\330\004\014\210A\210[\320\0302\260!\330\004\014\210A\210[\320\030/\250q\330\004\014\210A\210[\320\0302\260!\340\004\020\220\001\220\021\330\004\022\220!\200A\330\010\021\220\021\220!\330\010\023\2201\220A\330\010\021\220\021\220%\220u\230E\240\021\330\010\017\210q\220\001\330\010\014\210B\210b\220\001\220\023\220A\220Q\330\010\022\220!\2201\220G\2301\230G\2401\330\010\r\210Q\330\010\022\220!\2201\220G\2301\230G\2401\330\010\r\210Q\330\010\022\220!\2201\220G\2301\230G\2401\330\010\r\210Q\330\010\022\220!\2201\220G\2301\230G\2401\330\010\r\210Q\330\010\020\220\001\220\021\200A\360\010\000\t\n\330\014\020\220\013\2301\230E\240\030\250\021\330\017\020\340\010\013\2104\210t\2201\330\014\020\220\007\220q\200A\360\n\000\t\022\220\021\220!\2203\220a\220t\230:\240Q\240a\330\010\014\210L\230\005\230\\\250\026\250q\260\001\330\010\014\210C\210u\220C\220q\230\004\230K\240t\2501\330\014\016\210a\210t\2202\220Q\220d\230\"\230A\230U\240!\2404\240q\250\004\250A\250Q\330\014\016\210a\210t\2202\220Q\220d\230\"\230A\230U\240!\2404\240q\250\004\250A\250Q\330\014\022\220!\340\010\014\210I\220Q\220a\220s\230!\2304\230q\330\010\020\220\004\220F\230!\2301\330\010\014\210K\220t\230=\250\006\250a\250q\330\010\014\210L\230\004\230A\330\014\r\210Q\210d\220!\2201\220D\230\001\230\021\230%\230q\330\014\021\220\021\200A\360\016\000\t\023\220!""\2203\220c\230\027\240\001\360\006\000\t\025\220A\220T\230\031\240$\240i\250t\2609\270A\330\010\017\210q\320\020$\240B\240a\360\006\000\t\r\320\014\035\230Q\230g\240Q\360\006\000\t\025\220A\220Q\330\010\024\220A\330\010\014\320\014!\240\021\330\010\023\2201\320\004$\240A\330\010\022\220!\2203\220c\230\027\240\001\330\010\024\220A\220U\230%\230u\240A\330\010\017\210q\320\020$\240B\240a\330\010\014\210J\220d\230!\330\014\022\220%\220q\230\007\230q\330\010\013\2104\210q\330\014\020\220\r\230Q\200A\330\010\013\2103\210d\220$\220j\240\001\240\021\330\010\020\220\004\220I\230Q\230d\240$\240i\250q\260\004\260D\270\t\300\021\300!\200A\330\010\013\2103\210f\220G\2303\230g\240Q\240m\2608\2701\330\010\017\210y\230\001\230\022\2302\230R\230r\240\021\330\010\014\210C\210w\220i\230q\240\001\330\014\020\220\001\220\022\2202\220R\220r\230\025\230b\240\002\240#\240R\240r\250\022\2505\260\001\340\010\r\210R\210y\230\001\230\023\230C\230q\200A\360\010\000\t\014\2104\210{\230#\230Q\330\014\r\330\010\013\2104\210q\330\014\020\220\001\220\032\2301\330\010\r\210T\220\021\330\010\r\210S\220\001\220\024\220Y\230e\2401\240A\330\010\014\210B\210c\220\021\220%\220r\230\024\230Y\240f\250A\250T\260\021\330\010\r\210S\220\001\220\024\220Y\230e\2401\240A\330\010\r\210S\220\001\220\024\220Z\230q\330\010\014\210B\210c\220\021\220%\220r\230\024\230Z\240v\250Q\250d\260!\330\010\r\210S\220\001\220\024\220Q\330\010\014\210J\220a\200A\360\010\000\t\014\2104\320\017!\240\024\240R\240r\250\024\250[\270\001\330\014\020\220\014\230A\330\014\020\220\006\220a\220t\2304\230q\330\010\014\320\014\035\230Q\200A\330\010\013\2104\210\177\230a\230t\320#4\260F\270!\330\014\023\2201\340\010\013\2104\210\177\230a\230t\320#6\260f\270A\330\014\023\2201\340\010\026\220a\220t\320\033+\2504\250q\330\010\026\220a\220t\320\033+\2504\250q\340\010\013\2104\210}\230A\230T\320!1\260\021\330\014\023\2201\340\010\017\210q\200A\360\020\000\t\014\2104\210q\330\014\020\220\005\220Q\200A\330\022\023\340\010\013\2104\210q\330\014\031""\230\024\230U\240!\340\010\022\220!\2203\220c\230\027\240\001\330\010\013\2101\360\006\000\r\024\2201\220A\330\014\024\220A\220Q\340\014\025\220Q\220a\330\010\021\220\021\220!\330\010\021\220\021\220!\340\010\013\2104\210}\230I\240Q\330\014\020\220\003\220;\230i\240q\250\004\250A\330\020\023\2201\330\024#\2401\240L\260\002\260!\330\024\033\2305\240\001\340\014\020\220\r\230\\\250\021\330\014\020\220\r\230^\2501\330\020\024\320\024)\250\021\250'\260\021\330\014\020\220\017\230u\240A\340\014\030\230\001\230\036\240s\250!\340\014\020\220\003\220;\230i\240q\250\004\250A\330\020\023\2201\330\024#\2401\240L\260\002\260!\330\024\033\2307\240!\330\014\033\2301\230A\340\010\013\2104\210q\330\014\024\220A\330\014\020\320\020%\240Q\240d\250%\250s\260\"\260A\200A\360&\000\t!\240\001\360\014\000\t\014\2104\210t\2201\330\014\r\340\010\027\220q\340\010\014\210G\220>\240\032\320+A\300\026\300q\330\014\031\230\024\230V\2401\240A\330\014\033\230:\240R\240q\340\014\017\210s\220!\220<\230s\240!\330\020\026\320\026*\250!\2504\250q\330+7\260w\270a\270q\330\020\023\220=\240\003\2401\330\024\037\230q\240\005\240S\250\001\250\021\330\025\"\240#\240Q\330\024\037\230q\240\005\240U\250!\2501\330\025\"\240#\240Q\330\024\037\230q\240\005\240S\250\001\250\025\250k\270\021\330\025\"\240#\240Q\330\024\037\230q\240\005\240U\250!\2505\260\001\260\025\260e\2701\270E\300\021\300!\330\025\"\240#\240Q\330\024\037\230q\240\005\240S\250\001\250\025\250a\250u\260C\260q\270\005\270Q\270a\330\025\"\240#\240Q\330\024\030\230\005\230U\240!\2401\330\030\034\230E\240\025\240a\240q\330\034 \240\001\240\021\240!\2402\240R\240u\250E\260\021\260\"\260A\260Q\330\024&\240a\240u\250A\330'(\330'(\330\025\"\240#\240Q\330\024\030\230\003\2301\230A\330\024\037\230z\250\026\250q\260\002\260\"\260A\330\024\025\330\030\034\230E\240\025\240a\240q\330\034$\240A\240U\250%\250q\260\001\330\030$\240A\240U\250#\250Q\340\030\034\230A\230Q\330\025\"\240#\240Q\330\024\030\230\003\2301\230A\330\024\035\230\\\250\026\250q\260\002\260""\"\260A\330\024\025\330\030\034\230E\240\025\240a\240q\330\034\"\240!\2405\250\005\250Q\250a\330\030$\240A\240U\250#\250Q\340\030\034\230A\230Q\330\025\"\240#\240Q\330\024\030\230\003\2301\230A\330\024\035\230\\\250\026\250q\260\002\260\"\260B\260b\270\001\330\024\025\330\030\034\230E\240\025\240a\240q\330\034 \240\005\240U\250!\2501\330 &\240a\240r\250\022\2502\250R\250u\260E\270\021\270\"\270A\270Q\330\030$\240A\240U\250#\250Q\340\030\034\230A\230Q\330\025\"\240#\240Q\330\024\030\230\003\2301\230A\330\024\035\230\\\250\026\250q\260\002\260\"\260B\260b\270\001\330\024\025\330\030\034\230E\240\025\240a\240q\330\034 \240\005\240U\250!\2501\330 &\240a\240r\250\022\2502\250R\250u\260E\270\021\270\"\270A\270Q\330\030$\240A\240U\250#\250Q\340\030\034\230A\230Q\330\025\"\240#\240Q\330\024\030\230\003\2301\230A\330\024\035\230\\\250\026\250q\260\002\260\"\260B\260b\270\001\330\024\025\330\030\034\230E\240\025\240a\240q\330\034 \240\005\240U\250!\2501\330 &\240a\240r\250\022\2502\250R\250u\260E\270\021\270\"\270A\270Q\330\030$\240A\240U\250#\250Q\340\030\034\230A\230Q\330\025\"\240#\240Q\330\024\030\230\003\2301\230A\330\024\025\330\030!\320!<\270A\330\034#\2403\240c\250\021\330\030*\250!\2505\260\001\330+,\330+,\340\030\034\230A\230Q\330\025\"\240#\240Q\330\024\030\230\003\2301\230A\330\024\025\330\030!\320!<\270A\330\034#\2403\240c\250\021\330\030,\250A\250U\260!\330-.\330-.\340\030\034\230A\230Q\330\025\"\240#\240Q\330\024\030\230\003\2301\230A\330\024\025\330\030!\320!<\270A\330\034#\2403\240c\250\021\330\030,\250A\250U\260!\330-.\330-.\340\030\034\230A\230Q\330\025\"\240#\240Q\330\024\030\230\003\2301\230A\330\024\025\330\030!\320!<\270A\330\034#\2403\240c\250\021\330\030*\250!\2505\260\001\330+,\330+,\340\030\034\230A\230Q\340\024\032\230)\2401\330\0306\260b\270\001\340\020\037\230q\240\001\360\010\000\021\036\230Z\240q\250\001\330\020\024\320\024+\2501\250K\260t\2701\330\024\"\240.\260\001\340\010\014\210D\220\014\320\034.\250i\260q\330$(\320(?\270v\300Q\330\014\032""\320\0320\260\001\330\020\024\320\024$\240J\250g\260Q\260a\340\014\017\210|\2303\230a\330\020%\240Q\330\024\030\320\030(\250\r\260Q\340\020\035\230W\240A\330\020\035\230[\250\001\250\021\340\010\027\220q\230\001\200A\360\n\000\t\014\2104\210v\220S\230\001\330\014\r\330\010\024\220A\330\010\013\2104\210q\330\014\020\220\016\230a\230v\240Q\330\014\033\2301\340\014\020\220\016\230a\230u\240A\330\014\033\2301\330\010\013\2104\210y\230\004\230A\330\014\030\230\001\330\014\030\230\001\230\024\230W\240G\2504\250w\260g\270Q\330\014\020\220\n\230(\240!\330\014\027\220q\330\010\013\2104\210z\230\024\230Q\330\014\030\230\001\330\014\030\230\001\230\024\230W\240G\2504\250w\260g\270Q\330\014\020\220\007\220x\230q\330\014\027\220q\330\010\023\2201\200A\360\010\000\t\023\220!\2206\230\037\250\004\250L\270\001\320\004\027\220}\240A\330\021#\320#6\260a\330\021\022\330\021\034\230J\240a\330\025\026\360\010\000\t\030\220y\240\001\240\026\240x\250w\260a\330\010\014\210M\230\021\330\010\014\210O\2301\330\010\013\2103\210j\230\003\2301\330\014\020\220\007\220q\230\007\230q\340\014\020\220\007\220q\230\007\230q\330\010\014\210K\220q\360\006\000\t\r\210J\220d\230*\240D\250\n\260$\260k\300\021\330\010\014\210J\220d\230*\240A\360\006\000\t\r\210K\220q\330\010\014\210K\220q\330\010\014\210K\220q\360\006\000\t\r\210J\220a\330\010\014\210J\220a\330\010\014\210J\220a\360\006\000\t\r\210L\230\001\360\006\000\t\r\210H\220A\360\006\000\t\r\210H\220A\330\010\014\210G\2201\360\006\000\t\r\320\014 \240\001\360\006\000\t\r\210L\230\001\360\006\000\t\r\210N\230!\360\006\000\t\014\2101\330\014\020\220\005\220Q\320\026,\250D\260\001\330\014\020\220\005\220Q\320\026=\270T\300\021\330\010\013\320\013\033\2304\230q\330\014\020\220\005\220Q\220n\240D\250\001\330\014\020\220\005\220Q\220o\240T\250\021\330\014\017\210s\220*\230C\230q\330\020\024\220E\230\021\320\032.\250d\260!\330\020\024\220E\230\021\320\032/\250t\2601\330\020\024\220E\230\021\320\032/\250t\2601\340\020\024\220E\230\021\230.\250\004\250A\330""\020\024\220E\230\021\230/\250\024\250Q\330\020\024\220E\230\021\320\032/\250t\2601\330\r\016\330\014\020\220\005\220Q\220n\240D\250\001\330\014\020\220\005\220Q\220o\240T\250\021\330\014\020\220\005\220Q\320\026+\2504\250q\330\r\016\330\014\020\220\005\220Q\220n\240D\250\001\330\014\020\220\005\220Q\220o\240T\250\021\330\010\013\2101\330\014\020\220\005\220Q\220n\240D\250\001\330\014\020\220\005\220Q\220o\240T\250\021\330\014\020\220\005\220Q\220n\240D\250\001\200A\360\022\000\t\014\2107\220!\2206\230\021\330\014\022\220*\230A\230Q\200A\330\010\013\2108\2201\220D\230\n\240#\240Q\330\014\026\220a\220t\2301\200A\360\014\000\t\025\220A\220T\230\021\200A\330\010\030\230\001\230\023\230A\230T\240\021\330\010\014\320\014\034\230A\200A\360\016\000\t\032\230\023\230A\230\\\250\023\250A\250\\\270\022\2702\270Q\330\010\032\230!\2301\230H\240A\240Q\240h\250a\250q\260\001\330\010\032\230!\2301\230H\240A\240Q\240i\250r\260\021\260)\2701\270A\270Z\300q\310\001\310\021\330\010\032\230!\2301\230H\240A\240Q\240i\250r\260\021\260)\2701\270A\270Z\300q\310\001\310\021\310!\3101\360\006\000\t\020\210t\2202\220T\230\024\230R\230t\2404\240r\250\024\250Q\330\017\023\2202\220T\230\024\230R\230t\2404\240r\250\024\250Q\330\017\023\2202\220T\230\024\230R\230t\2404\240r\250\024\250Q\330\017\022\220#\220S\230\001\330\010\025\220Q\220e\2304\230|\2504\250q\200A\330\010\024\220A\320\025(\250\004\250A\330\010\024\220A\220Q\330\025!\240\024\240Q\330\025\031\230\021\330\025\026\200A\330\010\014\320\014\034\230A\330\010\014\210M\230\021\330\010\014\210J\220a\220x\230t\240<\250q\330\027 \240\004\240M\260\021\330\010\014\210M\230\021\200A\360\024\000\t\031\230\001\330\010\014\210D\220\001\330\010\014\210L\230\004\230A\330\014\017\210s\220$\220a\330\014\020\220\003\2201\220A\330\014\020\220\t\230\027\240\002\240!\2401\240C\240r\250\021\250!\2503\250a\250q\330\014\020\220\t\230\027\240\002\240!\2401\240C\240r\250\021\250!\2503\250a\250q\330\014\020\220\t\230\027\240\002\240!\2401\240C\240r\250\021\250!""\2503\250a\250q\330\014\020\220\004\220E\230\023\230A\230Q\230c\240\021\240!\2401\330\014\035\230R\230s\240$\240f\250D\260\004\260A\330\037#\2404\240u\250D\260\003\2601\330\010\014\210M\230\021\200A\330\010\014\210D\220\010\230\001\230\024\230X\240Q\330\010\014\210M\230\021\330\010\017\210q\220\001\330\010\022\220!\2201\220D\230\001\230\024\230Q\230a\330\010\014\210E\220\024\220Q\330\014\026\220a\220q\230\004\230A\230T\240\021\240!\330\010\r\210Q\200A\330\010\014\210E\220\021\220\"\220A\220Q\330\010\014\210L\230\001\230\021\230$\230c\240\021\240!\2402\240Q\240a\330\010\014\210G\2201\200A\360\n\000\t\021\220\002\220\"\220E\230\023\230E\240\023\240B\240d\250!\330\010\014\210L\230\004\230J\240b\250\001\330\010\014\210G\2201\330\010\014\210N\230!\2301\200A\330\010\014\210E\220\024\220Y\230g\240T\250\031\260!\330\010\r\210T\220\032\2301\330\010\014\210G\2204\220q\330\014\025\220T\230\030\240\021\240!\330\014\020\220\n\230$\230h\240a\240q\330\020\023\2204\220v\230T\240\026\240q\330\020\034\230A\330\020\034\230A\230S\240\003\2406\250\021\330\020\030\230\001\230\024\230S\240\002\240\"\240B\240a\240q\330\020\030\230\004\230C\230r\240\022\2402\240Q\240a\330\020\024\220G\230>\250\021\330\024\031\230\022\2302\230Q\230a\230q\330\024\031\230\022\2302\230Q\230a\230q\330\024\034\230A\230T\240\023\240B\240b\250\003\2501\250A\330\024\034\230D\240\003\2402\240R\240s\250!\2501\330\024\030\230\007\230~\250Q\330\030\037\230q\240\001\240\024\240Z\250r\260\021\260!\2604\260q\330\030$\240A\330\030$\240A\240T\250\027\260\004\260G\2701\330\030\036\230h\240a\330\030#\2401\330\020\033\2301\200A\330\010\020\220\004\220F\230$\230a\330\010\013\2106\220\023\220A\330\014\020\220\010\230\004\230A\330\020\024\220H\230A\330\r\023\2203\220a\330\014\020\220\010\230\004\230A\330\020\024\220H\230A\330\010\013\2104\210w\220d\230!\330\014\020\220\013\2308\2401\200A\360\010\000\t\r\210G\2201\330\010\014\210N\230!\2301\200A\330\010\014\210H\220G\2301\230A\200A\360\016\000\t\r\210I\220\\\240\021\330\010\014""\210I\220^\2401\330\014\020\320\020%\240Q\240l\260!\340\010\014\210O\2305\240\001\360\006\000\t\025\220A\220^\2403\240a\200A\330\010\014\210J\320\026&\240a\330\010\014\210K\320\027'\240q\330\010\014\210J\320\026&\240a\330\010\014\210J\320\026&\240a\330\010\014\210I\320\025%\240Q\330\010\014\210G\320\023#\2401\200A\330\010\014\210J\220a\200A\360\010\000\t\r\210J\220a\330\010\014\210J\220a\330\010\014\210J\220a\330\010\014\210G\2201\200A\330\010\014\210K\220q\200A\360\n\000\t\r\210K\220q\330\010\014\210K\220q\330\010\014\210K\220q\330\010\014\210G\2201\200A\360\010\000\t\r\210K\220u\230F\240\"\240D\250\001\330\010\014\210I\220T\230\031\240$\240j\260\005\260T\270\025\270d\300%\300q\200A\360\n\000\t\r\210K\220z\240\032\2501\250A\330\010\021\220\021\220)\2301\330\010\014\210E\220\022\2208\2301\330\010\021\220\021\200A\330\010\020\220\004\220L\240\001\330\010\021\220\024\220]\240!\330\010\013\2106\220\023\220B\220c\230\027\240\003\2401\330\014\r\340\010\014\210M\230\021\330\010\014\210J\220a\220w\230a\330\010\014\210M\230\021\340\010\013\2104\210q\330\014\033\2301\230A\200A\360\010\000\t\r\210L\230\001\330\010\014\210G\2201\200A\330\010\014\210L\230\001\330\010\014\210M\230\022\2302\230R\230q\320\004\024\220A\360\010\000\t\r\210L\230\001\330\010\014\210M\230\021\330\010\024\220A\220Q\330\010\026\220a\330\010\013\2101\330\014\020\220\007\220q\200A\360\010\000\t\021\220\004\220L\240\001\330\010\021\220\024\220]\240!\340\010\014\210M\230\021\340\010\014\210J\220a\220w\230a\330\027-\250Q\330\010\020\220\001\340\010\024\220A\220S\230\007\230r\240\023\240C\240q\330\025\026\330\025\037\230q\240\001\340\010\020\220\007\220w\230a\200A\360\006\000\t\021\220\004\220L\240\001\330\010\021\220\024\220]\240!\340\010\014\210M\230\021\330\010\014\210J\220a\220x\230q\330\027 \240\001\330\010\020\220\001\340\010\027\220v\230Q\230a\330\r\024\220A\220Y\230b\240\002\240&\250\002\250!\330\010\025\220Q\320\026)\250\021\330\010\024\220A\220S\230\003\2307\240!\330\025\026\330\025\026\330\025\034""\230E\240\021\340\010\021\220\022\2202\220Q\330\010\017\210r\220\027\230\001\230\022\2302\230Z\240q\250\001\250\023\250B\250a\330\021\025\220U\230%\230q\240\007\240r\250\024\250T\260\021\340\010\021\220\023\220G\2301\330\014\023\2201\330\014\030\230\001\330\014\027\220q\330\014\024\220A\330\010\016\210f\220A\220Y\230a\200A\340\010\014\210L\230\001\330\010\014\210N\230!\2301\200A\330\010\014\210L\230\001\230\034\240Q\340\010\t\360\010\000\t\n\330\014\032\230(\240%\240q\250\004\250A\330\014 \240\010\250\005\250Q\250d\260!\330\014!\240\030\250\025\250a\250t\2601\200A\360\010\000\t\r\210M\230\021\200A\360\010\000\t\r\210M\230\021\330\010\032\230!\2306\240\025\240d\250%\250t\2604\260y\300\004\300A\330\010\014\210G\2201\330\010\014\210N\230!\2301\200A\360\n\000\t\r\210M\230\021\330\010\014\210J\220d\230#\230U\240#\240R\240t\2501\330\010\014\210J\220d\230#\230U\240#\240R\240t\2501\330\010\027\220q\230\004\230J\240d\250*\260D\270\001\330\030\034\230I\240T\250\021\330\010\014\210G\2201\330\010\014\210N\230!\2301\200A\330\010\014\210M\230\021\340\010\014\210K\220t\2301\330\014\023\320\023#\2401\340\010\014\210L\230\001\330\010\014\320\014\034\230A\330\014\026\220a\330\014\r\330\020\032\320\032+\2501\250A\330\014\023\220=\240\001\330\020\025\220Q\320\026:\270\"\270A\330\020\025\220Q\220a\340\014\020\220\t\230\027\240\001\240\021\200A\330\010\014\210M\230\021\330\010\014\210L\230\004\230A\330\014\024\220E\230\021\230-\240q\200A\330\010\014\210M\230\021\340\010\021\220\025\220a\220v\230Q\230e\2401\240A\330\010\016\210f\220D\230\007\230t\2401\330\010\024\220A\220Q\330\010\026\220a\330\010\017\210u\220B\220c\230\021\230$\230e\2401\240B\240a\240q\330\010\017\210u\220B\220a\330\010\021\220\021\220!\2206\230\026\230q\240\006\240f\250F\260!\330\010\024\220A\220Q\220d\230*\240A\240T\250\032\2602\260T\270\030\300\021\300$\300a\200A\330\010\014\210M\230\021\330\010\027\220q\230\004\230J\240d\250*\260D\270\001\330\030\034\230I\240T\250\021\330\010\014\210G\2201\340\010\013\2104\210q\330""\014\020\220\006\220a\220t\2304\230q\200A\360\024\000\t\r\210N\230#\230Q\230k\250\021\250!\340\010\t\330\014\034\230B\230d\240,\250b\260\003\2601\260A\340\010\037\230|\2506\260\021\260!\330\010\t\330\014\020\220\003\220:\230Y\240a\240q\330\020\024\220E\230\025\230a\230t\2401\330\024\031\230\021\230$\230l\250\"\250B\250b\260\005\260V\2701\270A\340\014\033\2301\360\006\000\r\036\230Q\230d\240!\330\014\033\2301\230A\340\014\030\230\001\320\031*\250$\250a\340\014\030\230\001\230\021\330\031%\240Q\330\031\032\330\031\032\360\006\000\r\021\220\001\220\021\200A\330\010\014\210O\320\033+\2501\330\010\014\210I\320\025%\240Q\200A\330\010\030\230\001\230\021\330\031\032\330\031\035\230Q\200A\360\020\000\t\022\220\024\320\025%\240Q\240a\340\010\013\210=\230\003\2301\330\014\020\220\003\2201\220A\330\014\017\210w\220d\230$\230b\240\002\240\"\240D\250\001\330\020\026\220i\230q\330\025\026\340\030\036\230c\240\030\250\024\250Q\340\014\032\230+\240T\250\031\260\"\260A\330\014\020\220\005\220U\230!\2301\330\020\024\220E\230\025\230a\230q\330\024\037\230q\240\002\240\"\240B\240b\250\005\250U\260!\2602\260Q\260a\330\r\032\230#\230Q\330\014\020\220\003\2201\220A\330\014\017\210w\220h\230d\240\"\240B\240b\250\004\250A\330\020\026\220i\230q\330\025\026\340\030\036\230c\240\030\250\024\250Q\340\014\032\230+\240T\250\031\260\"\260A\330\014\020\220\005\220U\230!\2301\330\020\024\220E\230\025\230a\230q\330\024\030\230\005\230U\240!\2401\330\030#\2403\240d\250\"\250B\250b\260\002\260\"\260B\260b\270\005\270U\300!\3002\300Q\300b\310\001\310\021\330\r\032\230#\230Q\330\014\020\220\003\2201\220A\330\014\017\210w\220b\230\003\2302\230R\230r\240\024\240Q\330\020\026\220i\230q\330\025\026\340\030\036\230c\240\030\250\024\250Q\340\014\030\230\t\240\024\240Y\250b\260\001\330\014\020\220\005\220U\230!\2301\330\020\031\230\021\230\"\230B\230e\2405\250\001\250\021\330\r\032\230#\230Q\330\014\020\220\003\2201\220A\330\014\017\210w\220b\230\003\2302\230R\230r\240\024\240Q\330\020\026\220i\230q\330\025""\026\340\030\036\230c\240\030\250\024\250Q\340\014\032\230+\240T\250\031\260\"\260A\330\014\020\220\005\220U\230!\2301\330\020\033\2301\230B\230b\240\005\240U\250!\2501\340\014\022\220)\2301\330\021\022\340\024\"\240!\200A\340\010\025\220Q\220d\230$\230d\240!\330\010\017\210y\230\004\230J\240a\340\010\020\220\001\220\023\220C\220s\230#\230Q\230e\2401\240C\240q\250\006\250a\250s\260!\330\010\014\210E\220\024\220Q\330\014\024\220K\230q\240\001\330\014\017\210v\220S\230\001\330\020\034\230A\230U\240(\250%\250q\330\035&\240a\330\035'\240u\250A\330\020\030\230\001\230\023\230C\230s\240#\240U\250(\260#\260Q\200A\330\010\025\220Q\220e\2305\240\001\330\010\014\210C\210u\220A\330\014\023\2201\220A\220T\230\032\2402\240Q\240a\240t\2501\330\014\030\230\001\330\014\030\230\001\230\024\230W\240D\250\007\250q\330\014\020\220\n\230!\2304\230{\250$\250a\330\020\024\220I\230Q\330\024\031\230\025\230a\330\014\027\220q\200A\330\010\025\220Q\220o\240Q\200A\330\010\025\220Q\220o\240T\250\021\200A\360\n\000\t\016\210R\210}\230A\330\010\027\320\027*\250!\200A\330\010\r\210R\210y\230\001\230\032\2401\340\010\014\320\014\036\230l\250!\330\010\014\210O\2305\240\002\240!\2403\240e\2501\250B\250e\2601\260C\260q\340\010\014\320\014\034\230K\240q\330\014\020\220\001\330\014\020\220\001\330\014\023\2201\330\010\014\210L\230\001\330\010\014\320\014$\240A\340\010\014\210M\230\021\360\006\000\t\037\320\0366\260a\330\010\013\2101\330\014\022\220)\2301\330\021\022\340-.\330-:\270!\2701\200A\360\016\000\t\r\320\014\035\230T\320!8\270\007\270q\330\014\031\320\031)\250\021\340\010\026\220a\220t\2301\330\010\026\220a\220t\2301\330\010\027\220q\230\004\230A\340\010\014\320\014\036\230a\330\010\014\320\014 \240\001\330\010\014\320\014\035\230Q\330\010\014\320\014&\240a\200A\330\010\025\220_\240A\330\010\013\2104\210q\330\014\020\220\014\230M\250\021\330\010\013\2104\210y\230\004\230H\240A\240T\250\032\2603\260a\330\014\031\230\021\230$\230j\250\001\330\010\022\220-\230q\200A\360\016\000\t\033\230$\230a\330""\010\014\210E\220\025\220a\220r\230\023\230A\330\014\020\220\001\220\021\220!\2201\220A\330\014\r\210Q\210f\220A\220Q\220a\330\014\r\210Q\210a\210q\220\006\220a\220q\230\001\330\014\r\210Q\210a\210q\220\006\220a\220q\230\001\200A\330\010\t\330\014\036\230i\240|\2601\200A\360\006\000\t\030\220q\230\003\2301\230D\240\001\330\010\034\230A\230S\240\001\240\024\240Q\340\010\014\210H\220A\330\010\014\210H\220A\200A\330\010\027\220q\230\003\2301\230D\240\001\330\010\014\320\014&\240a\200A\330\010\027\220q\330\010\031\230\021\230$\230a\330\010\027\220q\230\001\340\010\024\220A\320\025&\240d\250!\360\n\000\t\"\240\021\240!\330\010\027\220q\230\001\360\010\000\t\036\230Q\230c\240\024\240Q\330\036(\250\001\330\036.\250b\260\004\260A\330\036\037\330\010\027\220q\230\001\200A\330\010\017\210s\220!\2204\220q\200A\330\010\017\210t\2201\200A\360\016\000\t\020\210t\320\023#\2401\240G\2501\360\010\000\t\022\220\022\2202\220Q\330\010\017\210r\220\024\220Q\220b\230\002\230*\240A\240Q\240c\250\022\2501\330\021\025\220U\230%\230q\240\007\240r\250\024\250T\260\021\340\010\021\220\023\220G\2301\330\014\023\2201\330\014\030\230\001\330\014\027\220q\330\014\024\220A\330\010\016\210f\220A\220Y\230a\200A\360\016\000\t\020\210t\220;\320\0363\2601\260L\300\001\200A\330\010\017\210w\220a\220q\230\004\230B\230a\230x\240t\2502\250Q\250h\260d\270\"\270A\270Q\200A\330\010\017\210w\220b\230\002\230#\230R\230t\2407\250\"\250B\250c\260\021\330\010\014\210M\230\021\330\010\014\210A\340\010\024\220A\330\010\026\220a\330\010\021\220\021\220$\220e\2305\240\001\340\010\021\220\021\220!\2202\220Q\220a\330\010\017\210r\220\021\220!\330\010\t\360\014\000\t\r\210E\220\025\220a\220q\330\014\024\220F\230!\2301\330\014\023\2201\220A\330\014\020\220\005\220U\230!\2307\240\"\240A\330\020\032\230!\2304\230q\240\003\2401\330\014\021\220\021\360\006\000\t\r\210E\220\025\220a\220s\230!\330\014\023\2201\220A\330\014\022\220$\220a\220q\330\014\020\220\005\220U\230!\2303\230a\330\020\032\230!\2305\240\006\240a\240q\330\014""\021\220\021\330\010\023\2201\200\001\360\n\000\005\013\210*\220C\220s\230!\320\004-\250Q\360\036\000\t\r\210M\230\021\340\010\013\2101\330\014\031\230\021\330\014!\240\021\340\014\031\230\021\330\014!\240\021\360\006\000\t\026\220Q\220c\230\021\230!\330\010\025\220Q\220o\240Q\330\010\024\220A\220_\240A\330\025\035\230W\240A\330\025\026\330\025\026\330\025\026\330\025\026\330\010\027\220q\230\001\330\030\031\330\030\031\330\010\027\220q\230\001\330\030\031\330\030\031\360\006\000\t\026\220Q\220c\230\021\230!\330\010\025\220Q\220o\240Q\330\010\024\220A\220_\240A\330\025)\250\027\260\001\330\025\026\330\025\026\330\025\026\330\025\026\330\010\027\220q\230\001\330\030\031\330\030\031\330\010\027\220q\230\001\330\030\031\330\030\031\360\006\000\t\032\230\021\230#\230Q\230a\330\010\031\230\021\320\032*\250!\330\010\036\230a\230q\330\037 \330\037 \330\037.\250a\330\010\036\230a\230q\330\037 \330\037 \330\037.\250a\330\010\013\320\013#\2401\320$4\260C\260q\330\014\022\220)\2301\230A\360\006\000\t\r\210J\220a\220w\230a\330\010\020\220\001\360\006\000\t\030\220v\230Q\230a\330\r\024\220A\220Y\230b\240\002\240&\250\002\250!\330\010\025\220Q\320\026)\250\021\330\010\024\220A\220S\230\003\2307\240!\330\025\026\330\025\026\330\025\034\230E\240\021\360\010\000\t\032\230\021\320\032*\250!\340\010\034\230A\230S\240\001\240\021\330\010\030\230\001\230\023\230A\230Q\330\010\030\230\001\230\023\230A\230Q\340\010\027\220q\230\001\340\010\017\210q\200\001\340\004\005\330\010\025\220Q\330\010\027\220q\330\010\026\220a\330\010\031\230\021\330\010'\240q\330\004\007\200t\210;\220a\220q\330\010\016\210l\230!\330\014\r\330\004\007\200w\210g\220Q\330\010\016\210j\230\001\330\0144\260B\260d\270%\270q\330\020\022\220'\230\022\2302\230T\240\025\240f\250A\250_\270E\300\021\330\004\n\210-\220{\240!\240?\260!\2601\330\004\013\2103\210g\220Q\220l\240*\250A\320\004.\250a\330\010\021\220\025\220a\220v\230Q\230e\2401\240A\330\010\016\210d\220%\220q\230\001\330\010\020\220\003\2201\220A\330\010\014\210M""\230\021\330\010\024\220A\220Q\330\010\026\220a\330\010\013\2104\210q\330\014\024\220A\220Q\330\014\025\220Q\220a\330\014\023\2201\220A\220W\230G\2405\250\001\250\025\250e\2601\340\014\024\220A\220Q\330\014\025\220Q\220a\330\014\023\2201\220A\220W\230G\2401\240E\250\025\250f\260A\200\001\360\n\000\005\006\330\010\016\210j\230\001\330\010\013\2104\210s\220!\330\014\r\330\010\013\2104\210s\220!\330\014\020\220\001\330\r\021\220\023\220A\330\014\020\220\001\330\r\021\220\023\220A\330\014\020\220\001\330\r\021\220\023\220A\330\014\020\220\001\340\014\020\220\017\230r\240\021\330\010\r\210Q\320\016\"\240#\240Q\320\004 \240\001\330\010\027\220q\230\n\240!\2401\320$5\260T\270\021\330\010\027\220q\230\003\230:\240Q\240a\320'8\270\004\270I\300Q\300a\330\010\033\2301\230A\330\010\033\2301\230A\330\010\034\230A\230Q\330\010\013\2101\330\014\020\220\r\230Q\330\010\026\220a\220~\240T\250\030\260\021\330\027\033\2301\330\010\034\230A\230Q\330\010\034\230A\230Q\210\001\330\014\017\210s\220$\220c\230\021\230$\230a\230s\240!\2408\2503\250a\250t\2601\260C\260q\270\010\300\003\3001\300A\330\014\026\220a\220s\230#\230Q\330\014\026\220a\220q\230\001\230\023\230A\230Q\230c\240\021\240!\2401\n    #version 150\n\n    // Note that GLSL ES 3.0 is based on GLSL 3.30 and used for WebGL 2.0.\n    // GLSL 1.50 came with OpenGL 3.2.\n\n    in vec4 position;\n\n    void main()\n    {\n        gl_Position = position;  // no-op\n    }\n\n    \n    #version 150\n\n    out vec4 out_FragColor;\n\n    void main()\n    {\n        out_FragColor = vec4(1.0, 0.0, 0.0, 1.0);\n    }\n    O";
    PyObject *data = NULL;
    CYTHON_UNUSED_VAR(__Pyx_DecompressString);
    #endif
    PyObject **stringtab = __pyx_mstate->__pyx_string_tab;
    Py_ssize_t pos = 0;
    for (int i = 0; i < 732; i++) {
      Py_ssize_t bytes_length = index[i].length;
      PyObject *string = PyUnicode_DecodeUTF8(bytes + pos, bytes_length, NULL);
      if (likely(string) && i >= 146) PyUnicode_InternInPlace(&string);
      if (unlikely(!string)) {
        Py_XDECREF(data);
        __PYX_ERR(0, 1, __pyx_L1_error)
      }
      stringtab[i] = string;
      pos += bytes_length;
    }
    for (int i = 732; i < 829; i++) {
      Py_ssize_t bytes_length = index[i].length;
      PyObject *string = PyBytes_FromStringAndSize(bytes + pos, bytes_length);
      stringtab[i] = string;
      pos += bytes_length;
      if (unlikely(!string)) {
        Py_XDECREF(data);
        __PYX_ERR(0, 1, __pyx_L1_error)
      }
    }
    Py_XDECREF(data);
    for (Py_ssize_t i = 0; i < 829; i++) {
      if (unlikely(PyObject_Hash(stringtab[i]) == -1)) {
        __PYX_ERR(0, 1, __pyx_L1_error)
      }
    }
    #if CYTHON_IMMORTAL_CONSTANTS
    {
      PyObject **table = stringtab + 732;
      for (Py_ssize_t i=0; i<97; ++i) {
        #if PY_VERSION_HEX >= 0x030F0000
        PyUnstable_SetImmortal(table[i]);
        #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
        if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL)) break;
        #if PY_VERSION_HEX < 0x030E0000
        if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1)
        #else
        if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
        #endif
        {
          Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1));
        }
        #else
        if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT)) break;
        Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
        #endif
      }
    }
    #endif
  }
  {
    PyObject **numbertab = __pyx_mstate->__pyx_number_tab;
    double const c_constants[] = {.2,0.,1.,0.0,0.1,0.3,0.5,0.6,0.8,0.9,1.0,-2.0,2.0,-2.2,2.2,0.01,0.05,10.0,30.0,50.0,100.0,360.0};
    for (int i = 0; i < 22; i++) {
      numbertab[i] = PyFloat_FromDouble(c_constants[i]);
      if (unlikely(!numbertab[i])) __PYX_ERR(0, 1, __pyx_L1_error)
    }
  }
  {
    PyObject **numbertab = __pyx_mstate->__pyx_number_tab + 22;
    int8_t const cint_constants_1[] = {0,-1,1,2,3,4,5,6,8,10,30,60,100};
    int32_t const cint_constants_4[] = {136983863L};
    for (int i = 0; i < 14; i++) {
      numbertab[i] = PyLong_FromLong((i < 13 ? cint_constants_1[i - 0] : cint_constants_4[i - 13]));
      if (unlikely(!numbertab[i])) __PYX_ERR(0, 1, __pyx_L1_error)
    }
  }
  #if CYTHON_IMMORTAL_CONSTANTS
  {
    PyObject **table = __pyx_mstate->__pyx_number_tab;
    for (Py_ssize_t i=0; i<36; ++i) {
      #if PY_VERSION_HEX >= 0x030F0000
      PyUnstable_SetImmortal(table[i]);
      #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
      if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL)) break;
      #if PY_VERSION_HEX < 0x030E0000
      if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1)
      #else
      if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
      #endif
      {
        Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1));
      }
      #else
      if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT)) break;
      Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
      #endif
    }
  }
  #endif
  return 0;
  __pyx_L1_error:;
  return -1;
}
/* #### Code section: init_codeobjects ### */
typedef struct {
    unsigned int argcount : 4;
    unsigned int num_posonly_args : 1;
    unsigned int num_kwonly_args : 1;
    unsigned int nlocals : 5;
    unsigned int flags : 10;
    unsigned int first_line : 9;
} __Pyx_PyCode_New_function_description;
/* NewCodeObj.proto */
static PyObject* __Pyx_PyCode_New(
        const __Pyx_PyCode_New_function_description descr,
        PyObject * const *varnames,
        PyObject *filename,
        PyObject *funcname,
        PyObject *line_table,
        PyObject *tuple_dedup_map
);


static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) {
  PyObject* tuple_dedup_map = PyDict_New();
  if (unlikely(!tuple_dedup_map)) return -1;
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 17};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_phi, __pyx_mstate->__pyx_n_u_theta, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_y, __pyx_mstate->__pyx_n_u_z};
    __pyx_mstate_global->__pyx_codeobj_tab[0] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_legacy_wireframe_sphere_p, __pyx_mstate->__pyx_n_u_draw_point, __pyx_mstate->__pyx_kp_b_iso88591_s_c_as_83at1Cq_1A_as_Q_aq_AQc_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[0])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 52};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_z};
    __pyx_mstate_global->__pyx_codeobj_tab[1] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_legacy_horoball_scene_pyx, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_kp_b_iso88591_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 192};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_m, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_j};
    __pyx_mstate_global->__pyx_codeobj_tab[2] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_modern_glsl_perspective_v, __pyx_mstate->__pyx_n_u_to_py, __pyx_mstate->__pyx_kp_b_iso88591_2RuAQar_2Rt4uE_e1A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_string, __pyx_mstate->__pyx_n_u_str, __pyx_mstate->__pyx_n_u_gl_string_enums, __pyx_mstate->__pyx_n_u_k};
    __pyx_mstate_global->__pyx_codeobj_tab[3] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_common_string_pyx, __pyx_mstate->__pyx_n_u_get_gl_string, __pyx_mstate->__pyx_kp_b_iso88591_Q_q_a_q_t_aq_l_wgQ_j_4Bd_q_2T_f, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[3])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 0, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {0};
    __pyx_mstate_global->__pyx_codeobj_tab[4] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_common_error_pyx, __pyx_mstate->__pyx_n_u_clear_gl_errors, __pyx_mstate->__pyx_kp_b_iso88591_Cs, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[4])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 9};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_msg, __pyx_mstate->__pyx_n_u_err, __pyx_mstate->__pyx_n_u_k};
    __pyx_mstate_global->__pyx_codeobj_tab[5] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_common_error_pyx, __pyx_mstate->__pyx_n_u_print_gl_errors, __pyx_mstate->__pyx_kp_b_iso88591_j_4s_4s_A_A_A_r_Q_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[5])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 30};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_scalar};
    __pyx_mstate_global->__pyx_codeobj_tab[6] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_vector3_pyx, __pyx_mstate->__pyx_n_u_div, __pyx_mstate->__pyx_kp_b_iso88591_A_waq_Baxt2Qhd_AQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[6])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_ambient, __pyx_mstate->__pyx_n_u_lightdiffuse, __pyx_mstate->__pyx_n_u_lightspecular, __pyx_mstate->__pyx_n_u_lightposition0, __pyx_mstate->__pyx_n_u_lightposition1};
    __pyx_mstate_global->__pyx_codeobj_tab[7] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_legacy_lighting_pyx, __pyx_mstate->__pyx_n_u_cyglSetStandardLighting, __pyx_mstate->__pyx_kp_b_iso88591_AV6_q_uE_5_U_1E_e1_1E_vQ_AQ_AQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[7])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 36};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_old_widget};
    __pyx_mstate_global->__pyx_codeobj_tab[8] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_legacy_object_pyx, __pyx_mstate->__pyx_n_u_delete_resource, __pyx_mstate->__pyx_kp_b_iso88591_A__A_4q_M_4y_HAT_3a_j_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[8])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS), 52};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kwargs};
    __pyx_mstate_global->__pyx_codeobj_tab[9] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_legacy_object_pyx, __pyx_mstate->__pyx_n_u_draw, __pyx_mstate->__pyx_kp_b_iso88591_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[9])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS), 59};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kwargs, __pyx_mstate->__pyx_n_u_list_id};
    __pyx_mstate_global->__pyx_codeobj_tab[10] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_legacy_object_pyx, __pyx_mstate->__pyx_n_u_build_display_list, __pyx_mstate->__pyx_kp_b_iso88591_A_Kz_1A_1_E_81, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[10])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 69};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[11] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_legacy_object_pyx, __pyx_mstate->__pyx_n_u_display, __pyx_mstate->__pyx_kp_b_iso88591_A_81D_Q_at1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[11])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 6};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_radius, __pyx_mstate->__pyx_n_u_slices, __pyx_mstate->__pyx_n_u_stacks, __pyx_mstate->__pyx_n_u_r, __pyx_mstate->__pyx_n_u_dtheta, __pyx_mstate->__pyx_n_u_dphi, __pyx_mstate->__pyx_n_u_draw_point, __pyx_mstate->__pyx_n_u_draw_point, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_theta, __pyx_mstate->__pyx_n_u_j, __pyx_mstate->__pyx_n_u_phi};
    __pyx_mstate_global->__pyx_codeobj_tab[12] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_legacy_wireframe_sphere_p, __pyx_mstate->__pyx_n_u_draw, __pyx_mstate->__pyx_kp_b_iso88591_A_wb_Rt7_Bc_M_A_A_a_e5_2Qa_r_E_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[12])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 5};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_vertices};
    __pyx_mstate_global->__pyx_codeobj_tab[13] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_legacy_triangle_mesh_pyx, __pyx_mstate->__pyx_n_u_init, __pyx_mstate->__pyx_kp_b_iso88591_A_L_M_2Rq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[13])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 9};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[14] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_legacy_triangle_mesh_pyx, __pyx_mstate->__pyx_n_u_repr, __pyx_mstate->__pyx_kp_b_iso88591_A_s_4q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[14])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 12};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_y, __pyx_mstate->__pyx_n_u_z};
    __pyx_mstate_global->__pyx_codeobj_tab[15] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_legacy_triangle_mesh_pyx, __pyx_mstate->__pyx_n_u_getitem, __pyx_mstate->__pyx_kp_b_iso88591_A_3d_j_IQd_iq_D, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[15])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 11, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 16};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_new_triangles, __pyx_mstate->__pyx_n_u_V, __pyx_mstate->__pyx_n_u_triangle, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_y, __pyx_mstate->__pyx_n_u_z, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_xy, __pyx_mstate->__pyx_n_u_yz, __pyx_mstate->__pyx_n_u_zx};
    __pyx_mstate_global->__pyx_codeobj_tab[16] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_legacy_triangle_mesh_pyx, __pyx_mstate->__pyx_n_u_subdivide, __pyx_mstate->__pyx_kp_b_iso88591_A_D_L_A_s_a_1A_1Cr_3aq_1Cr_3aq_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[16])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 16};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_scale, __pyx_mstate->__pyx_n_u_V, __pyx_mstate->__pyx_n_u_N, __pyx_mstate->__pyx_n_u_NV, __pyx_mstate->__pyx_n_u_T, __pyx_mstate->__pyx_n_u_NVsize, __pyx_mstate->__pyx_n_u_Tsize, __pyx_mstate->__pyx_n_u_triangle};
    __pyx_mstate_global->__pyx_codeobj_tab[17] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_legacy_meshed_surface_pyx, __pyx_mstate->__pyx_n_u_build_arrays, __pyx_mstate->__pyx_kp_b_iso88591_A_3at_Qa_L_q_CuCq_Kt1_at2Qd_AU_4, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[17])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 35};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_use_material};
    __pyx_mstate_global->__pyx_codeobj_tab[18] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_legacy_meshed_surface_pyx, __pyx_mstate->__pyx_n_u_draw, __pyx_mstate->__pyx_kp_b_iso88591_q_1_5T_q_Qa_8_IQa_1A_1A_AQ_1_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[18])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 27};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_triangle};
    __pyx_mstate_global->__pyx_codeobj_tab[19] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_legacy_poincare_polygon_p, __pyx_mstate->__pyx_n_u_draw, __pyx_mstate->__pyx_kp_b_iso88591_A_M_L_A_E_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[19])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 15};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_N, __pyx_mstate->__pyx_n_u_V};
    __pyx_mstate_global->__pyx_codeobj_tab[20] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_legacy_klein_polygon_pyx, __pyx_mstate->__pyx_n_u_draw, __pyx_mstate->__pyx_kp_b_iso88591_A_D_XQ_M_q_1D_Qa_E_Q_aq_AT_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[20])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 12, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 10};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_facedicts, __pyx_mstate->__pyx_n_u_model_var, __pyx_mstate->__pyx_n_u_sphere_var, __pyx_mstate->__pyx_n_u_togl_widget, __pyx_mstate->__pyx_n_u_dict_2, __pyx_mstate->__pyx_n_u_vertices, __pyx_mstate->__pyx_n_u_closest, __pyx_mstate->__pyx_n_u_center, __pyx_mstate->__pyx_n_u_color, __pyx_mstate->__pyx_n_u_face, __pyx_mstate->__pyx_n_u_vertex};
    __pyx_mstate_global->__pyx_codeobj_tab[21] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_legacy_hyperbolic_polyhed, __pyx_mstate->__pyx_n_u_init, __pyx_mstate->__pyx_kp_b_iso88591_9_M_IQ_Ja_Qe5_Q_q_a_N_e5_9_uE_6, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[21])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS), 50};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_model, __pyx_mstate->__pyx_n_u_face};
    __pyx_mstate_global->__pyx_codeobj_tab[22] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_legacy_hyperbolic_polyhed, __pyx_mstate->__pyx_n_u_draw, __pyx_mstate->__pyx_kp_b_iso88591_A_F_a_6_A_A_HA_3a_A_HA_4wd_81, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[22])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 20, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 44};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_R, __pyx_mstate->__pyx_n_u_T, __pyx_mstate->__pyx_n_u_vx, __pyx_mstate->__pyx_n_u_vy, __pyx_mstate->__pyx_n_u_ux, __pyx_mstate->__pyx_n_u_key, __pyx_mstate->__pyx_n_u_sphere, __pyx_mstate->__pyx_n_u_center, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_y, __pyx_mstate->__pyx_n_u_N_min, __pyx_mstate->__pyx_n_u_N_max, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_xn, __pyx_mstate->__pyx_n_u_yn, __pyx_mstate->__pyx_n_u_M_min, __pyx_mstate->__pyx_n_u_M_max, __pyx_mstate->__pyx_n_u_m, __pyx_mstate->__pyx_n_u_disp};
    __pyx_mstate_global->__pyx_codeobj_tab[23] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_legacy_horoball_group_pyx, __pyx_mstate->__pyx_n_u_draw, __pyx_mstate->__pyx_kp_b_iso88591_A_E_YgT_T_1_G4q_T_haq_4vT_q_A_AS, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[23])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 7};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_s1, __pyx_mstate->__pyx_n_u_s2, __pyx_mstate->__pyx_n_u_p};
    __pyx_mstate_global->__pyx_codeobj_tab[24] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_legacy_parallelogram_pyx, __pyx_mstate->__pyx_n_u_draw, __pyx_mstate->__pyx_kp_b_iso88591_A_1A_uE_q_Bb_AQ_1G1G1_Q_1G1G1_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[24])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 24};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_shifts, __pyx_mstate->__pyx_n_u_dark, __pyx_mstate->__pyx_n_u_M, __pyx_mstate->__pyx_n_u_L, __pyx_mstate->__pyx_n_u_disp, __pyx_mstate->__pyx_n_u_P1, __pyx_mstate->__pyx_n_u_P2};
    __pyx_mstate_global->__pyx_codeobj_tab[25] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_legacy_edge_set_pyx, __pyx_mstate->__pyx_n_u_draw, __pyx_mstate->__pyx_kp_b_iso88591_1A_4q_AQ_Q_1_q_CuA_1AT_2Qat1_WD, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[25])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 22};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_glyph, __pyx_mstate->__pyx_n_u_width, __pyx_mstate->__pyx_n_u_height, __pyx_mstate->__pyx_n_u_c};
    __pyx_mstate_global->__pyx_codeobj_tab[26] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_legacy_label_pyx, __pyx_mstate->__pyx_n_u_draw, __pyx_mstate->__pyx_kp_b_iso88591_A_Qd_d_y_Ja_Cs_Qe1Cq_as_E_Q_Kq_v, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[26])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 22};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_shifts, __pyx_mstate->__pyx_n_u_M, __pyx_mstate->__pyx_n_u_L, __pyx_mstate->__pyx_n_u_disp, __pyx_mstate->__pyx_n_u_labels, __pyx_mstate->__pyx_n_u_label};
    __pyx_mstate_global->__pyx_codeobj_tab[27] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_legacy_label_set_pyx, __pyx_mstate->__pyx_n_u_draw, __pyx_mstate->__pyx_kp_b_iso88591_A_Qe5_CuA_1AT_2Qat1_WD_q_4_a_IQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[27])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 35};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cutoff};
    __pyx_mstate_global->__pyx_codeobj_tab[28] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_legacy_horoball_scene_pyx, __pyx_mstate->__pyx_n_u_set_cutoff, __pyx_mstate->__pyx_kp_b_iso88591_A_Ja, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[28])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 38};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_boolean_value};
    __pyx_mstate_global->__pyx_codeobj_tab[29] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_legacy_horoball_scene_pyx, __pyx_mstate->__pyx_n_u_flip, __pyx_mstate->__pyx_kp_b_iso88591_A_Kq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[29])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 41};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_which_cusp, __pyx_mstate->__pyx_n_u_full_list, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_n};
    __pyx_mstate_global->__pyx_codeobj_tab[30] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_legacy_horoball_scene_pyx, __pyx_mstate->__pyx_n_u_build_scene, __pyx_mstate->__pyx_kp_b_iso88591_5Q_4vS_T_1_d_q_T_Q_c_Q_a_Kt1_M, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[30])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 75};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[31] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_legacy_horoball_scene_pyx, __pyx_mstate->__pyx_n_u_delete_resource, __pyx_mstate->__pyx_kp_b_iso88591_A_J_a_K_q_J_a_J_a_I_Q_G_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[31])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 97};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_z};
    __pyx_mstate_global->__pyx_codeobj_tab[32] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_legacy_horoball_scene_pyx, __pyx_mstate->__pyx_n_u_translate, __pyx_mstate->__pyx_kp_b_iso88591_A_4_Q_4q_1_T_S_Ye1A_Bc_r_YfAT_S, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[32])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS), 162};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_label_height};
    __pyx_mstate_global->__pyx_codeobj_tab[33] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_legacy_horoball_scene_pyx, __pyx_mstate->__pyx_n_u_draw, __pyx_mstate->__pyx_kp_b_iso88591_A_4vS_A_4q_avQ_1_auA_1_4y_A_WG4w, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[33])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS), 19};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_parent, __pyx_mstate->__pyx_n_u_cnf, __pyx_mstate->__pyx_n_u_kw, __pyx_mstate->__pyx_n_u_missing_gl_function};
    __pyx_mstate_global->__pyx_codeobj_tab[34] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_legacy_raw_openGL_widget, __pyx_mstate->__pyx_n_u_init, __pyx_mstate->__pyx_kp_b_iso88591_1_Ry_HA_A_M_6a_1_1_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[34])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 45};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[35] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_legacy_raw_openGL_widget, __pyx_mstate->__pyx_n_u_make_current, __pyx_mstate->__pyx_kp_b_iso88591_A_R_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[35])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 53};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[36] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_legacy_raw_openGL_widget, __pyx_mstate->__pyx_n_u_redraw, __pyx_mstate->__pyx_kp_b_iso88591_A_4q_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[36])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 64};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[37] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_legacy_raw_openGL_widget, __pyx_mstate->__pyx_n_u_draw, __pyx_mstate->__pyx_kp_b_iso88591_A_A_M_Jaxt_q_M_M, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[37])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 71};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_outfile, __pyx_mstate->__pyx_n_u_c_array, __pyx_mstate->__pyx_n_u_width, __pyx_mstate->__pyx_n_u_height, __pyx_mstate->__pyx_n_u_stride, __pyx_mstate->__pyx_n_u_rows, __pyx_mstate->__pyx_n_u_writer, __pyx_mstate->__pyx_n_u_i};
    __pyx_mstate_global->__pyx_codeobj_tab[38] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_legacy_raw_openGL_widget, __pyx_mstate->__pyx_n_u_save_image_window_resolution, __pyx_mstate->__pyx_kp_b_iso88591_A_L_M_Jaxq_vQa_AYb_Q_AS_7_E_2Q_r, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[38])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {11, 0, 0, 12, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS), 38};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_master, __pyx_mstate->__pyx_n_u_help, __pyx_mstate->__pyx_n_u_mouse_pick, __pyx_mstate->__pyx_n_u_mouse_rotate, __pyx_mstate->__pyx_n_u_mouse_translate, __pyx_mstate->__pyx_n_u_mouse_scale, __pyx_mstate->__pyx_n_u_fovy, __pyx_mstate->__pyx_n_u_near, __pyx_mstate->__pyx_n_u_far, __pyx_mstate->__pyx_n_u_cnf, __pyx_mstate->__pyx_n_u_kw};
    __pyx_mstate_global->__pyx_codeobj_tab[39] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_legacy_perspectiveWidget, __pyx_mstate->__pyx_n_u_init, __pyx_mstate->__pyx_kp_b_iso88591_A_6a_Ja_y_xwa_M_O1_3j_1_q_q_q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[39])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 115};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[40] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_legacy_perspectiveWidget, __pyx_mstate->__pyx_n_u_help, __pyx_mstate->__pyx_kp_b_iso88591_A_6_L, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[40])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 121};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_r, __pyx_mstate->__pyx_n_u_g, __pyx_mstate->__pyx_n_u_b};
    __pyx_mstate_global->__pyx_codeobj_tab[41] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_legacy_perspectiveWidget, __pyx_mstate->__pyx_n_u_set_background, __pyx_mstate->__pyx_kp_b_iso88591_A_Ja_Ja_Ja_G1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[41])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 130};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_y, __pyx_mstate->__pyx_n_u_z};
    __pyx_mstate_global->__pyx_codeobj_tab[42] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_legacy_perspectiveWidget, __pyx_mstate->__pyx_n_u_set_centerpoint, __pyx_mstate->__pyx_kp_b_iso88591_A_Kq_Kq_Kq_G1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[42])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 140};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_distance};
    __pyx_mstate_global->__pyx_codeobj_tab[43] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_legacy_perspectiveWidget, __pyx_mstate->__pyx_n_u_set_eyepoint, __pyx_mstate->__pyx_kp_b_iso88591_A_L_G1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[43])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 147};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_redraw};
    __pyx_mstate_global->__pyx_codeobj_tab[44] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_legacy_perspectiveWidget, __pyx_mstate->__pyx_n_u_reset, __pyx_mstate->__pyx_kp_b_iso88591_A_L_M_AQ_a_1_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[44])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 158};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_event, __pyx_mstate->__pyx_n_u_objX, __pyx_mstate->__pyx_n_u_objY, __pyx_mstate->__pyx_n_u_objZ, __pyx_mstate->__pyx_n_u_model, __pyx_mstate->__pyx_n_u_proj, __pyx_mstate->__pyx_n_u_view};
    __pyx_mstate_global->__pyx_codeobj_tab[45] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_legacy_perspectiveWidget, __pyx_mstate->__pyx_n_u_tkHandlePick, __pyx_mstate->__pyx_kp_b_iso88591_A_7_6_AQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[45])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 190};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_event};
    __pyx_mstate_global->__pyx_codeobj_tab[46] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_legacy_perspectiveWidget, __pyx_mstate->__pyx_n_u_tkRecordMouse, __pyx_mstate->__pyx_kp_b_iso88591_A_KuF_D_IT_j_T_d_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[46])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 197};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_event};
    __pyx_mstate_global->__pyx_codeobj_tab[47] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_legacy_perspectiveWidget, __pyx_mstate->__pyx_n_u_StartRotate, __pyx_mstate->__pyx_kp_b_iso88591_A_L_N_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[47])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 202};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_event, __pyx_mstate->__pyx_n_u_scale};
    __pyx_mstate_global->__pyx_codeobj_tab[48] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_legacy_perspectiveWidget, __pyx_mstate->__pyx_n_u_tkScale, __pyx_mstate->__pyx_kp_b_iso88591_A_E_E_Bd_L_Jb_G1_N_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[48])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 212};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_t};
    __pyx_mstate_global->__pyx_codeobj_tab[49] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_legacy_perspectiveWidget, __pyx_mstate->__pyx_n_u_zoom, __pyx_mstate->__pyx_kp_b_iso88591_A_E_AQ_L_c_2Qa_G1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[49])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 217};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[50] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_legacy_perspectiveWidget, __pyx_mstate->__pyx_n_u_do_AutoSpin, __pyx_mstate->__pyx_kp_b_iso88591_A_M_q_Jd_D_IT_G1_4q_at4q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[50])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 226};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_event};
    __pyx_mstate_global->__pyx_codeobj_tab[51] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_legacy_perspectiveWidget, __pyx_mstate->__pyx_n_u_tkAutoSpin, __pyx_mstate->__pyx_kp_b_iso88591_A_4_Rr_A_at4q_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[51])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 235};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_event, __pyx_mstate->__pyx_n_u_Xangle, __pyx_mstate->__pyx_n_u_Yangle};
    __pyx_mstate_global->__pyx_codeobj_tab[52] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_legacy_perspectiveWidget, __pyx_mstate->__pyx_n_u_tkRotate, __pyx_mstate->__pyx_kp_b_iso88591_A_M_Jd_U_Rt1_Jd_U_Rt1_q_Jd_D_IT, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[52])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 248};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_event};
    __pyx_mstate_global->__pyx_codeobj_tab[53] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_legacy_perspectiveWidget, __pyx_mstate->__pyx_n_u_tkTranslate, __pyx_mstate->__pyx_kp_b_iso88591_A_M_6_d_t4y_A_G1_N_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[53])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 257};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_event};
    __pyx_mstate_global->__pyx_codeobj_tab[54] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_legacy_perspectiveWidget, __pyx_mstate->__pyx_n_u_mouse_update, __pyx_mstate->__pyx_kp_b_iso88591_A_G1_N_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[54])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 264};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_width, __pyx_mstate->__pyx_n_u_height};
    __pyx_mstate_global->__pyx_codeobj_tab[55] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_legacy_perspectiveWidget, __pyx_mstate->__pyx_n_u_draw_impl, __pyx_mstate->__pyx_kp_b_iso88591_A_3c_AT_it9A_q_Ba_QgQ_AQ_A_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[55])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 286};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[56] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_legacy_perspectiveWidget, __pyx_mstate->__pyx_n_u_draw_projection_impl, __pyx_mstate->__pyx_kp_b_iso88591_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[56])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 291};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_width, __pyx_mstate->__pyx_n_u_height, __pyx_mstate->__pyx_n_u_xmax, __pyx_mstate->__pyx_n_u_ymax, __pyx_mstate->__pyx_n_u_near, __pyx_mstate->__pyx_n_u_far, __pyx_mstate->__pyx_n_u_aspect};
    __pyx_mstate_global->__pyx_codeobj_tab[57] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_legacy_perspectiveWidget, __pyx_mstate->__pyx_n_u_build_projection, __pyx_mstate->__pyx_kp_b_iso88591_A_M_avQe1A_fD_t1_AQ_a_uBc_e1Baq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[57])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 303};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_event};
    __pyx_mstate_global->__pyx_codeobj_tab[58] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_legacy_perspectiveWidget, __pyx_mstate->__pyx_n_u_tkKeyPress, __pyx_mstate->__pyx_kp_b_iso88591_A_1E_4t1_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[58])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 314};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_file};
    __pyx_mstate_global->__pyx_codeobj_tab[59] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_legacy_perspectiveWidget, __pyx_mstate->__pyx_n_u_tkPrint, __pyx_mstate->__pyx_kp_b_iso88591_A_M, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[59])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 7};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_width, __pyx_mstate->__pyx_n_u_height, __pyx_mstate->__pyx_n_u_t, __pyx_mstate->__pyx_n_u_aspect, __pyx_mstate->__pyx_n_u_top, __pyx_mstate->__pyx_n_u_right};
    __pyx_mstate_global->__pyx_codeobj_tab[60] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_legacy_orthoWidget_pyx, __pyx_mstate->__pyx_n_u_build_projection, __pyx_mstate->__pyx_kp_b_iso88591_a_avQe1A_d_q_1A_M_AQ_a_4q_AQ_Qa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[60])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 23};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_event};
    __pyx_mstate_global->__pyx_codeobj_tab[61] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_legacy_orthoWidget_pyx, __pyx_mstate->__pyx_n_u_tkTranslate, __pyx_mstate->__pyx_kp_b_iso88591_A_G1_N_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[61])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 37};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[62] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_modern_data_based_texture, __pyx_mstate->__pyx_n_u_bind, __pyx_mstate->__pyx_kp_b_iso88591_A_QoT, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[62])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 40};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[63] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_modern_data_based_texture, __pyx_mstate->__pyx_n_u_unbind, __pyx_mstate->__pyx_kp_b_iso88591_A_QoQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[63])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 43};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[64] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_modern_data_based_texture, __pyx_mstate->__pyx_n_u_delete_resource, __pyx_mstate->__pyx_kp_b_iso88591_A_AT_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[64])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_texture_file, __pyx_mstate->__pyx_n_u_w, __pyx_mstate->__pyx_n_u_h, __pyx_mstate->__pyx_n_u_rows, __pyx_mstate->__pyx_n_u_info, __pyx_mstate->__pyx_n_u_data, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_row};
    __pyx_mstate_global->__pyx_codeobj_tab[65] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_modern_image_based_textur, __pyx_mstate->__pyx_n_u_init, __pyx_mstate->__pyx_kp_b_iso88591_A_3fG3gQm81_y_2Rr_Cwiq_2Rr_b_Rr, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[65])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 11, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 38};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_uniform_type, __pyx_mstate->__pyx_n_u_value, __pyx_mstate->__pyx_n_u_offset, __pyx_mstate->__pyx_n_u_l, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_j, __pyx_mstate->__pyx_n_u_k, __pyx_mstate->__pyx_n_u_float_array, __pyx_mstate->__pyx_n_u_int_array};
    __pyx_mstate_global->__pyx_codeobj_tab[66] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_modern_uniform_buffer_obj, __pyx_mstate->__pyx_n_u_set, __pyx_mstate->__pyx_kp_b_iso88591_A_Qa_1_1A_wd_b_D_iq_c_Q_T_A_U_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[66])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 101};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[67] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_modern_uniform_buffer_obj, __pyx_mstate->__pyx_n_u_commit, __pyx_mstate->__pyx_kp_b_iso88591_A_A_A_AQ_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[67])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 108};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_binding_point};
    __pyx_mstate_global->__pyx_codeobj_tab[68] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_modern_uniform_buffer_obj, __pyx_mstate->__pyx_n_u_bind_block, __pyx_mstate->__pyx_kp_b_iso88591_A_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[68])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 117};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[69] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_modern_uniform_buffer_obj, __pyx_mstate->__pyx_n_u_delete_resource, __pyx_mstate->__pyx_kp_b_iso88591_A_q_1D_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[69])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 123};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_name};
    __pyx_mstate_global->__pyx_codeobj_tab[70] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_modern_glsl_program_pyx, __pyx_mstate->__pyx_n_u_compile_and_link, __pyx_mstate->__pyx_kp_b_iso88591_A_4_at_4F_1_4_at_6fA_1_at_4q_at, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[70])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 138};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[71] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_modern_glsl_program_pyx, __pyx_mstate->__pyx_n_u_is_valid, __pyx_mstate->__pyx_kp_b_iso88591_A_t1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[71])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 18, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 141};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_name_to_type_and_value, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_j, __pyx_mstate->__pyx_n_u_l, __pyx_mstate->__pyx_n_u_loc, __pyx_mstate->__pyx_n_u_floats, __pyx_mstate->__pyx_n_u_integers, __pyx_mstate->__pyx_n_u_mat4_2, __pyx_mstate->__pyx_n_u_block_size, __pyx_mstate->__pyx_n_u_block_index, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_uniform_type, __pyx_mstate->__pyx_n_u_value, __pyx_mstate->__pyx_n_u_name_parts, __pyx_mstate->__pyx_n_u_uniform_name, __pyx_mstate->__pyx_n_u_block_name, __pyx_mstate->__pyx_n_u_buffer_object};
    __pyx_mstate_global->__pyx_codeobj_tab[72] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_modern_glsl_program_pyx, __pyx_mstate->__pyx_n_u_bind_uniforms, __pyx_mstate->__pyx_kp_b_iso88591_A_4t1_q_G_A_q_V1A_Rq_s_s_4q_7waq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[72])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 309};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[73] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_modern_glsl_program_pyx, __pyx_mstate->__pyx_n_u_use_program, __pyx_mstate->__pyx_kp_b_iso88591_A_AT, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[73])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 317};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_uniform_block};
    __pyx_mstate_global->__pyx_codeobj_tab[74] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_modern_glsl_program_pyx, __pyx_mstate->__pyx_n_u_delete_resource, __pyx_mstate->__pyx_kp_b_iso88591_A_T_8_q_at1_at1_q_A_a_Q_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[74])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 50};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[75] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_modern_vertex_buffer_pyx, __pyx_mstate->__pyx_n_u_bind, __pyx_mstate->__pyx_kp_b_iso88591_A_q_a_q_A_d_q_Qc_Q_b_A_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[75])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 71};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_vertex_data, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_j, __pyx_mstate->__pyx_n_u_num_bytes, __pyx_mstate->__pyx_n_u_verts, __pyx_mstate->__pyx_n_u_vertex};
    __pyx_mstate_global->__pyx_codeobj_tab[76] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_modern_vertex_buffer_pyx, __pyx_mstate->__pyx_n_u_load, __pyx_mstate->__pyx_kp_b_iso88591_A_N_Qk_Bd_b_1A_6_Yaq_E_at1_l_Bb, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[76])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 108};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[77] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_modern_vertex_buffer_pyx, __pyx_mstate->__pyx_n_u_delete_resource, __pyx_mstate->__pyx_kp_b_iso88591_A_q_1D_AS_Q_HA_HA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[77])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS), 46};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_parent, __pyx_mstate->__pyx_n_u_kw, __pyx_mstate->__pyx_n_u_missing_gl_function};
    __pyx_mstate_global->__pyx_codeobj_tab[78] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_modern_simple_image_shade, __pyx_mstate->__pyx_n_u_init, __pyx_mstate->__pyx_kp_b_iso88591_A_Ry_1_l_O5_3e1Be1Cq_Kq_1_L_A_M, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[78])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 70};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_texture_files, __pyx_mstate->__pyx_n_u_texture, __pyx_mstate->__pyx_n_u_texture_file, __pyx_mstate->__pyx_n_u_e};
    __pyx_mstate_global->__pyx_codeobj_tab[79] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_modern_simple_image_shade, __pyx_mstate->__pyx_n_u_set_textures, __pyx_mstate->__pyx_kp_b_iso88591_A_M_Kt1_1_L_A_a_1A_Q_A_Qa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[79])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 87};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_source, __pyx_mstate->__pyx_n_u_uniform_block_names_sizes_and_of};
    __pyx_mstate_global->__pyx_codeobj_tab[80] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_modern_simple_image_shade, __pyx_mstate->__pyx_n_u_set_fragment_shader_source, __pyx_mstate->__pyx_kp_b_iso88591_AKL_M_Kq_4A_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[80])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 97};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_width, __pyx_mstate->__pyx_n_u_height, __pyx_mstate->__pyx_n_u_as_float, __pyx_mstate->__pyx_n_u_fbo, __pyx_mstate->__pyx_n_u_color_texture_type, __pyx_mstate->__pyx_n_u_color_texture, __pyx_mstate->__pyx_n_u_depth_texture, __pyx_mstate->__pyx_n_u_array_type, __pyx_mstate->__pyx_n_u_c_array};
    __pyx_mstate_global->__pyx_codeobj_tab[81] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_modern_simple_image_shade, __pyx_mstate->__pyx_n_u_render_to_array, __pyx_mstate->__pyx_kp_b_iso88591_Q_M_1_Qc_QoQ_A_A_WA_q_q_Qc_QoQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[81])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 192};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_width, __pyx_mstate->__pyx_n_u_height, __pyx_mstate->__pyx_n_u_outfile, __pyx_mstate->__pyx_n_u_data, __pyx_mstate->__pyx_n_u_stride, __pyx_mstate->__pyx_n_u_rows, __pyx_mstate->__pyx_n_u_writer, __pyx_mstate->__pyx_n_u_i};
    __pyx_mstate_global->__pyx_codeobj_tab[82] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_modern_simple_image_shade, __pyx_mstate->__pyx_n_u_save_image, __pyx_mstate->__pyx_kp_b_iso88591_A_t_1G1_2Q_r_Qb_AQc_1_U_q_r_T_G1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[82])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 214};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_y, __pyx_mstate->__pyx_n_u_depth, __pyx_mstate->__pyx_n_u_width, __pyx_mstate->__pyx_n_u_height};
    __pyx_mstate_global->__pyx_codeobj_tab[83] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_modern_simple_image_shade, __pyx_mstate->__pyx_n_u_read_depth_value, __pyx_mstate->__pyx_kp_b_iso88591_A_L_M_Jawa_Q_AS_r_Cq_q_wa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[83])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 233};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_width, __pyx_mstate->__pyx_n_u_height, __pyx_mstate->__pyx_n_u_include_depth_value, __pyx_mstate->__pyx_n_u_start_time, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_texture};
    __pyx_mstate_global->__pyx_codeobj_tab[84] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_modern_simple_image_shade, __pyx_mstate->__pyx_n_u_draw_impl, __pyx_mstate->__pyx_kp_b_iso88591_A_4q_U_3c_1_1A_AQ_Qa_4_IQ_iq_A_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[84])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 273};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_width, __pyx_mstate->__pyx_n_u_height};
    __pyx_mstate_global->__pyx_codeobj_tab[85] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_modern_simple_image_shade, __pyx_mstate->__pyx_n_u_draw, __pyx_mstate->__pyx_kp_b_iso88591_A_L_6_Bc_1_M_Jawa_M_4q_1A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[85])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 286};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_view_width, __pyx_mstate->__pyx_n_u_view_height};
    __pyx_mstate_global->__pyx_codeobj_tab[86] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_modern_simple_image_shade, __pyx_mstate->__pyx_n_u_get_uniform_bindings, __pyx_mstate->__pyx_kp_b_iso88591_A_i_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[86])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 156};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_y, __pyx_mstate->__pyx_n_u_z};
    __pyx_mstate_global->__pyx_codeobj_tab[87] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_modern_glsl_perspective_v, __pyx_mstate->__pyx_n_u_translate, __pyx_mstate->__pyx_kp_b_iso88591_A_a_E_ar_A_1A_QfAQa_Qaq_aq_Qaq_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[87])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 170};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_theta, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_y, __pyx_mstate->__pyx_n_u_z};
    __pyx_mstate_global->__pyx_codeobj_tab[88] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_modern_glsl_perspective_v, __pyx_mstate->__pyx_n_u_rotate, __pyx_mstate->__pyx_kp_b_iso88591_A_A_A_2Q_1HAQhaq_1HAQir_1AZq_1HA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[88])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 189};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_view_width, __pyx_mstate->__pyx_n_u_view_height, __pyx_mstate->__pyx_n_u_to_py, __pyx_mstate->__pyx_n_u_to_py};
    __pyx_mstate_global->__pyx_codeobj_tab[89] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_modern_glsl_perspective_v, __pyx_mstate->__pyx_n_u_get_uniform_bindings, __pyx_mstate->__pyx_kp_b_iso88591_A_L_Q_q_A_Qd_at1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[89])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS), 8};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_master, __pyx_mstate->__pyx_n_u_cnf, __pyx_mstate->__pyx_n_u_kw};
    __pyx_mstate_global->__pyx_codeobj_tab[90] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_modern_glsl_perspective_w, __pyx_mstate->__pyx_n_u_init, __pyx_mstate->__pyx_kp_b_iso88591_1_y_xt6_9AQ_M_Kq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[90])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 15};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_obj};
    __pyx_mstate_global->__pyx_codeobj_tab[91] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_modern_glsl_perspective_w, __pyx_mstate->__pyx_n_u_add_object, __pyx_mstate->__pyx_kp_b_iso88591_A_HG1A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[91])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 18};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_width, __pyx_mstate->__pyx_n_u_height, __pyx_mstate->__pyx_n_u_skip_swap_buffers, __pyx_mstate->__pyx_n_u_object_2};
    __pyx_mstate_global->__pyx_codeobj_tab[92] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_modern_glsl_perspective_w, __pyx_mstate->__pyx_n_u_redraw, __pyx_mstate->__pyx_kp_b_iso88591_A_3c_AU_uA_q_Ba_Jd_q_q_4q_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[92])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 21};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_view_width, __pyx_mstate->__pyx_n_u_view_height};
    __pyx_mstate_global->__pyx_codeobj_tab[93] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_modern_triangle_pyx, __pyx_mstate->__pyx_n_u_draw, __pyx_mstate->__pyx_kp_b_iso88591_A_I_I_1_Ql_O5_A_3a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[93])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 37};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[94] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_modern_triangle_pyx, __pyx_mstate->__pyx_n_u_delete_resource, __pyx_mstate->__pyx_kp_b_iso88591_A_O_1_I_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[94])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 41};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_view_width, __pyx_mstate->__pyx_n_u_view_height};
    __pyx_mstate_global->__pyx_codeobj_tab[95] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_opengl_modern_triangle_pyx, __pyx_mstate->__pyx_n_u_get_uniform_bindings, __pyx_mstate->__pyx_kp_b_iso88591_A_t_31L, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[95])) goto bad;
  }
  Py_DECREF(tuple_dedup_map);
  return 0;
  bad:
  Py_DECREF(tuple_dedup_map);
  return -1;
}
/* #### Code section: init_globals ### */

static int __Pyx_InitGlobals(void) {
  /* PythonCompatibility.init */
  if (likely(__Pyx_init_co_variables() == 0)); else
  
  if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)

  /* AssertionsEnabled.init */
  if (likely(__Pyx_init_assertions_enabled() == 0)); else
  
  if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)

  /* CommonTypesMetaclass.init */
  if (likely(__pyx_CommonTypesMetaclass_init(__pyx_m) == 0)); else
  
  if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)

  /* CachedMethodType.init */
  #if CYTHON_COMPILING_IN_LIMITED_API
  {
      PyObject *typesModule=NULL;
      typesModule = PyImport_ImportModule("types");
      if (typesModule) {
          __pyx_mstate_global->__Pyx_CachedMethodType = PyObject_GetAttrString(typesModule, "MethodType");
          Py_DECREF(typesModule);
      }
  } // error handling follows
  #endif
  
  if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)

  /* CythonFunctionShared.init */
  if (likely(__pyx_CyFunction_init(__pyx_m) == 0)); else
  
  if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)

  /* Generator.init */
  if (likely(__pyx_Generator_init(__pyx_m) == 0)); else
  
  if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)

  return 0;
  __pyx_L1_error:;
  return -1;
}
/* #### Code section: cleanup_globals ### */
/* #### Code section: cleanup_module ### */
/* #### Code section: main_method ### */
/* #### Code section: utility_code_pragmas ### */
#ifdef _MSC_VER
#pragma warning( push )
/* Warning 4127: conditional expression is constant
 * Cython uses constant conditional expressions to allow in inline functions to be optimized at
 * compile-time, so this warning is not useful
 */
#pragma warning( disable : 4127 )
#endif



/* #### Code section: utility_code_def ### */

/* --- Runtime support code --- */
/* Refnanny */
#if CYTHON_REFNANNY
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
    PyObject *m = NULL, *p = NULL;
    void *r = NULL;
    m = PyImport_ImportModule(modname);
    if (!m) goto end;
    p = PyObject_GetAttrString(m, "RefNannyAPI");
    if (!p) goto end;
    r = PyLong_AsVoidPtr(p);
end:
    Py_XDECREF(p);
    Py_XDECREF(m);
    return (__Pyx_RefNannyAPIStruct *)r;
}
#endif

/* PyErrExceptionMatches (used by PyObjectGetAttrStrNoError) */
#if CYTHON_FAST_THREAD_STATE
static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
    Py_ssize_t i, n;
    n = PyTuple_GET_SIZE(tuple);
    for (i=0; i<n; i++) {
        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
    }
    for (i=0; i<n; i++) {
        if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
    }
    return 0;
}
static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
    int result;
    PyObject *exc_type;
#if PY_VERSION_HEX >= 0x030C00A6
    PyObject *current_exception = tstate->current_exception;
    if (unlikely(!current_exception)) return 0;
    exc_type = (PyObject*) Py_TYPE(current_exception);
    if (exc_type == err) return 1;
#else
    exc_type = tstate->curexc_type;
    if (exc_type == err) return 1;
    if (unlikely(!exc_type)) return 0;
#endif
    #if CYTHON_AVOID_BORROWED_REFS
    Py_INCREF(exc_type);
    #endif
    if (unlikely(PyTuple_Check(err))) {
        result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
    } else {
        result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
    }
    #if CYTHON_AVOID_BORROWED_REFS
    Py_DECREF(exc_type);
    #endif
    return result;
}
#endif

/* PyErrFetchRestore (used by PyObjectGetAttrStrNoError) */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
#if PY_VERSION_HEX >= 0x030C00A6
    PyObject *tmp_value;
    assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value)));
    if (value) {
        #if CYTHON_COMPILING_IN_CPYTHON
        if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb))
        #endif
            PyException_SetTraceback(value, tb);
    }
    tmp_value = tstate->current_exception;
    tstate->current_exception = value;
    Py_XDECREF(tmp_value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
#else
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    tmp_type = tstate->curexc_type;
    tmp_value = tstate->curexc_value;
    tmp_tb = tstate->curexc_traceback;
    tstate->curexc_type = type;
    tstate->curexc_value = value;
    tstate->curexc_traceback = tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#endif
}
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
#if PY_VERSION_HEX >= 0x030C00A6
    PyObject* exc_value;
    exc_value = tstate->current_exception;
    tstate->current_exception = 0;
    *value = exc_value;
    *type = NULL;
    *tb = NULL;
    if (exc_value) {
        *type = (PyObject*) Py_TYPE(exc_value);
        Py_INCREF(*type);
        #if CYTHON_COMPILING_IN_CPYTHON
        *tb = ((PyBaseExceptionObject*) exc_value)->traceback;
        Py_XINCREF(*tb);
        #else
        *tb = PyException_GetTraceback(exc_value);
        #endif
    }
#else
    *type = tstate->curexc_type;
    *value = tstate->curexc_value;
    *tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
#endif
}
#endif

/* PyObjectGetAttrStr (used by PyObjectGetAttrStrNoError) */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_getattro))
        return tp->tp_getattro(obj, attr_name);
    return PyObject_GetAttr(obj, attr_name);
}
#endif

/* PyObjectGetAttrStrNoError (used by GetBuiltinName) */
#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
        __Pyx_PyErr_Clear();
}
#endif
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
    PyObject *result;
#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
    (void) PyObject_GetOptionalAttr(obj, attr_name, &result);
    return result;
#else
#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
        return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
    }
#endif
    result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
    if (unlikely(!result)) {
        __Pyx_PyObject_GetAttrStr_ClearAttributeError();
    }
    return result;
#endif
}

/* GetBuiltinName */
static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
    PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_mstate_global->__pyx_b, name);
    if (unlikely(!result) && !PyErr_Occurred()) {
        PyErr_Format(PyExc_NameError,
            "name '%U' is not defined", name);
    }
    return result;
}

/* GetTopmostException (used by SaveResetException) */
#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
static _PyErr_StackItem *
__Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
{
    _PyErr_StackItem *exc_info = tstate->exc_info;
    while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) &&
           exc_info->previous_item != NULL)
    {
        exc_info = exc_info->previous_item;
    }
    return exc_info;
}
#endif

/* SaveResetException */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
  #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
    _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
    PyObject *exc_value = exc_info->exc_value;
    if (exc_value == NULL || exc_value == Py_None) {
        *value = NULL;
        *type = NULL;
        *tb = NULL;
    } else {
        *value = exc_value;
        Py_INCREF(*value);
        *type = (PyObject*) Py_TYPE(exc_value);
        Py_INCREF(*type);
        *tb = PyException_GetTraceback(exc_value);
    }
  #elif CYTHON_USE_EXC_INFO_STACK
    _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
    *type = exc_info->exc_type;
    *value = exc_info->exc_value;
    *tb = exc_info->exc_traceback;
    Py_XINCREF(*type);
    Py_XINCREF(*value);
    Py_XINCREF(*tb);
  #else
    *type = tstate->exc_type;
    *value = tstate->exc_value;
    *tb = tstate->exc_traceback;
    Py_XINCREF(*type);
    Py_XINCREF(*value);
    Py_XINCREF(*tb);
  #endif
}
static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
  #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
    _PyErr_StackItem *exc_info = tstate->exc_info;
    PyObject *tmp_value = exc_info->exc_value;
    exc_info->exc_value = value;
    Py_XDECREF(tmp_value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
  #else
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    #if CYTHON_USE_EXC_INFO_STACK
    _PyErr_StackItem *exc_info = tstate->exc_info;
    tmp_type = exc_info->exc_type;
    tmp_value = exc_info->exc_value;
    tmp_tb = exc_info->exc_traceback;
    exc_info->exc_type = type;
    exc_info->exc_value = value;
    exc_info->exc_traceback = tb;
    #else
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = type;
    tstate->exc_value = value;
    tstate->exc_traceback = tb;
    #endif
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
  #endif
}
#endif

/* FastTypeChecks */
#if CYTHON_COMPILING_IN_CPYTHON
static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
    while (a) {
        a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*);
        if (a == b)
            return 1;
    }
    return b == &PyBaseObject_Type;
}
static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
    PyObject *mro;
    if (a == b) return 1;
    mro = a->tp_mro;
    if (likely(mro)) {
        Py_ssize_t i, n;
        n = PyTuple_GET_SIZE(mro);
        for (i = 0; i < n; i++) {
            if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
                return 1;
        }
        return 0;
    }
    return __Pyx_InBases(a, b);
}
static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) {
    PyObject *mro;
    if (cls == a || cls == b) return 1;
    mro = cls->tp_mro;
    if (likely(mro)) {
        Py_ssize_t i, n;
        n = PyTuple_GET_SIZE(mro);
        for (i = 0; i < n; i++) {
            PyObject *base = PyTuple_GET_ITEM(mro, i);
            if (base == (PyObject *)a || base == (PyObject *)b)
                return 1;
        }
        return 0;
    }
    return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b);
}
static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
    if (exc_type1) {
        return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2);
    } else {
        return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
    }
}
static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
    Py_ssize_t i, n;
    assert(PyExceptionClass_Check(exc_type));
    n = PyTuple_GET_SIZE(tuple);
    for (i=0; i<n; i++) {
        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
    }
    for (i=0; i<n; i++) {
        PyObject *t = PyTuple_GET_ITEM(tuple, i);
        if (likely(PyExceptionClass_Check(t))) {
            if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
        } else {
        }
    }
    return 0;
}
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
    if (likely(err == exc_type)) return 1;
    if (likely(PyExceptionClass_Check(err))) {
        if (likely(PyExceptionClass_Check(exc_type))) {
            return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
        } else if (likely(PyTuple_Check(exc_type))) {
            return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
        } else {
        }
    }
    return PyErr_GivenExceptionMatches(err, exc_type);
}
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
    assert(PyExceptionClass_Check(exc_type1));
    assert(PyExceptionClass_Check(exc_type2));
    if (likely(err == exc_type1 || err == exc_type2)) return 1;
    if (likely(PyExceptionClass_Check(err))) {
        return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
    }
    return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
}
#endif

/* TupleAndListFromArray (used by fastcall) */
#if !CYTHON_COMPILING_IN_CPYTHON && CYTHON_METH_FASTCALL
static CYTHON_INLINE PyObject *
__Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n)
{
    PyObject *res;
    Py_ssize_t i;
    if (n <= 0) {
        return __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_tuple);
    }
    res = PyTuple_New(n);
    if (unlikely(res == NULL)) return NULL;
    for (i = 0; i < n; i++) {
        Py_INCREF(src[i]);
        if (unlikely(__Pyx_PyTuple_SET_ITEM(res, i, src[i]) < (0))) {
            Py_DECREF(res);
            return NULL;
        }
    }
    return res;
}
#elif CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) {
    PyObject *v;
    Py_ssize_t i;
    for (i = 0; i < length; i++) {
        v = dest[i] = src[i];
        Py_INCREF(v);
    }
}
static CYTHON_INLINE PyObject *
__Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n)
{
    PyObject *res;
    if (n <= 0) {
        return __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_tuple);
    }
    res = PyTuple_New(n);
    if (unlikely(res == NULL)) return NULL;
    __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n);
    return res;
}
static CYTHON_INLINE PyObject *
__Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n)
{
    PyObject *res;
    if (n <= 0) {
        return PyList_New(0);
    }
    res = PyList_New(n);
    if (unlikely(res == NULL)) return NULL;
    __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n);
    return res;
}
#endif

/* BytesEquals (used by UnicodeEquals) */
static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL ||\
        !(CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS)
    return PyObject_RichCompareBool(s1, s2, equals);
#else
    if (s1 == s2) {
        return (equals == Py_EQ);
    } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
        const char *ps1, *ps2;
        Py_ssize_t length = PyBytes_GET_SIZE(s1);
        if (length != PyBytes_GET_SIZE(s2))
            return (equals == Py_NE);
        ps1 = PyBytes_AS_STRING(s1);
        ps2 = PyBytes_AS_STRING(s2);
        if (ps1[0] != ps2[0]) {
            return (equals == Py_NE);
        } else if (length == 1) {
            return (equals == Py_EQ);
        } else {
            int result;
#if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000)
            Py_hash_t hash1, hash2;
            hash1 = ((PyBytesObject*)s1)->ob_shash;
            hash2 = ((PyBytesObject*)s2)->ob_shash;
            if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
                return (equals == Py_NE);
            }
#endif
            result = memcmp(ps1, ps2, (size_t)length);
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
        return (equals == Py_NE);
    } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
        return (equals == Py_NE);
    } else {
        int result;
        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
        if (!py_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
#endif
}

/* UnicodeEquals (used by fastcall) */
static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL
    return PyObject_RichCompareBool(s1, s2, equals);
#else
    int s1_is_unicode, s2_is_unicode;
    if (s1 == s2) {
        goto return_eq;
    }
    s1_is_unicode = PyUnicode_CheckExact(s1);
    s2_is_unicode = PyUnicode_CheckExact(s2);
    if (s1_is_unicode & s2_is_unicode) {
        Py_ssize_t length, length2;
        int kind;
        void *data1, *data2;
        #if !CYTHON_COMPILING_IN_LIMITED_API
        if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
            return -1;
        #endif
        length = __Pyx_PyUnicode_GET_LENGTH(s1);
        #if !CYTHON_ASSUME_SAFE_SIZE
        if (unlikely(length < 0)) return -1;
        #endif
        length2 = __Pyx_PyUnicode_GET_LENGTH(s2);
        #if !CYTHON_ASSUME_SAFE_SIZE
        if (unlikely(length2 < 0)) return -1;
        #endif
        if (length != length2) {
            goto return_ne;
        }
#if CYTHON_USE_UNICODE_INTERNALS
        {
            Py_hash_t hash1, hash2;
            hash1 = ((PyASCIIObject*)s1)->hash;
            hash2 = ((PyASCIIObject*)s2)->hash;
            if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
                goto return_ne;
            }
        }
#endif
        kind = __Pyx_PyUnicode_KIND(s1);
        if (kind != __Pyx_PyUnicode_KIND(s2)) {
            goto return_ne;
        }
        data1 = __Pyx_PyUnicode_DATA(s1);
        data2 = __Pyx_PyUnicode_DATA(s2);
        if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
            goto return_ne;
        } else if (length == 1) {
            goto return_eq;
        } else {
            int result = memcmp(data1, data2, (size_t)(length * kind));
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & s2_is_unicode) {
        goto return_ne;
    } else if ((s2 == Py_None) & s1_is_unicode) {
        goto return_ne;
    } else {
        int result;
        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
        if (!py_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
return_eq:
    return (equals == Py_EQ);
return_ne:
    return (equals == Py_NE);
#endif
}

/* fastcall */
#if CYTHON_METH_FASTCALL
static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s)
{
    Py_ssize_t i, n = __Pyx_PyTuple_GET_SIZE(kwnames);
    #if !CYTHON_ASSUME_SAFE_SIZE
    if (unlikely(n == -1)) return NULL;
    #endif
    for (i = 0; i < n; i++)
    {
        PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i);
        #if !CYTHON_ASSUME_SAFE_MACROS
        if (unlikely(!namei)) return NULL;
        #endif
        if (s == namei) return kwvalues[i];
    }
    for (i = 0; i < n; i++)
    {
        PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i);
        #if !CYTHON_ASSUME_SAFE_MACROS
        if (unlikely(!namei)) return NULL;
        #endif
        int eq = __Pyx_PyUnicode_Equals(s, namei, Py_EQ);
        if (unlikely(eq != 0)) {
            if (unlikely(eq < 0)) return NULL;
            return kwvalues[i];
        }
    }
    return NULL;
}
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API
CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) {
    Py_ssize_t i, nkwargs;
    PyObject *dict;
#if !CYTHON_ASSUME_SAFE_SIZE
    nkwargs = PyTuple_Size(kwnames);
    if (unlikely(nkwargs < 0)) return NULL;
#else
    nkwargs = PyTuple_GET_SIZE(kwnames);
#endif
    dict = PyDict_New();
    if (unlikely(!dict))
        return NULL;
    for (i=0; i<nkwargs; i++) {
#if !CYTHON_ASSUME_SAFE_MACROS
        PyObject *key = PyTuple_GetItem(kwnames, i);
        if (!key) goto bad;
#else
        PyObject *key = PyTuple_GET_ITEM(kwnames, i);
#endif
        if (unlikely(PyDict_SetItem(dict, key, kwvalues[i]) < 0))
            goto bad;
    }
    return dict;
bad:
    Py_DECREF(dict);
    return NULL;
}
#endif
#endif

/* PyObjectCall (used by PyObjectFastCall) */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyObject *result;
    ternaryfunc call = Py_TYPE(func)->tp_call;
    if (unlikely(!call))
        return PyObject_Call(func, arg, kw);
    if (unlikely(Py_EnterRecursiveCall(" while calling a Python object")))
        return NULL;
    result = (*call)(func, arg, kw);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

/* PyObjectCallMethO (used by PyObjectFastCall) */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
    PyObject *self, *result;
    PyCFunction cfunc;
    cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func);
    self = __Pyx_CyOrPyCFunction_GET_SELF(func);
    if (unlikely(Py_EnterRecursiveCall(" while calling a Python object")))
        return NULL;
    result = cfunc(self, arg);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

/* PyObjectFastCall (used by PyObjectCallOneArg) */
#if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API
static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject * const*args, size_t nargs, PyObject *kwargs) {
    PyObject *argstuple;
    PyObject *result = 0;
    size_t i;
    argstuple = PyTuple_New((Py_ssize_t)nargs);
    if (unlikely(!argstuple)) return NULL;
    for (i = 0; i < nargs; i++) {
        Py_INCREF(args[i]);
        if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) != (0)) goto bad;
    }
    result = __Pyx_PyObject_Call(func, argstuple, kwargs);
  bad:
    Py_DECREF(argstuple);
    return result;
}
#endif
#if CYTHON_VECTORCALL && !CYTHON_COMPILING_IN_LIMITED_API
  #if PY_VERSION_HEX < 0x03090000
    #define __Pyx_PyVectorcall_Function(callable) _PyVectorcall_Function(callable)
  #elif CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE vectorcallfunc __Pyx_PyVectorcall_Function(PyObject *callable) {
    PyTypeObject *tp = Py_TYPE(callable);
    #if defined(__Pyx_CyFunction_USED)
    if (__Pyx_CyFunction_CheckExact(callable)) {
        return __Pyx_CyFunction_func_vectorcall(callable);
    }
    #endif
    if (!PyType_HasFeature(tp, Py_TPFLAGS_HAVE_VECTORCALL)) {
        return NULL;
    }
    assert(PyCallable_Check(callable));
    Py_ssize_t offset = tp->tp_vectorcall_offset;
    assert(offset > 0);
    vectorcallfunc ptr;
    memcpy(&ptr, (char *) callable + offset, sizeof(ptr));
    return ptr;
}
  #else
    #define __Pyx_PyVectorcall_Function(callable) PyVectorcall_Function(callable)
  #endif
#endif
static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject *const *args, size_t _nargs, PyObject *kwargs) {
    Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs);
#if CYTHON_COMPILING_IN_CPYTHON
    if (nargs == 0 && kwargs == NULL) {
        if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS))
            return __Pyx_PyObject_CallMethO(func, NULL);
    }
    else if (nargs == 1 && kwargs == NULL) {
        if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O))
            return __Pyx_PyObject_CallMethO(func, args[0]);
    }
#endif
    if (kwargs == NULL) {
        #if CYTHON_VECTORCALL
          #if CYTHON_COMPILING_IN_LIMITED_API
            return PyObject_Vectorcall(func, args, _nargs, NULL);
          #else
            vectorcallfunc f = __Pyx_PyVectorcall_Function(func);
            if (f) {
                return f(func, args, _nargs, NULL);
            }
          #endif
        #endif
    }
    if (nargs == 0) {
        return __Pyx_PyObject_Call(func, __pyx_mstate_global->__pyx_empty_tuple, kwargs);
    }
    #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API
    return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs);
    #else
    return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs);
    #endif
}

/* PyObjectCallOneArg (used by CallUnboundCMethod0) */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *args[2] = {NULL, arg};
    return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
}

/* UnpackUnboundCMethod (used by CallUnboundCMethod0) */
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000
static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) {
    PyObject *result;
    PyObject *selfless_args = PyTuple_GetSlice(args, 1, PyTuple_Size(args));
    if (unlikely(!selfless_args)) return NULL;
    result = PyObject_Call(method, selfless_args, kwargs);
    Py_DECREF(selfless_args);
    return result;
}
#elif CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03090000
static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) {
        return _PyObject_Vectorcall
            (method, args ? args+1 : NULL, nargs ? nargs-1 : 0, kwnames);
}
#else
static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) {
    return
#if PY_VERSION_HEX < 0x03090000
    _PyObject_Vectorcall
#else
    PyObject_Vectorcall
#endif
        (method, args ? args+1 : NULL, nargs ? (size_t) nargs-1 : 0, kwnames);
}
#endif
static PyMethodDef __Pyx_UnboundCMethod_Def = {
     "CythonUnboundCMethod",
     __PYX_REINTERPRET_FUNCION(PyCFunction, __Pyx_SelflessCall),
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000
     METH_VARARGS | METH_KEYWORDS,
#else
     METH_FASTCALL | METH_KEYWORDS,
#endif
     NULL
};
static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) {
    PyObject *method, *result=NULL;
    method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name);
    if (unlikely(!method))
        return -1;
    result = method;
#if CYTHON_COMPILING_IN_CPYTHON
    if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type)))
    {
        PyMethodDescrObject *descr = (PyMethodDescrObject*) method;
        target->func = descr->d_method->ml_meth;
        target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_STACKLESS);
    } else
#endif
#if CYTHON_COMPILING_IN_PYPY
#else
    if (PyCFunction_Check(method))
#endif
    {
        PyObject *self;
        int self_found;
#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
        self = PyObject_GetAttrString(method, "__self__");
        if (!self) {
            PyErr_Clear();
        }
#else
        self = PyCFunction_GET_SELF(method);
#endif
        self_found = (self && self != Py_None);
#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
        Py_XDECREF(self);
#endif
        if (self_found) {
            PyObject *unbound_method = PyCFunction_New(&__Pyx_UnboundCMethod_Def, method);
            if (unlikely(!unbound_method)) return -1;
            Py_DECREF(method);
            result = unbound_method;
        }
    }
#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    if (unlikely(target->method)) {
        Py_DECREF(result);
    } else
#endif
    target->method = result;
    return 0;
}

/* CallUnboundCMethod0 */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) {
    int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc);
    if (likely(was_initialized == 2 && cfunc->func)) {
        if (likely(cfunc->flag == METH_NOARGS))
            return __Pyx_CallCFunction(cfunc, self, NULL);
        if (likely(cfunc->flag == METH_FASTCALL))
            return __Pyx_CallCFunctionFast(cfunc, self, NULL, 0);
        if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS))
            return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, NULL, 0, NULL);
        if (likely(cfunc->flag == (METH_VARARGS | METH_KEYWORDS)))
            return __Pyx_CallCFunctionWithKeywords(cfunc, self, __pyx_mstate_global->__pyx_empty_tuple, NULL);
        if (cfunc->flag == METH_VARARGS)
            return __Pyx_CallCFunction(cfunc, self, __pyx_mstate_global->__pyx_empty_tuple);
        return __Pyx__CallUnboundCMethod0(cfunc, self);
    }
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    else if (unlikely(was_initialized == 1)) {
        __Pyx_CachedCFunction tmp_cfunc = {
#ifndef __cplusplus
            0
#endif
        };
        tmp_cfunc.type = cfunc->type;
        tmp_cfunc.method_name = cfunc->method_name;
        return __Pyx__CallUnboundCMethod0(&tmp_cfunc, self);
    }
#endif
    PyObject *result = __Pyx__CallUnboundCMethod0(cfunc, self);
    __Pyx_CachedCFunction_SetFinishedInitializing(cfunc);
    return result;
}
#endif
static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) {
    PyObject *result;
    if (unlikely(!cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
    result = __Pyx_PyObject_CallOneArg(cfunc->method, self);
    return result;
}

/* py_dict_items (used by OwnedDictNext) */
static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d) {
    return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_items, d);
}

/* py_dict_values (used by OwnedDictNext) */
static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d) {
    return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_values, d);
}

/* OwnedDictNext (used by ParseKeywordsImpl) */
#if CYTHON_AVOID_BORROWED_REFS
static int __Pyx_PyDict_NextRef(PyObject *p, PyObject **ppos, PyObject **pkey, PyObject **pvalue) {
    PyObject *next = NULL;
    if (!*ppos) {
        if (pvalue) {
            PyObject *dictview = pkey ? __Pyx_PyDict_Items(p) : __Pyx_PyDict_Values(p);
            if (unlikely(!dictview)) goto bad;
            *ppos = PyObject_GetIter(dictview);
            Py_DECREF(dictview);
        } else {
            *ppos = PyObject_GetIter(p);
        }
        if (unlikely(!*ppos)) goto bad;
    }
    next = PyIter_Next(*ppos);
    if (!next) {
        if (PyErr_Occurred()) goto bad;
        return 0;
    }
    if (pkey && pvalue) {
        *pkey = __Pyx_PySequence_ITEM(next, 0);
        if (unlikely(*pkey)) goto bad;
        *pvalue = __Pyx_PySequence_ITEM(next, 1);
        if (unlikely(*pvalue)) goto bad;
        Py_DECREF(next);
    } else if (pkey) {
        *pkey = next;
    } else {
        assert(pvalue);
        *pvalue = next;
    }
    return 1;
  bad:
    Py_XDECREF(next);
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000
    PyErr_FormatUnraisable("Exception ignored in __Pyx_PyDict_NextRef");
#else
    PyErr_WriteUnraisable(__pyx_mstate_global->__pyx_n_u_Pyx_PyDict_NextRef);
#endif
    if (pkey) *pkey = NULL;
    if (pvalue) *pvalue = NULL;
    return 0;
}
#else // !CYTHON_AVOID_BORROWED_REFS
static int __Pyx_PyDict_NextRef(PyObject *p, Py_ssize_t *ppos, PyObject **pkey, PyObject **pvalue) {
    int result = PyDict_Next(p, ppos, pkey, pvalue);
    if (likely(result == 1)) {
        if (pkey) Py_INCREF(*pkey);
        if (pvalue) Py_INCREF(*pvalue);
    }
    return result;
}
#endif

/* RaiseDoubleKeywords (used by ParseKeywordsImpl) */
static void __Pyx_RaiseDoubleKeywordsError(
    const char* func_name,
    PyObject* kw_name)
{
    PyErr_Format(PyExc_TypeError,
        "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
}

/* CallUnboundCMethod2 */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) {
    int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc);
    if (likely(was_initialized == 2 && cfunc->func)) {
        PyObject *args[2] = {arg1, arg2};
        if (cfunc->flag == METH_FASTCALL) {
            return __Pyx_CallCFunctionFast(cfunc, self, args, 2);
        }
        if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS))
            return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, args, 2, NULL);
    }
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    else if (unlikely(was_initialized == 1)) {
        __Pyx_CachedCFunction tmp_cfunc = {
#ifndef __cplusplus
            0
#endif
        };
        tmp_cfunc.type = cfunc->type;
        tmp_cfunc.method_name = cfunc->method_name;
        return __Pyx__CallUnboundCMethod2(&tmp_cfunc, self, arg1, arg2);
    }
#endif
    PyObject *result = __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2);
    __Pyx_CachedCFunction_SetFinishedInitializing(cfunc);
    return result;
}
#endif
static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2){
    if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
#if CYTHON_COMPILING_IN_CPYTHON
    if (cfunc->func && (cfunc->flag & METH_VARARGS)) {
        PyObject *result = NULL;
        PyObject *args = PyTuple_New(2);
        if (unlikely(!args)) return NULL;
        Py_INCREF(arg1);
        PyTuple_SET_ITEM(args, 0, arg1);
        Py_INCREF(arg2);
        PyTuple_SET_ITEM(args, 1, arg2);
        if (cfunc->flag & METH_KEYWORDS)
            result = __Pyx_CallCFunctionWithKeywords(cfunc, self, args, NULL);
        else
            result = __Pyx_CallCFunction(cfunc, self, args);
        Py_DECREF(args);
        return result;
    }
#endif
    {
        PyObject *args[4] = {NULL, self, arg1, arg2};
        return __Pyx_PyObject_FastCall(cfunc->method, args+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
    }
}

/* ParseKeywordsImpl (used by ParseKeywords) */
static int __Pyx_ValidateDuplicatePosArgs(
    PyObject *kwds,
    PyObject ** const argnames[],
    PyObject ** const *first_kw_arg,
    const char* function_name)
{
    PyObject ** const *name = argnames;
    while (name != first_kw_arg) {
        PyObject *key = **name;
        int found = PyDict_Contains(kwds, key);
        if (unlikely(found)) {
            if (found == 1) __Pyx_RaiseDoubleKeywordsError(function_name, key);
            goto bad;
        }
        name++;
    }
    return 0;
bad:
    return -1;
}
#if CYTHON_USE_UNICODE_INTERNALS
static CYTHON_INLINE int __Pyx_UnicodeKeywordsEqual(PyObject *s1, PyObject *s2) {
    int kind;
    Py_ssize_t len = PyUnicode_GET_LENGTH(s1);
    if (len != PyUnicode_GET_LENGTH(s2)) return 0;
    kind = PyUnicode_KIND(s1);
    if (kind != PyUnicode_KIND(s2)) return 0;
    const void *data1 = PyUnicode_DATA(s1);
    const void *data2 = PyUnicode_DATA(s2);
    return (memcmp(data1, data2, (size_t) len * (size_t) kind) == 0);
}
#endif
static int __Pyx_MatchKeywordArg_str(
    PyObject *key,
    PyObject ** const argnames[],
    PyObject ** const *first_kw_arg,
    size_t *index_found,
    const char *function_name)
{
    PyObject ** const *name;
    #if CYTHON_USE_UNICODE_INTERNALS
    Py_hash_t key_hash = ((PyASCIIObject*)key)->hash;
    if (unlikely(key_hash == -1)) {
        key_hash = PyObject_Hash(key);
        if (unlikely(key_hash == -1))
            goto bad;
    }
    #endif
    name = first_kw_arg;
    while (*name) {
        PyObject *name_str = **name;
        #if CYTHON_USE_UNICODE_INTERNALS
        if (key_hash == ((PyASCIIObject*)name_str)->hash && __Pyx_UnicodeKeywordsEqual(name_str, key)) {
            *index_found = (size_t) (name - argnames);
            return 1;
        }
        #else
        #if CYTHON_ASSUME_SAFE_SIZE
        if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key))
        #endif
        {
            int cmp = PyUnicode_Compare(name_str, key);
            if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
            if (cmp == 0) {
                *index_found = (size_t) (name - argnames);
                return 1;
            }
        }
        #endif
        name++;
    }
    name = argnames;
    while (name != first_kw_arg) {
        PyObject *name_str = **name;
        #if CYTHON_USE_UNICODE_INTERNALS
        if (unlikely(key_hash == ((PyASCIIObject*)name_str)->hash)) {
            if (__Pyx_UnicodeKeywordsEqual(name_str, key))
                goto arg_passed_twice;
        }
        #else
        #if CYTHON_ASSUME_SAFE_SIZE
        if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key))
        #endif
        {
            if (unlikely(name_str == key)) goto arg_passed_twice;
            int cmp = PyUnicode_Compare(name_str, key);
            if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
            if (cmp == 0) goto arg_passed_twice;
        }
        #endif
        name++;
    }
    return 0;
arg_passed_twice:
    __Pyx_RaiseDoubleKeywordsError(function_name, key);
    goto bad;
bad:
    return -1;
}
static int __Pyx_MatchKeywordArg_nostr(
    PyObject *key,
    PyObject ** const argnames[],
    PyObject ** const *first_kw_arg,
    size_t *index_found,
    const char *function_name)
{
    PyObject ** const *name;
    if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type;
    name = first_kw_arg;
    while (*name) {
        int cmp = PyObject_RichCompareBool(**name, key, Py_EQ);
        if (cmp == 1) {
            *index_found = (size_t) (name - argnames);
            return 1;
        }
        if (unlikely(cmp == -1)) goto bad;
        name++;
    }
    name = argnames;
    while (name != first_kw_arg) {
        int cmp = PyObject_RichCompareBool(**name, key, Py_EQ);
        if (unlikely(cmp != 0)) {
            if (cmp == 1) goto arg_passed_twice;
            else goto bad;
        }
        name++;
    }
    return 0;
arg_passed_twice:
    __Pyx_RaiseDoubleKeywordsError(function_name, key);
    goto bad;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%.200s() keywords must be strings", function_name);
    goto bad;
bad:
    return -1;
}
static CYTHON_INLINE int __Pyx_MatchKeywordArg(
    PyObject *key,
    PyObject ** const argnames[],
    PyObject ** const *first_kw_arg,
    size_t *index_found,
    const char *function_name)
{
    return likely(PyUnicode_CheckExact(key)) ?
        __Pyx_MatchKeywordArg_str(key, argnames, first_kw_arg, index_found, function_name) :
        __Pyx_MatchKeywordArg_nostr(key, argnames, first_kw_arg, index_found, function_name);
}
static void __Pyx_RejectUnknownKeyword(
    PyObject *kwds,
    PyObject ** const argnames[],
    PyObject ** const *first_kw_arg,
    const char *function_name)
{
    #if CYTHON_AVOID_BORROWED_REFS
    PyObject *pos = NULL;
    #else
    Py_ssize_t pos = 0;
    #endif
    PyObject *key = NULL;
    __Pyx_BEGIN_CRITICAL_SECTION(kwds);
    while (
        #if CYTHON_AVOID_BORROWED_REFS
        __Pyx_PyDict_NextRef(kwds, &pos, &key, NULL)
        #else
        PyDict_Next(kwds, &pos, &key, NULL)
        #endif
    ) {
        PyObject** const *name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (!*name) {
            size_t index_found = 0;
            int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name);
            if (cmp != 1) {
                if (cmp == 0) {
                    PyErr_Format(PyExc_TypeError,
                        "%s() got an unexpected keyword argument '%U'",
                        function_name, key);
                }
                #if CYTHON_AVOID_BORROWED_REFS
                Py_DECREF(key);
                #endif
                break;
            }
        }
        #if CYTHON_AVOID_BORROWED_REFS
        Py_DECREF(key);
        #endif
    }
    __Pyx_END_CRITICAL_SECTION();
    #if CYTHON_AVOID_BORROWED_REFS
    Py_XDECREF(pos);
    #endif
    assert(PyErr_Occurred());
}
static int __Pyx_ParseKeywordDict(
    PyObject *kwds,
    PyObject ** const argnames[],
    PyObject *values[],
    Py_ssize_t num_pos_args,
    Py_ssize_t num_kwargs,
    const char* function_name,
    int ignore_unknown_kwargs)
{
    PyObject** const *name;
    PyObject** const *first_kw_arg = argnames + num_pos_args;
    Py_ssize_t extracted = 0;
#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
    if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return -1;
#endif
    name = first_kw_arg;
    while (*name && num_kwargs > extracted) {
        PyObject * key = **name;
        PyObject *value;
        int found = 0;
        #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
        found = PyDict_GetItemRef(kwds, key, &value);
        #else
        value = PyDict_GetItemWithError(kwds, key);
        if (value) {
            Py_INCREF(value);
            found = 1;
        } else {
            if (unlikely(PyErr_Occurred())) goto bad;
        }
        #endif
        if (found) {
            if (unlikely(found < 0)) goto bad;
            values[name-argnames] = value;
            extracted++;
        }
        name++;
    }
    if (num_kwargs > extracted) {
        if (ignore_unknown_kwargs) {
            if (unlikely(__Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name) == -1))
                goto bad;
        } else {
            __Pyx_RejectUnknownKeyword(kwds, argnames, first_kw_arg, function_name);
            goto bad;
        }
    }
    return 0;
bad:
    return -1;
}
static int __Pyx_ParseKeywordDictToDict(
    PyObject *kwds,
    PyObject ** const argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    const char* function_name)
{
    PyObject** const *name;
    PyObject** const *first_kw_arg = argnames + num_pos_args;
    Py_ssize_t len;
#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
    if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return -1;
#endif
    if (PyDict_Update(kwds2, kwds) < 0) goto bad;
    name = first_kw_arg;
    while (*name) {
        PyObject *key = **name;
        PyObject *value;
#if !CYTHON_COMPILING_IN_LIMITED_API && (PY_VERSION_HEX >= 0x030d00A2 || defined(PyDict_Pop))
        int found = PyDict_Pop(kwds2, key, &value);
        if (found) {
            if (unlikely(found < 0)) goto bad;
            values[name-argnames] = value;
        }
#elif __PYX_LIMITED_VERSION_HEX >= 0x030d0000
        int found = PyDict_GetItemRef(kwds2, key, &value);
        if (found) {
            if (unlikely(found < 0)) goto bad;
            values[name-argnames] = value;
            if (unlikely(PyDict_DelItem(kwds2, key) < 0)) goto bad;
        }
#else
    #if CYTHON_COMPILING_IN_CPYTHON
        value = _PyDict_Pop(kwds2, key, kwds2);
    #else
        value = __Pyx_CallUnboundCMethod2(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_pop, kwds2, key, kwds2);
    #endif
        if (value == kwds2) {
            Py_DECREF(value);
        } else {
            if (unlikely(!value)) goto bad;
            values[name-argnames] = value;
        }
#endif
        name++;
    }
    len = PyDict_Size(kwds2);
    if (len > 0) {
        return __Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name);
    } else if (unlikely(len == -1)) {
        goto bad;
    }
    return 0;
bad:
    return -1;
}
static int __Pyx_ParseKeywordsTuple(
    PyObject *kwds,
    PyObject * const *kwvalues,
    PyObject ** const argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    Py_ssize_t num_kwargs,
    const char* function_name,
    int ignore_unknown_kwargs)
{
    PyObject *key = NULL;
    PyObject** const * name;
    PyObject** const *first_kw_arg = argnames + num_pos_args;
    for (Py_ssize_t pos = 0; pos < num_kwargs; pos++) {
#if CYTHON_AVOID_BORROWED_REFS
        key = __Pyx_PySequence_ITEM(kwds, pos);
#else
        key = __Pyx_PyTuple_GET_ITEM(kwds, pos);
#endif
#if !CYTHON_ASSUME_SAFE_MACROS
        if (unlikely(!key)) goto bad;
#endif
        name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (*name) {
            PyObject *value = kwvalues[pos];
            values[name-argnames] = __Pyx_NewRef(value);
        } else {
            size_t index_found = 0;
            int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name);
            if (cmp == 1) {
                PyObject *value = kwvalues[pos];
                values[index_found] = __Pyx_NewRef(value);
            } else {
                if (unlikely(cmp == -1)) goto bad;
                if (kwds2) {
                    PyObject *value = kwvalues[pos];
                    if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
                } else if (!ignore_unknown_kwargs) {
                    goto invalid_keyword;
                }
            }
        }
        #if CYTHON_AVOID_BORROWED_REFS
        Py_DECREF(key);
        key = NULL;
        #endif
    }
    return 0;
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    goto bad;
bad:
    #if CYTHON_AVOID_BORROWED_REFS
    Py_XDECREF(key);
    #endif
    return -1;
}

/* ParseKeywords */
static int __Pyx_ParseKeywords(
    PyObject *kwds,
    PyObject * const *kwvalues,
    PyObject ** const argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    Py_ssize_t num_kwargs,
    const char* function_name,
    int ignore_unknown_kwargs)
{
    if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)))
        return __Pyx_ParseKeywordsTuple(kwds, kwvalues, argnames, kwds2, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs);
    else if (kwds2)
        return __Pyx_ParseKeywordDictToDict(kwds, argnames, kwds2, values, num_pos_args, function_name);
    else
        return __Pyx_ParseKeywordDict(kwds, argnames, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs);
}

/* RaiseArgTupleInvalid */
static void __Pyx_RaiseArgtupleInvalid(
    const char* func_name,
    int exact,
    Py_ssize_t num_min,
    Py_ssize_t num_max,
    Py_ssize_t num_found)
{
    Py_ssize_t num_expected;
    const char *more_or_less;
    if (num_found < num_min) {
        num_expected = num_min;
        more_or_less = "at least";
    } else {
        num_expected = num_max;
        more_or_less = "at most";
    }
    if (exact) {
        more_or_less = "exactly";
    }
    PyErr_Format(PyExc_TypeError,
                 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
                 func_name, more_or_less, num_expected,
                 (num_expected == 1) ? "" : "s", num_found);
}

/* ArgTypeTestFunc (used by ArgTypeTest) */
static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
{
    __Pyx_TypeName type_name;
    __Pyx_TypeName obj_type_name;
    PyObject *extra_info = __pyx_mstate_global->__pyx_empty_unicode;
    int from_annotation_subclass = 0;
    if (unlikely(!type)) {
        PyErr_SetString(PyExc_SystemError, "Missing type object");
        return 0;
    }
    else if (!exact) {
        if (likely(__Pyx_TypeCheck(obj, type))) return 1;
    } else if (exact == 2) {
        if (__Pyx_TypeCheck(obj, type)) {
            from_annotation_subclass = 1;
            extra_info = __pyx_mstate_global->__pyx_kp_u_Note_that_Cython_is_deliberately;
        }
    }
    type_name = __Pyx_PyType_GetFullyQualifiedName(type);
    obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj));
    PyErr_Format(PyExc_TypeError,
        "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME
        ", got " __Pyx_FMT_TYPENAME ")"
#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
        "%s%U"
#endif
        , name, type_name, obj_type_name
#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
        , (from_annotation_subclass ? ". " : ""), extra_info
#endif
        );
#if __PYX_LIMITED_VERSION_HEX >= 0x030C0000
    if (exact == 2 && from_annotation_subclass) {
        PyObject *res;
        PyObject *vargs[2];
        vargs[0] = PyErr_GetRaisedException();
        vargs[1] = extra_info;
        res = PyObject_VectorcallMethod(__pyx_mstate_global->__pyx_kp_u_add_note, vargs, 2, NULL);
        Py_XDECREF(res);
        PyErr_SetRaisedException(vargs[0]);
    }
#endif
    __Pyx_DECREF_TypeName(type_name);
    __Pyx_DECREF_TypeName(obj_type_name);
    return 0;
}

/* RaiseException */
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
    PyObject* owned_instance = NULL;
    if (tb == Py_None) {
        tb = 0;
    } else if (tb && !PyTraceBack_Check(tb)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: arg 3 must be a traceback or None");
        goto bad;
    }
    if (value == Py_None)
        value = 0;
    if (PyExceptionInstance_Check(type)) {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto bad;
        }
        value = type;
        type = (PyObject*) Py_TYPE(value);
    } else if (PyExceptionClass_Check(type)) {
        PyObject *instance_class = NULL;
        if (value && PyExceptionInstance_Check(value)) {
            instance_class = (PyObject*) Py_TYPE(value);
            if (instance_class != type) {
                int is_subclass = PyObject_IsSubclass(instance_class, type);
                if (!is_subclass) {
                    instance_class = NULL;
                } else if (unlikely(is_subclass == -1)) {
                    goto bad;
                } else {
                    type = instance_class;
                }
            }
        }
        if (!instance_class) {
            PyObject *args;
            if (!value)
                args = PyTuple_New(0);
            else if (PyTuple_Check(value)) {
                Py_INCREF(value);
                args = value;
            } else
                args = PyTuple_Pack(1, value);
            if (!args)
                goto bad;
            owned_instance = PyObject_Call(type, args, NULL);
            Py_DECREF(args);
            if (!owned_instance)
                goto bad;
            value = owned_instance;
            if (!PyExceptionInstance_Check(value)) {
                PyErr_Format(PyExc_TypeError,
                             "calling %R should have returned an instance of "
                             "BaseException, not %R",
                             type, Py_TYPE(value));
                goto bad;
            }
        }
    } else {
        PyErr_SetString(PyExc_TypeError,
            "raise: exception class must be a subclass of BaseException");
        goto bad;
    }
    if (cause) {
        PyObject *fixed_cause;
        if (cause == Py_None) {
            fixed_cause = NULL;
        } else if (PyExceptionClass_Check(cause)) {
            fixed_cause = PyObject_CallObject(cause, NULL);
            if (fixed_cause == NULL)
                goto bad;
        } else if (PyExceptionInstance_Check(cause)) {
            fixed_cause = cause;
            Py_INCREF(fixed_cause);
        } else {
            PyErr_SetString(PyExc_TypeError,
                            "exception causes must derive from "
                            "BaseException");
            goto bad;
        }
        PyException_SetCause(value, fixed_cause);
    }
    PyErr_SetObject(type, value);
    if (tb) {
#if PY_VERSION_HEX >= 0x030C00A6
        PyException_SetTraceback(value, tb);
#elif CYTHON_FAST_THREAD_STATE
        PyThreadState *tstate = __Pyx_PyThreadState_Current;
        PyObject* tmp_tb = tstate->curexc_traceback;
        if (tb != tmp_tb) {
            Py_INCREF(tb);
            tstate->curexc_traceback = tb;
            Py_XDECREF(tmp_tb);
        }
#else
        PyObject *tmp_type, *tmp_value, *tmp_tb;
        PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
        Py_INCREF(tb);
        PyErr_Restore(tmp_type, tmp_value, tb);
        Py_XDECREF(tmp_tb);
#endif
    }
bad:
    Py_XDECREF(owned_instance);
    return;
}

/* PyObjectFastCallMethod */
#if !CYTHON_VECTORCALL || PY_VERSION_HEX < 0x03090000
static PyObject *__Pyx_PyObject_FastCallMethod(PyObject *name, PyObject *const *args, size_t nargsf) {
    PyObject *result;
    PyObject *attr = PyObject_GetAttr(args[0], name);
    if (unlikely(!attr))
        return NULL;
    result = __Pyx_PyObject_FastCall(attr, args+1, nargsf - 1);
    Py_DECREF(attr);
    return result;
}
#endif

/* RaiseUnexpectedTypeError */
static int
__Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj)
{
    __Pyx_TypeName obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj));
    PyErr_Format(PyExc_TypeError, "Expected %s, got " __Pyx_FMT_TYPENAME,
                 expected, obj_type_name);
    __Pyx_DECREF_TypeName(obj_type_name);
    return 0;
}

/* CIntToDigits (used by CIntToPyUnicode) */
static const char DIGIT_PAIRS_10[2*10*10+1] = {
    "00010203040506070809"
    "10111213141516171819"
    "20212223242526272829"
    "30313233343536373839"
    "40414243444546474849"
    "50515253545556575859"
    "60616263646566676869"
    "70717273747576777879"
    "80818283848586878889"
    "90919293949596979899"
};
static const char DIGIT_PAIRS_8[2*8*8+1] = {
    "0001020304050607"
    "1011121314151617"
    "2021222324252627"
    "3031323334353637"
    "4041424344454647"
    "5051525354555657"
    "6061626364656667"
    "7071727374757677"
};
static const char DIGITS_HEX[2*16+1] = {
    "0123456789abcdef"
    "0123456789ABCDEF"
};

/* BuildPyUnicode (used by COrdinalToPyUnicode) */
static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, const char* chars, int clength,
                                                int prepend_sign, char padding_char) {
    PyObject *uval;
    Py_ssize_t uoffset = ulength - clength;
#if CYTHON_USE_UNICODE_INTERNALS
    Py_ssize_t i;
    void *udata;
    uval = PyUnicode_New(ulength, 127);
    if (unlikely(!uval)) return NULL;
    udata = PyUnicode_DATA(uval);
    if (uoffset > 0) {
        i = 0;
        if (prepend_sign) {
            __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, 0, '-');
            i++;
        }
        for (; i < uoffset; i++) {
            __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, i, padding_char);
        }
    }
    for (i=0; i < clength; i++) {
        __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, uoffset+i, chars[i]);
    }
#else
    {
        PyObject *sign = NULL, *padding = NULL;
        uval = NULL;
        if (uoffset > 0) {
            prepend_sign = !!prepend_sign;
            if (uoffset > prepend_sign) {
                padding = PyUnicode_FromOrdinal(padding_char);
                if (likely(padding) && uoffset > prepend_sign + 1) {
                    PyObject *tmp = PySequence_Repeat(padding, uoffset - prepend_sign);
                    Py_DECREF(padding);
                    padding = tmp;
                }
                if (unlikely(!padding)) goto done_or_error;
            }
            if (prepend_sign) {
                sign = PyUnicode_FromOrdinal('-');
                if (unlikely(!sign)) goto done_or_error;
            }
        }
        uval = PyUnicode_DecodeASCII(chars, clength, NULL);
        if (likely(uval) && padding) {
            PyObject *tmp = PyUnicode_Concat(padding, uval);
            Py_DECREF(uval);
            uval = tmp;
        }
        if (likely(uval) && sign) {
            PyObject *tmp = PyUnicode_Concat(sign, uval);
            Py_DECREF(uval);
            uval = tmp;
        }
done_or_error:
        Py_XDECREF(padding);
        Py_XDECREF(sign);
    }
#endif
    return uval;
}

/* COrdinalToPyUnicode (used by CIntToPyUnicode) */
static CYTHON_INLINE int __Pyx_CheckUnicodeValue(int value) {
    return value <= 1114111;
}
static PyObject* __Pyx_PyUnicode_FromOrdinal_Padded(int value, Py_ssize_t ulength, char padding_char) {
    Py_ssize_t padding_length = ulength - 1;
    if (likely((padding_length <= 250) && (value < 0xD800 || value > 0xDFFF))) {
        char chars[256];
        if (value <= 255) {
            memset(chars, padding_char, (size_t) padding_length);
            chars[ulength-1] = (char) value;
            return PyUnicode_DecodeLatin1(chars, ulength, NULL);
        }
        char *cpos = chars + sizeof(chars);
        if (value < 0x800) {
            *--cpos = (char) (0x80 | (value & 0x3f));
            value >>= 6;
            *--cpos = (char) (0xc0 | (value & 0x1f));
        } else if (value < 0x10000) {
            *--cpos = (char) (0x80 | (value & 0x3f));
            value >>= 6;
            *--cpos = (char) (0x80 | (value & 0x3f));
            value >>= 6;
            *--cpos = (char) (0xe0 | (value & 0x0f));
        } else {
            *--cpos = (char) (0x80 | (value & 0x3f));
            value >>= 6;
            *--cpos = (char) (0x80 | (value & 0x3f));
            value >>= 6;
            *--cpos = (char) (0x80 | (value & 0x3f));
            value >>= 6;
            *--cpos = (char) (0xf0 | (value & 0x07));
        }
        cpos -= padding_length;
        memset(cpos, padding_char, (size_t) padding_length);
        return PyUnicode_DecodeUTF8(cpos, chars + sizeof(chars) - cpos, NULL);
    }
    if (value <= 127 && CYTHON_USE_UNICODE_INTERNALS) {
        const char chars[1] = {(char) value};
        return __Pyx_PyUnicode_BuildFromAscii(ulength, chars, 1, 0, padding_char);
    }
    {
        PyObject *uchar, *padding_uchar, *padding, *result;
        padding_uchar = PyUnicode_FromOrdinal(padding_char);
        if (unlikely(!padding_uchar)) return NULL;
        padding = PySequence_Repeat(padding_uchar, padding_length);
        Py_DECREF(padding_uchar);
        if (unlikely(!padding)) return NULL;
        uchar = PyUnicode_FromOrdinal(value);
        if (unlikely(!uchar)) {
            Py_DECREF(padding);
            return NULL;
        }
        result = PyUnicode_Concat(padding, uchar);
        Py_DECREF(padding);
        Py_DECREF(uchar);
        return result;
    }
}

/* CIntToPyUnicode */
static CYTHON_INLINE PyObject* __Pyx_uchar___Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const int neg_one = (int) -1, const_zero = (int) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (unlikely(!(is_unsigned || value == 0 || value > 0) ||
                    !(sizeof(value) <= 2 || value & ~ (int) 0x01fffff || __Pyx_CheckUnicodeValue((int) value)))) {
        PyErr_SetString(PyExc_OverflowError, "%c arg not in range(0x110000)");
        return NULL;
    }
    if (width <= 1) {
        return PyUnicode_FromOrdinal((int) value);
    }
    return __Pyx_PyUnicode_FromOrdinal_Padded((int) value, width, padding_char);
}
static CYTHON_INLINE PyObject* __Pyx____Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char, char format_char) {
    char digits[sizeof(int)*3+2];
    char *dpos, *end = digits + sizeof(int)*3+2;
    const char *hex_digits = DIGITS_HEX;
    Py_ssize_t length, ulength;
    int prepend_sign, last_one_off;
    int remaining;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const int neg_one = (int) -1, const_zero = (int) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (format_char == 'X') {
        hex_digits += 16;
        format_char = 'x';
    }
    remaining = value;
    last_one_off = 0;
    dpos = end;
    do {
        int digit_pos;
        switch (format_char) {
        case 'o':
            digit_pos = abs((int)(remaining % (8*8)));
            remaining = (int) (remaining / (8*8));
            dpos -= 2;
            memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2);
            last_one_off = (digit_pos < 8);
            break;
        case 'd':
            digit_pos = abs((int)(remaining % (10*10)));
            remaining = (int) (remaining / (10*10));
            dpos -= 2;
            memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2);
            last_one_off = (digit_pos < 10);
            break;
        case 'x':
            *(--dpos) = hex_digits[abs((int)(remaining % 16))];
            remaining = (int) (remaining / 16);
            break;
        default:
            assert(0);
            break;
        }
    } while (unlikely(remaining != 0));
    assert(!last_one_off || *dpos == '0');
    dpos += last_one_off;
    length = end - dpos;
    ulength = length;
    prepend_sign = 0;
    if (!is_unsigned && value <= neg_one) {
        if (padding_char == ' ' || width <= length + 1) {
            *(--dpos) = '-';
            ++length;
        } else {
            prepend_sign = 1;
        }
        ++ulength;
    }
    if (width > ulength) {
        ulength = width;
    }
    if (ulength == 1) {
        return PyUnicode_FromOrdinal(*dpos);
    }
    return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char);
}

/* CIntToPyUnicode */
static CYTHON_INLINE PyObject* __Pyx_uchar___Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const Py_ssize_t neg_one = (Py_ssize_t) -1, const_zero = (Py_ssize_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (unlikely(!(is_unsigned || value == 0 || value > 0) ||
                    !(sizeof(value) <= 2 || value & ~ (Py_ssize_t) 0x01fffff || __Pyx_CheckUnicodeValue((int) value)))) {
        PyErr_SetString(PyExc_OverflowError, "%c arg not in range(0x110000)");
        return NULL;
    }
    if (width <= 1) {
        return PyUnicode_FromOrdinal((int) value);
    }
    return __Pyx_PyUnicode_FromOrdinal_Padded((int) value, width, padding_char);
}
static CYTHON_INLINE PyObject* __Pyx____Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char, char format_char) {
    char digits[sizeof(Py_ssize_t)*3+2];
    char *dpos, *end = digits + sizeof(Py_ssize_t)*3+2;
    const char *hex_digits = DIGITS_HEX;
    Py_ssize_t length, ulength;
    int prepend_sign, last_one_off;
    Py_ssize_t remaining;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const Py_ssize_t neg_one = (Py_ssize_t) -1, const_zero = (Py_ssize_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (format_char == 'X') {
        hex_digits += 16;
        format_char = 'x';
    }
    remaining = value;
    last_one_off = 0;
    dpos = end;
    do {
        int digit_pos;
        switch (format_char) {
        case 'o':
            digit_pos = abs((int)(remaining % (8*8)));
            remaining = (Py_ssize_t) (remaining / (8*8));
            dpos -= 2;
            memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2);
            last_one_off = (digit_pos < 8);
            break;
        case 'd':
            digit_pos = abs((int)(remaining % (10*10)));
            remaining = (Py_ssize_t) (remaining / (10*10));
            dpos -= 2;
            memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2);
            last_one_off = (digit_pos < 10);
            break;
        case 'x':
            *(--dpos) = hex_digits[abs((int)(remaining % 16))];
            remaining = (Py_ssize_t) (remaining / 16);
            break;
        default:
            assert(0);
            break;
        }
    } while (unlikely(remaining != 0));
    assert(!last_one_off || *dpos == '0');
    dpos += last_one_off;
    length = end - dpos;
    ulength = length;
    prepend_sign = 0;
    if (!is_unsigned && value <= neg_one) {
        if (padding_char == ' ' || width <= length + 1) {
            *(--dpos) = '-';
            ++length;
        } else {
            prepend_sign = 1;
        }
        ++ulength;
    }
    if (width > ulength) {
        ulength = width;
    }
    if (ulength == 1) {
        return PyUnicode_FromOrdinal(*dpos);
    }
    return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char);
}

/* JoinPyUnicode */
static PyObject* __Pyx_PyUnicode_Join(PyObject** values, Py_ssize_t value_count, Py_ssize_t result_ulength,
                                      Py_UCS4 max_char) {
#if CYTHON_USE_UNICODE_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    PyObject *result_uval;
    int result_ukind, kind_shift;
    Py_ssize_t i, char_pos;
    void *result_udata;
    if (max_char > 1114111) max_char = 1114111;
    result_uval = PyUnicode_New(result_ulength, max_char);
    if (unlikely(!result_uval)) return NULL;
    result_ukind = (max_char <= 255) ? PyUnicode_1BYTE_KIND : (max_char <= 65535) ? PyUnicode_2BYTE_KIND : PyUnicode_4BYTE_KIND;
    kind_shift = (result_ukind == PyUnicode_4BYTE_KIND) ? 2 : result_ukind - 1;
    result_udata = PyUnicode_DATA(result_uval);
    assert(kind_shift == 2 || kind_shift == 1 || kind_shift == 0);
    if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - result_ulength < 0))
        goto overflow;
    char_pos = 0;
    for (i=0; i < value_count; i++) {
        int ukind;
        Py_ssize_t ulength;
        void *udata;
        PyObject *uval = values[i];
        #if !CYTHON_COMPILING_IN_LIMITED_API
        if (__Pyx_PyUnicode_READY(uval) == (-1))
            goto bad;
        #endif
        ulength = __Pyx_PyUnicode_GET_LENGTH(uval);
        #if !CYTHON_ASSUME_SAFE_SIZE
        if (unlikely(ulength < 0)) goto bad;
        #endif
        if (unlikely(!ulength))
            continue;
        if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - ulength < char_pos))
            goto overflow;
        ukind = __Pyx_PyUnicode_KIND(uval);
        udata = __Pyx_PyUnicode_DATA(uval);
        if (ukind == result_ukind) {
            memcpy((char *)result_udata + (char_pos << kind_shift), udata, (size_t) (ulength << kind_shift));
        } else {
            #if PY_VERSION_HEX >= 0x030d0000
            if (unlikely(PyUnicode_CopyCharacters(result_uval, char_pos, uval, 0, ulength) < 0)) goto bad;
            #elif CYTHON_COMPILING_IN_CPYTHON || defined(_PyUnicode_FastCopyCharacters)
            _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength);
            #else
            Py_ssize_t j;
            for (j=0; j < ulength; j++) {
                Py_UCS4 uchar = __Pyx_PyUnicode_READ(ukind, udata, j);
                __Pyx_PyUnicode_WRITE(result_ukind, result_udata, char_pos+j, uchar);
            }
            #endif
        }
        char_pos += ulength;
    }
    return result_uval;
overflow:
    PyErr_SetString(PyExc_OverflowError, "join() result is too long for a Python string");
bad:
    Py_DECREF(result_uval);
    return NULL;
#else
    Py_ssize_t i;
    PyObject *result = NULL;
    PyObject *value_tuple = PyTuple_New(value_count);
    if (unlikely(!value_tuple)) return NULL;
    CYTHON_UNUSED_VAR(max_char);
    CYTHON_UNUSED_VAR(result_ulength);
    for (i=0; i<value_count; i++) {
        Py_INCREF(values[i]);
        if (__Pyx_PyTuple_SET_ITEM(value_tuple, i, values[i]) != (0)) goto bad;
    }
    result = PyUnicode_Join(__pyx_mstate_global->__pyx_empty_unicode, value_tuple);
bad:
    Py_DECREF(value_tuple);
    return result;
#endif
}

/* GetAttr */
static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
#if CYTHON_USE_TYPE_SLOTS
    if (likely(PyUnicode_Check(n)))
        return __Pyx_PyObject_GetAttrStr(o, n);
#endif
    return PyObject_GetAttr(o, n);
}

/* GetItemInt */
static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
    PyObject *r;
    if (unlikely(!j)) return NULL;
    r = PyObject_GetItem(o, j);
    Py_DECREF(j);
    return r;
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
                                                              int wraparound, int boundscheck, int unsafe_shared) {
    CYTHON_MAYBE_UNUSED_VAR(unsafe_shared);
#if CYTHON_ASSUME_SAFE_SIZE
    Py_ssize_t wrapped_i = i;
    if (wraparound & unlikely(i < 0)) {
        wrapped_i += PyList_GET_SIZE(o);
    }
    if ((CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS)) {
        return __Pyx_PyList_GetItemRefFast(o, wrapped_i, unsafe_shared);
    } else
    if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
        return __Pyx_NewRef(PyList_GET_ITEM(o, wrapped_i));
    }
    return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i));
#else
    (void)wraparound;
    (void)boundscheck;
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                              int wraparound, int boundscheck, int unsafe_shared) {
    CYTHON_MAYBE_UNUSED_VAR(unsafe_shared);
#if CYTHON_ASSUME_SAFE_SIZE && 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)))) {
        return __Pyx_NewRef(PyTuple_GET_ITEM(o, wrapped_i));
    }
    return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i));
#else
    (void)wraparound;
    (void)boundscheck;
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
                                                     int wraparound, int boundscheck, int unsafe_shared) {
    CYTHON_MAYBE_UNUSED_VAR(unsafe_shared);
#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
    if (is_list || PyList_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
        if ((CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS)) {
            return __Pyx_PyList_GetItemRefFast(o, n, unsafe_shared);
        } else if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
            return __Pyx_NewRef(PyList_GET_ITEM(o, n));
        }
    } else
    #if !CYTHON_AVOID_BORROWED_REFS
    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)))) {
            return __Pyx_NewRef(PyTuple_GET_ITEM(o, n));
        }
    } else
    #endif
#endif
#if CYTHON_USE_TYPE_SLOTS && !CYTHON_COMPILING_IN_PYPY
    {
        PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping;
        PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence;
        if (!is_list && mm && mm->mp_subscript) {
            PyObject *r, *key = PyLong_FromSsize_t(i);
            if (unlikely(!key)) return NULL;
            r = mm->mp_subscript(o, key);
            Py_DECREF(key);
            return r;
        }
        if (is_list || likely(sm && sm->sq_item)) {
            if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) {
                Py_ssize_t l = sm->sq_length(o);
                if (likely(l >= 0)) {
                    i += l;
                } else {
                    if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                        return NULL;
                    PyErr_Clear();
                }
            }
            return sm->sq_item(o, i);
        }
    }
#else
    if (is_list || !PyMapping_Check(o)) {
        return PySequence_GetItem(o, i);
    }
#endif
    (void)wraparound;
    (void)boundscheck;
    return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i));
}

/* ObjectGetItem */
#if CYTHON_USE_TYPE_SLOTS
static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) {
    PyObject *runerr = NULL;
    Py_ssize_t key_value;
    key_value = __Pyx_PyIndex_AsSsize_t(index);
    if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
        return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1, 1);
    }
    if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
        __Pyx_TypeName index_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(index));
        PyErr_Clear();
        PyErr_Format(PyExc_IndexError,
            "cannot fit '" __Pyx_FMT_TYPENAME "' into an index-sized integer", index_type_name);
        __Pyx_DECREF_TypeName(index_type_name);
    }
    return NULL;
}
static PyObject *__Pyx_PyObject_GetItem_Slow(PyObject *obj, PyObject *key) {
    __Pyx_TypeName obj_type_name;
    if (likely(PyType_Check(obj))) {
        PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_mstate_global->__pyx_n_u_class_getitem);
        if (!meth) {
            PyErr_Clear();
        } else {
            PyObject *result = __Pyx_PyObject_CallOneArg(meth, key);
            Py_DECREF(meth);
            return result;
        }
    }
    obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj));
    PyErr_Format(PyExc_TypeError,
        "'" __Pyx_FMT_TYPENAME "' object is not subscriptable", obj_type_name);
    __Pyx_DECREF_TypeName(obj_type_name);
    return NULL;
}
static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) {
    PyTypeObject *tp = Py_TYPE(obj);
    PyMappingMethods *mm = tp->tp_as_mapping;
    PySequenceMethods *sm = tp->tp_as_sequence;
    if (likely(mm && mm->mp_subscript)) {
        return mm->mp_subscript(obj, key);
    }
    if (likely(sm && sm->sq_item)) {
        return __Pyx_PyObject_GetIndex(obj, key);
    }
    return __Pyx_PyObject_GetItem_Slow(obj, key);
}
#endif

/* RejectKeywords */
static void __Pyx_RejectKeywords(const char* function_name, PyObject *kwds) {
    PyObject *key = NULL;
    if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds))) {
        key = __Pyx_PySequence_ITEM(kwds, 0);
    } else {
#if CYTHON_AVOID_BORROWED_REFS
        PyObject *pos = NULL;
#else
        Py_ssize_t pos = 0;
#endif
#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
        if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return;
#endif
        __Pyx_PyDict_NextRef(kwds, &pos, &key, NULL);
#if CYTHON_AVOID_BORROWED_REFS
        Py_XDECREF(pos);
#endif
    }
    if (likely(key)) {
        PyErr_Format(PyExc_TypeError,
            "%s() got an unexpected keyword argument '%U'",
            function_name, key);
        Py_DECREF(key);
    }
}

/* DivInt[Py_ssize_t] */
static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b, int b_is_constant) {
    Py_ssize_t q = a / b;
    Py_ssize_t r = a - q*b;
    Py_ssize_t adapt_python = (b_is_constant ?
        ((r != 0) & ((r < 0) ^ (b < 0))) :
        ((r != 0) & ((r ^ b) < 0))
    );
    return q - adapt_python;
}

/* GetAttr3 */
#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
        return NULL;
    __Pyx_PyErr_Clear();
    Py_INCREF(d);
    return d;
}
#endif
static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
    PyObject *r;
#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
    int res = PyObject_GetOptionalAttr(o, n, &r);
    return (res != 0) ? r : __Pyx_NewRef(d);
#else
  #if CYTHON_USE_TYPE_SLOTS
    if (likely(PyUnicode_Check(n))) {
        r = __Pyx_PyObject_GetAttrStrNoError(o, n);
        if (unlikely(!r) && likely(!PyErr_Occurred())) {
            r = __Pyx_NewRef(d);
        }
        return r;
    }
  #endif
    r = PyObject_GetAttr(o, n);
    return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
#endif
}

/* PyDictVersioning (used by GetModuleGlobalName) */
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
    PyObject *dict = Py_TYPE(obj)->tp_dict;
    return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
}
static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
    PyObject **dictptr = NULL;
    Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
    if (offset) {
#if CYTHON_COMPILING_IN_CPYTHON
        dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
#else
        dictptr = _PyObject_GetDictPtr(obj);
#endif
    }
    return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
}
static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
    PyObject *dict = Py_TYPE(obj)->tp_dict;
    if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
        return 0;
    return obj_dict_version == __Pyx_get_object_dict_version(obj);
}
#endif

/* GetModuleGlobalName */
#if CYTHON_USE_DICT_VERSIONS
static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
#else
static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
#endif
{
    PyObject *result;
#if CYTHON_COMPILING_IN_LIMITED_API
    if (unlikely(!__pyx_m)) {
        if (!PyErr_Occurred())
            PyErr_SetNone(PyExc_NameError);
        return NULL;
    }
    result = PyObject_GetAttr(__pyx_m, name);
    if (likely(result)) {
        return result;
    }
    PyErr_Clear();
#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
    if (unlikely(__Pyx_PyDict_GetItemRef(__pyx_mstate_global->__pyx_d, name, &result) == -1)) PyErr_Clear();
    __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return result;
    }
#else
    result = _PyDict_GetItem_KnownHash(__pyx_mstate_global->__pyx_d, name, ((PyASCIIObject *) name)->hash);
    __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return __Pyx_NewRef(result);
    }
    PyErr_Clear();
#endif
    return __Pyx_GetBuiltinName(name);
}

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

/* RaiseNoneIterError */
static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
}

/* ExtTypeTest */
static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
    __Pyx_TypeName obj_type_name;
    __Pyx_TypeName type_name;
    if (unlikely(!type)) {
        PyErr_SetString(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if (likely(__Pyx_TypeCheck(obj, type)))
        return 1;
    obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj));
    type_name = __Pyx_PyType_GetFullyQualifiedName(type);
    PyErr_Format(PyExc_TypeError,
                 "Cannot convert " __Pyx_FMT_TYPENAME " to " __Pyx_FMT_TYPENAME,
                 obj_type_name, type_name);
    __Pyx_DECREF_TypeName(obj_type_name);
    __Pyx_DECREF_TypeName(type_name);
    return 0;
}

/* GetException */
#if CYTHON_FAST_THREAD_STATE
static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
#else
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
#endif
{
    PyObject *local_type = NULL, *local_value, *local_tb = NULL;
#if CYTHON_FAST_THREAD_STATE
    PyObject *tmp_type, *tmp_value, *tmp_tb;
  #if PY_VERSION_HEX >= 0x030C0000
    local_value = tstate->current_exception;
    tstate->current_exception = 0;
  #else
    local_type = tstate->curexc_type;
    local_value = tstate->curexc_value;
    local_tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
  #endif
#elif __PYX_LIMITED_VERSION_HEX > 0x030C0000
    local_value = PyErr_GetRaisedException();
#else
    PyErr_Fetch(&local_type, &local_value, &local_tb);
#endif
#if __PYX_LIMITED_VERSION_HEX > 0x030C0000
    if (likely(local_value)) {
        local_type = (PyObject*) Py_TYPE(local_value);
        Py_INCREF(local_type);
        local_tb = PyException_GetTraceback(local_value);
    }
#else
    PyErr_NormalizeException(&local_type, &local_value, &local_tb);
#if CYTHON_FAST_THREAD_STATE
    if (unlikely(tstate->curexc_type))
#else
    if (unlikely(PyErr_Occurred()))
#endif
        goto bad;
    if (local_tb) {
        if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
            goto bad;
    }
#endif // __PYX_LIMITED_VERSION_HEX > 0x030C0000
    Py_XINCREF(local_tb);
    Py_XINCREF(local_type);
    Py_XINCREF(local_value);
    *type = local_type;
    *value = local_value;
    *tb = local_tb;
#if CYTHON_FAST_THREAD_STATE
    #if CYTHON_USE_EXC_INFO_STACK
    {
        _PyErr_StackItem *exc_info = tstate->exc_info;
      #if PY_VERSION_HEX >= 0x030B00a4
        tmp_value = exc_info->exc_value;
        exc_info->exc_value = local_value;
        tmp_type = NULL;
        tmp_tb = NULL;
        Py_XDECREF(local_type);
        Py_XDECREF(local_tb);
      #else
        tmp_type = exc_info->exc_type;
        tmp_value = exc_info->exc_value;
        tmp_tb = exc_info->exc_traceback;
        exc_info->exc_type = local_type;
        exc_info->exc_value = local_value;
        exc_info->exc_traceback = local_tb;
      #endif
    }
    #else
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = local_type;
    tstate->exc_value = local_value;
    tstate->exc_traceback = local_tb;
    #endif
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#elif __PYX_LIMITED_VERSION_HEX >= 0x030b0000
    PyErr_SetHandledException(local_value);
    Py_XDECREF(local_value);
    Py_XDECREF(local_type);
    Py_XDECREF(local_tb);
#else
    PyErr_SetExcInfo(local_type, local_value, local_tb);
#endif
    return 0;
#if __PYX_LIMITED_VERSION_HEX <= 0x030C0000
bad:
    *type = 0;
    *value = 0;
    *tb = 0;
    Py_XDECREF(local_type);
    Py_XDECREF(local_value);
    Py_XDECREF(local_tb);
    return -1;
#endif
}

/* SwapException */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
  #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
    _PyErr_StackItem *exc_info = tstate->exc_info;
    tmp_value = exc_info->exc_value;
    exc_info->exc_value = *value;
    if (tmp_value == NULL || tmp_value == Py_None) {
        Py_XDECREF(tmp_value);
        tmp_value = NULL;
        tmp_type = NULL;
        tmp_tb = NULL;
    } else {
        tmp_type = (PyObject*) Py_TYPE(tmp_value);
        Py_INCREF(tmp_type);
        #if CYTHON_COMPILING_IN_CPYTHON
        tmp_tb = ((PyBaseExceptionObject*) tmp_value)->traceback;
        Py_XINCREF(tmp_tb);
        #else
        tmp_tb = PyException_GetTraceback(tmp_value);
        #endif
    }
  #elif CYTHON_USE_EXC_INFO_STACK
    _PyErr_StackItem *exc_info = tstate->exc_info;
    tmp_type = exc_info->exc_type;
    tmp_value = exc_info->exc_value;
    tmp_tb = exc_info->exc_traceback;
    exc_info->exc_type = *type;
    exc_info->exc_value = *value;
    exc_info->exc_traceback = *tb;
  #else
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = *type;
    tstate->exc_value = *value;
    tstate->exc_traceback = *tb;
  #endif
    *type = tmp_type;
    *value = tmp_value;
    *tb = tmp_tb;
}
#else
static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
    PyErr_SetExcInfo(*type, *value, *tb);
    *type = tmp_type;
    *value = tmp_value;
    *tb = tmp_tb;
}
#endif

/* HasAttr (used by ImportImpl) */
#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
    PyObject *r;
    if (unlikely(!PyUnicode_Check(n))) {
        PyErr_SetString(PyExc_TypeError,
                        "hasattr(): attribute name must be string");
        return -1;
    }
    r = __Pyx_PyObject_GetAttrStrNoError(o, n);
    if (!r) {
        return (unlikely(PyErr_Occurred())) ? -1 : 0;
    } else {
        Py_DECREF(r);
        return 1;
    }
}
#endif

/* ImportImpl (used by Import) */
static int __Pyx__Import_GetModule(PyObject *qualname, PyObject **module) {
    PyObject *imported_module = PyImport_GetModule(qualname);
    if (unlikely(!imported_module)) {
        *module = NULL;
        if (PyErr_Occurred()) {
            return -1;
        }
        return 0;
    }
    *module = imported_module;
    return 1;
}
static int __Pyx__Import_Lookup(PyObject *qualname, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject **module) {
    PyObject *imported_module;
    PyObject *top_level_package_name;
    Py_ssize_t i;
    int status, module_found;
    Py_ssize_t dot_index;
    module_found = __Pyx__Import_GetModule(qualname, &imported_module);
    if (unlikely(!module_found || module_found == -1)) {
        *module = NULL;
        return module_found;
    }
    if (imported_names) {
        for (i = 0; i < len_imported_names; i++) {
            PyObject *imported_name = imported_names[i];
#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
            int has_imported_attribute = PyObject_HasAttr(imported_module, imported_name);
#else
            int has_imported_attribute = PyObject_HasAttrWithError(imported_module, imported_name);
            if (unlikely(has_imported_attribute == -1)) goto error;
#endif
            if (!has_imported_attribute) {
                goto not_found;
            }
        }
        *module = imported_module;
        return 1;
    }
    dot_index = PyUnicode_FindChar(qualname, '.', 0, PY_SSIZE_T_MAX, 1);
    if (dot_index == -1) {
        *module = imported_module;
        return 1;
    }
    if (unlikely(dot_index == -2)) goto error;
    top_level_package_name = PyUnicode_Substring(qualname, 0, dot_index);
    if (unlikely(!top_level_package_name)) goto error;
    Py_DECREF(imported_module);
    status = __Pyx__Import_GetModule(top_level_package_name, module);
    Py_DECREF(top_level_package_name);
    return status;
error:
    Py_DECREF(imported_module);
    *module = NULL;
    return -1;
not_found:
    Py_DECREF(imported_module);
    *module = NULL;
    return 0;
}
static PyObject *__Pyx__Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, PyObject *moddict, int level) {
    PyObject *module = 0;
    PyObject *empty_dict = 0;
    PyObject *from_list = 0;
    int module_found;
    if (!qualname) {
        qualname = name;
    }
    module_found = __Pyx__Import_Lookup(qualname, imported_names, len_imported_names, &module);
    if (likely(module_found == 1)) {
        return module;
    } else if (unlikely(module_found == -1)) {
        return NULL;
    }
    empty_dict = PyDict_New();
    if (unlikely(!empty_dict))
        goto bad;
    if (imported_names) {
#if CYTHON_COMPILING_IN_CPYTHON
        from_list = __Pyx_PyList_FromArray(imported_names, len_imported_names);
        if (unlikely(!from_list))
            goto bad;
#else
        from_list = PyList_New(len_imported_names);
        if (unlikely(!from_list)) goto bad;
        for (Py_ssize_t i=0; i<len_imported_names; ++i) {
            if (PyList_SetItem(from_list, i, __Pyx_NewRef(imported_names[i])) < 0) goto bad;
        }
#endif
    }
    if (level == -1) {
        const char* package_sep = strchr(__Pyx_MODULE_NAME, '.');
        if (package_sep != (0)) {
            module = PyImport_ImportModuleLevelObject(
                name, moddict, empty_dict, from_list, 1);
            if (unlikely(!module)) {
                if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError)))
                    goto bad;
                PyErr_Clear();
            }
        }
        level = 0;
    }
    if (!module) {
        module = PyImport_ImportModuleLevelObject(
            name, moddict, empty_dict, from_list, level);
    }
bad:
    Py_XDECREF(from_list);
    Py_XDECREF(empty_dict);
    return module;
}

/* Import */
static PyObject *__Pyx_Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, int level) {
    return __Pyx__Import(name, imported_names, len_imported_names, qualname, __pyx_mstate_global->__pyx_d, level);
}

/* PySequenceMultiply */
#if CYTHON_USE_TYPE_SLOTS
static PyObject* __Pyx_PySequence_Multiply_Generic(PyObject *seq, Py_ssize_t mul) {
    PyObject *result, *pymul = PyLong_FromSsize_t(mul);
    if (unlikely(!pymul))
        return NULL;
    result = PyNumber_Multiply(seq, pymul);
    Py_DECREF(pymul);
    return result;
}
static CYTHON_INLINE PyObject* __Pyx_PySequence_Multiply(PyObject *seq, Py_ssize_t mul) {
    PyTypeObject *type = Py_TYPE(seq);
    if (likely(type->tp_as_sequence && type->tp_as_sequence->sq_repeat)) {
        return type->tp_as_sequence->sq_repeat(seq, mul);
    } else {
        return __Pyx_PySequence_Multiply_Generic(seq, mul);
    }
}
#endif

/* PyObjectFormatAndDecref */
static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f) {
    if (unlikely(!s)) return NULL;
    if (likely(PyUnicode_CheckExact(s))) return s;
    return __Pyx_PyObject_FormatAndDecref(s, f);
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f) {
    PyObject *result;
    if (unlikely(!s)) return NULL;
    result = PyObject_Format(s, f);
    Py_DECREF(s);
    return result;
}

/* PyObjectFormat */
#if CYTHON_USE_UNICODE_WRITER
static PyObject* __Pyx_PyObject_Format(PyObject* obj, PyObject* format_spec) {
    int ret;
    _PyUnicodeWriter writer;
    if (likely(PyFloat_CheckExact(obj))) {
        _PyUnicodeWriter_Init(&writer);
        ret = _PyFloat_FormatAdvancedWriter(
            &writer,
            obj,
            format_spec, 0, PyUnicode_GET_LENGTH(format_spec));
    } else if (likely(PyLong_CheckExact(obj))) {
        _PyUnicodeWriter_Init(&writer);
        ret = _PyLong_FormatAdvancedWriter(
            &writer,
            obj,
            format_spec, 0, PyUnicode_GET_LENGTH(format_spec));
    } else {
        return PyObject_Format(obj, format_spec);
    }
    if (unlikely(ret == -1)) {
        _PyUnicodeWriter_Dealloc(&writer);
        return NULL;
    }
    return _PyUnicodeWriter_Finish(&writer);
}
#endif

/* SetItemInt */
static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
    int r;
    if (unlikely(!j)) return -1;
    r = PyObject_SetItem(o, j, v);
    Py_DECREF(j);
    return r;
}
static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int is_list,
                                               int wraparound, int boundscheck, int unsafe_shared) {
    CYTHON_MAYBE_UNUSED_VAR(unsafe_shared);
#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE && !CYTHON_AVOID_BORROWED_REFS
    if (is_list || PyList_CheckExact(o)) {
        Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o));
        if ((CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS && !__Pyx_IS_UNIQUELY_REFERENCED(o, unsafe_shared))) {
            Py_INCREF(v);
            return PyList_SetItem(o, n, v);
        } else if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o)))) {
            PyObject* old;
            Py_INCREF(v);
            old = PyList_GET_ITEM(o, n);
            PyList_SET_ITEM(o, n, v);
            Py_DECREF(old);
            return 0;
        }
    } else
#endif
#if CYTHON_USE_TYPE_SLOTS && !CYTHON_COMPILING_IN_PYPY
    {
        PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping;
        PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence;
        if (!is_list && mm && mm->mp_ass_subscript) {
            int r;
            PyObject *key = PyLong_FromSsize_t(i);
            if (unlikely(!key)) return -1;
            r = mm->mp_ass_subscript(o, key, v);
            Py_DECREF(key);
            return r;
        }
        if (is_list || likely(sm && sm->sq_ass_item)) {
            if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) {
                Py_ssize_t l = sm->sq_length(o);
                if (likely(l >= 0)) {
                    i += l;
                } else {
                    if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                        return -1;
                    PyErr_Clear();
                }
            }
            return sm->sq_ass_item(o, i, v);
        }
    }
#else
    if (is_list || !PyMapping_Check(o)) {
        return PySequence_SetItem(o, i, v);
    }
#endif
    (void)wraparound;
    (void)boundscheck;
    return __Pyx_SetItemInt_Generic(o, PyLong_FromSsize_t(i), v);
}

/* RaiseUnboundLocalError */
static void __Pyx_RaiseUnboundLocalError(const char *varname) {
    PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
}

/* DivInt[long] */
static CYTHON_INLINE long __Pyx_div_long(long a, long b, int b_is_constant) {
    long q = a / b;
    long r = a - q*b;
    long adapt_python = (b_is_constant ?
        ((r != 0) & ((r < 0) ^ (b < 0))) :
        ((r != 0) & ((r ^ b) < 0))
    );
    return q - adapt_python;
}

/* py_dict_keys */
static CYTHON_INLINE PyObject* __Pyx_PyDict_Keys(PyObject* d) {
    return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_keys, d);
}

/* DictGetItem */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
    PyObject *value;
    if (unlikely(__Pyx_PyDict_GetItemRef(d, key, &value) == 0)) { // no value, no error
        if (unlikely(PyTuple_Check(key))) {
            PyObject* args = PyTuple_Pack(1, key);
            if (likely(args)) {
                PyErr_SetObject(PyExc_KeyError, args);
                Py_DECREF(args);
            }
        } else {
            PyErr_SetObject(PyExc_KeyError, key);
        }
    }
    return value;
}
#endif

/* decode_c_string */
static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
         const char* cstring, Py_ssize_t start, Py_ssize_t stop,
         const char* encoding, const char* errors,
         PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
    Py_ssize_t length;
    if (unlikely((start < 0) | (stop < 0))) {
        size_t slen = strlen(cstring);
        if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) {
            PyErr_SetString(PyExc_OverflowError,
                            "c-string too long to convert to Python");
            return NULL;
        }
        length = (Py_ssize_t) slen;
        if (start < 0) {
            start += length;
            if (start < 0)
                start = 0;
        }
        if (stop < 0)
            stop += length;
    }
    if (unlikely(stop <= start))
        return __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_unicode);
    length = stop - start;
    cstring += start;
    if (decode_func) {
        return decode_func(cstring, length, errors);
    } else {
        return PyUnicode_Decode(cstring, length, encoding, errors);
    }
}

/* IterFinish */
static CYTHON_INLINE int __Pyx_IterFinish(void) {
    PyObject* exc_type;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    exc_type = __Pyx_PyErr_CurrentExceptionType();
    if (unlikely(exc_type)) {
        if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))
            return -1;
        __Pyx_PyErr_Clear();
        return 0;
    }
    return 0;
}

/* UnpackItemEndCheck */
static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
    if (unlikely(retval)) {
        Py_DECREF(retval);
        __Pyx_RaiseTooManyValuesError(expected);
        return -1;
    }
    return __Pyx_IterFinish();
}

/* PyObjectCall2Args (used by CallUnboundCMethod1) */
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
    PyObject *args[3] = {NULL, arg1, arg2};
    return __Pyx_PyObject_FastCall(function, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
}

/* CallUnboundCMethod1 */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg) {
    int was_initialized =  __Pyx_CachedCFunction_GetAndSetInitializing(cfunc);
    if (likely(was_initialized == 2 && cfunc->func)) {
        int flag = cfunc->flag;
        if (flag == METH_O) {
            return __Pyx_CallCFunction(cfunc, self, arg);
        } else if (flag == METH_FASTCALL) {
            return __Pyx_CallCFunctionFast(cfunc, self, &arg, 1);
        } else if (flag == (METH_FASTCALL | METH_KEYWORDS)) {
            return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, &arg, 1, NULL);
        }
    }
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    else if (unlikely(was_initialized == 1)) {
        __Pyx_CachedCFunction tmp_cfunc = {
#ifndef __cplusplus
            0
#endif
        };
        tmp_cfunc.type = cfunc->type;
        tmp_cfunc.method_name = cfunc->method_name;
        return __Pyx__CallUnboundCMethod1(&tmp_cfunc, self, arg);
    }
#endif
    PyObject* result = __Pyx__CallUnboundCMethod1(cfunc, self, arg);
    __Pyx_CachedCFunction_SetFinishedInitializing(cfunc);
    return result;
}
#endif
static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg){
    PyObject *result = NULL;
    if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
#if CYTHON_COMPILING_IN_CPYTHON
    if (cfunc->func && (cfunc->flag & METH_VARARGS)) {
        PyObject *args = PyTuple_New(1);
        if (unlikely(!args)) return NULL;
        Py_INCREF(arg);
        PyTuple_SET_ITEM(args, 0, arg);
        if (cfunc->flag & METH_KEYWORDS)
            result = __Pyx_CallCFunctionWithKeywords(cfunc, self, args, NULL);
        else
            result = __Pyx_CallCFunction(cfunc, self, args);
        Py_DECREF(args);
    } else
#endif
    {
        result = __Pyx_PyObject_Call2Args(cfunc->method, self, arg);
    }
    return result;
}

/* dict_getitem_default */
static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value) {
    PyObject* value;
#if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000
    value = PyDict_GetItemWithError(d, key);
    if (unlikely(!value)) {
        if (unlikely(PyErr_Occurred()))
            return NULL;
        value = default_value;
    }
    Py_INCREF(value);
    if ((1));
#else
    if (PyBytes_CheckExact(key) || PyUnicode_CheckExact(key) || PyLong_CheckExact(key)) {
        value = PyDict_GetItem(d, key);
        if (unlikely(!value)) {
            value = default_value;
        }
        Py_INCREF(value);
    }
#endif
    else {
        if (default_value == Py_None)
            value = __Pyx_CallUnboundCMethod1(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_get, d, key);
        else
            value = __Pyx_CallUnboundCMethod2(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_get, d, key, default_value);
    }
    return value;
}

/* KeywordStringCheck */
static int __Pyx_CheckKeywordStrings(
    const char* function_name,
    PyObject *kw)
{
#if CYTHON_COMPILING_IN_PYPY && !defined(PyArg_ValidateKeywordArguments)
    CYTHON_UNUSED_VAR(function_name);
    CYTHON_UNUSED_VAR(kw);
    return 0;
#else
    if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kw))) {
#if PY_VERSION_HEX >= 0x03090000
        CYTHON_UNUSED_VAR(function_name);
#else
        Py_ssize_t kwsize;
        #if CYTHON_ASSUME_SAFE_SIZE
        kwsize = PyTuple_GET_SIZE(kw);
        #else
        kwsize = PyTuple_Size(kw);
        if (unlikely(kwsize < 0)) return -1;
        #endif
        for (Py_ssize_t pos = 0; pos < kwsize; pos++) {
            PyObject* key = NULL;
            #if CYTHON_ASSUME_SAFE_MACROS
            key = PyTuple_GET_ITEM(kw, pos);
            #else
            key = PyTuple_GetItem(kw, pos);
            if (unlikely(!key)) return -1;
            #endif
            if (unlikely(!PyUnicode_Check(key))) {
                PyErr_Format(PyExc_TypeError,
                    "%.200s() keywords must be strings", function_name);
                return -1;
            }
        }
#endif
    } else {
        if (unlikely(!PyArg_ValidateKeywordArguments(kw))) return -1;
    }
    return 0;
#endif
}

/* RaiseClosureNameError */
static void __Pyx_RaiseClosureNameError(const char *varname) {
    PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname);
}

/* ModInt[long] */
static CYTHON_INLINE long __Pyx_mod_long(long a, long b, int b_is_constant) {
    long r = a % b;
    long adapt_python = (b_is_constant ?
        ((r != 0) & ((r < 0) ^ (b < 0))) :
        ((r != 0) & ((r ^ b) < 0))
    );
    return r + adapt_python * b;
}

/* PyLongBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_Fallback___Pyx_PyLong_MultiplyCObj(PyObject *op1, PyObject *op2, int inplace) {
    return (inplace ? PyNumber_InPlaceMultiply : PyNumber_Multiply)(op1, op2);
}
#if CYTHON_USE_PYLONG_INTERNALS
static PyObject* __Pyx_Unpacked___Pyx_PyLong_MultiplyCObj(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(inplace);
    CYTHON_UNUSED_VAR(zerodivision_check);
    const long a = intval;
    long b;
    const PY_LONG_LONG lla = intval;
    PY_LONG_LONG llb;
    if (unlikely(__Pyx_PyLong_IsZero(op2))) {
        return __Pyx_NewRef(op2);
    }
    const int is_positive = __Pyx_PyLong_IsPos(op2);
    const digit* digits = __Pyx_PyLong_Digits(op2);
    const Py_ssize_t size = __Pyx_PyLong_DigitCount(op2);
    if (likely(size == 1)) {
        b = (long) digits[0];
        if (!is_positive) b *= -1;
    } else {
        switch (size) {
            case 2:
                if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT+30) {
                    b = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    if (!is_positive) b *= -1;
                    goto calculate_long;
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT+30) {
                    llb = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    if (!is_positive) llb *= -1;
                    goto calculate_long_long;
                }
                break;
            case 3:
                if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT+30) {
                    b = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    if (!is_positive) b *= -1;
                    goto calculate_long;
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT+30) {
                    llb = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    if (!is_positive) llb *= -1;
                    goto calculate_long_long;
                }
                break;
            case 4:
                if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT+30) {
                    b = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    if (!is_positive) b *= -1;
                    goto calculate_long;
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT+30) {
                    llb = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    if (!is_positive) llb *= -1;
                    goto calculate_long_long;
                }
                break;
        }
        return PyLong_Type.tp_as_number->nb_multiply(op1, op2);
    }
    calculate_long:
        CYTHON_UNUSED_VAR(a);
        CYTHON_UNUSED_VAR(b);
        llb = b;
        goto calculate_long_long;
    calculate_long_long:
        {
            PY_LONG_LONG llx;
            llx = lla * llb;
            return PyLong_FromLongLong(llx);
        }
    
}
#endif
static PyObject* __Pyx_Float___Pyx_PyLong_MultiplyCObj(PyObject *float_val, long intval, int zerodivision_check) {
    CYTHON_UNUSED_VAR(zerodivision_check);
    const long a = intval;
    double b = __Pyx_PyFloat_AS_DOUBLE(float_val);
        double result;
        
        result = ((double)a) * (double)b;
        return PyFloat_FromDouble(result);
}
static CYTHON_INLINE PyObject* __Pyx_PyLong_MultiplyCObj(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_UNUSED_VAR(zerodivision_check);
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op2))) {
        return __Pyx_Unpacked___Pyx_PyLong_MultiplyCObj(op1, op2, intval, inplace, zerodivision_check);
    }
    #endif
    if (PyFloat_CheckExact(op2)) {
        return __Pyx_Float___Pyx_PyLong_MultiplyCObj(op2, intval, zerodivision_check);
    }
    return __Pyx_Fallback___Pyx_PyLong_MultiplyCObj(op1, op2, inplace);
}
#endif

/* dict_setdefault (used by FetchCommonType) */
static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value) {
    PyObject* value;
#if __PYX_LIMITED_VERSION_HEX >= 0x030F0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4)
    PyDict_SetDefaultRef(d, key, default_value, &value);
#elif CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX >= 0x030C0000
    PyObject *args[] = {d, key, default_value};
    value = PyObject_VectorcallMethod(__pyx_mstate_global->__pyx_n_u_setdefault, args, 3 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
#elif CYTHON_COMPILING_IN_LIMITED_API
    value = PyObject_CallMethodObjArgs(d, __pyx_mstate_global->__pyx_n_u_setdefault, key, default_value, NULL);
#else
    value = PyDict_SetDefault(d, key, default_value);
    if (unlikely(!value)) return NULL;
    Py_INCREF(value);
#endif
    return value;
}

/* LimitedApiGetTypeDict (used by SetItemOnTypeDict) */
#if CYTHON_COMPILING_IN_LIMITED_API
static Py_ssize_t __Pyx_GetTypeDictOffset(void) {
    PyObject *tp_dictoffset_o;
    Py_ssize_t tp_dictoffset;
    tp_dictoffset_o = PyObject_GetAttrString((PyObject*)(&PyType_Type), "__dictoffset__");
    if (unlikely(!tp_dictoffset_o)) return -1;
    tp_dictoffset = PyLong_AsSsize_t(tp_dictoffset_o);
    Py_DECREF(tp_dictoffset_o);
    if (unlikely(tp_dictoffset == 0)) {
        PyErr_SetString(
            PyExc_TypeError,
            "'type' doesn't have a dictoffset");
        return -1;
    } else if (unlikely(tp_dictoffset < 0)) {
        PyErr_SetString(
            PyExc_TypeError,
            "'type' has an unexpected negative dictoffset. "
            "Please report this as Cython bug");
        return -1;
    }
    return tp_dictoffset;
}
static PyObject *__Pyx_GetTypeDict(PyTypeObject *tp) {
    static Py_ssize_t tp_dictoffset = 0;
    if (unlikely(tp_dictoffset == 0)) {
        tp_dictoffset = __Pyx_GetTypeDictOffset();
        if (unlikely(tp_dictoffset == -1 && PyErr_Occurred())) {
            tp_dictoffset = 0; // try again next time?
            return NULL;
        }
    }
    return *(PyObject**)((char*)tp + tp_dictoffset);
}
#endif

/* SetItemOnTypeDict (used by FixUpExtensionType) */
static int __Pyx__SetItemOnTypeDict(PyTypeObject *tp, PyObject *k, PyObject *v) {
    int result;
    PyObject *tp_dict;
#if CYTHON_COMPILING_IN_LIMITED_API
    tp_dict = __Pyx_GetTypeDict(tp);
    if (unlikely(!tp_dict)) return -1;
#else
    tp_dict = tp->tp_dict;
#endif
    result = PyDict_SetItem(tp_dict, k, v);
    if (likely(!result)) {
        PyType_Modified(tp);
        if (unlikely(PyObject_HasAttr(v, __pyx_mstate_global->__pyx_n_u_set_name))) {
            PyObject *setNameResult = PyObject_CallMethodObjArgs(v, __pyx_mstate_global->__pyx_n_u_set_name,  (PyObject *) tp, k, NULL);
            if (!setNameResult) return -1;
            Py_DECREF(setNameResult);
        }
    }
    return result;
}

/* FixUpExtensionType (used by FetchCommonType) */
static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) {
#if __PYX_LIMITED_VERSION_HEX > 0x030900B1
    CYTHON_UNUSED_VAR(spec);
    CYTHON_UNUSED_VAR(type);
    CYTHON_UNUSED_VAR(__Pyx__SetItemOnTypeDict);
#else
    const PyType_Slot *slot = spec->slots;
    int changed = 0;
#if !CYTHON_COMPILING_IN_LIMITED_API
    while (slot && slot->slot && slot->slot != Py_tp_members)
        slot++;
    if (slot && slot->slot == Py_tp_members) {
#if !CYTHON_COMPILING_IN_CPYTHON
        const
#endif  // !CYTHON_COMPILING_IN_CPYTHON)
            PyMemberDef *memb = (PyMemberDef*) slot->pfunc;
        while (memb && memb->name) {
            if (memb->name[0] == '_' && memb->name[1] == '_') {
                if (strcmp(memb->name, "__weaklistoffset__") == 0) {
                    assert(memb->type == T_PYSSIZET);
                    assert(memb->flags == READONLY);
                    type->tp_weaklistoffset = memb->offset;
                    changed = 1;
                }
                else if (strcmp(memb->name, "__dictoffset__") == 0) {
                    assert(memb->type == T_PYSSIZET);
                    assert(memb->flags == READONLY);
                    type->tp_dictoffset = memb->offset;
                    changed = 1;
                }
#if CYTHON_METH_FASTCALL
                else if (strcmp(memb->name, "__vectorcalloffset__") == 0) {
                    assert(memb->type == T_PYSSIZET);
                    assert(memb->flags == READONLY);
                    type->tp_vectorcall_offset = memb->offset;
                    changed = 1;
                }
#endif  // CYTHON_METH_FASTCALL
#if !CYTHON_COMPILING_IN_PYPY
                else if (strcmp(memb->name, "__module__") == 0) {
                    PyObject *descr;
                    assert(memb->type == T_OBJECT);
                    assert(memb->flags == 0 || memb->flags == READONLY);
                    descr = PyDescr_NewMember(type, memb);
                    if (unlikely(!descr))
                        return -1;
                    int set_item_result = PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr);
                    Py_DECREF(descr);
                    if (unlikely(set_item_result < 0)) {
                        return -1;
                    }
                    changed = 1;
                }
#endif  // !CYTHON_COMPILING_IN_PYPY
            }
            memb++;
        }
    }
#endif  // !CYTHON_COMPILING_IN_LIMITED_API
#if !CYTHON_COMPILING_IN_PYPY
    slot = spec->slots;
    while (slot && slot->slot && slot->slot != Py_tp_getset)
        slot++;
    if (slot && slot->slot == Py_tp_getset) {
        PyGetSetDef *getset = (PyGetSetDef*) slot->pfunc;
        while (getset && getset->name) {
            if (getset->name[0] == '_' && getset->name[1] == '_' && strcmp(getset->name, "__module__") == 0) {
                PyObject *descr = PyDescr_NewGetSet(type, getset);
                if (unlikely(!descr))
                    return -1;
                #if CYTHON_COMPILING_IN_LIMITED_API
                PyObject *pyname = PyUnicode_FromString(getset->name);
                if (unlikely(!pyname)) {
                    Py_DECREF(descr);
                    return -1;
                }
                int set_item_result = __Pyx_SetItemOnTypeDict(type, pyname, descr);
                Py_DECREF(pyname);
                #else
                CYTHON_UNUSED_VAR(__Pyx__SetItemOnTypeDict);
                int set_item_result = PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr);
                #endif
                Py_DECREF(descr);
                if (unlikely(set_item_result < 0)) {
                    return -1;
                }
                changed = 1;
            }
            ++getset;
        }
    }
#else
    CYTHON_UNUSED_VAR(__Pyx__SetItemOnTypeDict);
#endif  // !CYTHON_COMPILING_IN_PYPY
    if (changed)
        PyType_Modified(type);
#endif  // PY_VERSION_HEX > 0x030900B1
    return 0;
}

/* AddModuleRef (used by FetchSharedCythonModule) */
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
  static PyObject *__Pyx_PyImport_AddModuleObjectRef(PyObject *name) {
      PyObject *module_dict = PyImport_GetModuleDict();
      PyObject *m;
      if (PyMapping_GetOptionalItem(module_dict, name, &m) < 0) {
          return NULL;
      }
      if (m != NULL && PyModule_Check(m)) {
          return m;
      }
      Py_XDECREF(m);
      m = PyModule_NewObject(name);
      if (m == NULL)
          return NULL;
      if (PyDict_CheckExact(module_dict)) {
          PyObject *new_m;
          (void)PyDict_SetDefaultRef(module_dict, name, m, &new_m);
          Py_DECREF(m);
          return new_m;
      } else {
           if (PyObject_SetItem(module_dict, name, m) != 0) {
                Py_DECREF(m);
                return NULL;
            }
            return m;
      }
  }
  static PyObject *__Pyx_PyImport_AddModuleRef(const char *name) {
      PyObject *py_name = PyUnicode_FromString(name);
      if (!py_name) return NULL;
      PyObject *module = __Pyx_PyImport_AddModuleObjectRef(py_name);
      Py_DECREF(py_name);
      return module;
  }
#elif __PYX_LIMITED_VERSION_HEX >= 0x030d0000
  #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name)
#else
  static PyObject *__Pyx_PyImport_AddModuleRef(const char *name) {
      PyObject *module = PyImport_AddModule(name);
      Py_XINCREF(module);
      return module;
  }
#endif

/* FetchSharedCythonModule (used by FetchCommonType) */
static PyObject *__Pyx_FetchSharedCythonABIModule(void) {
    return __Pyx_PyImport_AddModuleRef(__PYX_ABI_MODULE_NAME);
}

/* FetchCommonType (used by CommonTypesMetaclass) */
#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
static PyObject* __Pyx_PyType_FromMetaclass(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases) {
    PyObject *result = __Pyx_PyType_FromModuleAndSpec(module, spec, bases);
    if (result && metaclass) {
        PyObject *old_tp = (PyObject*)Py_TYPE(result);
    Py_INCREF((PyObject*)metaclass);
#if __PYX_LIMITED_VERSION_HEX >= 0x03090000
        Py_SET_TYPE(result, metaclass);
#else
        result->ob_type = metaclass;
#endif
        Py_DECREF(old_tp);
    }
    return result;
}
#else
#define __Pyx_PyType_FromMetaclass(me, mo, s, b) PyType_FromMetaclass(me, mo, s, b)
#endif
static int __Pyx_VerifyCachedType(PyObject *cached_type,
                               const char *name,
                               Py_ssize_t expected_basicsize) {
    Py_ssize_t basicsize;
    if (!PyType_Check(cached_type)) {
        PyErr_Format(PyExc_TypeError,
            "Shared Cython type %.200s is not a type object", name);
        return -1;
    }
    if (expected_basicsize == 0) {
        return 0; // size is inherited, nothing useful to check
    }
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject *py_basicsize;
    py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__");
    if (unlikely(!py_basicsize)) return -1;
    basicsize = PyLong_AsSsize_t(py_basicsize);
    Py_DECREF(py_basicsize);
    py_basicsize = NULL;
    if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) return -1;
#else
    basicsize = ((PyTypeObject*) cached_type)->tp_basicsize;
#endif
    if (basicsize != expected_basicsize) {
        PyErr_Format(PyExc_TypeError,
            "Shared Cython type %.200s has the wrong size, try recompiling",
            name);
        return -1;
    }
    return 0;
}
static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases) {
    PyObject *abi_module = NULL, *cached_type = NULL, *abi_module_dict, *new_cached_type, *py_object_name;
    int get_item_ref_result;
    const char* object_name = strrchr(spec->name, '.');
    object_name = object_name ? object_name+1 : spec->name;
    py_object_name = PyUnicode_FromString(object_name);
    if (!py_object_name) return NULL;
    abi_module = __Pyx_FetchSharedCythonABIModule();
    if (!abi_module) goto done;
    abi_module_dict = PyModule_GetDict(abi_module);
    if (!abi_module_dict) goto done;
    get_item_ref_result = __Pyx_PyDict_GetItemRef(abi_module_dict, py_object_name, &cached_type);
    if (get_item_ref_result == 1) {
        if (__Pyx_VerifyCachedType(
              cached_type,
              object_name,
              spec->basicsize) < 0) {
            goto bad;
        }
        goto done;
    } else if (unlikely(get_item_ref_result == -1)) {
        goto bad;
    }
    cached_type = __Pyx_PyType_FromMetaclass(
        metaclass,
        CYTHON_USE_MODULE_STATE ? module : abi_module,
        spec, bases);
    if (unlikely(!cached_type)) goto bad;
    if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad;
    new_cached_type = __Pyx_PyDict_SetDefault(abi_module_dict, py_object_name, cached_type);
    if (unlikely(new_cached_type != cached_type)) {
        if (unlikely(!new_cached_type)) goto bad;
        Py_DECREF(cached_type);
        cached_type = new_cached_type;
        if (__Pyx_VerifyCachedType(
                cached_type,
                object_name,
                spec->basicsize) < 0) {
            goto bad;
        }
        goto done;
    } else {
        Py_DECREF(new_cached_type);
    }
done:
    Py_XDECREF(abi_module);
    Py_DECREF(py_object_name);
    assert(cached_type == NULL || PyType_Check(cached_type));
    return (PyTypeObject *) cached_type;
bad:
    Py_XDECREF(cached_type);
    cached_type = NULL;
    goto done;
}

/* CommonTypesMetaclass (used by CythonFunctionShared) */
static PyObject* __pyx_CommonTypesMetaclass_get_module(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED void* context) {
    return PyUnicode_FromString(__PYX_ABI_MODULE_NAME);
}
#if __PYX_LIMITED_VERSION_HEX < 0x030A0000
static PyObject* __pyx_CommonTypesMetaclass_call(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED PyObject *args, CYTHON_UNUSED PyObject *kwds) {
    PyErr_SetString(PyExc_TypeError, "Cannot instantiate Cython internal types");
    return NULL;
}
static int __pyx_CommonTypesMetaclass_setattr(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED PyObject *attr, CYTHON_UNUSED PyObject *value) {
    PyErr_SetString(PyExc_TypeError, "Cython internal types are immutable");
    return -1;
}
#endif
static PyGetSetDef __pyx_CommonTypesMetaclass_getset[] = {
    {"__module__", __pyx_CommonTypesMetaclass_get_module, NULL, NULL, NULL},
    {0, 0, 0, 0, 0}
};
static PyType_Slot __pyx_CommonTypesMetaclass_slots[] = {
    {Py_tp_getset, (void *)__pyx_CommonTypesMetaclass_getset},
    #if __PYX_LIMITED_VERSION_HEX < 0x030A0000
    {Py_tp_call, (void*)__pyx_CommonTypesMetaclass_call},
    {Py_tp_new, (void*)__pyx_CommonTypesMetaclass_call},
    {Py_tp_setattro, (void*)__pyx_CommonTypesMetaclass_setattr},
    #endif
    {0, 0}
};
static PyType_Spec __pyx_CommonTypesMetaclass_spec = {
    __PYX_TYPE_MODULE_PREFIX "_common_types_metatype",
    0,
    0,
    Py_TPFLAGS_IMMUTABLETYPE |
    Py_TPFLAGS_DISALLOW_INSTANTIATION |
    Py_TPFLAGS_DEFAULT,
    __pyx_CommonTypesMetaclass_slots
};
static int __pyx_CommonTypesMetaclass_init(PyObject *module) {
    __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module);
    PyObject *bases = PyTuple_Pack(1, &PyType_Type);
    if (unlikely(!bases)) {
        return -1;
    }
    mstate->__pyx_CommonTypesMetaclassType = __Pyx_FetchCommonTypeFromSpec(NULL, module, &__pyx_CommonTypesMetaclass_spec, bases);
    Py_DECREF(bases);
    if (unlikely(mstate->__pyx_CommonTypesMetaclassType == NULL)) {
        return -1;
    }
    return 0;
}

/* CallTypeTraverse (used by CythonFunctionShared) */
#if !CYTHON_USE_TYPE_SPECS || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x03090000)
#else
static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visit, void *arg) {
    #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x03090000
    if (__Pyx_get_runtime_version() < 0x03090000) return 0;
    #endif
    if (!always_call) {
        PyTypeObject *base = __Pyx_PyObject_GetSlot(o, tp_base, PyTypeObject*);
        unsigned long flags = PyType_GetFlags(base);
        if (flags & Py_TPFLAGS_HEAPTYPE) {
            return 0;
        }
    }
    Py_VISIT((PyObject*)Py_TYPE(o));
    return 0;
}
#endif

/* PyMethodNew (used by CythonFunctionShared) */
#if CYTHON_COMPILING_IN_LIMITED_API
static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
    PyObject *result;
    CYTHON_UNUSED_VAR(typ);
    if (!self)
        return __Pyx_NewRef(func);
    #if __PYX_LIMITED_VERSION_HEX >= 0x030C0000
    {
        PyObject *args[] = {func, self};
        result = PyObject_Vectorcall(__pyx_mstate_global->__Pyx_CachedMethodType, args, 2, NULL);
    }
    #else
    result = PyObject_CallFunctionObjArgs(__pyx_mstate_global->__Pyx_CachedMethodType, func, self, NULL);
    #endif
    return result;
}
#else
static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
    CYTHON_UNUSED_VAR(typ);
    if (!self)
        return __Pyx_NewRef(func);
    return PyMethod_New(func, self);
}
#endif

/* PyVectorcallFastCallDict (used by CythonFunctionShared) */
#if CYTHON_METH_FASTCALL && CYTHON_VECTORCALL
static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw)
{
    PyObject *res = NULL;
    PyObject *kwnames;
    PyObject **newargs;
    PyObject **kwvalues;
    Py_ssize_t i;
    #if CYTHON_AVOID_BORROWED_REFS
    PyObject *pos;
    #else
    Py_ssize_t pos;
    #endif
    size_t j;
    PyObject *key, *value;
    unsigned long keys_are_strings;
    #if !CYTHON_ASSUME_SAFE_SIZE
    Py_ssize_t nkw = PyDict_Size(kw);
    if (unlikely(nkw == -1)) return NULL;
    #else
    Py_ssize_t nkw = PyDict_GET_SIZE(kw);
    #endif
    newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0]));
    if (unlikely(newargs == NULL)) {
        PyErr_NoMemory();
        return NULL;
    }
    for (j = 0; j < nargs; j++) newargs[j] = args[j];
    kwnames = PyTuple_New(nkw);
    if (unlikely(kwnames == NULL)) {
        PyMem_Free(newargs);
        return NULL;
    }
    kwvalues = newargs + nargs;
    pos = 0;
    i = 0;
    keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS;
    while (__Pyx_PyDict_NextRef(kw, &pos, &key, &value)) {
        keys_are_strings &=
        #if CYTHON_COMPILING_IN_LIMITED_API
            PyType_GetFlags(Py_TYPE(key));
        #else
            Py_TYPE(key)->tp_flags;
        #endif
        #if !CYTHON_ASSUME_SAFE_MACROS
        if (unlikely(PyTuple_SetItem(kwnames, i, key) < 0)) goto cleanup;
        #else
        PyTuple_SET_ITEM(kwnames, i, key);
        #endif
        kwvalues[i] = value;
        i++;
    }
    if (unlikely(!keys_are_strings)) {
        PyErr_SetString(PyExc_TypeError, "keywords must be strings");
        goto cleanup;
    }
    res = vc(func, newargs, nargs, kwnames);
cleanup:
    #if CYTHON_AVOID_BORROWED_REFS
    Py_DECREF(pos);
    #endif
    Py_DECREF(kwnames);
    for (i = 0; i < nkw; i++)
        Py_DECREF(kwvalues[i]);
    PyMem_Free(newargs);
    return res;
}
static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw)
{
    Py_ssize_t kw_size =
        likely(kw == NULL) ?
        0 :
#if !CYTHON_ASSUME_SAFE_SIZE
        PyDict_Size(kw);
#else
        PyDict_GET_SIZE(kw);
#endif
    if (kw_size == 0) {
        return vc(func, args, nargs, NULL);
    }
#if !CYTHON_ASSUME_SAFE_SIZE
    else if (unlikely(kw_size == -1)) {
        return NULL;
    }
#endif
    return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw);
}
#endif

/* CythonFunctionShared (used by CythonFunction) */
#if CYTHON_COMPILING_IN_LIMITED_API
static CYTHON_INLINE int __Pyx__IsSameCyOrCFunctionNoMethod(PyObject *func, void (*cfunc)(void)) {
    if (__Pyx_CyFunction_Check(func)) {
        return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc;
    } else if (PyCFunction_Check(func)) {
        return PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
    }
    return 0;
}
static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void)) {
    if ((PyObject*)Py_TYPE(func) == __pyx_mstate_global->__Pyx_CachedMethodType) {
        int result;
        PyObject *newFunc = PyObject_GetAttr(func, __pyx_mstate_global->__pyx_n_u_func);
        if (unlikely(!newFunc)) {
            PyErr_Clear(); // It's only an optimization, so don't throw an error
            return 0;
        }
        result = __Pyx__IsSameCyOrCFunctionNoMethod(newFunc, cfunc);
        Py_DECREF(newFunc);
        return result;
    }
    return __Pyx__IsSameCyOrCFunctionNoMethod(func, cfunc);
}
#else
static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void)) {
    if (PyMethod_Check(func)) {
        func = PyMethod_GET_FUNCTION(func);
    }
    return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
}
#endif
static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) {
#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
    __Pyx_Py_XDECREF_SET(
        __Pyx_CyFunction_GetClassObj(f),
            ((classobj) ? __Pyx_NewRef(classobj) : NULL));
#else
    __Pyx_Py_XDECREF_SET(
        ((PyCMethodObject *) (f))->mm_class,
        (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL));
#endif
}
static PyObject *
__Pyx_CyFunction_get_doc_locked(__pyx_CyFunctionObject *op)
{
    if (unlikely(op->func_doc == NULL)) {
#if CYTHON_COMPILING_IN_LIMITED_API
        op->func_doc = PyObject_GetAttrString(op->func, "__doc__");
        if (unlikely(!op->func_doc)) return NULL;
#else
        if (((PyCFunctionObject*)op)->m_ml->ml_doc) {
            op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc);
            if (unlikely(op->func_doc == NULL))
                return NULL;
        } else {
            Py_INCREF(Py_None);
            return Py_None;
        }
#endif
    }
    Py_INCREF(op->func_doc);
    return op->func_doc;
}
static PyObject *
__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) {
    PyObject *result;
    CYTHON_UNUSED_VAR(closure);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    result = __Pyx_CyFunction_get_doc_locked(op);
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static int
__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
    if (value == NULL) {
        value = Py_None;
    }
    Py_INCREF(value);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    __Pyx_Py_XDECREF_SET(op->func_doc, value);
    __Pyx_END_CRITICAL_SECTION();
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_name_locked(__pyx_CyFunctionObject *op)
{
    if (unlikely(op->func_name == NULL)) {
#if CYTHON_COMPILING_IN_LIMITED_API
        op->func_name = PyObject_GetAttrString(op->func, "__name__");
#else
        op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name);
#endif
        if (unlikely(op->func_name == NULL))
            return NULL;
    }
    Py_INCREF(op->func_name);
    return op->func_name;
}
static PyObject *
__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context)
{
    PyObject *result = NULL;
    CYTHON_UNUSED_VAR(context);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    result = __Pyx_CyFunction_get_name_locked(op);
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static int
__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
    if (unlikely(value == NULL || !PyUnicode_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
                        "__name__ must be set to a string object");
        return -1;
    }
    Py_INCREF(value);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    __Pyx_Py_XDECREF_SET(op->func_name, value);
    __Pyx_END_CRITICAL_SECTION();
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context)
{
    CYTHON_UNUSED_VAR(context);
    PyObject *result;
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    Py_INCREF(op->func_qualname);
    result = op->func_qualname;
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static int
__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
    if (unlikely(value == NULL || !PyUnicode_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
                        "__qualname__ must be set to a string object");
        return -1;
    }
    Py_INCREF(value);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    __Pyx_Py_XDECREF_SET(op->func_qualname, value);
    __Pyx_END_CRITICAL_SECTION();
    return 0;
}
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
static PyObject *
__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context)
{
    CYTHON_UNUSED_VAR(context);
    if (unlikely(op->func_dict == NULL)) {
        op->func_dict = PyDict_New();
        if (unlikely(op->func_dict == NULL))
            return NULL;
    }
    Py_INCREF(op->func_dict);
    return op->func_dict;
}
#endif
static PyObject *
__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context)
{
    CYTHON_UNUSED_VAR(context);
    Py_INCREF(op->func_globals);
    return op->func_globals;
}
static PyObject *
__Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context)
{
    CYTHON_UNUSED_VAR(op);
    CYTHON_UNUSED_VAR(context);
    Py_INCREF(Py_None);
    return Py_None;
}
static PyObject *
__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context)
{
    PyObject* result = (op->func_code) ? op->func_code : Py_None;
    CYTHON_UNUSED_VAR(context);
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
    int result = 0;
    PyObject *res = op->defaults_getter((PyObject *) op);
    if (unlikely(!res))
        return -1;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
    Py_INCREF(op->defaults_tuple);
    op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
    Py_INCREF(op->defaults_kwdict);
    #else
    op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0);
    if (unlikely(!op->defaults_tuple)) result = -1;
    else {
        op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1);
        if (unlikely(!op->defaults_kwdict)) result = -1;
    }
    #endif
    Py_DECREF(res);
    return result;
}
static int
__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
    CYTHON_UNUSED_VAR(context);
    if (!value) {
        value = Py_None;
    } else if (unlikely(value != Py_None && !PyTuple_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
                        "__defaults__ must be set to a tuple object");
        return -1;
    }
    PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not "
                 "currently affect the values used in function calls", 1);
    Py_INCREF(value);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    __Pyx_Py_XDECREF_SET(op->defaults_tuple, value);
    __Pyx_END_CRITICAL_SECTION();
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_defaults_locked(__pyx_CyFunctionObject *op) {
    PyObject* result = op->defaults_tuple;
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL;
            result = op->defaults_tuple;
        } else {
            result = Py_None;
        }
    }
    Py_INCREF(result);
    return result;
}
static PyObject *
__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) {
    PyObject* result = NULL;
    CYTHON_UNUSED_VAR(context);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    result = __Pyx_CyFunction_get_defaults_locked(op);
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static int
__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
    CYTHON_UNUSED_VAR(context);
    if (!value) {
        value = Py_None;
    } else if (unlikely(value != Py_None && !PyDict_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
                        "__kwdefaults__ must be set to a dict object");
        return -1;
    }
    PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not "
                 "currently affect the values used in function calls", 1);
    Py_INCREF(value);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value);
    __Pyx_END_CRITICAL_SECTION();
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_kwdefaults_locked(__pyx_CyFunctionObject *op) {
    PyObject* result = op->defaults_kwdict;
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL;
            result = op->defaults_kwdict;
        } else {
            result = Py_None;
        }
    }
    Py_INCREF(result);
    return result;
}
static PyObject *
__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) {
    PyObject* result;
    CYTHON_UNUSED_VAR(context);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    result = __Pyx_CyFunction_get_kwdefaults_locked(op);
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static int __Pyx_CyFunction_set_annotate_in_dict_if_exists(PyObject *op_in, PyObject *value);
static int
__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
    CYTHON_UNUSED_VAR(context);
    if (!value || value == Py_None) {
        value = NULL;
    } else if (unlikely(!PyDict_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
                        "__annotations__ must be set to a dict object");
        return -1;
    }
    Py_XINCREF(value);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    __Pyx_Py_XDECREF_SET(op->func_annotations, value);
    __Pyx_END_CRITICAL_SECTION();
    if (unlikely(__Pyx_CyFunction_set_annotate_in_dict_if_exists((PyObject*) op, Py_None) < 0)) return -1;
    return 0;
}
static int
__Pyx_CyFunction_get_dict_if_exists(PyObject *op_in, PyObject **dict) {
    /* Return 1 if the function dict exists, 0 otherwise.  This cannot fail:
     * _PyObject_GetDictPtr() may clear errors internally, but never reports them. */
#if CYTHON_COMPILING_IN_PYPY
    *dict = PyObject_GenericGetDict(op_in, NULL);
#elif CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX < 0x030C0000
    *dict = ((__pyx_CyFunctionObject*) op_in)->func_dict;
#else
    PyObject **dictptr = _PyObject_GetDictPtr(op_in);
    *dict = likely(dictptr) ? *dictptr : NULL;
#endif
    return *dict ? 1 : 0;
}
static int
__Pyx_CyFunction_get_annotate_from_dict_if_exists(PyObject *op_in, PyObject **annotate) {
    PyObject *dict;
    int dict_found;
    *annotate = NULL;
    dict_found = __Pyx_CyFunction_get_dict_if_exists(op_in, &dict);
    if (!dict_found) return 0;
    return __Pyx_PyDict_GetItemRef(dict, __pyx_mstate_global->__pyx_n_u_annotate, annotate);
}
static int
__Pyx_CyFunction_set_annotate_in_dict_if_exists(PyObject *op_in, PyObject *value) {
    PyObject *dict;
    int dict_found;
    dict_found = __Pyx_CyFunction_get_dict_if_exists(op_in, &dict);
    if (!dict_found) return 0;
    return PyDict_SetItem(dict, __pyx_mstate_global->__pyx_n_u_annotate, value);
}
static int
__Pyx_CyFunction_set_annotate_in_dict(PyObject *op_in, PyObject *value) {
    PyObject *dict;
    int result;
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
    dict = __Pyx_CyFunction_get_dict((__pyx_CyFunctionObject*) op_in, NULL);
#else
    dict = PyObject_GenericGetDict(op_in, NULL);
#endif
    if (unlikely(!dict)) return -1;
    result = PyDict_SetItem(dict, __pyx_mstate_global->__pyx_n_u_annotate, value);
    Py_DECREF(dict);
    return result;
}
static PyObject *
__Pyx_CyFunction_get_annotations_locked(__pyx_CyFunctionObject *op) {
    PyObject* result = op->func_annotations;
    if (unlikely(!result)) {
        result = PyDict_New();
        if (unlikely(!result)) return NULL;
        op->func_annotations = result;
    }
    Py_INCREF(result);
    return result;
}
static PyObject *
__Pyx_CyFunction_get_annotations(PyObject *op_in, void *context) {
    PyObject *annotate = NULL;
    PyObject *result = NULL;
    __pyx_CyFunctionObject *op = (__pyx_CyFunctionObject*) op_in;
    CYTHON_UNUSED_VAR(context);
    __Pyx_BEGIN_CRITICAL_SECTION(op_in);
    result = __Pyx_XNewRef(op->func_annotations);
    __Pyx_END_CRITICAL_SECTION();
    if (result) return result;
    if (unlikely(__Pyx_CyFunction_get_annotate_from_dict_if_exists(op_in, &annotate) < 0)) return NULL;
    if (!annotate || annotate == Py_None) {
        Py_XDECREF(annotate);
        __Pyx_BEGIN_CRITICAL_SECTION(op_in);
        result = __Pyx_CyFunction_get_annotations_locked(op);
        __Pyx_END_CRITICAL_SECTION();
        return result;
    }
    PyObject *format = PyLong_FromLong(1L);  // annotationlib.Format.VALUE
    if (likely(format)) {
        result = __Pyx_PyObject_CallOneArg(annotate, format);
        Py_DECREF(format);
    }
    Py_DECREF(annotate);
    if (unlikely(!result)) return NULL;
    if (unlikely(!PyDict_Check(result))) {
        PyErr_SetString(PyExc_TypeError, "__annotate__ must return a dict");
        Py_DECREF(result);
        return NULL;
    }
    __Pyx_BEGIN_CRITICAL_SECTION(op_in);
    __Pyx_Py_XDECREF_SET(op->func_annotations, __Pyx_NewRef(result));
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static PyObject *__Pyx_CyFunction_annotate_impl(PyObject *self, PyObject *args) {
    CYTHON_UNUSED_VAR(args);
    if (unlikely(!self)) {
        PyErr_SetString(PyExc_SystemError, "cython __annotate__ called without 'self' argument");
    }
    Py_XINCREF(self);
    return self;
}
static PyMethodDef __Pyx_CyFunction_annotate_method = {
    "__annotate__",
    (PyCFunction)(void (*)(void))__Pyx_CyFunction_annotate_impl,
    METH_VARARGS,
    "Placeholder __annotate__ function to allow 'functools.wraps' to work "
    "on Cython functions."
};
static PyObject *
__Pyx_CyFunction_get_annotate(PyObject *op_in, void *context) {
    PyObject *annotate = NULL;
    CYTHON_UNUSED_VAR(context);
    if (unlikely(__Pyx_CyFunction_get_annotate_from_dict_if_exists(op_in, &annotate) < 0)) return NULL;
    if (annotate) return annotate;
    PyObject *annotations = __Pyx_CyFunction_get_annotations(op_in, NULL);
    if (unlikely(!annotations)) return NULL;
    PyObject *method = PyCFunction_New(
        &__Pyx_CyFunction_annotate_method,
        annotations);
    Py_DECREF(annotations);
    return method;
}
static int
__Pyx_CyFunction_set_annotate(PyObject *op_in, PyObject* value, void *context) {
    CYTHON_UNUSED_VAR(context);
    if (value == NULL) {
        PyErr_SetString(PyExc_TypeError, "__annotate__ cannot be deleted");
        return -1;
    }
    if (unlikely(value != Py_None && !PyCallable_Check(value))) {
        PyErr_SetString(PyExc_TypeError, "__annotate__ must be callable or None");
        return -1;
    }
    if (value != Py_None) {
        __pyx_CyFunctionObject *op = (__pyx_CyFunctionObject*) op_in;
        __Pyx_BEGIN_CRITICAL_SECTION(op_in);
        Py_CLEAR(op->func_annotations);
        __Pyx_END_CRITICAL_SECTION();
    }
    return __Pyx_CyFunction_set_annotate_in_dict(op_in, value);
}
static PyObject *
__Pyx_CyFunction_get_is_coroutine_value(__pyx_CyFunctionObject *op) {
    int is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE;
    if (is_coroutine) {
        PyObject *is_coroutine_value, *module, *fromlist, *marker = __pyx_mstate_global->__pyx_n_u_is_coroutine;
        fromlist = PyList_New(1);
        if (unlikely(!fromlist)) return NULL;
        Py_INCREF(marker);
#if CYTHON_ASSUME_SAFE_MACROS
        PyList_SET_ITEM(fromlist, 0, marker);
#else
        if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) {
            Py_DECREF(fromlist);
            return NULL;
        }
#endif
        module = PyImport_ImportModuleLevelObject(__pyx_mstate_global->__pyx_n_u_asyncio_coroutines, NULL, NULL, fromlist, 0);
        Py_DECREF(fromlist);
        if (unlikely(!module)) goto ignore;
        is_coroutine_value = __Pyx_PyObject_GetAttrStr(module, marker);
        Py_DECREF(module);
        if (likely(is_coroutine_value)) {
            return is_coroutine_value;
        }
ignore:
        PyErr_Clear();
    }
    return __Pyx_PyBool_FromLong(is_coroutine);
}
static PyObject *
__Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) {
    PyObject *result;
    CYTHON_UNUSED_VAR(context);
    if (op->func_is_coroutine) {
        return __Pyx_NewRef(op->func_is_coroutine);
    }
    result = __Pyx_CyFunction_get_is_coroutine_value(op);
    if (unlikely(!result))
        return NULL;
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    if (op->func_is_coroutine) {
        Py_DECREF(result);
        result = __Pyx_NewRef(op->func_is_coroutine);
    } else {
        op->func_is_coroutine = __Pyx_NewRef(result);
    }
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static void __Pyx_CyFunction_raise_argument_count_error(__pyx_CyFunctionObject *func, const char* message, Py_ssize_t size) {
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject *py_name = __Pyx_CyFunction_get_name(func, NULL);
    if (!py_name) return;
    PyErr_Format(PyExc_TypeError,
        "%.200S() %s (%" CYTHON_FORMAT_SSIZE_T "d given)",
        py_name, message, size);
    Py_DECREF(py_name);
#else
    const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name;
    PyErr_Format(PyExc_TypeError,
        "%.200s() %s (%" CYTHON_FORMAT_SSIZE_T "d given)",
        name, message, size);
#endif
}
static void __Pyx_CyFunction_raise_type_error(__pyx_CyFunctionObject *func, const char* message) {
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject *py_name = __Pyx_CyFunction_get_name(func, NULL);
    if (!py_name) return;
    PyErr_Format(PyExc_TypeError,
        "%.200S() %s",
        py_name, message);
    Py_DECREF(py_name);
#else
    const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name;
    PyErr_Format(PyExc_TypeError,
        "%.200s() %s",
        name, message);
#endif
}
#if CYTHON_COMPILING_IN_LIMITED_API
static PyObject *
__Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) {
    CYTHON_UNUSED_VAR(context);
    return PyObject_GetAttrString(op->func, "__module__");
}
static int
__Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
    CYTHON_UNUSED_VAR(context);
    return PyObject_SetAttrString(op->func, "__module__", value);
}
#endif
static PyGetSetDef __pyx_CyFunction_getsets[] = {
    {"func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {"__doc__",  (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {"func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {"__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {"__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
    {"func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)PyObject_GenericSetDict, 0, 0},
    {"__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)PyObject_GenericSetDict, 0, 0},
#else
    {"func_dict", (getter)PyObject_GenericGetDict, (setter)PyObject_GenericSetDict, 0, 0},
    {"__dict__", (getter)PyObject_GenericGetDict, (setter)PyObject_GenericSetDict, 0, 0},
#endif
    {"func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {"__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {"func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {"__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {"func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {"__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {"func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {"__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {"__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
    {"__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
    {"__annotate__", (getter)__Pyx_CyFunction_get_annotate, (setter)__Pyx_CyFunction_set_annotate, 0, 0},
    {"_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0},
#if CYTHON_COMPILING_IN_LIMITED_API
    {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0},
#endif
    {0, 0, 0, 0, 0}
};
static PyMemberDef __pyx_CyFunction_members[] = {
#if !CYTHON_COMPILING_IN_LIMITED_API
    {"__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0},
#endif
#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
    {"__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0},
#endif
#if CYTHON_METH_FASTCALL
#if CYTHON_COMPILING_IN_LIMITED_API
    {"__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0},
#else
    {"__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0},
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
    {"__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0},
#else
    {"__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0},
#endif
#endif
    {0, 0, 0,  0, 0}
};
static PyObject *
__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args)
{
    PyObject *result = NULL;
    CYTHON_UNUSED_VAR(args);
    __Pyx_BEGIN_CRITICAL_SECTION(m);
    Py_INCREF(m->func_qualname);
    result = m->func_qualname;
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static PyMethodDef __pyx_CyFunction_methods[] = {
    {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
    {0, 0, 0, 0}
};
#if CYTHON_COMPILING_IN_LIMITED_API
#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
#else
#define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist)
#endif
static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname,
                                       PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
#if !CYTHON_COMPILING_IN_LIMITED_API
    PyCFunctionObject *cf = (PyCFunctionObject*) op;
#endif
    if (unlikely(op == NULL))
        return NULL;
#if CYTHON_COMPILING_IN_LIMITED_API
    op->func = PyCFunction_NewEx(ml, (PyObject*)op, module);
    if (unlikely(!op->func)) return NULL;
#endif
    op->flags = flags;
    __Pyx_CyFunction_weakreflist(op) = NULL;
#if !CYTHON_COMPILING_IN_LIMITED_API
    cf->m_ml = ml;
    cf->m_self = (PyObject *) op;
#endif
    Py_XINCREF(closure);
    op->func_closure = closure;
#if !CYTHON_COMPILING_IN_LIMITED_API
    Py_XINCREF(module);
    cf->m_module = module;
#endif
#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
    op->func_dict = NULL;
#endif
    op->func_name = NULL;
    Py_INCREF(qualname);
    op->func_qualname = qualname;
    op->func_doc = NULL;
#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
    op->func_classobj = NULL;
#else
    ((PyCMethodObject*)op)->mm_class = NULL;
#endif
    op->func_globals = globals;
    Py_INCREF(op->func_globals);
    Py_XINCREF(code);
    op->func_code = code;
    op->defaults = NULL;
    op->defaults_tuple = NULL;
    op->defaults_kwdict = NULL;
    op->defaults_getter = NULL;
    op->func_annotations = NULL;
    op->func_is_coroutine = NULL;
#if CYTHON_METH_FASTCALL
    switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) {
    case METH_NOARGS:
        __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS;
        break;
    case METH_O:
        __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O;
        break;
    case METH_METHOD | METH_FASTCALL | METH_KEYWORDS:
        __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD;
        break;
    case METH_FASTCALL | METH_KEYWORDS:
        __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS;
        break;
    case METH_VARARGS | METH_KEYWORDS:
        __Pyx_CyFunction_func_vectorcall(op) = NULL;
        break;
    default:
        PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
        Py_DECREF(op);
        return NULL;
    }
#endif
    return (PyObject *) op;
}
static int
__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
{
    Py_CLEAR(m->func_closure);
#if CYTHON_COMPILING_IN_LIMITED_API
    Py_CLEAR(m->func);
#else
    Py_CLEAR(((PyCFunctionObject*)m)->m_module);
#endif
#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
    Py_CLEAR(m->func_dict);
#elif PY_VERSION_HEX < 0x030d0000
    _PyObject_ClearManagedDict((PyObject*)m);
#else
    PyObject_ClearManagedDict((PyObject*)m);
#endif
    Py_CLEAR(m->func_name);
    Py_CLEAR(m->func_qualname);
    Py_CLEAR(m->func_doc);
    Py_CLEAR(m->func_globals);
    Py_CLEAR(m->func_code);
#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
    Py_CLEAR(__Pyx_CyFunction_GetClassObj(m));
#else
    {
        PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class;
        ((PyCMethodObject *) (m))->mm_class = NULL;
        Py_XDECREF(cls);
    }
#endif
    Py_CLEAR(m->defaults_tuple);
    Py_CLEAR(m->defaults_kwdict);
    Py_CLEAR(m->func_annotations);
    Py_CLEAR(m->func_is_coroutine);
    Py_CLEAR(m->defaults);
    return 0;
}
static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
{
    if (__Pyx_CyFunction_weakreflist(m) != NULL)
        PyObject_ClearWeakRefs((PyObject *) m);
    __Pyx_CyFunction_clear(m);
    __Pyx_PyHeapTypeObject_GC_Del(m);
}
static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
{
    PyObject_GC_UnTrack(m);
    __Pyx__CyFunction_dealloc(m);
}
static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
{
    {
        int e = __Pyx_call_type_traverse((PyObject*)m, 1, visit, arg);
        if (e) return e;
    }
    Py_VISIT(m->func_closure);
#if CYTHON_COMPILING_IN_LIMITED_API
    Py_VISIT(m->func);
#else
    Py_VISIT(((PyCFunctionObject*)m)->m_module);
#endif
#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
    Py_VISIT(m->func_dict);
#else
    {
        int e =
#if PY_VERSION_HEX < 0x030d0000
            _PyObject_VisitManagedDict
#else
            PyObject_VisitManagedDict
#endif
                ((PyObject*)m, visit, arg);
        if (e != 0) return e;
    }
#endif
    __Pyx_VISIT_CONST(m->func_name);
    __Pyx_VISIT_CONST(m->func_qualname);
    Py_VISIT(m->func_doc);
    Py_VISIT(m->func_globals);
    __Pyx_VISIT_CONST(m->func_code);
    Py_VISIT(__Pyx_CyFunction_GetClassObj(m));
    Py_VISIT(m->defaults_tuple);
    Py_VISIT(m->defaults_kwdict);
    Py_VISIT(m->func_annotations);
    Py_VISIT(m->func_is_coroutine);
    Py_VISIT(m->defaults);
    return 0;
}
static PyObject*
__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
{
    PyObject *repr;
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    repr = PyUnicode_FromFormat("<cyfunction %U at %p>",
                                op->func_qualname, (void *)op);
    __Pyx_END_CRITICAL_SECTION();
    return repr;
}
static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject *f = ((__pyx_CyFunctionObject*)func)->func;
    PyCFunction meth;
    int flags;
    meth = PyCFunction_GetFunction(f);
    if (unlikely(!meth)) return NULL;
    flags = PyCFunction_GetFlags(f);
    if (unlikely(flags < 0)) return NULL;
#else
    PyCFunctionObject* f = (PyCFunctionObject*)func;
    PyCFunction meth = f->m_ml->ml_meth;
    int flags = f->m_ml->ml_flags;
#endif
    Py_ssize_t size;
    switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
    case METH_VARARGS:
        if (likely(kw == NULL || PyDict_Size(kw) == 0))
            return (*meth)(self, arg);
        break;
    case METH_VARARGS | METH_KEYWORDS:
        return (*(PyCFunctionWithKeywords)(void(*)(void))meth)(self, arg, kw);
    case METH_NOARGS:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
#if CYTHON_ASSUME_SAFE_SIZE
            size = PyTuple_GET_SIZE(arg);
#else
            size = PyTuple_Size(arg);
            if (unlikely(size < 0)) return NULL;
#endif
            if (likely(size == 0))
                return (*meth)(self, NULL);
            __Pyx_CyFunction_raise_argument_count_error(
                (__pyx_CyFunctionObject*)func,
                "takes no arguments", size);
            return NULL;
        }
        break;
    case METH_O:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
#if CYTHON_ASSUME_SAFE_SIZE
            size = PyTuple_GET_SIZE(arg);
#else
            size = PyTuple_Size(arg);
            if (unlikely(size < 0)) return NULL;
#endif
            if (likely(size == 1)) {
                PyObject *result, *arg0;
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                arg0 = PyTuple_GET_ITEM(arg, 0);
                #else
                arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
                #endif
                result = (*meth)(self, arg0);
                #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
                Py_DECREF(arg0);
                #endif
                return result;
            }
            __Pyx_CyFunction_raise_argument_count_error(
                (__pyx_CyFunctionObject*)func,
                "takes exactly one argument", size);
            return NULL;
        }
        break;
    default:
        PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
        return NULL;
    }
    __Pyx_CyFunction_raise_type_error(
        (__pyx_CyFunctionObject*)func, "takes no keyword arguments");
    return NULL;
}
static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyObject *self, *result;
#if CYTHON_COMPILING_IN_LIMITED_API
    self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func);
    if (unlikely(!self) && PyErr_Occurred()) return NULL;
#else
    self = ((PyCFunctionObject*)func)->m_self;
#endif
    result = __Pyx_CyFunction_CallMethod(func, self, arg, kw);
    return result;
}
static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
    PyObject *result;
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
#if CYTHON_METH_FASTCALL && CYTHON_VECTORCALL
     __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc);
    if (vc) {
#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
        return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw);
#else
        (void) &__Pyx_PyVectorcall_FastCallDict;
        return PyVectorcall_Call(func, args, kw);
#endif
    }
#endif
    if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
        Py_ssize_t argc;
        PyObject *new_args;
        PyObject *self;
#if CYTHON_ASSUME_SAFE_SIZE
        argc = PyTuple_GET_SIZE(args);
#else
        argc = PyTuple_Size(args);
        if (unlikely(argc < 0)) return NULL;
#endif
        new_args = PyTuple_GetSlice(args, 1, argc);
        if (unlikely(!new_args))
            return NULL;
        self = PyTuple_GetItem(args, 0);
        if (unlikely(!self)) {
            Py_DECREF(new_args);
            PyErr_Format(PyExc_TypeError,
                         "unbound method %.200S() needs an argument",
                         cyfunc->func_qualname);
            return NULL;
        }
        result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
        Py_DECREF(new_args);
    } else {
        result = __Pyx_CyFunction_Call(func, args, kw);
    }
    return result;
}
#if CYTHON_METH_FASTCALL && CYTHON_VECTORCALL
static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames)
{
    int ret = 0;
    if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
        if (unlikely(nargs < 1)) {
            __Pyx_CyFunction_raise_type_error(
                cyfunc, "needs an argument");
            return -1;
        }
        ret = 1;
    }
    if (unlikely(kwnames) && unlikely(__Pyx_PyTuple_GET_SIZE(kwnames))) {
        __Pyx_CyFunction_raise_type_error(
            cyfunc, "takes no keyword arguments");
        return -1;
    }
    return ret;
}
static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
{
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
    PyObject *self;
#if CYTHON_COMPILING_IN_LIMITED_API
    PyCFunction meth = PyCFunction_GetFunction(cyfunc->func);
    if (unlikely(!meth)) return NULL;
#else
    PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
#endif
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
#if CYTHON_COMPILING_IN_LIMITED_API
        self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func);
        if (unlikely(!self) && PyErr_Occurred()) return NULL;
#else
        self = ((PyCFunctionObject*)cyfunc)->m_self;
#endif
        break;
    default:
        return NULL;
    }
    if (unlikely(nargs != 0)) {
        __Pyx_CyFunction_raise_argument_count_error(
            cyfunc, "takes no arguments", nargs);
        return NULL;
    }
    return meth(self, NULL);
}
static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
{
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
    PyObject *self;
#if CYTHON_COMPILING_IN_LIMITED_API
    PyCFunction meth = PyCFunction_GetFunction(cyfunc->func);
    if (unlikely(!meth)) return NULL;
#else
    PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
#endif
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
#if CYTHON_COMPILING_IN_LIMITED_API
        self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func);
        if (unlikely(!self) && PyErr_Occurred()) return NULL;
#else
        self = ((PyCFunctionObject*)cyfunc)->m_self;
#endif
        break;
    default:
        return NULL;
    }
    if (unlikely(nargs != 1)) {
        __Pyx_CyFunction_raise_argument_count_error(
            cyfunc, "takes exactly one argument", nargs);
        return NULL;
    }
    return meth(self, args[0]);
}
static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
{
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
    PyObject *self;
#if CYTHON_COMPILING_IN_LIMITED_API
    PyCFunction meth = PyCFunction_GetFunction(cyfunc->func);
    if (unlikely(!meth)) return NULL;
#else
    PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
#endif
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
#if CYTHON_COMPILING_IN_LIMITED_API
        self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func);
        if (unlikely(!self) && PyErr_Occurred()) return NULL;
#else
        self = ((PyCFunctionObject*)cyfunc)->m_self;
#endif
        break;
    default:
        return NULL;
    }
    return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))meth)(self, args, nargs, kwnames);
}
static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
{
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
    PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc);
    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
    PyObject *self;
#if CYTHON_COMPILING_IN_LIMITED_API
    PyCFunction meth = PyCFunction_GetFunction(cyfunc->func);
    if (unlikely(!meth)) return NULL;
#else
    PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
#endif
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
#if CYTHON_COMPILING_IN_LIMITED_API
        self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func);
        if (unlikely(!self) && PyErr_Occurred()) return NULL;
#else
        self = ((PyCFunctionObject*)cyfunc)->m_self;
#endif
        break;
    default:
        return NULL;
    }
    #if PY_VERSION_HEX < 0x030e00A6
    size_t nargs_value = (size_t) nargs;
    #else
    Py_ssize_t nargs_value = nargs;
    #endif
    return ((__Pyx_PyCMethod)(void(*)(void))meth)(self, cls, args, nargs_value, kwnames);
}
#endif
static PyType_Slot __pyx_CyFunctionType_slots[] = {
    {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc},
    {Py_tp_repr, (void *)__Pyx_CyFunction_repr},
    {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod},
    {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse},
    {Py_tp_clear, (void *)__Pyx_CyFunction_clear},
    {Py_tp_methods, (void *)__pyx_CyFunction_methods},
    {Py_tp_members, (void *)__pyx_CyFunction_members},
    {Py_tp_getset, (void *)__pyx_CyFunction_getsets},
    {Py_tp_descr_get, (void *)__Pyx_PyMethod_New},
    {0, 0},
};
static PyType_Spec __pyx_CyFunctionType_spec = {
    __PYX_TYPE_MODULE_PREFIX "cython_function_or_method",
    sizeof(__pyx_CyFunctionObject),
    0,
#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR
    Py_TPFLAGS_METHOD_DESCRIPTOR |
#endif
#if CYTHON_METH_FASTCALL
#if defined(Py_TPFLAGS_HAVE_VECTORCALL)
    Py_TPFLAGS_HAVE_VECTORCALL |
#elif defined(_Py_TPFLAGS_HAVE_VECTORCALL)
    _Py_TPFLAGS_HAVE_VECTORCALL |
#endif
#endif // CYTHON_METH_FASTCALL
#if PY_VERSION_HEX >= 0x030C0000 && !CYTHON_COMPILING_IN_LIMITED_API
    Py_TPFLAGS_MANAGED_DICT |
#endif
    Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION |
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
    __pyx_CyFunctionType_slots
};
static int __pyx_CyFunction_init(PyObject *module) {
    __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module);
    mstate->__pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(
        mstate->__pyx_CommonTypesMetaclassType, module, &__pyx_CyFunctionType_spec, NULL);
    if (unlikely(mstate->__pyx_CyFunctionType == NULL)) {
        return -1;
    }
    return 0;
}
static CYTHON_INLINE PyObject *__Pyx_CyFunction_InitDefaults(PyObject *func, PyTypeObject *defaults_type) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults = PyObject_CallObject((PyObject*)defaults_type, NULL); // _PyObject_New(defaults_type);
    if (unlikely(!m->defaults))
        return NULL;
    return m->defaults;
}
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults_tuple = tuple;
    Py_INCREF(tuple);
}
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults_kwdict = dict;
    Py_INCREF(dict);
}
static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->func_annotations = dict;
    Py_INCREF(dict);
}

/* CythonFunction */
static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname,
                                      PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
    PyObject *op = __Pyx_CyFunction_Init(
        PyObject_GC_New(__pyx_CyFunctionObject, __pyx_mstate_global->__pyx_CyFunctionType),
        ml, flags, qualname, closure, module, globals, code
    );
    if (likely(op)) {
        PyObject_GC_Track(op);
    }
    return op;
}

/* PyObjectSetAttrStr */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_setattro))
        return tp->tp_setattro(obj, attr_name, value);
    return PyObject_SetAttr(obj, attr_name, value);
}
#endif

/* PyObjectGetMethod (used by PyObjectCallMethod1) */
#if !(CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000)))
static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) {
    PyObject *attr;
#if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP
    __Pyx_TypeName type_name;
    PyTypeObject *tp = Py_TYPE(obj);
    PyObject *descr;
    descrgetfunc f = NULL;
    PyObject **dictptr, *dict;
    int meth_found = 0;
    assert (*method == NULL);
    if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) {
        attr = __Pyx_PyObject_GetAttrStr(obj, name);
        goto try_unpack;
    }
    if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) {
        return 0;
    }
    descr = _PyType_Lookup(tp, name);
    if (likely(descr != NULL)) {
        Py_INCREF(descr);
#if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR
        if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR))
#else
        #ifdef __Pyx_CyFunction_USED
        if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr)))
        #else
        if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type)))
        #endif
#endif
        {
            meth_found = 1;
        } else {
            f = Py_TYPE(descr)->tp_descr_get;
            if (f != NULL && PyDescr_IsData(descr)) {
                attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
                Py_DECREF(descr);
                goto try_unpack;
            }
        }
    }
    dictptr = _PyObject_GetDictPtr(obj);
    if (dictptr != NULL && (dict = *dictptr) != NULL) {
        Py_INCREF(dict);
        attr = __Pyx_PyDict_GetItemStr(dict, name);
        if (attr != NULL) {
            Py_INCREF(attr);
            Py_DECREF(dict);
            Py_XDECREF(descr);
            goto try_unpack;
        }
        Py_DECREF(dict);
    }
    if (meth_found) {
        *method = descr;
        return 1;
    }
    if (f != NULL) {
        attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
        Py_DECREF(descr);
        goto try_unpack;
    }
    if (likely(descr != NULL)) {
        *method = descr;
        return 0;
    }
    type_name = __Pyx_PyType_GetFullyQualifiedName(tp);
    PyErr_Format(PyExc_AttributeError,
                 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'",
                 type_name, name);
    __Pyx_DECREF_TypeName(type_name);
    return 0;
#else
    attr = __Pyx_PyObject_GetAttrStr(obj, name);
    goto try_unpack;
#endif
try_unpack:
#if CYTHON_UNPACK_METHODS
    if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) {
        PyObject *function = PyMethod_GET_FUNCTION(attr);
        Py_INCREF(function);
        Py_DECREF(attr);
        *method = function;
        return 1;
    }
#endif
    *method = attr;
    return 0;
}
#endif

/* PyObjectCallMethod1 (used by append) */
#if !(CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000)))
static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) {
    PyObject *result = __Pyx_PyObject_CallOneArg(method, arg);
    Py_DECREF(method);
    return result;
}
#endif
static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
#if CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000))
    PyObject *args[2] = {obj, arg};
    (void) __Pyx_PyObject_CallOneArg;
    (void) __Pyx_PyObject_Call2Args;
    return PyObject_VectorcallMethod(method_name, args, 2 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
#else
    PyObject *method = NULL, *result;
    int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
    if (likely(is_method)) {
        result = __Pyx_PyObject_Call2Args(method, obj, arg);
        Py_DECREF(method);
        return result;
    }
    if (unlikely(!method)) return NULL;
    return __Pyx__PyObject_CallMethod1(method, arg);
#endif
}

/* append */
static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
    if (likely(PyList_CheckExact(L))) {
        if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1;
    } else {
        PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_mstate_global->__pyx_n_u_append, x);
        if (unlikely(!retval))
            return -1;
        Py_DECREF(retval);
    }
    return 0;
}

/* PyLongBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_Fallback___Pyx_PyLong_TrueDivideObjC(PyObject *op1, PyObject *op2, int inplace) {
    return (inplace ? PyNumber_InPlaceTrueDivide : PyNumber_TrueDivide)(op1, op2);
}
#if CYTHON_USE_PYLONG_INTERNALS
static PyObject* __Pyx_Unpacked___Pyx_PyLong_TrueDivideObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(inplace);
    CYTHON_UNUSED_VAR(zerodivision_check);
    const long b = intval;
    long a;
    if (unlikely(__Pyx_PyLong_IsZero(op1))) {
    }
    const int is_positive = __Pyx_PyLong_IsPos(op1);
    const digit* digits = __Pyx_PyLong_Digits(op1);
    const Py_ssize_t size = __Pyx_PyLong_DigitCount(op1);
    if (likely(size == 1)) {
        a = (long) digits[0];
        if (!is_positive) a *= -1;
    } else {
        switch (size) {
            case 2:
                if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT && 1 * PyLong_SHIFT < 53) {
                    a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    if (!is_positive) a *= -1;
                    goto calculate_long;
                }
                break;
            case 3:
                if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT && 2 * PyLong_SHIFT < 53) {
                    a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    if (!is_positive) a *= -1;
                    goto calculate_long;
                }
                break;
            case 4:
                if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT && 3 * PyLong_SHIFT < 53) {
                    a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    if (!is_positive) a *= -1;
                    goto calculate_long;
                }
                break;
        }
        return PyLong_Type.tp_as_number->nb_true_divide(op1, op2);
    }
    calculate_long:
        if ((8 * sizeof(long) <= 53 || likely(labs(a) <= ((PY_LONG_LONG)1 << 53)))
                || __Pyx_PyLong_DigitCount(op1) <= 52 / PyLong_SHIFT) {
            return PyFloat_FromDouble((double)a / (double)b);
        }
        return PyLong_Type.tp_as_number->nb_true_divide(op1, op2);
}
#endif
static PyObject* __Pyx_Float___Pyx_PyLong_TrueDivideObjC(PyObject *float_val, long intval, int zerodivision_check) {
    CYTHON_UNUSED_VAR(zerodivision_check);
    const long b = intval;
    double a = __Pyx_PyFloat_AS_DOUBLE(float_val);
        double result;
        
        result = ((double)a) / (double)b;
        return PyFloat_FromDouble(result);
}
static CYTHON_INLINE PyObject* __Pyx_PyLong_TrueDivideObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_UNUSED_VAR(zerodivision_check);
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        return __Pyx_Unpacked___Pyx_PyLong_TrueDivideObjC(op1, op2, intval, inplace, zerodivision_check);
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        return __Pyx_Float___Pyx_PyLong_TrueDivideObjC(op1, intval, zerodivision_check);
    }
    return __Pyx_Fallback___Pyx_PyLong_TrueDivideObjC(op1, op2, inplace);
}
#endif

/* PyLongBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_Fallback___Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2, int inplace) {
    return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
}
#if CYTHON_USE_PYLONG_INTERNALS
static PyObject* __Pyx_Unpacked___Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(inplace);
    CYTHON_UNUSED_VAR(zerodivision_check);
    const long b = intval;
    long a;
    const PY_LONG_LONG llb = intval;
    PY_LONG_LONG lla;
    if (unlikely(__Pyx_PyLong_IsZero(op1))) {
        return __Pyx_NewRef(op2);
    }
    const int is_positive = __Pyx_PyLong_IsPos(op1);
    const digit* digits = __Pyx_PyLong_Digits(op1);
    const Py_ssize_t size = __Pyx_PyLong_DigitCount(op1);
    if (likely(size == 1)) {
        a = (long) digits[0];
        if (!is_positive) a *= -1;
    } else {
        switch (size) {
            case 2:
                if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                    a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    if (!is_positive) a *= -1;
                    goto calculate_long;
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                    lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    if (!is_positive) lla *= -1;
                    goto calculate_long_long;
                }
                break;
            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]));
                    if (!is_positive) a *= -1;
                    goto calculate_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]));
                    if (!is_positive) lla *= -1;
                    goto calculate_long_long;
                }
                break;
            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]));
                    if (!is_positive) a *= -1;
                    goto calculate_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]));
                    if (!is_positive) lla *= -1;
                    goto calculate_long_long;
                }
                break;
        }
        return PyLong_Type.tp_as_number->nb_add(op1, op2);
    }
    calculate_long:
        {
            long x;
            x = a + b;
            return PyLong_FromLong(x);
        }
    calculate_long_long:
        {
            PY_LONG_LONG llx;
            llx = lla + llb;
            return PyLong_FromLongLong(llx);
        }
    
}
#endif
static PyObject* __Pyx_Float___Pyx_PyLong_AddObjC(PyObject *float_val, long intval, int zerodivision_check) {
    CYTHON_UNUSED_VAR(zerodivision_check);
    const long b = intval;
    double a = __Pyx_PyFloat_AS_DOUBLE(float_val);
        double result;
        
        result = ((double)a) + (double)b;
        return PyFloat_FromDouble(result);
}
static CYTHON_INLINE PyObject* __Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_UNUSED_VAR(zerodivision_check);
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        return __Pyx_Unpacked___Pyx_PyLong_AddObjC(op1, op2, intval, inplace, zerodivision_check);
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        return __Pyx_Float___Pyx_PyLong_AddObjC(op1, intval, zerodivision_check);
    }
    return __Pyx_Fallback___Pyx_PyLong_AddObjC(op1, op2, inplace);
}
#endif

/* PyLongBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_Fallback___Pyx_PyLong_AddCObj(PyObject *op1, PyObject *op2, int inplace) {
    return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
}
#if CYTHON_USE_PYLONG_INTERNALS
static PyObject* __Pyx_Unpacked___Pyx_PyLong_AddCObj(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(inplace);
    CYTHON_UNUSED_VAR(zerodivision_check);
    const long a = intval;
    long b;
    const PY_LONG_LONG lla = intval;
    PY_LONG_LONG llb;
    if (unlikely(__Pyx_PyLong_IsZero(op2))) {
        return __Pyx_NewRef(op1);
    }
    const int is_positive = __Pyx_PyLong_IsPos(op2);
    const digit* digits = __Pyx_PyLong_Digits(op2);
    const Py_ssize_t size = __Pyx_PyLong_DigitCount(op2);
    if (likely(size == 1)) {
        b = (long) digits[0];
        if (!is_positive) b *= -1;
    } 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]));
                    if (!is_positive) b *= -1;
                    goto calculate_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]));
                    if (!is_positive) llb *= -1;
                    goto calculate_long_long;
                }
                break;
            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]));
                    if (!is_positive) b *= -1;
                    goto calculate_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]));
                    if (!is_positive) llb *= -1;
                    goto calculate_long_long;
                }
                break;
            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]));
                    if (!is_positive) b *= -1;
                    goto calculate_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]));
                    if (!is_positive) llb *= -1;
                    goto calculate_long_long;
                }
                break;
        }
        return PyLong_Type.tp_as_number->nb_add(op1, op2);
    }
    calculate_long:
        {
            long x;
            x = a + b;
            return PyLong_FromLong(x);
        }
    calculate_long_long:
        {
            PY_LONG_LONG llx;
            llx = lla + llb;
            return PyLong_FromLongLong(llx);
        }
    
}
#endif
static PyObject* __Pyx_Float___Pyx_PyLong_AddCObj(PyObject *float_val, long intval, int zerodivision_check) {
    CYTHON_UNUSED_VAR(zerodivision_check);
    const long a = intval;
    double b = __Pyx_PyFloat_AS_DOUBLE(float_val);
        double result;
        
        result = ((double)a) + (double)b;
        return PyFloat_FromDouble(result);
}
static CYTHON_INLINE PyObject* __Pyx_PyLong_AddCObj(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_UNUSED_VAR(zerodivision_check);
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op2))) {
        return __Pyx_Unpacked___Pyx_PyLong_AddCObj(op1, op2, intval, inplace, zerodivision_check);
    }
    #endif
    if (PyFloat_CheckExact(op2)) {
        return __Pyx_Float___Pyx_PyLong_AddCObj(op2, intval, zerodivision_check);
    }
    return __Pyx_Fallback___Pyx_PyLong_AddCObj(op1, op2, inplace);
}
#endif

/* PyLongBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_Fallback___Pyx_PyLong_SubtractCObj(PyObject *op1, PyObject *op2, int inplace) {
    return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2);
}
#if CYTHON_USE_PYLONG_INTERNALS
static PyObject* __Pyx_Unpacked___Pyx_PyLong_SubtractCObj(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(inplace);
    CYTHON_UNUSED_VAR(zerodivision_check);
    const long a = intval;
    long b;
    const PY_LONG_LONG lla = intval;
    PY_LONG_LONG llb;
    if (unlikely(__Pyx_PyLong_IsZero(op2))) {
        return __Pyx_NewRef(op1);
    }
    const int is_positive = __Pyx_PyLong_IsPos(op2);
    const digit* digits = __Pyx_PyLong_Digits(op2);
    const Py_ssize_t size = __Pyx_PyLong_DigitCount(op2);
    if (likely(size == 1)) {
        b = (long) digits[0];
        if (!is_positive) b *= -1;
    } 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]));
                    if (!is_positive) b *= -1;
                    goto calculate_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]));
                    if (!is_positive) llb *= -1;
                    goto calculate_long_long;
                }
                break;
            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]));
                    if (!is_positive) b *= -1;
                    goto calculate_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]));
                    if (!is_positive) llb *= -1;
                    goto calculate_long_long;
                }
                break;
            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]));
                    if (!is_positive) b *= -1;
                    goto calculate_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]));
                    if (!is_positive) llb *= -1;
                    goto calculate_long_long;
                }
                break;
        }
        return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
    }
    calculate_long:
        {
            long x;
            x = a - b;
            return PyLong_FromLong(x);
        }
    calculate_long_long:
        {
            PY_LONG_LONG llx;
            llx = lla - llb;
            return PyLong_FromLongLong(llx);
        }
    
}
#endif
static PyObject* __Pyx_Float___Pyx_PyLong_SubtractCObj(PyObject *float_val, long intval, int zerodivision_check) {
    CYTHON_UNUSED_VAR(zerodivision_check);
    const long a = intval;
    double b = __Pyx_PyFloat_AS_DOUBLE(float_val);
        double result;
        
        result = ((double)a) - (double)b;
        return PyFloat_FromDouble(result);
}
static CYTHON_INLINE PyObject* __Pyx_PyLong_SubtractCObj(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_UNUSED_VAR(zerodivision_check);
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op2))) {
        return __Pyx_Unpacked___Pyx_PyLong_SubtractCObj(op1, op2, intval, inplace, zerodivision_check);
    }
    #endif
    if (PyFloat_CheckExact(op2)) {
        return __Pyx_Float___Pyx_PyLong_SubtractCObj(op2, intval, zerodivision_check);
    }
    return __Pyx_Fallback___Pyx_PyLong_SubtractCObj(op1, op2, inplace);
}
#endif

/* PyLongBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_Fallback___Pyx_PyLong_SubtractObjC(PyObject *op1, PyObject *op2, int inplace) {
    return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2);
}
#if CYTHON_USE_PYLONG_INTERNALS
static PyObject* __Pyx_Unpacked___Pyx_PyLong_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(inplace);
    CYTHON_UNUSED_VAR(zerodivision_check);
    const long b = intval;
    long a;
    const PY_LONG_LONG llb = intval;
    PY_LONG_LONG lla;
    if (unlikely(__Pyx_PyLong_IsZero(op1))) {
        return PyLong_FromLong(-intval);
    }
    const int is_positive = __Pyx_PyLong_IsPos(op1);
    const digit* digits = __Pyx_PyLong_Digits(op1);
    const Py_ssize_t size = __Pyx_PyLong_DigitCount(op1);
    if (likely(size == 1)) {
        a = (long) digits[0];
        if (!is_positive) a *= -1;
    } else {
        switch (size) {
            case 2:
                if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                    a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    if (!is_positive) a *= -1;
                    goto calculate_long;
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                    lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    if (!is_positive) lla *= -1;
                    goto calculate_long_long;
                }
                break;
            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]));
                    if (!is_positive) a *= -1;
                    goto calculate_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]));
                    if (!is_positive) lla *= -1;
                    goto calculate_long_long;
                }
                break;
            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]));
                    if (!is_positive) a *= -1;
                    goto calculate_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]));
                    if (!is_positive) lla *= -1;
                    goto calculate_long_long;
                }
                break;
        }
        return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
    }
    calculate_long:
        {
            long x;
            x = a - b;
            return PyLong_FromLong(x);
        }
    calculate_long_long:
        {
            PY_LONG_LONG llx;
            llx = lla - llb;
            return PyLong_FromLongLong(llx);
        }
    
}
#endif
static PyObject* __Pyx_Float___Pyx_PyLong_SubtractObjC(PyObject *float_val, long intval, int zerodivision_check) {
    CYTHON_UNUSED_VAR(zerodivision_check);
    const long b = intval;
    double a = __Pyx_PyFloat_AS_DOUBLE(float_val);
        double result;
        
        result = ((double)a) - (double)b;
        return PyFloat_FromDouble(result);
}
static CYTHON_INLINE PyObject* __Pyx_PyLong_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_UNUSED_VAR(zerodivision_check);
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        return __Pyx_Unpacked___Pyx_PyLong_SubtractObjC(op1, op2, intval, inplace, zerodivision_check);
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        return __Pyx_Float___Pyx_PyLong_SubtractObjC(op1, intval, zerodivision_check);
    }
    return __Pyx_Fallback___Pyx_PyLong_SubtractObjC(op1, op2, inplace);
}
#endif

/* PyObjectVectorCallKwBuilder (used by PyObjectVectorCallMethodKwBuilder) */
#if CYTHON_VECTORCALL
static int __Pyx_VectorcallBuilder_AddArg(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n) {
    (void)__Pyx_PyObject_FastCallDict;
    Py_INCREF(key);
    if (__Pyx_PyTuple_SET_ITEM(builder, n, key) != (0)) return -1;
    args[n] = value;
    return 0;
}
CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n) {
    (void)__Pyx_VectorcallBuilder_AddArgStr;
    if (unlikely(!PyUnicode_Check(key))) {
        PyErr_SetString(PyExc_TypeError, "keywords must be strings");
        return -1;
    }
    return __Pyx_VectorcallBuilder_AddArg(key, value, builder, args, n);
}
static int __Pyx_VectorcallBuilder_AddArgStr(const char *key, PyObject *value, PyObject *builder, PyObject **args, int n) {
    PyObject *pyKey = PyUnicode_FromString(key);
    if (!pyKey) return -1;
    return __Pyx_VectorcallBuilder_AddArg(pyKey, value, builder, args, n);
}
#else // CYTHON_VECTORCALL
CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, CYTHON_UNUSED PyObject **args, CYTHON_UNUSED int n) {
    if (unlikely(!PyUnicode_Check(key))) {
        PyErr_SetString(PyExc_TypeError, "keywords must be strings");
        return -1;
    }
    return PyDict_SetItem(builder, key, value);
}
#endif

/* PyObjectVectorCallMethodKwBuilder */
#if !CYTHON_VECTORCALL || PY_VERSION_HEX < 0x03090000
static PyObject *__Pyx_Object_VectorcallMethod_CallFromBuilder(PyObject *name, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
    PyObject *result;
    PyObject *obj = PyObject_GetAttr(args[0], name);
    if (unlikely(!obj))
        return NULL;
    result = __Pyx_Object_Vectorcall_CallFromBuilder(obj, args+1, nargsf-1, kwnames);
    Py_DECREF(obj);
    return result;
}
#endif

/* PyLongBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_Fallback___Pyx_PyLong_RemainderObjC(PyObject *op1, PyObject *op2, int inplace) {
    return (inplace ? PyNumber_InPlaceRemainder : PyNumber_Remainder)(op1, op2);
}
#if CYTHON_USE_PYLONG_INTERNALS
static PyObject* __Pyx_Unpacked___Pyx_PyLong_RemainderObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(inplace);
    CYTHON_UNUSED_VAR(zerodivision_check);
    const long b = intval;
    long a;
    const PY_LONG_LONG llb = intval;
    PY_LONG_LONG lla;
    if (unlikely(__Pyx_PyLong_IsZero(op1))) {
        return __Pyx_NewRef(op1);
    }
    const int is_positive = __Pyx_PyLong_IsPos(op1);
    const digit* digits = __Pyx_PyLong_Digits(op1);
    const Py_ssize_t size = __Pyx_PyLong_DigitCount(op1);
    if (likely(size == 1)) {
        a = (long) digits[0];
        if (!is_positive) a *= -1;
    } else {
        switch (size) {
            case 2:
                if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                    a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    if (!is_positive) a *= -1;
                    goto calculate_long;
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                    lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    if (!is_positive) lla *= -1;
                    goto calculate_long_long;
                }
                break;
            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]));
                    if (!is_positive) a *= -1;
                    goto calculate_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]));
                    if (!is_positive) lla *= -1;
                    goto calculate_long_long;
                }
                break;
            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]));
                    if (!is_positive) a *= -1;
                    goto calculate_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]));
                    if (!is_positive) lla *= -1;
                    goto calculate_long_long;
                }
                break;
        }
        return PyLong_Type.tp_as_number->nb_remainder(op1, op2);
    }
    calculate_long:
        {
            long x = a % b;
            x += ((x != 0) & ((x ^ b) < 0)) * b;
            return PyLong_FromLong(x);
        }
    calculate_long_long:
        {
            PY_LONG_LONG llx = lla % llb;
            llx += ((llx != 0) & ((llx ^ llb) < 0)) * llb;
            return PyLong_FromLongLong(llx);
        }
    
}
#endif
static CYTHON_INLINE PyObject* __Pyx_PyLong_RemainderObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_UNUSED_VAR(zerodivision_check);
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        return __Pyx_Unpacked___Pyx_PyLong_RemainderObjC(op1, op2, intval, inplace, zerodivision_check);
    }
    #endif
    return __Pyx_Fallback___Pyx_PyLong_RemainderObjC(op1, op2, inplace);
}
#endif

/* PyLongBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_Fallback___Pyx_PyLong_FloorDivideObjC(PyObject *op1, PyObject *op2, int inplace) {
    return (inplace ? PyNumber_InPlaceFloorDivide : PyNumber_FloorDivide)(op1, op2);
}
#if CYTHON_USE_PYLONG_INTERNALS
static PyObject* __Pyx_Unpacked___Pyx_PyLong_FloorDivideObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(inplace);
    CYTHON_UNUSED_VAR(zerodivision_check);
    const long b = intval;
    long a;
    const PY_LONG_LONG llb = intval;
    PY_LONG_LONG lla;
    if (unlikely(__Pyx_PyLong_IsZero(op1))) {
        return __Pyx_NewRef(op1);
    }
    const int is_positive = __Pyx_PyLong_IsPos(op1);
    const digit* digits = __Pyx_PyLong_Digits(op1);
    const Py_ssize_t size = __Pyx_PyLong_DigitCount(op1);
    if (likely(size == 1)) {
        a = (long) digits[0];
        if (!is_positive) a *= -1;
    } else {
        switch (size) {
            case 2:
                if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                    a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    if (!is_positive) a *= -1;
                    goto calculate_long;
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                    lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    if (!is_positive) lla *= -1;
                    goto calculate_long_long;
                }
                break;
            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]));
                    if (!is_positive) a *= -1;
                    goto calculate_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]));
                    if (!is_positive) lla *= -1;
                    goto calculate_long_long;
                }
                break;
            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]));
                    if (!is_positive) a *= -1;
                    goto calculate_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]));
                    if (!is_positive) lla *= -1;
                    goto calculate_long_long;
                }
                break;
        }
        return PyLong_Type.tp_as_number->nb_floor_divide(op1, op2);
    }
    calculate_long:
        {
            long q, r;
            q = a / b;
            r = a - q*b;
            q -= ((r != 0) & ((r ^ b) < 0));
            return PyLong_FromLong(q);
        }
    calculate_long_long:
        {
            PY_LONG_LONG q, r;
            q = lla / llb;
            r = lla - q*llb;
            q -= ((r != 0) & ((r ^ llb) < 0));
            return PyLong_FromLongLong(q);
        }
    
}
#endif
static CYTHON_INLINE PyObject* __Pyx_PyLong_FloorDivideObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_UNUSED_VAR(zerodivision_check);
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        return __Pyx_Unpacked___Pyx_PyLong_FloorDivideObjC(op1, op2, intval, inplace, zerodivision_check);
    }
    #endif
    return __Pyx_Fallback___Pyx_PyLong_FloorDivideObjC(op1, op2, inplace);
}
#endif

/* ModFloat[double] */
static CYTHON_INLINE double __Pyx_mod_double(double a, double b, int b_is_constant) {
    CYTHON_UNUSED_VAR(b_is_constant);
    double r = fmod(a, b);
    r += ((r != 0) & ((r < 0) ^ (b < 0))) * b;
    return r;
}

/* pybuiltin_invalid (used by pyint_simplify) */
static void __Pyx_PyBuiltin_Invalid(PyObject *obj, const char *type_name, const char *argname) {
    __Pyx_TypeName obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj));
    if (argname) {
        PyErr_Format(PyExc_TypeError,
            "Argument '%.200s' has incorrect type (expected %.200s, got " __Pyx_FMT_TYPENAME ")",
            argname, type_name, obj_type_name
        );
    } else {
        PyErr_Format(PyExc_TypeError,
            "Expected %.200s, got " __Pyx_FMT_TYPENAME,
            type_name, obj_type_name
        );
    }
    __Pyx_DECREF_TypeName(obj_type_name);
}

/* pyint_simplify */
static CYTHON_INLINE int __Pyx_PyInt_FromNumber(PyObject **number_var, const char *argname, int accept_none) {
    PyObject *number = *number_var;
    if (likely((accept_none && number == Py_None) || PyLong_CheckExact(number))) {
        return 0;
    }
    PyObject *int_object;
    if (likely(PyNumber_Check(number))) {
        int_object = PyNumber_Long(number);
        if (unlikely(!int_object)) goto bad;
    } else {
        __Pyx_PyBuiltin_Invalid(number, "int", argname);
        goto bad;
    }
    *number_var = int_object;
    Py_DECREF(number);
    return 0;
bad:
    *number_var = NULL;
    Py_DECREF(number);
    return -1;
}

/* unicode_iter */
static CYTHON_INLINE int __Pyx_init_unicode_iteration(
    PyObject* ustring, Py_ssize_t *length, void** data, int *kind) {
#if CYTHON_COMPILING_IN_LIMITED_API
    *kind   = 0;
    *length = PyUnicode_GetLength(ustring);
    *data   = (void*)ustring;
#else
    if (unlikely(__Pyx_PyUnicode_READY(ustring) < 0)) return -1;
    *kind   = PyUnicode_KIND(ustring);
    *length = PyUnicode_GET_LENGTH(ustring);
    *data   = PyUnicode_DATA(ustring);
#endif
    return 0;
}

/* set_iter */
static CYTHON_INLINE PyObject* __Pyx_set_iterator(PyObject* iterable, int is_set,
                                                  Py_ssize_t* p_orig_length, int* p_source_is_set) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000
    is_set = is_set || likely(PySet_CheckExact(iterable) || PyFrozenSet_CheckExact(iterable));
    *p_source_is_set = is_set;
    if (likely(is_set)) {
        *p_orig_length = PySet_Size(iterable);
        Py_INCREF(iterable);
        return iterable;
    }
#else
    CYTHON_UNUSED_VAR(is_set);
    *p_source_is_set = 0;
#endif
    *p_orig_length = 0;
    return PyObject_GetIter(iterable);
}
static CYTHON_INLINE int __Pyx_set_iter_next(
        PyObject* iter_obj, Py_ssize_t orig_length,
        Py_ssize_t* ppos, PyObject **value,
        int source_is_set) {
    if (!CYTHON_COMPILING_IN_CPYTHON || PY_VERSION_HEX >= 0x030d0000 || unlikely(!source_is_set)) {
        *value = PyIter_Next(iter_obj);
        if (unlikely(!*value)) {
            return __Pyx_IterFinish();
        }
        CYTHON_UNUSED_VAR(orig_length);
        CYTHON_UNUSED_VAR(ppos);
        return 1;
    }
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000
    if (unlikely(PySet_GET_SIZE(iter_obj) != orig_length)) {
        PyErr_SetString(
            PyExc_RuntimeError,
            "set changed size during iteration");
        return -1;
    }
    {
        Py_hash_t hash;
        int ret = _PySet_NextEntry(iter_obj, ppos, value, &hash);
        assert (ret != -1);
        if (likely(ret)) {
            Py_INCREF(*value);
            return 1;
        }
    }
#endif
    return 0;
}

/* pep479 */
static void __Pyx_Generator_Replace_StopIteration(int in_async_gen) {
    PyObject *exc, *val, *tb, *cur_exc, *new_exc;
    __Pyx_PyThreadState_declare
    int is_async_stopiteration = 0;
    CYTHON_MAYBE_UNUSED_VAR(in_async_gen);
    __Pyx_PyThreadState_assign
    cur_exc = __Pyx_PyErr_CurrentExceptionType();
    if (likely(!__Pyx_PyErr_GivenExceptionMatches(cur_exc, PyExc_StopIteration))) {
        if (in_async_gen && unlikely(__Pyx_PyErr_GivenExceptionMatches(cur_exc, PyExc_StopAsyncIteration))) {
            is_async_stopiteration = 1;
        } else {
            return;
        }
    }
    __Pyx_GetException(&exc, &val, &tb);
    Py_XDECREF(exc);
    Py_XDECREF(tb);
    new_exc = PyObject_CallFunction(PyExc_RuntimeError, "s",
        is_async_stopiteration ? "async generator raised StopAsyncIteration" :
        in_async_gen ? "async generator raised StopIteration" :
        "generator raised StopIteration");
    if (!new_exc) {
        Py_XDECREF(val);
        return;
    }
    PyException_SetCause(new_exc, val); // steals ref to val
    PyErr_SetObject(PyExc_RuntimeError, new_exc);
    Py_DECREF(new_exc);
}

/* PyLongCompare */
static CYTHON_INLINE int __Pyx_PyLong_BoolEqObjC(PyObject *op1, PyObject *op2, long intval, long inplace) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_UNUSED_VAR(inplace);
    if (op1 == op2) {
        return 1;
    }
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        int unequal;
        unsigned long uintval;
        Py_ssize_t size = __Pyx_PyLong_DigitCount(op1);
        const digit* digits = __Pyx_PyLong_Digits(op1);
        if (intval == 0) {
            return (__Pyx_PyLong_IsZero(op1) == 1);
        } else if (intval < 0) {
            if (__Pyx_PyLong_IsNonNeg(op1))
                return 0;
            intval = -intval;
        } else {
            if (__Pyx_PyLong_IsNeg(op1))
                return 0;
        }
        uintval = (unsigned long) intval;
#if PyLong_SHIFT * 4 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 4)) {
            unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 3 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 3)) {
            unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 2 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 2)) {
            unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 1 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 1)) {
            unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
            unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK));
        return (unequal == 0);
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
        double a = __Pyx_PyFloat_AS_DOUBLE(op1);
        return ((double)a == (double)b);
    }
    return __Pyx_PyObject_IsTrueAndDecref(
        PyObject_RichCompare(op1, op2, Py_EQ));
}

/* py_abs */
#if CYTHON_USE_PYLONG_INTERNALS
static PyObject *__Pyx_PyLong_AbsNeg(PyObject *n) {
#if PY_VERSION_HEX >= 0x030C00A7
    if (likely(__Pyx_PyLong_IsCompact(n))) {
        return PyLong_FromSize_t(__Pyx_PyLong_CompactValueUnsigned(n));
    }
#else
    if (likely(Py_SIZE(n) == -1)) {
        return PyLong_FromUnsignedLong(__Pyx_PyLong_Digits(n)[0]);
    }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
    {
        PyObject *copy = _PyLong_Copy((PyLongObject*)n);
        if (likely(copy)) {
            #if PY_VERSION_HEX >= 0x030C00A7
            ((PyLongObject*)copy)->long_value.lv_tag ^= ((PyLongObject*)copy)->long_value.lv_tag & _PyLong_SIGN_MASK;
            #else
            __Pyx_SET_SIZE(copy, -Py_SIZE(copy));
            #endif
        }
        return copy;
    }
#else
    return PyNumber_Negative(n);
#endif
}
#endif

/* PyFloatBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyFloat_AddObjC(PyObject *op1, PyObject *op2, double floatval, int inplace, int zerodivision_check) {
    const double b = floatval;
    double a, result;
    CYTHON_UNUSED_VAR(inplace);
    CYTHON_UNUSED_VAR(zerodivision_check);
    if (likely(PyFloat_CheckExact(op1))) {
        a = __Pyx_PyFloat_AS_DOUBLE(op1);
        
    } else
    if (likely(PyLong_CheckExact(op1))) {
        #if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsZero(op1)) {
            a = 0.0;
            
        } else if (__Pyx_PyLong_IsCompact(op1)) {
            a = (double) __Pyx_PyLong_CompactValue(op1);
        } else {
            const digit* digits = __Pyx_PyLong_Digits(op1);
            const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1);
            switch (size) {
                case -2:
                case 2:
                    if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (1 * PyLong_SHIFT < 53))) {
                        a = (double) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        if ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
                            if (size == -2)
                                a = -a;
                            break;
                        }
                    }
                    CYTHON_FALLTHROUGH;
                case -3:
                case 3:
                    if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53))) {
                        a = (double) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        if ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
                            if (size == -3)
                                a = -a;
                            break;
                        }
                    }
                    CYTHON_FALLTHROUGH;
                case -4:
                case 4:
                    if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53))) {
                        a = (double) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        if ((8 * sizeof(unsigned long) < 53) || (4 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
                            if (size == -4)
                                a = -a;
                            break;
                        }
                    }
                    CYTHON_FALLTHROUGH;
                default:
        #endif
                    a = PyLong_AsDouble(op1);
                    if (unlikely(a == -1.0 && PyErr_Occurred())) return NULL;
        #if CYTHON_USE_PYLONG_INTERNALS
            }
        }
        #endif
    } else {
        return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
    }
        result = a + b;
        return PyFloat_FromDouble(result);
}
#endif

/* SliceObject */
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj,
        Py_ssize_t cstart, Py_ssize_t cstop,
        PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
        int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
    __Pyx_TypeName obj_type_name;
#if CYTHON_USE_TYPE_SLOTS
    PyMappingMethods* mp = Py_TYPE(obj)->tp_as_mapping;
    if (likely(mp && mp->mp_subscript))
#endif
    {
        PyObject* result;
        PyObject *py_slice, *py_start, *py_stop;
        if (_py_slice) {
            py_slice = *_py_slice;
        } else {
            PyObject* owned_start = NULL;
            PyObject* owned_stop = NULL;
            if (_py_start) {
                py_start = *_py_start;
            } else {
                if (has_cstart) {
                    owned_start = py_start = PyLong_FromSsize_t(cstart);
                    if (unlikely(!py_start)) goto bad;
                } else
                    py_start = Py_None;
            }
            if (_py_stop) {
                py_stop = *_py_stop;
            } else {
                if (has_cstop) {
                    owned_stop = py_stop = PyLong_FromSsize_t(cstop);
                    if (unlikely(!py_stop)) {
                        Py_XDECREF(owned_start);
                        goto bad;
                    }
                } else
                    py_stop = Py_None;
            }
            py_slice = PySlice_New(py_start, py_stop, Py_None);
            Py_XDECREF(owned_start);
            Py_XDECREF(owned_stop);
            if (unlikely(!py_slice)) goto bad;
        }
#if CYTHON_USE_TYPE_SLOTS
        result = mp->mp_subscript(obj, py_slice);
#else
        result = PyObject_GetItem(obj, py_slice);
#endif
        if (!_py_slice) {
            Py_DECREF(py_slice);
        }
        return result;
    }
    obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj));
    PyErr_Format(PyExc_TypeError,
        "'" __Pyx_FMT_TYPENAME "' object is unsliceable", obj_type_name);
    __Pyx_DECREF_TypeName(obj_type_name);
bad:
    return NULL;
}

/* pybytes_as_double (used by pyobject_as_double) */
static double __Pyx_SlowPyString_AsDouble(PyObject *obj) {
    PyObject *float_value = PyFloat_FromString(obj);
    if (likely(float_value)) {
        double value = __Pyx_PyFloat_AS_DOUBLE(float_value);
        Py_DECREF(float_value);
        return value;
    }
    return (double)-1;
}
static const char* __Pyx__PyBytes_AsDouble_Copy(const char* start, char* buffer, Py_ssize_t length) {
    int last_was_punctuation = 1;
    int parse_error_found = 0;
    Py_ssize_t i;
    for (i=0; i < length; i++) {
        char chr = start[i];
        int is_punctuation = (chr == '_') | (chr == '.') | (chr == 'e') | (chr == 'E');
        *buffer = chr;
        buffer += (chr != '_');
        parse_error_found |= last_was_punctuation & is_punctuation;
        last_was_punctuation = is_punctuation;
    }
    parse_error_found |= last_was_punctuation;
    *buffer = '\0';
    return unlikely(parse_error_found) ? NULL : buffer;
}
static double __Pyx__PyBytes_AsDouble_inf_nan(const char* start, Py_ssize_t length) {
    int matches = 1;
    char sign = start[0];
    int is_signed = (sign == '+') | (sign == '-');
    start += is_signed;
    length -= is_signed;
    switch (start[0]) {
        #ifdef Py_NAN
        case 'n':
        case 'N':
            if (unlikely(length != 3)) goto parse_failure;
            matches &= (start[1] == 'a' || start[1] == 'A');
            matches &= (start[2] == 'n' || start[2] == 'N');
            if (unlikely(!matches)) goto parse_failure;
            return (sign == '-') ? -Py_NAN : Py_NAN;
        #endif
        case 'i':
        case 'I':
            if (unlikely(length < 3)) goto parse_failure;
            matches &= (start[1] == 'n' || start[1] == 'N');
            matches &= (start[2] == 'f' || start[2] == 'F');
            if (likely(length == 3 && matches))
                return (sign == '-') ? -Py_HUGE_VAL : Py_HUGE_VAL;
            if (unlikely(length != 8)) goto parse_failure;
            matches &= (start[3] == 'i' || start[3] == 'I');
            matches &= (start[4] == 'n' || start[4] == 'N');
            matches &= (start[5] == 'i' || start[5] == 'I');
            matches &= (start[6] == 't' || start[6] == 'T');
            matches &= (start[7] == 'y' || start[7] == 'Y');
            if (unlikely(!matches)) goto parse_failure;
            return (sign == '-') ? -Py_HUGE_VAL : Py_HUGE_VAL;
        case '.': case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9':
            break;
        default:
            goto parse_failure;
    }
    return 0.0;
parse_failure:
    return -1.0;
}
static CYTHON_INLINE int __Pyx__PyBytes_AsDouble_IsSpace(char ch) {
    return (ch == 0x20) | !((ch < 0x9) | (ch > 0xd));
}
CYTHON_UNUSED static double __Pyx__PyBytes_AsDouble(PyObject *obj, const char* start, Py_ssize_t length) {
    double value;
    Py_ssize_t i, digits;
    const char *last = start + length;
    char *end;
    while (__Pyx__PyBytes_AsDouble_IsSpace(*start))
        start++;
    while (start < last - 1 && __Pyx__PyBytes_AsDouble_IsSpace(last[-1]))
        last--;
    length = last - start;
    if (unlikely(length <= 0)) goto fallback;
    value = __Pyx__PyBytes_AsDouble_inf_nan(start, length);
    if (unlikely(value == -1.0)) goto fallback;
    if (value != 0.0) return value;
    digits = 0;
    for (i=0; i < length; digits += start[i++] != '_');
    if (likely(digits == length)) {
        value = PyOS_string_to_double(start, &end, NULL);
    } else if (digits < 40) {
        char number[40];
        last = __Pyx__PyBytes_AsDouble_Copy(start, number, length);
        if (unlikely(!last)) goto fallback;
        value = PyOS_string_to_double(number, &end, NULL);
    } else {
        char *number = (char*) PyMem_Malloc((digits + 1) * sizeof(char));
        if (unlikely(!number)) goto fallback;
        last = __Pyx__PyBytes_AsDouble_Copy(start, number, length);
        if (unlikely(!last)) {
            PyMem_Free(number);
            goto fallback;
        }
        value = PyOS_string_to_double(number, &end, NULL);
        PyMem_Free(number);
    }
    if (likely(end == last) || (value == (double)-1 && PyErr_Occurred())) {
        return value;
    }
fallback:
    return __Pyx_SlowPyString_AsDouble(obj);
}

/* pyobject_as_double */
static double __Pyx__PyObject_AsDouble(PyObject* obj) {
    if (PyUnicode_CheckExact(obj)) {
        return __Pyx_PyUnicode_AsDouble(obj);
    } else if (PyBytes_CheckExact(obj)) {
        return __Pyx_PyBytes_AsDouble(obj);
    } else if (PyByteArray_CheckExact(obj)) {
        return __Pyx_PyByteArray_AsDouble(obj);
    } else {
        PyObject* float_value;
#if !CYTHON_USE_TYPE_SLOTS
        float_value = PyNumber_Float(obj);  if ((0)) goto bad;
        (void)__Pyx_PyObject_CallOneArg;
#else
        PyNumberMethods *nb = Py_TYPE(obj)->tp_as_number;
        if (likely(nb) && likely(nb->nb_float)) {
            float_value = nb->nb_float(obj);
            if (likely(float_value) && unlikely(!PyFloat_Check(float_value))) {
                __Pyx_TypeName float_value_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(float_value));
                PyErr_Format(PyExc_TypeError,
                    "__float__ returned non-float (type " __Pyx_FMT_TYPENAME ")",
                    float_value_type_name);
                __Pyx_DECREF_TypeName(float_value_type_name);
                Py_DECREF(float_value);
                goto bad;
            }
        } else {
            float_value = __Pyx_PyObject_CallOneArg((PyObject*)&PyFloat_Type, obj);
        }
#endif
        if (likely(float_value)) {
            double value = __Pyx_PyFloat_AS_DOUBLE(float_value);
            Py_DECREF(float_value);
            return value;
        }
    }
bad:
    return (double)-1;
}

/* PyFloatBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyFloat_TrueDivideObjC(PyObject *op1, PyObject *op2, double floatval, int inplace, int zerodivision_check) {
    const double b = floatval;
    double a, result;
    CYTHON_UNUSED_VAR(inplace);
    CYTHON_UNUSED_VAR(zerodivision_check);
    if (likely(PyFloat_CheckExact(op1))) {
        a = __Pyx_PyFloat_AS_DOUBLE(op1);
        
    } else
    if (likely(PyLong_CheckExact(op1))) {
        #if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsZero(op1)) {
            a = 0.0;
            
        } else if (__Pyx_PyLong_IsCompact(op1)) {
            a = (double) __Pyx_PyLong_CompactValue(op1);
        } else {
            const digit* digits = __Pyx_PyLong_Digits(op1);
            const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1);
            switch (size) {
                case -2:
                case 2:
                    if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (1 * PyLong_SHIFT < 53))) {
                        a = (double) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        if ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
                            if (size == -2)
                                a = -a;
                            break;
                        }
                    }
                    CYTHON_FALLTHROUGH;
                case -3:
                case 3:
                    if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53))) {
                        a = (double) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        if ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
                            if (size == -3)
                                a = -a;
                            break;
                        }
                    }
                    CYTHON_FALLTHROUGH;
                case -4:
                case 4:
                    if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53))) {
                        a = (double) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        if ((8 * sizeof(unsigned long) < 53) || (4 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
                            if (size == -4)
                                a = -a;
                            break;
                        }
                    }
                    CYTHON_FALLTHROUGH;
                default:
        #endif
                    a = PyLong_AsDouble(op1);
                    if (unlikely(a == -1.0 && PyErr_Occurred())) return NULL;
        #if CYTHON_USE_PYLONG_INTERNALS
            }
        }
        #endif
    } else {
        return (inplace ? PyNumber_InPlaceTrueDivide : PyNumber_TrueDivide)(op1, op2);
    }
        result = a / b;
        return PyFloat_FromDouble(result);
}
#endif

/* BufferIndexError */
static void __Pyx_RaiseBufferIndexError(int axis) {
  PyErr_Format(PyExc_IndexError,
     "Out of bounds on buffer access (axis %d)", axis);
}

/* PyLongBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_Fallback___Pyx_PyLong_MultiplyObjC(PyObject *op1, PyObject *op2, int inplace) {
    return (inplace ? PyNumber_InPlaceMultiply : PyNumber_Multiply)(op1, op2);
}
#if CYTHON_USE_PYLONG_INTERNALS
static PyObject* __Pyx_Unpacked___Pyx_PyLong_MultiplyObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(inplace);
    CYTHON_UNUSED_VAR(zerodivision_check);
    const long b = intval;
    long a;
    const PY_LONG_LONG llb = intval;
    PY_LONG_LONG lla;
    if (unlikely(__Pyx_PyLong_IsZero(op1))) {
        return __Pyx_NewRef(op1);
    }
    const int is_positive = __Pyx_PyLong_IsPos(op1);
    const digit* digits = __Pyx_PyLong_Digits(op1);
    const Py_ssize_t size = __Pyx_PyLong_DigitCount(op1);
    if (likely(size == 1)) {
        a = (long) digits[0];
        if (!is_positive) a *= -1;
    } else {
        switch (size) {
            case 2:
                if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT+30) {
                    a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    if (!is_positive) a *= -1;
                    goto calculate_long;
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT+30) {
                    lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    if (!is_positive) lla *= -1;
                    goto calculate_long_long;
                }
                break;
            case 3:
                if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT+30) {
                    a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    if (!is_positive) a *= -1;
                    goto calculate_long;
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT+30) {
                    lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    if (!is_positive) lla *= -1;
                    goto calculate_long_long;
                }
                break;
            case 4:
                if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT+30) {
                    a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    if (!is_positive) a *= -1;
                    goto calculate_long;
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT+30) {
                    lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    if (!is_positive) lla *= -1;
                    goto calculate_long_long;
                }
                break;
        }
        return PyLong_Type.tp_as_number->nb_multiply(op1, op2);
    }
    calculate_long:
        CYTHON_UNUSED_VAR(a);
        CYTHON_UNUSED_VAR(b);
        lla = a;
        goto calculate_long_long;
    calculate_long_long:
        {
            PY_LONG_LONG llx;
            llx = lla * llb;
            return PyLong_FromLongLong(llx);
        }
    
}
#endif
static PyObject* __Pyx_Float___Pyx_PyLong_MultiplyObjC(PyObject *float_val, long intval, int zerodivision_check) {
    CYTHON_UNUSED_VAR(zerodivision_check);
    const long b = intval;
    double a = __Pyx_PyFloat_AS_DOUBLE(float_val);
        double result;
        
        result = ((double)a) * (double)b;
        return PyFloat_FromDouble(result);
}
static CYTHON_INLINE PyObject* __Pyx_PyLong_MultiplyObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_UNUSED_VAR(zerodivision_check);
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        return __Pyx_Unpacked___Pyx_PyLong_MultiplyObjC(op1, op2, intval, inplace, zerodivision_check);
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        return __Pyx_Float___Pyx_PyLong_MultiplyObjC(op1, intval, zerodivision_check);
    }
    return __Pyx_Fallback___Pyx_PyLong_MultiplyObjC(op1, op2, inplace);
}
#endif

/* SliceObject */
static CYTHON_INLINE int __Pyx_PyObject_SetSlice(PyObject* obj, PyObject* value,
        Py_ssize_t cstart, Py_ssize_t cstop,
        PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
        int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
    __Pyx_TypeName obj_type_name;
#if CYTHON_USE_TYPE_SLOTS
    PyMappingMethods* mp = Py_TYPE(obj)->tp_as_mapping;
    if (likely(mp && mp->mp_ass_subscript))
#endif
    {
        int result;
        PyObject *py_slice, *py_start, *py_stop;
        if (_py_slice) {
            py_slice = *_py_slice;
        } else {
            PyObject* owned_start = NULL;
            PyObject* owned_stop = NULL;
            if (_py_start) {
                py_start = *_py_start;
            } else {
                if (has_cstart) {
                    owned_start = py_start = PyLong_FromSsize_t(cstart);
                    if (unlikely(!py_start)) goto bad;
                } else
                    py_start = Py_None;
            }
            if (_py_stop) {
                py_stop = *_py_stop;
            } else {
                if (has_cstop) {
                    owned_stop = py_stop = PyLong_FromSsize_t(cstop);
                    if (unlikely(!py_stop)) {
                        Py_XDECREF(owned_start);
                        goto bad;
                    }
                } else
                    py_stop = Py_None;
            }
            py_slice = PySlice_New(py_start, py_stop, Py_None);
            Py_XDECREF(owned_start);
            Py_XDECREF(owned_stop);
            if (unlikely(!py_slice)) goto bad;
        }
#if CYTHON_USE_TYPE_SLOTS
        result = mp->mp_ass_subscript(obj, py_slice, value);
#else
        result = value ? PyObject_SetItem(obj, py_slice, value) : PyObject_DelItem(obj, py_slice);
#endif
        if (!_py_slice) {
            Py_DECREF(py_slice);
        }
        return result;
    }
    obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj));
    PyErr_Format(PyExc_TypeError,
        "'" __Pyx_FMT_TYPENAME "' object does not support slice %.10s",
        obj_type_name, value ? "assignment" : "deletion");
    __Pyx_DECREF_TypeName(obj_type_name);
bad:
    return -1;
}

/* CIntToPyUnicode */
static CYTHON_INLINE PyObject* __Pyx_uchar___Pyx_PyUnicode_From_size_t(size_t value, Py_ssize_t width, char padding_char) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const size_t neg_one = (size_t) -1, const_zero = (size_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (unlikely(!(is_unsigned || value == 0 || value > 0) ||
                    !(sizeof(value) <= 2 || value & ~ (size_t) 0x01fffff || __Pyx_CheckUnicodeValue((int) value)))) {
        PyErr_SetString(PyExc_OverflowError, "%c arg not in range(0x110000)");
        return NULL;
    }
    if (width <= 1) {
        return PyUnicode_FromOrdinal((int) value);
    }
    return __Pyx_PyUnicode_FromOrdinal_Padded((int) value, width, padding_char);
}
static CYTHON_INLINE PyObject* __Pyx____Pyx_PyUnicode_From_size_t(size_t value, Py_ssize_t width, char padding_char, char format_char) {
    char digits[sizeof(size_t)*3+2];
    char *dpos, *end = digits + sizeof(size_t)*3+2;
    const char *hex_digits = DIGITS_HEX;
    Py_ssize_t length, ulength;
    int prepend_sign, last_one_off;
    size_t remaining;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const size_t neg_one = (size_t) -1, const_zero = (size_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (format_char == 'X') {
        hex_digits += 16;
        format_char = 'x';
    }
    remaining = value;
    last_one_off = 0;
    dpos = end;
    do {
        int digit_pos;
        switch (format_char) {
        case 'o':
            digit_pos = abs((int)(remaining % (8*8)));
            remaining = (size_t) (remaining / (8*8));
            dpos -= 2;
            memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2);
            last_one_off = (digit_pos < 8);
            break;
        case 'd':
            digit_pos = abs((int)(remaining % (10*10)));
            remaining = (size_t) (remaining / (10*10));
            dpos -= 2;
            memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2);
            last_one_off = (digit_pos < 10);
            break;
        case 'x':
            *(--dpos) = hex_digits[abs((int)(remaining % 16))];
            remaining = (size_t) (remaining / 16);
            break;
        default:
            assert(0);
            break;
        }
    } while (unlikely(remaining != 0));
    assert(!last_one_off || *dpos == '0');
    dpos += last_one_off;
    length = end - dpos;
    ulength = length;
    prepend_sign = 0;
    if (!is_unsigned && value <= neg_one) {
        if (padding_char == ' ' || width <= length + 1) {
            *(--dpos) = '-';
            ++length;
        } else {
            prepend_sign = 1;
        }
        ++ulength;
    }
    if (width > ulength) {
        ulength = width;
    }
    if (ulength == 1) {
        return PyUnicode_FromOrdinal(*dpos);
    }
    return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char);
}

/* PyObjectCallNoArg (used by PyObjectCallMethod0) */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
    PyObject *arg[2] = {NULL, NULL};
    return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
}

/* PyObjectCallMethod0 (used by dict_iter) */
static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
#if CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000))
    PyObject *args[1] = {obj};
    (void) __Pyx_PyObject_CallOneArg;
    (void) __Pyx_PyObject_CallNoArg;
    return PyObject_VectorcallMethod(method_name, args, 1 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
#else
    PyObject *method = NULL, *result = NULL;
    int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
    if (likely(is_method)) {
        result = __Pyx_PyObject_CallOneArg(method, obj);
        Py_DECREF(method);
        return result;
    }
    if (unlikely(!method)) goto bad;
    result = __Pyx_PyObject_CallNoArg(method);
    Py_DECREF(method);
bad:
    return result;
#endif
}

/* UnpackTupleError (used by UnpackTuple2) */
static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) {
    if (t == Py_None) {
      __Pyx_RaiseNoneNotIterableError();
    } else {
      Py_ssize_t size = __Pyx_PyTuple_GET_SIZE(t);
 #if !CYTHON_ASSUME_SAFE_SIZE
      if (unlikely(size < 0)) return;
 #endif
      if (size < index) {
        __Pyx_RaiseNeedMoreValuesError(size);
      } else {
        __Pyx_RaiseTooManyValuesError(index);
      }
    }
}

/* UnpackTuple2 (used by dict_iter) */
static CYTHON_INLINE int __Pyx_unpack_tuple2(
        PyObject* tuple, PyObject** value1, PyObject** value2, int is_tuple, int has_known_size, int decref_tuple) {
    if (likely(is_tuple || PyTuple_Check(tuple))) {
        Py_ssize_t size;
        if (has_known_size) {
            return __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple);
        }
        size = __Pyx_PyTuple_GET_SIZE(tuple);
        if (likely(size == 2)) {
            return __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple);
        }
        if (size >= 0) {
            __Pyx_UnpackTupleError(tuple, 2);
        }
        return -1;
    } else {
        return __Pyx_unpack_tuple2_generic(tuple, value1, value2, has_known_size, decref_tuple);
    }
}
static CYTHON_INLINE int __Pyx_unpack_tuple2_exact(
        PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int decref_tuple) {
    PyObject *value1 = NULL, *value2 = NULL;
#if CYTHON_AVOID_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS
    value1 = __Pyx_PySequence_ITEM(tuple, 0);  if (unlikely(!value1)) goto bad;
    value2 = __Pyx_PySequence_ITEM(tuple, 1);  if (unlikely(!value2)) goto bad;
#else
    value1 = PyTuple_GET_ITEM(tuple, 0);  Py_INCREF(value1);
    value2 = PyTuple_GET_ITEM(tuple, 1);  Py_INCREF(value2);
#endif
    if (decref_tuple) {
        Py_DECREF(tuple);
    }
    *pvalue1 = value1;
    *pvalue2 = value2;
    return 0;
#if CYTHON_AVOID_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS
bad:
    Py_XDECREF(value1);
    Py_XDECREF(value2);
    if (decref_tuple) { Py_XDECREF(tuple); }
    return -1;
#endif
}
static int __Pyx_unpack_tuple2_generic(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2,
                                       int has_known_size, int decref_tuple) {
    Py_ssize_t index;
    PyObject *value1 = NULL, *value2 = NULL, *iter = NULL;
    iternextfunc iternext;
    iter = PyObject_GetIter(tuple);
    if (unlikely(!iter)) goto bad;
    if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; }
    iternext = __Pyx_PyObject_GetIterNextFunc(iter);
    value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; }
    value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; }
    if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad;
    Py_DECREF(iter);
    *pvalue1 = value1;
    *pvalue2 = value2;
    return 0;
unpacking_failed:
    if (!has_known_size && __Pyx_IterFinish() == 0)
        __Pyx_RaiseNeedMoreValuesError(index);
bad:
    Py_XDECREF(iter);
    Py_XDECREF(value1);
    Py_XDECREF(value2);
    if (decref_tuple) { Py_XDECREF(tuple); }
    return -1;
}

/* dict_iter */
#if CYTHON_AVOID_BORROWED_REFS
#include <string.h>
#endif
static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name,
                                                   Py_ssize_t* p_orig_length, int* p_source_is_dict) {
    is_dict = is_dict || likely(PyDict_CheckExact(iterable));
    *p_source_is_dict = is_dict;
    if (is_dict) {
#if !CYTHON_AVOID_BORROWED_REFS
        *p_orig_length = PyDict_Size(iterable);
        Py_INCREF(iterable);
        return iterable;
#else
        static PyObject *py_items = NULL, *py_keys = NULL, *py_values = NULL;
        PyObject **pp = NULL;
        if (method_name) {
            const char *name = PyUnicode_AsUTF8(method_name);
            if (strcmp(name, "iteritems") == 0) pp = &py_items;
            else if (strcmp(name, "iterkeys") == 0) pp = &py_keys;
            else if (strcmp(name, "itervalues") == 0) pp = &py_values;
            if (pp) {
                if (!*pp) {
                    *pp = PyUnicode_FromString(name + 4);
                    if (!*pp)
                        return NULL;
                }
                method_name = *pp;
            }
        }
#endif
    }
    *p_orig_length = 0;
    if (method_name) {
        PyObject* iter;
        iterable = __Pyx_PyObject_CallMethod0(iterable, method_name);
        if (!iterable)
            return NULL;
#if !CYTHON_AVOID_BORROWED_REFS
        if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable))
            return iterable;
#endif
        iter = PyObject_GetIter(iterable);
        Py_DECREF(iterable);
        return iter;
    }
    return PyObject_GetIter(iterable);
}
#if !CYTHON_AVOID_BORROWED_REFS
static CYTHON_INLINE int __Pyx_dict_iter_next_source_is_dict(
        PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos,
        PyObject** pkey, PyObject** pvalue, PyObject** pitem) {
    PyObject *key, *value;
    if (unlikely(orig_length != PyDict_Size(iter_obj))) {
        PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration");
        return -1;
    }
    if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) {
        return 0;
    }
    if (pitem) {
        PyObject* tuple = PyTuple_New(2);
        if (unlikely(!tuple)) {
            return -1;
        }
        Py_INCREF(key);
        Py_INCREF(value);
        #if CYTHON_ASSUME_SAFE_MACROS
        PyTuple_SET_ITEM(tuple, 0, key);
        PyTuple_SET_ITEM(tuple, 1, value);
        #else
        if (unlikely(PyTuple_SetItem(tuple, 0, key) < 0)) {
            Py_DECREF(value);
            Py_DECREF(tuple);
            return -1;
        }
        if (unlikely(PyTuple_SetItem(tuple, 1, value) < 0)) {
            Py_DECREF(tuple);
            return -1;
        }
        #endif
        *pitem = tuple;
    } else {
        if (pkey) {
            Py_INCREF(key);
            *pkey = key;
        }
        if (pvalue) {
            Py_INCREF(value);
            *pvalue = value;
        }
    }
    return 1;
}
#endif
static CYTHON_INLINE int __Pyx_dict_iter_next(
        PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos,
        PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) {
    PyObject* next_item;
#if !CYTHON_AVOID_BORROWED_REFS
    if (source_is_dict) {
        int result;
#if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_BEGIN_CRITICAL_SECTION(iter_obj);
#endif
        result = __Pyx_dict_iter_next_source_is_dict(iter_obj, orig_length, ppos, pkey, pvalue, pitem);
#if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_END_CRITICAL_SECTION();
#endif
        return result;
    } else if (PyTuple_CheckExact(iter_obj)) {
        Py_ssize_t pos = *ppos;
        Py_ssize_t tuple_size = __Pyx_PyTuple_GET_SIZE(iter_obj);
        #if !CYTHON_ASSUME_SAFE_SIZE
        if (unlikely(tuple_size < 0)) return -1;
        #endif
        if (unlikely(pos >= tuple_size)) return 0;
        *ppos = pos + 1;
        #if CYTHON_ASSUME_SAFE_MACROS
        next_item = PyTuple_GET_ITEM(iter_obj, pos);
        #else
        next_item = PyTuple_GetItem(iter_obj, pos);
        if (unlikely(!next_item)) return -1;
        #endif
        Py_INCREF(next_item);
    } else if (PyList_CheckExact(iter_obj)) {
        Py_ssize_t pos = *ppos;
        Py_ssize_t list_size = __Pyx_PyList_GET_SIZE(iter_obj);
        #if !CYTHON_ASSUME_SAFE_SIZE
        if (unlikely(list_size < 0)) return -1;
        #endif
        if (unlikely(pos >= list_size)) return 0;
        *ppos = pos + 1;
        next_item = __Pyx_PyList_GetItemRef(iter_obj, pos);
        if (unlikely(!next_item)) return -1;
    } else
#endif
    {
        next_item = PyIter_Next(iter_obj);
        if (unlikely(!next_item)) {
            return __Pyx_IterFinish();
        }
    }
    if (pitem) {
        *pitem = next_item;
    } else if (pkey && pvalue) {
        if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1))
            return -1;
    } else if (pkey) {
        *pkey = next_item;
    } else {
        *pvalue = next_item;
    }
    return 1;
}

/* pynumber_float */
static CYTHON_INLINE PyObject* __Pyx__PyNumber_Float(PyObject* obj) {
    double val;
    if (PyLong_CheckExact(obj)) {
#if CYTHON_USE_PYLONG_INTERNALS
        if (likely(__Pyx_PyLong_IsCompact(obj))) {
            val = (double) __Pyx_PyLong_CompactValue(obj);
            goto no_error;
        }
#endif
        val = PyLong_AsDouble(obj);
    } else if (PyUnicode_CheckExact(obj)) {
        val = __Pyx_PyUnicode_AsDouble(obj);
    } else if (PyBytes_CheckExact(obj)) {
        val = __Pyx_PyBytes_AsDouble(obj);
    } else if (PyByteArray_CheckExact(obj)) {
        val = __Pyx_PyByteArray_AsDouble(obj);
    } else {
        return PyNumber_Float(obj);
    }
    if (unlikely(val == -1 && PyErr_Occurred())) {
        return NULL;
    }
#if CYTHON_USE_PYLONG_INTERNALS
no_error:
#endif
    return PyFloat_FromDouble(val);
}

/* MergeKeywords */
static int __Pyx_MergeKeywords_dict(PyObject *kwdict, PyObject *source_dict) {
    Py_ssize_t len1, len2;
    len2 = PyDict_Size(source_dict);
    if (unlikely(len2 == -1)) return -1;
    if (len2 == 0) {
        return 0;
    }
    len1 = PyDict_Size(kwdict);
    if (unlikely(len1 == -1)) return -1;
    if (len1 > 0) {
        PyObject *key, *smaller_dict, *larger_dict;
        #if CYTHON_AVOID_BORROWED_REFS
        PyObject *ppos = NULL;
        #else
        Py_ssize_t ppos = 0;
        #endif
        int duplicates_found = 0;
        if (len1 <= len2) {
            smaller_dict = kwdict;
            larger_dict = source_dict;
        } else {
            smaller_dict = source_dict;
            larger_dict = kwdict;
        }
        __Pyx_BEGIN_CRITICAL_SECTION(smaller_dict);
        while (
            #if CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
            __Pyx_PyDict_NextRef(smaller_dict, &ppos, &key, NULL)
            #else
            PyDict_Next(smaller_dict, &ppos, &key, NULL)
            #endif
        ) {
            if (unlikely(PyDict_Contains(larger_dict, key))) {
                __Pyx_RaiseDoubleKeywordsError("function", key);
                #if CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
                Py_DECREF(key);
                #endif
                duplicates_found = 1;
                break;
            };
            #if CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
            Py_DECREF(key);
            #endif
        }
        __Pyx_END_CRITICAL_SECTION();
        #if CYTHON_AVOID_BORROWED_REFS
        Py_XDECREF(ppos);
        #endif
        if (unlikely(duplicates_found))
            return -1;
    }
    return PyDict_Update(kwdict, source_dict);
}
static int __Pyx_MergeKeywords_any(PyObject *kwdict, PyObject *source_mapping) {
    PyObject *iter, *key = NULL, *value = NULL;
    int source_is_dict, result;
    Py_ssize_t orig_length, ppos = 0;
    iter = __Pyx_dict_iterator(source_mapping, 0, __pyx_mstate_global->__pyx_n_u_items, &orig_length, &source_is_dict);
    if (unlikely(!iter)) {
        PyObject *args;
        if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError))) goto bad;
        PyErr_Clear();
        args = PyTuple_Pack(1, source_mapping);
        if (likely(args)) {
            PyObject *fallback = PyObject_Call((PyObject*)&PyDict_Type, args, NULL);
            Py_DECREF(args);
            if (likely(fallback)) {
                result = __Pyx_MergeKeywords_dict(kwdict, fallback);
                Py_DECREF(fallback);
                return result;
            }
        }
        goto bad;
    }
    while (1) {
        result = __Pyx_dict_iter_next(iter, orig_length, &ppos, &key, &value, NULL, source_is_dict);
        if (unlikely(result < 0)) goto bad;
        if (!result) break;
    #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API
        {
            int inserted = PyDict_SetDefaultRef(kwdict, key, value, NULL);
            if (unlikely(inserted != 0)) {
                if (inserted == 1) __Pyx_RaiseDoubleKeywordsError("function", key);
                result = -1;
            }
        }
    #else
        if (unlikely(PyDict_Contains(kwdict, key))) {
            __Pyx_RaiseDoubleKeywordsError("function", key);
            result = -1;
        } else {
            result = PyDict_SetItem(kwdict, key, value);
        }
    #endif
        Py_DECREF(key);
        Py_DECREF(value);
        if (unlikely(result < 0)) goto bad;
    }
    Py_XDECREF(iter);
    return 0;
bad:
    Py_XDECREF(iter);
    return -1;
}
static CYTHON_INLINE int __Pyx_MergeKeywords(PyObject *kwdict, PyObject *source_mapping) {
    assert(PyDict_Check(kwdict));
    if (likely(PyDict_Check(source_mapping))) {
        return __Pyx_MergeKeywords_dict(kwdict, source_mapping);
    } else {
        return __Pyx_MergeKeywords_any(kwdict, source_mapping);
    }
}

/* AllocateExtensionType */
static PyObject *__Pyx_AllocateExtensionType(PyTypeObject *t, int is_final) {
    if (is_final || likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
        allocfunc alloc_func = __Pyx_PyType_GetSlot(t, tp_alloc, allocfunc);
        return alloc_func(t, 0);
    } else {
        newfunc tp_new = __Pyx_PyType_TryGetSlot(&PyBaseObject_Type, tp_new, newfunc);
    #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
        if (!tp_new) {
            PyObject *new_str = PyUnicode_FromString("__new__");
            if (likely(new_str)) {
                PyObject *o = PyObject_CallMethodObjArgs((PyObject *)&PyBaseObject_Type, new_str, t, NULL);
                Py_DECREF(new_str);
                return o;
            } else
                return NULL;
        } else
    #endif
        return tp_new(t, __pyx_mstate_global->__pyx_empty_tuple, 0);
    }
}

/* ValidateBasesTuple (used by PyType_Ready) */
#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS
static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) {
    Py_ssize_t i, n;
#if CYTHON_ASSUME_SAFE_SIZE
    n = PyTuple_GET_SIZE(bases);
#else
    n = PyTuple_Size(bases);
    if (unlikely(n < 0)) return -1;
#endif
    for (i = 1; i < n; i++)
    {
        PyTypeObject *b;
#if CYTHON_AVOID_BORROWED_REFS
        PyObject *b0 = PySequence_GetItem(bases, i);
        if (!b0) return -1;
#elif CYTHON_ASSUME_SAFE_MACROS
        PyObject *b0 = PyTuple_GET_ITEM(bases, i);
#else
        PyObject *b0 = PyTuple_GetItem(bases, i);
        if (!b0) return -1;
#endif
        b = (PyTypeObject*) b0;
        if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE))
        {
            __Pyx_TypeName b_name = __Pyx_PyType_GetFullyQualifiedName(b);
            PyErr_Format(PyExc_TypeError,
                "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b_name);
            __Pyx_DECREF_TypeName(b_name);
#if CYTHON_AVOID_BORROWED_REFS
            Py_DECREF(b0);
#endif
            return -1;
        }
        if (dictoffset == 0)
        {
            Py_ssize_t b_dictoffset = 0;
#if CYTHON_USE_TYPE_SLOTS
            b_dictoffset = b->tp_dictoffset;
#else
            PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__");
            if (!py_b_dictoffset) goto dictoffset_return;
            b_dictoffset = PyLong_AsSsize_t(py_b_dictoffset);
            Py_DECREF(py_b_dictoffset);
            if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return;
#endif
            if (b_dictoffset) {
                {
                    __Pyx_TypeName b_name = __Pyx_PyType_GetFullyQualifiedName(b);
                    PyErr_Format(PyExc_TypeError,
                        "extension type '%.200s' has no __dict__ slot, "
                        "but base type '" __Pyx_FMT_TYPENAME "' has: "
                        "either add 'cdef dict __dict__' to the extension type "
                        "or add '__slots__ = [...]' to the base type",
                        type_name, b_name);
                    __Pyx_DECREF_TypeName(b_name);
                }
#if !CYTHON_USE_TYPE_SLOTS
              dictoffset_return:
#endif
#if CYTHON_AVOID_BORROWED_REFS
                Py_DECREF(b0);
#endif
                return -1;
            }
        }
#if CYTHON_AVOID_BORROWED_REFS
        Py_DECREF(b0);
#endif
    }
    return 0;
}
#endif

/* PyType_Ready */
CYTHON_UNUSED static int __Pyx_PyType_HasMultipleInheritance(PyTypeObject *t) {
    while (t) {
        PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*);
        if (bases) {
            return 1;
        }
        t = __Pyx_PyType_GetSlot(t, tp_base, PyTypeObject*);
    }
    return 0;
}
static int __Pyx_PyType_Ready(PyTypeObject *t) {
#if CYTHON_USE_TYPE_SPECS || !CYTHON_COMPILING_IN_CPYTHON || defined(PYSTON_MAJOR_VERSION)
    (void)__Pyx_PyObject_CallMethod0;
#if CYTHON_USE_TYPE_SPECS
    (void)__Pyx_validate_bases_tuple;
#endif
    return PyType_Ready(t);
#else
    int r;
    if (!__Pyx_PyType_HasMultipleInheritance(t)) {
        return PyType_Ready(t);
    }
    PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*);
    if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1))
        return -1;
#if !defined(PYSTON_MAJOR_VERSION)
    {
        int gc_was_enabled;
    #if PY_VERSION_HEX >= 0x030A00b1
        gc_was_enabled = PyGC_Disable();
        (void)__Pyx_PyObject_CallMethod0;
    #else
        PyObject *ret, *py_status;
        PyObject *gc = NULL;
        #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) &&\
                !CYTHON_COMPILING_IN_GRAAL
        gc = PyImport_GetModule(__pyx_mstate_global->__pyx_kp_u_gc);
        #endif
        if (unlikely(!gc)) gc = PyImport_Import(__pyx_mstate_global->__pyx_kp_u_gc);
        if (unlikely(!gc)) return -1;
        py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__pyx_kp_u_isenabled);
        if (unlikely(!py_status)) {
            Py_DECREF(gc);
            return -1;
        }
        gc_was_enabled = __Pyx_PyObject_IsTrue(py_status);
        Py_DECREF(py_status);
        if (gc_was_enabled > 0) {
            ret = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__pyx_kp_u_disable);
            if (unlikely(!ret)) {
                Py_DECREF(gc);
                return -1;
            }
            Py_DECREF(ret);
        } else if (unlikely(gc_was_enabled == -1)) {
            Py_DECREF(gc);
            return -1;
        }
    #endif
        t->tp_flags |= Py_TPFLAGS_HEAPTYPE;
#if PY_VERSION_HEX >= 0x030A0000
        t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE;
#endif
#else
        (void)__Pyx_PyObject_CallMethod0;
#endif
    r = PyType_Ready(t);
#if !defined(PYSTON_MAJOR_VERSION)
        t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE;
    #if PY_VERSION_HEX >= 0x030A00b1
        if (gc_was_enabled)
            PyGC_Enable();
    #else
        if (gc_was_enabled) {
            PyObject *tp, *v, *tb;
            PyErr_Fetch(&tp, &v, &tb);
            ret = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__pyx_kp_u_enable);
            if (likely(ret || r == -1)) {
                Py_XDECREF(ret);
                PyErr_Restore(tp, v, tb);
            } else {
                Py_XDECREF(tp);
                Py_XDECREF(v);
                Py_XDECREF(tb);
                r = -1;
            }
        }
        Py_DECREF(gc);
    #endif
    }
#endif
    return r;
#endif
}

/* SetVTable */
static int __Pyx_SetVtable(PyTypeObject *type, void *vtable) {
    PyObject *ob = PyCapsule_New(vtable, 0, 0);
    if (unlikely(!ob))
        goto bad;
#if CYTHON_COMPILING_IN_LIMITED_API
    if (unlikely(PyObject_SetAttr((PyObject *) type, __pyx_mstate_global->__pyx_n_u_pyx_vtable, ob) < 0))
#else
    if (unlikely(PyDict_SetItem(type->tp_dict, __pyx_mstate_global->__pyx_n_u_pyx_vtable, ob) < 0))
#endif
        goto bad;
    Py_DECREF(ob);
    return 0;
bad:
    Py_XDECREF(ob);
    return -1;
}

/* GetVTable (used by MergeVTables) */
static void* __Pyx_GetVtable(PyTypeObject *type) {
    void* ptr;
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject *ob = PyObject_GetAttr((PyObject *)type, __pyx_mstate_global->__pyx_n_u_pyx_vtable);
#else
    PyObject *ob = PyObject_GetItem(type->tp_dict, __pyx_mstate_global->__pyx_n_u_pyx_vtable);
#endif
    if (!ob)
        goto bad;
    ptr = PyCapsule_GetPointer(ob, 0);
    if (!ptr && !PyErr_Occurred())
        PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type");
    Py_DECREF(ob);
    return ptr;
bad:
    Py_XDECREF(ob);
    return NULL;
}

/* MergeVTables */
static int __Pyx_MergeVtables(PyTypeObject *type) {
    int i=0;
    Py_ssize_t size;
    void** base_vtables;
    __Pyx_TypeName tp_base_name = NULL;
    __Pyx_TypeName base_name = NULL;
    void* unknown = (void*)-1;
    PyObject* bases = __Pyx_PyType_GetSlot(type, tp_bases, PyObject*);
    int base_depth = 0;
    {
        PyTypeObject* base = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*);
        while (base) {
            base_depth += 1;
            base = __Pyx_PyType_GetSlot(base, tp_base, PyTypeObject*);
        }
    }
    base_vtables = (void**) PyMem_Malloc(sizeof(void*) * (size_t)(base_depth + 1));
    base_vtables[0] = unknown;
#if CYTHON_COMPILING_IN_LIMITED_API
    size = PyTuple_Size(bases);
    if (size < 0) goto other_failure;
#else
    size = PyTuple_GET_SIZE(bases);
#endif
    for (i = 1; i < size; i++) {
        PyObject *basei;
        void* base_vtable;
#if CYTHON_AVOID_BORROWED_REFS
        basei = PySequence_GetItem(bases, i);
        if (unlikely(!basei)) goto other_failure;
#elif !CYTHON_ASSUME_SAFE_MACROS
        basei = PyTuple_GetItem(bases, i);
        if (unlikely(!basei)) goto other_failure;
#else
        basei = PyTuple_GET_ITEM(bases, i);
#endif
        base_vtable = __Pyx_GetVtable((PyTypeObject*)basei);
#if CYTHON_AVOID_BORROWED_REFS
        Py_DECREF(basei);
#endif
        if (base_vtable != NULL) {
            int j;
            PyTypeObject* base = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*);
            for (j = 0; j < base_depth; j++) {
                if (base_vtables[j] == unknown) {
                    base_vtables[j] = __Pyx_GetVtable(base);
                    base_vtables[j + 1] = unknown;
                }
                if (base_vtables[j] == base_vtable) {
                    break;
                } else if (base_vtables[j] == NULL) {
                    goto bad;
                }
                base = __Pyx_PyType_GetSlot(base, tp_base, PyTypeObject*);
            }
        }
    }
    PyErr_Clear();
    PyMem_Free(base_vtables);
    return 0;
bad:
    {
        PyTypeObject* basei = NULL;
        PyTypeObject* tp_base = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*);
        tp_base_name = __Pyx_PyType_GetFullyQualifiedName(tp_base);
#if CYTHON_AVOID_BORROWED_REFS
        basei = (PyTypeObject*)PySequence_GetItem(bases, i);
        if (unlikely(!basei)) goto really_bad;
#elif !CYTHON_ASSUME_SAFE_MACROS
        basei = (PyTypeObject*)PyTuple_GetItem(bases, i);
        if (unlikely(!basei)) goto really_bad;
#else
        basei = (PyTypeObject*)PyTuple_GET_ITEM(bases, i);
#endif
        base_name = __Pyx_PyType_GetFullyQualifiedName(basei);
#if CYTHON_AVOID_BORROWED_REFS
        Py_DECREF(basei);
#endif
    }
    PyErr_Format(PyExc_TypeError,
        "multiple bases have vtable conflict: '" __Pyx_FMT_TYPENAME "' and '" __Pyx_FMT_TYPENAME "'", tp_base_name, base_name);
#if CYTHON_AVOID_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS
really_bad: // bad has failed!
#endif
    __Pyx_DECREF_TypeName(tp_base_name);
    __Pyx_DECREF_TypeName(base_name);
#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_AVOID_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS
other_failure:
#endif
    PyMem_Free(base_vtables);
    return -1;
}

/* DelItemOnTypeDict (used by SetupReduce) */
static int __Pyx__DelItemOnTypeDict(PyTypeObject *tp, PyObject *k) {
    int result;
    PyObject *tp_dict;
#if CYTHON_COMPILING_IN_LIMITED_API
    tp_dict = __Pyx_GetTypeDict(tp);
    if (unlikely(!tp_dict)) return -1;
#else
    tp_dict = tp->tp_dict;
#endif
    result = PyDict_DelItem(tp_dict, k);
    if (likely(!result)) PyType_Modified(tp);
    return result;
}

/* SetupReduce */
static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
  int ret;
  PyObject *name_attr;
  name_attr = __Pyx_PyObject_GetAttrStrNoError(meth, __pyx_mstate_global->__pyx_n_u_name_2);
  if (likely(name_attr)) {
      ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
  } else {
      ret = -1;
  }
  if (unlikely(ret < 0)) {
      PyErr_Clear();
      ret = 0;
  }
  Py_XDECREF(name_attr);
  return ret;
}
static int __Pyx_setup_reduce(PyObject* type_obj) {
    int ret = 0;
    PyObject *object_reduce = NULL;
    PyObject *object_getstate = NULL;
    PyObject *object_reduce_ex = NULL;
    PyObject *reduce = NULL;
    PyObject *reduce_ex = NULL;
    PyObject *reduce_cython = NULL;
    PyObject *setstate = NULL;
    PyObject *setstate_cython = NULL;
    PyObject *getstate = NULL;
#if CYTHON_USE_PYTYPE_LOOKUP
    getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_getstate);
#else
    getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_mstate_global->__pyx_n_u_getstate);
    if (!getstate && PyErr_Occurred()) {
        goto __PYX_BAD;
    }
#endif
    if (getstate) {
#if CYTHON_USE_PYTYPE_LOOKUP
        object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_getstate);
#else
        object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_getstate);
        if (!object_getstate && PyErr_Occurred()) {
            goto __PYX_BAD;
        }
#endif
        if (object_getstate != getstate) {
            goto __PYX_GOOD;
        }
    }
#if CYTHON_USE_PYTYPE_LOOKUP
    object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
#else
    object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
#endif
    reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_mstate_global->__pyx_n_u_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;
    if (reduce_ex == object_reduce_ex) {
#if CYTHON_USE_PYTYPE_LOOKUP
        object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_reduce); if (!object_reduce) goto __PYX_BAD;
#else
        object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_reduce); if (!object_reduce) goto __PYX_BAD;
#endif
        reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_mstate_global->__pyx_n_u_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
        if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_mstate_global->__pyx_n_u_reduce_cython)) {
            reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_mstate_global->__pyx_n_u_reduce_cython);
            if (likely(reduce_cython)) {
                ret = __Pyx_SetItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
                ret = __Pyx_DelItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
            } else if (reduce == object_reduce || PyErr_Occurred()) {
                goto __PYX_BAD;
            }
            setstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_mstate_global->__pyx_n_u_setstate);
            if (!setstate) PyErr_Clear();
            if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_mstate_global->__pyx_n_u_setstate_cython)) {
                setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_mstate_global->__pyx_n_u_setstate_cython);
                if (likely(setstate_cython)) {
                    ret = __Pyx_SetItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
                    ret = __Pyx_DelItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
                } else if (!setstate || PyErr_Occurred()) {
                    goto __PYX_BAD;
                }
            }
            PyType_Modified((PyTypeObject*)type_obj);
        }
    }
    goto __PYX_GOOD;
__PYX_BAD:
    if (!PyErr_Occurred()) {
        __Pyx_TypeName type_obj_name =
            __Pyx_PyType_GetFullyQualifiedName((PyTypeObject*)type_obj);
        PyErr_Format(PyExc_RuntimeError,
            "Unable to initialize pickling for " __Pyx_FMT_TYPENAME, type_obj_name);
        __Pyx_DECREF_TypeName(type_obj_name);
    }
    ret = -1;
__PYX_GOOD:
#if !CYTHON_USE_PYTYPE_LOOKUP
    Py_XDECREF(object_reduce);
    Py_XDECREF(object_reduce_ex);
    Py_XDECREF(object_getstate);
    Py_XDECREF(getstate);
#endif
    Py_XDECREF(reduce);
    Py_XDECREF(reduce_ex);
    Py_XDECREF(reduce_cython);
    Py_XDECREF(setstate);
    Py_XDECREF(setstate_cython);
    return ret;
}

/* TypeImport */
#ifndef __PYX_HAVE_RT_ImportType_3_2_8
#define __PYX_HAVE_RT_ImportType_3_2_8
static PyTypeObject *__Pyx_ImportType_3_2_8(PyObject *module, const char *module_name, const char *class_name,
    size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_2_8 check_size)
{
    PyObject *result = 0;
    Py_ssize_t basicsize;
    Py_ssize_t itemsize;
#if defined(Py_LIMITED_API) || (defined(CYTHON_COMPILING_IN_LIMITED_API) && CYTHON_COMPILING_IN_LIMITED_API)
    PyObject *py_basicsize;
    PyObject *py_itemsize;
#endif
    result = PyObject_GetAttrString(module, class_name);
    if (!result)
        goto bad;
    if (!PyType_Check(result)) {
        PyErr_Format(PyExc_TypeError,
            "%.200s.%.200s is not a type object",
            module_name, class_name);
        goto bad;
    }
#if !( defined(Py_LIMITED_API) || (defined(CYTHON_COMPILING_IN_LIMITED_API) && CYTHON_COMPILING_IN_LIMITED_API) )
    basicsize = ((PyTypeObject *)result)->tp_basicsize;
    itemsize = ((PyTypeObject *)result)->tp_itemsize;
#else
    if (size == 0) {
        return (PyTypeObject *)result;
    }
    py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
    if (!py_basicsize)
        goto bad;
    basicsize = PyLong_AsSsize_t(py_basicsize);
    Py_DECREF(py_basicsize);
    py_basicsize = 0;
    if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
        goto bad;
    py_itemsize = PyObject_GetAttrString(result, "__itemsize__");
    if (!py_itemsize)
        goto bad;
    itemsize = PyLong_AsSsize_t(py_itemsize);
    Py_DECREF(py_itemsize);
    py_itemsize = 0;
    if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred())
        goto bad;
#endif
    if (itemsize) {
        if (size % alignment) {
            alignment = size % alignment;
        }
        if (itemsize < (Py_ssize_t)alignment)
            itemsize = (Py_ssize_t)alignment;
    }
    if ((size_t)(basicsize + itemsize) < size) {
        PyErr_Format(PyExc_ValueError,
            "%.200s.%.200s size changed, may indicate binary incompatibility. "
            "Expected %zd from C header, got %zd from PyObject",
            module_name, class_name, size, basicsize+itemsize);
        goto bad;
    }
    if (check_size == __Pyx_ImportType_CheckSize_Error_3_2_8 &&
            ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) {
        PyErr_Format(PyExc_ValueError,
            "%.200s.%.200s size changed, may indicate binary incompatibility. "
            "Expected %zd from C header, got %zd-%zd from PyObject",
            module_name, class_name, size, basicsize, basicsize+itemsize);
        goto bad;
    }
    else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_2_8 && (size_t)basicsize > size) {
        if (PyErr_WarnFormat(NULL, 0,
                "%.200s.%.200s size changed, may indicate binary incompatibility. "
                "Expected %zd from C header, got %zd from PyObject",
                module_name, class_name, size, basicsize) < 0) {
            goto bad;
        }
    }
    return (PyTypeObject *)result;
bad:
    Py_XDECREF(result);
    return NULL;
}
#endif

/* ImportFrom */
static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
    PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
    if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
        const char* module_name_str = 0;
        PyObject* module_name = 0;
        PyObject* module_dot = 0;
        PyObject* full_name = 0;
        PyErr_Clear();
        module_name_str = PyModule_GetName(module);
        if (unlikely(!module_name_str)) { goto modbad; }
        module_name = PyUnicode_FromString(module_name_str);
        if (unlikely(!module_name)) { goto modbad; }
        module_dot = PyUnicode_Concat(module_name, __pyx_mstate_global->__pyx_kp_u__2);
        if (unlikely(!module_dot)) { goto modbad; }
        full_name = PyUnicode_Concat(module_dot, name);
        if (unlikely(!full_name)) { goto modbad; }
        #if (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM  < 0x07030400) ||\
                CYTHON_COMPILING_IN_GRAAL
        {
            PyObject *modules = PyImport_GetModuleDict();
            if (unlikely(!modules))
                goto modbad;
            value = PyObject_GetItem(modules, full_name);
        }
        #else
        value = PyImport_GetModule(full_name);
        #endif
      modbad:
        Py_XDECREF(full_name);
        Py_XDECREF(module_dot);
        Py_XDECREF(module_name);
    }
    if (unlikely(!value)) {
        PyErr_Format(PyExc_ImportError, "cannot import name %S", name);
    }
    return value;
}

/* ListPack */
static PyObject *__Pyx_PyList_Pack(Py_ssize_t n, ...) {
    va_list va;
    PyObject *l = PyList_New(n);
    va_start(va, n);
    if (unlikely(!l)) goto end;
    for (Py_ssize_t i=0; i<n; ++i) {
        PyObject *arg = va_arg(va, PyObject*);
        Py_INCREF(arg);
        if (__Pyx_PyList_SET_ITEM(l, i, arg) != (0)) {
            Py_CLEAR(l);
            goto end;
        }
    }
    end:
    va_end(va);
    return l;
}

/* CalculateMetaclass (used by Py3ClassCreate) */
static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
    Py_ssize_t i, nbases;
#if CYTHON_ASSUME_SAFE_SIZE
    nbases = PyTuple_GET_SIZE(bases);
#else
    nbases = PyTuple_Size(bases);
    if (nbases < 0) return NULL;
#endif
    for (i=0; i < nbases; i++) {
        PyTypeObject *tmptype;
#if CYTHON_ASSUME_SAFE_MACROS
        PyObject *tmp = PyTuple_GET_ITEM(bases, i);
#else
        PyObject *tmp = PyTuple_GetItem(bases, i);
        if (!tmp) return NULL;
#endif
        tmptype = Py_TYPE(tmp);
        if (!metaclass) {
            metaclass = tmptype;
            continue;
        }
        if (PyType_IsSubtype(metaclass, tmptype))
            continue;
        if (PyType_IsSubtype(tmptype, metaclass)) {
            metaclass = tmptype;
            continue;
        }
        PyErr_SetString(PyExc_TypeError,
                        "metaclass conflict: "
                        "the metaclass of a derived class "
                        "must be a (non-strict) subclass "
                        "of the metaclasses of all its bases");
        return NULL;
    }
    if (!metaclass) {
        metaclass = &PyType_Type;
    }
    Py_INCREF((PyObject*) metaclass);
    return (PyObject*) metaclass;
}

/* PyObjectLookupSpecial (used by Py3ClassCreate) */
#if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error) {
    PyObject *res;
    PyTypeObject *tp = Py_TYPE(obj);
    res = _PyType_Lookup(tp, attr_name);
    if (likely(res)) {
        descrgetfunc f = Py_TYPE(res)->tp_descr_get;
        if (!f) {
            Py_INCREF(res);
        } else {
            res = f(res, obj, (PyObject *)tp);
        }
    } else if (with_error) {
        PyErr_SetObject(PyExc_AttributeError, attr_name);
    }
    return res;
}
#endif

/* Py3ClassCreate */
static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
                                           PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
    PyObject *ns;
    if (metaclass) {
        PyObject *prep = __Pyx_PyObject_GetAttrStrNoError(metaclass, __pyx_mstate_global->__pyx_n_u_prepare);
        if (prep) {
            PyObject *pargs[3] = {NULL, name, bases};
            ns = __Pyx_PyObject_FastCallDict(prep, pargs+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, mkw);
            Py_DECREF(prep);
        } else {
            if (unlikely(PyErr_Occurred()))
                return NULL;
            ns = PyDict_New();
        }
    } else {
        ns = PyDict_New();
    }
    if (unlikely(!ns))
        return NULL;
    if (unlikely(PyObject_SetItem(ns, __pyx_mstate_global->__pyx_n_u_module, modname) < 0)) goto bad;
    if (unlikely(PyObject_SetItem(ns, __pyx_mstate_global->__pyx_n_u_qualname, qualname) < 0)) goto bad;
    if (unlikely(doc && PyObject_SetItem(ns, __pyx_mstate_global->__pyx_n_u_doc, doc) < 0)) goto bad;
    return ns;
bad:
    Py_DECREF(ns);
    return NULL;
}
static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
                                      PyObject *dict, PyObject *mkw,
                                      int calculate_metaclass, int allow_py2_metaclass) {
    PyObject *result;
    PyObject *owned_metaclass = NULL;
    PyObject *margs[4] = {NULL, name, bases, dict};
    if (allow_py2_metaclass) {
        owned_metaclass = PyObject_GetItem(dict, __pyx_mstate_global->__pyx_n_u_metaclass);
        if (owned_metaclass) {
            metaclass = owned_metaclass;
        } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
            PyErr_Clear();
        } else {
            return NULL;
        }
    }
    if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
        metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
        Py_XDECREF(owned_metaclass);
        if (unlikely(!metaclass))
            return NULL;
        owned_metaclass = metaclass;
    }
    result = __Pyx_PyObject_FastCallDict(metaclass, margs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, mkw);
    Py_XDECREF(owned_metaclass);
    return result;
}

/* Py3UpdateBases */
static PyObject*
__Pyx_PEP560_update_bases(PyObject *bases)
{
    Py_ssize_t i, j, size_bases;
    PyObject *base = NULL, *meth, *new_base, *result, *new_bases = NULL;
#if CYTHON_ASSUME_SAFE_SIZE
    size_bases = PyTuple_GET_SIZE(bases);
#else
    size_bases = PyTuple_Size(bases);
    if (size_bases < 0) return NULL;
#endif
    for (i = 0; i < size_bases; i++) {
#if CYTHON_AVOID_BORROWED_REFS
        Py_CLEAR(base);
#endif
#if CYTHON_ASSUME_SAFE_MACROS
        base = PyTuple_GET_ITEM(bases, i);
#else
        base = PyTuple_GetItem(bases, i);
        if (!base) goto error;
#endif
#if CYTHON_AVOID_BORROWED_REFS
        Py_INCREF(base);
#endif
        if (PyType_Check(base)) {
            if (new_bases) {
                if (PyList_Append(new_bases, base) < 0) {
                    goto error;
                }
            }
            continue;
        }
        meth = __Pyx_PyObject_GetAttrStrNoError(base, __pyx_mstate_global->__pyx_n_u_mro_entries);
        if (!meth && PyErr_Occurred()) {
            goto error;
        }
        if (!meth) {
            if (new_bases) {
                if (PyList_Append(new_bases, base) < 0) {
                    goto error;
                }
            }
            continue;
        }
        new_base = __Pyx_PyObject_CallOneArg(meth, bases);
        Py_DECREF(meth);
        if (!new_base) {
            goto error;
        }
        if (!PyTuple_Check(new_base)) {
            PyErr_SetString(PyExc_TypeError,
                            "__mro_entries__ must return a tuple");
            Py_DECREF(new_base);
            goto error;
        }
        if (!new_bases) {
            if (!(new_bases = PyList_New(i))) {
                goto error;
            }
            for (j = 0; j < i; j++) {
                PyObject *base_from_list;
#if CYTHON_ASSUME_SAFE_MACROS
                base_from_list = PyTuple_GET_ITEM(bases, j);
                PyList_SET_ITEM(new_bases, j, base_from_list);
                Py_INCREF(base_from_list);
#else
                base_from_list = PyTuple_GetItem(bases, j);
                if (!base_from_list) goto error;
                Py_INCREF(base_from_list);
                if (PyList_SetItem(new_bases, j, base_from_list) < 0) goto error;
#endif
            }
        }
#if CYTHON_ASSUME_SAFE_SIZE
        j = PyList_GET_SIZE(new_bases);
#else
        j = PyList_Size(new_bases);
        if (j < 0) goto error;
#endif
        if (PyList_SetSlice(new_bases, j, j, new_base) < 0) {
            goto error;
        }
        Py_DECREF(new_base);
    }
    if (!new_bases) {
        Py_INCREF(bases);
        return bases;
    }
    result = PyList_AsTuple(new_bases);
    Py_DECREF(new_bases);
#if CYTHON_AVOID_BORROWED_REFS
    Py_XDECREF(base);
#endif
    return result;
error:
    Py_XDECREF(new_bases);
#if CYTHON_AVOID_BORROWED_REFS
    Py_XDECREF(base);
#endif
    return NULL;
}

/* CyFunctionClassCell */
static int __Pyx_CyFunction_InitClassCell(PyObject *cyfunctions, PyObject *classobj) {
    Py_ssize_t i, count = __Pyx_PyList_GET_SIZE(cyfunctions);
    #if !CYTHON_ASSUME_SAFE_SIZE
    if (unlikely(count < 0)) return -1;
    #endif
    for (i = 0; i < count; i++) {
        __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *)
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && !CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
            PyList_GET_ITEM(cyfunctions, i);
#else
            __Pyx_PySequence_ITEM(cyfunctions, i);
        if (unlikely(!m))
            return -1;
#endif
        __Pyx_CyFunction_SetClassObj(m, classobj);
#if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && !CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS)
        Py_DECREF((PyObject*)m);
#endif
    }
    return 0;
}

/* CLineInTraceback (used by AddTraceback) */
#if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
#define __Pyx_PyProbablyModule_GetDict(o) __Pyx_XNewRef(PyModule_GetDict(o))
#elif !CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
#define __Pyx_PyProbablyModule_GetDict(o) PyObject_GenericGetDict(o, NULL);
#else
PyObject* __Pyx_PyProbablyModule_GetDict(PyObject *o) {
    PyObject **dict_ptr = _PyObject_GetDictPtr(o);
    return dict_ptr ? __Pyx_XNewRef(*dict_ptr) : NULL;
}
#endif
static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) {
    PyObject *use_cline = NULL;
    PyObject *ptype, *pvalue, *ptraceback;
    PyObject *cython_runtime_dict;
    CYTHON_MAYBE_UNUSED_VAR(tstate);
    if (unlikely(!__pyx_mstate_global->__pyx_cython_runtime)) {
        return c_line;
    }
    __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
    cython_runtime_dict = __Pyx_PyProbablyModule_GetDict(__pyx_mstate_global->__pyx_cython_runtime);
    if (likely(cython_runtime_dict)) {
        __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
            use_cline, cython_runtime_dict,
            __Pyx_PyDict_SetDefault(cython_runtime_dict, __pyx_mstate_global->__pyx_n_u_cline_in_traceback, Py_False))
    }
    if (use_cline == NULL || use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
        c_line = 0;
    }
    Py_XDECREF(use_cline);
    Py_XDECREF(cython_runtime_dict);
    __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
    return c_line;
}
#endif

/* CodeObjectCache (used by AddTraceback) */
static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
    int start = 0, mid = 0, end = count - 1;
    if (end >= 0 && code_line > entries[end].code_line) {
        return count;
    }
    while (start < end) {
        mid = start + (end - start) / 2;
        if (code_line < entries[mid].code_line) {
            end = mid;
        } else if (code_line > entries[mid].code_line) {
             start = mid + 1;
        } else {
            return mid;
        }
    }
    if (code_line <= entries[mid].code_line) {
        return mid;
    } else {
        return mid + 1;
    }
}
static __Pyx_CachedCodeObjectType *__pyx__find_code_object(struct __Pyx_CodeObjectCache *code_cache, int code_line) {
    __Pyx_CachedCodeObjectType* code_object;
    int pos;
    if (unlikely(!code_line) || unlikely(!code_cache->entries)) {
        return NULL;
    }
    pos = __pyx_bisect_code_objects(code_cache->entries, code_cache->count, code_line);
    if (unlikely(pos >= code_cache->count) || unlikely(code_cache->entries[pos].code_line != code_line)) {
        return NULL;
    }
    code_object = code_cache->entries[pos].code_object;
    Py_INCREF(code_object);
    return code_object;
}
static __Pyx_CachedCodeObjectType *__pyx_find_code_object(int code_line) {
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && !CYTHON_ATOMICS
    (void)__pyx__find_code_object;
    return NULL; // Most implementation should have atomics. But otherwise, don't make it thread-safe, just miss.
#else
    struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache;
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    __pyx_nonatomic_int_type old_count = __pyx_atomic_incr_acq_rel(&code_cache->accessor_count);
    if (old_count < 0) {
        __pyx_atomic_decr_acq_rel(&code_cache->accessor_count);
        return NULL;
    }
#endif
    __Pyx_CachedCodeObjectType *result = __pyx__find_code_object(code_cache, code_line);
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    __pyx_atomic_decr_acq_rel(&code_cache->accessor_count);
#endif
    return result;
#endif
}
static void __pyx__insert_code_object(struct __Pyx_CodeObjectCache *code_cache, int code_line, __Pyx_CachedCodeObjectType* code_object)
{
    int pos, i;
    __Pyx_CodeObjectCacheEntry* entries = code_cache->entries;
    if (unlikely(!code_line)) {
        return;
    }
    if (unlikely(!entries)) {
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
        if (likely(entries)) {
            code_cache->entries = entries;
            code_cache->max_count = 64;
            code_cache->count = 1;
            entries[0].code_line = code_line;
            entries[0].code_object = code_object;
            Py_INCREF(code_object);
        }
        return;
    }
    pos = __pyx_bisect_code_objects(code_cache->entries, code_cache->count, code_line);
    if ((pos < code_cache->count) && unlikely(code_cache->entries[pos].code_line == code_line)) {
        __Pyx_CachedCodeObjectType* tmp = entries[pos].code_object;
        entries[pos].code_object = code_object;
        Py_INCREF(code_object);
        Py_DECREF(tmp);
        return;
    }
    if (code_cache->count == code_cache->max_count) {
        int new_max = code_cache->max_count + 64;
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
            code_cache->entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
        if (unlikely(!entries)) {
            return;
        }
        code_cache->entries = entries;
        code_cache->max_count = new_max;
    }
    for (i=code_cache->count; i>pos; i--) {
        entries[i] = entries[i-1];
    }
    entries[pos].code_line = code_line;
    entries[pos].code_object = code_object;
    code_cache->count++;
    Py_INCREF(code_object);
}
static void __pyx_insert_code_object(int code_line, __Pyx_CachedCodeObjectType* code_object) {
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && !CYTHON_ATOMICS
    (void)__pyx__insert_code_object;
    return; // Most implementation should have atomics. But otherwise, don't make it thread-safe, just fail.
#else
    struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache;
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    __pyx_nonatomic_int_type expected = 0;
    if (!__pyx_atomic_int_cmp_exchange(&code_cache->accessor_count, &expected, INT_MIN)) {
        return;
    }
#endif
    __pyx__insert_code_object(code_cache, code_line, code_object);
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    __pyx_atomic_sub(&code_cache->accessor_count, INT_MIN);
#endif
#endif
}

/* AddTraceback */
#include "compile.h"
#include "frameobject.h"
#include "traceback.h"
#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION)
  #ifndef Py_BUILD_CORE
    #define Py_BUILD_CORE 1
  #endif
  #include "internal/pycore_frame.h"
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict,
                                                       PyObject *firstlineno, PyObject *name) {
    PyObject *replace = NULL;
    if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL;
    if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL;
    replace = PyObject_GetAttrString(code, "replace");
    if (likely(replace)) {
        PyObject *result = PyObject_Call(replace, __pyx_mstate_global->__pyx_empty_tuple, scratch_dict);
        Py_DECREF(replace);
        return result;
    }
    PyErr_Clear();
    return NULL;
}
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename) {
    PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL;
    PyObject *replace = NULL, *getframe = NULL, *frame = NULL;
    PyObject *exc_type, *exc_value, *exc_traceback;
    int success = 0;
    if (c_line) {
        c_line = __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line);
    }
    PyErr_Fetch(&exc_type, &exc_value, &exc_traceback);
    code_object = __pyx_find_code_object(c_line ? -c_line : py_line);
    if (!code_object) {
        code_object = Py_CompileString("_getframe()", filename, Py_eval_input);
        if (unlikely(!code_object)) goto bad;
        py_py_line = PyLong_FromLong(py_line);
        if (unlikely(!py_py_line)) goto bad;
        if (c_line) {
            py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        } else {
            py_funcname = PyUnicode_FromString(funcname);
        }
        if (unlikely(!py_funcname)) goto bad;
        dict = PyDict_New();
        if (unlikely(!dict)) goto bad;
        {
            PyObject *old_code_object = code_object;
            code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname);
            Py_DECREF(old_code_object);
        }
        if (unlikely(!code_object)) goto bad;
        __pyx_insert_code_object(c_line ? -c_line : py_line, code_object);
    } else {
        dict = PyDict_New();
    }
    getframe = PySys_GetObject("_getframe");
    if (unlikely(!getframe)) goto bad;
    if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad;
    frame = PyEval_EvalCode(code_object, dict, dict);
    if (unlikely(!frame) || frame == Py_None) goto bad;
    success = 1;
  bad:
    PyErr_Restore(exc_type, exc_value, exc_traceback);
    Py_XDECREF(code_object);
    Py_XDECREF(py_py_line);
    Py_XDECREF(py_funcname);
    Py_XDECREF(dict);
    Py_XDECREF(replace);
    if (success) {
        PyTraceBack_Here(
            (struct _frame*)frame);
    }
    Py_XDECREF(frame);
}
#else
static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
            const char *funcname, int c_line,
            int py_line, const char *filename) {
    PyCodeObject *py_code = NULL;
    PyObject *py_funcname = NULL;
    if (c_line) {
        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        if (!py_funcname) goto bad;
        funcname = PyUnicode_AsUTF8(py_funcname);
        if (!funcname) goto bad;
    }
    py_code = PyCode_NewEmpty(filename, funcname, py_line);
    Py_XDECREF(py_funcname);
    return py_code;
bad:
    Py_XDECREF(py_funcname);
    return NULL;
}
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyFrameObject *py_frame = 0;
    PyThreadState *tstate = __Pyx_PyThreadState_Current;
    PyObject *ptype, *pvalue, *ptraceback;
    if (c_line) {
        c_line = __Pyx_CLineForTraceback(tstate, c_line);
    }
    py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
    if (!py_code) {
        __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
        py_code = __Pyx_CreateCodeObjectForTraceback(
            funcname, c_line, py_line, filename);
        if (!py_code) {
            /* If the code object creation fails, then we should clear the
               fetched exception references and propagate the new exception */
            Py_XDECREF(ptype);
            Py_XDECREF(pvalue);
            Py_XDECREF(ptraceback);
            goto bad;
        }
        __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
        __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
    }
    py_frame = PyFrame_New(
        tstate,            /*PyThreadState *tstate,*/
        py_code,           /*PyCodeObject *code,*/
        __pyx_mstate_global->__pyx_d,    /*PyObject *globals,*/
        0                  /*PyObject *locals*/
    );
    if (!py_frame) goto bad;
    __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
    PyTraceBack_Here(py_frame);
bad:
    Py_XDECREF(py_code);
    Py_XDECREF(py_frame);
}
#endif

/* MemviewRefcount */
#include <stdio.h>
#ifndef _Py_NO_RETURN
#define _Py_NO_RETURN
#endif
_Py_NO_RETURN
static void __pyx_fatalerror(const char *fmt, ...) {
    va_list vargs;
    char msg[200];
#if PY_VERSION_HEX >= 0x030A0000 || defined(HAVE_STDARG_PROTOTYPES)
    va_start(vargs, fmt);
#else
    va_start(vargs);
#endif
    vsnprintf(msg, 200, fmt, vargs);
    va_end(vargs);
    Py_FatalError(msg);
}
static CYTHON_INLINE int
__pyx_add_acquisition_count_locked(__pyx_atomic_int_type *acquisition_count,
                                   PyThread_type_lock lock)
{
    int result;
    PyThread_acquire_lock(lock, 1);
    result = (*acquisition_count)++;
    PyThread_release_lock(lock);
    return result;
}
static CYTHON_INLINE int
__pyx_sub_acquisition_count_locked(__pyx_atomic_int_type *acquisition_count,
                                   PyThread_type_lock lock)
{
    int result;
    PyThread_acquire_lock(lock, 1);
    result = (*acquisition_count)--;
    PyThread_release_lock(lock);
    return result;
}
static CYTHON_INLINE void
__Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno)
{
    __pyx_nonatomic_int_type old_acquisition_count;
    struct __pyx_memoryview_obj *memview = memslice->memview;
    if (unlikely(!memview || (PyObject *) memview == Py_None)) {
        return;
    }
    old_acquisition_count = __pyx_add_acquisition_count(memview);
    if (unlikely(old_acquisition_count <= 0)) {
        if (likely(old_acquisition_count == 0)) {
            if (have_gil) {
                Py_INCREF((PyObject *) memview);
            } else {
                PyGILState_STATE _gilstate = PyGILState_Ensure();
                Py_INCREF((PyObject *) memview);
                PyGILState_Release(_gilstate);
            }
        } else {
            __pyx_fatalerror("Acquisition count is %d (line %d)",
                             old_acquisition_count+1, lineno);
        }
    }
}
static CYTHON_INLINE void __Pyx_XCLEAR_MEMVIEW(__Pyx_memviewslice *memslice,
                                             int have_gil, int lineno) {
    __pyx_nonatomic_int_type old_acquisition_count;
    struct __pyx_memoryview_obj *memview = memslice->memview;
    if (unlikely(!memview || (PyObject *) memview == Py_None)) {
        memslice->memview = NULL;
        return;
    }
    old_acquisition_count = __pyx_sub_acquisition_count(memview);
    memslice->data = NULL;
    if (likely(old_acquisition_count > 1)) {
        memslice->memview = NULL;
    } else if (likely(old_acquisition_count == 1)) {
        if (have_gil) {
            Py_CLEAR(memslice->memview);
        } else {
            PyGILState_STATE _gilstate = PyGILState_Ensure();
            Py_CLEAR(memslice->memview);
            PyGILState_Release(_gilstate);
        }
    } else {
        __pyx_fatalerror("Acquisition count is %d (line %d)",
                         old_acquisition_count-1, lineno);
    }
}

/* MemviewSliceIsContig */
static int
__pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim)
{
    int i, index, step, start;
    Py_ssize_t itemsize = mvs.memview->view.itemsize;
    if (order == 'F') {
        step = 1;
        start = 0;
    } else {
        step = -1;
        start = ndim - 1;
    }
    for (i = 0; i < ndim; i++) {
        index = start + step * i;
        if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
            return 0;
        itemsize *= mvs.shape[index];
    }
    return 1;
}

/* OverlappingSlices */
static void
__pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
                               void **out_start, void **out_end,
                               int ndim, size_t itemsize)
{
    char *start, *end;
    int i;
    start = end = slice->data;
    for (i = 0; i < ndim; i++) {
        Py_ssize_t stride = slice->strides[i];
        Py_ssize_t extent = slice->shape[i];
        if (extent == 0) {
            *out_start = *out_end = start;
            return;
        } else {
            if (stride > 0)
                end += stride * (extent - 1);
            else
                start += stride * (extent - 1);
        }
    }
    *out_start = start;
    *out_end = end + itemsize;
}
static int
__pyx_slices_overlap(__Pyx_memviewslice *slice1,
                     __Pyx_memviewslice *slice2,
                     int ndim, size_t itemsize)
{
    void *start1, *end1, *start2, *end2;
    __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
    __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
    return (start1 < end2) && (start2 < end1);
}

/* MemviewSliceInit */
static int
__Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview,
                        int ndim,
                        __Pyx_memviewslice *memviewslice,
                        int memview_is_new_reference)
{
    __Pyx_RefNannyDeclarations
    int i, retval=-1;
    Py_buffer *buf = &memview->view;
    __Pyx_RefNannySetupContext("init_memviewslice", 0);
    if (unlikely(memviewslice->memview || memviewslice->data)) {
        PyErr_SetString(PyExc_ValueError,
            "memviewslice is already initialized!");
        goto fail;
    }
    if (buf->strides) {
        for (i = 0; i < ndim; i++) {
            memviewslice->strides[i] = buf->strides[i];
        }
    } else {
        Py_ssize_t stride = buf->itemsize;
        for (i = ndim - 1; i >= 0; i--) {
            memviewslice->strides[i] = stride;
            stride *= buf->shape[i];
        }
    }
    for (i = 0; i < ndim; i++) {
        memviewslice->shape[i]   = buf->shape[i];
        if (buf->suboffsets) {
            memviewslice->suboffsets[i] = buf->suboffsets[i];
        } else {
            memviewslice->suboffsets[i] = -1;
        }
    }
    memviewslice->memview = memview;
    memviewslice->data = (char *)buf->buf;
    if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
        Py_INCREF((PyObject*)memview);
    }
    retval = 0;
    goto no_fail;
fail:
    memviewslice->memview = 0;
    memviewslice->data = 0;
    retval = -1;
no_fail:
    __Pyx_RefNannyFinishContext();
    return retval;
}

/* SliceMemoryviewSlice */
static void __pyx_memoryview_slice_memviewslice_err_dim(PyObject *error, const char* msg, int dim) {
    PyGILState_STATE gilstate = PyGILState_Ensure();
    PyErr_Format(error, msg, dim);
    PyGILState_Release(gilstate);
}
static CYTHON_INLINE int __pyx_memoryview_slice_memviewslice(
        __Pyx_memviewslice *dst,
        Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
        int dim, int new_ndim, int *suboffset_dim,
        Py_ssize_t start, Py_ssize_t stop, Py_ssize_t step,
        int have_start, int have_stop, int have_step,
        int is_slice) {
    if (!is_slice) {
        if (start < 0) {
            start += shape;
        }
        if (unlikely(!(0 <= start && start < shape))) {
            __pyx_memoryview_slice_memviewslice_err_dim(PyExc_IndexError, "Index out of bounds (axis %d)", dim);
            return -1;
        }
    } else {
        int negative_step;
        if (have_step) {
            negative_step = step < 0;
            if (unlikely(step == 0)) {
                __pyx_memoryview_slice_memviewslice_err_dim(PyExc_ValueError, "Step may not be zero (axis %d)", dim);
                return -1;
            }
        } else {
            negative_step = 0;
            step = 1;
        }
        if (have_start) {
            if (start < 0) {
                start += shape;
                if (start < 0) {
                    start = 0;
                }
            } else if (start >= shape) {
                start = negative_step ? (shape - 1) : shape;
            }
        } else {
            start = negative_step ? (shape - 1) : 0;
        }
        if (have_stop) {
            if (stop < 0) {
                stop += shape;
                if (stop < 0) {
                    stop = 0;
                }
            } else if (stop > shape) {
                stop = shape;
            }
        } else {
            stop = negative_step ? -1 : shape;
        }
        Py_ssize_t new_shape = (stop - start) / step;
        if ((stop - start) - step * new_shape) {
            ++new_shape;
        }
        if (new_shape < 0) {
            new_shape = 0;
        }
        dst->strides[new_ndim] = stride * step;
        dst->shape[new_ndim] = new_shape;
        dst->suboffsets[new_ndim] = suboffset;
    }
    if (suboffset_dim[0] < 0) {
        dst->data += start * stride;
    } else {
        dst->suboffsets[suboffset_dim[0]] += start * stride;
    }
    if (suboffset >= 0) {
        if (!is_slice) {
            if (likely(new_ndim == 0)) {
                dst->data = ((char **)(dst->data))[0] + suboffset;
            } else {
                __pyx_memoryview_slice_memviewslice_err_dim(
                    PyExc_IndexError,
                    "All dimensions preceding dimension %d must be indexed and not sliced",
                    dim);
                return -1;
            }
        } else {
            suboffset_dim[0] = new_ndim;
        }
    }
    return 0;
}

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

/* IsLittleEndian (used by BufferFormatCheck) */
static CYTHON_INLINE int __Pyx_Is_Little_Endian(void)
{
  union {
    uint32_t u32;
    uint8_t u8[4];
  } S;
  S.u32 = 0x01020304;
  return S.u8[0] == 4;
}

/* BufferFormatCheck (used by MemviewSliceValidateAndInit) */
static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
                              __Pyx_BufFmt_StackElem* stack,
                              const __Pyx_TypeInfo* type) {
  stack[0].field = &ctx->root;
  stack[0].parent_offset = 0;
  ctx->root.type = type;
  ctx->root.name = "buffer dtype";
  ctx->root.offset = 0;
  ctx->head = stack;
  ctx->head->field = &ctx->root;
  ctx->fmt_offset = 0;
  ctx->head->parent_offset = 0;
  ctx->new_packmode = '@';
  ctx->enc_packmode = '@';
  ctx->new_count = 1;
  ctx->enc_count = 0;
  ctx->enc_type = 0;
  ctx->is_complex = 0;
  ctx->is_valid_array = 0;
  ctx->struct_alignment = 0;
  while (type->typegroup == 'S') {
    ++ctx->head;
    ctx->head->field = type->fields;
    ctx->head->parent_offset = 0;
    type = type->fields->type;
  }
}
static int __Pyx_BufFmt_ParseNumber(const char** ts) {
    int count;
    const char* t = *ts;
    if (*t < '0' || *t > '9') {
      return -1;
    } else {
        count = *t++ - '0';
        while (*t >= '0' && *t <= '9') {
            count *= 10;
            count += *t++ - '0';
        }
    }
    *ts = t;
    return count;
}
static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
    int number = __Pyx_BufFmt_ParseNumber(ts);
    if (number == -1)
        PyErr_Format(PyExc_ValueError,\
                     "Does not understand character buffer dtype format string ('%c')", **ts);
    return number;
}
static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) {
  PyErr_Format(PyExc_ValueError,
               "Unexpected format string character: '%c'", ch);
}
static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) {
  switch (ch) {
    case '?': return "'bool'";
    case 'c': return "'char'";
    case 'b': return "'signed char'";
    case 'B': return "'unsigned char'";
    case 'h': return "'short'";
    case 'H': return "'unsigned short'";
    case 'i': return "'int'";
    case 'I': return "'unsigned int'";
    case 'l': return "'long'";
    case 'L': return "'unsigned long'";
    case 'q': return "'long long'";
    case 'Q': return "'unsigned long long'";
    case 'f': return (is_complex ? "'complex float'" : "'float'");
    case 'd': return (is_complex ? "'complex double'" : "'double'");
    case 'g': return (is_complex ? "'complex long double'" : "'long double'");
    case 'T': return "a struct";
    case 'O': return "Python object";
    case 'P': return "a pointer";
    case 's': case 'p': return "a string";
    case 0: return "end";
    default: return "unparsable format string";
  }
}
static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) {
  switch (ch) {
    case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
    case 'h': case 'H': return 2;
    case 'i': case 'I': case 'l': case 'L': return 4;
    case 'q': case 'Q': return 8;
    case 'f': return (is_complex ? 8 : 4);
    case 'd': return (is_complex ? 16 : 8);
    case 'g': {
      PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g')..");
      return 0;
    }
    case 'O': case 'P': return sizeof(void*);
    default:
      __Pyx_BufFmt_RaiseUnexpectedChar(ch);
      return 0;
    }
}
static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) {
  switch (ch) {
    case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
    case 'h': case 'H': return sizeof(short);
    case 'i': case 'I': return sizeof(int);
    case 'l': case 'L': return sizeof(long);
    case 'q': case 'Q': return sizeof(PY_LONG_LONG);
    case 'f': return sizeof(float) * (is_complex ? 2 : 1);
    case 'd': return sizeof(double) * (is_complex ? 2 : 1);
    case 'g': return sizeof(long double) * (is_complex ? 2 : 1);
    case 'O': case 'P': return sizeof(void*);
    default: {
      __Pyx_BufFmt_RaiseUnexpectedChar(ch);
      return 0;
    }
  }
}
typedef struct { char c; short x; } __Pyx_st_short;
typedef struct { char c; int x; } __Pyx_st_int;
typedef struct { char c; long x; } __Pyx_st_long;
typedef struct { char c; float x; } __Pyx_st_float;
typedef struct { char c; double x; } __Pyx_st_double;
typedef struct { char c; long double x; } __Pyx_st_longdouble;
typedef struct { char c; void *x; } __Pyx_st_void_p;
typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong;
static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, int is_complex) {
  CYTHON_UNUSED_VAR(is_complex);
  switch (ch) {
    case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
    case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short);
    case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int);
    case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long);
    case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG);
    case 'f': return sizeof(__Pyx_st_float) - sizeof(float);
    case 'd': return sizeof(__Pyx_st_double) - sizeof(double);
    case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double);
    case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*);
    default:
      __Pyx_BufFmt_RaiseUnexpectedChar(ch);
      return 0;
    }
}
/* These are for computing the padding at the end of the struct to align
   on the first member of the struct. This will probably the same as above,
   but we don't have any guarantees.
 */
typedef struct { short x; char c; } __Pyx_pad_short;
typedef struct { int x; char c; } __Pyx_pad_int;
typedef struct { long x; char c; } __Pyx_pad_long;
typedef struct { float x; char c; } __Pyx_pad_float;
typedef struct { double x; char c; } __Pyx_pad_double;
typedef struct { long double x; char c; } __Pyx_pad_longdouble;
typedef struct { void *x; char c; } __Pyx_pad_void_p;
typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong;
static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, int is_complex) {
  CYTHON_UNUSED_VAR(is_complex);
  switch (ch) {
    case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
    case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short);
    case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int);
    case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long);
    case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG);
    case 'f': return sizeof(__Pyx_pad_float) - sizeof(float);
    case 'd': return sizeof(__Pyx_pad_double) - sizeof(double);
    case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double);
    case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*);
    default:
      __Pyx_BufFmt_RaiseUnexpectedChar(ch);
      return 0;
    }
}
static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) {
  switch (ch) {
    case 'c':
        return 'H';
    case 'b': case 'h': case 'i':
    case 'l': case 'q': case 's': case 'p':
        return 'I';
    case '?': case 'B': case 'H': case 'I': case 'L': case 'Q':
        return 'U';
    case 'f': case 'd': case 'g':
        return (is_complex ? 'C' : 'R');
    case 'O':
        return 'O';
    case 'P':
        return 'P';
    default: {
      __Pyx_BufFmt_RaiseUnexpectedChar(ch);
      return 0;
    }
  }
}
static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
  if (ctx->head == NULL || ctx->head->field == &ctx->root) {
    const char* expected;
    const char* quote;
    if (ctx->head == NULL) {
      expected = "end";
      quote = "";
    } else {
      expected = ctx->head->field->type->name;
      quote = "'";
    }
    PyErr_Format(PyExc_ValueError,
                 "Buffer dtype mismatch, expected %s%s%s but got %s",
                 quote, expected, quote,
                 __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
  } else {
    const __Pyx_StructField* field = ctx->head->field;
    const __Pyx_StructField* parent = (ctx->head - 1)->field;
    PyErr_Format(PyExc_ValueError,
                 "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
                 field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
                 parent->type->name, field->name);
  }
}
static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
  char group;
  size_t size, offset, arraysize = 1;
  if (ctx->enc_type == 0) return 0;
  if (ctx->head->field->type->arraysize[0]) {
    int i, ndim = 0;
    if (ctx->enc_type == 's' || ctx->enc_type == 'p') {
        ctx->is_valid_array = ctx->head->field->type->ndim == 1;
        ndim = 1;
        if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
            PyErr_Format(PyExc_ValueError,
                         "Expected a dimension of size %zu, got %zu",
                         ctx->head->field->type->arraysize[0], ctx->enc_count);
            return -1;
        }
    }
    if (!ctx->is_valid_array) {
      PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d",
                   ctx->head->field->type->ndim, ndim);
      return -1;
    }
    for (i = 0; i < ctx->head->field->type->ndim; i++) {
      arraysize *= ctx->head->field->type->arraysize[i];
    }
    ctx->is_valid_array = 0;
    ctx->enc_count = 1;
  }
  group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
  do {
    const __Pyx_StructField* field = ctx->head->field;
    const __Pyx_TypeInfo* type = field->type;
    if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') {
      size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
    } else {
      size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
    }
    if (ctx->enc_packmode == '@') {
      size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
      size_t align_mod_offset;
      if (align_at == 0) return -1;
      align_mod_offset = ctx->fmt_offset % align_at;
      if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
      if (ctx->struct_alignment == 0)
          ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
                                                                 ctx->is_complex);
    }
    if (type->size != size || type->typegroup != group) {
      if (type->typegroup == 'C' && type->fields != NULL) {
        size_t parent_offset = ctx->head->parent_offset + field->offset;
        ++ctx->head;
        ctx->head->field = type->fields;
        ctx->head->parent_offset = parent_offset;
        continue;
      }
      if ((type->typegroup == 'H' || group == 'H') && type->size == size) {
      } else {
          __Pyx_BufFmt_RaiseExpected(ctx);
          return -1;
      }
    }
    offset = ctx->head->parent_offset + field->offset;
    if (ctx->fmt_offset != offset) {
      PyErr_Format(PyExc_ValueError,
                   "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected",
                   (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
      return -1;
    }
    ctx->fmt_offset += size;
    if (arraysize)
      ctx->fmt_offset += (arraysize - 1) * size;
    --ctx->enc_count;
    while (1) {
      if (field == &ctx->root) {
        ctx->head = NULL;
        if (ctx->enc_count != 0) {
          __Pyx_BufFmt_RaiseExpected(ctx);
          return -1;
        }
        break;
      }
      ctx->head->field = ++field;
      if (field->type == NULL) {
        --ctx->head;
        field = ctx->head->field;
        continue;
      } else if (field->type->typegroup == 'S') {
        size_t parent_offset = ctx->head->parent_offset + field->offset;
        if (field->type->fields->type == NULL) continue;
        field = field->type->fields;
        ++ctx->head;
        ctx->head->field = field;
        ctx->head->parent_offset = parent_offset;
        break;
      } else {
        break;
      }
    }
  } while (ctx->enc_count);
  ctx->enc_type = 0;
  ctx->is_complex = 0;
  return 0;
}
static int
__pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
{
    const char *ts = *tsp;
    int i = 0, number, ndim;
    ++ts;
    if (ctx->new_count != 1) {
        PyErr_SetString(PyExc_ValueError,
                        "Cannot handle repeated arrays in format string");
        return -1;
    }
    if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return -1;
    ndim = ctx->head->field->type->ndim;
    while (*ts && *ts != ')') {
        switch (*ts) {
            case ' ': case '\f': case '\r': case '\n': case '\t': case '\v':  continue;
            default:  break;
        }
        number = __Pyx_BufFmt_ExpectNumber(&ts);
        if (number == -1) return -1;
        if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i]) {
            PyErr_Format(PyExc_ValueError,
                        "Expected a dimension of size %zu, got %d",
                        ctx->head->field->type->arraysize[i], number);
            return -1;
        }
        if (*ts != ',' && *ts != ')') {
            PyErr_Format(PyExc_ValueError,
                                "Expected a comma in format string, got '%c'", *ts);
            return -1;
        }
        if (*ts == ',') ts++;
        i++;
    }
    if (i != ndim) {
        PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d",
                            ctx->head->field->type->ndim, i);
        return -1;
    }
    if (!*ts) {
        PyErr_SetString(PyExc_ValueError,
                        "Unexpected end of format string, expected ')'");
        return -1;
    }
    ctx->is_valid_array = 1;
    ctx->new_count = 1;
    *tsp = ++ts;
    return 0;
}
static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) {
  int got_Z = 0;
  while (1) {
    switch(*ts) {
      case 0:
        if (ctx->enc_type != 0 && ctx->head == NULL) {
          __Pyx_BufFmt_RaiseExpected(ctx);
          return NULL;
        }
        if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
        if (ctx->head != NULL) {
          __Pyx_BufFmt_RaiseExpected(ctx);
          return NULL;
        }
        return ts;
      case ' ':
      case '\r':
      case '\n':
        ++ts;
        break;
      case '<':
        if (!__Pyx_Is_Little_Endian()) {
          PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler");
          return NULL;
        }
        ctx->new_packmode = '=';
        ++ts;
        break;
      case '>':
      case '!':
        if (__Pyx_Is_Little_Endian()) {
          PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler");
          return NULL;
        }
        ctx->new_packmode = '=';
        ++ts;
        break;
      case '=':
      case '@':
      case '^':
        ctx->new_packmode = *ts++;
        break;
      case 'T':
        {
          const char* ts_after_sub;
          size_t i, struct_count = ctx->new_count;
          size_t struct_alignment = ctx->struct_alignment;
          ctx->new_count = 1;
          ++ts;
          if (*ts != '{') {
            PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'");
            return NULL;
          }
          if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
          ctx->enc_type = 0;
          ctx->enc_count = 0;
          ctx->struct_alignment = 0;
          ++ts;
          ts_after_sub = ts;
          for (i = 0; i != struct_count; ++i) {
            ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
            if (!ts_after_sub) return NULL;
          }
          ts = ts_after_sub;
          if (struct_alignment) ctx->struct_alignment = struct_alignment;
        }
        break;
      case '}':
        {
          size_t alignment = ctx->struct_alignment;
          ++ts;
          if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
          ctx->enc_type = 0;
          if (alignment && ctx->fmt_offset % alignment) {
            ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
          }
        }
        return ts;
      case 'x':
        if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
        ctx->fmt_offset += ctx->new_count;
        ctx->new_count = 1;
        ctx->enc_count = 0;
        ctx->enc_type = 0;
        ctx->enc_packmode = ctx->new_packmode;
        ++ts;
        break;
      case 'Z':
        got_Z = 1;
        ++ts;
        if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
          __Pyx_BufFmt_RaiseUnexpectedChar('Z');
          return NULL;
        }
        CYTHON_FALLTHROUGH;
      case '?': case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I':
      case 'l': case 'L': case 'q': case 'Q':
      case 'f': case 'd': case 'g':
      case 'O': case 'p':
        if ((ctx->enc_type == *ts) && (got_Z == ctx->is_complex) &&
            (ctx->enc_packmode == ctx->new_packmode) && (!ctx->is_valid_array)) {
          ctx->enc_count += ctx->new_count;
          ctx->new_count = 1;
          got_Z = 0;
          ++ts;
          break;
        }
        CYTHON_FALLTHROUGH;
      case 's':
        if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
        ctx->enc_count = ctx->new_count;
        ctx->enc_packmode = ctx->new_packmode;
        ctx->enc_type = *ts;
        ctx->is_complex = got_Z;
        ++ts;
        ctx->new_count = 1;
        got_Z = 0;
        break;
      case ':':
        ++ts;
        while(*ts != ':') ++ts;
        ++ts;
        break;
      case '(':
        if (__pyx_buffmt_parse_array(ctx, &ts) < 0) return NULL;
        break;
      default:
        {
          int number = __Pyx_BufFmt_ExpectNumber(&ts);
          if (number == -1) return NULL;
          ctx->new_count = (size_t)number;
        }
    }
  }
}

/* TypeInfoCompare (used by MemviewSliceValidateAndInit) */
  static int
  __pyx_typeinfo_cmp(const __Pyx_TypeInfo *a, const __Pyx_TypeInfo *b)
  {
      int i;
      if (!a || !b)
          return 0;
      if (a == b)
          return 1;
      if (a->size != b->size || a->typegroup != b->typegroup ||
              a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) {
          if (a->typegroup == 'H' || b->typegroup == 'H') {
              return a->size == b->size;
          } else {
              return 0;
          }
      }
      if (a->ndim) {
          for (i = 0; i < a->ndim; i++)
              if (a->arraysize[i] != b->arraysize[i])
                  return 0;
      }
      if (a->typegroup == 'S') {
          if (a->flags != b->flags)
              return 0;
          if (a->fields || b->fields) {
              if (!(a->fields && b->fields))
                  return 0;
              for (i = 0; a->fields[i].type && b->fields[i].type; i++) {
                  const __Pyx_StructField *field_a = a->fields + i;
                  const __Pyx_StructField *field_b = b->fields + i;
                  if (field_a->offset != field_b->offset ||
                      !__pyx_typeinfo_cmp(field_a->type, field_b->type))
                      return 0;
              }
              return !a->fields[i].type && !b->fields[i].type;
          }
      }
      return 1;
  }
  
/* MemviewSliceValidateAndInit (used by ObjectToMemviewSlice) */
  static int
  __pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec)
  {
      if (buf->shape[dim] <= 1)
          return 1;
      if (buf->strides) {
          if (spec & __Pyx_MEMVIEW_CONTIG) {
              if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) {
                  if (unlikely(buf->strides[dim] != sizeof(void *))) {
                      PyErr_Format(PyExc_ValueError,
                                   "Buffer is not indirectly contiguous "
                                   "in dimension %d.", dim);
                      goto fail;
                  }
              } else if (unlikely(buf->strides[dim] != buf->itemsize)) {
                  PyErr_SetString(PyExc_ValueError,
                                  "Buffer and memoryview are not contiguous "
                                  "in the same dimension.");
                  goto fail;
              }
          }
          if (spec & __Pyx_MEMVIEW_FOLLOW) {
              Py_ssize_t stride = buf->strides[dim];
              if (stride < 0)
                  stride = -stride;
              if (unlikely(stride < buf->itemsize)) {
                  PyErr_SetString(PyExc_ValueError,
                                  "Buffer and memoryview are not contiguous "
                                  "in the same dimension.");
                  goto fail;
              }
          }
      } else {
          if (unlikely(spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1)) {
              PyErr_Format(PyExc_ValueError,
                           "C-contiguous buffer is not contiguous in "
                           "dimension %d", dim);
              goto fail;
          } else if (unlikely(spec & (__Pyx_MEMVIEW_PTR))) {
              PyErr_Format(PyExc_ValueError,
                           "C-contiguous buffer is not indirect in "
                           "dimension %d", dim);
              goto fail;
          } else if (unlikely(buf->suboffsets)) {
              PyErr_SetString(PyExc_ValueError,
                              "Buffer exposes suboffsets but no strides");
              goto fail;
          }
      }
      return 1;
  fail:
      return 0;
  }
  static int
  __pyx_check_suboffsets(Py_buffer *buf, int dim, int ndim, int spec)
  {
      CYTHON_UNUSED_VAR(ndim);
      if (spec & __Pyx_MEMVIEW_DIRECT) {
          if (unlikely(buf->suboffsets && buf->suboffsets[dim] >= 0)) {
              PyErr_Format(PyExc_ValueError,
                           "Buffer not compatible with direct access "
                           "in dimension %d.", dim);
              goto fail;
          }
      }
      if (spec & __Pyx_MEMVIEW_PTR) {
          if (unlikely(!buf->suboffsets || (buf->suboffsets[dim] < 0))) {
              PyErr_Format(PyExc_ValueError,
                           "Buffer is not indirectly accessible "
                           "in dimension %d.", dim);
              goto fail;
          }
      }
      return 1;
  fail:
      return 0;
  }
  static int
  __pyx_verify_contig(Py_buffer *buf, int ndim, int c_or_f_flag)
  {
      int i;
      if (c_or_f_flag & __Pyx_IS_F_CONTIG) {
          Py_ssize_t stride = 1;
          for (i = 0; i < ndim; i++) {
              if (unlikely(stride * buf->itemsize != buf->strides[i]  &&  buf->shape[i] > 1)) {
                  PyErr_SetString(PyExc_ValueError,
                      "Buffer not fortran contiguous.");
                  goto fail;
              }
              stride = stride * buf->shape[i];
          }
      } else if (c_or_f_flag & __Pyx_IS_C_CONTIG) {
          Py_ssize_t stride = 1;
          for (i = ndim - 1; i >- 1; i--) {
              if (unlikely(stride * buf->itemsize != buf->strides[i]  &&  buf->shape[i] > 1)) {
                  PyErr_SetString(PyExc_ValueError,
                      "Buffer not C contiguous.");
                  goto fail;
              }
              stride = stride * buf->shape[i];
          }
      }
      return 1;
  fail:
      return 0;
  }
  static int __Pyx_ValidateAndInit_memviewslice(
                  int *axes_specs,
                  int c_or_f_flag,
                  int buf_flags,
                  int ndim,
                  const __Pyx_TypeInfo *dtype,
                  __Pyx_BufFmt_StackElem stack[],
                  __Pyx_memviewslice *memviewslice,
                  PyObject *original_obj)
  {
      struct __pyx_memoryview_obj *memview, *new_memview;
      __Pyx_RefNannyDeclarations
      Py_buffer *buf;
      int i, spec = 0, retval = -1;
      __Pyx_BufFmt_Context ctx;
      int from_memoryview = __pyx_memoryview_check(original_obj);
      __Pyx_RefNannySetupContext("ValidateAndInit_memviewslice", 0);
      if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((struct __pyx_memoryview_obj *)
                                                              original_obj)->typeinfo)) {
          memview = (struct __pyx_memoryview_obj *) original_obj;
          new_memview = NULL;
      } else {
          memview = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
                                              original_obj, buf_flags, 0, dtype);
          new_memview = memview;
          if (unlikely(!memview))
              goto fail;
      }
      buf = &memview->view;
      if (unlikely(buf->ndim != ndim)) {
          PyErr_Format(PyExc_ValueError,
                  "Buffer has wrong number of dimensions (expected %d, got %d)",
                  ndim, buf->ndim);
          goto fail;
      }
      if (new_memview) {
          __Pyx_BufFmt_Init(&ctx, stack, dtype);
          if (unlikely(!__Pyx_BufFmt_CheckString(&ctx, buf->format))) goto fail;
      }
      if (unlikely((unsigned) buf->itemsize != dtype->size)) {
          PyErr_Format(PyExc_ValueError,
                       "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "u byte%s) "
                       "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "u byte%s)",
                       buf->itemsize,
                       (buf->itemsize > 1) ? "s" : "",
                       dtype->name,
                       dtype->size,
                       (dtype->size > 1) ? "s" : "");
          goto fail;
      }
      if (buf->len > 0) {
          for (i = 0; i < ndim; i++) {
              spec = axes_specs[i];
              if (unlikely(!__pyx_check_strides(buf, i, ndim, spec)))
                  goto fail;
              if (unlikely(!__pyx_check_suboffsets(buf, i, ndim, spec)))
                  goto fail;
          }
          if (unlikely(buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag)))
              goto fail;
      }
      if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice,
                                           new_memview != NULL) == -1)) {
          goto fail;
      }
      retval = 0;
      goto no_fail;
  fail:
      Py_XDECREF((PyObject*)new_memview);
      retval = -1;
  no_fail:
      __Pyx_RefNannyFinishContext();
      return retval;
  }
  
/* ObjectToMemviewSlice */
  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_unsigned_char(PyObject *obj, int writable_flag) {
      __Pyx_memviewslice result = __Pyx_MEMSLICE_INIT;
      __Pyx_BufFmt_StackElem stack[1];
      int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
      int retcode;
      if (obj == Py_None) {
          result.memview = (struct __pyx_memoryview_obj *) Py_None;
          return result;
      }
      retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
                                                   PyBUF_RECORDS_RO | writable_flag, 1,
                                                   &__Pyx_TypeInfo_unsigned_char, stack,
                                                   &result, obj);
      if (unlikely(retcode == -1))
          goto __pyx_fail;
      return result;
  __pyx_fail:
      result.memview = NULL;
      result.data = NULL;
      return result;
  }
  
/* UnicodeAsUCS4 */
  static void __Pyx_PyUnicode_AsPy_UCS4_error(Py_ssize_t length) {
      if (likely(length >= 0)) {
          PyErr_Format(PyExc_ValueError,
                       "only single character unicode strings can be converted to Py_UCS4, "
                       "got length %" CYTHON_FORMAT_SSIZE_T "d", length);
      }
  }
  static CYTHON_INLINE Py_UCS4 __Pyx_PyUnicode_AsPy_UCS4(PyObject* x) {
      Py_ssize_t length = __Pyx_PyUnicode_GET_LENGTH(x);
      if (unlikely(length != 1)) {
          __Pyx_PyUnicode_AsPy_UCS4_error(length);
          return (Py_UCS4)-1;
      }
      return __Pyx_PyUnicode_READ_CHAR(x, 0);
  }
  
/* Declarations */
  #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
    #ifdef __cplusplus
      static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
        return ::std::complex< double >(x, y);
      }
    #else
      static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
        return x + y*(__pyx_t_double_complex)_Complex_I;
      }
    #endif
  #else
      static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
        __pyx_t_double_complex z;
        z.real = x;
        z.imag = y;
        return z;
      }
  #endif
  
/* Arithmetic */
  #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
  #else
      static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
         return (a.real == b.real) && (a.imag == b.imag);
      }
      static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
          __pyx_t_double_complex z;
          z.real = a.real + b.real;
          z.imag = a.imag + b.imag;
          return z;
      }
      static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
          __pyx_t_double_complex z;
          z.real = a.real - b.real;
          z.imag = a.imag - b.imag;
          return z;
      }
      static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
          __pyx_t_double_complex z;
          z.real = a.real * b.real - a.imag * b.imag;
          z.imag = a.real * b.imag + a.imag * b.real;
          return z;
      }
      #if 1
      static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
          if (b.imag == 0) {
              return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
          } else if (fabs(b.real) >= fabs(b.imag)) {
              if (b.real == 0 && b.imag == 0) {
                  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
              } else {
                  double r = b.imag / b.real;
                  double s = (double)(1.0) / (b.real + b.imag * r);
                  return __pyx_t_double_complex_from_parts(
                      (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
              }
          } else {
              double r = b.real / b.imag;
              double s = (double)(1.0) / (b.imag + b.real * r);
              return __pyx_t_double_complex_from_parts(
                  (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
          }
      }
      #else
      static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
          if (b.imag == 0) {
              return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
          } else {
              double denom = b.real * b.real + b.imag * b.imag;
              return __pyx_t_double_complex_from_parts(
                  (a.real * b.real + a.imag * b.imag) / denom,
                  (a.imag * b.real - a.real * b.imag) / denom);
          }
      }
      #endif
      static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
          __pyx_t_double_complex z;
          z.real = -a.real;
          z.imag = -a.imag;
          return z;
      }
      static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
         return (a.real == 0) && (a.imag == 0);
      }
      static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
          __pyx_t_double_complex z;
          z.real =  a.real;
          z.imag = -a.imag;
          return z;
      }
      #if 1
          static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
            #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
              return sqrt(z.real*z.real + z.imag*z.imag);
            #else
              return hypot(z.real, z.imag);
            #endif
          }
          static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
              __pyx_t_double_complex z;
              double r, lnr, theta, z_r, z_theta;
              if (b.imag == 0 && b.real == (int)b.real) {
                  if (b.real < 0) {
                      double denom = a.real * a.real + a.imag * a.imag;
                      a.real = a.real / denom;
                      a.imag = -a.imag / denom;
                      b.real = -b.real;
                  }
                  switch ((int)b.real) {
                      case 0:
                          z.real = 1;
                          z.imag = 0;
                          return z;
                      case 1:
                          return a;
                      case 2:
                          return __Pyx_c_prod_double(a, a);
                      case 3:
                          z = __Pyx_c_prod_double(a, a);
                          return __Pyx_c_prod_double(z, a);
                      case 4:
                          z = __Pyx_c_prod_double(a, a);
                          return __Pyx_c_prod_double(z, z);
                  }
              }
              if (a.imag == 0) {
                  if (a.real == 0) {
                      return a;
                  } else if ((b.imag == 0) && (a.real >= 0)) {
                      z.real = pow(a.real, b.real);
                      z.imag = 0;
                      return z;
                  } else if (a.real > 0) {
                      r = a.real;
                      theta = 0;
                  } else {
                      r = -a.real;
                      theta = atan2(0.0, -1.0);
                  }
              } else {
                  r = __Pyx_c_abs_double(a);
                  theta = atan2(a.imag, a.real);
              }
              lnr = log(r);
              z_r = exp(lnr * b.real - theta * b.imag);
              z_theta = theta * b.real + lnr * b.imag;
              z.real = z_r * cos(z_theta);
              z.imag = z_r * sin(z_theta);
              return z;
          }
      #endif
  #endif
  
/* MemviewDtypeToObject */
  static CYTHON_INLINE PyObject *__pyx_memview_get_unsigned_char(const char *itemp) {
      return (PyObject *) __Pyx_PyLong_From_unsigned_char(*(unsigned char const *) itemp);
  }
  static CYTHON_INLINE int __pyx_memview_set_unsigned_char(char *itemp, PyObject *obj) {
      unsigned char value = __Pyx_PyLong_As_unsigned_char(obj);
      if (unlikely((value == (unsigned char)-1) && PyErr_Occurred()))
          return 0;
      *(unsigned char *) itemp = value;
      return 1;
  }
  
/* MemviewSliceCopy */
  static __Pyx_memviewslice
  __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
                                   const char *mode, int ndim,
                                   size_t sizeof_dtype, int contig_flag,
                                   int dtype_is_object)
  {
      __Pyx_RefNannyDeclarations
      int i;
      __Pyx_memviewslice new_mvs = __Pyx_MEMSLICE_INIT;
      struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
      Py_buffer *buf = &from_memview->view;
      PyObject *shape_tuple = NULL;
      struct __pyx_array_obj *array_obj = NULL;
      struct __pyx_memoryview_obj *memview_obj = NULL;
      __Pyx_RefNannySetupContext("__pyx_memoryview_copy_new_contig", 0);
      for (i = 0; i < ndim; i++) {
          if (unlikely(from_mvs->suboffsets[i] >= 0)) {
              PyErr_Format(PyExc_ValueError, "Cannot copy memoryview slice with "
                                             "indirect dimensions (axis %d)", i);
              goto fail;
          }
      }
      shape_tuple = PyTuple_New(ndim);
      if (unlikely(!shape_tuple)) {
          goto fail;
      }
      __Pyx_GOTREF(shape_tuple);
      for(i = 0; i < ndim; i++) {
          PyObject *temp_int = PyLong_FromSsize_t(from_mvs->shape[i]);
          if(unlikely(!temp_int)) {
              goto fail;
          } else {
  #if CYTHON_ASSUME_SAFE_MACROS
              PyTuple_SET_ITEM(shape_tuple, i, temp_int);
  #else
              if (PyTuple_SetItem(shape_tuple, i, temp_int) < 0) {
                  goto fail;
              }
  #endif
          }
      }
      array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, mode, NULL);
      if (unlikely(!array_obj)) {
          goto fail;
      }
      __Pyx_GOTREF(array_obj);
      memview_obj = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
                                      (PyObject *) array_obj, contig_flag,
                                      dtype_is_object,
                                      from_mvs->memview->typeinfo);
      if (unlikely(!memview_obj))
          goto fail;
      if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
          goto fail;
      if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
                                                  dtype_is_object) < 0))
          goto fail;
      goto no_fail;
  fail:
      __Pyx_XDECREF((PyObject *) new_mvs.memview);
      new_mvs.memview = NULL;
      new_mvs.data = NULL;
  no_fail:
      __Pyx_XDECREF(shape_tuple);
      __Pyx_XDECREF((PyObject *) array_obj);
      __Pyx_RefNannyFinishContext();
      return new_mvs;
  }
  
/* CIntFromPy */
  static CYTHON_INLINE GLint __Pyx_PyLong_As_GLint(PyObject *x) {
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic push
  #pragma GCC diagnostic ignored "-Wconversion"
  #endif
      const GLint neg_one = (GLint) -1, const_zero = (GLint) 0;
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic pop
  #endif
      const int is_unsigned = neg_one > const_zero;
      if (unlikely(!PyLong_Check(x))) {
          GLint val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (GLint) -1;
          val = __Pyx_PyLong_As_GLint(tmp);
          Py_DECREF(tmp);
          return val;
      }
      if (is_unsigned) {
  #if CYTHON_USE_PYLONG_INTERNALS
          if (unlikely(__Pyx_PyLong_IsNeg(x))) {
              goto raise_neg_overflow;
          } else if (__Pyx_PyLong_IsCompact(x)) {
              __PYX_VERIFY_RETURN_INT(GLint, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
          } else {
              const digit* digits = __Pyx_PyLong_Digits(x);
              assert(__Pyx_PyLong_DigitCount(x) > 1);
              switch (__Pyx_PyLong_DigitCount(x)) {
                  case 2:
                      if ((8 * sizeof(GLint) > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(GLint, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(GLint) >= 2 * PyLong_SHIFT)) {
                              return (GLint) (((((GLint)digits[1]) << PyLong_SHIFT) | (GLint)digits[0]));
                          }
                      }
                      break;
                  case 3:
                      if ((8 * sizeof(GLint) > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(GLint, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(GLint) >= 3 * PyLong_SHIFT)) {
                              return (GLint) (((((((GLint)digits[2]) << PyLong_SHIFT) | (GLint)digits[1]) << PyLong_SHIFT) | (GLint)digits[0]));
                          }
                      }
                      break;
                  case 4:
                      if ((8 * sizeof(GLint) > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(GLint, 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(GLint) >= 4 * PyLong_SHIFT)) {
                              return (GLint) (((((((((GLint)digits[3]) << PyLong_SHIFT) | (GLint)digits[2]) << PyLong_SHIFT) | (GLint)digits[1]) << PyLong_SHIFT) | (GLint)digits[0]));
                          }
                      }
                      break;
              }
          }
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
          if (unlikely(Py_SIZE(x) < 0)) {
              goto raise_neg_overflow;
          }
  #else
          {
              int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
              if (unlikely(result < 0))
                  return (GLint) -1;
              if (unlikely(result == 1))
                  goto raise_neg_overflow;
          }
  #endif
          if ((sizeof(GLint) <= sizeof(unsigned long))) {
              __PYX_VERIFY_RETURN_INT_EXC(GLint, unsigned long, PyLong_AsUnsignedLong(x))
          } else if ((sizeof(GLint) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(GLint, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } else {
  #if CYTHON_USE_PYLONG_INTERNALS
          if (__Pyx_PyLong_IsCompact(x)) {
              __PYX_VERIFY_RETURN_INT(GLint, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
          } else {
              const digit* digits = __Pyx_PyLong_Digits(x);
              assert(__Pyx_PyLong_DigitCount(x) > 1);
              switch (__Pyx_PyLong_SignedDigitCount(x)) {
                  case -2:
                      if ((8 * sizeof(GLint) - 1 > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(GLint, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(GLint) - 1 > 2 * PyLong_SHIFT)) {
                              return (GLint) (((GLint)-1)*(((((GLint)digits[1]) << PyLong_SHIFT) | (GLint)digits[0])));
                          }
                      }
                      break;
                  case 2:
                      if ((8 * sizeof(GLint) > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(GLint, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(GLint) - 1 > 2 * PyLong_SHIFT)) {
                              return (GLint) ((((((GLint)digits[1]) << PyLong_SHIFT) | (GLint)digits[0])));
                          }
                      }
                      break;
                  case -3:
                      if ((8 * sizeof(GLint) - 1 > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(GLint, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(GLint) - 1 > 3 * PyLong_SHIFT)) {
                              return (GLint) (((GLint)-1)*(((((((GLint)digits[2]) << PyLong_SHIFT) | (GLint)digits[1]) << PyLong_SHIFT) | (GLint)digits[0])));
                          }
                      }
                      break;
                  case 3:
                      if ((8 * sizeof(GLint) > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(GLint, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(GLint) - 1 > 3 * PyLong_SHIFT)) {
                              return (GLint) ((((((((GLint)digits[2]) << PyLong_SHIFT) | (GLint)digits[1]) << PyLong_SHIFT) | (GLint)digits[0])));
                          }
                      }
                      break;
                  case -4:
                      if ((8 * sizeof(GLint) - 1 > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(GLint, 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(GLint) - 1 > 4 * PyLong_SHIFT)) {
                              return (GLint) (((GLint)-1)*(((((((((GLint)digits[3]) << PyLong_SHIFT) | (GLint)digits[2]) << PyLong_SHIFT) | (GLint)digits[1]) << PyLong_SHIFT) | (GLint)digits[0])));
                          }
                      }
                      break;
                  case 4:
                      if ((8 * sizeof(GLint) > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(GLint, 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(GLint) - 1 > 4 * PyLong_SHIFT)) {
                              return (GLint) ((((((((((GLint)digits[3]) << PyLong_SHIFT) | (GLint)digits[2]) << PyLong_SHIFT) | (GLint)digits[1]) << PyLong_SHIFT) | (GLint)digits[0])));
                          }
                      }
                      break;
              }
          }
  #endif
          if ((sizeof(GLint) <= sizeof(long))) {
              __PYX_VERIFY_RETURN_INT_EXC(GLint, long, PyLong_AsLong(x))
          } else if ((sizeof(GLint) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(GLint, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          GLint val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
          int one = 1; int is_little = (int)*(unsigned char *)&one;
          unsigned char *bytes = (unsigned char *)&val;
          ret = _PyLong_AsByteArray((PyLongObject *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyObject *v;
          PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
          int bits, remaining_bits, is_negative = 0;
          int chunk_size = (sizeof(long) < 8) ? 30 : 62;
          if (likely(PyLong_CheckExact(x))) {
              v = __Pyx_NewRef(x);
          } else {
              v = PyNumber_Long(x);
              if (unlikely(!v)) return (GLint) -1;
              assert(PyLong_CheckExact(v));
          }
          {
              int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
              if (unlikely(result < 0)) {
                  Py_DECREF(v);
                  return (GLint) -1;
              }
              is_negative = result == 1;
          }
          if (is_unsigned && unlikely(is_negative)) {
              Py_DECREF(v);
              goto raise_neg_overflow;
          } else if (is_negative) {
              stepval = PyNumber_Invert(v);
              Py_DECREF(v);
              if (unlikely(!stepval))
                  return (GLint) -1;
          } else {
              stepval = v;
          }
          v = NULL;
          val = (GLint) 0;
          mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
          shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
          for (bits = 0; bits < (int) sizeof(GLint) * 8 - chunk_size; bits += chunk_size) {
              PyObject *tmp, *digit;
              long idigit;
              digit = PyNumber_And(stepval, mask);
              if (unlikely(!digit)) goto done;
              idigit = PyLong_AsLong(digit);
              Py_DECREF(digit);
              if (unlikely(idigit < 0)) goto done;
              val |= ((GLint) idigit) << bits;
              tmp = PyNumber_Rshift(stepval, shift);
              if (unlikely(!tmp)) goto done;
              Py_DECREF(stepval); stepval = tmp;
          }
          Py_DECREF(shift); shift = NULL;
          Py_DECREF(mask); mask = NULL;
          {
              long idigit = PyLong_AsLong(stepval);
              if (unlikely(idigit < 0)) goto done;
              remaining_bits = ((int) sizeof(GLint) * 8) - bits - (is_unsigned ? 0 : 1);
              if (unlikely(idigit >= (1L << remaining_bits)))
                  goto raise_overflow;
              val |= ((GLint) idigit) << bits;
          }
          if (!is_unsigned) {
              if (unlikely(val & (((GLint) 1) << (sizeof(GLint) * 8 - 1))))
                  goto raise_overflow;
              if (is_negative)
                  val = ~val;
          }
          ret = 0;
      done:
          Py_XDECREF(shift);
          Py_XDECREF(mask);
          Py_XDECREF(stepval);
  #endif
          if (unlikely(ret))
              return (GLint) -1;
          return val;
      }
  raise_overflow:
      PyErr_SetString(PyExc_OverflowError,
          "value too large to convert to GLint");
      return (GLint) -1;
  raise_neg_overflow:
      PyErr_SetString(PyExc_OverflowError,
          "can't convert negative value to GLint");
      return (GLint) -1;
  }
  
/* CIntFromPy */
  static CYTHON_INLINE unsigned int __Pyx_PyLong_As_unsigned_int(PyObject *x) {
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic push
  #pragma GCC diagnostic ignored "-Wconversion"
  #endif
      const unsigned int neg_one = (unsigned int) -1, const_zero = (unsigned int) 0;
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic pop
  #endif
      const int is_unsigned = neg_one > const_zero;
      if (unlikely(!PyLong_Check(x))) {
          unsigned int val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (unsigned int) -1;
          val = __Pyx_PyLong_As_unsigned_int(tmp);
          Py_DECREF(tmp);
          return val;
      }
      if (is_unsigned) {
  #if CYTHON_USE_PYLONG_INTERNALS
          if (unlikely(__Pyx_PyLong_IsNeg(x))) {
              goto raise_neg_overflow;
          } else if (__Pyx_PyLong_IsCompact(x)) {
              __PYX_VERIFY_RETURN_INT(unsigned int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
          } else {
              const digit* digits = __Pyx_PyLong_Digits(x);
              assert(__Pyx_PyLong_DigitCount(x) > 1);
              switch (__Pyx_PyLong_DigitCount(x)) {
                  case 2:
                      if ((8 * sizeof(unsigned int) > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(unsigned int) >= 2 * PyLong_SHIFT)) {
                              return (unsigned int) (((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]));
                          }
                      }
                      break;
                  case 3:
                      if ((8 * sizeof(unsigned int) > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(unsigned int) >= 3 * PyLong_SHIFT)) {
                              return (unsigned int) (((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]));
                          }
                      }
                      break;
                  case 4:
                      if ((8 * sizeof(unsigned int) > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(unsigned int) >= 4 * PyLong_SHIFT)) {
                              return (unsigned int) (((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]));
                          }
                      }
                      break;
              }
          }
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
          if (unlikely(Py_SIZE(x) < 0)) {
              goto raise_neg_overflow;
          }
  #else
          {
              int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
              if (unlikely(result < 0))
                  return (unsigned int) -1;
              if (unlikely(result == 1))
                  goto raise_neg_overflow;
          }
  #endif
          if ((sizeof(unsigned int) <= sizeof(unsigned long))) {
              __PYX_VERIFY_RETURN_INT_EXC(unsigned int, unsigned long, PyLong_AsUnsignedLong(x))
          } else if ((sizeof(unsigned int) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(unsigned int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } else {
  #if CYTHON_USE_PYLONG_INTERNALS
          if (__Pyx_PyLong_IsCompact(x)) {
              __PYX_VERIFY_RETURN_INT(unsigned int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
          } else {
              const digit* digits = __Pyx_PyLong_Digits(x);
              assert(__Pyx_PyLong_DigitCount(x) > 1);
              switch (__Pyx_PyLong_SignedDigitCount(x)) {
                  case -2:
                      if ((8 * sizeof(unsigned int) - 1 > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(unsigned int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT)) {
                              return (unsigned int) (((unsigned int)-1)*(((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
                          }
                      }
                      break;
                  case 2:
                      if ((8 * sizeof(unsigned int) > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT)) {
                              return (unsigned int) ((((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
                          }
                      }
                      break;
                  case -3:
                      if ((8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(unsigned int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT)) {
                              return (unsigned int) (((unsigned int)-1)*(((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
                          }
                      }
                      break;
                  case 3:
                      if ((8 * sizeof(unsigned int) > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT)) {
                              return (unsigned int) ((((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
                          }
                      }
                      break;
                  case -4:
                      if ((8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(unsigned int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(unsigned int) - 1 > 4 * PyLong_SHIFT)) {
                              return (unsigned int) (((unsigned int)-1)*(((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
                          }
                      }
                      break;
                  case 4:
                      if ((8 * sizeof(unsigned int) > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(unsigned int) - 1 > 4 * PyLong_SHIFT)) {
                              return (unsigned int) ((((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
                          }
                      }
                      break;
              }
          }
  #endif
          if ((sizeof(unsigned int) <= sizeof(long))) {
              __PYX_VERIFY_RETURN_INT_EXC(unsigned int, long, PyLong_AsLong(x))
          } else if ((sizeof(unsigned int) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(unsigned int, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          unsigned int val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
          int one = 1; int is_little = (int)*(unsigned char *)&one;
          unsigned char *bytes = (unsigned char *)&val;
          ret = _PyLong_AsByteArray((PyLongObject *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyObject *v;
          PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
          int bits, remaining_bits, is_negative = 0;
          int chunk_size = (sizeof(long) < 8) ? 30 : 62;
          if (likely(PyLong_CheckExact(x))) {
              v = __Pyx_NewRef(x);
          } else {
              v = PyNumber_Long(x);
              if (unlikely(!v)) return (unsigned int) -1;
              assert(PyLong_CheckExact(v));
          }
          {
              int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
              if (unlikely(result < 0)) {
                  Py_DECREF(v);
                  return (unsigned int) -1;
              }
              is_negative = result == 1;
          }
          if (is_unsigned && unlikely(is_negative)) {
              Py_DECREF(v);
              goto raise_neg_overflow;
          } else if (is_negative) {
              stepval = PyNumber_Invert(v);
              Py_DECREF(v);
              if (unlikely(!stepval))
                  return (unsigned int) -1;
          } else {
              stepval = v;
          }
          v = NULL;
          val = (unsigned int) 0;
          mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
          shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
          for (bits = 0; bits < (int) sizeof(unsigned int) * 8 - chunk_size; bits += chunk_size) {
              PyObject *tmp, *digit;
              long idigit;
              digit = PyNumber_And(stepval, mask);
              if (unlikely(!digit)) goto done;
              idigit = PyLong_AsLong(digit);
              Py_DECREF(digit);
              if (unlikely(idigit < 0)) goto done;
              val |= ((unsigned int) idigit) << bits;
              tmp = PyNumber_Rshift(stepval, shift);
              if (unlikely(!tmp)) goto done;
              Py_DECREF(stepval); stepval = tmp;
          }
          Py_DECREF(shift); shift = NULL;
          Py_DECREF(mask); mask = NULL;
          {
              long idigit = PyLong_AsLong(stepval);
              if (unlikely(idigit < 0)) goto done;
              remaining_bits = ((int) sizeof(unsigned int) * 8) - bits - (is_unsigned ? 0 : 1);
              if (unlikely(idigit >= (1L << remaining_bits)))
                  goto raise_overflow;
              val |= ((unsigned int) idigit) << bits;
          }
          if (!is_unsigned) {
              if (unlikely(val & (((unsigned int) 1) << (sizeof(unsigned int) * 8 - 1))))
                  goto raise_overflow;
              if (is_negative)
                  val = ~val;
          }
          ret = 0;
      done:
          Py_XDECREF(shift);
          Py_XDECREF(mask);
          Py_XDECREF(stepval);
  #endif
          if (unlikely(ret))
              return (unsigned int) -1;
          return val;
      }
  raise_overflow:
      PyErr_SetString(PyExc_OverflowError,
          "value too large to convert to unsigned int");
      return (unsigned int) -1;
  raise_neg_overflow:
      PyErr_SetString(PyExc_OverflowError,
          "can't convert negative value to unsigned int");
      return (unsigned int) -1;
  }
  
/* CIntFromPy */
  static CYTHON_INLINE GLuint __Pyx_PyLong_As_GLuint(PyObject *x) {
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic push
  #pragma GCC diagnostic ignored "-Wconversion"
  #endif
      const GLuint neg_one = (GLuint) -1, const_zero = (GLuint) 0;
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic pop
  #endif
      const int is_unsigned = neg_one > const_zero;
      if (unlikely(!PyLong_Check(x))) {
          GLuint val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (GLuint) -1;
          val = __Pyx_PyLong_As_GLuint(tmp);
          Py_DECREF(tmp);
          return val;
      }
      if (is_unsigned) {
  #if CYTHON_USE_PYLONG_INTERNALS
          if (unlikely(__Pyx_PyLong_IsNeg(x))) {
              goto raise_neg_overflow;
          } else if (__Pyx_PyLong_IsCompact(x)) {
              __PYX_VERIFY_RETURN_INT(GLuint, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
          } else {
              const digit* digits = __Pyx_PyLong_Digits(x);
              assert(__Pyx_PyLong_DigitCount(x) > 1);
              switch (__Pyx_PyLong_DigitCount(x)) {
                  case 2:
                      if ((8 * sizeof(GLuint) > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(GLuint, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(GLuint) >= 2 * PyLong_SHIFT)) {
                              return (GLuint) (((((GLuint)digits[1]) << PyLong_SHIFT) | (GLuint)digits[0]));
                          }
                      }
                      break;
                  case 3:
                      if ((8 * sizeof(GLuint) > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(GLuint, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(GLuint) >= 3 * PyLong_SHIFT)) {
                              return (GLuint) (((((((GLuint)digits[2]) << PyLong_SHIFT) | (GLuint)digits[1]) << PyLong_SHIFT) | (GLuint)digits[0]));
                          }
                      }
                      break;
                  case 4:
                      if ((8 * sizeof(GLuint) > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(GLuint, 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(GLuint) >= 4 * PyLong_SHIFT)) {
                              return (GLuint) (((((((((GLuint)digits[3]) << PyLong_SHIFT) | (GLuint)digits[2]) << PyLong_SHIFT) | (GLuint)digits[1]) << PyLong_SHIFT) | (GLuint)digits[0]));
                          }
                      }
                      break;
              }
          }
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
          if (unlikely(Py_SIZE(x) < 0)) {
              goto raise_neg_overflow;
          }
  #else
          {
              int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
              if (unlikely(result < 0))
                  return (GLuint) -1;
              if (unlikely(result == 1))
                  goto raise_neg_overflow;
          }
  #endif
          if ((sizeof(GLuint) <= sizeof(unsigned long))) {
              __PYX_VERIFY_RETURN_INT_EXC(GLuint, unsigned long, PyLong_AsUnsignedLong(x))
          } else if ((sizeof(GLuint) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(GLuint, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } else {
  #if CYTHON_USE_PYLONG_INTERNALS
          if (__Pyx_PyLong_IsCompact(x)) {
              __PYX_VERIFY_RETURN_INT(GLuint, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
          } else {
              const digit* digits = __Pyx_PyLong_Digits(x);
              assert(__Pyx_PyLong_DigitCount(x) > 1);
              switch (__Pyx_PyLong_SignedDigitCount(x)) {
                  case -2:
                      if ((8 * sizeof(GLuint) - 1 > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(GLuint, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(GLuint) - 1 > 2 * PyLong_SHIFT)) {
                              return (GLuint) (((GLuint)-1)*(((((GLuint)digits[1]) << PyLong_SHIFT) | (GLuint)digits[0])));
                          }
                      }
                      break;
                  case 2:
                      if ((8 * sizeof(GLuint) > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(GLuint, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(GLuint) - 1 > 2 * PyLong_SHIFT)) {
                              return (GLuint) ((((((GLuint)digits[1]) << PyLong_SHIFT) | (GLuint)digits[0])));
                          }
                      }
                      break;
                  case -3:
                      if ((8 * sizeof(GLuint) - 1 > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(GLuint, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(GLuint) - 1 > 3 * PyLong_SHIFT)) {
                              return (GLuint) (((GLuint)-1)*(((((((GLuint)digits[2]) << PyLong_SHIFT) | (GLuint)digits[1]) << PyLong_SHIFT) | (GLuint)digits[0])));
                          }
                      }
                      break;
                  case 3:
                      if ((8 * sizeof(GLuint) > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(GLuint, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(GLuint) - 1 > 3 * PyLong_SHIFT)) {
                              return (GLuint) ((((((((GLuint)digits[2]) << PyLong_SHIFT) | (GLuint)digits[1]) << PyLong_SHIFT) | (GLuint)digits[0])));
                          }
                      }
                      break;
                  case -4:
                      if ((8 * sizeof(GLuint) - 1 > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(GLuint, 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(GLuint) - 1 > 4 * PyLong_SHIFT)) {
                              return (GLuint) (((GLuint)-1)*(((((((((GLuint)digits[3]) << PyLong_SHIFT) | (GLuint)digits[2]) << PyLong_SHIFT) | (GLuint)digits[1]) << PyLong_SHIFT) | (GLuint)digits[0])));
                          }
                      }
                      break;
                  case 4:
                      if ((8 * sizeof(GLuint) > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(GLuint, 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(GLuint) - 1 > 4 * PyLong_SHIFT)) {
                              return (GLuint) ((((((((((GLuint)digits[3]) << PyLong_SHIFT) | (GLuint)digits[2]) << PyLong_SHIFT) | (GLuint)digits[1]) << PyLong_SHIFT) | (GLuint)digits[0])));
                          }
                      }
                      break;
              }
          }
  #endif
          if ((sizeof(GLuint) <= sizeof(long))) {
              __PYX_VERIFY_RETURN_INT_EXC(GLuint, long, PyLong_AsLong(x))
          } else if ((sizeof(GLuint) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(GLuint, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          GLuint val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
          int one = 1; int is_little = (int)*(unsigned char *)&one;
          unsigned char *bytes = (unsigned char *)&val;
          ret = _PyLong_AsByteArray((PyLongObject *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyObject *v;
          PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
          int bits, remaining_bits, is_negative = 0;
          int chunk_size = (sizeof(long) < 8) ? 30 : 62;
          if (likely(PyLong_CheckExact(x))) {
              v = __Pyx_NewRef(x);
          } else {
              v = PyNumber_Long(x);
              if (unlikely(!v)) return (GLuint) -1;
              assert(PyLong_CheckExact(v));
          }
          {
              int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
              if (unlikely(result < 0)) {
                  Py_DECREF(v);
                  return (GLuint) -1;
              }
              is_negative = result == 1;
          }
          if (is_unsigned && unlikely(is_negative)) {
              Py_DECREF(v);
              goto raise_neg_overflow;
          } else if (is_negative) {
              stepval = PyNumber_Invert(v);
              Py_DECREF(v);
              if (unlikely(!stepval))
                  return (GLuint) -1;
          } else {
              stepval = v;
          }
          v = NULL;
          val = (GLuint) 0;
          mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
          shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
          for (bits = 0; bits < (int) sizeof(GLuint) * 8 - chunk_size; bits += chunk_size) {
              PyObject *tmp, *digit;
              long idigit;
              digit = PyNumber_And(stepval, mask);
              if (unlikely(!digit)) goto done;
              idigit = PyLong_AsLong(digit);
              Py_DECREF(digit);
              if (unlikely(idigit < 0)) goto done;
              val |= ((GLuint) idigit) << bits;
              tmp = PyNumber_Rshift(stepval, shift);
              if (unlikely(!tmp)) goto done;
              Py_DECREF(stepval); stepval = tmp;
          }
          Py_DECREF(shift); shift = NULL;
          Py_DECREF(mask); mask = NULL;
          {
              long idigit = PyLong_AsLong(stepval);
              if (unlikely(idigit < 0)) goto done;
              remaining_bits = ((int) sizeof(GLuint) * 8) - bits - (is_unsigned ? 0 : 1);
              if (unlikely(idigit >= (1L << remaining_bits)))
                  goto raise_overflow;
              val |= ((GLuint) idigit) << bits;
          }
          if (!is_unsigned) {
              if (unlikely(val & (((GLuint) 1) << (sizeof(GLuint) * 8 - 1))))
                  goto raise_overflow;
              if (is_negative)
                  val = ~val;
          }
          ret = 0;
      done:
          Py_XDECREF(shift);
          Py_XDECREF(mask);
          Py_XDECREF(stepval);
  #endif
          if (unlikely(ret))
              return (GLuint) -1;
          return val;
      }
  raise_overflow:
      PyErr_SetString(PyExc_OverflowError,
          "value too large to convert to GLuint");
      return (GLuint) -1;
  raise_neg_overflow:
      PyErr_SetString(PyExc_OverflowError,
          "can't convert negative value to GLuint");
      return (GLuint) -1;
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_From___pyx_anon_enum(int value) {
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic push
  #pragma GCC diagnostic ignored "-Wconversion"
  #endif
      const int neg_one = (int) -1, const_zero = (int) 0;
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic pop
  #endif
      const int is_unsigned = neg_one > const_zero;
      if (is_unsigned) {
          if (sizeof(int) < sizeof(long)) {
              return PyLong_FromLong((long) value);
          } else if (sizeof(int) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
              return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
  #endif
          }
      } else {
          if (sizeof(int) <= sizeof(long)) {
              return PyLong_FromLong((long) value);
          } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(int),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = NULL, *order_str = NULL;
          from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
          if (!from_bytes) return NULL;
          py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int));
          if (!py_bytes) goto limited_bad;
          order_str = PyUnicode_FromString(little ? "little" : "big");
          if (!order_str) goto limited_bad;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntFromPy */
  static CYTHON_INLINE GLenum __Pyx_PyLong_As_GLenum(PyObject *x) {
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic push
  #pragma GCC diagnostic ignored "-Wconversion"
  #endif
      const GLenum neg_one = (GLenum) -1, const_zero = (GLenum) 0;
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic pop
  #endif
      const int is_unsigned = neg_one > const_zero;
      if (unlikely(!PyLong_Check(x))) {
          GLenum val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (GLenum) -1;
          val = __Pyx_PyLong_As_GLenum(tmp);
          Py_DECREF(tmp);
          return val;
      }
      if (is_unsigned) {
  #if CYTHON_USE_PYLONG_INTERNALS
          if (unlikely(__Pyx_PyLong_IsNeg(x))) {
              goto raise_neg_overflow;
          } else if (__Pyx_PyLong_IsCompact(x)) {
              __PYX_VERIFY_RETURN_INT(GLenum, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
          } else {
              const digit* digits = __Pyx_PyLong_Digits(x);
              assert(__Pyx_PyLong_DigitCount(x) > 1);
              switch (__Pyx_PyLong_DigitCount(x)) {
                  case 2:
                      if ((8 * sizeof(GLenum) > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(GLenum, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(GLenum) >= 2 * PyLong_SHIFT)) {
                              return (GLenum) (((((GLenum)digits[1]) << PyLong_SHIFT) | (GLenum)digits[0]));
                          }
                      }
                      break;
                  case 3:
                      if ((8 * sizeof(GLenum) > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(GLenum, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(GLenum) >= 3 * PyLong_SHIFT)) {
                              return (GLenum) (((((((GLenum)digits[2]) << PyLong_SHIFT) | (GLenum)digits[1]) << PyLong_SHIFT) | (GLenum)digits[0]));
                          }
                      }
                      break;
                  case 4:
                      if ((8 * sizeof(GLenum) > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(GLenum, 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(GLenum) >= 4 * PyLong_SHIFT)) {
                              return (GLenum) (((((((((GLenum)digits[3]) << PyLong_SHIFT) | (GLenum)digits[2]) << PyLong_SHIFT) | (GLenum)digits[1]) << PyLong_SHIFT) | (GLenum)digits[0]));
                          }
                      }
                      break;
              }
          }
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
          if (unlikely(Py_SIZE(x) < 0)) {
              goto raise_neg_overflow;
          }
  #else
          {
              int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
              if (unlikely(result < 0))
                  return (GLenum) -1;
              if (unlikely(result == 1))
                  goto raise_neg_overflow;
          }
  #endif
          if ((sizeof(GLenum) <= sizeof(unsigned long))) {
              __PYX_VERIFY_RETURN_INT_EXC(GLenum, unsigned long, PyLong_AsUnsignedLong(x))
          } else if ((sizeof(GLenum) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(GLenum, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } else {
  #if CYTHON_USE_PYLONG_INTERNALS
          if (__Pyx_PyLong_IsCompact(x)) {
              __PYX_VERIFY_RETURN_INT(GLenum, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
          } else {
              const digit* digits = __Pyx_PyLong_Digits(x);
              assert(__Pyx_PyLong_DigitCount(x) > 1);
              switch (__Pyx_PyLong_SignedDigitCount(x)) {
                  case -2:
                      if ((8 * sizeof(GLenum) - 1 > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(GLenum, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(GLenum) - 1 > 2 * PyLong_SHIFT)) {
                              return (GLenum) (((GLenum)-1)*(((((GLenum)digits[1]) << PyLong_SHIFT) | (GLenum)digits[0])));
                          }
                      }
                      break;
                  case 2:
                      if ((8 * sizeof(GLenum) > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(GLenum, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(GLenum) - 1 > 2 * PyLong_SHIFT)) {
                              return (GLenum) ((((((GLenum)digits[1]) << PyLong_SHIFT) | (GLenum)digits[0])));
                          }
                      }
                      break;
                  case -3:
                      if ((8 * sizeof(GLenum) - 1 > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(GLenum, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(GLenum) - 1 > 3 * PyLong_SHIFT)) {
                              return (GLenum) (((GLenum)-1)*(((((((GLenum)digits[2]) << PyLong_SHIFT) | (GLenum)digits[1]) << PyLong_SHIFT) | (GLenum)digits[0])));
                          }
                      }
                      break;
                  case 3:
                      if ((8 * sizeof(GLenum) > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(GLenum, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(GLenum) - 1 > 3 * PyLong_SHIFT)) {
                              return (GLenum) ((((((((GLenum)digits[2]) << PyLong_SHIFT) | (GLenum)digits[1]) << PyLong_SHIFT) | (GLenum)digits[0])));
                          }
                      }
                      break;
                  case -4:
                      if ((8 * sizeof(GLenum) - 1 > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(GLenum, 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(GLenum) - 1 > 4 * PyLong_SHIFT)) {
                              return (GLenum) (((GLenum)-1)*(((((((((GLenum)digits[3]) << PyLong_SHIFT) | (GLenum)digits[2]) << PyLong_SHIFT) | (GLenum)digits[1]) << PyLong_SHIFT) | (GLenum)digits[0])));
                          }
                      }
                      break;
                  case 4:
                      if ((8 * sizeof(GLenum) > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(GLenum, 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(GLenum) - 1 > 4 * PyLong_SHIFT)) {
                              return (GLenum) ((((((((((GLenum)digits[3]) << PyLong_SHIFT) | (GLenum)digits[2]) << PyLong_SHIFT) | (GLenum)digits[1]) << PyLong_SHIFT) | (GLenum)digits[0])));
                          }
                      }
                      break;
              }
          }
  #endif
          if ((sizeof(GLenum) <= sizeof(long))) {
              __PYX_VERIFY_RETURN_INT_EXC(GLenum, long, PyLong_AsLong(x))
          } else if ((sizeof(GLenum) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(GLenum, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          GLenum val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
          int one = 1; int is_little = (int)*(unsigned char *)&one;
          unsigned char *bytes = (unsigned char *)&val;
          ret = _PyLong_AsByteArray((PyLongObject *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyObject *v;
          PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
          int bits, remaining_bits, is_negative = 0;
          int chunk_size = (sizeof(long) < 8) ? 30 : 62;
          if (likely(PyLong_CheckExact(x))) {
              v = __Pyx_NewRef(x);
          } else {
              v = PyNumber_Long(x);
              if (unlikely(!v)) return (GLenum) -1;
              assert(PyLong_CheckExact(v));
          }
          {
              int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
              if (unlikely(result < 0)) {
                  Py_DECREF(v);
                  return (GLenum) -1;
              }
              is_negative = result == 1;
          }
          if (is_unsigned && unlikely(is_negative)) {
              Py_DECREF(v);
              goto raise_neg_overflow;
          } else if (is_negative) {
              stepval = PyNumber_Invert(v);
              Py_DECREF(v);
              if (unlikely(!stepval))
                  return (GLenum) -1;
          } else {
              stepval = v;
          }
          v = NULL;
          val = (GLenum) 0;
          mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
          shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
          for (bits = 0; bits < (int) sizeof(GLenum) * 8 - chunk_size; bits += chunk_size) {
              PyObject *tmp, *digit;
              long idigit;
              digit = PyNumber_And(stepval, mask);
              if (unlikely(!digit)) goto done;
              idigit = PyLong_AsLong(digit);
              Py_DECREF(digit);
              if (unlikely(idigit < 0)) goto done;
              val |= ((GLenum) idigit) << bits;
              tmp = PyNumber_Rshift(stepval, shift);
              if (unlikely(!tmp)) goto done;
              Py_DECREF(stepval); stepval = tmp;
          }
          Py_DECREF(shift); shift = NULL;
          Py_DECREF(mask); mask = NULL;
          {
              long idigit = PyLong_AsLong(stepval);
              if (unlikely(idigit < 0)) goto done;
              remaining_bits = ((int) sizeof(GLenum) * 8) - bits - (is_unsigned ? 0 : 1);
              if (unlikely(idigit >= (1L << remaining_bits)))
                  goto raise_overflow;
              val |= ((GLenum) idigit) << bits;
          }
          if (!is_unsigned) {
              if (unlikely(val & (((GLenum) 1) << (sizeof(GLenum) * 8 - 1))))
                  goto raise_overflow;
              if (is_negative)
                  val = ~val;
          }
          ret = 0;
      done:
          Py_XDECREF(shift);
          Py_XDECREF(mask);
          Py_XDECREF(stepval);
  #endif
          if (unlikely(ret))
              return (GLenum) -1;
          return val;
      }
  raise_overflow:
      PyErr_SetString(PyExc_OverflowError,
          "value too large to convert to GLenum");
      return (GLenum) -1;
  raise_neg_overflow:
      PyErr_SetString(PyExc_OverflowError,
          "can't convert negative value to GLenum");
      return (GLenum) -1;
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_From_GLenum(GLenum value) {
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic push
  #pragma GCC diagnostic ignored "-Wconversion"
  #endif
      const GLenum neg_one = (GLenum) -1, const_zero = (GLenum) 0;
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic pop
  #endif
      const int is_unsigned = neg_one > const_zero;
      if (is_unsigned) {
          if (sizeof(GLenum) < sizeof(long)) {
              return PyLong_FromLong((long) value);
          } else if (sizeof(GLenum) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } else if (sizeof(GLenum) <= sizeof(unsigned PY_LONG_LONG)) {
              return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
  #endif
          }
      } else {
          if (sizeof(GLenum) <= sizeof(long)) {
              return PyLong_FromLong((long) value);
          } else if (sizeof(GLenum) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(GLenum),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = NULL, *order_str = NULL;
          from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
          if (!from_bytes) return NULL;
          py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(GLenum));
          if (!py_bytes) goto limited_bad;
          order_str = PyUnicode_FromString(little ? "little" : "big");
          if (!order_str) goto limited_bad;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_From_int(int value) {
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic push
  #pragma GCC diagnostic ignored "-Wconversion"
  #endif
      const int neg_one = (int) -1, const_zero = (int) 0;
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic pop
  #endif
      const int is_unsigned = neg_one > const_zero;
      if (is_unsigned) {
          if (sizeof(int) < sizeof(long)) {
              return PyLong_FromLong((long) value);
          } else if (sizeof(int) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
              return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
  #endif
          }
      } else {
          if (sizeof(int) <= sizeof(long)) {
              return PyLong_FromLong((long) value);
          } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(int),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = NULL, *order_str = NULL;
          from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
          if (!from_bytes) return NULL;
          py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int));
          if (!py_bytes) goto limited_bad;
          order_str = PyUnicode_FromString(little ? "little" : "big");
          if (!order_str) goto limited_bad;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_From_GLuint(GLuint value) {
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic push
  #pragma GCC diagnostic ignored "-Wconversion"
  #endif
      const GLuint neg_one = (GLuint) -1, const_zero = (GLuint) 0;
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic pop
  #endif
      const int is_unsigned = neg_one > const_zero;
      if (is_unsigned) {
          if (sizeof(GLuint) < sizeof(long)) {
              return PyLong_FromLong((long) value);
          } else if (sizeof(GLuint) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } else if (sizeof(GLuint) <= sizeof(unsigned PY_LONG_LONG)) {
              return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
  #endif
          }
      } else {
          if (sizeof(GLuint) <= sizeof(long)) {
              return PyLong_FromLong((long) value);
          } else if (sizeof(GLuint) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(GLuint),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = NULL, *order_str = NULL;
          from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
          if (!from_bytes) return NULL;
          py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(GLuint));
          if (!py_bytes) goto limited_bad;
          order_str = PyUnicode_FromString(little ? "little" : "big");
          if (!order_str) goto limited_bad;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_From_GLint(GLint value) {
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic push
  #pragma GCC diagnostic ignored "-Wconversion"
  #endif
      const GLint neg_one = (GLint) -1, const_zero = (GLint) 0;
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic pop
  #endif
      const int is_unsigned = neg_one > const_zero;
      if (is_unsigned) {
          if (sizeof(GLint) < sizeof(long)) {
              return PyLong_FromLong((long) value);
          } else if (sizeof(GLint) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } else if (sizeof(GLint) <= sizeof(unsigned PY_LONG_LONG)) {
              return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
  #endif
          }
      } else {
          if (sizeof(GLint) <= sizeof(long)) {
              return PyLong_FromLong((long) value);
          } else if (sizeof(GLint) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(GLint),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = NULL, *order_str = NULL;
          from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
          if (!from_bytes) return NULL;
          py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(GLint));
          if (!py_bytes) goto limited_bad;
          order_str = PyUnicode_FromString(little ? "little" : "big");
          if (!order_str) goto limited_bad;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value) {
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic push
  #pragma GCC diagnostic ignored "-Wconversion"
  #endif
      const long neg_one = (long) -1, const_zero = (long) 0;
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic pop
  #endif
      const int is_unsigned = neg_one > const_zero;
      if (is_unsigned) {
          if (sizeof(long) < sizeof(long)) {
              return PyLong_FromLong((long) value);
          } else if (sizeof(long) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
              return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
  #endif
          }
      } else {
          if (sizeof(long) <= sizeof(long)) {
              return PyLong_FromLong((long) value);
          } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(long),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = NULL, *order_str = NULL;
          from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
          if (!from_bytes) return NULL;
          py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long));
          if (!py_bytes) goto limited_bad;
          order_str = PyUnicode_FromString(little ? "little" : "big");
          if (!order_str) goto limited_bad;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntFromPy */
  static CYTHON_INLINE size_t __Pyx_PyLong_As_size_t(PyObject *x) {
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic push
  #pragma GCC diagnostic ignored "-Wconversion"
  #endif
      const size_t neg_one = (size_t) -1, const_zero = (size_t) 0;
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic pop
  #endif
      const int is_unsigned = neg_one > const_zero;
      if (unlikely(!PyLong_Check(x))) {
          size_t val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (size_t) -1;
          val = __Pyx_PyLong_As_size_t(tmp);
          Py_DECREF(tmp);
          return val;
      }
      if (is_unsigned) {
  #if CYTHON_USE_PYLONG_INTERNALS
          if (unlikely(__Pyx_PyLong_IsNeg(x))) {
              goto raise_neg_overflow;
          } else if (__Pyx_PyLong_IsCompact(x)) {
              __PYX_VERIFY_RETURN_INT(size_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
          } else {
              const digit* digits = __Pyx_PyLong_Digits(x);
              assert(__Pyx_PyLong_DigitCount(x) > 1);
              switch (__Pyx_PyLong_DigitCount(x)) {
                  case 2:
                      if ((8 * sizeof(size_t) > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(size_t) >= 2 * PyLong_SHIFT)) {
                              return (size_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
                          }
                      }
                      break;
                  case 3:
                      if ((8 * sizeof(size_t) > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(size_t) >= 3 * PyLong_SHIFT)) {
                              return (size_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
                          }
                      }
                      break;
                  case 4:
                      if ((8 * sizeof(size_t) > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(size_t) >= 4 * PyLong_SHIFT)) {
                              return (size_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
                          }
                      }
                      break;
              }
          }
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
          if (unlikely(Py_SIZE(x) < 0)) {
              goto raise_neg_overflow;
          }
  #else
          {
              int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
              if (unlikely(result < 0))
                  return (size_t) -1;
              if (unlikely(result == 1))
                  goto raise_neg_overflow;
          }
  #endif
          if ((sizeof(size_t) <= sizeof(unsigned long))) {
              __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned long, PyLong_AsUnsignedLong(x))
          } else if ((sizeof(size_t) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } else {
  #if CYTHON_USE_PYLONG_INTERNALS
          if (__Pyx_PyLong_IsCompact(x)) {
              __PYX_VERIFY_RETURN_INT(size_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
          } else {
              const digit* digits = __Pyx_PyLong_Digits(x);
              assert(__Pyx_PyLong_DigitCount(x) > 1);
              switch (__Pyx_PyLong_SignedDigitCount(x)) {
                  case -2:
                      if ((8 * sizeof(size_t) - 1 > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT)) {
                              return (size_t) (((size_t)-1)*(((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                          }
                      }
                      break;
                  case 2:
                      if ((8 * sizeof(size_t) > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT)) {
                              return (size_t) ((((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                          }
                      }
                      break;
                  case -3:
                      if ((8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT)) {
                              return (size_t) (((size_t)-1)*(((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                          }
                      }
                      break;
                  case 3:
                      if ((8 * sizeof(size_t) > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT)) {
                              return (size_t) ((((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                          }
                      }
                      break;
                  case -4:
                      if ((8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT)) {
                              return (size_t) (((size_t)-1)*(((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                          }
                      }
                      break;
                  case 4:
                      if ((8 * sizeof(size_t) > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT)) {
                              return (size_t) ((((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                          }
                      }
                      break;
              }
          }
  #endif
          if ((sizeof(size_t) <= sizeof(long))) {
              __PYX_VERIFY_RETURN_INT_EXC(size_t, long, PyLong_AsLong(x))
          } else if ((sizeof(size_t) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(size_t, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          size_t val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
          int one = 1; int is_little = (int)*(unsigned char *)&one;
          unsigned char *bytes = (unsigned char *)&val;
          ret = _PyLong_AsByteArray((PyLongObject *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyObject *v;
          PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
          int bits, remaining_bits, is_negative = 0;
          int chunk_size = (sizeof(long) < 8) ? 30 : 62;
          if (likely(PyLong_CheckExact(x))) {
              v = __Pyx_NewRef(x);
          } else {
              v = PyNumber_Long(x);
              if (unlikely(!v)) return (size_t) -1;
              assert(PyLong_CheckExact(v));
          }
          {
              int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
              if (unlikely(result < 0)) {
                  Py_DECREF(v);
                  return (size_t) -1;
              }
              is_negative = result == 1;
          }
          if (is_unsigned && unlikely(is_negative)) {
              Py_DECREF(v);
              goto raise_neg_overflow;
          } else if (is_negative) {
              stepval = PyNumber_Invert(v);
              Py_DECREF(v);
              if (unlikely(!stepval))
                  return (size_t) -1;
          } else {
              stepval = v;
          }
          v = NULL;
          val = (size_t) 0;
          mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
          shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
          for (bits = 0; bits < (int) sizeof(size_t) * 8 - chunk_size; bits += chunk_size) {
              PyObject *tmp, *digit;
              long idigit;
              digit = PyNumber_And(stepval, mask);
              if (unlikely(!digit)) goto done;
              idigit = PyLong_AsLong(digit);
              Py_DECREF(digit);
              if (unlikely(idigit < 0)) goto done;
              val |= ((size_t) idigit) << bits;
              tmp = PyNumber_Rshift(stepval, shift);
              if (unlikely(!tmp)) goto done;
              Py_DECREF(stepval); stepval = tmp;
          }
          Py_DECREF(shift); shift = NULL;
          Py_DECREF(mask); mask = NULL;
          {
              long idigit = PyLong_AsLong(stepval);
              if (unlikely(idigit < 0)) goto done;
              remaining_bits = ((int) sizeof(size_t) * 8) - bits - (is_unsigned ? 0 : 1);
              if (unlikely(idigit >= (1L << remaining_bits)))
                  goto raise_overflow;
              val |= ((size_t) idigit) << bits;
          }
          if (!is_unsigned) {
              if (unlikely(val & (((size_t) 1) << (sizeof(size_t) * 8 - 1))))
                  goto raise_overflow;
              if (is_negative)
                  val = ~val;
          }
          ret = 0;
      done:
          Py_XDECREF(shift);
          Py_XDECREF(mask);
          Py_XDECREF(stepval);
  #endif
          if (unlikely(ret))
              return (size_t) -1;
          return val;
      }
  raise_overflow:
      PyErr_SetString(PyExc_OverflowError,
          "value too large to convert to size_t");
      return (size_t) -1;
  raise_neg_overflow:
      PyErr_SetString(PyExc_OverflowError,
          "can't convert negative value to size_t");
      return (size_t) -1;
  }
  
/* CIntFromPy */
  static CYTHON_INLINE GLushort __Pyx_PyLong_As_GLushort(PyObject *x) {
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic push
  #pragma GCC diagnostic ignored "-Wconversion"
  #endif
      const GLushort neg_one = (GLushort) -1, const_zero = (GLushort) 0;
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic pop
  #endif
      const int is_unsigned = neg_one > const_zero;
      if (unlikely(!PyLong_Check(x))) {
          GLushort val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (GLushort) -1;
          val = __Pyx_PyLong_As_GLushort(tmp);
          Py_DECREF(tmp);
          return val;
      }
      if (is_unsigned) {
  #if CYTHON_USE_PYLONG_INTERNALS
          if (unlikely(__Pyx_PyLong_IsNeg(x))) {
              goto raise_neg_overflow;
          } else if (__Pyx_PyLong_IsCompact(x)) {
              __PYX_VERIFY_RETURN_INT(GLushort, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
          } else {
              const digit* digits = __Pyx_PyLong_Digits(x);
              assert(__Pyx_PyLong_DigitCount(x) > 1);
              switch (__Pyx_PyLong_DigitCount(x)) {
                  case 2:
                      if ((8 * sizeof(GLushort) > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(GLushort, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(GLushort) >= 2 * PyLong_SHIFT)) {
                              return (GLushort) (((((GLushort)digits[1]) << PyLong_SHIFT) | (GLushort)digits[0]));
                          }
                      }
                      break;
                  case 3:
                      if ((8 * sizeof(GLushort) > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(GLushort, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(GLushort) >= 3 * PyLong_SHIFT)) {
                              return (GLushort) (((((((GLushort)digits[2]) << PyLong_SHIFT) | (GLushort)digits[1]) << PyLong_SHIFT) | (GLushort)digits[0]));
                          }
                      }
                      break;
                  case 4:
                      if ((8 * sizeof(GLushort) > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(GLushort, 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(GLushort) >= 4 * PyLong_SHIFT)) {
                              return (GLushort) (((((((((GLushort)digits[3]) << PyLong_SHIFT) | (GLushort)digits[2]) << PyLong_SHIFT) | (GLushort)digits[1]) << PyLong_SHIFT) | (GLushort)digits[0]));
                          }
                      }
                      break;
              }
          }
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
          if (unlikely(Py_SIZE(x) < 0)) {
              goto raise_neg_overflow;
          }
  #else
          {
              int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
              if (unlikely(result < 0))
                  return (GLushort) -1;
              if (unlikely(result == 1))
                  goto raise_neg_overflow;
          }
  #endif
          if ((sizeof(GLushort) <= sizeof(unsigned long))) {
              __PYX_VERIFY_RETURN_INT_EXC(GLushort, unsigned long, PyLong_AsUnsignedLong(x))
          } else if ((sizeof(GLushort) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(GLushort, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } else {
  #if CYTHON_USE_PYLONG_INTERNALS
          if (__Pyx_PyLong_IsCompact(x)) {
              __PYX_VERIFY_RETURN_INT(GLushort, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
          } else {
              const digit* digits = __Pyx_PyLong_Digits(x);
              assert(__Pyx_PyLong_DigitCount(x) > 1);
              switch (__Pyx_PyLong_SignedDigitCount(x)) {
                  case -2:
                      if ((8 * sizeof(GLushort) - 1 > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(GLushort, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(GLushort) - 1 > 2 * PyLong_SHIFT)) {
                              return (GLushort) (((GLushort)-1)*(((((GLushort)digits[1]) << PyLong_SHIFT) | (GLushort)digits[0])));
                          }
                      }
                      break;
                  case 2:
                      if ((8 * sizeof(GLushort) > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(GLushort, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(GLushort) - 1 > 2 * PyLong_SHIFT)) {
                              return (GLushort) ((((((GLushort)digits[1]) << PyLong_SHIFT) | (GLushort)digits[0])));
                          }
                      }
                      break;
                  case -3:
                      if ((8 * sizeof(GLushort) - 1 > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(GLushort, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(GLushort) - 1 > 3 * PyLong_SHIFT)) {
                              return (GLushort) (((GLushort)-1)*(((((((GLushort)digits[2]) << PyLong_SHIFT) | (GLushort)digits[1]) << PyLong_SHIFT) | (GLushort)digits[0])));
                          }
                      }
                      break;
                  case 3:
                      if ((8 * sizeof(GLushort) > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(GLushort, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(GLushort) - 1 > 3 * PyLong_SHIFT)) {
                              return (GLushort) ((((((((GLushort)digits[2]) << PyLong_SHIFT) | (GLushort)digits[1]) << PyLong_SHIFT) | (GLushort)digits[0])));
                          }
                      }
                      break;
                  case -4:
                      if ((8 * sizeof(GLushort) - 1 > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(GLushort, 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(GLushort) - 1 > 4 * PyLong_SHIFT)) {
                              return (GLushort) (((GLushort)-1)*(((((((((GLushort)digits[3]) << PyLong_SHIFT) | (GLushort)digits[2]) << PyLong_SHIFT) | (GLushort)digits[1]) << PyLong_SHIFT) | (GLushort)digits[0])));
                          }
                      }
                      break;
                  case 4:
                      if ((8 * sizeof(GLushort) > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(GLushort, 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(GLushort) - 1 > 4 * PyLong_SHIFT)) {
                              return (GLushort) ((((((((((GLushort)digits[3]) << PyLong_SHIFT) | (GLushort)digits[2]) << PyLong_SHIFT) | (GLushort)digits[1]) << PyLong_SHIFT) | (GLushort)digits[0])));
                          }
                      }
                      break;
              }
          }
  #endif
          if ((sizeof(GLushort) <= sizeof(long))) {
              __PYX_VERIFY_RETURN_INT_EXC(GLushort, long, PyLong_AsLong(x))
          } else if ((sizeof(GLushort) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(GLushort, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          GLushort val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
          int one = 1; int is_little = (int)*(unsigned char *)&one;
          unsigned char *bytes = (unsigned char *)&val;
          ret = _PyLong_AsByteArray((PyLongObject *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyObject *v;
          PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
          int bits, remaining_bits, is_negative = 0;
          int chunk_size = (sizeof(long) < 8) ? 30 : 62;
          if (likely(PyLong_CheckExact(x))) {
              v = __Pyx_NewRef(x);
          } else {
              v = PyNumber_Long(x);
              if (unlikely(!v)) return (GLushort) -1;
              assert(PyLong_CheckExact(v));
          }
          {
              int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
              if (unlikely(result < 0)) {
                  Py_DECREF(v);
                  return (GLushort) -1;
              }
              is_negative = result == 1;
          }
          if (is_unsigned && unlikely(is_negative)) {
              Py_DECREF(v);
              goto raise_neg_overflow;
          } else if (is_negative) {
              stepval = PyNumber_Invert(v);
              Py_DECREF(v);
              if (unlikely(!stepval))
                  return (GLushort) -1;
          } else {
              stepval = v;
          }
          v = NULL;
          val = (GLushort) 0;
          mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
          shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
          for (bits = 0; bits < (int) sizeof(GLushort) * 8 - chunk_size; bits += chunk_size) {
              PyObject *tmp, *digit;
              long idigit;
              digit = PyNumber_And(stepval, mask);
              if (unlikely(!digit)) goto done;
              idigit = PyLong_AsLong(digit);
              Py_DECREF(digit);
              if (unlikely(idigit < 0)) goto done;
              val |= ((GLushort) idigit) << bits;
              tmp = PyNumber_Rshift(stepval, shift);
              if (unlikely(!tmp)) goto done;
              Py_DECREF(stepval); stepval = tmp;
          }
          Py_DECREF(shift); shift = NULL;
          Py_DECREF(mask); mask = NULL;
          {
              long idigit = PyLong_AsLong(stepval);
              if (unlikely(idigit < 0)) goto done;
              remaining_bits = ((int) sizeof(GLushort) * 8) - bits - (is_unsigned ? 0 : 1);
              if (unlikely(idigit >= (1L << remaining_bits)))
                  goto raise_overflow;
              val |= ((GLushort) idigit) << bits;
          }
          if (!is_unsigned) {
              if (unlikely(val & (((GLushort) 1) << (sizeof(GLushort) * 8 - 1))))
                  goto raise_overflow;
              if (is_negative)
                  val = ~val;
          }
          ret = 0;
      done:
          Py_XDECREF(shift);
          Py_XDECREF(mask);
          Py_XDECREF(stepval);
  #endif
          if (unlikely(ret))
              return (GLushort) -1;
          return val;
      }
  raise_overflow:
      PyErr_SetString(PyExc_OverflowError,
          "value too large to convert to GLushort");
      return (GLushort) -1;
  raise_neg_overflow:
      PyErr_SetString(PyExc_OverflowError,
          "can't convert negative value to GLushort");
      return (GLushort) -1;
  }
  
/* CIntFromPy */
  static CYTHON_INLINE GLsizei __Pyx_PyLong_As_GLsizei(PyObject *x) {
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic push
  #pragma GCC diagnostic ignored "-Wconversion"
  #endif
      const GLsizei neg_one = (GLsizei) -1, const_zero = (GLsizei) 0;
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic pop
  #endif
      const int is_unsigned = neg_one > const_zero;
      if (unlikely(!PyLong_Check(x))) {
          GLsizei val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (GLsizei) -1;
          val = __Pyx_PyLong_As_GLsizei(tmp);
          Py_DECREF(tmp);
          return val;
      }
      if (is_unsigned) {
  #if CYTHON_USE_PYLONG_INTERNALS
          if (unlikely(__Pyx_PyLong_IsNeg(x))) {
              goto raise_neg_overflow;
          } else if (__Pyx_PyLong_IsCompact(x)) {
              __PYX_VERIFY_RETURN_INT(GLsizei, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
          } else {
              const digit* digits = __Pyx_PyLong_Digits(x);
              assert(__Pyx_PyLong_DigitCount(x) > 1);
              switch (__Pyx_PyLong_DigitCount(x)) {
                  case 2:
                      if ((8 * sizeof(GLsizei) > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(GLsizei, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(GLsizei) >= 2 * PyLong_SHIFT)) {
                              return (GLsizei) (((((GLsizei)digits[1]) << PyLong_SHIFT) | (GLsizei)digits[0]));
                          }
                      }
                      break;
                  case 3:
                      if ((8 * sizeof(GLsizei) > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(GLsizei, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(GLsizei) >= 3 * PyLong_SHIFT)) {
                              return (GLsizei) (((((((GLsizei)digits[2]) << PyLong_SHIFT) | (GLsizei)digits[1]) << PyLong_SHIFT) | (GLsizei)digits[0]));
                          }
                      }
                      break;
                  case 4:
                      if ((8 * sizeof(GLsizei) > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(GLsizei, 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(GLsizei) >= 4 * PyLong_SHIFT)) {
                              return (GLsizei) (((((((((GLsizei)digits[3]) << PyLong_SHIFT) | (GLsizei)digits[2]) << PyLong_SHIFT) | (GLsizei)digits[1]) << PyLong_SHIFT) | (GLsizei)digits[0]));
                          }
                      }
                      break;
              }
          }
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
          if (unlikely(Py_SIZE(x) < 0)) {
              goto raise_neg_overflow;
          }
  #else
          {
              int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
              if (unlikely(result < 0))
                  return (GLsizei) -1;
              if (unlikely(result == 1))
                  goto raise_neg_overflow;
          }
  #endif
          if ((sizeof(GLsizei) <= sizeof(unsigned long))) {
              __PYX_VERIFY_RETURN_INT_EXC(GLsizei, unsigned long, PyLong_AsUnsignedLong(x))
          } else if ((sizeof(GLsizei) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(GLsizei, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } else {
  #if CYTHON_USE_PYLONG_INTERNALS
          if (__Pyx_PyLong_IsCompact(x)) {
              __PYX_VERIFY_RETURN_INT(GLsizei, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
          } else {
              const digit* digits = __Pyx_PyLong_Digits(x);
              assert(__Pyx_PyLong_DigitCount(x) > 1);
              switch (__Pyx_PyLong_SignedDigitCount(x)) {
                  case -2:
                      if ((8 * sizeof(GLsizei) - 1 > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(GLsizei, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(GLsizei) - 1 > 2 * PyLong_SHIFT)) {
                              return (GLsizei) (((GLsizei)-1)*(((((GLsizei)digits[1]) << PyLong_SHIFT) | (GLsizei)digits[0])));
                          }
                      }
                      break;
                  case 2:
                      if ((8 * sizeof(GLsizei) > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(GLsizei, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(GLsizei) - 1 > 2 * PyLong_SHIFT)) {
                              return (GLsizei) ((((((GLsizei)digits[1]) << PyLong_SHIFT) | (GLsizei)digits[0])));
                          }
                      }
                      break;
                  case -3:
                      if ((8 * sizeof(GLsizei) - 1 > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(GLsizei, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(GLsizei) - 1 > 3 * PyLong_SHIFT)) {
                              return (GLsizei) (((GLsizei)-1)*(((((((GLsizei)digits[2]) << PyLong_SHIFT) | (GLsizei)digits[1]) << PyLong_SHIFT) | (GLsizei)digits[0])));
                          }
                      }
                      break;
                  case 3:
                      if ((8 * sizeof(GLsizei) > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(GLsizei, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(GLsizei) - 1 > 3 * PyLong_SHIFT)) {
                              return (GLsizei) ((((((((GLsizei)digits[2]) << PyLong_SHIFT) | (GLsizei)digits[1]) << PyLong_SHIFT) | (GLsizei)digits[0])));
                          }
                      }
                      break;
                  case -4:
                      if ((8 * sizeof(GLsizei) - 1 > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(GLsizei, 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(GLsizei) - 1 > 4 * PyLong_SHIFT)) {
                              return (GLsizei) (((GLsizei)-1)*(((((((((GLsizei)digits[3]) << PyLong_SHIFT) | (GLsizei)digits[2]) << PyLong_SHIFT) | (GLsizei)digits[1]) << PyLong_SHIFT) | (GLsizei)digits[0])));
                          }
                      }
                      break;
                  case 4:
                      if ((8 * sizeof(GLsizei) > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(GLsizei, 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(GLsizei) - 1 > 4 * PyLong_SHIFT)) {
                              return (GLsizei) ((((((((((GLsizei)digits[3]) << PyLong_SHIFT) | (GLsizei)digits[2]) << PyLong_SHIFT) | (GLsizei)digits[1]) << PyLong_SHIFT) | (GLsizei)digits[0])));
                          }
                      }
                      break;
              }
          }
  #endif
          if ((sizeof(GLsizei) <= sizeof(long))) {
              __PYX_VERIFY_RETURN_INT_EXC(GLsizei, long, PyLong_AsLong(x))
          } else if ((sizeof(GLsizei) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(GLsizei, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          GLsizei val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
          int one = 1; int is_little = (int)*(unsigned char *)&one;
          unsigned char *bytes = (unsigned char *)&val;
          ret = _PyLong_AsByteArray((PyLongObject *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyObject *v;
          PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
          int bits, remaining_bits, is_negative = 0;
          int chunk_size = (sizeof(long) < 8) ? 30 : 62;
          if (likely(PyLong_CheckExact(x))) {
              v = __Pyx_NewRef(x);
          } else {
              v = PyNumber_Long(x);
              if (unlikely(!v)) return (GLsizei) -1;
              assert(PyLong_CheckExact(v));
          }
          {
              int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
              if (unlikely(result < 0)) {
                  Py_DECREF(v);
                  return (GLsizei) -1;
              }
              is_negative = result == 1;
          }
          if (is_unsigned && unlikely(is_negative)) {
              Py_DECREF(v);
              goto raise_neg_overflow;
          } else if (is_negative) {
              stepval = PyNumber_Invert(v);
              Py_DECREF(v);
              if (unlikely(!stepval))
                  return (GLsizei) -1;
          } else {
              stepval = v;
          }
          v = NULL;
          val = (GLsizei) 0;
          mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
          shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
          for (bits = 0; bits < (int) sizeof(GLsizei) * 8 - chunk_size; bits += chunk_size) {
              PyObject *tmp, *digit;
              long idigit;
              digit = PyNumber_And(stepval, mask);
              if (unlikely(!digit)) goto done;
              idigit = PyLong_AsLong(digit);
              Py_DECREF(digit);
              if (unlikely(idigit < 0)) goto done;
              val |= ((GLsizei) idigit) << bits;
              tmp = PyNumber_Rshift(stepval, shift);
              if (unlikely(!tmp)) goto done;
              Py_DECREF(stepval); stepval = tmp;
          }
          Py_DECREF(shift); shift = NULL;
          Py_DECREF(mask); mask = NULL;
          {
              long idigit = PyLong_AsLong(stepval);
              if (unlikely(idigit < 0)) goto done;
              remaining_bits = ((int) sizeof(GLsizei) * 8) - bits - (is_unsigned ? 0 : 1);
              if (unlikely(idigit >= (1L << remaining_bits)))
                  goto raise_overflow;
              val |= ((GLsizei) idigit) << bits;
          }
          if (!is_unsigned) {
              if (unlikely(val & (((GLsizei) 1) << (sizeof(GLsizei) * 8 - 1))))
                  goto raise_overflow;
              if (is_negative)
                  val = ~val;
          }
          ret = 0;
      done:
          Py_XDECREF(shift);
          Py_XDECREF(mask);
          Py_XDECREF(stepval);
  #endif
          if (unlikely(ret))
              return (GLsizei) -1;
          return val;
      }
  raise_overflow:
      PyErr_SetString(PyExc_OverflowError,
          "value too large to convert to GLsizei");
      return (GLsizei) -1;
  raise_neg_overflow:
      PyErr_SetString(PyExc_OverflowError,
          "can't convert negative value to GLsizei");
      return (GLsizei) -1;
  }
  
/* CIntFromPy */
  static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *x) {
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic push
  #pragma GCC diagnostic ignored "-Wconversion"
  #endif
      const int neg_one = (int) -1, const_zero = (int) 0;
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic pop
  #endif
      const int is_unsigned = neg_one > const_zero;
      if (unlikely(!PyLong_Check(x))) {
          int val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (int) -1;
          val = __Pyx_PyLong_As_int(tmp);
          Py_DECREF(tmp);
          return val;
      }
      if (is_unsigned) {
  #if CYTHON_USE_PYLONG_INTERNALS
          if (unlikely(__Pyx_PyLong_IsNeg(x))) {
              goto raise_neg_overflow;
          } else if (__Pyx_PyLong_IsCompact(x)) {
              __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
          } else {
              const digit* digits = __Pyx_PyLong_Digits(x);
              assert(__Pyx_PyLong_DigitCount(x) > 1);
              switch (__Pyx_PyLong_DigitCount(x)) {
                  case 2:
                      if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) {
                              return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                          }
                      }
                      break;
                  case 3:
                      if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) {
                              return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                          }
                      }
                      break;
                  case 4:
                      if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) {
                              return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                          }
                      }
                      break;
              }
          }
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
          if (unlikely(Py_SIZE(x) < 0)) {
              goto raise_neg_overflow;
          }
  #else
          {
              int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
              if (unlikely(result < 0))
                  return (int) -1;
              if (unlikely(result == 1))
                  goto raise_neg_overflow;
          }
  #endif
          if ((sizeof(int) <= sizeof(unsigned long))) {
              __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
          } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } else {
  #if CYTHON_USE_PYLONG_INTERNALS
          if (__Pyx_PyLong_IsCompact(x)) {
              __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
          } else {
              const digit* digits = __Pyx_PyLong_Digits(x);
              assert(__Pyx_PyLong_DigitCount(x) > 1);
              switch (__Pyx_PyLong_SignedDigitCount(x)) {
                  case -2:
                      if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
                              return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                          }
                      }
                      break;
                  case 2:
                      if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
                              return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                          }
                      }
                      break;
                  case -3:
                      if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
                              return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                          }
                      }
                      break;
                  case 3:
                      if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
                              return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                          }
                      }
                      break;
                  case -4:
                      if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) {
                              return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                          }
                      }
                      break;
                  case 4:
                      if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) {
                              return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                          }
                      }
                      break;
              }
          }
  #endif
          if ((sizeof(int) <= sizeof(long))) {
              __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
          } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          int val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
          int one = 1; int is_little = (int)*(unsigned char *)&one;
          unsigned char *bytes = (unsigned char *)&val;
          ret = _PyLong_AsByteArray((PyLongObject *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyObject *v;
          PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
          int bits, remaining_bits, is_negative = 0;
          int chunk_size = (sizeof(long) < 8) ? 30 : 62;
          if (likely(PyLong_CheckExact(x))) {
              v = __Pyx_NewRef(x);
          } else {
              v = PyNumber_Long(x);
              if (unlikely(!v)) return (int) -1;
              assert(PyLong_CheckExact(v));
          }
          {
              int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
              if (unlikely(result < 0)) {
                  Py_DECREF(v);
                  return (int) -1;
              }
              is_negative = result == 1;
          }
          if (is_unsigned && unlikely(is_negative)) {
              Py_DECREF(v);
              goto raise_neg_overflow;
          } else if (is_negative) {
              stepval = PyNumber_Invert(v);
              Py_DECREF(v);
              if (unlikely(!stepval))
                  return (int) -1;
          } else {
              stepval = v;
          }
          v = NULL;
          val = (int) 0;
          mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
          shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
          for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) {
              PyObject *tmp, *digit;
              long idigit;
              digit = PyNumber_And(stepval, mask);
              if (unlikely(!digit)) goto done;
              idigit = PyLong_AsLong(digit);
              Py_DECREF(digit);
              if (unlikely(idigit < 0)) goto done;
              val |= ((int) idigit) << bits;
              tmp = PyNumber_Rshift(stepval, shift);
              if (unlikely(!tmp)) goto done;
              Py_DECREF(stepval); stepval = tmp;
          }
          Py_DECREF(shift); shift = NULL;
          Py_DECREF(mask); mask = NULL;
          {
              long idigit = PyLong_AsLong(stepval);
              if (unlikely(idigit < 0)) goto done;
              remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1);
              if (unlikely(idigit >= (1L << remaining_bits)))
                  goto raise_overflow;
              val |= ((int) idigit) << bits;
          }
          if (!is_unsigned) {
              if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1))))
                  goto raise_overflow;
              if (is_negative)
                  val = ~val;
          }
          ret = 0;
      done:
          Py_XDECREF(shift);
          Py_XDECREF(mask);
          Py_XDECREF(stepval);
  #endif
          if (unlikely(ret))
              return (int) -1;
          return val;
      }
  raise_overflow:
      PyErr_SetString(PyExc_OverflowError,
          "value too large to convert to int");
      return (int) -1;
  raise_neg_overflow:
      PyErr_SetString(PyExc_OverflowError,
          "can't convert negative value to int");
      return (int) -1;
  }
  
/* CIntFromPy */
  static CYTHON_INLINE long __Pyx_PyLong_As_long(PyObject *x) {
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic push
  #pragma GCC diagnostic ignored "-Wconversion"
  #endif
      const long neg_one = (long) -1, const_zero = (long) 0;
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic pop
  #endif
      const int is_unsigned = neg_one > const_zero;
      if (unlikely(!PyLong_Check(x))) {
          long val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (long) -1;
          val = __Pyx_PyLong_As_long(tmp);
          Py_DECREF(tmp);
          return val;
      }
      if (is_unsigned) {
  #if CYTHON_USE_PYLONG_INTERNALS
          if (unlikely(__Pyx_PyLong_IsNeg(x))) {
              goto raise_neg_overflow;
          } else if (__Pyx_PyLong_IsCompact(x)) {
              __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
          } else {
              const digit* digits = __Pyx_PyLong_Digits(x);
              assert(__Pyx_PyLong_DigitCount(x) > 1);
              switch (__Pyx_PyLong_DigitCount(x)) {
                  case 2:
                      if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) {
                              return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                          }
                      }
                      break;
                  case 3:
                      if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) {
                              return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                          }
                      }
                      break;
                  case 4:
                      if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) {
                              return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                          }
                      }
                      break;
              }
          }
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
          if (unlikely(Py_SIZE(x) < 0)) {
              goto raise_neg_overflow;
          }
  #else
          {
              int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
              if (unlikely(result < 0))
                  return (long) -1;
              if (unlikely(result == 1))
                  goto raise_neg_overflow;
          }
  #endif
          if ((sizeof(long) <= sizeof(unsigned long))) {
              __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
          } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } else {
  #if CYTHON_USE_PYLONG_INTERNALS
          if (__Pyx_PyLong_IsCompact(x)) {
              __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
          } else {
              const digit* digits = __Pyx_PyLong_Digits(x);
              assert(__Pyx_PyLong_DigitCount(x) > 1);
              switch (__Pyx_PyLong_SignedDigitCount(x)) {
                  case -2:
                      if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
                              return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                          }
                      }
                      break;
                  case 2:
                      if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
                              return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                          }
                      }
                      break;
                  case -3:
                      if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
                              return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                          }
                      }
                      break;
                  case 3:
                      if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
                              return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                          }
                      }
                      break;
                  case -4:
                      if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) {
                              return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                          }
                      }
                      break;
                  case 4:
                      if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) {
                              return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                          }
                      }
                      break;
              }
          }
  #endif
          if ((sizeof(long) <= sizeof(long))) {
              __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
          } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          long val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
          int one = 1; int is_little = (int)*(unsigned char *)&one;
          unsigned char *bytes = (unsigned char *)&val;
          ret = _PyLong_AsByteArray((PyLongObject *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyObject *v;
          PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
          int bits, remaining_bits, is_negative = 0;
          int chunk_size = (sizeof(long) < 8) ? 30 : 62;
          if (likely(PyLong_CheckExact(x))) {
              v = __Pyx_NewRef(x);
          } else {
              v = PyNumber_Long(x);
              if (unlikely(!v)) return (long) -1;
              assert(PyLong_CheckExact(v));
          }
          {
              int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
              if (unlikely(result < 0)) {
                  Py_DECREF(v);
                  return (long) -1;
              }
              is_negative = result == 1;
          }
          if (is_unsigned && unlikely(is_negative)) {
              Py_DECREF(v);
              goto raise_neg_overflow;
          } else if (is_negative) {
              stepval = PyNumber_Invert(v);
              Py_DECREF(v);
              if (unlikely(!stepval))
                  return (long) -1;
          } else {
              stepval = v;
          }
          v = NULL;
          val = (long) 0;
          mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
          shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
          for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) {
              PyObject *tmp, *digit;
              long idigit;
              digit = PyNumber_And(stepval, mask);
              if (unlikely(!digit)) goto done;
              idigit = PyLong_AsLong(digit);
              Py_DECREF(digit);
              if (unlikely(idigit < 0)) goto done;
              val |= ((long) idigit) << bits;
              tmp = PyNumber_Rshift(stepval, shift);
              if (unlikely(!tmp)) goto done;
              Py_DECREF(stepval); stepval = tmp;
          }
          Py_DECREF(shift); shift = NULL;
          Py_DECREF(mask); mask = NULL;
          {
              long idigit = PyLong_AsLong(stepval);
              if (unlikely(idigit < 0)) goto done;
              remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1);
              if (unlikely(idigit >= (1L << remaining_bits)))
                  goto raise_overflow;
              val |= ((long) idigit) << bits;
          }
          if (!is_unsigned) {
              if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1))))
                  goto raise_overflow;
              if (is_negative)
                  val = ~val;
          }
          ret = 0;
      done:
          Py_XDECREF(shift);
          Py_XDECREF(mask);
          Py_XDECREF(stepval);
  #endif
          if (unlikely(ret))
              return (long) -1;
          return val;
      }
  raise_overflow:
      PyErr_SetString(PyExc_OverflowError,
          "value too large to convert to long");
      return (long) -1;
  raise_neg_overflow:
      PyErr_SetString(PyExc_OverflowError,
          "can't convert negative value to long");
      return (long) -1;
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_From_unsigned_char(unsigned char value) {
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic push
  #pragma GCC diagnostic ignored "-Wconversion"
  #endif
      const unsigned char neg_one = (unsigned char) -1, const_zero = (unsigned char) 0;
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic pop
  #endif
      const int is_unsigned = neg_one > const_zero;
      if (is_unsigned) {
          if (sizeof(unsigned char) < sizeof(long)) {
              return PyLong_FromLong((long) value);
          } else if (sizeof(unsigned char) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } else if (sizeof(unsigned char) <= sizeof(unsigned PY_LONG_LONG)) {
              return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
  #endif
          }
      } else {
          if (sizeof(unsigned char) <= sizeof(long)) {
              return PyLong_FromLong((long) value);
          } else if (sizeof(unsigned char) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(unsigned char),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = NULL, *order_str = NULL;
          from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
          if (!from_bytes) return NULL;
          py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(unsigned char));
          if (!py_bytes) goto limited_bad;
          order_str = PyUnicode_FromString(little ? "little" : "big");
          if (!order_str) goto limited_bad;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntFromPy */
  static CYTHON_INLINE unsigned char __Pyx_PyLong_As_unsigned_char(PyObject *x) {
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic push
  #pragma GCC diagnostic ignored "-Wconversion"
  #endif
      const unsigned char neg_one = (unsigned char) -1, const_zero = (unsigned char) 0;
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic pop
  #endif
      const int is_unsigned = neg_one > const_zero;
      if (unlikely(!PyLong_Check(x))) {
          unsigned char val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (unsigned char) -1;
          val = __Pyx_PyLong_As_unsigned_char(tmp);
          Py_DECREF(tmp);
          return val;
      }
      if (is_unsigned) {
  #if CYTHON_USE_PYLONG_INTERNALS
          if (unlikely(__Pyx_PyLong_IsNeg(x))) {
              goto raise_neg_overflow;
          } else if (__Pyx_PyLong_IsCompact(x)) {
              __PYX_VERIFY_RETURN_INT(unsigned char, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
          } else {
              const digit* digits = __Pyx_PyLong_Digits(x);
              assert(__Pyx_PyLong_DigitCount(x) > 1);
              switch (__Pyx_PyLong_DigitCount(x)) {
                  case 2:
                      if ((8 * sizeof(unsigned char) > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(unsigned char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(unsigned char) >= 2 * PyLong_SHIFT)) {
                              return (unsigned char) (((((unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0]));
                          }
                      }
                      break;
                  case 3:
                      if ((8 * sizeof(unsigned char) > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(unsigned char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(unsigned char) >= 3 * PyLong_SHIFT)) {
                              return (unsigned char) (((((((unsigned char)digits[2]) << PyLong_SHIFT) | (unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0]));
                          }
                      }
                      break;
                  case 4:
                      if ((8 * sizeof(unsigned char) > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(unsigned char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(unsigned char) >= 4 * PyLong_SHIFT)) {
                              return (unsigned char) (((((((((unsigned char)digits[3]) << PyLong_SHIFT) | (unsigned char)digits[2]) << PyLong_SHIFT) | (unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0]));
                          }
                      }
                      break;
              }
          }
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
          if (unlikely(Py_SIZE(x) < 0)) {
              goto raise_neg_overflow;
          }
  #else
          {
              int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
              if (unlikely(result < 0))
                  return (unsigned char) -1;
              if (unlikely(result == 1))
                  goto raise_neg_overflow;
          }
  #endif
          if ((sizeof(unsigned char) <= sizeof(unsigned long))) {
              __PYX_VERIFY_RETURN_INT_EXC(unsigned char, unsigned long, PyLong_AsUnsignedLong(x))
          } else if ((sizeof(unsigned char) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(unsigned char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } else {
  #if CYTHON_USE_PYLONG_INTERNALS
          if (__Pyx_PyLong_IsCompact(x)) {
              __PYX_VERIFY_RETURN_INT(unsigned char, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
          } else {
              const digit* digits = __Pyx_PyLong_Digits(x);
              assert(__Pyx_PyLong_DigitCount(x) > 1);
              switch (__Pyx_PyLong_SignedDigitCount(x)) {
                  case -2:
                      if ((8 * sizeof(unsigned char) - 1 > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(unsigned char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(unsigned char) - 1 > 2 * PyLong_SHIFT)) {
                              return (unsigned char) (((unsigned char)-1)*(((((unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0])));
                          }
                      }
                      break;
                  case 2:
                      if ((8 * sizeof(unsigned char) > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(unsigned char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(unsigned char) - 1 > 2 * PyLong_SHIFT)) {
                              return (unsigned char) ((((((unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0])));
                          }
                      }
                      break;
                  case -3:
                      if ((8 * sizeof(unsigned char) - 1 > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(unsigned char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(unsigned char) - 1 > 3 * PyLong_SHIFT)) {
                              return (unsigned char) (((unsigned char)-1)*(((((((unsigned char)digits[2]) << PyLong_SHIFT) | (unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0])));
                          }
                      }
                      break;
                  case 3:
                      if ((8 * sizeof(unsigned char) > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(unsigned char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(unsigned char) - 1 > 3 * PyLong_SHIFT)) {
                              return (unsigned char) ((((((((unsigned char)digits[2]) << PyLong_SHIFT) | (unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0])));
                          }
                      }
                      break;
                  case -4:
                      if ((8 * sizeof(unsigned char) - 1 > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(unsigned char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(unsigned char) - 1 > 4 * PyLong_SHIFT)) {
                              return (unsigned char) (((unsigned char)-1)*(((((((((unsigned char)digits[3]) << PyLong_SHIFT) | (unsigned char)digits[2]) << PyLong_SHIFT) | (unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0])));
                          }
                      }
                      break;
                  case 4:
                      if ((8 * sizeof(unsigned char) > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(unsigned char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(unsigned char) - 1 > 4 * PyLong_SHIFT)) {
                              return (unsigned char) ((((((((((unsigned char)digits[3]) << PyLong_SHIFT) | (unsigned char)digits[2]) << PyLong_SHIFT) | (unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0])));
                          }
                      }
                      break;
              }
          }
  #endif
          if ((sizeof(unsigned char) <= sizeof(long))) {
              __PYX_VERIFY_RETURN_INT_EXC(unsigned char, long, PyLong_AsLong(x))
          } else if ((sizeof(unsigned char) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(unsigned char, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          unsigned char val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
          int one = 1; int is_little = (int)*(unsigned char *)&one;
          unsigned char *bytes = (unsigned char *)&val;
          ret = _PyLong_AsByteArray((PyLongObject *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyObject *v;
          PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
          int bits, remaining_bits, is_negative = 0;
          int chunk_size = (sizeof(long) < 8) ? 30 : 62;
          if (likely(PyLong_CheckExact(x))) {
              v = __Pyx_NewRef(x);
          } else {
              v = PyNumber_Long(x);
              if (unlikely(!v)) return (unsigned char) -1;
              assert(PyLong_CheckExact(v));
          }
          {
              int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
              if (unlikely(result < 0)) {
                  Py_DECREF(v);
                  return (unsigned char) -1;
              }
              is_negative = result == 1;
          }
          if (is_unsigned && unlikely(is_negative)) {
              Py_DECREF(v);
              goto raise_neg_overflow;
          } else if (is_negative) {
              stepval = PyNumber_Invert(v);
              Py_DECREF(v);
              if (unlikely(!stepval))
                  return (unsigned char) -1;
          } else {
              stepval = v;
          }
          v = NULL;
          val = (unsigned char) 0;
          mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
          shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
          for (bits = 0; bits < (int) sizeof(unsigned char) * 8 - chunk_size; bits += chunk_size) {
              PyObject *tmp, *digit;
              long idigit;
              digit = PyNumber_And(stepval, mask);
              if (unlikely(!digit)) goto done;
              idigit = PyLong_AsLong(digit);
              Py_DECREF(digit);
              if (unlikely(idigit < 0)) goto done;
              val |= ((unsigned char) idigit) << bits;
              tmp = PyNumber_Rshift(stepval, shift);
              if (unlikely(!tmp)) goto done;
              Py_DECREF(stepval); stepval = tmp;
          }
          Py_DECREF(shift); shift = NULL;
          Py_DECREF(mask); mask = NULL;
          {
              long idigit = PyLong_AsLong(stepval);
              if (unlikely(idigit < 0)) goto done;
              remaining_bits = ((int) sizeof(unsigned char) * 8) - bits - (is_unsigned ? 0 : 1);
              if (unlikely(idigit >= (1L << remaining_bits)))
                  goto raise_overflow;
              val |= ((unsigned char) idigit) << bits;
          }
          if (!is_unsigned) {
              if (unlikely(val & (((unsigned char) 1) << (sizeof(unsigned char) * 8 - 1))))
                  goto raise_overflow;
              if (is_negative)
                  val = ~val;
          }
          ret = 0;
      done:
          Py_XDECREF(shift);
          Py_XDECREF(mask);
          Py_XDECREF(stepval);
  #endif
          if (unlikely(ret))
              return (unsigned char) -1;
          return val;
      }
  raise_overflow:
      PyErr_SetString(PyExc_OverflowError,
          "value too large to convert to unsigned char");
      return (unsigned char) -1;
  raise_neg_overflow:
      PyErr_SetString(PyExc_OverflowError,
          "can't convert negative value to unsigned char");
      return (unsigned char) -1;
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_From_unsigned_int(unsigned int value) {
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic push
  #pragma GCC diagnostic ignored "-Wconversion"
  #endif
      const unsigned int neg_one = (unsigned int) -1, const_zero = (unsigned int) 0;
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic pop
  #endif
      const int is_unsigned = neg_one > const_zero;
      if (is_unsigned) {
          if (sizeof(unsigned int) < sizeof(long)) {
              return PyLong_FromLong((long) value);
          } else if (sizeof(unsigned int) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } else if (sizeof(unsigned int) <= sizeof(unsigned PY_LONG_LONG)) {
              return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
  #endif
          }
      } else {
          if (sizeof(unsigned int) <= sizeof(long)) {
              return PyLong_FromLong((long) value);
          } else if (sizeof(unsigned int) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(unsigned int),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = NULL, *order_str = NULL;
          from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
          if (!from_bytes) return NULL;
          py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(unsigned int));
          if (!py_bytes) goto limited_bad;
          order_str = PyUnicode_FromString(little ? "little" : "big");
          if (!order_str) goto limited_bad;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* ObjectAsUCS4 */
  static void __Pyx__PyObject_AsPy_UCS4_raise_error(long ival) {
     if (ival < 0) {
         if (!PyErr_Occurred())
             PyErr_SetString(PyExc_OverflowError,
                             "cannot convert negative value to Py_UCS4");
     } else {
         PyErr_SetString(PyExc_OverflowError,
                         "value too large to convert to Py_UCS4");
     }
  }
  static Py_UCS4 __Pyx__PyObject_AsPy_UCS4(PyObject* x) {
     long ival;
     ival = __Pyx_PyLong_As_long(x);
     if (unlikely(!__Pyx_is_valid_index(ival, 1114111 + 1))) {
         __Pyx__PyObject_AsPy_UCS4_raise_error(ival);
         return (Py_UCS4)-1;
     }
     return (Py_UCS4)ival;
  }
  
/* UpdateUnpickledDict */
  static int __Pyx__UpdateUnpickledDict(PyObject *obj, PyObject *state, Py_ssize_t index) {
      PyObject *state_dict = __Pyx_PySequence_ITEM(state, index);
      if (unlikely(!state_dict)) {
          return -1;
      }
      int non_empty = PyObject_IsTrue(state_dict);
      if (non_empty == 0) {
          Py_DECREF(state_dict);
          return 0;
      } else if (unlikely(non_empty == -1)) {
          return -1;
      }
      PyObject *dict;
      #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
      dict = PyObject_GetAttrString(obj, "__dict__");
      #else
      dict = PyObject_GenericGetDict(obj, NULL);
      #endif
      if (unlikely(!dict)) {
          Py_DECREF(state_dict);
          return -1;
      }
      int result;
      if (likely(PyDict_CheckExact(dict))) {
          result = PyDict_Update(dict, state_dict);
      } else {
          PyObject *obj_result = __Pyx_PyObject_CallMethod1(dict, __pyx_mstate_global->__pyx_n_u_update, state_dict);
          if (likely(obj_result)) {
              Py_DECREF(obj_result);
              result = 0;
          } else {
              result = -1;
          }
      }
      Py_DECREF(state_dict);
      Py_DECREF(dict);
      return result;
  }
  static int __Pyx_UpdateUnpickledDict(PyObject *obj, PyObject *state, Py_ssize_t index) {
      Py_ssize_t state_size = __Pyx_PyTuple_GET_SIZE(state);
      #if !CYTHON_ASSUME_SAFE_SIZE
      if (unlikely(state_size == -1)) return -1;
      #endif
      if (state_size <= index) {
          return 0;
      }
      return __Pyx__UpdateUnpickledDict(obj, state, index);
  }
  
/* CheckUnpickleChecksum */
  static void __Pyx_RaiseUnpickleChecksumError(long checksum, long checksum1, long checksum2, long checksum3, const char *members) {
      PyObject *pickle_module = PyImport_ImportModule("pickle");
      if (unlikely(!pickle_module)) return;
      PyObject *pickle_error = PyObject_GetAttrString(pickle_module, "PickleError");
      Py_DECREF(pickle_module);
      if (unlikely(!pickle_error)) return;
      if (checksum2 == checksum1) {
          PyErr_Format(pickle_error, "Incompatible checksums (0x%x vs (0x%x) = (%s))",
              checksum, checksum1, members);
      } else if (checksum3 == checksum2) {
          PyErr_Format(pickle_error, "Incompatible checksums (0x%x vs (0x%x, 0x%x) = (%s))",
              checksum, checksum1, checksum2, members);
      } else {
          PyErr_Format(pickle_error, "Incompatible checksums (0x%x vs (0x%x, 0x%x, 0x%x) = (%s))",
              checksum, checksum1, checksum2, checksum3, members);
      }
      Py_DECREF(pickle_error);
  }
  static int __Pyx_CheckUnpickleChecksum(long checksum, long checksum1, long checksum2, long checksum3, const char *members) {
      int found = 0;
      found |= checksum1 == checksum;
      found |= checksum2 == checksum;
      found |= checksum3 == checksum;
      if (likely(found))
          return 0;
      __Pyx_RaiseUnpickleChecksumError(checksum, checksum1, checksum2, checksum3, members);
      return -1;
  }
  
/* CIntFromPy */
  static CYTHON_INLINE char __Pyx_PyLong_As_char(PyObject *x) {
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic push
  #pragma GCC diagnostic ignored "-Wconversion"
  #endif
      const char neg_one = (char) -1, const_zero = (char) 0;
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic pop
  #endif
      const int is_unsigned = neg_one > const_zero;
      if (unlikely(!PyLong_Check(x))) {
          char val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (char) -1;
          val = __Pyx_PyLong_As_char(tmp);
          Py_DECREF(tmp);
          return val;
      }
      if (is_unsigned) {
  #if CYTHON_USE_PYLONG_INTERNALS
          if (unlikely(__Pyx_PyLong_IsNeg(x))) {
              goto raise_neg_overflow;
          } else if (__Pyx_PyLong_IsCompact(x)) {
              __PYX_VERIFY_RETURN_INT(char, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
          } else {
              const digit* digits = __Pyx_PyLong_Digits(x);
              assert(__Pyx_PyLong_DigitCount(x) > 1);
              switch (__Pyx_PyLong_DigitCount(x)) {
                  case 2:
                      if ((8 * sizeof(char) > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(char) >= 2 * PyLong_SHIFT)) {
                              return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
                          }
                      }
                      break;
                  case 3:
                      if ((8 * sizeof(char) > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(char) >= 3 * PyLong_SHIFT)) {
                              return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
                          }
                      }
                      break;
                  case 4:
                      if ((8 * sizeof(char) > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(char) >= 4 * PyLong_SHIFT)) {
                              return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
                          }
                      }
                      break;
              }
          }
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
          if (unlikely(Py_SIZE(x) < 0)) {
              goto raise_neg_overflow;
          }
  #else
          {
              int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
              if (unlikely(result < 0))
                  return (char) -1;
              if (unlikely(result == 1))
                  goto raise_neg_overflow;
          }
  #endif
          if ((sizeof(char) <= sizeof(unsigned long))) {
              __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x))
          } else if ((sizeof(char) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } else {
  #if CYTHON_USE_PYLONG_INTERNALS
          if (__Pyx_PyLong_IsCompact(x)) {
              __PYX_VERIFY_RETURN_INT(char, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
          } else {
              const digit* digits = __Pyx_PyLong_Digits(x);
              assert(__Pyx_PyLong_DigitCount(x) > 1);
              switch (__Pyx_PyLong_SignedDigitCount(x)) {
                  case -2:
                      if ((8 * sizeof(char) - 1 > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(char) - 1 > 2 * PyLong_SHIFT)) {
                              return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
                          }
                      }
                      break;
                  case 2:
                      if ((8 * sizeof(char) > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(char) - 1 > 2 * PyLong_SHIFT)) {
                              return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
                          }
                      }
                      break;
                  case -3:
                      if ((8 * sizeof(char) - 1 > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(char) - 1 > 3 * PyLong_SHIFT)) {
                              return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
                          }
                      }
                      break;
                  case 3:
                      if ((8 * sizeof(char) > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(char) - 1 > 3 * PyLong_SHIFT)) {
                              return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
                          }
                      }
                      break;
                  case -4:
                      if ((8 * sizeof(char) - 1 > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(char) - 1 > 4 * PyLong_SHIFT)) {
                              return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
                          }
                      }
                      break;
                  case 4:
                      if ((8 * sizeof(char) > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(char) - 1 > 4 * PyLong_SHIFT)) {
                              return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
                          }
                      }
                      break;
              }
          }
  #endif
          if ((sizeof(char) <= sizeof(long))) {
              __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x))
          } else if ((sizeof(char) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          char val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
          int one = 1; int is_little = (int)*(unsigned char *)&one;
          unsigned char *bytes = (unsigned char *)&val;
          ret = _PyLong_AsByteArray((PyLongObject *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyObject *v;
          PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
          int bits, remaining_bits, is_negative = 0;
          int chunk_size = (sizeof(long) < 8) ? 30 : 62;
          if (likely(PyLong_CheckExact(x))) {
              v = __Pyx_NewRef(x);
          } else {
              v = PyNumber_Long(x);
              if (unlikely(!v)) return (char) -1;
              assert(PyLong_CheckExact(v));
          }
          {
              int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
              if (unlikely(result < 0)) {
                  Py_DECREF(v);
                  return (char) -1;
              }
              is_negative = result == 1;
          }
          if (is_unsigned && unlikely(is_negative)) {
              Py_DECREF(v);
              goto raise_neg_overflow;
          } else if (is_negative) {
              stepval = PyNumber_Invert(v);
              Py_DECREF(v);
              if (unlikely(!stepval))
                  return (char) -1;
          } else {
              stepval = v;
          }
          v = NULL;
          val = (char) 0;
          mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
          shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
          for (bits = 0; bits < (int) sizeof(char) * 8 - chunk_size; bits += chunk_size) {
              PyObject *tmp, *digit;
              long idigit;
              digit = PyNumber_And(stepval, mask);
              if (unlikely(!digit)) goto done;
              idigit = PyLong_AsLong(digit);
              Py_DECREF(digit);
              if (unlikely(idigit < 0)) goto done;
              val |= ((char) idigit) << bits;
              tmp = PyNumber_Rshift(stepval, shift);
              if (unlikely(!tmp)) goto done;
              Py_DECREF(stepval); stepval = tmp;
          }
          Py_DECREF(shift); shift = NULL;
          Py_DECREF(mask); mask = NULL;
          {
              long idigit = PyLong_AsLong(stepval);
              if (unlikely(idigit < 0)) goto done;
              remaining_bits = ((int) sizeof(char) * 8) - bits - (is_unsigned ? 0 : 1);
              if (unlikely(idigit >= (1L << remaining_bits)))
                  goto raise_overflow;
              val |= ((char) idigit) << bits;
          }
          if (!is_unsigned) {
              if (unlikely(val & (((char) 1) << (sizeof(char) * 8 - 1))))
                  goto raise_overflow;
              if (is_negative)
                  val = ~val;
          }
          ret = 0;
      done:
          Py_XDECREF(shift);
          Py_XDECREF(mask);
          Py_XDECREF(stepval);
  #endif
          if (unlikely(ret))
              return (char) -1;
          return val;
      }
  raise_overflow:
      PyErr_SetString(PyExc_OverflowError,
          "value too large to convert to char");
      return (char) -1;
  raise_neg_overflow:
      PyErr_SetString(PyExc_OverflowError,
          "can't convert negative value to char");
      return (char) -1;
  }
  
/* FormatTypeName */
  #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
  static __Pyx_TypeName
  __Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp)
  {
      PyObject *module = NULL, *name = NULL, *result = NULL;
      #if __PYX_LIMITED_VERSION_HEX < 0x030b0000
      name = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
                                                 __pyx_mstate_global->__pyx_n_u_qualname);
      #else
      name = PyType_GetQualName(tp);
      #endif
      if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) goto bad;
      module = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
                                                 __pyx_mstate_global->__pyx_n_u_module);
      if (unlikely(module == NULL) || unlikely(!PyUnicode_Check(module))) goto bad;
      if (PyUnicode_CompareWithASCIIString(module, "builtins") == 0) {
          result = name;
          name = NULL;
          goto done;
      }
      result = PyUnicode_FromFormat("%U.%U", module, name);
      if (unlikely(result == NULL)) goto bad;
    done:
      Py_XDECREF(name);
      Py_XDECREF(module);
      return result;
    bad:
      PyErr_Clear();
      if (name) {
          result = name;
          name = NULL;
      } else {
          result = __Pyx_NewRef(__pyx_mstate_global->__pyx_kp_u__16);
      }
      goto done;
  }
  #endif
  
/* GetRuntimeVersion */
  #if __PYX_LIMITED_VERSION_HEX < 0x030b0000
  void __Pyx_init_runtime_version(void) {
      if (__Pyx_cached_runtime_version == 0) {
          const char* rt_version = Py_GetVersion();
          unsigned long version = 0;
          unsigned long factor = 0x01000000UL;
          unsigned int digit = 0;
          int i = 0;
          while (factor) {
              while ('0' <= rt_version[i] && rt_version[i] <= '9') {
                  digit = digit * 10 + (unsigned int) (rt_version[i] - '0');
                  ++i;
              }
              version += factor * digit;
              if (rt_version[i] != '.')
                  break;
              digit = 0;
              factor >>= 8;
              ++i;
          }
          __Pyx_cached_runtime_version = version;
      }
  }
  #endif
  static unsigned long __Pyx_get_runtime_version(void) {
  #if __PYX_LIMITED_VERSION_HEX >= 0x030b0000
      return Py_Version & ~0xFFUL;
  #else
      return __Pyx_cached_runtime_version;
  #endif
  }
  
/* IterNextPlain (used by CoroutineBase) */
  #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
  static PyObject *__Pyx_GetBuiltinNext_LimitedAPI(void) {
      if (unlikely(!__pyx_mstate_global->__Pyx_GetBuiltinNext_LimitedAPI_cache))
          __pyx_mstate_global->__Pyx_GetBuiltinNext_LimitedAPI_cache = __Pyx_GetBuiltinName(__pyx_mstate_global->__pyx_n_u_next);
      return __pyx_mstate_global->__Pyx_GetBuiltinNext_LimitedAPI_cache;
  }
  #endif
  static CYTHON_INLINE PyObject *__Pyx_PyIter_Next_Plain(PyObject *iterator) {
  #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
      PyObject *result;
      PyObject *next = __Pyx_GetBuiltinNext_LimitedAPI();
      if (unlikely(!next)) return NULL;
      result = PyObject_CallFunctionObjArgs(next, iterator, NULL);
      return result;
  #else
      (void)__Pyx_GetBuiltinName; // only for early limited API
      iternextfunc iternext = __Pyx_PyObject_GetIterNextFunc(iterator);
      assert(iternext);
      return iternext(iterator);
  #endif
  }
  
/* ReturnWithStopIteration (used by CoroutineBase) */
  static void __Pyx__ReturnWithStopIteration(PyObject* value, int async);
  static CYTHON_INLINE void __Pyx_ReturnWithStopIteration(PyObject* value, int async, int iternext) {
      if (value == Py_None) {
          if (async || !iternext)
              PyErr_SetNone(async ? PyExc_StopAsyncIteration : PyExc_StopIteration);
          return;
      }
      __Pyx__ReturnWithStopIteration(value, async);
  }
  static void __Pyx__ReturnWithStopIteration(PyObject* value, int async) {
  #if CYTHON_COMPILING_IN_CPYTHON
      __Pyx_PyThreadState_declare
  #endif
      PyObject *exc;
      PyObject *exc_type = async ? PyExc_StopAsyncIteration : PyExc_StopIteration;
  #if CYTHON_COMPILING_IN_CPYTHON
      if ((PY_VERSION_HEX >= (0x030C00A6)) || unlikely(PyTuple_Check(value) || PyExceptionInstance_Check(value))) {
          if (PY_VERSION_HEX >= (0x030e00A1)) {
              exc = __Pyx_PyObject_CallOneArg(exc_type, value);
          } else {
              PyObject *args_tuple = PyTuple_New(1);
              if (unlikely(!args_tuple)) return;
              Py_INCREF(value);
              PyTuple_SET_ITEM(args_tuple, 0, value);
              exc = PyObject_Call(exc_type, args_tuple, NULL);
              Py_DECREF(args_tuple);
          }
          if (unlikely(!exc)) return;
      } else {
          Py_INCREF(value);
          exc = value;
      }
      #if CYTHON_FAST_THREAD_STATE
      __Pyx_PyThreadState_assign
      #if CYTHON_USE_EXC_INFO_STACK
      if (!__pyx_tstate->exc_info->exc_value)
      #else
      if (!__pyx_tstate->exc_type)
      #endif
      {
          Py_INCREF(exc_type);
          __Pyx_ErrRestore(exc_type, exc, NULL);
          return;
      }
      #endif
  #else
      exc = __Pyx_PyObject_CallOneArg(exc_type, value);
      if (unlikely(!exc)) return;
  #endif
      PyErr_SetObject(exc_type, exc);
      Py_DECREF(exc);
  }
  
/* CoroutineBase (used by Generator) */
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #include <frameobject.h>
  #if PY_VERSION_HEX >= 0x030b00a6 && !defined(PYPY_VERSION)
    #ifndef Py_BUILD_CORE
      #define Py_BUILD_CORE 1
    #endif
    #include "internal/pycore_frame.h"
  #endif
  #endif // CYTHON_COMPILING_IN_LIMITED_API
  static CYTHON_INLINE void
  __Pyx_Coroutine_Undelegate(__pyx_CoroutineObject *gen) {
  #if CYTHON_USE_AM_SEND
      gen->yieldfrom_am_send = NULL;
  #endif
      Py_CLEAR(gen->yieldfrom);
  }
  static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *__pyx_tstate, PyObject **pvalue) {
      PyObject *et, *ev, *tb;
      PyObject *value = NULL;
      CYTHON_UNUSED_VAR(__pyx_tstate);
      __Pyx_ErrFetch(&et, &ev, &tb);
      if (!et) {
          Py_XDECREF(tb);
          Py_XDECREF(ev);
          Py_INCREF(Py_None);
          *pvalue = Py_None;
          return 0;
      }
      if (likely(et == PyExc_StopIteration)) {
          if (!ev) {
              Py_INCREF(Py_None);
              value = Py_None;
          }
          else if (likely(__Pyx_IS_TYPE(ev, (PyTypeObject*)PyExc_StopIteration))) {
              #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL
              value = PyObject_GetAttr(ev, __pyx_mstate_global->__pyx_n_u_value);
              if (unlikely(!value)) goto limited_api_failure;
              #else
              value = ((PyStopIterationObject *)ev)->value;
              Py_INCREF(value);
              #endif
              Py_DECREF(ev);
          }
          else if (unlikely(PyTuple_Check(ev))) {
              Py_ssize_t tuple_size = __Pyx_PyTuple_GET_SIZE(ev);
              #if !CYTHON_ASSUME_SAFE_SIZE
              if (unlikely(tuple_size < 0)) {
                  Py_XDECREF(tb);
                  Py_DECREF(ev);
                  Py_DECREF(et);
                  return -1;
              }
              #endif
              if (tuple_size >= 1) {
  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                  value = PyTuple_GET_ITEM(ev, 0);
                  Py_INCREF(value);
  #elif CYTHON_ASSUME_SAFE_MACROS
                  value = PySequence_ITEM(ev, 0);
  #else
                  value = PySequence_GetItem(ev, 0);
                  if (!value) goto limited_api_failure;
  #endif
              } else {
                  Py_INCREF(Py_None);
                  value = Py_None;
              }
              Py_DECREF(ev);
          }
          else if (!__Pyx_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) {
              value = ev;
          }
          if (likely(value)) {
              Py_XDECREF(tb);
              Py_DECREF(et);
              *pvalue = value;
              return 0;
          }
      } else if (!__Pyx_PyErr_GivenExceptionMatches(et, PyExc_StopIteration)) {
          __Pyx_ErrRestore(et, ev, tb);
          return -1;
      }
      PyErr_NormalizeException(&et, &ev, &tb);
      if (unlikely(!PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration))) {
          __Pyx_ErrRestore(et, ev, tb);
          return -1;
      }
      Py_XDECREF(tb);
      Py_DECREF(et);
  #if CYTHON_COMPILING_IN_LIMITED_API
      value = PyObject_GetAttr(ev, __pyx_mstate_global->__pyx_n_u_value);
  #else
      value = ((PyStopIterationObject *)ev)->value;
      Py_INCREF(value);
  #endif
      Py_DECREF(ev);
  #if CYTHON_COMPILING_IN_LIMITED_API
      if (unlikely(!value)) return -1;
  #endif
      *pvalue = value;
      return 0;
  #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL || !CYTHON_ASSUME_SAFE_MACROS
    limited_api_failure:
      Py_XDECREF(et);
      Py_XDECREF(tb);
      Py_XDECREF(ev);
      return -1;
  #endif
  }
  static CYTHON_INLINE
  __Pyx_PySendResult __Pyx_Coroutine_status_from_result(PyObject **retval) {
      if (*retval) {
          return PYGEN_NEXT;
      } else if (likely(__Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, retval) == 0)) {
          return PYGEN_RETURN;
      } else {
          return PYGEN_ERROR;
      }
  }
  static CYTHON_INLINE
  void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *exc_state) {
  #if PY_VERSION_HEX >= 0x030B00a4
      Py_CLEAR(exc_state->exc_value);
  #else
      PyObject *t, *v, *tb;
      t = exc_state->exc_type;
      v = exc_state->exc_value;
      tb = exc_state->exc_traceback;
      exc_state->exc_type = NULL;
      exc_state->exc_value = NULL;
      exc_state->exc_traceback = NULL;
      Py_XDECREF(t);
      Py_XDECREF(v);
      Py_XDECREF(tb);
  #endif
  }
  #define __Pyx_Coroutine_AlreadyRunningError(gen)  (__Pyx__Coroutine_AlreadyRunningError(gen), (PyObject*)NULL)
  static void __Pyx__Coroutine_AlreadyRunningError(__pyx_CoroutineObject *gen) {
      const char *msg;
      CYTHON_MAYBE_UNUSED_VAR(gen);
      if ((0)) {
      #ifdef __Pyx_Coroutine_USED
      } else if (__Pyx_Coroutine_Check((PyObject*)gen)) {
          msg = "coroutine already executing";
      #endif
      #ifdef __Pyx_AsyncGen_USED
      } else if (__Pyx_AsyncGen_CheckExact((PyObject*)gen)) {
          msg = "async generator already executing";
      #endif
      } else {
          msg = "generator already executing";
      }
      PyErr_SetString(PyExc_ValueError, msg);
  }
  static void __Pyx_Coroutine_AlreadyTerminatedError(PyObject *gen, PyObject *value, int closing) {
      CYTHON_MAYBE_UNUSED_VAR(gen);
      CYTHON_MAYBE_UNUSED_VAR(closing);
      #ifdef __Pyx_Coroutine_USED
      if (!closing && __Pyx_Coroutine_Check(gen)) {
          PyErr_SetString(PyExc_RuntimeError, "cannot reuse already awaited coroutine");
      } else
      #endif
      if (value) {
          #ifdef __Pyx_AsyncGen_USED
          if (__Pyx_AsyncGen_CheckExact(gen))
              PyErr_SetNone(PyExc_StopAsyncIteration);
          else
          #endif
          PyErr_SetNone(PyExc_StopIteration);
      }
  }
  static
  __Pyx_PySendResult __Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, PyObject **result, int closing) {
      __Pyx_PyThreadState_declare
      PyThreadState *tstate;
      __Pyx_ExcInfoStruct *exc_state;
      PyObject *retval;
      assert(__Pyx_Coroutine_get_is_running(self));  // Callers should ensure is_running
      if (unlikely(self->resume_label == -1)) {
          __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)self, value, closing);
          return PYGEN_ERROR;
      }
  #if CYTHON_FAST_THREAD_STATE
      __Pyx_PyThreadState_assign
      tstate = __pyx_tstate;
  #else
      tstate = __Pyx_PyThreadState_Current;
  #endif
      exc_state = &self->gi_exc_state;
      if (exc_state->exc_value) {
          #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
          #else
          PyObject *exc_tb;
          #if PY_VERSION_HEX >= 0x030B00a4 && !CYTHON_COMPILING_IN_CPYTHON
          exc_tb = PyException_GetTraceback(exc_state->exc_value);
          #elif PY_VERSION_HEX >= 0x030B00a4
          exc_tb = ((PyBaseExceptionObject*) exc_state->exc_value)->traceback;
          #else
          exc_tb = exc_state->exc_traceback;
          #endif
          if (exc_tb) {
              PyTracebackObject *tb = (PyTracebackObject *) exc_tb;
              PyFrameObject *f = tb->tb_frame;
              assert(f->f_back == NULL);
              #if PY_VERSION_HEX >= 0x030B00A1
              f->f_back = PyThreadState_GetFrame(tstate);
              #else
              Py_XINCREF(tstate->frame);
              f->f_back = tstate->frame;
              #endif
              #if PY_VERSION_HEX >= 0x030B00a4 && !CYTHON_COMPILING_IN_CPYTHON
              Py_DECREF(exc_tb);
              #endif
          }
          #endif
      }
  #if CYTHON_USE_EXC_INFO_STACK
      exc_state->previous_item = tstate->exc_info;
      tstate->exc_info = exc_state;
  #else
      if (exc_state->exc_type) {
          __Pyx_ExceptionSwap(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback);
      } else {
          __Pyx_Coroutine_ExceptionClear(exc_state);
          __Pyx_ExceptionSave(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback);
      }
  #endif
      retval = self->body(self, tstate, value);
  #if CYTHON_USE_EXC_INFO_STACK
      exc_state = &self->gi_exc_state;
      tstate->exc_info = exc_state->previous_item;
      exc_state->previous_item = NULL;
      __Pyx_Coroutine_ResetFrameBackpointer(exc_state);
  #endif
      *result = retval;
      if (self->resume_label == -1) {
          return likely(retval) ? PYGEN_RETURN : PYGEN_ERROR;
      }
      return PYGEN_NEXT;
  }
  static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state) {
  #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API
      CYTHON_UNUSED_VAR(exc_state);
  #else
      PyObject *exc_tb;
      #if PY_VERSION_HEX >= 0x030B00a4
      if (!exc_state->exc_value) return;
      exc_tb = PyException_GetTraceback(exc_state->exc_value);
      #else
      exc_tb = exc_state->exc_traceback;
      #endif
      if (likely(exc_tb)) {
          PyTracebackObject *tb = (PyTracebackObject *) exc_tb;
          PyFrameObject *f = tb->tb_frame;
          Py_CLEAR(f->f_back);
          #if PY_VERSION_HEX >= 0x030B00a4
          Py_DECREF(exc_tb);
          #endif
      }
  #endif
  }
  #define __Pyx_Coroutine_MethodReturnFromResult(gen, result, retval, iternext)\
      ((result) == PYGEN_NEXT ? (retval) : __Pyx__Coroutine_MethodReturnFromResult(gen, result, retval, iternext))
  static PyObject *
  __Pyx__Coroutine_MethodReturnFromResult(PyObject* gen, __Pyx_PySendResult result, PyObject *retval, int iternext) {
      CYTHON_MAYBE_UNUSED_VAR(gen);
      if (likely(result == PYGEN_RETURN)) {
          int is_async = 0;
          #ifdef __Pyx_AsyncGen_USED
          is_async = __Pyx_AsyncGen_CheckExact(gen);
          #endif
          __Pyx_ReturnWithStopIteration(retval, is_async, iternext);
          Py_XDECREF(retval);
      }
      return NULL;
  }
  #if CYTHON_COMPILING_IN_CPYTHON
  static CYTHON_INLINE
  PyObject *__Pyx_PyGen_Send(PyGenObject *gen, PyObject *arg) {
  #if PY_VERSION_HEX <= 0x030A00A1
      return _PyGen_Send(gen, arg);
  #else
      PyObject *result;
      if (PyIter_Send((PyObject*)gen, arg ? arg : Py_None, &result) == PYGEN_RETURN) {
          if (PyAsyncGen_CheckExact(gen)) {
              assert(result == Py_None);
              PyErr_SetNone(PyExc_StopAsyncIteration);
          }
          else if (result == Py_None) {
              PyErr_SetNone(PyExc_StopIteration);
          }
          else {
  #if PY_VERSION_HEX < 0x030d00A1
              _PyGen_SetStopIterationValue(result);
  #else
              if (!PyTuple_Check(result) && !PyExceptionInstance_Check(result)) {
                  PyErr_SetObject(PyExc_StopIteration, result);
              } else {
                  PyObject *exc = __Pyx_PyObject_CallOneArg(PyExc_StopIteration, result);
                  if (likely(exc != NULL)) {
                      PyErr_SetObject(PyExc_StopIteration, exc);
                      Py_DECREF(exc);
                  }
              }
  #endif
          }
          Py_DECREF(result);
          result = NULL;
      }
      return result;
  #endif
  }
  #endif
  static CYTHON_INLINE __Pyx_PySendResult
  __Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen, PyObject** retval) {
      __Pyx_PySendResult result;
      PyObject *val = NULL;
      assert(__Pyx_Coroutine_get_is_running(gen));
      __Pyx_Coroutine_Undelegate(gen);
      __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, &val);
      result = __Pyx_Coroutine_SendEx(gen, val, retval, 0);
      Py_XDECREF(val);
      return result;
  }
  #if CYTHON_USE_AM_SEND
  static __Pyx_PySendResult
  __Pyx_Coroutine_SendToDelegate(__pyx_CoroutineObject *gen, __Pyx_pyiter_sendfunc gen_am_send, PyObject *value, PyObject **retval) {
      PyObject *ret = NULL;
      __Pyx_PySendResult delegate_result, result;
      assert(__Pyx_Coroutine_get_is_running(gen));
      delegate_result = gen_am_send(gen->yieldfrom, value, &ret);
      if (delegate_result == PYGEN_NEXT) {
          assert (ret != NULL);
          *retval = ret;
          return PYGEN_NEXT;
      }
      assert (delegate_result != PYGEN_ERROR || ret == NULL);
      __Pyx_Coroutine_Undelegate(gen);
      result = __Pyx_Coroutine_SendEx(gen, ret, retval, 0);
      Py_XDECREF(ret);
      return result;
  }
  #endif
  static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) {
      PyObject *retval = NULL;
      __Pyx_PySendResult result = __Pyx_Coroutine_AmSend(self, value, &retval);
      return __Pyx_Coroutine_MethodReturnFromResult(self, result, retval, 0);
  }
  static __Pyx_PySendResult
  __Pyx_Coroutine_AmSend(PyObject *self, PyObject *value, PyObject **retval) {
      __Pyx_PySendResult result;
      __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
      if (unlikely(__Pyx_Coroutine_test_and_set_is_running(gen))) {
          *retval = __Pyx_Coroutine_AlreadyRunningError(gen);
          return PYGEN_ERROR;
      }
      #if CYTHON_USE_AM_SEND
      if (gen->yieldfrom_am_send) {
          result = __Pyx_Coroutine_SendToDelegate(gen, gen->yieldfrom_am_send, value, retval);
      } else
      #endif
      if (gen->yieldfrom) {
          PyObject *yf = gen->yieldfrom;
          PyObject *ret;
        #if !CYTHON_USE_AM_SEND
          #ifdef __Pyx_Generator_USED
          if (__Pyx_Generator_CheckExact(yf)) {
              ret = __Pyx_Coroutine_Send(yf, value);
          } else
          #endif
          #ifdef __Pyx_Coroutine_USED
          if (__Pyx_Coroutine_Check(yf)) {
              ret = __Pyx_Coroutine_Send(yf, value);
          } else
          #endif
          #ifdef __Pyx_AsyncGen_USED
          if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
              ret = __Pyx_async_gen_asend_send(yf, value);
          } else
          #endif
          #if CYTHON_COMPILING_IN_CPYTHON
          if (PyGen_CheckExact(yf)) {
              ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
          } else
          if (PyCoro_CheckExact(yf)) {
              ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
          } else
          #endif
        #endif
          {
              #if !CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x03080000
              if (value == Py_None && PyIter_Check(yf))
                  ret = __Pyx_PyIter_Next_Plain(yf);
              else
              #endif
                  ret = __Pyx_PyObject_CallMethod1(yf, __pyx_mstate_global->__pyx_n_u_send, value);
          }
          if (likely(ret)) {
              __Pyx_Coroutine_unset_is_running(gen);
              *retval = ret;
              return PYGEN_NEXT;
          }
          result = __Pyx_Coroutine_FinishDelegation(gen, retval);
      } else {
          result = __Pyx_Coroutine_SendEx(gen, value, retval, 0);
      }
      __Pyx_Coroutine_unset_is_running(gen);
      return result;
  }
  static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) {
      __Pyx_PySendResult result;
      PyObject *retval = NULL;
      CYTHON_UNUSED_VAR(gen);
      assert(__Pyx_Coroutine_get_is_running(gen));
      #ifdef __Pyx_Generator_USED
      if (__Pyx_Generator_CheckExact(yf)) {
          result = __Pyx_Coroutine_Close(yf, &retval);
      } else
      #endif
      #ifdef __Pyx_Coroutine_USED
      if (__Pyx_Coroutine_Check(yf)) {
          result = __Pyx_Coroutine_Close(yf, &retval);
      } else
      if (__Pyx_CoroutineAwait_CheckExact(yf)) {
          result = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf);
      } else
      #endif
      #ifdef __Pyx_AsyncGen_USED
      if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
          retval = __Pyx_async_gen_asend_close(yf, NULL);
          result = PYGEN_RETURN;
      } else
      if (__pyx_PyAsyncGenAThrow_CheckExact(yf)) {
          retval = __Pyx_async_gen_athrow_close(yf, NULL);
          result = PYGEN_RETURN;
      } else
      #endif
      {
          PyObject *meth;
          result = PYGEN_RETURN;
          meth = __Pyx_PyObject_GetAttrStrNoError(yf, __pyx_mstate_global->__pyx_n_u_close);
          if (unlikely(!meth)) {
              if (unlikely(PyErr_Occurred())) {
                  PyErr_WriteUnraisable(yf);
              }
          } else {
              retval = __Pyx_PyObject_CallNoArg(meth);
              Py_DECREF(meth);
              if (unlikely(!retval)) {
                  result = PYGEN_ERROR;
              }
          }
      }
      Py_XDECREF(retval);
      return result == PYGEN_ERROR ? -1 : 0;
  }
  static PyObject *__Pyx_Generator_Next(PyObject *self) {
      __Pyx_PySendResult result;
      PyObject *retval = NULL;
      __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
      if (unlikely(__Pyx_Coroutine_test_and_set_is_running(gen))) {
          return __Pyx_Coroutine_AlreadyRunningError(gen);
      }
      #if CYTHON_USE_AM_SEND
      if (gen->yieldfrom_am_send) {
          result = __Pyx_Coroutine_SendToDelegate(gen, gen->yieldfrom_am_send, Py_None, &retval);
      } else
      #endif
      if (gen->yieldfrom) {
          PyObject *yf = gen->yieldfrom;
          PyObject *ret;
          #ifdef __Pyx_Generator_USED
          if (__Pyx_Generator_CheckExact(yf)) {
              ret = __Pyx_Generator_Next(yf);
          } else
          #endif
          #ifdef __Pyx_Coroutine_USED
          if (__Pyx_Coroutine_CheckExact(yf)) {
              ret = __Pyx_Coroutine_Send(yf, Py_None);
          } else
          #endif
          #if CYTHON_COMPILING_IN_CPYTHON && (PY_VERSION_HEX < 0x030A00A3 || !CYTHON_USE_AM_SEND)
          if (PyGen_CheckExact(yf)) {
              ret = __Pyx_PyGen_Send((PyGenObject*)yf, NULL);
          } else
          #endif
              ret = __Pyx_PyIter_Next_Plain(yf);
          if (likely(ret)) {
              __Pyx_Coroutine_unset_is_running(gen);
              return ret;
          }
          result = __Pyx_Coroutine_FinishDelegation(gen, &retval);
      } else {
          result = __Pyx_Coroutine_SendEx(gen, Py_None, &retval, 0);
      }
      __Pyx_Coroutine_unset_is_running(gen);
      return __Pyx_Coroutine_MethodReturnFromResult(self, result, retval, 1);
  }
  static PyObject *__Pyx_Coroutine_Close_Method(PyObject *self, PyObject *arg) {
      PyObject *retval = NULL;
      __Pyx_PySendResult result;
      CYTHON_UNUSED_VAR(arg);
      result = __Pyx_Coroutine_Close(self, &retval);
      if (unlikely(result == PYGEN_ERROR))
          return NULL;
      Py_XDECREF(retval);
      Py_RETURN_NONE;
  }
  static __Pyx_PySendResult
  __Pyx_Coroutine_Close(PyObject *self, PyObject **retval) {
      __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
      __Pyx_PySendResult result;
      PyObject *yf;
      int err = 0;
      if (unlikely(__Pyx_Coroutine_test_and_set_is_running(gen))) {
          *retval = __Pyx_Coroutine_AlreadyRunningError(gen);
          return PYGEN_ERROR;
      }
      yf = gen->yieldfrom;
      if (yf) {
          Py_INCREF(yf);
          err = __Pyx_Coroutine_CloseIter(gen, yf);
          __Pyx_Coroutine_Undelegate(gen);
          Py_DECREF(yf);
      }
      if (err == 0)
          PyErr_SetNone(PyExc_GeneratorExit);
      result = __Pyx_Coroutine_SendEx(gen, NULL, retval, 1);
      if (result == PYGEN_ERROR) {
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __Pyx_Coroutine_unset_is_running(gen);
          if (!__Pyx_PyErr_Occurred()) {
              return PYGEN_RETURN;
          } else if (likely(__Pyx_PyErr_ExceptionMatches2(PyExc_GeneratorExit, PyExc_StopIteration))) {
              __Pyx_PyErr_Clear();
              return PYGEN_RETURN;
          }
          return PYGEN_ERROR;
      } else if (likely(result == PYGEN_RETURN && *retval == Py_None)) {
          __Pyx_Coroutine_unset_is_running(gen);
          return PYGEN_RETURN;
      } else {
          const char *msg;
          Py_DECREF(*retval);
          *retval = NULL;
          if ((0)) {
          #ifdef __Pyx_Coroutine_USED
          } else if (__Pyx_Coroutine_Check(self)) {
              msg = "coroutine ignored GeneratorExit";
          #endif
          #ifdef __Pyx_AsyncGen_USED
          } else if (__Pyx_AsyncGen_CheckExact(self)) {
              msg = "async generator ignored GeneratorExit";
          #endif
          } else {
              msg = "generator ignored GeneratorExit";
          }
          PyErr_SetString(PyExc_RuntimeError, msg);
          __Pyx_Coroutine_unset_is_running(gen);
          return PYGEN_ERROR;
      }
  }
  static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject *val, PyObject *tb,
                                          PyObject *args, int close_on_genexit) {
      __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
      PyObject *yf;
      if (unlikely(__Pyx_Coroutine_test_and_set_is_running(gen)))
          return __Pyx_Coroutine_AlreadyRunningError(gen);
      yf = gen->yieldfrom;
      if (yf) {
          __Pyx_PySendResult result;
          PyObject *ret;
          Py_INCREF(yf);
          if (__Pyx_PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit) && close_on_genexit) {
              int err = __Pyx_Coroutine_CloseIter(gen, yf);
              Py_DECREF(yf);
              __Pyx_Coroutine_Undelegate(gen);
              if (err < 0)
                  goto propagate_exception;
              goto throw_here;
          }
          if (0
          #ifdef __Pyx_Generator_USED
              || __Pyx_Generator_CheckExact(yf)
          #endif
          #ifdef __Pyx_Coroutine_USED
              || __Pyx_Coroutine_Check(yf)
          #endif
              ) {
              ret = __Pyx__Coroutine_Throw(yf, typ, val, tb, args, close_on_genexit);
          #ifdef __Pyx_Coroutine_USED
          } else if (__Pyx_CoroutineAwait_CheckExact(yf)) {
              ret = __Pyx__Coroutine_Throw(((__pyx_CoroutineAwaitObject*)yf)->coroutine, typ, val, tb, args, close_on_genexit);
          #endif
          } else {
              PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(yf, __pyx_mstate_global->__pyx_n_u_throw);
              if (unlikely(!meth)) {
                  Py_DECREF(yf);
                  if (unlikely(PyErr_Occurred())) {
                      __Pyx_Coroutine_unset_is_running(gen);
                      return NULL;
                  }
                  __Pyx_Coroutine_Undelegate(gen);
                  goto throw_here;
              }
              if (likely(args)) {
                  ret = __Pyx_PyObject_Call(meth, args, NULL);
              } else {
                  PyObject *cargs[4] = {NULL, typ, val, tb};
                  size_t nargs = 1U + (val != NULL) + (tb != NULL);
                  ret = __Pyx_PyObject_FastCall(meth, cargs+1, nargs | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
              }
              Py_DECREF(meth);
          }
          Py_DECREF(yf);
          if (ret) {
              __Pyx_Coroutine_unset_is_running(gen);
              return ret;
          }
          result = __Pyx_Coroutine_FinishDelegation(gen, &ret);
          __Pyx_Coroutine_unset_is_running(gen);
          return __Pyx_Coroutine_MethodReturnFromResult(self, result, ret, 0);
      }
  throw_here:
      __Pyx_Raise(typ, val, tb, NULL);
  propagate_exception:
      {
          PyObject *retval = NULL;
          __Pyx_PySendResult result = __Pyx_Coroutine_SendEx(gen, NULL, &retval, 0);
          __Pyx_Coroutine_unset_is_running(gen);
          return __Pyx_Coroutine_MethodReturnFromResult(self, result, retval, 0);
      }
  }
  static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) {
      PyObject *typ;
      PyObject *val = NULL;
      PyObject *tb = NULL;
      if (unlikely(!PyArg_UnpackTuple(args, "throw", 1, 3, &typ, &val, &tb)))
          return NULL;
      return __Pyx__Coroutine_Throw(self, typ, val, tb, args, 1);
  }
  static CYTHON_INLINE int __Pyx_Coroutine_traverse_excstate(__Pyx_ExcInfoStruct *exc_state, visitproc visit, void *arg) {
  #if PY_VERSION_HEX >= 0x030B00a4
      Py_VISIT(exc_state->exc_value);
  #else
      Py_VISIT(exc_state->exc_type);
      Py_VISIT(exc_state->exc_value);
      Py_VISIT(exc_state->exc_traceback);
  #endif
      return 0;
  }
  static int __Pyx_Coroutine_traverse(__pyx_CoroutineObject *gen, visitproc visit, void *arg) {
      {
          int e = __Pyx_call_type_traverse((PyObject*)gen, 1, visit, arg);
          if (e) return e;
      }
      Py_VISIT(gen->closure);
      Py_VISIT(gen->classobj);
      Py_VISIT(gen->yieldfrom);
      return __Pyx_Coroutine_traverse_excstate(&gen->gi_exc_state, visit, arg);
  }
  static int __Pyx_Coroutine_clear(PyObject *self) {
      __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
      Py_CLEAR(gen->closure);
      Py_CLEAR(gen->classobj);
      __Pyx_Coroutine_Undelegate(gen);
      __Pyx_Coroutine_ExceptionClear(&gen->gi_exc_state);
  #ifdef __Pyx_AsyncGen_USED
      if (__Pyx_AsyncGen_CheckExact(self)) {
          Py_CLEAR(((__pyx_PyAsyncGenObject*)gen)->ag_finalizer);
      }
  #endif
      Py_CLEAR(gen->gi_code);
      Py_CLEAR(gen->gi_frame);
      Py_CLEAR(gen->gi_name);
      Py_CLEAR(gen->gi_qualname);
      Py_CLEAR(gen->gi_modulename);
      return 0;
  }
  static void __Pyx_Coroutine_dealloc(PyObject *self) {
      __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
      PyObject_GC_UnTrack(gen);
      #if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
      if (gen->gi_weakreflist != NULL)
      #endif
          PyObject_ClearWeakRefs(self);
      if (gen->resume_label >= 0) {
          PyObject_GC_Track(self);
  #if CYTHON_USE_TP_FINALIZE
          if (unlikely(PyObject_CallFinalizerFromDealloc(self)))
  #else
          {
              destructor del = __Pyx_PyObject_GetSlot(gen, tp_del, destructor);
              if (del) del(self);
          }
          if (unlikely(Py_REFCNT(self) > 0))
  #endif
          {
              return;
          }
          PyObject_GC_UnTrack(self);
      }
  #ifdef __Pyx_AsyncGen_USED
      if (__Pyx_AsyncGen_CheckExact(self)) {
          /* We have to handle this case for asynchronous generators
             right here, because this code has to be between UNTRACK
             and GC_Del. */
          Py_CLEAR(((__pyx_PyAsyncGenObject*)self)->ag_finalizer);
      }
  #endif
      __Pyx_Coroutine_clear(self);
      __Pyx_PyHeapTypeObject_GC_Del(gen);
  }
  #if CYTHON_USE_TP_FINALIZE
  static void __Pyx_Coroutine_del(PyObject *self) {
      PyObject *error_type, *error_value, *error_traceback;
      __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
      __Pyx_PyThreadState_declare
      if (gen->resume_label < 0) {
          return;
      }
      __Pyx_PyThreadState_assign
      __Pyx_ErrFetch(&error_type, &error_value, &error_traceback);
  #ifdef __Pyx_AsyncGen_USED
      if (__Pyx_AsyncGen_CheckExact(self)) {
          __pyx_PyAsyncGenObject *agen = (__pyx_PyAsyncGenObject*)self;
          PyObject *finalizer = agen->ag_finalizer;
          if (finalizer && !agen->ag_closed) {
              PyObject *res = __Pyx_PyObject_CallOneArg(finalizer, self);
              if (unlikely(!res)) {
                  PyErr_WriteUnraisable(self);
              } else {
                  Py_DECREF(res);
              }
              __Pyx_ErrRestore(error_type, error_value, error_traceback);
              return;
          }
      }
  #endif
      if (unlikely(gen->resume_label == 0 && !error_value)) {
  #ifdef __Pyx_Coroutine_USED
  #ifdef __Pyx_Generator_USED
      if (!__Pyx_Generator_CheckExact(self))
  #endif
          {
          PyObject_GC_UnTrack(self);
          if (unlikely(PyErr_WarnFormat(PyExc_RuntimeWarning, 1, "coroutine '%.50S' was never awaited", gen->gi_qualname) < 0))
              PyErr_WriteUnraisable(self);
          PyObject_GC_Track(self);
          }
  #endif
      } else {
          PyObject *retval = NULL;
          __Pyx_PySendResult result = __Pyx_Coroutine_Close(self, &retval);
          if (result == PYGEN_ERROR) {
              PyErr_WriteUnraisable(self);
          } else {
              Py_XDECREF(retval);
          }
      }
      __Pyx_ErrRestore(error_type, error_value, error_traceback);
  }
  #endif
  static PyObject *
  __Pyx_Coroutine_get_name(__pyx_CoroutineObject *self, void *context)
  {
      PyObject *name = self->gi_name;
      CYTHON_UNUSED_VAR(context);
      if (unlikely(!name)) name = Py_None;
      Py_INCREF(name);
      return name;
  }
  static int
  __Pyx_Coroutine_set_name(__pyx_CoroutineObject *self, PyObject *value, void *context)
  {
      CYTHON_UNUSED_VAR(context);
      if (unlikely(value == NULL || !PyUnicode_Check(value))) {
          PyErr_SetString(PyExc_TypeError,
                          "__name__ must be set to a string object");
          return -1;
      }
      Py_INCREF(value);
      __Pyx_Py_XDECREF_SET(self->gi_name, value);
      return 0;
  }
  static PyObject *
  __Pyx_Coroutine_get_qualname(__pyx_CoroutineObject *self, void *context)
  {
      PyObject *name = self->gi_qualname;
      CYTHON_UNUSED_VAR(context);
      if (unlikely(!name)) name = Py_None;
      Py_INCREF(name);
      return name;
  }
  static int
  __Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value, void *context)
  {
      CYTHON_UNUSED_VAR(context);
      if (unlikely(value == NULL || !PyUnicode_Check(value))) {
          PyErr_SetString(PyExc_TypeError,
                          "__qualname__ must be set to a string object");
          return -1;
      }
      Py_INCREF(value);
      __Pyx_Py_XDECREF_SET(self->gi_qualname, value);
      return 0;
  }
  #if !CYTHON_COMPILING_IN_LIMITED_API
  static PyObject *
  __Pyx__Coroutine_get_frame_locked(__pyx_CoroutineObject *self) {
      PyObject *frame;
      frame = self->gi_frame;
      if (!frame) {
          if (unlikely(!self->gi_code)) {
              Py_RETURN_NONE;
          }
          PyObject *globals = PyDict_New();
          if (unlikely(!globals)) return NULL;
          frame = (PyObject *) PyFrame_New(
              PyThreadState_Get(),            /*PyThreadState *tstate,*/
              (PyCodeObject*) self->gi_code,  /*PyCodeObject *code,*/
              globals,                        /*PyObject *globals,*/
              0                               /*PyObject *locals*/
          );
          Py_DECREF(globals);
          if (unlikely(!frame))
              return NULL;
          if (unlikely(self->gi_frame)) {
              Py_DECREF(frame);
              frame = self->gi_frame;
          } else {
              self->gi_frame = frame;
          }
      }
      Py_INCREF(frame);
      return frame;
  }
  #endif
  static PyObject *
  __Pyx__Coroutine_get_frame(__pyx_CoroutineObject *self)
  {
  #if !CYTHON_COMPILING_IN_LIMITED_API
      PyObject *frame;
      __Pyx_BEGIN_CRITICAL_SECTION((PyObject*)self);
      frame = __Pyx__Coroutine_get_frame_locked(self);
      __Pyx_END_CRITICAL_SECTION();
      return frame;
  #else
      CYTHON_UNUSED_VAR(self);
      Py_RETURN_NONE;
  #endif
  }
  static PyObject *
  __Pyx_Coroutine_get_frame(__pyx_CoroutineObject *self, void *context) {
      CYTHON_UNUSED_VAR(context);
      PyObject *frame = self->gi_frame;
      if (frame)
          return __Pyx_NewRef(frame);
      return __Pyx__Coroutine_get_frame(self);
  }
  static __pyx_CoroutineObject *__Pyx__Coroutine_New(
              PyTypeObject* type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
              PyObject *name, PyObject *qualname, PyObject *module_name) {
      __pyx_CoroutineObject *gen = PyObject_GC_New(__pyx_CoroutineObject, type);
      if (unlikely(!gen))
          return NULL;
      return __Pyx__Coroutine_NewInit(gen, body, code, closure, name, qualname, module_name);
  }
  static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
              __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
              PyObject *name, PyObject *qualname, PyObject *module_name) {
      gen->body = body;
      gen->closure = closure;
      Py_XINCREF(closure);
      gen->is_running = 0;
      gen->resume_label = 0;
      gen->classobj = NULL;
      gen->yieldfrom = NULL;
      gen->yieldfrom_am_send = NULL;
      #if PY_VERSION_HEX >= 0x030B00a4 && !CYTHON_COMPILING_IN_LIMITED_API
      gen->gi_exc_state.exc_value = NULL;
      #else
      gen->gi_exc_state.exc_type = NULL;
      gen->gi_exc_state.exc_value = NULL;
      gen->gi_exc_state.exc_traceback = NULL;
      #endif
  #if CYTHON_USE_EXC_INFO_STACK
      gen->gi_exc_state.previous_item = NULL;
  #endif
  #if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
      gen->gi_weakreflist = NULL;
  #endif
      Py_XINCREF(qualname);
      gen->gi_qualname = qualname;
      Py_XINCREF(name);
      gen->gi_name = name;
      Py_XINCREF(module_name);
      gen->gi_modulename = module_name;
      Py_XINCREF(code);
      gen->gi_code = code;
      gen->gi_frame = NULL;
  #if CYTHON_USE_SYS_MONITORING && (CYTHON_PROFILE || CYTHON_TRACE)
      memset(gen->__pyx_pymonitoring_state, 0, sizeof(gen->__pyx_pymonitoring_state));
      gen->__pyx_pymonitoring_version = 0;
  #endif
      PyObject_GC_Track(gen);
      return gen;
  }
  static char __Pyx_Coroutine_test_and_set_is_running(__pyx_CoroutineObject *gen) {
      char result;
      __Pyx_BEGIN_CRITICAL_SECTION((PyObject*)gen);
      result = gen->is_running;
      gen->is_running = 1;
      __Pyx_END_CRITICAL_SECTION();
      return result;
  }
  static void __Pyx_Coroutine_unset_is_running(__pyx_CoroutineObject *gen) {
      __Pyx_BEGIN_CRITICAL_SECTION((PyObject*)gen);
      assert(gen->is_running);
      gen->is_running = 0;
      __Pyx_END_CRITICAL_SECTION();
  }
  static char __Pyx_Coroutine_get_is_running(__pyx_CoroutineObject *gen) {
      char result;
      __Pyx_BEGIN_CRITICAL_SECTION((PyObject*)gen);
      result = gen->is_running;
      __Pyx_END_CRITICAL_SECTION();
      return result;
  }
  static PyObject *__Pyx_Coroutine_get_is_running_getter(PyObject *gen, void *closure) {
      CYTHON_UNUSED_VAR(closure);
      char result = __Pyx_Coroutine_get_is_running((__pyx_CoroutineObject*)gen);
      if (result) Py_RETURN_TRUE;
      else Py_RETURN_FALSE;
  }
  #if __PYX_HAS_PY_AM_SEND == 2
  static void __Pyx_SetBackportTypeAmSend(PyTypeObject *type, __Pyx_PyAsyncMethodsStruct *static_amsend_methods, __Pyx_pyiter_sendfunc am_send) {
      Py_ssize_t ptr_offset = (char*)(type->tp_as_async) - (char*)type;
      if (ptr_offset < 0 || ptr_offset > type->tp_basicsize) {
          return;
      }
      memcpy((void*)static_amsend_methods, (void*)(type->tp_as_async), sizeof(*type->tp_as_async));
      static_amsend_methods->am_send = am_send;
      type->tp_as_async = __Pyx_SlotTpAsAsync(static_amsend_methods);
  }
  #endif
  static PyObject *__Pyx_Coroutine_fail_reduce_ex(PyObject *self, PyObject *arg) {
      CYTHON_UNUSED_VAR(arg);
      __Pyx_TypeName self_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE((PyObject*)self));
      PyErr_Format(PyExc_TypeError, "cannot pickle '" __Pyx_FMT_TYPENAME "' object",
                           self_type_name);
      __Pyx_DECREF_TypeName(self_type_name);
      return NULL;
  }
  
/* Generator */
  static PyMethodDef __pyx_Generator_methods[] = {
      {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O,
       PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")},
      {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS,
       PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")},
      {"close", (PyCFunction) __Pyx_Coroutine_Close_Method, METH_NOARGS,
       PyDoc_STR("close() -> raise GeneratorExit inside generator.")},
      {"__reduce_ex__", (PyCFunction) __Pyx_Coroutine_fail_reduce_ex, METH_O, 0},
      {"__reduce__", (PyCFunction) __Pyx_Coroutine_fail_reduce_ex, METH_NOARGS, 0},
      {0, 0, 0, 0}
  };
  static PyMemberDef __pyx_Generator_memberlist[] = {
      {"gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY,
       PyDoc_STR("object being iterated by 'yield from', or None")},
      {"gi_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL},
      {"__module__", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_modulename), 0, 0},
  #if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
      {"__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CoroutineObject, gi_weakreflist), READONLY, 0},
  #endif
      {0, 0, 0, 0, 0}
  };
  static PyGetSetDef __pyx_Generator_getsets[] = {
      {"__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name,
       PyDoc_STR("name of the generator"), 0},
      {"__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname,
       PyDoc_STR("qualified name of the generator"), 0},
      {"gi_frame", (getter)__Pyx_Coroutine_get_frame, NULL,
       PyDoc_STR("Frame of the generator"), 0},
      {"gi_running", __Pyx_Coroutine_get_is_running_getter, NULL, NULL, NULL},
      {0, 0, 0, 0, 0}
  };
  static PyType_Slot __pyx_GeneratorType_slots[] = {
      {Py_tp_dealloc, (void *)__Pyx_Coroutine_dealloc},
      {Py_tp_traverse, (void *)__Pyx_Coroutine_traverse},
      {Py_tp_iter, (void *)PyObject_SelfIter},
      {Py_tp_iternext, (void *)__Pyx_Generator_Next},
      {Py_tp_methods, (void *)__pyx_Generator_methods},
      {Py_tp_members, (void *)__pyx_Generator_memberlist},
      {Py_tp_getset, (void *)__pyx_Generator_getsets},
      {Py_tp_getattro, (void *) PyObject_GenericGetAttr},
  #if CYTHON_USE_TP_FINALIZE
      {Py_tp_finalize, (void *)__Pyx_Coroutine_del},
  #endif
  #if __PYX_HAS_PY_AM_SEND == 1
      {Py_am_send, (void *)__Pyx_Coroutine_AmSend},
  #endif
      {0, 0},
  };
  static PyType_Spec __pyx_GeneratorType_spec = {
      __PYX_TYPE_MODULE_PREFIX "generator",
      sizeof(__pyx_CoroutineObject),
      0,
  #if PY_VERSION_HEX >= 0x030C0000 && !CYTHON_COMPILING_IN_LIMITED_API
      Py_TPFLAGS_MANAGED_WEAKREF |
  #endif
      Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION |
      Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | __Pyx_TPFLAGS_HAVE_AM_SEND,
      __pyx_GeneratorType_slots
  };
  #if __PYX_HAS_PY_AM_SEND == 2
  static __Pyx_PyAsyncMethodsStruct __pyx_Generator_as_async;
  #endif
  static int __pyx_Generator_init(PyObject *module) {
      __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module);
      mstate->__pyx_GeneratorType = __Pyx_FetchCommonTypeFromSpec(
          mstate->__pyx_CommonTypesMetaclassType, module, &__pyx_GeneratorType_spec, NULL);
      if (unlikely(!mstate->__pyx_GeneratorType)) {
          return -1;
      }
  #if __PYX_HAS_PY_AM_SEND == 2
      __Pyx_SetBackportTypeAmSend(mstate->__pyx_GeneratorType, &__pyx_Generator_as_async, &__Pyx_Coroutine_AmSend);
  #endif
      return 0;
  }
  static PyObject *__Pyx_Generator_GetInlinedResult(PyObject *self) {
      __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
      PyObject *retval = NULL;
      if (unlikely(__Pyx_Coroutine_test_and_set_is_running(gen))) {
          return __Pyx_Coroutine_AlreadyRunningError(gen);
      }
      __Pyx_PySendResult result = __Pyx_Coroutine_SendEx(gen, Py_None, &retval, 0);
      __Pyx_Coroutine_unset_is_running(gen);
      (void) result;
      assert (result == PYGEN_RETURN || result == PYGEN_ERROR);
      assert ((result == PYGEN_RETURN && retval != NULL) || (result == PYGEN_ERROR && retval == NULL));
      return retval;
  }
  
/* CheckBinaryVersion */
  static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) {
      const unsigned long MAJOR_MINOR = 0xFFFF0000UL;
      if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR))
          return 0;
      if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR)))
          return 1;
      {
          char message[200];
          PyOS_snprintf(message, sizeof(message),
                        "compile time Python version %d.%d "
                        "of module '%.100s' "
                        "%s "
                        "runtime version %d.%d",
                         (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF),
                         __Pyx_MODULE_NAME,
                         (allow_newer) ? "was newer than" : "does not match",
                         (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF)
         );
          return PyErr_WarnEx(NULL, message, 1);
      }
  }
  
/* NewCodeObj */
  #if CYTHON_COMPILING_IN_LIMITED_API
      static PyObject* __Pyx__PyCode_New(int a, int p, int k, int l, int s, int f,
                                         PyObject *code, PyObject *c, PyObject* n, PyObject *v,
                                         PyObject *fv, PyObject *cell, PyObject* fn,
                                         PyObject *name, int fline, PyObject *lnos) {
          PyObject *exception_table = NULL;
          PyObject *types_module=NULL, *code_type=NULL, *result=NULL;
          #if __PYX_LIMITED_VERSION_HEX < 0x030b0000
          PyObject *version_info;
          PyObject *py_minor_version = NULL;
          #endif
          long minor_version = 0;
          PyObject *type, *value, *traceback;
          PyErr_Fetch(&type, &value, &traceback);
          #if __PYX_LIMITED_VERSION_HEX >= 0x030b0000
          minor_version = 11;
          #else
          if (!(version_info = PySys_GetObject("version_info"))) goto end;
          if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end;
          minor_version = PyLong_AsLong(py_minor_version);
          Py_DECREF(py_minor_version);
          if (minor_version == -1 && PyErr_Occurred()) goto end;
          #endif
          if (!(types_module = PyImport_ImportModule("types"))) goto end;
          if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end;
          if (minor_version <= 7) {
              (void)p;
              result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOOO", a, k, l, s, f, code,
                            c, n, v, fn, name, fline, lnos, fv, cell);
          } else if (minor_version <= 10) {
              result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOOO", a,p, k, l, s, f, code,
                            c, n, v, fn, name, fline, lnos, fv, cell);
          } else {
              if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end;
              result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOOOO", a,p, k, l, s, f, code,
                            c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell);
          }
      end:
          Py_XDECREF(code_type);
          Py_XDECREF(exception_table);
          Py_XDECREF(types_module);
          if (type) {
              PyErr_Restore(type, value, traceback);
          }
          return result;
      }
  #elif PY_VERSION_HEX >= 0x030B0000
    static PyCodeObject* __Pyx__PyCode_New(int a, int p, int k, int l, int s, int f,
                                           PyObject *code, PyObject *c, PyObject* n, PyObject *v,
                                           PyObject *fv, PyObject *cell, PyObject* fn,
                                           PyObject *name, int fline, PyObject *lnos) {
      PyCodeObject *result;
      result =
        #if PY_VERSION_HEX >= 0x030C0000
          PyUnstable_Code_NewWithPosOnlyArgs
        #else
          PyCode_NewWithPosOnlyArgs
        #endif
          (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, __pyx_mstate_global->__pyx_empty_bytes);
      #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030c00A1
      if (likely(result))
          result->_co_firsttraceable = 0;
      #endif
      return result;
    }
  #elif !CYTHON_COMPILING_IN_PYPY
    #define __Pyx__PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
            PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
  #else
    #define __Pyx__PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
            PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
  #endif
  static PyObject* __Pyx_PyCode_New(
          const __Pyx_PyCode_New_function_description descr,
          PyObject * const *varnames,
          PyObject *filename,
          PyObject *funcname,
          PyObject *line_table,
          PyObject *tuple_dedup_map
  ) {
      PyObject *code_obj = NULL, *varnames_tuple_dedup = NULL, *code_bytes = NULL;
      Py_ssize_t var_count = (Py_ssize_t) descr.nlocals;
      PyObject *varnames_tuple = PyTuple_New(var_count);
      if (unlikely(!varnames_tuple)) return NULL;
      for (Py_ssize_t i=0; i < var_count; i++) {
          Py_INCREF(varnames[i]);
          if (__Pyx_PyTuple_SET_ITEM(varnames_tuple, i, varnames[i]) != (0)) goto done;
      }
      #if CYTHON_COMPILING_IN_LIMITED_API
      varnames_tuple_dedup = PyDict_GetItem(tuple_dedup_map, varnames_tuple);
      if (!varnames_tuple_dedup) {
          if (unlikely(PyDict_SetItem(tuple_dedup_map, varnames_tuple, varnames_tuple) < 0)) goto done;
          varnames_tuple_dedup = varnames_tuple;
      }
      #else
      varnames_tuple_dedup = PyDict_SetDefault(tuple_dedup_map, varnames_tuple, varnames_tuple);
      if (unlikely(!varnames_tuple_dedup)) goto done;
      #endif
      #if CYTHON_AVOID_BORROWED_REFS
      Py_INCREF(varnames_tuple_dedup);
      #endif
      if (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table != NULL && !CYTHON_COMPILING_IN_GRAAL) {
          Py_ssize_t line_table_length = __Pyx_PyBytes_GET_SIZE(line_table);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely(line_table_length == -1)) goto done;
          #endif
          Py_ssize_t code_len = (line_table_length * 2 + 4) & ~3LL;
          code_bytes = PyBytes_FromStringAndSize(NULL, code_len);
          if (unlikely(!code_bytes)) goto done;
          char* c_code_bytes = PyBytes_AsString(code_bytes);
          if (unlikely(!c_code_bytes)) goto done;
          memset(c_code_bytes, 0, (size_t) code_len);
      }
      code_obj = (PyObject*) __Pyx__PyCode_New(
          (int) descr.argcount,
          (int) descr.num_posonly_args,
          (int) descr.num_kwonly_args,
          (int) descr.nlocals,
          0,
          (int) descr.flags,
          code_bytes ? code_bytes : __pyx_mstate_global->__pyx_empty_bytes,
          __pyx_mstate_global->__pyx_empty_tuple,
          __pyx_mstate_global->__pyx_empty_tuple,
          varnames_tuple_dedup,
          __pyx_mstate_global->__pyx_empty_tuple,
          __pyx_mstate_global->__pyx_empty_tuple,
          filename,
          funcname,
          (int) descr.first_line,
          (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table) ? line_table : __pyx_mstate_global->__pyx_empty_bytes
      );
  done:
      Py_XDECREF(code_bytes);
      #if CYTHON_AVOID_BORROWED_REFS
      Py_XDECREF(varnames_tuple_dedup);
      #endif
      Py_DECREF(varnames_tuple);
      return code_obj;
  }
  
/* DecompressString */
  static PyObject *__Pyx_DecompressString(const char *s, Py_ssize_t length, int algo) {
      PyObject *module = NULL, *decompress, *compressed_bytes, *decompressed;
      const char* module_name = algo == 3 ? "compression.zstd" : algo == 2 ? "bz2" : "zlib";
      PyObject *methodname = PyUnicode_FromString("decompress");
      if (unlikely(!methodname)) return NULL;
      #if __PYX_LIMITED_VERSION_HEX >= 0x030e0000
      if (algo == 3) {
          PyObject *fromlist = Py_BuildValue("[O]", methodname);
          if (unlikely(!fromlist)) goto bad;
          module = PyImport_ImportModuleLevel("compression.zstd", NULL, NULL, fromlist, 0);
          Py_DECREF(fromlist);
      } else
      #endif
          module = PyImport_ImportModule(module_name);
      if (unlikely(!module)) goto import_failed;
      decompress = PyObject_GetAttr(module, methodname);
      if (unlikely(!decompress)) goto import_failed;
      {
          #ifdef __cplusplus
              char *memview_bytes = const_cast<char*>(s);
          #else
              #if defined(__clang__)
                #pragma clang diagnostic push
                #pragma clang diagnostic ignored "-Wcast-qual"
              #elif !defined(__INTEL_COMPILER) && defined(__GNUC__)
                #pragma GCC diagnostic push
                #pragma GCC diagnostic ignored "-Wcast-qual"
              #endif
              char *memview_bytes = (char*) s;
              #if defined(__clang__)
                #pragma clang diagnostic pop
              #elif !defined(__INTEL_COMPILER) && defined(__GNUC__)
                #pragma GCC diagnostic pop
              #endif
          #endif
          #if CYTHON_COMPILING_IN_LIMITED_API && !defined(PyBUF_READ)
          int memview_flags = 0x100;
          #else
          int memview_flags = PyBUF_READ;
          #endif
          compressed_bytes = PyMemoryView_FromMemory(memview_bytes, length, memview_flags);
      }
      if (unlikely(!compressed_bytes)) {
          Py_DECREF(decompress);
          goto bad;
      }
      decompressed = PyObject_CallFunctionObjArgs(decompress, compressed_bytes, NULL);
      Py_DECREF(compressed_bytes);
      Py_DECREF(decompress);
      Py_DECREF(module);
      Py_DECREF(methodname);
      return decompressed;
  import_failed:
      PyErr_Format(PyExc_ImportError,
          "Failed to import '%.20s.decompress' - cannot initialise module strings. "
          "String compression was configured with the C macro 'CYTHON_COMPRESS_STRINGS=%d'.",
          module_name, algo);
  bad:
      Py_XDECREF(module);
      Py_DECREF(methodname);
      return NULL;
  }
  
#include <string.h>
static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) {
    size_t len = strlen(s);
    if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) {
        PyErr_SetString(PyExc_OverflowError, "byte string is too long");
        return -1;
    }
    return (Py_ssize_t) len;
}
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
    Py_ssize_t len = __Pyx_ssize_strlen(c_str);
    if (unlikely(len < 0)) return NULL;
    return __Pyx_PyUnicode_FromStringAndSize(c_str, len);
}
static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) {
    Py_ssize_t len = __Pyx_ssize_strlen(c_str);
    if (unlikely(len < 0)) return NULL;
    return PyByteArray_FromStringAndSize(c_str, len);
}
static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
    Py_ssize_t ignore;
    return __Pyx_PyObject_AsStringAndSize(o, &ignore);
}
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_UTF8
static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
    if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
#if CYTHON_COMPILING_IN_LIMITED_API
    {
        const char* result;
        Py_ssize_t unicode_length;
        CYTHON_MAYBE_UNUSED_VAR(unicode_length); // only for __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
        #if __PYX_LIMITED_VERSION_HEX < 0x030A0000
        if (unlikely(PyArg_Parse(o, "s#", &result, length) < 0)) return NULL;
        #else
        result = PyUnicode_AsUTF8AndSize(o, length);
        #endif
        #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
        unicode_length = PyUnicode_GetLength(o);
        if (unlikely(unicode_length < 0)) return NULL;
        if (unlikely(unicode_length != *length)) {
            PyUnicode_AsASCIIString(o);
            return NULL;
        }
        #endif
        return result;
    }
#else
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
    if (likely(PyUnicode_IS_ASCII(o))) {
        *length = PyUnicode_GET_LENGTH(o);
        return PyUnicode_AsUTF8(o);
    } else {
        PyUnicode_AsASCIIString(o);
        return NULL;
    }
#else
    return PyUnicode_AsUTF8AndSize(o, length);
#endif
#endif
}
#endif
static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_UTF8
    if (PyUnicode_Check(o)) {
        return __Pyx_PyUnicode_AsStringAndSize(o, length);
    } else
#endif
    if (PyByteArray_Check(o)) {
#if (CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS) || (CYTHON_COMPILING_IN_PYPY && (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)))
        *length = PyByteArray_GET_SIZE(o);
        return PyByteArray_AS_STRING(o);
#else
        *length = PyByteArray_Size(o);
        if (*length == -1) return NULL;
        return PyByteArray_AsString(o);
#endif
    } else
    {
        char* result;
        int r = PyBytes_AsStringAndSize(o, &result, length);
        if (unlikely(r < 0)) {
            return NULL;
        } else {
            return result;
        }
    }
}
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
   int is_true = x == Py_True;
   if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
   else return PyObject_IsTrue(x);
}
static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
    int retval;
    if (unlikely(!x)) return -1;
    retval = __Pyx_PyObject_IsTrue(x);
    Py_DECREF(x);
    return retval;
}
static PyObject* __Pyx_PyNumber_LongWrongResultType(PyObject* result) {
    __Pyx_TypeName result_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(result));
    if (PyLong_Check(result)) {
        if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
                "__int__ returned non-int (type " __Pyx_FMT_TYPENAME ").  "
                "The ability to return an instance of a strict subclass of int is deprecated, "
                "and may be removed in a future version of Python.",
                result_type_name)) {
            __Pyx_DECREF_TypeName(result_type_name);
            Py_DECREF(result);
            return NULL;
        }
        __Pyx_DECREF_TypeName(result_type_name);
        return result;
    }
    PyErr_Format(PyExc_TypeError,
                 "__int__ returned non-int (type " __Pyx_FMT_TYPENAME ")",
                 result_type_name);
    __Pyx_DECREF_TypeName(result_type_name);
    Py_DECREF(result);
    return NULL;
}
static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x) {
#if CYTHON_USE_TYPE_SLOTS
  PyNumberMethods *m;
#endif
  PyObject *res = NULL;
  if (likely(PyLong_Check(x)))
      return __Pyx_NewRef(x);
#if CYTHON_USE_TYPE_SLOTS
  m = Py_TYPE(x)->tp_as_number;
  if (likely(m && m->nb_int)) {
      res = m->nb_int(x);
  }
#else
  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
      res = PyNumber_Long(x);
  }
#endif
  if (likely(res)) {
      if (unlikely(!PyLong_CheckExact(res))) {
          return __Pyx_PyNumber_LongWrongResultType(res);
      }
  }
  else if (!PyErr_Occurred()) {
      PyErr_SetString(PyExc_TypeError,
                      "an integer is required");
  }
  return res;
}
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  Py_ssize_t ival;
  PyObject *x;
  if (likely(PyLong_CheckExact(b))) {
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(__Pyx_PyLong_IsCompact(b))) {
        return __Pyx_PyLong_CompactValue(b);
    } else {
      const digit* digits = __Pyx_PyLong_Digits(b);
      const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b);
      switch (size) {
         case 2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
      }
    }
    #endif
    return PyLong_AsSsize_t(b);
  }
  x = PyNumber_Index(b);
  if (!x) return -1;
  ival = PyLong_AsSsize_t(x);
  Py_DECREF(x);
  return ival;
}
static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
  if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) {
    return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
  } else {
    Py_ssize_t ival;
    PyObject *x;
    x = PyNumber_Index(o);
    if (!x) return -1;
    ival = PyLong_AsLong(x);
    Py_DECREF(x);
    return ival;
  }
}
static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(int b) {
    CYTHON_UNUSED_VAR(b);
    return __Pyx_NewRef(Py_None);
}
static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
  return __Pyx_NewRef(b ? Py_True: Py_False);
}
static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(size_t ival) {
    return PyLong_FromSize_t(ival);
}


  /* MultiPhaseInitModuleState */
  #if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE
  #ifndef CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
  #if (CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX >= 0x030C0000)
    #define CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE 1
  #else
    #define CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE 0
  #endif
  #endif
  #if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE && !CYTHON_ATOMICS
  #error "Module state with PEP489 requires atomics. Currently that's one of\
   C11, C++11, gcc atomic intrinsics or MSVC atomic intrinsics"
  #endif
  #if !CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
  #define __Pyx_ModuleStateLookup_Lock()
  #define __Pyx_ModuleStateLookup_Unlock()
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000
  static PyMutex __Pyx_ModuleStateLookup_mutex = {0};
  #define __Pyx_ModuleStateLookup_Lock() PyMutex_Lock(&__Pyx_ModuleStateLookup_mutex)
  #define __Pyx_ModuleStateLookup_Unlock() PyMutex_Unlock(&__Pyx_ModuleStateLookup_mutex)
  #elif defined(__cplusplus) && __cplusplus >= 201103L
  #include <mutex>
  static std::mutex __Pyx_ModuleStateLookup_mutex;
  #define __Pyx_ModuleStateLookup_Lock() __Pyx_ModuleStateLookup_mutex.lock()
  #define __Pyx_ModuleStateLookup_Unlock() __Pyx_ModuleStateLookup_mutex.unlock()
  #elif defined(__STDC_VERSION__) && (__STDC_VERSION__ > 201112L) && !defined(__STDC_NO_THREADS__)
  #include <threads.h>
  static mtx_t __Pyx_ModuleStateLookup_mutex;
  static once_flag __Pyx_ModuleStateLookup_mutex_once_flag = ONCE_FLAG_INIT;
  static void __Pyx_ModuleStateLookup_initialize_mutex(void) {
      mtx_init(&__Pyx_ModuleStateLookup_mutex, mtx_plain);
  }
  #define __Pyx_ModuleStateLookup_Lock()\
    call_once(&__Pyx_ModuleStateLookup_mutex_once_flag, __Pyx_ModuleStateLookup_initialize_mutex);\
    mtx_lock(&__Pyx_ModuleStateLookup_mutex)
  #define __Pyx_ModuleStateLookup_Unlock() mtx_unlock(&__Pyx_ModuleStateLookup_mutex)
  #elif defined(HAVE_PTHREAD_H)
  #include <pthread.h>
  static pthread_mutex_t __Pyx_ModuleStateLookup_mutex = PTHREAD_MUTEX_INITIALIZER;
  #define __Pyx_ModuleStateLookup_Lock() pthread_mutex_lock(&__Pyx_ModuleStateLookup_mutex)
  #define __Pyx_ModuleStateLookup_Unlock() pthread_mutex_unlock(&__Pyx_ModuleStateLookup_mutex)
  #elif defined(_WIN32)
  #include <Windows.h>  // synchapi.h on its own doesn't work
  static SRWLOCK __Pyx_ModuleStateLookup_mutex = SRWLOCK_INIT;
  #define __Pyx_ModuleStateLookup_Lock() AcquireSRWLockExclusive(&__Pyx_ModuleStateLookup_mutex)
  #define __Pyx_ModuleStateLookup_Unlock() ReleaseSRWLockExclusive(&__Pyx_ModuleStateLookup_mutex)
  #else
  #error "No suitable lock available for CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE.\
   Requires C standard >= C11, or C++ standard >= C++11,\
   or pthreads, or the Windows 32 API, or Python >= 3.13."
  #endif
  typedef struct {
      int64_t id;
      PyObject *module;
  } __Pyx_InterpreterIdAndModule;
  typedef struct {
      char interpreter_id_as_index;
      Py_ssize_t count;
      Py_ssize_t allocated;
      __Pyx_InterpreterIdAndModule table[1];
  } __Pyx_ModuleStateLookupData;
  #define __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE 32
  #if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
  static __pyx_atomic_int_type __Pyx_ModuleStateLookup_read_counter = 0;
  #endif
  #if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
  static __pyx_atomic_ptr_type __Pyx_ModuleStateLookup_data = 0;
  #else
  static __Pyx_ModuleStateLookupData* __Pyx_ModuleStateLookup_data = NULL;
  #endif
  static __Pyx_InterpreterIdAndModule* __Pyx_State_FindModuleStateLookupTableLowerBound(
          __Pyx_InterpreterIdAndModule* table,
          Py_ssize_t count,
          int64_t interpreterId) {
      __Pyx_InterpreterIdAndModule* begin = table;
      __Pyx_InterpreterIdAndModule* end = begin + count;
      if (begin->id == interpreterId) {
          return begin;
      }
      while ((end - begin) > __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) {
          __Pyx_InterpreterIdAndModule* halfway = begin + (end - begin)/2;
          if (halfway->id == interpreterId) {
              return halfway;
          }
          if (halfway->id < interpreterId) {
              begin = halfway;
          } else {
              end = halfway;
          }
      }
      for (; begin < end; ++begin) {
          if (begin->id >= interpreterId) return begin;
      }
      return begin;
  }
  static PyObject *__Pyx_State_FindModule(CYTHON_UNUSED void* dummy) {
      int64_t interpreter_id = PyInterpreterState_GetID(__Pyx_PyInterpreterState_Get());
      if (interpreter_id == -1) return NULL;
  #if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
      __Pyx_ModuleStateLookupData* data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_relaxed(&__Pyx_ModuleStateLookup_data);
      {
          __pyx_atomic_incr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
          if (likely(data)) {
              __Pyx_ModuleStateLookupData* new_data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_acquire(&__Pyx_ModuleStateLookup_data);
              if (likely(data == new_data)) {
                  goto read_finished;
              }
          }
          __pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
          __Pyx_ModuleStateLookup_Lock();
          __pyx_atomic_incr_relaxed(&__Pyx_ModuleStateLookup_read_counter);
          data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_relaxed(&__Pyx_ModuleStateLookup_data);
          __Pyx_ModuleStateLookup_Unlock();
      }
    read_finished:;
  #else
      __Pyx_ModuleStateLookupData* data = __Pyx_ModuleStateLookup_data;
  #endif
      __Pyx_InterpreterIdAndModule* found = NULL;
      if (unlikely(!data)) goto end;
      if (data->interpreter_id_as_index) {
          if (interpreter_id < data->count) {
              found = data->table+interpreter_id;
          }
      } else {
          found = __Pyx_State_FindModuleStateLookupTableLowerBound(
              data->table, data->count, interpreter_id);
      }
    end:
      {
          PyObject *result=NULL;
          if (found && found->id == interpreter_id) {
              result = found->module;
          }
  #if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
          __pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
  #endif
          return result;
      }
  }
  #if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
  static void __Pyx_ModuleStateLookup_wait_until_no_readers(void) {
      while (__pyx_atomic_load(&__Pyx_ModuleStateLookup_read_counter) != 0);
  }
  #else
  #define __Pyx_ModuleStateLookup_wait_until_no_readers()
  #endif
  static int __Pyx_State_AddModuleInterpIdAsIndex(__Pyx_ModuleStateLookupData **old_data, PyObject* module, int64_t interpreter_id) {
      Py_ssize_t to_allocate = (*old_data)->allocated;
      while (to_allocate <= interpreter_id) {
          if (to_allocate == 0) to_allocate = 1;
          else to_allocate *= 2;
      }
      __Pyx_ModuleStateLookupData *new_data = *old_data;
      if (to_allocate != (*old_data)->allocated) {
           new_data = (__Pyx_ModuleStateLookupData *)realloc(
              *old_data,
              sizeof(__Pyx_ModuleStateLookupData)+(to_allocate-1)*sizeof(__Pyx_InterpreterIdAndModule));
          if (!new_data) {
              PyErr_NoMemory();
              return -1;
          }
          for (Py_ssize_t i = new_data->allocated; i < to_allocate; ++i) {
              new_data->table[i].id = i;
              new_data->table[i].module = NULL;
          }
          new_data->allocated = to_allocate;
      }
      new_data->table[interpreter_id].module = module;
      if (new_data->count < interpreter_id+1) {
          new_data->count = interpreter_id+1;
      }
      *old_data = new_data;
      return 0;
  }
  static void __Pyx_State_ConvertFromInterpIdAsIndex(__Pyx_ModuleStateLookupData *data) {
      __Pyx_InterpreterIdAndModule *read = data->table;
      __Pyx_InterpreterIdAndModule *write = data->table;
      __Pyx_InterpreterIdAndModule *end = read + data->count;
      for (; read<end; ++read) {
          if (read->module) {
              write->id = read->id;
              write->module = read->module;
              ++write;
          }
      }
      data->count = write - data->table;
      for (; write<end; ++write) {
          write->id = 0;
          write->module = NULL;
      }
      data->interpreter_id_as_index = 0;
  }
  static int __Pyx_State_AddModule(PyObject* module, CYTHON_UNUSED void* dummy) {
      int64_t interpreter_id = PyInterpreterState_GetID(__Pyx_PyInterpreterState_Get());
      if (interpreter_id == -1) return -1;
      int result = 0;
      __Pyx_ModuleStateLookup_Lock();
  #if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
      __Pyx_ModuleStateLookupData *old_data = (__Pyx_ModuleStateLookupData *)
              __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, 0);
  #else
      __Pyx_ModuleStateLookupData *old_data = __Pyx_ModuleStateLookup_data;
  #endif
      __Pyx_ModuleStateLookupData *new_data = old_data;
      if (!new_data) {
          new_data = (__Pyx_ModuleStateLookupData *)calloc(1, sizeof(__Pyx_ModuleStateLookupData));
          if (!new_data) {
              result = -1;
              PyErr_NoMemory();
              goto end;
          }
          new_data->allocated = 1;
          new_data->interpreter_id_as_index = 1;
      }
      __Pyx_ModuleStateLookup_wait_until_no_readers();
      if (new_data->interpreter_id_as_index) {
          if (interpreter_id < __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) {
              result = __Pyx_State_AddModuleInterpIdAsIndex(&new_data, module, interpreter_id);
              goto end;
          }
          __Pyx_State_ConvertFromInterpIdAsIndex(new_data);
      }
      {
          Py_ssize_t insert_at = 0;
          {
              __Pyx_InterpreterIdAndModule* lower_bound = __Pyx_State_FindModuleStateLookupTableLowerBound(
                  new_data->table, new_data->count, interpreter_id);
              assert(lower_bound);
              insert_at = lower_bound - new_data->table;
              if (unlikely(insert_at < new_data->count && lower_bound->id == interpreter_id)) {
                  lower_bound->module = module;
                  goto end;  // already in table, nothing more to do
              }
          }
          if (new_data->count+1 >= new_data->allocated) {
              Py_ssize_t to_allocate = (new_data->count+1)*2;
              new_data =
                  (__Pyx_ModuleStateLookupData*)realloc(
                      new_data,
                      sizeof(__Pyx_ModuleStateLookupData) +
                      (to_allocate-1)*sizeof(__Pyx_InterpreterIdAndModule));
              if (!new_data) {
                  result = -1;
                  new_data = old_data;
                  PyErr_NoMemory();
                  goto end;
              }
              new_data->allocated = to_allocate;
          }
          ++new_data->count;
          int64_t last_id = interpreter_id;
          PyObject *last_module = module;
          for (Py_ssize_t i=insert_at; i<new_data->count; ++i) {
              int64_t current_id = new_data->table[i].id;
              new_data->table[i].id = last_id;
              last_id = current_id;
              PyObject *current_module = new_data->table[i].module;
              new_data->table[i].module = last_module;
              last_module = current_module;
          }
      }
    end:
  #if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
      __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, new_data);
  #else
      __Pyx_ModuleStateLookup_data = new_data;
  #endif
      __Pyx_ModuleStateLookup_Unlock();
      return result;
  }
  static int __Pyx_State_RemoveModule(CYTHON_UNUSED void* dummy) {
      int64_t interpreter_id = PyInterpreterState_GetID(__Pyx_PyInterpreterState_Get());
      if (interpreter_id == -1) return -1;
      __Pyx_ModuleStateLookup_Lock();
  #if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
      __Pyx_ModuleStateLookupData *data = (__Pyx_ModuleStateLookupData *)
              __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, 0);
  #else
      __Pyx_ModuleStateLookupData *data = __Pyx_ModuleStateLookup_data;
  #endif
      if (data->interpreter_id_as_index) {
          if (interpreter_id < data->count) {
              data->table[interpreter_id].module = NULL;
          }
          goto done;
      }
      {
          __Pyx_ModuleStateLookup_wait_until_no_readers();
          __Pyx_InterpreterIdAndModule* lower_bound = __Pyx_State_FindModuleStateLookupTableLowerBound(
              data->table, data->count, interpreter_id);
          if (!lower_bound) goto done;
          if (lower_bound->id != interpreter_id) goto done;
          __Pyx_InterpreterIdAndModule *end = data->table+data->count;
          for (;lower_bound<end-1; ++lower_bound) {
              lower_bound->id = (lower_bound+1)->id;
              lower_bound->module = (lower_bound+1)->module;
          }
      }
      --data->count;
      if (data->count == 0) {
          free(data);
          data = NULL;
      }
    done:
  #if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
      __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, data);
  #else
      __Pyx_ModuleStateLookup_data = data;
  #endif
      __Pyx_ModuleStateLookup_Unlock();
      return 0;
  }
  #endif
  
/* #### Code section: utility_code_pragmas_end ### */
#ifdef _MSC_VER
#pragma warning( pop )
#endif



/* #### Code section: end ### */
#endif /* Py_PYTHON_H */
