/* Generated by Cython 0.29.21 */

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

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

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

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

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

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

#define __PYX_HAVE__mathics__builtin__graphics
#define __PYX_HAVE_API__mathics__builtin__graphics
/* Early includes */
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */

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

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

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


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

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


static const char *__pyx_f[] = {
  "mathics/builtin/graphics.py",
};

/*--- Type declarations ---*/
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct___euclidean_distance;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_1_genexpr;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_2__extract_graphics;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_3_genexpr;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_4_apply_makeboxes;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_5_convert;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_6_genexpr;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_7_genexpr;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_8_hsl_to_rgba;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_9_apply;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_10_to_svg;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_11_path;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_12_to_asy;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_13_path;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_14_genexpr;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_15_genexpr;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_16_do_init;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_17_genexpr;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_18_init;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_19_genexpr;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_20__svg_bezier;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_21_path;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_22_genexpr;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_23__asy_bezier;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_24_path;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_25_init;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_26_parse_component;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_27_genexpr;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_28_to_svg;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_29_components;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_30_to_asy;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_31_components;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_32_to_svg;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_33_genexpr;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_34_init;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_35_genexpr;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_36_vertices;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_37_heads;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_38_genexpr;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_39_make_draw_svg;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_40_draw;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_41_genexpr;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_42_make_draw_asy;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_43_draw;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_44_arrows;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_45_segments;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_46_genexpr;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_47_genexpr;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_48_make_draw_svg;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_49_draw;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_50_make_draw_asy;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_51_draw;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_52_arrows;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_53__setback_spec;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_54_genexpr;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_55__default_arrow;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_56_draw;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_57__draw;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_58__custom_arrow;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_59_make;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_60_draw;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_61_to_svg;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_62_polygon;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_63_genexpr;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_64_to_asy;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_65_polygon;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_66_extent;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_67_polyline;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_68_polygon;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_69_default_arrow;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_70__flatten;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_71___init__;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_72_convert;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_73_create_style;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_74_to_svg;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_75_genexpr;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_76_to_asy;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_77_genexpr;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_78__prepare_elements;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_79_genexpr;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_80_boxes_to_tex;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_81_genexpr;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_82_genexpr;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_83_boxes_to_xml;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_84_genexpr;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_85_create_axes;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_86_genexpr;
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_87_genexpr;

/* "mathics/builtin/graphics.py":196
 * 
 * 
 * def _euclidean_distance(a, b):             # <<<<<<<<<<<<<<
 *     return sqrt(sum((x1 - x2) * (x1 - x2) for x1, x2 in zip(a, b)))
 * 
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct___euclidean_distance {
  PyObject_HEAD
  PyObject *__pyx_v_a;
  PyObject *__pyx_v_b;
};


/* "mathics/builtin/graphics.py":197
 * 
 * def _euclidean_distance(a, b):
 *     return sqrt(sum((x1 - x2) * (x1 - x2) for x1, x2 in zip(a, b)))             # <<<<<<<<<<<<<<
 * 
 * 
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_1_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct___euclidean_distance *__pyx_outer_scope;
  PyObject *__pyx_v_x1;
  PyObject *__pyx_v_x2;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "mathics/builtin/graphics.py":292
 * 
 * 
 * def _extract_graphics(graphics, format, evaluation):             # <<<<<<<<<<<<<<
 *     graphics_box = Expression("MakeBoxes", graphics).evaluate(evaluation)
 *     builtin = GraphicsBox(expression=False)
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_2__extract_graphics {
  PyObject_HEAD
  PyObject *__pyx_v_elements;
};


/* "mathics/builtin/graphics.py":319
 * 
 *     if format == "asy":
 *         code = "\n".join(element.to_asy() for element in elements.elements)             # <<<<<<<<<<<<<<
 *     elif format == "svg":
 *         code = elements.to_svg()
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_3_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_2__extract_graphics *__pyx_outer_scope;
  PyObject *__pyx_v_element;
};


/* "mathics/builtin/graphics.py":470
 *     box_suffix = "Box"
 * 
 *     def apply_makeboxes(self, content, evaluation, options):             # <<<<<<<<<<<<<<
 *         """MakeBoxes[%(name)s[content_, OptionsPattern[%(name)s]],
 *         StandardForm|TraditionalForm|OutputForm]"""
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_4_apply_makeboxes {
  PyObject_HEAD
  PyObject *__pyx_v_convert;
  PyObject *__pyx_v_evaluation;
  PyObject *__pyx_v_self;
};


/* "mathics/builtin/graphics.py":474
 *         StandardForm|TraditionalForm|OutputForm]"""
 * 
 *         def convert(content):             # <<<<<<<<<<<<<<
 *             head = content.get_head_name()
 * 
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_5_convert {
  PyObject_HEAD
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_4_apply_makeboxes *__pyx_outer_scope;
  PyObject *__pyx_v_atoms;
  PyObject *__pyx_v_content;
};


/* "mathics/builtin/graphics.py":490
 *                 if any(
 *                     not isinstance(atom, (Integer, Real))
 *                     and not atom.get_name() in GRAPHICS_SYMBOLS             # <<<<<<<<<<<<<<
 *                     for atom in atoms
 *                 ):
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_6_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_5_convert *__pyx_outer_scope;
  PyObject *__pyx_v_atom;
};


/* "mathics/builtin/graphics.py":500
 *                     else:
 *                         n_leaves = (
 *                             Expression("N", leaf).evaluate(evaluation)             # <<<<<<<<<<<<<<
 *                             for leaf in content.leaves
 *                         )
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_7_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_5_convert *__pyx_outer_scope;
  PyObject *__pyx_v_leaf;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "mathics/builtin/graphics.py":743
 *     default_components = [0, 1, 1, 1]
 * 
 *     def hsl_to_rgba(self):             # <<<<<<<<<<<<<<
 *         h, s, l = self.components[:3]
 *         if l < 0.5:
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_8_hsl_to_rgba {
  PyObject_HEAD
  PyObject *__pyx_v_p;
  PyObject *__pyx_v_q;
};


/* "mathics/builtin/graphics.py":884
 *     }
 * 
 *     def apply(self, c1, c2, evaluation, options):             # <<<<<<<<<<<<<<
 *         "ColorDistance[c1_, c2_, OptionsPattern[ColorDistance]]"
 * 
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_9_apply {
  PyObject_HEAD
  PyObject *__pyx_v_chroma;
  PyObject *__pyx_v_compute;
  PyObject *__pyx_v_distance_function;
  PyObject *__pyx_v_evaluation;
  PyObject *__pyx_v_lightness;
};


/* "mathics/builtin/graphics.py":1377
 *         return x, y, abs(rx), abs(ry), sx, sy, ex, ey, large_arc
 * 
 *     def to_svg(self):             # <<<<<<<<<<<<<<
 *         if self.arc is None:
 *             return super(_ArcBox, self).to_svg()
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_10_to_svg {
  PyObject_HEAD
  PyObject *__pyx_v_ex;
  PyObject *__pyx_v_ey;
  PyObject *__pyx_v_large_arc;
  PyObject *__pyx_v_rx;
  PyObject *__pyx_v_ry;
  PyObject *__pyx_v_sx;
  PyObject *__pyx_v_sy;
  PyObject *__pyx_v_x;
  PyObject *__pyx_v_y;
};


/* "mathics/builtin/graphics.py":1383
 *         x, y, rx, ry, sx, sy, ex, ey, large_arc = self._arc_params()
 * 
 *         def path(closed):             # <<<<<<<<<<<<<<
 *             if closed:
 *                 yield "M %f,%f" % (x, y)
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_11_path {
  PyObject_HEAD
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_10_to_svg *__pyx_outer_scope;
  PyObject *__pyx_v_closed;
};


/* "mathics/builtin/graphics.py":1399
 *         return '<path d="%s" style="%s" />' % (" ".join(path(self.face_element)), style)
 * 
 *     def to_asy(self):             # <<<<<<<<<<<<<<
 *         if self.arc is None:
 *             return super(_ArcBox, self).to_asy()
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_12_to_asy {
  PyObject_HEAD
  PyObject *__pyx_v_ex;
  PyObject *__pyx_v_ey;
  PyObject *__pyx_v_sx;
  PyObject *__pyx_v_sy;
  PyObject *__pyx_v_x;
  PyObject *__pyx_v_y;
};


/* "mathics/builtin/graphics.py":1405
 *         x, y, rx, ry, sx, sy, ex, ey, large_arc = self._arc_params()
 * 
 *         def path(closed):             # <<<<<<<<<<<<<<
 *             if closed:
 *                 yield "(%s,%s)--(%s,%s)--" % tuple(
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_13_path {
  PyObject_HEAD
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_12_to_asy *__pyx_outer_scope;
  PyObject *__pyx_v_closed;
  PyObject *__pyx_v_genexpr;
};


/* "mathics/builtin/graphics.py":1408
 *             if closed:
 *                 yield "(%s,%s)--(%s,%s)--" % tuple(
 *                     asy_number(t) for t in (x, y, sx, sy)             # <<<<<<<<<<<<<<
 *                 )
 * 
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_14_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_13_path *__pyx_outer_scope;
  PyObject *__pyx_v_t;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
};


/* "mathics/builtin/graphics.py":1412
 * 
 *             yield "arc((%s,%s), (%s, %s), (%s, %s))" % tuple(
 *                 asy_number(t) for t in (x, y, sx, sy, ex, ey)             # <<<<<<<<<<<<<<
 *             )
 * 
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_15_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_13_path *__pyx_outer_scope;
  PyObject *__pyx_v_t;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
};


/* "mathics/builtin/graphics.py":1438
 * 
 * class _Polyline(_GraphicsElement):
 *     def do_init(self, graphics, points):             # <<<<<<<<<<<<<<
 *         if not points.has_form("List", None):
 *             raise BoxConstructError
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_16_do_init {
  PyObject_HEAD
  PyObject *__pyx_v_points;
};


/* "mathics/builtin/graphics.py":1444
 *             points.leaves
 *             and points.leaves[0].has_form("List", None)
 *             and all(leaf.has_form("List", None) for leaf in points.leaves[0].leaves)             # <<<<<<<<<<<<<<
 *         ):
 *             leaves = points.leaves
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_17_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_16_do_init *__pyx_outer_scope;
  PyObject *__pyx_v_leaf;
};


/* "mathics/builtin/graphics.py":1496
 * 
 * class PointBox(_Polyline):
 *     def init(self, graphics, style, item=None):             # <<<<<<<<<<<<<<
 *         super(PointBox, self).init(graphics, item, style)
 *         self.edge_color, self.face_color = style.get_style(_Color, face_element=True)
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_18_init {
  PyObject_HEAD
  PyObject *__pyx_v_points;
};


/* "mathics/builtin/graphics.py":1504
 *             points = item.leaves[0]
 *             if points.has_form("List", None) and len(points.leaves) != 0:
 *                 if all(not leaf.has_form("List", None) for leaf in points.leaves):             # <<<<<<<<<<<<<<
 *                     points = Expression("List", points)
 *             self.do_init(graphics, points)
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_19_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_18_init *__pyx_outer_scope;
  PyObject *__pyx_v_leaf;
};


/* "mathics/builtin/graphics.py":1595
 * 
 * 
 * def _svg_bezier(*segments):             # <<<<<<<<<<<<<<
 *     # see https://www.w3.org/TR/SVG/paths.html#PathDataCubicBezierCommands
 *     # see https://docs.webplatform.org/wiki/svg/tutorials/smarter_svg_shapes
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_20__svg_bezier {
  PyObject_HEAD
  PyObject *__pyx_v_forms;
  PyObject *__pyx_v_k;
  PyObject *__pyx_v_p;
  PyObject *__pyx_v_path;
  PyObject *__pyx_v_s;
  PyObject *__pyx_v_segments;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
  PyObject *__pyx_t_3;
  Py_ssize_t __pyx_t_4;
};


/* "mathics/builtin/graphics.py":1607
 *     forms = "LQC"  # SVG commands for line, quadratic bezier, cubic bezier
 * 
 *     def path(max_degree, p):             # <<<<<<<<<<<<<<
 *         max_degree = min(max_degree, len(forms))
 *         while p:
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_21_path {
  PyObject_HEAD
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_20__svg_bezier *__pyx_outer_scope;
  PyObject *__pyx_v_genexpr;
  PyObject *__pyx_v_max_degree;
  PyObject *__pyx_v_n;
  PyObject *__pyx_v_p;
};


/* "mathics/builtin/graphics.py":1613
 *             if n < 1:
 *                 raise BoxConstructError
 *             yield forms[n - 1] + " ".join("%f,%f" % xy for xy in p[:n])             # <<<<<<<<<<<<<<
 *             p = p[n:]
 * 
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_22_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_21_path *__pyx_outer_scope;
  PyObject *__pyx_v_xy;
};


/* "mathics/builtin/graphics.py":1627
 * 
 * 
 * def _asy_bezier(*segments):             # <<<<<<<<<<<<<<
 *     # see http://asymptote.sourceforge.net/doc/Bezier-curves.html#Bezier-curves
 * 
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_23__asy_bezier {
  PyObject_HEAD
  PyObject *__pyx_v_connect;
  PyObject *__pyx_v_cubic;
  PyObject *__pyx_v_forms;
  PyObject *__pyx_v_k;
  PyObject *__pyx_v_linear;
  PyObject *__pyx_v_p;
  PyObject *__pyx_v_path;
  PyObject *__pyx_v_quadratric;
  PyObject *__pyx_v_s;
  PyObject *__pyx_v_segments;
  PyObject *__pyx_t_0;
  PyObject *__pyx_t_1;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
};


/* "mathics/builtin/graphics.py":1667
 *     forms = (linear, quadratric, cubic)
 * 
 *     def path(max_degree, p):             # <<<<<<<<<<<<<<
 *         max_degree = min(max_degree, len(forms))
 *         while p:
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_24_path {
  PyObject_HEAD
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_23__asy_bezier *__pyx_outer_scope;
  PyObject *__pyx_v_max_degree;
  PyObject *__pyx_v_n;
  PyObject *__pyx_v_p;
};


/* "mathics/builtin/graphics.py":1771
 * 
 * class FilledCurveBox(_GraphicsElement):
 *     def init(self, graphics, style, item=None):             # <<<<<<<<<<<<<<
 *         super(FilledCurveBox, self).init(graphics, item, style)
 *         self.edge_color, self.face_color = style.get_style(_Color, face_element=True)
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_25_init {
  PyObject_HEAD
  PyObject *__pyx_v_graphics;
  PyObject *__pyx_v_leaves;
};


/* "mathics/builtin/graphics.py":1780
 *             leaves = item.leaves[0].leaves
 * 
 *             def parse_component(segments):             # <<<<<<<<<<<<<<
 *                 for segment in segments:
 *                     head = segment.get_head_name()
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_26_parse_component {
  PyObject_HEAD
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_25_init *__pyx_outer_scope;
  PyObject *__pyx_v_coords;
  PyObject *__pyx_v_head;
  PyObject *__pyx_v_k;
  PyObject *__pyx_v_options;
  PyObject *__pyx_v_part;
  PyObject *__pyx_v_parts;
  PyObject *__pyx_v_segment;
  PyObject *__pyx_v_segments;
  PyObject *__pyx_v_spline_degree;
  PyObject *__pyx_9genexpr25__pyx_v_xy;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "mathics/builtin/graphics.py":1810
 *                     yield k, coords
 * 
 *             if all(x.get_head_name() == "System`List" for x in leaves):             # <<<<<<<<<<<<<<
 *                 self.components = [list(parse_component(x)) for x in leaves]
 *             else:
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_27_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_25_init *__pyx_outer_scope;
  PyObject *__pyx_v_x;
};


/* "mathics/builtin/graphics.py":1817
 *             raise BoxConstructError
 * 
 *     def to_svg(self):             # <<<<<<<<<<<<<<
 *         l = self.style.get_line_width(face_element=False)
 *         style = create_css(
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_28_to_svg {
  PyObject_HEAD
  PyObject *__pyx_v_self;
};


/* "mathics/builtin/graphics.py":1823
 *         )
 * 
 *         def components():             # <<<<<<<<<<<<<<
 *             for component in self.components:
 *                 transformed = [(k, [xy.pos() for xy in p]) for k, p in component]
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_29_components {
  PyObject_HEAD
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_28_to_svg *__pyx_outer_scope;
  PyObject *__pyx_v_component;
  PyObject *__pyx_9genexpr28__pyx_v_k;
  PyObject *__pyx_9genexpr28__pyx_v_p;
  PyObject *__pyx_v_transformed;
  PyObject *__pyx_9genexpr29__pyx_v_xy;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "mathics/builtin/graphics.py":1833
 *         )
 * 
 *     def to_asy(self):             # <<<<<<<<<<<<<<
 *         l = self.style.get_line_width(face_element=False)
 *         pen = create_pens(edge_color=self.edge_color, stroke_width=l)
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_30_to_asy {
  PyObject_HEAD
  PyObject *__pyx_v_pen;
  PyObject *__pyx_v_self;
};


/* "mathics/builtin/graphics.py":1840
 *             pen = "currentpen"
 * 
 *         def components():             # <<<<<<<<<<<<<<
 *             for component in self.components:
 *                 transformed = [(k, [xy.pos() for xy in p]) for k, p in component]
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_31_components {
  PyObject_HEAD
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_30_to_asy *__pyx_outer_scope;
  PyObject *__pyx_v_component;
  PyObject *__pyx_9genexpr30__pyx_v_k;
  PyObject *__pyx_9genexpr30__pyx_v_p;
  PyObject *__pyx_v_transformed;
  PyObject *__pyx_9genexpr31__pyx_v_xy;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "mathics/builtin/graphics.py":1922
 *             raise BoxConstructError
 * 
 *     def to_svg(self):             # <<<<<<<<<<<<<<
 *         l = self.style.get_line_width(face_element=True)
 *         if self.vertex_colors is None:
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_32_to_svg {
  PyObject_HEAD
  PyObject *__pyx_v_line;
};


/* "mathics/builtin/graphics.py":1943
 *         for line in self.lines:
 *             svg += '<polygon points="%s" style="%s" />' % (
 *                 " ".join("%f,%f" % coords.pos() for coords in line),             # <<<<<<<<<<<<<<
 *                 style,
 *             )
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_33_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_32_to_svg *__pyx_outer_scope;
  PyObject *__pyx_v_coords;
};


/* "mathics/builtin/graphics.py":2017
 * 
 * class RegularPolygonBox(PolygonBox):
 *     def init(self, graphics, style, item):             # <<<<<<<<<<<<<<
 *         if len(item.leaves) in (1, 2, 3) and isinstance(item.leaves[-1], Integer):
 *             r = 1.0
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_34_init {
  PyObject_HEAD
  PyObject *__pyx_v_n;
  PyObject *__pyx_v_phi0;
  PyObject *__pyx_v_pi2;
  PyObject *__pyx_v_r;
  PyObject *__pyx_v_x;
  PyObject *__pyx_v_y;
};


/* "mathics/builtin/graphics.py":2043
 *             n = item.leaves[-1].get_int_value()
 * 
 *             if any(t is None for t in (x, y, r)) or n < 0:             # <<<<<<<<<<<<<<
 *                 raise BoxConstructError
 * 
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_35_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_34_init *__pyx_outer_scope;
  PyObject *__pyx_v_t;
};


/* "mathics/builtin/graphics.py":2053
 *             pi2 = pi * 2.0
 * 
 *             def vertices():             # <<<<<<<<<<<<<<
 *                 for i in range(n):
 *                     phi = phi0 + pi2 * i / float(n)
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_36_vertices {
  PyObject_HEAD
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_34_init *__pyx_outer_scope;
  PyObject *__pyx_v_i;
  PyObject *__pyx_v_phi;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "mathics/builtin/graphics.py":2150
 *             return _to_float(s) * extent
 * 
 *     def heads(self, extent, default_arrow, custom_arrow):             # <<<<<<<<<<<<<<
 *         # see https://reference.wolfram.com/language/ref/Arrowheads.html
 * 
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_37_heads {
  PyObject_HEAD
  PyObject *__pyx_v_arrow;
  PyObject *__pyx_v_custom_arrow;
  PyObject *__pyx_v_default_arrow;
  PyObject *__pyx_v_extent;
  PyObject *__pyx_v_genexpr;
  PyObject *__pyx_v_graphics;
  PyObject *__pyx_v_head;
  PyObject *__pyx_v_i;
  PyObject *__pyx_v_leaves;
  double __pyx_v_n;
  PyObject *__pyx_v_s;
  PyObject *__pyx_v_self;
  PyObject *__pyx_v_size_spec;
  PyObject *__pyx_v_spec;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
  PyObject *__pyx_t_3;
};


/* "mathics/builtin/graphics.py":2155
 *         if self.spec.get_head_name() == "System`List":
 *             leaves = self.spec.leaves
 *             if all(x.get_head_name() == "System`List" for x in leaves):             # <<<<<<<<<<<<<<
 *                 for head in leaves:
 *                     spec = head.leaves
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_38_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_37_heads *__pyx_outer_scope;
  PyObject *__pyx_v_x;
};


/* "mathics/builtin/graphics.py":2203
 * 
 * class _Line:
 *     def make_draw_svg(self, style):             # <<<<<<<<<<<<<<
 *         def draw(points):
 *             yield '<polyline points="'
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_39_make_draw_svg {
  PyObject_HEAD
  PyObject *__pyx_v_style;
};


/* "mathics/builtin/graphics.py":2204
 * class _Line:
 *     def make_draw_svg(self, style):
 *         def draw(points):             # <<<<<<<<<<<<<<
 *             yield '<polyline points="'
 *             yield " ".join("%f,%f" % xy for xy in points)
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_40_draw {
  PyObject_HEAD
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_39_make_draw_svg *__pyx_outer_scope;
  PyObject *__pyx_v_genexpr;
  PyObject *__pyx_v_points;
};


/* "mathics/builtin/graphics.py":2206
 *         def draw(points):
 *             yield '<polyline points="'
 *             yield " ".join("%f,%f" % xy for xy in points)             # <<<<<<<<<<<<<<
 *             yield '" style="%s" />' % style
 * 
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_41_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_40_draw *__pyx_outer_scope;
  PyObject *__pyx_v_xy;
};


/* "mathics/builtin/graphics.py":2211
 *         return draw
 * 
 *     def make_draw_asy(self, pen):             # <<<<<<<<<<<<<<
 *         def draw(points):
 *             yield "draw("
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_42_make_draw_asy {
  PyObject_HEAD
  PyObject *__pyx_v_pen;
};


/* "mathics/builtin/graphics.py":2212
 * 
 *     def make_draw_asy(self, pen):
 *         def draw(points):             # <<<<<<<<<<<<<<
 *             yield "draw("
 *             yield "--".join(["(%.5g,%5g)" % xy for xy in points])
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_43_draw {
  PyObject_HEAD
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_42_make_draw_asy *__pyx_outer_scope;
  PyObject *__pyx_v_points;
  PyObject *__pyx_9genexpr41__pyx_v_xy;
};


/* "mathics/builtin/graphics.py":2219
 *         return draw
 * 
 *     def arrows(self, points, heads):  # heads has to be sorted by pos             # <<<<<<<<<<<<<<
 *         def segments(points):
 *             for i in range(len(points) - 1):
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_44_arrows {
  PyObject_HEAD
  PyObject *__pyx_v_dl;
  PyObject *__pyx_v_draw;
  PyObject *__pyx_v_dx;
  PyObject *__pyx_v_dy;
  PyObject *__pyx_v_genexpr;
  PyObject *__pyx_v_heads;
  PyObject *__pyx_v_i;
  Py_ssize_t __pyx_v_n;
  PyObject *__pyx_v_points;
  PyObject *__pyx_v_px;
  PyObject *__pyx_v_py;
  PyObject *__pyx_v_s;
  PyObject *__pyx_v_seg;
  PyObject *__pyx_v_segments;
  PyObject *__pyx_v_self;
  PyObject *__pyx_v_shape;
  PyObject *__pyx_v_t;
  PyObject *__pyx_v_t0;
  PyObject *__pyx_v_total;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
};


/* "mathics/builtin/graphics.py":2220
 * 
 *     def arrows(self, points, heads):  # heads has to be sorted by pos
 *         def segments(points):             # <<<<<<<<<<<<<<
 *             for i in range(len(points) - 1):
 *                 px, py = points[i]
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_45_segments {
  PyObject_HEAD
  PyObject *__pyx_v_dl;
  PyObject *__pyx_v_dx;
  PyObject *__pyx_v_dy;
  PyObject *__pyx_v_i;
  PyObject *__pyx_v_points;
  PyObject *__pyx_v_px;
  PyObject *__pyx_v_py;
  Py_ssize_t __pyx_t_0;
  PyObject *__pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "mathics/builtin/graphics.py":2235
 *         n = len(seg)
 *         dl, px, py, dx, dy = seg[i]
 *         total = sum(segment[0] for segment in seg)             # <<<<<<<<<<<<<<
 * 
 *         for s, t, draw in ((s, pos * total - t0, draw) for s, pos, draw in heads):
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_46_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_44_arrows *__pyx_outer_scope;
  PyObject *__pyx_v_segment;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
};


/* "mathics/builtin/graphics.py":2237
 *         total = sum(segment[0] for segment in seg)
 * 
 *         for s, t, draw in ((s, pos * total - t0, draw) for s, pos, draw in heads):             # <<<<<<<<<<<<<<
 *             if s == 0.0:  # ignore zero-sized arrows
 *                 continue
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_47_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_44_arrows *__pyx_outer_scope;
  PyObject *__pyx_v_draw;
  PyObject *__pyx_v_pos;
  PyObject *__pyx_v_s;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "mathics/builtin/graphics.py":2291
 *         self.spline_degree = spline_degree
 * 
 *     def make_draw_svg(self, style):             # <<<<<<<<<<<<<<
 *         def draw(points):
 *             s = " ".join(_svg_bezier((self.spline_degree, points)))
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_48_make_draw_svg {
  PyObject_HEAD
  PyObject *__pyx_v_self;
  PyObject *__pyx_v_style;
};


/* "mathics/builtin/graphics.py":2292
 * 
 *     def make_draw_svg(self, style):
 *         def draw(points):             # <<<<<<<<<<<<<<
 *             s = " ".join(_svg_bezier((self.spline_degree, points)))
 *             yield '<path d="%s" style="%s"/>' % (s, style)
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_49_draw {
  PyObject_HEAD
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_48_make_draw_svg *__pyx_outer_scope;
  PyObject *__pyx_v_points;
  PyObject *__pyx_v_s;
};


/* "mathics/builtin/graphics.py":2298
 *         return draw
 * 
 *     def make_draw_asy(self, pen):             # <<<<<<<<<<<<<<
 *         def draw(points):
 *             for path in _asy_bezier((self.spline_degree, points)):
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_50_make_draw_asy {
  PyObject_HEAD
  PyObject *__pyx_v_pen;
  PyObject *__pyx_v_self;
};


/* "mathics/builtin/graphics.py":2299
 * 
 *     def make_draw_asy(self, pen):
 *         def draw(points):             # <<<<<<<<<<<<<<
 *             for path in _asy_bezier((self.spline_degree, points)):
 *                 yield "draw(%s, %s);" % (path, pen)
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_51_draw {
  PyObject_HEAD
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_50_make_draw_asy *__pyx_outer_scope;
  PyObject *__pyx_v_path;
  PyObject *__pyx_v_points;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "mathics/builtin/graphics.py":2305
 *         return draw
 * 
 *     def arrows(self, points, heads):  # heads has to be sorted by pos             # <<<<<<<<<<<<<<
 *         if len(points) < 2:
 *             return
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_52_arrows {
  PyObject_HEAD
  PyObject *__pyx_v_cp;
  PyObject *__pyx_v_dcp;
  PyObject *__pyx_v_draw;
  PyObject *__pyx_v_heads;
  PyObject *__pyx_v_points;
  PyObject *__pyx_v_px;
  PyObject *__pyx_v_py;
  PyObject *__pyx_v_s;
  PyObject *__pyx_v_self;
  PyObject *__pyx_v_shape;
  PyObject *__pyx_v_t;
  PyObject *__pyx_v_tl;
  PyObject *__pyx_v_tx;
  PyObject *__pyx_v_ty;
  Py_ssize_t __pyx_t_0;
  PyObject *__pyx_t_1;
  PyObject *__pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
};


/* "mathics/builtin/graphics.py":2373
 * 
 *     @staticmethod
 *     def _setback_spec(expr):             # <<<<<<<<<<<<<<
 *         if expr.get_head_name() == "System`List":
 *             leaves = expr.leaves
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_53__setback_spec {
  PyObject_HEAD
  PyObject *__pyx_v_leaves;
};


/* "mathics/builtin/graphics.py":2378
 *             if len(leaves) != 2:
 *                 raise BoxConstructError
 *             return tuple(max(_to_float(l), 0.0) for l in leaves)             # <<<<<<<<<<<<<<
 *         else:
 *             s = max(_to_float(expr), 0.0)
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_54_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_53__setback_spec *__pyx_outer_scope;
  PyObject *__pyx_v_l;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "mathics/builtin/graphics.py":2384
 * 
 *     @staticmethod
 *     def _default_arrow(polygon):             # <<<<<<<<<<<<<<
 *         # the default arrow drawn by draw() below looks looks like this:
 *         #
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_55__default_arrow {
  PyObject_HEAD
  double __pyx_v_arrow_edge;
  double __pyx_v_arrow_spread;
  PyObject *__pyx_v_polygon;
};


/* "mathics/builtin/graphics.py":2407
 *         arrow_edge = 1.1
 * 
 *         def draw(px, py, vx, vy, t1, s):             # <<<<<<<<<<<<<<
 *             hx = px + t1 * vx  # compute H
 *             hy = py + t1 * vy
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_56_draw {
  PyObject_HEAD
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_55__default_arrow *__pyx_outer_scope;
  PyObject *__pyx_v_bx;
  PyObject *__pyx_v_by;
  PyObject *__pyx_v_ex;
  PyObject *__pyx_v_ey;
  PyObject *__pyx_v_head_points;
  PyObject *__pyx_v_hx;
  PyObject *__pyx_v_hy;
  PyObject *__pyx_v_px;
  PyObject *__pyx_v_py;
  PyObject *__pyx_v_s;
  PyObject *__pyx_v_shape;
  PyObject *__pyx_v_sx;
  PyObject *__pyx_v_sy;
  PyObject *__pyx_v_t0;
  PyObject *__pyx_v_t1;
  PyObject *__pyx_v_te;
  PyObject *__pyx_v_ts;
  PyObject *__pyx_v_vx;
  PyObject *__pyx_v_vy;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "mathics/builtin/graphics.py":2430
 *         return draw
 * 
 *     def _draw(self, polyline, default_arrow, custom_arrow, extent):             # <<<<<<<<<<<<<<
 *         if self.heads:
 *             heads = list(self.heads.heads(extent, default_arrow, custom_arrow))
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_57__draw {
  PyObject_HEAD
  PyObject *__pyx_v_custom_arrow;
  PyObject *__pyx_v_default_arrow;
  PyObject *__pyx_v_extent;
  PyObject *__pyx_v_heads;
  PyObject *__pyx_v_line;
  PyObject *__pyx_v_polyline;
  PyObject *__pyx_v_s;
  PyObject *__pyx_v_self;
  PyObject *__pyx_v_setback;
  PyObject *__pyx_v_shrink;
  PyObject *__pyx_v_shrink_one_end;
  PyObject *__pyx_v_transformed_points;
  PyObject *__pyx_9genexpr50__pyx_v_xy;
  PyObject *__pyx_t_0;
  PyObject *__pyx_t_1;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
};


/* "mathics/builtin/graphics.py":2479
 *                 yield s
 * 
 *     def _custom_arrow(self, format, format_transform):             # <<<<<<<<<<<<<<
 *         def make(graphics):
 *             xmin, xmax, ymin, ymax, ox, oy, ex, ey, code = _extract_graphics(
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_58__custom_arrow {
  PyObject_HEAD
  PyObject *__pyx_v_format;
  PyObject *__pyx_v_format_transform;
  PyObject *__pyx_v_self;
};


/* "mathics/builtin/graphics.py":2480
 * 
 *     def _custom_arrow(self, format, format_transform):
 *         def make(graphics):             # <<<<<<<<<<<<<<
 *             xmin, xmax, ymin, ymax, ox, oy, ex, ey, code = _extract_graphics(
 *                 graphics, format, self.graphics.evaluation
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_59_make {
  PyObject_HEAD
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_58__custom_arrow *__pyx_outer_scope;
  PyObject *__pyx_v_boxh;
  PyObject *__pyx_v_boxw;
  PyObject *__pyx_v_code;
  PyObject *__pyx_v_ex;
  PyObject *__pyx_v_ey;
  PyObject *__pyx_v_ox;
  PyObject *__pyx_v_oy;
};


/* "mathics/builtin/graphics.py":2487
 *             boxh = ymax - ymin
 * 
 *             def draw(px, py, vx, vy, t1, s):             # <<<<<<<<<<<<<<
 *                 t0 = t1
 *                 cx = px + t0 * vx
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_60_draw {
  PyObject_HEAD
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_59_make *__pyx_outer_scope;
  PyObject *__pyx_v_cx;
  PyObject *__pyx_v_cy;
  PyObject *__pyx_v_px;
  PyObject *__pyx_v_py;
  PyObject *__pyx_v_s;
  PyObject *__pyx_v_t0;
  PyObject *__pyx_v_t1;
  PyObject *__pyx_v_transform;
  PyObject *__pyx_v_vx;
  PyObject *__pyx_v_vy;
};


/* "mathics/builtin/graphics.py":2503
 *         return make
 * 
 *     def to_svg(self):             # <<<<<<<<<<<<<<
 *         width = self.style.get_line_width(face_element=False)
 *         style = create_css(edge_color=self.edge_color, stroke_width=width)
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_61_to_svg {
  PyObject_HEAD
  PyObject *__pyx_v_arrow_style;
};


/* "mathics/builtin/graphics.py":2510
 *         arrow_style = create_css(face_color=self.edge_color, stroke_width=width)
 * 
 *         def polygon(points):             # <<<<<<<<<<<<<<
 *             yield '<polygon points="'
 *             yield " ".join("%f,%f" % xy for xy in points)
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_62_polygon {
  PyObject_HEAD
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_61_to_svg *__pyx_outer_scope;
  PyObject *__pyx_v_genexpr;
  PyObject *__pyx_v_points;
};


/* "mathics/builtin/graphics.py":2512
 *         def polygon(points):
 *             yield '<polygon points="'
 *             yield " ".join("%f,%f" % xy for xy in points)             # <<<<<<<<<<<<<<
 *             yield '" style="%s" />' % arrow_style
 * 
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_63_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_62_polygon *__pyx_outer_scope;
  PyObject *__pyx_v_xy;
};


/* "mathics/builtin/graphics.py":2520
 *         return "".join(self._draw(polyline, default_arrow, custom_arrow, extent))
 * 
 *     def to_asy(self):             # <<<<<<<<<<<<<<
 *         width = self.style.get_line_width(face_element=False)
 *         pen = create_pens(edge_color=self.edge_color, stroke_width=width)
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_64_to_asy {
  PyObject_HEAD
  PyObject *__pyx_v_arrow_pen;
};


/* "mathics/builtin/graphics.py":2527
 *         arrow_pen = create_pens(face_color=self.edge_color, stroke_width=width)
 * 
 *         def polygon(points):             # <<<<<<<<<<<<<<
 *             yield "filldraw("
 *             yield "--".join(["(%.5g,%5g)" % xy for xy in points])
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_65_polygon {
  PyObject_HEAD
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_64_to_asy *__pyx_outer_scope;
  PyObject *__pyx_v_points;
  PyObject *__pyx_9genexpr52__pyx_v_xy;
};


/* "mathics/builtin/graphics.py":2537
 *         return "".join(self._draw(polyline, default_arrow, custom_arrow, extent))
 * 
 *     def extent(self):             # <<<<<<<<<<<<<<
 *         width = self.style.get_line_width(face_element=False)
 * 
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_66_extent {
  PyObject_HEAD
  PyObject *__pyx_v_width;
};


/* "mathics/builtin/graphics.py":2540
 *         width = self.style.get_line_width(face_element=False)
 * 
 *         def polyline(points):             # <<<<<<<<<<<<<<
 *             for p in points:
 *                 x, y = p
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_67_polyline {
  PyObject_HEAD
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_66_extent *__pyx_outer_scope;
  PyObject *__pyx_v_p;
  PyObject *__pyx_v_points;
  PyObject *__pyx_v_x;
  PyObject *__pyx_v_y;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "mathics/builtin/graphics.py":2548
 *                 yield x + width, y + width
 * 
 *         def polygon(points):             # <<<<<<<<<<<<<<
 *             for p in points:
 *                 yield p
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_68_polygon {
  PyObject_HEAD
  PyObject *__pyx_v_p;
  PyObject *__pyx_v_points;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "mathics/builtin/graphics.py":2552
 *                 yield p
 * 
 *         def default_arrow(px, py, vx, vy, t1, s):             # <<<<<<<<<<<<<<
 *             yield px, py
 * 
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_69_default_arrow {
  PyObject_HEAD
  PyObject *__pyx_v_px;
  PyObject *__pyx_v_py;
  PyObject *__pyx_v_s;
  PyObject *__pyx_v_t1;
  PyObject *__pyx_v_vx;
  PyObject *__pyx_v_vy;
};


/* "mathics/builtin/graphics.py":2754
 * 
 * 
 * def _flatten(leaves):             # <<<<<<<<<<<<<<
 *     for leaf in leaves:
 *         if leaf.get_head_name() == "System`List":
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_70__flatten {
  PyObject_HEAD
  PyObject *__pyx_v_flattened;
  PyObject *__pyx_v_leaf;
  PyObject *__pyx_v_leaves;
  PyObject *__pyx_v_x;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
  PyObject *__pyx_t_3;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
};


/* "mathics/builtin/graphics.py":2768
 * 
 * class _GraphicsElements(object):
 *     def __init__(self, content, evaluation):             # <<<<<<<<<<<<<<
 *         self.evaluation = evaluation
 *         self.elements = []
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_71___init__ {
  PyObject_HEAD
  PyObject *__pyx_v_builtins;
  PyObject *__pyx_v_convert;
  PyObject *__pyx_v_get_options;
  PyObject *__pyx_v_self;
  PyObject *__pyx_v_stylebox_style;
};


/* "mathics/builtin/graphics.py":2801
 *             return new_style
 * 
 *         def convert(content, style):             # <<<<<<<<<<<<<<
 *             if content.has_form("List", None):
 *                 items = content.leaves
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_72_convert {
  PyObject_HEAD
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_71___init__ *__pyx_outer_scope;
  PyObject *__pyx_v_content;
  PyObject *__pyx_v_data;
  PyObject *__pyx_v_element;
  PyObject *__pyx_v_element_class;
  PyObject *__pyx_v_head;
  PyObject *__pyx_v_item;
  PyObject *__pyx_v_items;
  PyObject *__pyx_v_new_item;
  PyObject *__pyx_v_options;
  PyObject *__pyx_v_style;
  PyObject *__pyx_t_0;
  PyObject *__pyx_t_1;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
};


/* "mathics/builtin/graphics.py":2841
 *         self.elements = list(convert(content, self.get_style_class()(self)))
 * 
 *     def create_style(self, expr):             # <<<<<<<<<<<<<<
 *         style = self.get_style_class()(self)
 * 
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_73_create_style {
  PyObject_HEAD
  PyObject *__pyx_v_convert;
  PyObject *__pyx_v_style;
};


/* "mathics/builtin/graphics.py":2919
 *         return xmin, xmax, ymin, ymax
 * 
 *     def to_svg(self):             # <<<<<<<<<<<<<<
 *         return "\n".join(element.to_svg() for element in self.elements)
 * 
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_74_to_svg {
  PyObject_HEAD
  PyObject *__pyx_v_self;
};


/* "mathics/builtin/graphics.py":2920
 * 
 *     def to_svg(self):
 *         return "\n".join(element.to_svg() for element in self.elements)             # <<<<<<<<<<<<<<
 * 
 *     def to_asy(self):
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_75_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_74_to_svg *__pyx_outer_scope;
  PyObject *__pyx_v_element;
};


/* "mathics/builtin/graphics.py":2922
 *         return "\n".join(element.to_svg() for element in self.elements)
 * 
 *     def to_asy(self):             # <<<<<<<<<<<<<<
 *         return "\n".join(element.to_asy() for element in self.elements)
 * 
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_76_to_asy {
  PyObject_HEAD
  PyObject *__pyx_v_self;
};


/* "mathics/builtin/graphics.py":2923
 * 
 *     def to_asy(self):
 *         return "\n".join(element.to_asy() for element in self.elements)             # <<<<<<<<<<<<<<
 * 
 *     def set_size(
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_77_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_76_to_asy *__pyx_outer_scope;
  PyObject *__pyx_v_element;
};


/* "mathics/builtin/graphics.py":2992
 *         return base_width, base_height, multi, aspect
 * 
 *     def _prepare_elements(self, leaves, options, neg_y=False, max_width=None):             # <<<<<<<<<<<<<<
 *         if not leaves:
 *             raise BoxConstructError
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_78__prepare_elements {
  PyObject_HEAD
  PyObject *__pyx_v_axes;
  PyObject *__pyx_v_base_height;
  PyObject *__pyx_v_base_width;
  PyObject *__pyx_v_elements;
  PyObject *__pyx_v_plot_range;
  PyObject *__pyx_v_size_aspect;
  PyObject *__pyx_v_size_multiplier;
};


/* "mathics/builtin/graphics.py":3041
 *             if (
 *                 final_pass
 *                 and any(x for x in axes)             # <<<<<<<<<<<<<<
 *                 and plot_range != ["System`Automatic", "System`Automatic"]
 *             ):
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_79_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_78__prepare_elements *__pyx_outer_scope;
  PyObject *__pyx_v_x;
};


/* "mathics/builtin/graphics.py":3145
 *         return elements, calc_dimensions
 * 
 *     def boxes_to_tex(self, leaves, **options):             # <<<<<<<<<<<<<<
 *         elements, calc_dimensions = self._prepare_elements(
 *             leaves, options, max_width=450
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_80_boxes_to_tex {
  PyObject_HEAD
  PyObject *__pyx_v_elements;
};


/* "mathics/builtin/graphics.py":3154
 * 
 *         asy_completely_visible = "\n".join(
 *             element.to_asy()             # <<<<<<<<<<<<<<
 *             for element in elements.elements
 *             if element.is_completely_visible
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_81_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_80_boxes_to_tex *__pyx_outer_scope;
  PyObject *__pyx_v_element;
};


/* "mathics/builtin/graphics.py":3160
 * 
 *         asy_regular = "\n".join(
 *             element.to_asy()             # <<<<<<<<<<<<<<
 *             for element in elements.elements
 *             if not element.is_completely_visible
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_82_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_80_boxes_to_tex *__pyx_outer_scope;
  PyObject *__pyx_v_element;
};


/* "mathics/builtin/graphics.py":3198
 *         return tex
 * 
 *     def boxes_to_xml(self, leaves, **options):             # <<<<<<<<<<<<<<
 *         elements, calc_dimensions = self._prepare_elements(leaves, options, neg_y=True)
 * 
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_83_boxes_to_xml {
  PyObject_HEAD
  PyObject *__pyx_v_h;
  PyObject *__pyx_v_w;
  PyObject *__pyx_v_xmin;
  PyObject *__pyx_v_ymin;
};


/* "mathics/builtin/graphics.py":3229
 *             </svg>
 *         """ % (
 *             " ".join("%f" % t for t in (xmin, ymin, w, h)),             # <<<<<<<<<<<<<<
 *             svg,
 *         )
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_84_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_83_boxes_to_xml *__pyx_outer_scope;
  PyObject *__pyx_v_t;
};


/* "mathics/builtin/graphics.py":3302
 *         return ticks, ticks_small, origin_x
 * 
 *     def create_axes(self, elements, graphics_options, xmin, xmax, ymin, ymax):             # <<<<<<<<<<<<<<
 *         axes = graphics_options.get("System`Axes")
 *         if axes.is_true():
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_85_create_axes {
  PyObject_HEAD
  PyObject *__pyx_v_elements;
  PyObject *__pyx_v_origin_x;
  PyObject *__pyx_v_origin_y;
  PyObject *__pyx_v_ticks_x;
  PyObject *__pyx_v_ticks_y;
};


/* "mathics/builtin/graphics.py":3340
 *         tick_label_d = 2
 * 
 *         ticks_x_int = all(floor(x) == x for x in ticks_x)             # <<<<<<<<<<<<<<
 *         ticks_y_int = all(floor(x) == x for x in ticks_y)
 * 
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_86_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_85_create_axes *__pyx_outer_scope;
  PyObject *__pyx_v_x;
};


/* "mathics/builtin/graphics.py":3341
 * 
 *         ticks_x_int = all(floor(x) == x for x in ticks_x)
 *         ticks_y_int = all(floor(x) == x for x in ticks_y)             # <<<<<<<<<<<<<<
 * 
 *         for index, (
 */
struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_87_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_85_create_axes *__pyx_outer_scope;
  PyObject *__pyx_v_x;
};


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/* py_abs.proto */
#if CYTHON_USE_PYLONG_INTERNALS
static PyObject *__Pyx_PyLong_AbsNeg(PyObject *num);
#define __Pyx_PyNumber_Absolute(x)\
    ((likely(PyLong_CheckExact(x))) ?\
         (likely(Py_SIZE(x) >= 0) ? (Py_INCREF(x), (x)) : __Pyx_PyLong_AbsNeg(x)) :\
         PyNumber_Absolute(x))
#else
#define __Pyx_PyNumber_Absolute(x)  PyNumber_Absolute(x)
#endif

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

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

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

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

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

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

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

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

/* PyFloatBinop.proto */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyFloat_AddCObj(PyObject *op1, PyObject *op2, double floatval, int inplace, int zerodivision_check);
#else
#define __Pyx_PyFloat_AddCObj(op1, op2, floatval, inplace, zerodivision_check)\
    (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
#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

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

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

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

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

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

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

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

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

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

/* PySequenceContains.proto */
static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) {
    int result = PySequence_Contains(seq, item);
    return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
}

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

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

/* CythonFunctionShared.proto */
#define __Pyx_CyFunction_USED 1
#define __Pyx_CYFUNCTION_STATICMETHOD  0x01
#define __Pyx_CYFUNCTION_CLASSMETHOD   0x02
#define __Pyx_CYFUNCTION_CCLASS        0x04
#define __Pyx_CyFunction_GetClosure(f)\
    (((__pyx_CyFunctionObject *) (f))->func_closure)
#define __Pyx_CyFunction_GetClassObj(f)\
    (((__pyx_CyFunctionObject *) (f))->func_classobj)
#define __Pyx_CyFunction_Defaults(type, f)\
    ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
    ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
typedef struct {
    PyCFunctionObject func;
#if PY_VERSION_HEX < 0x030500A0
    PyObject *func_weakreflist;
#endif
    PyObject *func_dict;
    PyObject *func_name;
    PyObject *func_qualname;
    PyObject *func_doc;
    PyObject *func_globals;
    PyObject *func_code;
    PyObject *func_closure;
    PyObject *func_classobj;
    void *defaults;
    int defaults_pyobjects;
    size_t defaults_size;  // used by FusedFunction for copying defaults
    int flags;
    PyObject *defaults_tuple;
    PyObject *defaults_kwdict;
    PyObject *(*defaults_getter)(PyObject *);
    PyObject *func_annotations;
} __pyx_CyFunctionObject;
static PyTypeObject *__pyx_CyFunctionType = 0;
#define __Pyx_CyFunction_Check(obj)  (__Pyx_TypeCheck(obj, __pyx_CyFunctionType))
static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml,
                                      int flags, PyObject* qualname,
                                      PyObject *self,
                                      PyObject *module, PyObject *globals,
                                      PyObject* code);
static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
                                                         size_t size,
                                                         int pyobjects);
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
                                                            PyObject *tuple);
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
                                                             PyObject *dict);
static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
                                                              PyObject *dict);
static int __pyx_CyFunction_init(void);

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

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

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

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

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

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

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

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

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

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

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

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

/* PyFloatBinop.proto */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyFloat_EqObjC(PyObject *op1, PyObject *op2, double floatval, int inplace, int zerodivision_check);
#else
#define __Pyx_PyFloat_EqObjC(op1, op2, floatval, inplace, zerodivision_check)\
    (PyObject_RichCompare(op1, op2, Py_EQ))
    #endif

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


/* Module declarations from 'mathics.builtin.graphics' */
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct___euclidean_distance = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_1_genexpr = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_2__extract_graphics = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_3_genexpr = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_4_apply_makeboxes = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_5_convert = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_6_genexpr = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_7_genexpr = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_8_hsl_to_rgba = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_9_apply = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_10_to_svg = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_11_path = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_12_to_asy = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_13_path = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_14_genexpr = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_15_genexpr = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_16_do_init = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_17_genexpr = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_18_init = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_19_genexpr = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_20__svg_bezier = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_21_path = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_22_genexpr = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_23__asy_bezier = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_24_path = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_25_init = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_26_parse_component = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_27_genexpr = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_28_to_svg = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_29_components = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_30_to_asy = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_31_components = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_32_to_svg = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_33_genexpr = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_34_init = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_35_genexpr = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_36_vertices = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_37_heads = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_38_genexpr = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_39_make_draw_svg = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_40_draw = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_41_genexpr = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_42_make_draw_asy = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_43_draw = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_44_arrows = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_45_segments = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_46_genexpr = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_47_genexpr = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_48_make_draw_svg = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_49_draw = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_50_make_draw_asy = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_51_draw = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_52_arrows = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_53__setback_spec = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_54_genexpr = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_55__default_arrow = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_56_draw = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_57__draw = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_58__custom_arrow = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_59_make = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_60_draw = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_61_to_svg = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_62_polygon = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_63_genexpr = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_64_to_asy = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_65_polygon = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_66_extent = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_67_polyline = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_68_polygon = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_69_default_arrow = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_70__flatten = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_71___init__ = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_72_convert = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_73_create_style = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_74_to_svg = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_75_genexpr = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_76_to_asy = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_77_genexpr = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_78__prepare_elements = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_79_genexpr = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_80_boxes_to_tex = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_81_genexpr = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_82_genexpr = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_83_boxes_to_xml = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_84_genexpr = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_85_create_axes = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_86_genexpr = 0;
static PyTypeObject *__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_87_genexpr = 0;
static PyObject *__pyx_9genexpr71__pyx_v_7mathics_7builtin_8graphics_element;
#define __Pyx_MODULE_NAME "mathics.builtin.graphics"
extern int __pyx_module_is_main_mathics__builtin__graphics;
int __pyx_module_is_main_mathics__builtin__graphics = 0;

/* Implementation of 'mathics.builtin.graphics' */
static PyObject *__pyx_builtin_object;
static PyObject *__pyx_builtin_staticmethod;
static PyObject *__pyx_builtin_sum;
static PyObject *__pyx_builtin_zip;
static PyObject *__pyx_builtin_NotImplementedError;
static PyObject *__pyx_builtin_super;
static PyObject *__pyx_builtin_ValueError;
static PyObject *__pyx_builtin_RuntimeError;
static PyObject *__pyx_builtin_enumerate;
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_sorted;
static PyObject *__pyx_builtin_reversed;
static PyObject *__pyx_builtin_map;
static PyObject *__pyx_builtin_TypeError;
static const char __pyx_k_0[] = ",0,";
static const char __pyx_k_1[] = "1";
static const char __pyx_k_3[] = "3";
static const char __pyx_k_A[] = "A ";
static const char __pyx_k_F[] = "F";
static const char __pyx_k_L[] = "L ";
static const char __pyx_k_M[] = "M ";
static const char __pyx_k_N[] = "N";
static const char __pyx_k_T[] = "T";
static const char __pyx_k_Z[] = "Z";
static const char __pyx_k_a[] = "a";
static const char __pyx_k_b[] = "b";
static const char __pyx_k_c[] = "c";
static const char __pyx_k_d[] = "d";
static const char __pyx_k_e[] = "e";
static const char __pyx_k_f[] = "f";
static const char __pyx_k_g[] = "</g>";
static const char __pyx_k_h[] = "h";
static const char __pyx_k_i[] = "i";
static const char __pyx_k_k[] = "k";
static const char __pyx_k_l[] = "l";
static const char __pyx_k_n[] = "n";
static const char __pyx_k_p[] = "p";
static const char __pyx_k_q[] = "q";
static const char __pyx_k_r[] = "r";
static const char __pyx_k_s[] = "s";
static const char __pyx_k_t[] = "t";
static const char __pyx_k_u[] = "u";
static const char __pyx_k_w[] = "w";
static const char __pyx_k_x[] = "x";
static const char __pyx_k_y[] = "y";
static const char __pyx_k_1f[] = "%.1f";
static const char __pyx_k_5g[] = "%.5g";
static const char __pyx_k_C1[] = "C1";
static const char __pyx_k_C2[] = "C2";
static const char __pyx_k_Cm[] = "Cm";
static const char __pyx_k_Hm[] = "Hm";
static const char __pyx_k_L1[] = "L1";
static const char __pyx_k_L2[] = "L2";
static const char __pyx_k_Lm[] = "Lm";
static const char __pyx_k_SC[] = "SC";
static const char __pyx_k_SH[] = "SH";
static const char __pyx_k_SL[] = "SL";
static const char __pyx_k__3[] = "; ";
static const char __pyx_k__4[] = ", ";
static const char __pyx_k__5[] = "\n";
static const char __pyx_k__6[] = ")";
static const char __pyx_k__7[] = " ";
static const char __pyx_k__8[] = "\">";
static const char __pyx_k__9[] = "(";
static const char __pyx_k_a1[] = "a1";
static const char __pyx_k_a2[] = "a2";
static const char __pyx_k_b1[] = "b1";
static const char __pyx_k_b2[] = "b2";
static const char __pyx_k_bx[] = "bx";
static const char __pyx_k_by[] = "by";
static const char __pyx_k_c1[] = "c1";
static const char __pyx_k_c2[] = "c2";
static const char __pyx_k_cm[] = "cm, ";
static const char __pyx_k_cp[] = "cp";
static const char __pyx_k_cx[] = "cx";
static const char __pyx_k_cy[] = "\" cy=\"";
static const char __pyx_k_dC[] = "dC";
static const char __pyx_k_dH[] = "dH";
static const char __pyx_k_dL[] = "dL";
static const char __pyx_k_da[] = "da";
static const char __pyx_k_db[] = "db";
static const char __pyx_k_dh[] = "dh";
static const char __pyx_k_dl[] = "dl";
static const char __pyx_k_dx[] = "dx";
static const char __pyx_k_dy[] = "dy";
static const char __pyx_k_ex[] = "ex";
static const char __pyx_k_ey[] = "ey";
static const char __pyx_k_h1[] = "h1";
static const char __pyx_k_h2[] = "h2";
static const char __pyx_k_hx[] = "hx";
static const char __pyx_k_hy[] = "hy";
static const char __pyx_k_kC[] = "kC";
static const char __pyx_k_kH[] = "kH";
static const char __pyx_k_kL[] = "kL";
static const char __pyx_k_mt[] = "mt";
static const char __pyx_k_np[] = "np";
static const char __pyx_k_ox[] = "ox";
static const char __pyx_k_oy[] = "oy";
static const char __pyx_k_p0[] = "p0";
static const char __pyx_k_p1[] = "p1";
static const char __pyx_k_p2[] = "p2";
static const char __pyx_k_p3[] = "p3";
static const char __pyx_k_pi[] = "pi";
static const char __pyx_k_px[] = "px";
static const char __pyx_k_py[] = "py";
static const char __pyx_k_qx[] = "qx";
static const char __pyx_k_qy[] = "qy";
static const char __pyx_k_rT[] = "rT";
static const char __pyx_k_rx[] = "\" rx=\"";
static const char __pyx_k_ry[] = "\" ry=\"";
static const char __pyx_k_s1[] = "s1";
static const char __pyx_k_s2[] = "s2";
static const char __pyx_k_sx[] = "sx";
static const char __pyx_k_sy[] = "sy";
static const char __pyx_k_t0[] = "t0";
static const char __pyx_k_t1[] = "t1";
static const char __pyx_k_t2[] = "t2";
static const char __pyx_k_t3[] = "t3";
static const char __pyx_k_te[] = "te";
static const char __pyx_k_tl[] = "tl";
static const char __pyx_k_to[] = " to ";
static const char __pyx_k_ts[] = "ts";
static const char __pyx_k_tx[] = "tx";
static const char __pyx_k_ty[] = "ty";
static const char __pyx_k_vx[] = "vx";
static const char __pyx_k_vy[] = "vy";
static const char __pyx_k_x0[] = "x0";
static const char __pyx_k_x1[] = "x1";
static const char __pyx_k_x2[] = "x2";
static const char __pyx_k_xy[] = "xy";
static const char __pyx_k_y1[] = "y1";
static const char __pyx_k_y2[] = "y2";
static const char __pyx_k_0_0[] = "(0.,0.)";
static const char __pyx_k_0_2[] = "0";
static const char __pyx_k_Box[] = "Box";
static const char __pyx_k_CMC[] = "CMC";
static const char __pyx_k_HSB[] = "HSB";
static const char __pyx_k_Hue[] = "Hue";
static const char __pyx_k_LAB[] = "LAB";
static const char __pyx_k_LCH[] = "LCH";
static const char __pyx_k_LQC[] = "LQC";
static const char __pyx_k_LUV[] = "LUV";
static const char __pyx_k_RGB[] = "RGB";
static const char __pyx_k_Red[] = "Red";
static const char __pyx_k_XYZ[] = "XYZ";
static const char __pyx_k_Z_2[] = " Z";
static const char __pyx_k__10[] = " * ";
static const char __pyx_k__16[] = "%, ";
static const char __pyx_k__17[] = "%)";
static const char __pyx_k__18[] = ".";
static const char __pyx_k__30[] = "\" />";
static const char __pyx_k__31[] = ",";
static const char __pyx_k__32[] = ")--(";
static const char __pyx_k__33[] = ");";
static const char __pyx_k__34[] = "),";
static const char __pyx_k__35[] = "), ";
static const char __pyx_k__41[] = "";
static const char __pyx_k__43[] = "--";
static const char __pyx_k__57[] = "\"/>";
static const char __pyx_k__58[] = "..";
static const char __pyx_k__66[] = "^^";
static const char __pyx_k__67[] = "});";
static const char __pyx_k_add[] = "add";
static const char __pyx_k_arc[] = "arc";
static const char __pyx_k_arg[] = "arg";
static const char __pyx_k_asy[] = "asy";
static const char __pyx_k_box[] = "box((";
static const char __pyx_k_cls[] = "cls";
static const char __pyx_k_cmd[] = "cmd";
static const char __pyx_k_cos[] = "cos";
static const char __pyx_k_cp0[] = "cp0";
static const char __pyx_k_cp1[] = "cp1";
static const char __pyx_k_cp2[] = "cp2";
static const char __pyx_k_cp3[] = "cp3";
static const char __pyx_k_css[] = "css";
static const char __pyx_k_cut[] = "cut";
static const char __pyx_k_dH2[] = "dH2";
static const char __pyx_k_dcp[] = "dcp";
static const char __pyx_k_dir[] = "dir";
static const char __pyx_k_doc[] = "__doc__";
static const char __pyx_k_dot[] = "dot(";
static const char __pyx_k_exp[] = "exp";
static const char __pyx_k_ext[] = "ext";
static const char __pyx_k_f_2[] = "%f";
static const char __pyx_k_f_f[] = "%f,%f";
static const char __pyx_k_g_2[] = "%g";
static const char __pyx_k_get[] = "get";
static const char __pyx_k_key[] = "key";
static const char __pyx_k_map[] = "map";
static const char __pyx_k_max[] = "max";
static const char __pyx_k_min[] = "min";
static const char __pyx_k_mt2[] = "mt2";
static const char __pyx_k_mt3[] = "mt3";
static const char __pyx_k_pen[] = "pen";
static const char __pyx_k_phi[] = "phi";
static const char __pyx_k_pi2[] = "pi2";
static const char __pyx_k_pop[] = "pop";
static const char __pyx_k_pos[] = "pos";
static const char __pyx_k_pre[] = "pre";
static const char __pyx_k_qp0[] = "qp0";
static const char __pyx_k_qp1[] = "qp1";
static const char __pyx_k_qp2[] = "qp2";
static const char __pyx_k_r_2[] = "\" r=\"";
static const char __pyx_k_rgb[] = "rgb(";
static const char __pyx_k_s_2[] = ", % s);";
static const char __pyx_k_seg[] = "seg";
static const char __pyx_k_sin[] = "sin";
static const char __pyx_k_sum[] = "sum";
static const char __pyx_k_svg[] = "svg";
static const char __pyx_k_tex[] = "tex";
static const char __pyx_k_val[] = "val";
static const char __pyx_k_y_2[] = "\" y=\"";
static const char __pyx_k_zip[] = "zip";
static const char __pyx_k_Axes[] = "Axes";
static const char __pyx_k_Blue[] = "Blue";
static const char __pyx_k_CMYK[] = "CMYK";
static const char __pyx_k_Cyan[] = "Cyan";
static const char __pyx_k_Disk[] = "Disk";
static const char __pyx_k_Gray[] = "Gray";
static const char __pyx_k_Line[] = "_Line";
static const char __pyx_k_List[] = "List";
static const char __pyx_k_None[] = "None";
static const char __pyx_k_Real[] = "Real";
static const char __pyx_k_Rule[] = "Rule";
static const char __pyx_k_Show[] = "Show";
static const char __pyx_k_Size[] = "_Size";
static const char __pyx_k_Text[] = "Text";
static const char __pyx_k_Thin[] = "Thin";
static const char __pyx_k_Tiny[] = "Tiny";
static const char __pyx_k__108[] = "$\", (";
static const char __pyx_k__109[] = "), (";
static const char __pyx_k__140[] = "))";
static const char __pyx_k__141[] = ");\n";
static const char __pyx_k__142[] = "\">\n                ";
static const char __pyx_k__151[] = "{}";
static const char __pyx_k__186[] = "_";
static const char __pyx_k_argl[] = "argl";
static const char __pyx_k_args[] = "args";
static const char __pyx_k_axes[] = "axes";
static const char __pyx_k_boxh[] = "boxh";
static const char __pyx_k_boxw[] = "boxw";
static const char __pyx_k_ceil[] = "ceil";
static const char __pyx_k_clip[] = "\nclip(";
static const char __pyx_k_cm_2[] = "cm);\n";
static const char __pyx_k_code[] = "code";
static const char __pyx_k_copy[] = "copy";
static const char __pyx_k_cy_2[] = "cy";
static const char __pyx_k_data[] = "data";
static const char __pyx_k_draw[] = "draw";
static const char __pyx_k_edge[] = "edge";
static const char __pyx_k_expr[] = "expr";
static const char __pyx_k_face[] = "face";
static const char __pyx_k_fill[] = "fill(";
static const char __pyx_k_frac[] = "frac";
static const char __pyx_k_head[] = "head";
static const char __pyx_k_init[] = "init";
static const char __pyx_k_item[] = "item";
static const char __pyx_k_json[] = "json";
static const char __pyx_k_keys[] = "keys";
static const char __pyx_k_lab1[] = "lab1";
static const char __pyx_k_lab2[] = "lab2";
static const char __pyx_k_leaf[] = "leaf";
static const char __pyx_k_line[] = "line";
static const char __pyx_k_main[] = "__main__";
static const char __pyx_k_make[] = "make";
static const char __pyx_k_math[] = "\"><math>";
static const char __pyx_k_mesh[] = "mesh";
static const char __pyx_k_name[] = "name";
static const char __pyx_k_norm[] = "_norm";
static const char __pyx_k_opos[] = "opos";
static const char __pyx_k_ox_2[] = "\" ox=\"";
static const char __pyx_k_oy_2[] = "\" oy=\"";
static const char __pyx_k_part[] = "part";
static const char __pyx_k_path[] = "path";
static const char __pyx_k_pens[] = "pens";
static const char __pyx_k_phi0[] = "phi0";
static const char __pyx_k_py_a[] = "py_a";
static const char __pyx_k_py_b[] = "py_b";
static const char __pyx_k_qp0x[] = "qp0x";
static const char __pyx_k_qp0y[] = "qp0y";
static const char __pyx_k_qp1x[] = "qp1x";
static const char __pyx_k_qp1y[] = "qp1y";
static const char __pyx_k_qp2x[] = "qp2x";
static const char __pyx_k_qp2y[] = "qp2y";
static const char __pyx_k_rgba[] = "rgba";
static const char __pyx_k_rx_2[] = "rx";
static const char __pyx_k_ry_2[] = "ry";
static const char __pyx_k_self[] = "self";
static const char __pyx_k_send[] = "send";
static const char __pyx_k_size[] = "size";
static const char __pyx_k_spec[] = "spec";
static const char __pyx_k_sqrt[] = "sqrt";
static const char __pyx_k_test[] = "__test__";
static const char __pyx_k_type[] = "type";
static const char __pyx_k_utf8[] = "utf8";
static const char __pyx_k_xmax[] = "xmax";
static const char __pyx_k_xmin[] = "xmin";
static const char __pyx_k_ymax[] = "ymax";
static const char __pyx_k_ymin[] = "ymin";
static const char __pyx_k_5g_5g[] = "(%.5g,%5g)";
static const char __pyx_k_Apply[] = "Apply";
static const char __pyx_k_Arrow[] = "Arrow";
static const char __pyx_k_Black[] = "Black";
static const char __pyx_k_Blend[] = "Blend";
static const char __pyx_k_CIE76[] = "CIE76";
static const char __pyx_k_CIE94[] = "CIE94";
static const char __pyx_k_Color[] = "_Color";
static const char __pyx_k_False[] = "False";
static const char __pyx_k_Green[] = "Green";
static const char __pyx_k_Inset[] = "Inset";
static const char __pyx_k_Large[] = "Large";
static const char __pyx_k_M_f_f[] = "M%f,%f";
static const char __pyx_k_Point[] = "Point";
static const char __pyx_k_Small[] = "Small";
static const char __pyx_k_Style[] = "Style";
static const char __pyx_k_Thick[] = "Thick";
static const char __pyx_k_White[] = "White";
static const char __pyx_k_alpha[] = "alpha";
static const char __pyx_k_apply[] = "apply";
static const char __pyx_k_arrow[] = "arrow";
static const char __pyx_k_atan2[] = "atan2";
static const char __pyx_k_atoms[] = "atoms";
static const char __pyx_k_black[] = "black";
static const char __pyx_k_brush[] = "brush";
static const char __pyx_k_chain[] = "chain";
static const char __pyx_k_class[] = "__class__";
static const char __pyx_k_clone[] = "clone";
static const char __pyx_k_close[] = "close";
static const char __pyx_k_color[] = "color";
static const char __pyx_k_cubic[] = "cubic";
static const char __pyx_k_curve[] = "curve";
static const char __pyx_k_cycle[] = ")--cycle, ";
static const char __pyx_k_doc_2[] = "doc";
static const char __pyx_k_dumps[] = "dumps";
static const char __pyx_k_edges[] = "edges";
static const char __pyx_k_exmax[] = "exmax";
static const char __pyx_k_exmin[] = "exmin";
static const char __pyx_k_eymax[] = "eymax";
static const char __pyx_k_eymin[] = "eymin";
static const char __pyx_k_floor[] = "floor";
static const char __pyx_k_forms[] = "forms";
static const char __pyx_k_heads[] = "heads";
static const char __pyx_k_index[] = "index";
static const char __pyx_k_items[] = "items";
static const char __pyx_k_klass[] = "klass";
static const char __pyx_k_label[] = "label(\"$";
static const char __pyx_k_lines[] = "lines";
static const char __pyx_k_log10[] = "log10";
static const char __pyx_k_lower[] = "lower";
static const char __pyx_k_multi[] = "multi";
static const char __pyx_k_neg_y[] = "neg_y";
static const char __pyx_k_numpy[] = "numpy";
static const char __pyx_k_parts[] = "parts";
static const char __pyx_k_paths[] = "paths";
static const char __pyx_k_point[] = "point";
static const char __pyx_k_range[] = "range";
static const char __pyx_k_rgb_2[] = "rgb";
static const char __pyx_k_rspec[] = "rspec";
static const char __pyx_k_rules[] = "rules";
static const char __pyx_k_scale[] = "scale(";
static const char __pyx_k_shape[] = "shape";
static const char __pyx_k_shift[] = "shift(";
static const char __pyx_k_specs[] = "specs";
static const char __pyx_k_style[] = "style";
static const char __pyx_k_sub_x[] = "sub_x";
static const char __pyx_k_super[] = "super";
static const char __pyx_k_svg_2[] = "\n            </svg>\n        ";
static const char __pyx_k_throw[] = "throw";
static const char __pyx_k_ticks[] = "ticks";
static const char __pyx_k_to_js[] = "to_js";
static const char __pyx_k_total[] = "total";
static const char __pyx_k_trans[] = "trans";
static const char __pyx_k_union[] = "union";
static const char __pyx_k_value[] = "value";
static const char __pyx_k_width[] = "\" width=\"";
static const char __pyx_k_ArcBox[] = "_ArcBox";
static const char __pyx_k_Circle[] = "Circle";
static const char __pyx_k_Coords[] = "Coords";
static const char __pyx_k_Darker[] = "Darker";
static const char __pyx_k_DeltaC[] = "DeltaC";
static const char __pyx_k_DeltaH[] = "DeltaH";
static const char __pyx_k_DeltaL[] = "DeltaL";
static const char __pyx_k_Disk_2[] = "Disk[]";
static const char __pyx_k_Ignore[] = "Ignore";
static const char __pyx_k_Line_2[] = "Line";
static const char __pyx_k_Medium[] = "Medium";
static const char __pyx_k_Offset[] = "Offset";
static const char __pyx_k_Orange[] = "Orange";
static const char __pyx_k_Purple[] = "Purple";
static const char __pyx_k_Sphere[] = "Sphere";
static const char __pyx_k_String[] = "String";
static const char __pyx_k_Symbol[] = "Symbol";
static const char __pyx_k_System[] = "System`";
static const char __pyx_k_Yellow[] = "Yellow";
static const char __pyx_k_append[] = "append";
static const char __pyx_k_arrows[] = "arrows";
static const char __pyx_k_aspect[] = "aspect";
static const char __pyx_k_base64[] = "base64";
static const char __pyx_k_border[] = "border";
static const char __pyx_k_chroma[] = "chroma";
static const char __pyx_k_closed[] = "closed";
static const char __pyx_k_colors[] = "colors";
static const char __pyx_k_coords[] = "coords";
static const char __pyx_k_create[] = "create";
static const char __pyx_k_decode[] = "decode";
static const char __pyx_k_draw_2[] = "draw(";
static const char __pyx_k_draw_3[] = "_draw";
static const char __pyx_k_extend[] = "extend";
static const char __pyx_k_extent[] = "extent";
static const char __pyx_k_fill_s[] = "fill: %s";
static const char __pyx_k_format[] = "format";
static const char __pyx_k_height[] = "\" height=\"";
static const char __pyx_k_import[] = "__import__";
static const char __pyx_k_init_2[] = "__init__";
static const char __pyx_k_invarg[] = "invarg";
static const char __pyx_k_kwargs[] = "kwargs";
static const char __pyx_k_leaves[] = "leaves";
static const char __pyx_k_length[] = "length";
static const char __pyx_k_linear[] = "linear";
static const char __pyx_k_math_2[] = "math";
static const char __pyx_k_matrix[] = "matrix(";
static const char __pyx_k_module[] = "__module__";
static const char __pyx_k_name_2[] = "__name__";
static const char __pyx_k_object[] = "object";
static const char __pyx_k_option[] = "option";
static const char __pyx_k_path_d[] = "<path d=\"";
static const char __pyx_k_points[] = "points";
static const char __pyx_k_rect_x[] = "<rect x=\"";
static const char __pyx_k_result[] = "result";
static const char __pyx_k_rotate[] = "rotate";
static const char __pyx_k_shrink[] = "shrink";
static const char __pyx_k_sorted[] = "sorted";
static const char __pyx_k_step_x[] = "step_x";
static const char __pyx_k_styles[] = "styles";
static const char __pyx_k_to_asy[] = "to_asy";
static const char __pyx_k_to_css[] = "to_css";
static const char __pyx_k_to_svg[] = "to_svg";
static const char __pyx_k_update[] = "update";
static const char __pyx_k_values[] = "values";
static const char __pyx_k_5g_5g_2[] = "--(%.5g,%.5g)";
static const char __pyx_k_5g_5g_3[] = "(%.5g,%.5g)";
static const char __pyx_k_Builtin[] = "Builtin";
static const char __pyx_k_CIE2000[] = "CIE2000";
static const char __pyx_k_Color_2[] = "Color";
static const char __pyx_k_DiskBox[] = "DiskBox";
static const char __pyx_k_GLOBALS[] = "GLOBALS";
static const char __pyx_k_HoldAll[] = "HoldAll";
static const char __pyx_k_Integer[] = "Integer";
static const char __pyx_k_Lighter[] = "Lighter";
static const char __pyx_k_LineBox[] = "LineBox";
static const char __pyx_k_Magenta[] = "Magenta";
static const char __pyx_k_Polygon[] = "Polygon";
static const char __pyx_k_asy_box[] = "asy_box";
static const char __pyx_k_builtin[] = "builtin";
static const char __pyx_k_color_s[] = "color: %s";
static const char __pyx_k_command[] = "command";
static const char __pyx_k_compute[] = "compute";
static const char __pyx_k_connect[] = "connect";
static const char __pyx_k_content[] = "content";
static const char __pyx_k_convert[] = "convert";
static const char __pyx_k_cycle_2[] = "--cycle";
static const char __pyx_k_cycle_3[] = "--cycle, ";
static const char __pyx_k_cycle_s[] = "--cycle, % s);";
static const char __pyx_k_degrees[] = "degrees";
static const char __pyx_k_do_init[] = "do_init";
static const char __pyx_k_element[] = "element";
static const char __pyx_k_ellipse[] = "(ellipse((";
static const char __pyx_k_end_asy[] = "\n\\end{asy}\n";
static const char __pyx_k_extents[] = "extents";
static const char __pyx_k_flatten[] = "_flatten";
static const char __pyx_k_formats[] = "formats";
static const char __pyx_k_genexpr[] = "genexpr";
static const char __pyx_k_invdist[] = "invdist";
static const char __pyx_k_is_true[] = "is_true";
static const char __pyx_k_message[] = "message";
static const char __pyx_k_new_int[] = "}, new int[] {";
static const char __pyx_k_new_pen[] = ", new pen[] {";
static const char __pyx_k_nullpen[] = "nullpen";
static const char __pyx_k_opacity[] = "opacity";
static const char __pyx_k_options[] = "options";
static const char __pyx_k_p_self0[] = "p_self0";
static const char __pyx_k_polygon[] = "polygon";
static const char __pyx_k_prepare[] = "__prepare__";
static const char __pyx_k_py_name[] = "py_name";
static const char __pyx_k_radians[] = "radians";
static const char __pyx_k_s_s_s_s[] = "(%s,%s)--(%s,%s)--";
static const char __pyx_k_scale_2[] = "scale";
static const char __pyx_k_segment[] = "segment";
static const char __pyx_k_setback[] = "setback";
static const char __pyx_k_shift_2[] = "shift";
static const char __pyx_k_steps_x[] = "steps_x";
static const char __pyx_k_style_2[] = "\" style=\"";
static const char __pyx_k_style_3[] = "_style";
static const char __pyx_k_style_s[] = "\" style=\"%s\" />";
static const char __pyx_k_svg_xml[] = "svg_xml";
static const char __pyx_k_ticks_x[] = "ticks_x";
static const char __pyx_k_ticks_y[] = "ticks_y";
static const char __pyx_k_to_expr[] = "to_expr";
static const char __pyx_k_to_rgba[] = "to_rgba";
static const char __pyx_k_width_2[] = "width";
static const char __pyx_k_ArrowBox[] = "ArrowBox";
static const char __pyx_k_Circle_2[] = "Circle[]";
static const char __pyx_k_Darker_c[] = "Darker[c_]";
static const char __pyx_k_Disk_0_0[] = "Disk[{0, 0}]";
static const char __pyx_k_EdgeForm[] = "EdgeForm";
static const char __pyx_k_FaceForm[] = "FaceForm";
static const char __pyx_k_Graphics[] = "Graphics";
static const char __pyx_k_InsetBox[] = "InsetBox";
static const char __pyx_k_LABColor[] = "LABColor";
static const char __pyx_k_LCHColor[] = "LCHColor";
static const char __pyx_k_LUVColor[] = "LUVColor";
static const char __pyx_k_LightRed[] = "LightRed";
static const char __pyx_k_PointBox[] = "PointBox";
static const char __pyx_k_Polyline[] = "_Polyline";
static const char __pyx_k_RGBColor[] = "RGBColor";
static const char __pyx_k_Rational[] = "Rational";
static const char __pyx_k_RoundBox[] = "_RoundBox";
static const char __pyx_k_StyleBox[] = "StyleBox";
static const char __pyx_k_XYZColor[] = "XYZColor";
static const char __pyx_k_arc_expr[] = "arc_expr";
static const char __pyx_k_box_name[] = "box_name";
static const char __pyx_k_builtins[] = "builtins";
static const char __pyx_k_distance[] = "distance";
static const char __pyx_k_do_blend[] = "do_blend";
static const char __pyx_k_elements[] = "elements";
static const char __pyx_k_evaluate[] = "evaluate";
static const char __pyx_k_filldraw[] = "filldraw((";
static const char __pyx_k_get_name[] = "get_name";
static const char __pyx_k_get_size[] = "get_size";
static const char __pyx_k_graphics[] = "graphics";
static const char __pyx_k_has_form[] = "has_form";
static const char __pyx_k_height_2[] = "height";
static const char __pyx_k_matrix_2[] = "matrix";
static const char __pyx_k_messages[] = "messages";
static const char __pyx_k_n_leaves[] = "n_leaves";
static const char __pyx_k_new_item[] = "new_item";
static const char __pyx_k_new_leaf[] = "new_leaf";
static const char __pyx_k_origin_x[] = "origin_x";
static const char __pyx_k_origin_y[] = "origin_y";
static const char __pyx_k_p_origin[] = "p_origin";
static const char __pyx_k_p_other0[] = "p_other0";
static const char __pyx_k_polyline[] = "polyline";
static const char __pyx_k_qualname[] = "__qualname__";
static const char __pyx_k_reversed[] = "reversed";
static const char __pyx_k_rotate_f[] = "rotate(%f)";
static const char __pyx_k_segments[] = "segments";
static const char __pyx_k_set_size[] = "set_size";
static const char __pyx_k_stroke_s[] = "stroke: %s";
static const char __pyx_k_template[] = "_template";
static const char __pyx_k_to_float[] = "_to_float";
static const char __pyx_k_use_list[] = "use_list";
static const char __pyx_k_vertices[] = "vertices";
static const char __pyx_k_Automatic[] = "Automatic";
static const char __pyx_k_AxesStyle[] = "AxesStyle";
static const char __pyx_k_CIEDE2000[] = "CIEDE2000";
static const char __pyx_k_CMYKColor[] = "CMYKColor";
static const char __pyx_k_CircleBox[] = "CircleBox";
static const char __pyx_k_Directive[] = "Directive";
static const char __pyx_k_FontColor[] = "FontColor";
static const char __pyx_k_GLOBALS3D[] = "GLOBALS3D";
static const char __pyx_k_GrayLevel[] = "GrayLevel";
static const char __pyx_k_Grayscale[] = "Grayscale";
static const char __pyx_k_ImageSize[] = "ImageSize";
static const char __pyx_k_Lighter_c[] = "Lighter[c_]";
static const char __pyx_k_MakeBoxes[] = "MakeBoxes";
static const char __pyx_k_PlotRange[] = "PlotRange";
static const char __pyx_k_PointSize[] = "PointSize";
static const char __pyx_k_Rectangle[] = "Rectangle";
static const char __pyx_k_Size_init[] = "_Size.init";
static const char __pyx_k_Thickness[] = "_Thickness";
static const char __pyx_k_TypeError[] = "TypeError";
static const char __pyx_k_arrow_pen[] = "arrow_pen";
static const char __pyx_k_b64encode[] = "b64encode";
static const char __pyx_k_circle_cx[] = "<circle cx=\"";
static const char __pyx_k_component[] = "component";
static const char __pyx_k_distances[] = "_distances";
static const char __pyx_k_end_angle[] = "end_angle";
static const char __pyx_k_enumerate[] = "enumerate";
static const char __pyx_k_fill_none[] = "fill: none";
static const char __pyx_k_flatten_2[] = "flatten";
static const char __pyx_k_flattened[] = "flattened";
static const char __pyx_k_get_atoms[] = "get_atoms";
static const char __pyx_k_get_class[] = "get_class";
static const char __pyx_k_get_range[] = "get_range";
static const char __pyx_k_get_style[] = "get_style";
static const char __pyx_k_head_name[] = "head_name";
static const char __pyx_k_itertools[] = "itertools";
static const char __pyx_k_large_arc[] = "large_arc";
static const char __pyx_k_leaf_name[] = "leaf_name";
static const char __pyx_k_light_red[] = "light red";
static const char __pyx_k_lightness[] = "lightness";
static const char __pyx_k_max_width[] = "max_width";
static const char __pyx_k_metaclass[] = "__metaclass__";
static const char __pyx_k_name_head[] = "name_head";
static const char __pyx_k_new_style[] = "new_style";
static const char __pyx_k_opacity_s[] = "+opacity(%s)";
static const char __pyx_k_px_height[] = "px\" height=\"";
static const char __pyx_k_size_spec[] = "size_spec";
static const char __pyx_k_start_k_x[] = "start_k_x";
static const char __pyx_k_sub_steps[] = "sub_steps";
static const char __pyx_k_text_name[] = "text_name";
static const char __pyx_k_ticks_int[] = "ticks_int";
static const char __pyx_k_to_python[] = "to_python";
static const char __pyx_k_transform[] = "transform";
static const char __pyx_k_translate[] = "translate";
static const char __pyx_k_Arrowheads[] = "Arrowheads";
static const char __pyx_k_Background[] = "Background";
static const char __pyx_k_Circle_0_0[] = "Circle[{0, 0}]";
static const char __pyx_k_ColorError[] = "ColorError";
static const char __pyx_k_Color_init[] = "_Color.init";
static const char __pyx_k_Coords_add[] = "Coords.add";
static const char __pyx_k_Coords_pos[] = "Coords.pos";
static const char __pyx_k_Expression[] = "Expression";
static const char __pyx_k_Graphics_2[] = "-Graphics-";
static const char __pyx_k_LabelStyle[] = "LabelStyle";
static const char __pyx_k_PolygonBox[] = "PolygonBox";
static const char __pyx_k_Show_apply[] = "Show.apply";
static const char __pyx_k_TicksStyle[] = "TicksStyle";
static const char __pyx_k_ValueError[] = "ValueError";
static const char __pyx_k_arc_params[] = "_arc_params";
static const char __pyx_k_arrow_edge[] = "arrow_edge";
static const char __pyx_k_arrow_size[] = "_arrow_size";
static const char __pyx_k_asy_bezier[] = "_asy_bezier";
static const char __pyx_k_asy_number[] = "asy_number";
static const char __pyx_k_attributes[] = "attributes";
static const char __pyx_k_axes_extra[] = "axes_extra";
static const char __pyx_k_axes_style[] = "axes_style";
static const char __pyx_k_axis_ticks[] = "axis_ticks";
static const char __pyx_k_background[] = "background";
static const char __pyx_k_base_width[] = "base_width";
static const char __pyx_k_box_suffix[] = "box_suffix";
static const char __pyx_k_colorspace[] = "colorspace";
static const char __pyx_k_components[] = "components";
static const char __pyx_k_create_css[] = "create_css";
static const char __pyx_k_currentpen[] = "currentpen";
static const char __pyx_k_edge_color[] = "edge_color";
static const char __pyx_k_edge_style[] = "edge_style";
static const char __pyx_k_ellipse_cx[] = "<ellipse cx=\"";
static const char __pyx_k_evaluation[] = "evaluation";
static const char __pyx_k_expression[] = "expression";
static const char __pyx_k_face_color[] = "face_color";
static const char __pyx_k_face_style[] = "face_style";
static const char __pyx_k_filldraw_2[] = "filldraw";
static const char __pyx_k_filldraw_3[] = "filldraw(";
static const char __pyx_k_final_pass[] = "final_pass";
static const char __pyx_k_font_color[] = "font_color";
static const char __pyx_k_get_option[] = "get_option";
static const char __pyx_k_homogenous[] = "homogenous";
static const char __pyx_k_image_size[] = "image_size";
static const char __pyx_k_inside_row[] = "inside_row";
static const char __pyx_k_is_numeric[] = "is_numeric";
static const char __pyx_k_line_index[] = "line_index";
static const char __pyx_k_max_degree[] = "max_degree";
static const char __pyx_k_new_leaves[] = "new_leaves";
static const char __pyx_k_origin_k_x[] = "origin_k_x";
static const char __pyx_k_plot_range[] = "plot_range";
static const char __pyx_k_point_size[] = "point_size";
static const char __pyx_k_quadratric[] = "quadratric";
static const char __pyx_k_round_step[] = "round_step";
static const char __pyx_k_set_option[] = "set_option";
static const char __pyx_k_style_fill[] = "\" style=\"fill:";
static const char __pyx_k_svg_bezier[] = "_svg_bezier";
static const char __pyx_k_transforms[] = "transforms";
static const char __pyx_k_view_width[] = "view_width";
static const char __pyx_k_ArcBox_init[] = "_ArcBox.init";
static const char __pyx_k_AspectRatio[] = "AspectRatio";
static const char __pyx_k_BezierCurve[] = "_BezierCurve";
static const char __pyx_k_Blend_apply[] = "Blend.apply";
static const char __pyx_k_ColorObject[] = "_ColorObject";
static const char __pyx_k_Color_to_js[] = "_Color.to_js";
static const char __pyx_k_Darker_c__f[] = "Darker[c_, f_]";
static const char __pyx_k_FilledCurve[] = "FilledCurve";
static const char __pyx_k_GraphicsBox[] = "GraphicsBox";
static const char __pyx_k_GrayLevel_0[] = "GrayLevel[0]";
static const char __pyx_k_GrayLevel_1[] = "GrayLevel[1]";
static const char __pyx_k_Line_arrows[] = "_Line.arrows";
static const char __pyx_k_Rectangle_2[] = "Rectangle[]";
static const char __pyx_k_Style_clone[] = "Style.clone";
static const char __pyx_k_System_Axes[] = "System`Axes";
static const char __pyx_k_System_Line[] = "System`Line";
static const char __pyx_k_System_List[] = "System`List";
static const char __pyx_k_System_Null[] = "System`Null";
static const char __pyx_k_System_Rule[] = "System`Rule";
static const char __pyx_k_System_Text[] = "System`Text";
static const char __pyx_k_System_Tiny[] = "System`Tiny";
static const char __pyx_k_Thickness_2[] = "Thickness";
static const char __pyx_k_add_element[] = "add_element";
static const char __pyx_k_allow_forms[] = "allow_forms";
static const char __pyx_k_arrow_style[] = "arrow_style";
static const char __pyx_k_asy_regular[] = "asy_regular";
static const char __pyx_k_base_height[] = "base_height";
static const char __pyx_k_color_space[] = "color_space";
static const char __pyx_k_colors_orig[] = "colors_orig";
static const char __pyx_k_create_axes[] = "create_axes";
static const char __pyx_k_create_pens[] = "create_pens";
static const char __pyx_k_definitions[] = "definitions";
static const char __pyx_k_from_python[] = "from_python";
static const char __pyx_k_g_transform[] = "<g transform=\"";
static const char __pyx_k_get_options[] = "get_options";
static const char __pyx_k_head_points[] = "head_points";
static const char __pyx_k_hsl_to_rgba[] = "hsl_to_rgba";
static const char __pyx_k_inside_list[] = "inside_list";
static const char __pyx_k_label_style[] = "label_style";
static const char __pyx_k_line_colors[] = "line_colors";
static const char __pyx_k_linewidth_s[] = "+linewidth(%s)";
static const char __pyx_k_multi_parts[] = "multi_parts";
static const char __pyx_k_options_set[] = "options_set";
static const char __pyx_k_pixel_width[] = "pixel_width";
static const char __pyx_k_restructure[] = "restructure";
static const char __pyx_k_size_aspect[] = "size_aspect";
static const char __pyx_k_start_angle[] = "start_angle";
static const char __pyx_k_stroke_none[] = "stroke: none";
static const char __pyx_k_style_class[] = "style_class";
static const char __pyx_k_style_heads[] = "style_heads";
static const char __pyx_k_ticks_lines[] = "ticks_lines";
static const char __pyx_k_ticks_small[] = "ticks_small";
static const char __pyx_k_ticks_style[] = "ticks_style";
static const char __pyx_k_ticks_x_int[] = "ticks_x_int";
static const char __pyx_k_ticks_y_int[] = "ticks_y_int";
static const char __pyx_k_transformed[] = "transformed";
static const char __pyx_k_translate_2[] = "translate(";
static const char __pyx_k_ASYTransform[] = "_ASYTransform";
static const char __pyx_k_Blend_colors[] = "Blend[colors_]";
static const char __pyx_k_BoxConstruct[] = "BoxConstruct";
static const char __pyx_k_CMC_distance[] = "_CMC_distance";
static const char __pyx_k_Color_create[] = "_Color.create";
static const char __pyx_k_Color_to_asy[] = "_Color.to_asy";
static const char __pyx_k_Color_to_css[] = "_Color.to_css";
static const char __pyx_k_Darker_c_1_3[] = "Darker[c, 1/3]";
static const char __pyx_k_Lighter_c__f[] = "Lighter[c_, f_]";
static const char __pyx_k_LineBox_init[] = "LineBox.init";
static const char __pyx_k_OptionSyntax[] = "$OptionSyntax";
static const char __pyx_k_RectangleBox[] = "RectangleBox";
static const char __pyx_k_RuntimeError[] = "RuntimeError";
static const char __pyx_k_SVGTransform[] = "_SVGTransform";
static const char __pyx_k_SplineDegree[] = "SplineDegree";
static const char __pyx_k_StandardForm[] = "StandardForm";
static const char __pyx_k_Style___init[] = "Style.__init__";
static const char __pyx_k_Style_append[] = "Style.append";
static const char __pyx_k_Style_extend[] = "Style.extend";
static const char __pyx_k_System_Inset[] = "System`Inset";
static const char __pyx_k_System_Large[] = "System`Large";
static const char __pyx_k_System_Small[] = "System`Small";
static const char __pyx_k_System_Style[] = "System`Style";
static const char __pyx_k_arrow_spread[] = "arrow_spread";
static const char __pyx_k_aspect_ratio[] = "aspect_ratio";
static const char __pyx_k_boxes_to_tex[] = "boxes_to_tex";
static const char __pyx_k_boxes_to_xml[] = "boxes_to_xml";
static const char __pyx_k_content_text[] = "content_text";
static const char __pyx_k_create_style[] = "create_style";
static const char __pyx_k_curve_points[] = "curve_points";
static const char __pyx_k_custom_arrow[] = "custom_arrow";
static const char __pyx_k_default_size[] = "default_size";
static const char __pyx_k_extent_width[] = "extent_width";
static const char __pyx_k_face_element[] = "face_element";
static const char __pyx_k_get_sequence[] = "get_sequence";
static const char __pyx_k_gouraudshade[] = "gouraudshade(";
static const char __pyx_k_graphics_box[] = "graphics_box";
static const char __pyx_k_mglyph_width[] = "<mglyph width=\"";
static const char __pyx_k_pixel_height[] = "pixel_height";
static const char __pyx_k_setback_spec[] = "_setback_spec";
static const char __pyx_k_staticmethod[] = "staticmethod";
static const char __pyx_k_step_x_small[] = "step_x_small";
static const char __pyx_k_stroke_width[] = "stroke_width";
static const char __pyx_k_tick_label_d[] = "tick_label_d";
static const char __pyx_k_total_extent[] = "total_extent";
static const char __pyx_k_Acceptability[] = "Acceptability";
static const char __pyx_k_ArcBox_to_asy[] = "_ArcBox.to_asy";
static const char __pyx_k_ArcBox_to_svg[] = "_ArcBox.to_svg";
static const char __pyx_k_ArrowBox_init[] = "ArrowBox.init";
static const char __pyx_k_BezierCurve_2[] = "BezierCurve";
static const char __pyx_k_ColorDistance[] = "ColorDistance";
static const char __pyx_k_Color_to_expr[] = "_Color.to_expr";
static const char __pyx_k_Color_to_rgba[] = "_Color.to_rgba";
static const char __pyx_k_Coords___init[] = "Coords.__init__";
static const char __pyx_k_GrayLevel_0_5[] = "GrayLevel[0.5]";
static const char __pyx_k_InsetBox_init[] = "InsetBox.init";
static const char __pyx_k_Lighter_c_1_3[] = "Lighter[c, 1/3]";
static const char __pyx_k_PointBox_init[] = "PointBox.init";
static const char __pyx_k_ReadProtected[] = "ReadProtected";
static const char __pyx_k_Rectangle_0_0[] = "Rectangle[{0, 0}]";
static const char __pyx_k_RoundBox_init[] = "_RoundBox.init";
static const char __pyx_k_System_Medium[] = "System`Medium";
static const char __pyx_k_System_String[] = "System`String";
static const char __pyx_k_System_Symbol[] = "System`Symbol";
static const char __pyx_k_boxes_to_text[] = "boxes_to_text";
static const char __pyx_k_convert_color[] = "convert_color";
static const char __pyx_k_default_arrow[] = "default_arrow";
static const char __pyx_k_element_class[] = "element_class";
static const char __pyx_k_element_heads[] = "element_heads";
static const char __pyx_k_extent_height[] = "extent_height";
static const char __pyx_k_get_head_name[] = "get_head_name";
static const char __pyx_k_get_int_value[] = "get_int_value";
static const char __pyx_k_get_thickness[] = "get_thickness";
static const char __pyx_k_include_heads[] = "include_heads";
static const char __pyx_k_make_draw_asy[] = "make_draw_asy";
static const char __pyx_k_make_draw_svg[] = "make_draw_svg";
static const char __pyx_k_name_s_x_List[] = "%(name)s[x_List]";
static const char __pyx_k_round_to_zero[] = "round_to_zero";
static const char __pyx_k_spline_degree[] = "spline_degree";
static const char __pyx_k_steps_x_small[] = "steps_x_small";
static const char __pyx_k_strip_context[] = "strip_context";
static const char __pyx_k_style_options[] = "style_options";
static const char __pyx_k_ticks_x_small[] = "ticks_x_small";
static const char __pyx_k_ticks_y_small[] = "ticks_y_small";
static const char __pyx_k_vertex_colors[] = "vertex_colors";
static const char __pyx_k_Apply_name_s_x[] = "Apply[%(name)s, x]";
static const char __pyx_k_ArrowBox__draw[] = "ArrowBox._draw";
static const char __pyx_k_BernsteinBasis[] = "BernsteinBasis";
static const char __pyx_k_BezierCurveBox[] = "BezierCurveBox";
static const char __pyx_k_BezierFunction[] = "BezierFunction";
static const char __pyx_k_Blend_do_blend[] = "Blend.do_blend";
static const char __pyx_k_FilledCurveBox[] = "FilledCurveBox";
static const char __pyx_k_LineBox_to_asy[] = "LineBox.to_asy";
static const char __pyx_k_LineBox_to_svg[] = "LineBox.to_svg";
static const char __pyx_k_Perceptibility[] = "Perceptibility";
static const char __pyx_k_RGBColor_0_0_1[] = "RGBColor[0, 0, 1]";
static const char __pyx_k_RGBColor_0_1_0[] = "RGBColor[0, 1, 0]";
static const char __pyx_k_RGBColor_0_1_1[] = "RGBColor[0, 1, 1]";
static const char __pyx_k_RGBColor_1_0_0[] = "RGBColor[1, 0, 0]";
static const char __pyx_k_RGBColor_1_0_1[] = "RGBColor[1, 0, 1]";
static const char __pyx_k_RGBColor_1_1_0[] = "RGBColor[1, 1, 0]";
static const char __pyx_k_RegularPolygon[] = "RegularPolygon";
static const char __pyx_k_asy_background[] = "asy_background";
static const char __pyx_k_consider_forms[] = "consider_forms";
static const char __pyx_k_custom_arrow_2[] = "_custom_arrow";
static const char __pyx_k_fill_opacity_s[] = "fill-opacity: %s";
static const char __pyx_k_get_image_size[] = "_get_image_size";
static const char __pyx_k_get_line_width[] = "get_line_width";
static const char __pyx_k_polygon_points[] = "<polygon points=\"";
static const char __pyx_k_process_option[] = "process_option";
static const char __pyx_k_round_to_float[] = "round_to_float";
static const char __pyx_k_shrink_one_end[] = "shrink_one_end";
static const char __pyx_k_stylebox_style[] = "stylebox_style";
static const char __pyx_k_symbolic_sizes[] = "symbolic_sizes";
static const char __pyx_k_system_symbols[] = "system_symbols";
static const char __pyx_k_to_color_space[] = "to_color_space";
static const char __pyx_k_ArrowBox_extent[] = "ArrowBox.extent";
static const char __pyx_k_ArrowBox_to_asy[] = "ArrowBox.to_asy";
static const char __pyx_k_ArrowBox_to_svg[] = "ArrowBox.to_svg";
static const char __pyx_k_Arrowheads_init[] = "Arrowheads.init";
static const char __pyx_k_Blend_c_Black_f[] = "Blend[{c, Black}, f]";
static const char __pyx_k_Blend_c_White_f[] = "Blend[{c, White}, f]";
static const char __pyx_k_GraphicsElement[] = "_GraphicsElement";
static const char __pyx_k_Hue_hsl_to_rgba[] = "Hue.hsl_to_rgba";
static const char __pyx_k_InsetBox_extent[] = "InsetBox.extent";
static const char __pyx_k_InsetBox_to_asy[] = "InsetBox.to_asy";
static const char __pyx_k_InsetBox_to_svg[] = "InsetBox.to_svg";
static const char __pyx_k_PointBox_to_asy[] = "PointBox.to_asy";
static const char __pyx_k_PointBox_to_svg[] = "PointBox.to_svg";
static const char __pyx_k_PolygonBox_init[] = "PolygonBox.init";
static const char __pyx_k_Polyline_extent[] = "_Polyline.extent";
static const char __pyx_k_RoundBox_extent[] = "_RoundBox.extent";
static const char __pyx_k_RoundBox_to_asy[] = "_RoundBox.to_asy";
static const char __pyx_k_RoundBox_to_svg[] = "_RoundBox.to_svg";
static const char __pyx_k_Style_get_style[] = "Style.get_style";
static const char __pyx_k_System_EdgeForm[] = "System`EdgeForm";
static const char __pyx_k_System_FaceForm[] = "System`FaceForm";
static const char __pyx_k_System_Graphics[] = "System`Graphics";
static const char __pyx_k_System_StyleBox[] = "System`StyleBox";
static const char __pyx_k_TraditionalForm[] = "TraditionalForm";
static const char __pyx_k_apply_makeboxes[] = "apply_makeboxes";
static const char __pyx_k_arc_s_s_s_s_s_s[] = "arc((%s,%s), (%s, %s), (%s, %s))";
static const char __pyx_k_bezier_evaluate[] = "_bezier_evaluate";
static const char __pyx_k_calc_dimensions[] = "calc_dimensions";
static const char __pyx_k_create_as_style[] = "create_as_style";
static const char __pyx_k_curve_head_name[] = "curve_head_name";
static const char __pyx_k_default_arrow_2[] = "_default_arrow";
static const char __pyx_k_defined_options[] = "defined_options";
static const char __pyx_k_foreignObject_x[] = "<foreignObject x=\"";
static const char __pyx_k_get_style_class[] = "get_style_class";
static const char __pyx_k_is_face_element[] = "is_face_element";
static const char __pyx_k_machine_epsilon[] = "machine_epsilon";
static const char __pyx_k_parse_component[] = "parse_component";
static const char __pyx_k_polyline_points[] = "<polyline points=\"";
static const char __pyx_k_size_multiplier[] = "size_multiplier";
static const char __pyx_k_start_k_x_small[] = "start_k_x_small";
static const char __pyx_k_tick_large_size[] = "tick_large_size";
static const char __pyx_k_tick_small_size[] = "tick_small_size";
static const char __pyx_k_Arrowheads_heads[] = "Arrowheads.heads";
static const char __pyx_k_BezierFunction_p[] = "BezierFunction[p_]";
static const char __pyx_k_CoordinatesError[] = "CoordinatesError";
static const char __pyx_k_DistanceFunction[] = "DistanceFunction";
static const char __pyx_k_Drawing_Graphics[] = "\nDrawing Graphics\n";
static const char __pyx_k_GRAPHICS_OPTIONS[] = "GRAPHICS_OPTIONS";
static const char __pyx_k_GRAPHICS_SYMBOLS[] = "GRAPHICS_SYMBOLS";
static const char __pyx_k_GraphicsElements[] = "GraphicsElements";
static const char __pyx_k_Lighter_Red_0_85[] = "Lighter[Red, 0.85]";
static const char __pyx_k_PlotRangePadding[] = "PlotRangePadding";
static const char __pyx_k_Polyline_do_init[] = "_Polyline.do_init";
static const char __pyx_k_RGBColor_1_0_5_0[] = "RGBColor[1, 0.5, 0]";
static const char __pyx_k_RGBColor_to_rgba[] = "RGBColor.to_rgba";
static const char __pyx_k_Style_get_option[] = "Style.get_option";
static const char __pyx_k_Style_set_option[] = "Style.set_option";
static const char __pyx_k_System_Automatic[] = "System`Automatic";
static const char __pyx_k_System_AxesStyle[] = "System`AxesStyle";
static const char __pyx_k_System_FontColor[] = "System`FontColor";
static const char __pyx_k_System_ImageSize[] = "System`ImageSize";
static const char __pyx_k_System_PlotRange[] = "System`PlotRange";
static const char __pyx_k_background_color[] = "background_color";
static const char __pyx_k_cie2000_distance[] = "_cie2000_distance";
static const char __pyx_k_components_sizes[] = "components_sizes";
static const char __pyx_k_data_and_options[] = "_data_and_options";
static const char __pyx_k_default_to_faces[] = "default_to_faces";
static const char __pyx_k_extract_graphics[] = "_extract_graphics";
static const char __pyx_k_format_transform[] = "format_transform";
static const char __pyx_k_get_string_value[] = "get_string_value";
static const char __pyx_k_graphics_options[] = "graphics_options";
static const char __pyx_k_options_to_rules[] = "options_to_rules";
static const char __pyx_k_prepare_elements[] = "_prepare_elements";
static const char __pyx_k_stroke_opacity_s[] = "stroke-opacity: %s";
static const char __pyx_k_stroke_width_fpx[] = "stroke-width: %fpx";
static const char __pyx_k_tick_label_style[] = "tick_label_style";
static const char __pyx_k_AbsoluteThickness[] = "AbsoluteThickness";
static const char __pyx_k_Black_GrayLevel_0[] = "\n    >> Black\n     = GrayLevel[0]\n    ";
static const char __pyx_k_BoxConstructError[] = "BoxConstructError";
static const char __pyx_k_PolygonBox_to_asy[] = "PolygonBox.to_asy";
static const char __pyx_k_PolygonBox_to_svg[] = "PolygonBox.to_svg";
static const char __pyx_k_RectangleBox_init[] = "RectangleBox.init";
static const char __pyx_k_RegularPolygonBox[] = "RegularPolygonBox";
static const char __pyx_k_System_Background[] = "System`Background";
static const char __pyx_k_System_LabelStyle[] = "System`LabelStyle";
static const char __pyx_k_System_TicksStyle[] = "System`TicksStyle";
static const char __pyx_k_White_GrayLevel_1[] = "\n    >> White\n     = GrayLevel[1]\n    ";
static const char __pyx_k_bezier_derivative[] = "_bezier_derivative";
static const char __pyx_k_distance_function[] = "distance_function";
static const char __pyx_k_fill_rule_evenodd[] = "\" fill-rule=\"evenodd\"/>";
static const char __pyx_k_get_option_values[] = "get_option_values";
static const char __pyx_k_ASYTransform_apply[] = "_ASYTransform.apply";
static const char __pyx_k_ASYTransform_scale[] = "_ASYTransform.scale";
static const char __pyx_k_ArcBox__arc_params[] = "_ArcBox._arc_params";
static const char __pyx_k_BezierCurve___init[] = "_BezierCurve.__init__";
static const char __pyx_k_BezierCurve_arrows[] = "_BezierCurve.arrows";
static const char __pyx_k_ColorObject___init[] = "_ColorObject.__init__";
static const char __pyx_k_GraphicsElements_2[] = "_GraphicsElements";
static const char __pyx_k_Gray_GrayLevel_0_5[] = "\n    >> Gray\n     = GrayLevel[0.5]\n    ";
static const char __pyx_k_InstancableBuiltin[] = "InstancableBuiltin";
static const char __pyx_k_Line_make_draw_asy[] = "_Line.make_draw_asy";
static const char __pyx_k_Line_make_draw_svg[] = "_Line.make_draw_svg";
static const char __pyx_k_PointSize_get_size[] = "PointSize.get_size";
static const char __pyx_k_RGBColor_0_5_0_0_5[] = "RGBColor[0.5, 0, 0.5]";
static const char __pyx_k_Red_RGBColor_1_0_0[] = "\n    >> Red\n     = RGBColor[1, 0, 0]\n    ";
static const char __pyx_k_SVGTransform_apply[] = "_SVGTransform.apply";
static const char __pyx_k_SVGTransform_scale[] = "_SVGTransform.scale";
static const char __pyx_k_System_AspectRatio[] = "System`AspectRatio";
static const char __pyx_k_System_BezierCurve[] = "System`BezierCurve";
static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
static const char __pyx_k_component_distance[] = "_component_distance";
static const char __pyx_k_default_components[] = "default_components";
static const char __pyx_k_euclidean_distance[] = "_euclidean_distance";
static const char __pyx_k_math_foreignObject[] = "</math></foreignObject>";
static const char __pyx_k_transformed_points[] = "transformed_points";
static const char __pyx_k_translate_absolute[] = "translate_absolute";
static const char __pyx_k_translate_relative[] = "translate_relative";
static const char __pyx_k_ASYTransform___init[] = "_ASYTransform.__init__";
static const char __pyx_k_ASYTransform_matrix[] = "_ASYTransform.matrix";
static const char __pyx_k_ASYTransform_rotate[] = "_ASYTransform.rotate";
static const char __pyx_k_AbsoluteThickness_2[] = "AbsoluteThickness[2]";
static const char __pyx_k_BezierCurveBox_init[] = "BezierCurveBox.init";
static const char __pyx_k_Blue_RGBColor_0_0_1[] = "\n    >> Blue\n     = RGBColor[0, 0, 1]\n    ";
static const char __pyx_k_ColorDistance_apply[] = "ColorDistance.apply";
static const char __pyx_k_Cyan_RGBColor_0_1_1[] = "\n    >> Cyan\n     = RGBColor[0, 1, 1]\n    ";
static const char __pyx_k_FilledCurveBox_init[] = "FilledCurveBox.init";
static const char __pyx_k_NotImplementedError[] = "NotImplementedError";
static const char __pyx_k_RectangleBox_extent[] = "RectangleBox.extent";
static const char __pyx_k_RectangleBox_to_asy[] = "RectangleBox.to_asy";
static const char __pyx_k_RectangleBox_to_svg[] = "RectangleBox.to_svg";
static const char __pyx_k_SVGTransform___init[] = "_SVGTransform.__init__";
static const char __pyx_k_SVGTransform_matrix[] = "_SVGTransform.matrix";
static const char __pyx_k_SVGTransform_rotate[] = "_SVGTransform.rotate";
static const char __pyx_k_System_BSplineCurve[] = "System`BSplineCurve";
static const char __pyx_k_System_SplineDegree[] = "System`SplineDegree";
static const char __pyx_k_System_VertexColors[] = "System`VertexColors";
static const char __pyx_k_color_to_expression[] = "color_to_expression";
static const char __pyx_k_expression_to_color[] = "expression_to_color";
static const char __pyx_k_meshgradient_data_s[] = "<meshgradient data=\"%s\" />";
static const char __pyx_k_system_symbols_dict[] = "system_symbols_dict";
static const char __pyx_k_ColorDistance_lambda[] = "ColorDistance.<lambda>";
static const char __pyx_k_Color_to_color_space[] = "_Color.to_color_space";
static const char __pyx_k_GraphicsElement_init[] = "_GraphicsElement.init";
static const char __pyx_k_Green_RGBColor_0_1_0[] = "\n    >> Green\n     = RGBColor[0, 1, 0]\n    ";
static const char __pyx_k_Style_get_line_width[] = "Style.get_line_width";
static const char __pyx_k_converted_color_name[] = "converted_color_name";
static const char __pyx_k_mathics_builtin_base[] = "mathics.builtin.base";
static const char __pyx_k_mathics_core_numbers[] = "mathics.core.numbers";
static const char __pyx_k_style_and_form_heads[] = "style_and_form_heads";
static const char __pyx_k_AbsoluteThickness_0_5[] = "AbsoluteThickness[0.5]";
static const char __pyx_k_BezierCurveBox_to_asy[] = "BezierCurveBox.to_asy";
static const char __pyx_k_BezierCurveBox_to_svg[] = "BezierCurveBox.to_svg";
static const char __pyx_k_Color_create_as_style[] = "_Color.create_as_style";
static const char __pyx_k_FilledCurveBox_extent[] = "FilledCurveBox.extent";
static const char __pyx_k_FilledCurveBox_to_asy[] = "FilledCurveBox.to_asy";
static const char __pyx_k_FilledCurveBox_to_svg[] = "FilledCurveBox.to_svg";
static const char __pyx_k_Yellow_RGBColor_1_1_0[] = "\n    >> Yellow\n     = RGBColor[1, 1, 0]\n    ";
static const char __pyx_k_is_completely_visible[] = "is_completely_visible";
static const char __pyx_k_ASYTransform_translate[] = "_ASYTransform.translate";
static const char __pyx_k_ArrowBox__custom_arrow[] = "ArrowBox._custom_arrow";
static const char __pyx_k_ArrowBox__setback_spec[] = "ArrowBox._setback_spec";
static const char __pyx_k_Arrowheads__arrow_size[] = "Arrowheads._arrow_size";
static const char __pyx_k_BernsteinBasis_d__n__x[] = "BernsteinBasis[d_, n_, x_]";
static const char __pyx_k_GraphicsBox_axis_ticks[] = "GraphicsBox.axis_ticks";
static const char __pyx_k_Magenta_RGBColor_1_0_1[] = "\n    >> Magenta\n     = RGBColor[1, 0, 1]\n    ";
static const char __pyx_k_RegularPolygonBox_init[] = "RegularPolygonBox.init";
static const char __pyx_k_SVGTransform_translate[] = "_SVGTransform.translate";
static const char __pyx_k_asy_bezier_locals_path[] = "_asy_bezier.<locals>.path";
static const char __pyx_k_asy_completely_visible[] = "asy_completely_visible";
static const char __pyx_k_get_default_edge_color[] = "get_default_edge_color";
static const char __pyx_k_get_default_face_color[] = "get_default_face_color";
static const char __pyx_k_image_size_multipliers[] = "image_size_multipliers";
static const char __pyx_k_mathics_builtin_colors[] = "mathics.builtin.colors";
static const char __pyx_k_svg_bezier_locals_path[] = "_svg_bezier.<locals>.path";
static const char __pyx_k_ArrowBox__default_arrow[] = "ArrowBox._default_arrow";
static const char __pyx_k_GraphicsBox_create_axes[] = "GraphicsBox.create_axes";
static const char __pyx_k_GraphicsElements___init[] = "_GraphicsElements.__init__";
static const char __pyx_k_GraphicsElements_extent[] = "GraphicsElements.extent";
static const char __pyx_k_GraphicsElements_to_asy[] = "GraphicsElements.to_asy";
static const char __pyx_k_GraphicsElements_to_svg[] = "GraphicsElements.to_svg";
static const char __pyx_k_System_DistanceFunction[] = "System`DistanceFunction";
static const char __pyx_k_Thickness_get_thickness[] = "Thickness.get_thickness";
static const char __pyx_k_asy_bezier_locals_cubic[] = "_asy_bezier.<locals>.cubic";
static const char __pyx_k_completely_visible_only[] = "completely_visible_only";
static const char __pyx_k_mathics_builtin_options[] = "mathics.builtin.options";
static const char __pyx_k_mathics_core_expression[] = "mathics.core.expression";
static const char __pyx_k_name_s_x___NumericQ_0_1[] = "%(name)s[x__?(NumericQ[#] && 0 <= # <= 1&)]";
static const char __pyx_k_GraphicsBox_boxes_to_tex[] = "GraphicsBox.boxes_to_tex";
static const char __pyx_k_GraphicsBox_boxes_to_xml[] = "GraphicsBox.boxes_to_xml";
static const char __pyx_k_Graphics_apply_makeboxes[] = "Graphics.apply_makeboxes";
static const char __pyx_k_asy_bezier_locals_linear[] = "_asy_bezier.<locals>.linear";
static const char __pyx_k_mathics_builtin_graphics[] = "mathics.builtin.graphics";
static const char __pyx_k_ArcBox_to_asy_locals_path[] = "_ArcBox.to_asy.<locals>.path";
static const char __pyx_k_ArcBox_to_svg_locals_path[] = "_ArcBox.to_svg.<locals>.path";
static const char __pyx_k_BezierCurve_make_draw_asy[] = "_BezierCurve.make_draw_asy";
static const char __pyx_k_BezierCurve_make_draw_svg[] = "_BezierCurve.make_draw_svg";
static const char __pyx_k_GraphicsBox_boxes_to_text[] = "GraphicsBox.boxes_to_text";
static const char __pyx_k_GraphicsElements___init_2[] = "GraphicsElements.__init__";
static const char __pyx_k_GraphicsElements_set_size[] = "GraphicsElements.set_size";
static const char __pyx_k_PolygonBox_process_option[] = "PolygonBox.process_option";
static const char __pyx_k_GraphicsElements_translate[] = "GraphicsElements.translate";
static const char __pyx_k_Hue_hsl_to_rgba_locals_map[] = "Hue.hsl_to_rgba.<locals>.map";
static const char __pyx_k_Line_arrows_locals_genexpr[] = "_Line.arrows.<locals>.genexpr";
static const char __pyx_k_mathics_builtin_graphics3d[] = "mathics.builtin.graphics3d";
static const char __pyx_k_GraphicsBox__get_image_size[] = "GraphicsBox._get_image_size";
static const char __pyx_k_Line_arrows_locals_segments[] = "_Line.arrows.<locals>.segments";
static const char __pyx_k_mathics_builtin_graphics_py[] = "mathics/builtin/graphics.py";
static const char __pyx_k_ArrowBox__draw_locals_lambda[] = "ArrowBox._draw.<locals>.<lambda>";
static const char __pyx_k_ArrowBox__draw_locals_shrink[] = "ArrowBox._draw.<locals>.shrink";
static const char __pyx_k_Hue_hsl_to_rgba_locals_trans[] = "Hue.hsl_to_rgba.<locals>.trans";
static const char __pyx_k_PointBox_init_locals_genexpr[] = "PointBox.init.<locals>.genexpr";
static const char __pyx_k_Style_get_default_edge_color[] = "Style.get_default_edge_color";
static const char __pyx_k_Style_get_default_face_color[] = "Style.get_default_face_color";
static const char __pyx_k_asy_bezier_locals_quadratric[] = "_asy_bezier.<locals>.quadratric";
static const char __pyx_k_ArrowBox__draw_locals_setback[] = "ArrowBox._draw.<locals>.setback";
static const char __pyx_k_GraphicsBox__prepare_elements[] = "GraphicsBox._prepare_elements";
static const char __pyx_k_GraphicsElements_create_style[] = "_GraphicsElements.create_style";
static const char __pyx_k_1_is_not_a_valid_list_of_color[] = "`1` is not a valid list of color or gray-level directives, or pairs of a real number and a directive.";
static const char __pyx_k_1_should_be_a_real_number_or_a[] = "`1` should be a real number or a list of non-negative numbers, which has the same length as `2`.";
static const char __pyx_k_ArrowBox_extent_locals_polygon[] = "ArrowBox.extent.<locals>.polygon";
static const char __pyx_k_ArrowBox_to_asy_locals_polygon[] = "ArrowBox.to_asy.<locals>.polygon";
static const char __pyx_k_ArrowBox_to_svg_locals_polygon[] = "ArrowBox.to_svg.<locals>.polygon";
static const char __pyx_k_Line_make_draw_asy_locals_draw[] = "_Line.make_draw_asy.<locals>.draw";
static const char __pyx_k_Line_make_draw_svg_locals_draw[] = "_Line.make_draw_svg.<locals>.draw.<locals>.genexpr";
static const char __pyx_k_controls_5g_5g_and_5g_5g_5g_5g[] = "..controls(%.5g,%.5g) and (%.5g,%.5g)..(%.5g,%.5g)";
static const char __pyx_k_dl_dt_Point_point_1_point_2_dd[] = "\n    <dl>\n    <dt>'Point[{$point_1$, $point_2$ ...}]'\n        <dd>represents the point primitive.\n    <dt>'Point[{{$p_11$, $p_12$, ...}, {$p_21$, $p_22$, ...}, ...}]'\n        <dd>represents a number of point primitives.\n    </dl>\n\n    >> Graphics[Point[{0,0}]]\n    = -Graphics-\n\n    >> Graphics[Point[Table[{Sin[t], Cos[t]}, {t, 0, 2. Pi, Pi / 15.}]]]\n    = -Graphics-\n\n    >> Graphics3D[Point[Table[{Sin[t], Cos[t], 0}, {t, 0, 2. Pi, Pi / 15.}]]]\n    = -Graphics3D-\n    ";
static const char __pyx_k_dl_dt_Show_graphics_options_dd[] = "\n    <dl>\n      <dt>'Show[$graphics$, $options$]'\n      <dd>shows graphics with the specified options added.\n    </dl>\n    ";
static const char __pyx_k_dl_dt_name_s_dd_represents_the[] = "\n            <dl>\n            <dt>'%(name)s'\n            <dd>represents the color %(text_name)s in graphics.\n            </dl>\n\n            >> Graphics[{EdgeForm[Black], %(name)s, Disk[]}, ImageSize->Small]\n             = -Graphics-\n\n            >> %(name)s // ToBoxes\n             = StyleBox[GraphicsBox[...], ...]\n        ";
static const char __pyx_k_1_and_2_should_be_two_colors_or[] = "`1` and `2` should be two colors or a color and a lists of colors or two lists of colors of the same length.";
static const char __pyx_k_1_is_not_Automatic_or_a_valid_d[] = "`1` is not Automatic or a valid distance specification.";
static const char __pyx_k_AbsoluteThickness_get_thickness[] = "AbsoluteThickness.get_thickness";
static const char __pyx_k_ArcBox_to_asy_locals_path_local[] = "_ArcBox.to_asy.<locals>.path.<locals>.genexpr";
static const char __pyx_k_ArrowBox_extent_locals_polyline[] = "ArrowBox.extent.<locals>.polyline";
static const char __pyx_k_Arrowheads_heads_locals_genexpr[] = "Arrowheads.heads.<locals>.genexpr";
static const char __pyx_k_BezierCurve_make_draw_asy_local[] = "_BezierCurve.make_draw_asy.<locals>.draw";
static const char __pyx_k_BezierCurve_make_draw_svg_local[] = "_BezierCurve.make_draw_svg.<locals>.draw";
static const char __pyx_k_GraphicsBox_boxes_to_tex_locals[] = "GraphicsBox.boxes_to_tex.<locals>.genexpr";
static const char __pyx_k_GraphicsBox_boxes_to_xml_locals[] = "GraphicsBox.boxes_to_xml.<locals>.genexpr";
static const char __pyx_k_GraphicsElement_create_as_style[] = "_GraphicsElement.create_as_style";
static const char __pyx_k_GraphicsElements___init___local[] = "_GraphicsElements.__init__.<locals>.convert";
static const char __pyx_k_GraphicsElements_create_style_l[] = "_GraphicsElements.create_style.<locals>.convert";
static const char __pyx_k_GraphicsElements_get_style_clas[] = "_GraphicsElements.get_style_class";
static const char __pyx_k_Graphics_EdgeForm_Thick_Green_D[] = "\n    >> Graphics[{EdgeForm[{Thick, Green}], Disk[]}]\n     = -Graphics-\n\n    >> Graphics[{Style[Disk[],EdgeForm[{Thick,Red}]], Circle[{1,1}]}]\n     = -Graphics-\n    ";
static const char __pyx_k_Graphics_apply_makeboxes_locals[] = "Graphics.apply_makeboxes.<locals>.convert.<locals>.genexpr";
static const char __pyx_k_NumPy_needs_to_be_installed_for[] = "NumPy needs to be installed for ColorDistance";
static const char __pyx_k_Polyline_do_init_locals_genexpr[] = "_Polyline.do_init.<locals>.genexpr";
static const char __pyx_k_add_s_new_picture_picture_saved[] = "\n    add(%s * (new picture() {\n        picture saved = currentpicture;\n        picture transformed = new picture;\n        currentpicture = transformed;\n        %s\n        currentpicture = saved;\n        return transformed;\n    })());\n    ";
static const char __pyx_k_begin_asy_usepackage_amsmath_si[] = "\n\\begin{asy}\nusepackage(\"amsmath\");\nsize(";
static const char __pyx_k_cannot_convert_from_color_space[] = "cannot convert from color space ";
static const char __pyx_k_dl_dt_AbsoluteThickness_p_dd_se[] = "\n    <dl>\n    <dt>'AbsoluteThickness[$p$]'\n        <dd>sets the line thickness for subsequent graphics primitives\n        to $p$ points.\n    </dl>\n\n    >> Graphics[Table[{AbsoluteThickness[t], Line[{{20 t, 10}, {20 t, 80}}], Text[ToString[t]<>\"pt\", {20 t, 0}]}, {t, 0, 10}]]\n     = -Graphics-\n    ";
static const char __pyx_k_dl_dt_Arrow_p1_p2_dd_represents[] = "\n    <dl>\n    <dt>'Arrow[{$p1$, $p2$}]'\n        <dd>represents a line from $p1$ to $p2$ that ends with an arrow at $p2$.\n    <dt>'Arrow[{$p1$, $p2$}, $s$]'\n        <dd>represents a line with arrow that keeps a distance of $s$ from $p1$\n        and $p2$.\n    <dt>'Arrow[{$point_1$, $point_2$}, {$s1$, $s2$}]'\n        <dd>represents a line with arrow that keeps a distance of $s1$ from $p1$\n        and a distance of $s2$ from $p2$.\n    </dl>\n\n    >> Graphics[Arrow[{{0,0}, {1,1}}]]\n    = -Graphics-\n\n    >> Graphics[{Circle[], Arrow[{{2, 1}, {0, 0}}, 1]}]\n    = -Graphics-\n\n    Keeping distances may happen across multiple segments:\n\n    >> Table[Graphics[{Circle[], Arrow[Table[{Cos[phi],Sin[phi]},{phi,0,2*Pi,Pi/2}],{d, d}]}],{d,0,2,0.5}]\n     = {-Graphics-, -Graphics-, -Graphics-, -Graphics-, -Graphics-}\n    ";
static const char __pyx_k_dl_dt_Arrowheads_s_dd_specifies[] = "\n    <dl>\n    <dt>'Arrowheads[$s$]'\n        <dd>specifies that Arrow[] draws one arrow of size $s$ (relative to width of image, defaults to 0.04).\n    <dt>'Arrowheads[{$spec1$, $spec2$, ..., $specn$}]'\n        <dd>specifies that Arrow[] draws n arrows as defined by $spec1$, $spec2$, ... $specn$.\n    <dt>'Arrowheads[{{$s$}}]'\n        <dd>specifies that one arrow of size $s$ should be drawn.\n    <dt>'Arrowheads[{{$s$, $pos$}}]'\n        <dd>specifies that one arrow of size $s$ should be drawn at position $pos$ (for the arrow to\n        be on the line, $pos$ has to be between 0, i.e. the start for the line, and 1, i.e. the end\n        of the line).\n    <dt>'Arrowheads[{{$s$, $pos$, $g$}}]'\n        <dd>specifies that one arrow of size $s$ should be drawn at position $pos$ using Graphics $g$.\n    </dl>\n\n    Arrows on both ends can be achieved using negative sizes:\n\n    >> Graphics[{Circle[],Arrowheads[{-0.04, 0.04}], Arrow[{{0, 0}, {2, 2}}, {1,1}]}]\n     = -Graphics-\n\n    You may also specify our own arrow shapes:\n\n    >> Graphics[{Circle[], Arrowheads[{{0.04, 1, Graphics[{Red, Disk[]}]}}], Arrow[{{0, 0}, {Cos[Pi/3],Sin[Pi/3]}}]}]\n     = -Graphics-\n\n    >> Graphics[{Arrowheads[Table[{0.04, i/10, Graphics[Disk[]]},{i,1,10}]], Arrow[{{0, 0}, {6, 5}, {1, -3}, {-2, 2}}]}]\n     = -Graphics-\n    ";
static const char __pyx_k_dl_dt_Automatic_dd_is_used_to_s[] = "\n    <dl>\n    <dt>'Automatic'\n        <dd>is used to specify an automatically computed option value.\n    </dl>\n\n    'Automatic' is the default for 'PlotRange', 'ImageSize', and other\n    graphical options:\n\n    >> Cases[Options[Plot], HoldPattern[_ :> Automatic]]\n     = {Background :> Automatic, Exclusions :> Automatic, ImageSize :> Automatic, MaxRecursion :> Automatic, PlotRange :> Automatic, PlotRangePadding :> Automatic}\n    ";
static const char __pyx_k_dl_dt_BezierCurve_p1_p2_dd_repr[] = "\n    <dl>\n    <dt>'BezierCurve[{$p1$, $p2$ ...}]'\n        <dd>represents a bezier curve with $p1$, $p2$ as control points.\n    </dl>\n\n    >> Graphics[BezierCurve[{{0, 0},{1, 1},{2, -1},{3, 0}}]]\n     = -Graphics-\n\n    >> Module[{p={{0, 0},{1, 1},{2, -1},{4, 0}}}, Graphics[{BezierCurve[p], Red, Point[Table[BezierFunction[p][x], {x, 0, 1, 0.1}]]}]]\n     = -Graphics-\n    ";
static const char __pyx_k_dl_dt_Blend_c1_c2_dd_represents[] = "\n    <dl>\n    <dt>'Blend[{$c1$, $c2$}]'\n        <dd>represents the color between $c1$ and $c2$.\n    <dt>'Blend[{$c1$, $c2$}, $x$]'\n        <dd>represents the color formed by blending $c1$ and $c2$ with\n        factors 1 - $x$ and $x$ respectively.\n    <dt>'Blend[{$c1$, $c2$, ..., $cn$}, $x$]'\n        <dd>blends between the colors $c1$ to $cn$ according to the\n        factor $x$.\n    </dl>\n\n    >> Blend[{Red, Blue}]\n     = RGBColor[0.5, 0., 0.5]\n    >> Blend[{Red, Blue}, 0.3]\n     = RGBColor[0.7, 0., 0.3]\n    >> Blend[{Red, Blue, Green}, 0.75]\n     = RGBColor[0., 0.5, 0.5]\n\n    >> Graphics[Table[{Blend[{Red, Green, Blue}, x], Rectangle[{10 x, 0}]}, {x, 0, 1, 1/10}]]\n     = -Graphics-\n\n    >> Graphics[Table[{Blend[{RGBColor[1, 0.5, 0, 0.5], RGBColor[0, 0, 1, 0.5]}, x], Disk[{5x, 0}]}, {x, 0, 1, 1/10}]]\n     = -Graphics-\n\n    #> Blend[{Red, Green, Blue}, {1, 0.5}]\n     : {1, 0.5} should be a real number or a list of non-negative numbers, which has the same length as {RGBColor[1, 0, 0], RGBColor[0, 1, 0], RGBColor[0, 0, 1]}.\n     = Blend[{RGBColor[1, 0, 0], RGBColor[0, 1, 0], RGBColor[0, 0, 1]}, {1, 0.5}]\n    ";
static const char __pyx_k_dl_dt_CMYKColor_c_m_y_k_dd_repr[] = "\n    <dl>\n    <dt>'CMYKColor[$c$, $m$, $y$, $k$]'\n        <dd>represents a color with the specified cyan, magenta,\n        yellow and black components.\n    </dl>\n\n    >> Graphics[MapIndexed[{CMYKColor @@ #1, Disk[2*#2 ~Join~ {0}]} &, IdentityMatrix[4]], ImageSize->Small]\n     = -Graphics-\n    ";
static const char __pyx_k_dl_dt_Circle_cx_cy_r_dd_draws_a[] = "\n    <dl>\n    <dt>'Circle[{$cx$, $cy$}, $r$]'\n        <dd>draws a circle with center '($cx$, $cy$)' and radius $r$.\n    <dt>'Circle[{$cx$, $cy$}, {$rx$, $ry$}]'\n        <dd>draws an ellipse.\n    <dt>'Circle[{$cx$, $cy$}]'\n        <dd>chooses radius 1.\n    <dt>'Circle[]'\n        <dd>chooses center '(0, 0)' and radius 1.\n    </dl>\n\n    >> Graphics[{Red, Circle[{0, 0}, {2, 1}]}]\n     = -Graphics-\n    >> Graphics[{Circle[], Disk[{0, 0}, {1, 1}, {0, 2.1}]}]\n     = -Graphics-\n    ";
static const char __pyx_k_dl_dt_ColorDistance_c1_c2_dd_re[] = "\n    <dl>\n    <dt>'ColorDistance[$c1$, $c2$]'\n        <dd>returns a measure of color distance between the colors $c1$ and $c2$.\n    <dt>'ColorDistance[$list$, $c2$]'\n        <dd>returns a list of color distances between the colors in $list$ and $c2$.\n    </dl>\n\n    The option DistanceFunction specifies the method used to measure the color\n    distance. Available options are:\n\n    CIE76: euclidean distance in the LABColor space\n    CIE94: euclidean distance in the LCHColor space\n    CIE2000 or CIEDE2000: CIE94 distance with corrections\n    CMC: Colour Measurement Committee metric (1984)\n    DeltaL: difference in the L component of LCHColor\n    DeltaC: difference in the C component of LCHColor\n    DeltaH: difference in the H component of LCHColor\n\n    It is also possible to specify a custom distance\n\n    >> ColorDistance[Magenta, Green]\n     = 2.2507\n    >> ColorDistance[{Red, Blue}, {Green, Yellow}, DistanceFunction -> {\"CMC\", \"Perceptibility\"}]\n     = {1.0495, 1.27455}\n    #> ColorDistance[Blue, Red, DistanceFunction -> \"CIE2000\"]\n     = 0.557976\n    #> ColorDistance[Red, Black, DistanceFunction -> (Abs[#1[[1]] - #2[[1]]] &)]\n     = 0.542917\n\n    ";
static const char __pyx_k_dl_dt_Darker_c_f_dd_is_equivale[] = "\n    <dl>\n    <dt>'Darker[$c$, $f$]'\n        <dd>is equivalent to 'Blend[{$c$, Black}, $f$]'.\n    <dt>'Darker[$c$]'\n        <dd>is equivalent to 'Darker[$c$, 1/3]'.\n    </dl>\n\n    >> Graphics[Table[{Darker[Yellow, x], Disk[{12x, 0}]}, {x, 0, 1, 1/6}]]\n     = -Graphics-\n    ";
static const char __pyx_k_dl_dt_Disk_cx_cy_r_dd_fills_a_c[] = "\n    <dl>\n    <dt>'Disk[{$cx$, $cy$}, $r$]'\n        <dd>fills a circle with center '($cx$, $cy$)' and radius $r$.\n    <dt>'Disk[{$cx$, $cy$}, {$rx$, $ry$}]'\n        <dd>fills an ellipse.\n    <dt>'Disk[{$cx$, $cy$}]'\n        <dd>chooses radius 1.\n    <dt>'Disk[]'\n        <dd>chooses center '(0, 0)' and radius 1.\n    <dt>'Disk[{$x$, $y$}, ..., {$t1$, $t2$}]'\n        <dd>is a sector from angle $t1$ to $t2$.\n    </dl>\n\n    >> Graphics[{Blue, Disk[{0, 0}, {2, 1}]}]\n     = -Graphics-\n    The outer border can be drawn using 'EdgeForm':\n    >> Graphics[{EdgeForm[Black], Red, Disk[]}]\n     = -Graphics-\n\n    Disk can also draw sectors of circles and ellipses\n    >> Graphics[Disk[{0, 0}, 1, {Pi / 3, 2 Pi / 3}]]\n     = -Graphics-\n    >> Graphics[{Blue, Disk[{0, 0}, {1, 2}, {Pi / 3, 5 Pi / 3}]}]\n     = -Graphics-\n    ";
static const char __pyx_k_dl_dt_FilledCurve_segment1_segm[] = "\n    <dl>\n    <dt>'FilledCurve[{$segment1$, $segment2$ ...}]'\n        <dd>represents a filled curve.\n    </dl>\n\n    >> Graphics[FilledCurve[{Line[{{0, 0}, {1, 1}, {2, 0}}]}]]\n    = -Graphics-\n\n    >> Graphics[FilledCurve[{BezierCurve[{{0, 0}, {1, 1}, {2, 0}}], Line[{{3, 0}, {0, 2}}]}]]\n    = -Graphics-\n    ";
static const char __pyx_k_dl_dt_FontColor_dd_is_an_option[] = "\n    <dl>\n    <dt>'FontColor'\n        <dd>is an option for Style to set the font color.\n    </dl>\n    ";
static const char __pyx_k_dl_dt_Graphics_primitives_optio[] = "\n    <dl>\n      <dt>'Graphics[$primitives$, $options$]'\n      <dd>represents a graphic.\n    </dl>\n\n    Options include:\n\n    <ul>\n      <li>Axes</li>\n      <li>TicksStyle</li>\n      <li>AxesStyle</li>\n      <li>LabelStyle</li>\n      <li>AspectRatio</li>\n      <li>PlotRange</li>\n      <li>PlotRangePadding</li>\n      <li>ImageSize</li>\n      <li>Background</li>\n    <li>\n    </ul>\n\n    >> Graphics[{Blue, Line[{{0,0}, {1,1}}]}]\n     = -Graphics-\n\n    'Graphics' supports 'PlotRange':\n    >> Graphics[{Rectangle[{1, 1}]}, Axes -> True, PlotRange -> {{-2, 1.5}, {-1, 1.5}}]\n     = -Graphics-\n\n    >> Graphics[{Rectangle[],Red,Disk[{1,0}]},PlotRange->{{0,1},{0,1}}]\n     = -Graphics-\n\n    'Graphics' produces 'GraphicsBox' boxes:\n    >> Graphics[Rectangle[]] // ToBoxes // Head\n     = GraphicsBox\n\n    In 'TeXForm', 'Graphics' produces Asymptote figures:\n    >> Graphics[Circle[]] // TeXForm\n     = #<--#\n     . \\begin{asy}\n     . usepackage(\"amsmath\");\n     . size(5.8556cm, 5.8333cm);\n     . draw(ellipse((175,175),175,175), rgb(0, 0, 0)+linewidth(0.66667));\n     . clip(box((-0.33333,0.33333), (350.33,349.67)));\n     . \\end{asy}\n    ";
static const char __pyx_k_dl_dt_GrayLevel_g_dd_represents[] = "\n    <dl>\n    <dt>'GrayLevel[$g$]'\n        <dd>represents a shade of gray specified by $g$, ranging from\n        0 (black) to 1 (white).\n    <dt>'GrayLevel[$g$, $a$]'\n        <dd>represents a shade of gray specified by $g$ with opacity $a$.\n    </dl>\n    ";
static const char __pyx_k_dl_dt_Hue_h_s_l_a_dd_represents[] = "\n    <dl>\n    <dt>'Hue[$h$, $s$, $l$, $a$]'\n        <dd>represents the color with hue $h$, saturation $s$,\n        lightness $l$ and opacity $a$.\n    <dt>'Hue[$h$, $s$, $l$]'\n        <dd>is equivalent to 'Hue[$h$, $s$, $l$, 1]'.\n    <dt>'Hue[$h$, $s$]'\n        <dd>is equivalent to 'Hue[$h$, $s$, 1, 1]'.\n    <dt>'Hue[$h$]'\n        <dd>is equivalent to 'Hue[$h$, 1, 1, 1]'.\n    </dl>\n    >> Graphics[Table[{EdgeForm[Gray], Hue[h, s], Disk[{12h, 8s}]}, {h, 0, 1, 1/6}, {s, 0, 1, 1/4}]]\n     = -Graphics-\n\n    >> Graphics[Table[{EdgeForm[{GrayLevel[0, 0.5]}], Hue[(-11+q+10r)/72, 1, 1, 0.6], Disk[(8-r) {Cos[2Pi q/12], Sin[2Pi q/12]}, (8-r)/3]}, {r, 6}, {q, 12}]]\n     = -Graphics-\n    ";
static const char __pyx_k_dl_dt_ImageSize_Large_dd_produc[] = "\n    <dl>\n    <dt>'ImageSize' -> 'Large'\n        <dd>produces a large image.\n    </dl>\n    ";
static const char __pyx_k_dl_dt_ImageSize_Medium_dd_produ[] = "\n    <dl>\n    <dt>'ImageSize' -> 'Medium'\n        <dd>produces a medium-sized image.\n    </dl>\n    ";
static const char __pyx_k_dl_dt_ImageSize_Small_dd_produc[] = "\n    <dl>\n    <dt>'ImageSize' -> 'Small'\n        <dd>produces a small image.\n    </dl>\n    ";
static const char __pyx_k_dl_dt_ImageSize_Tiny_dd_produce[] = "\n    <dl>\n    <dt>'ImageSize' -> 'Tiny'\n        <dd>produces a tiny image.\n    </dl>\n    ";
static const char __pyx_k_dl_dt_LABColor_l_a_b_dd_represe[] = "\n    <dl>\n    <dt>'LABColor[$l$, $a$, $b$]'\n        <dd>represents a color with the specified lightness, red/green and yellow/blue\n        components in the CIE 1976 L*a*b* (CIELAB) color space.\n    </dl>\n    ";
static const char __pyx_k_dl_dt_LCHColor_l_c_h_dd_represe[] = "\n    <dl>\n    <dt>'LCHColor[$l$, $c$, $h$]'\n        <dd>represents a color with the specified lightness, chroma and hue\n        components in the CIELCh CIELab cube color space.\n    </dl>\n    ";
static const char __pyx_k_dl_dt_LCHColor_l_u_v_dd_represe[] = "\n    <dl>\n    <dt>'LCHColor[$l$, $u$, $v$]'\n        <dd>represents a color with the specified components in the CIE 1976 L*u*v* (CIELUV) color space.\n    </dl>\n    ";
static const char __pyx_k_dl_dt_Lighter_c_f_dd_is_equival[] = "\n    <dl>\n    <dt>'Lighter[$c$, $f$]'\n        <dd>is equivalent to 'Blend[{$c$, White}, $f$]'.\n    <dt>'Lighter[$c$]'\n        <dd>is equivalent to 'Lighter[$c$, 1/3]'.\n    </dl>\n\n    >> Lighter[Orange, 1/4]\n     = RGBColor[1., 0.625, 0.25]\n    >> Graphics[{Lighter[Orange, 1/4], Disk[]}]\n     = -Graphics-\n    >> Graphics[Table[{Lighter[Orange, x], Disk[{12x, 0}]}, {x, 0, 1, 1/6}]]\n     = -Graphics-\n    ";
static const char __pyx_k_dl_dt_Line_point_1_point_2_dd_r[] = "\n    <dl>\n    <dt>'Line[{$point_1$, $point_2$ ...}]'\n        <dd>represents the line primitive.\n    <dt>'Line[{{$p_11$, $p_12$, ...}, {$p_21$, $p_22$, ...}, ...}]'\n        <dd>represents a number of line primitives.\n    </dl>\n\n    >> Graphics[Line[{{0,1},{0,0},{1,0},{1,1}}]]\n    = -Graphics-\n\n    >> Graphics3D[Line[{{0,0,0},{0,1,1},{1,0,0}}]]\n    = -Graphics3D-\n    ";
static const char __pyx_k_dl_dt_PointSize_t_dd_sets_the_d[] = "\n    <dl>\n    <dt>'PointSize[$t$]'\n        <dd>sets the diameter of points to $t$, which is relative to the overall width.\n    </dl>\n    ";
static const char __pyx_k_dl_dt_Polygon_point_1_point_2_d[] = "\n    <dl>\n    <dt>'Polygon[{$point_1$, $point_2$ ...}]'\n        <dd>represents the filled polygon primitive.\n    <dt>'Polygon[{{$p_11$, $p_12$, ...}, {$p_21$, $p_22$, ...}, ...}]'\n        <dd>represents a number of filled polygon primitives.\n    </dl>\n\n    >> Graphics[Polygon[{{1,0},{0,0},{0,1}}]]\n    = -Graphics-\n\n    >> Graphics3D[Polygon[{{0,0,0},{0,1,1},{1,0,0}}]]\n    = -Graphics3D-\n    ";
static const char __pyx_k_dl_dt_RGBColor_r_g_b_dd_represe[] = "\n    <dl>\n    <dt>'RGBColor[$r$, $g$, $b$]'\n        <dd>represents a color with the specified red, green and blue\n        components.\n    </dl>\n\n    >> Graphics[MapIndexed[{RGBColor @@ #1, Disk[2*#2 ~Join~ {0}]} &, IdentityMatrix[3]], ImageSize->Small]\n     = -Graphics-\n\n    >> RGBColor[0, 1, 0]\n     = RGBColor[0, 1, 0]\n\n    >> RGBColor[0, 1, 0] // ToBoxes\n     = StyleBox[GraphicsBox[...], ...]\n    ";
static const char __pyx_k_dl_dt_Rectangle_xmin_ymin_dd_re[] = "\n    <dl>\n    <dt>'Rectangle[{$xmin$, $ymin$}]'\n        <dd>represents a unit square with bottom-left corner at {$xmin$, $ymin$}.\n    <dt>'Rectangle[{$xmin$, $ymin$}, {$xmax$, $ymax$}]\n        <dd>is a rectange extending from {$xmin$, $ymin$} to {$xmax$, $ymax$}.\n    </dl>\n\n    >> Graphics[Rectangle[]]\n     = -Graphics-\n\n    >> Graphics[{Blue, Rectangle[{0.5, 0}], Orange, Rectangle[{0, 0.5}]}]\n     = -Graphics-\n    ";
static const char __pyx_k_dl_dt_RegularPolygon_n_dd_gives[] = "\n    <dl>\n    <dt>'RegularPolygon[$n$]'\n        <dd>gives the regular polygon with $n$ edges.\n    <dt>'RegularPolygon[$r$, $n$]'\n        <dd>gives the regular polygon with $n$ edges and radius $r$.\n    <dt>'RegularPolygon[{$r$, $phi$}, $n$]'\n        <dd>gives the regular polygon with radius $r$ with one vertex drawn at angle $phi$.\n    <dt>'RegularPolygon[{$x, $y}, $r$, $n$]'\n        <dd>gives the regular polygon centered at the position {$x, $y}.\n    </dl>\n\n    >> Graphics[RegularPolygon[5]]\n    = -Graphics-\n\n    >> Graphics[{Yellow, Rectangle[], Orange, RegularPolygon[{1, 1}, {0.25, 0}, 3]}]\n    = -Graphics-\n    ";
static const char __pyx_k_dl_dt_Text_text_x_y_dd_draws_te[] = "\n    <dl>\n    <dt>'Text[\"$text$\", {$x$, $y$}]'\n        <dd>draws $text$ centered on position '{$x$, $y$}'.\n    </dl>\n\n    >> Graphics[{Text[\"First\", {0, 0}], Text[\"Second\", {1, 1}]}, Axes->True, PlotRange->{{-2, 2}, {-2, 2}}]\n     = -Graphics-\n\n    #> Graphics[{Text[x, {0,0}]}]\n     = -Graphics-\n    ";
static const char __pyx_k_dl_dt_Thick_dd_sets_the_line_wi[] = "\n    <dl>\n    <dt>'Thick'\n        <dd>sets the line width for subsequent graphics primitives to 2pt.\n    </dl>\n    ";
static const char __pyx_k_dl_dt_Thickness_t_dd_sets_the_l[] = "\n    <dl>\n    <dt>'Thickness[$t$]'\n        <dd>sets the line thickness for subsequent graphics primitives\n        to $t$ times the size of the plot area.\n    </dl>\n\n    >> Graphics[{Thickness[0.2], Line[{{0, 0}, {0, 5}}]}, Axes->True, PlotRange->{{-5, 5}, {-5, 5}}]\n     = -Graphics-\n    ";
static const char __pyx_k_dl_dt_Thin_dd_sets_the_line_wid[] = "\n    <dl>\n    <dt>'Thin'\n        <dd>sets the line width for subsequent graphics primitives to 0.5pt.\n    </dl>\n    ";
static const char __pyx_k_dl_dt_XYZColor_x_y_z_dd_represe[] = "\n    <dl>\n    <dt>'XYZColor[$x$, $y$, $z$]'\n        <dd>represents a color with the specified components in the CIE 1931 XYZ color space.\n    </dl>\n    ";
static const char __pyx_k_euclidean_distance_locals_genex[] = "_euclidean_distance.<locals>.genexpr";
static const char __pyx_k_extract_graphics_locals_genexpr[] = "_extract_graphics.<locals>.genexpr";
static const char __pyx_k_svg_bezier_locals_path_locals_g[] = "_svg_bezier.<locals>.path.<locals>.genexpr";
static const char __pyx_k_svg_xmlns_svg_http_www_w3_org_2[] = "\n            <svg xmlns:svg=\"http://www.w3.org/2000/svg\"\n                xmlns=\"http://www.w3.org/2000/svg\"\n                version=\"1.1\"\n                viewBox=\"";
static const char __pyx_k_ArrowBox__custom_arrow_locals_ma[] = "ArrowBox._custom_arrow.<locals>.make.<locals>.draw";
static const char __pyx_k_ArrowBox__default_arrow_locals_d[] = "ArrowBox._default_arrow.<locals>.draw";
static const char __pyx_k_ArrowBox__draw_locals_shrink_one[] = "ArrowBox._draw.<locals>.shrink_one_end";
static const char __pyx_k_ArrowBox__setback_spec_locals_ge[] = "ArrowBox._setback_spec.<locals>.genexpr";
static const char __pyx_k_ArrowBox_extent_locals_default_a[] = "ArrowBox.extent.<locals>.default_arrow";
static const char __pyx_k_ArrowBox_to_svg_locals_polygon_l[] = "ArrowBox.to_svg.<locals>.polygon.<locals>.genexpr";
static const char __pyx_k_Blend_colors_ConstantArray_1_Len[] = "Blend[colors, ConstantArray[1, Length[colors]]]";
static const char __pyx_k_ColorDistance_apply_locals_compu[] = "ColorDistance.apply.<locals>.compute";
static const char __pyx_k_ColorDistance_apply_locals_dista[] = "ColorDistance.apply.<locals>.distance";
static const char __pyx_k_ColorDistance_apply_locals_lambd[] = "ColorDistance.apply.<locals>.<lambda>";
static const char __pyx_k_FilledCurveBox_init_locals_genex[] = "FilledCurveBox.init.<locals>.genexpr";
static const char __pyx_k_FilledCurveBox_init_locals_parse[] = "FilledCurveBox.init.<locals>.parse_component";
static const char __pyx_k_FilledCurveBox_to_asy_locals_com[] = "FilledCurveBox.to_asy.<locals>.components";
static const char __pyx_k_FilledCurveBox_to_svg_locals_com[] = "FilledCurveBox.to_svg.<locals>.components";
static const char __pyx_k_Function_x_Total_p_BernsteinBasi[] = "Function[x, Total[p * BernsteinBasis[Length[p] - 1, Range[0, Length[p] - 1], x]]]";
static const char __pyx_k_GraphicsBox__prepare_elements_lo[] = "GraphicsBox._prepare_elements.<locals>.calc_dimensions.<locals>.genexpr";
static const char __pyx_k_GraphicsBox_axis_ticks_locals_ro[] = "GraphicsBox.axis_ticks.<locals>.round_to_zero";
static const char __pyx_k_GraphicsBox_create_axes_locals_a[] = "GraphicsBox.create_axes.<locals>.add_element";
static const char __pyx_k_GraphicsBox_create_axes_locals_g[] = "GraphicsBox.create_axes.<locals>.genexpr";
static const char __pyx_k_GraphicsBox_create_axes_locals_l[] = "GraphicsBox.create_axes.<locals>.<lambda>";
static const char __pyx_k_GraphicsElements_to_asy_locals_g[] = "GraphicsElements.to_asy.<locals>.genexpr";
static const char __pyx_k_GraphicsElements_to_svg_locals_g[] = "GraphicsElements.to_svg.<locals>.genexpr";
static const char __pyx_k_GraphicsElements_translate_absol[] = "GraphicsElements.translate_absolute";
static const char __pyx_k_GraphicsElements_translate_relat[] = "GraphicsElements.translate_relative";
static const char __pyx_k_Line_make_draw_svg_locals_draw_2[] = "_Line.make_draw_svg.<locals>.draw";
static const char __pyx_k_Piecewise_Binomial_d_n_x_n_1_x_d[] = "Piecewise[{{Binomial[d, n] * x ^ n * (1 - x) ^ (d - n), 0 < x < 1}}, 0]";
static const char __pyx_k_PolygonBox_to_svg_locals_genexpr[] = "PolygonBox.to_svg.<locals>.genexpr";
static const char __pyx_k_RegularPolygonBox_init_locals_ge[] = "RegularPolygonBox.init.<locals>.genexpr";
static const char __pyx_k_RegularPolygonBox_init_locals_ve[] = "RegularPolygonBox.init.<locals>.vertices";
static const char __pyx_k_Style_Graphics_EdgeForm_Black_na[] = "Style[Graphics[{EdgeForm[Black], %(name)s[x], Rectangle[]}, ImageSize -> 16], ImageSizeMultipliers -> {1, 1}]";
static const char __pyx_k_cannot_compute_bezier_curve_of_o[] = "cannot compute bezier curve of order %d";
static const char __pyx_k_px_src_data_image_svg_xml_base64[] = "px\" src=\"data:image/svg+xml;base64,";
static const char __pyx_k_GraphicsElements___init___local_2[] = "_GraphicsElements.__init__.<locals>.get_options";
static const char __pyx_k_GraphicsElements___init___local_3[] = "_GraphicsElements.__init__.<locals>.stylebox_style";
static const char __pyx_k_Graphics_apply_makeboxes_locals_2[] = "Graphics.apply_makeboxes.<locals>.convert";
static const char __pyx_k_ArrowBox__custom_arrow_locals_ma_2[] = "ArrowBox._custom_arrow.<locals>.make";
static const char __pyx_k_GraphicsBox__prepare_elements_lo_2[] = "GraphicsBox._prepare_elements.<locals>.calc_dimensions.<locals>.get_range";
static const char __pyx_k_GraphicsBox__prepare_elements_lo_3[] = "GraphicsBox._prepare_elements.<locals>.calc_dimensions";
static const char __pyx_k_GraphicsBox_axis_ticks_locals_ro_2[] = "GraphicsBox.axis_ticks.<locals>.round_step";
static PyObject *__pyx_kp_u_0;
static PyObject *__pyx_kp_u_0_0;
static PyObject *__pyx_kp_u_0_2;
static PyObject *__pyx_kp_u_1;
static PyObject *__pyx_kp_u_1_and_2_should_be_two_colors_or;
static PyObject *__pyx_kp_u_1_is_not_Automatic_or_a_valid_d;
static PyObject *__pyx_kp_u_1_is_not_a_valid_list_of_color;
static PyObject *__pyx_kp_u_1_should_be_a_real_number_or_a;
static PyObject *__pyx_kp_u_1f;
static PyObject *__pyx_kp_u_3;
static PyObject *__pyx_kp_u_5g;
static PyObject *__pyx_kp_u_5g_5g;
static PyObject *__pyx_kp_u_5g_5g_2;
static PyObject *__pyx_kp_u_5g_5g_3;
static PyObject *__pyx_kp_u_A;
static PyObject *__pyx_n_s_ASYTransform;
static PyObject *__pyx_n_s_ASYTransform___init;
static PyObject *__pyx_n_s_ASYTransform_apply;
static PyObject *__pyx_n_s_ASYTransform_matrix;
static PyObject *__pyx_n_s_ASYTransform_rotate;
static PyObject *__pyx_n_s_ASYTransform_scale;
static PyObject *__pyx_n_s_ASYTransform_translate;
static PyObject *__pyx_n_s_AbsoluteThickness;
static PyObject *__pyx_n_u_AbsoluteThickness;
static PyObject *__pyx_kp_u_AbsoluteThickness_0_5;
static PyObject *__pyx_kp_u_AbsoluteThickness_2;
static PyObject *__pyx_n_s_AbsoluteThickness_get_thickness;
static PyObject *__pyx_n_u_Acceptability;
static PyObject *__pyx_n_u_Apply;
static PyObject *__pyx_kp_u_Apply_name_s_x;
static PyObject *__pyx_n_s_ArcBox;
static PyObject *__pyx_n_s_ArcBox__arc_params;
static PyObject *__pyx_n_s_ArcBox_init;
static PyObject *__pyx_n_s_ArcBox_to_asy;
static PyObject *__pyx_n_s_ArcBox_to_asy_locals_path;
static PyObject *__pyx_n_s_ArcBox_to_asy_locals_path_local;
static PyObject *__pyx_n_s_ArcBox_to_svg;
static PyObject *__pyx_n_s_ArcBox_to_svg_locals_path;
static PyObject *__pyx_n_s_Arrow;
static PyObject *__pyx_n_u_Arrow;
static PyObject *__pyx_n_s_ArrowBox;
static PyObject *__pyx_n_u_ArrowBox;
static PyObject *__pyx_n_s_ArrowBox__custom_arrow;
static PyObject *__pyx_n_s_ArrowBox__custom_arrow_locals_ma;
static PyObject *__pyx_n_s_ArrowBox__custom_arrow_locals_ma_2;
static PyObject *__pyx_n_s_ArrowBox__default_arrow;
static PyObject *__pyx_n_s_ArrowBox__default_arrow_locals_d;
static PyObject *__pyx_n_s_ArrowBox__draw;
static PyObject *__pyx_n_s_ArrowBox__draw_locals_lambda;
static PyObject *__pyx_n_s_ArrowBox__draw_locals_setback;
static PyObject *__pyx_n_s_ArrowBox__draw_locals_shrink;
static PyObject *__pyx_n_s_ArrowBox__draw_locals_shrink_one;
static PyObject *__pyx_n_s_ArrowBox__setback_spec;
static PyObject *__pyx_n_s_ArrowBox__setback_spec_locals_ge;
static PyObject *__pyx_n_s_ArrowBox_extent;
static PyObject *__pyx_n_s_ArrowBox_extent_locals_default_a;
static PyObject *__pyx_n_s_ArrowBox_extent_locals_polygon;
static PyObject *__pyx_n_s_ArrowBox_extent_locals_polyline;
static PyObject *__pyx_n_s_ArrowBox_init;
static PyObject *__pyx_n_s_ArrowBox_to_asy;
static PyObject *__pyx_n_s_ArrowBox_to_asy_locals_polygon;
static PyObject *__pyx_n_s_ArrowBox_to_svg;
static PyObject *__pyx_n_s_ArrowBox_to_svg_locals_polygon;
static PyObject *__pyx_n_s_ArrowBox_to_svg_locals_polygon_l;
static PyObject *__pyx_n_s_Arrowheads;
static PyObject *__pyx_n_u_Arrowheads;
static PyObject *__pyx_n_s_Arrowheads__arrow_size;
static PyObject *__pyx_n_s_Arrowheads_heads;
static PyObject *__pyx_n_s_Arrowheads_heads_locals_genexpr;
static PyObject *__pyx_n_s_Arrowheads_init;
static PyObject *__pyx_n_u_AspectRatio;
static PyObject *__pyx_n_s_Automatic;
static PyObject *__pyx_n_u_Automatic;
static PyObject *__pyx_n_u_Axes;
static PyObject *__pyx_n_u_AxesStyle;
static PyObject *__pyx_n_u_Background;
static PyObject *__pyx_n_s_BernsteinBasis;
static PyObject *__pyx_kp_u_BernsteinBasis_d__n__x;
static PyObject *__pyx_n_s_BezierCurve;
static PyObject *__pyx_n_s_BezierCurveBox;
static PyObject *__pyx_n_u_BezierCurveBox;
static PyObject *__pyx_n_s_BezierCurveBox_init;
static PyObject *__pyx_n_s_BezierCurveBox_to_asy;
static PyObject *__pyx_n_s_BezierCurveBox_to_svg;
static PyObject *__pyx_n_s_BezierCurve_2;
static PyObject *__pyx_n_u_BezierCurve_2;
static PyObject *__pyx_n_s_BezierCurve___init;
static PyObject *__pyx_n_s_BezierCurve_arrows;
static PyObject *__pyx_n_s_BezierCurve_make_draw_asy;
static PyObject *__pyx_n_s_BezierCurve_make_draw_asy_local;
static PyObject *__pyx_n_s_BezierCurve_make_draw_svg;
static PyObject *__pyx_n_s_BezierCurve_make_draw_svg_local;
static PyObject *__pyx_n_s_BezierFunction;
static PyObject *__pyx_kp_u_BezierFunction_p;
static PyObject *__pyx_n_s_Black;
static PyObject *__pyx_n_u_Black;
static PyObject *__pyx_kp_s_Black_GrayLevel_0;
static PyObject *__pyx_n_s_Blend;
static PyObject *__pyx_n_u_Blend;
static PyObject *__pyx_n_s_Blend_apply;
static PyObject *__pyx_kp_u_Blend_c_Black_f;
static PyObject *__pyx_kp_u_Blend_c_White_f;
static PyObject *__pyx_kp_u_Blend_colors;
static PyObject *__pyx_kp_u_Blend_colors_ConstantArray_1_Len;
static PyObject *__pyx_n_s_Blend_do_blend;
static PyObject *__pyx_n_s_Blue;
static PyObject *__pyx_n_u_Blue;
static PyObject *__pyx_kp_s_Blue_RGBColor_0_0_1;
static PyObject *__pyx_n_u_Box;
static PyObject *__pyx_n_s_BoxConstruct;
static PyObject *__pyx_n_s_BoxConstructError;
static PyObject *__pyx_n_s_Builtin;
static PyObject *__pyx_n_s_C1;
static PyObject *__pyx_n_s_C2;
static PyObject *__pyx_n_u_CIE2000;
static PyObject *__pyx_n_u_CIE76;
static PyObject *__pyx_n_u_CIE94;
static PyObject *__pyx_n_u_CIEDE2000;
static PyObject *__pyx_n_u_CMC;
static PyObject *__pyx_n_s_CMC_distance;
static PyObject *__pyx_n_u_CMYK;
static PyObject *__pyx_n_s_CMYKColor;
static PyObject *__pyx_n_u_CMYKColor;
static PyObject *__pyx_n_s_Circle;
static PyObject *__pyx_n_u_Circle;
static PyObject *__pyx_n_s_CircleBox;
static PyObject *__pyx_n_u_CircleBox;
static PyObject *__pyx_kp_u_Circle_0_0;
static PyObject *__pyx_kp_u_Circle_2;
static PyObject *__pyx_n_s_Cm;
static PyObject *__pyx_n_s_Color;
static PyObject *__pyx_n_s_ColorDistance;
static PyObject *__pyx_n_u_ColorDistance;
static PyObject *__pyx_n_s_ColorDistance_apply;
static PyObject *__pyx_n_s_ColorDistance_apply_locals_compu;
static PyObject *__pyx_n_s_ColorDistance_apply_locals_dista;
static PyObject *__pyx_n_s_ColorDistance_apply_locals_lambd;
static PyObject *__pyx_n_s_ColorDistance_lambda;
static PyObject *__pyx_n_s_ColorError;
static PyObject *__pyx_n_s_ColorObject;
static PyObject *__pyx_n_s_ColorObject___init;
static PyObject *__pyx_n_u_Color_2;
static PyObject *__pyx_n_s_Color_create;
static PyObject *__pyx_n_s_Color_create_as_style;
static PyObject *__pyx_n_s_Color_init;
static PyObject *__pyx_n_s_Color_to_asy;
static PyObject *__pyx_n_s_Color_to_color_space;
static PyObject *__pyx_n_s_Color_to_css;
static PyObject *__pyx_n_s_Color_to_expr;
static PyObject *__pyx_n_s_Color_to_js;
static PyObject *__pyx_n_s_Color_to_rgba;
static PyObject *__pyx_n_s_CoordinatesError;
static PyObject *__pyx_n_s_Coords;
static PyObject *__pyx_n_s_Coords___init;
static PyObject *__pyx_n_s_Coords_add;
static PyObject *__pyx_n_s_Coords_pos;
static PyObject *__pyx_n_s_Cyan;
static PyObject *__pyx_n_u_Cyan;
static PyObject *__pyx_kp_s_Cyan_RGBColor_0_1_1;
static PyObject *__pyx_n_s_Darker;
static PyObject *__pyx_kp_u_Darker_c;
static PyObject *__pyx_kp_u_Darker_c_1_3;
static PyObject *__pyx_kp_u_Darker_c__f;
static PyObject *__pyx_n_u_DeltaC;
static PyObject *__pyx_n_u_DeltaH;
static PyObject *__pyx_n_u_DeltaL;
static PyObject *__pyx_n_s_Directive;
static PyObject *__pyx_n_u_Directive;
static PyObject *__pyx_n_s_Disk;
static PyObject *__pyx_n_u_Disk;
static PyObject *__pyx_n_s_DiskBox;
static PyObject *__pyx_n_u_DiskBox;
static PyObject *__pyx_kp_u_Disk_0_0;
static PyObject *__pyx_kp_u_Disk_2;
static PyObject *__pyx_n_u_DistanceFunction;
static PyObject *__pyx_n_s_EdgeForm;
static PyObject *__pyx_n_s_Expression;
static PyObject *__pyx_n_s_F;
static PyObject *__pyx_n_s_FaceForm;
static PyObject *__pyx_n_u_False;
static PyObject *__pyx_n_s_FilledCurve;
static PyObject *__pyx_n_u_FilledCurve;
static PyObject *__pyx_n_s_FilledCurveBox;
static PyObject *__pyx_n_u_FilledCurveBox;
static PyObject *__pyx_n_s_FilledCurveBox_extent;
static PyObject *__pyx_n_s_FilledCurveBox_init;
static PyObject *__pyx_n_s_FilledCurveBox_init_locals_genex;
static PyObject *__pyx_n_s_FilledCurveBox_init_locals_parse;
static PyObject *__pyx_n_s_FilledCurveBox_to_asy;
static PyObject *__pyx_n_s_FilledCurveBox_to_asy_locals_com;
static PyObject *__pyx_n_s_FilledCurveBox_to_svg;
static PyObject *__pyx_n_s_FilledCurveBox_to_svg_locals_com;
static PyObject *__pyx_n_s_FontColor;
static PyObject *__pyx_n_u_FontColor;
static PyObject *__pyx_kp_u_Function_x_Total_p_BernsteinBasi;
static PyObject *__pyx_n_s_GLOBALS;
static PyObject *__pyx_n_s_GLOBALS3D;
static PyObject *__pyx_n_s_GRAPHICS_OPTIONS;
static PyObject *__pyx_n_s_GRAPHICS_SYMBOLS;
static PyObject *__pyx_n_s_Graphics;
static PyObject *__pyx_n_u_Graphics;
static PyObject *__pyx_n_s_GraphicsBox;
static PyObject *__pyx_n_s_GraphicsBox__get_image_size;
static PyObject *__pyx_n_s_GraphicsBox__prepare_elements;
static PyObject *__pyx_n_s_GraphicsBox__prepare_elements_lo;
static PyObject *__pyx_n_s_GraphicsBox__prepare_elements_lo_2;
static PyObject *__pyx_n_s_GraphicsBox__prepare_elements_lo_3;
static PyObject *__pyx_n_s_GraphicsBox_axis_ticks;
static PyObject *__pyx_n_s_GraphicsBox_axis_ticks_locals_ro;
static PyObject *__pyx_n_s_GraphicsBox_axis_ticks_locals_ro_2;
static PyObject *__pyx_n_s_GraphicsBox_boxes_to_tex;
static PyObject *__pyx_n_s_GraphicsBox_boxes_to_tex_locals;
static PyObject *__pyx_n_s_GraphicsBox_boxes_to_text;
static PyObject *__pyx_n_s_GraphicsBox_boxes_to_xml;
static PyObject *__pyx_n_s_GraphicsBox_boxes_to_xml_locals;
static PyObject *__pyx_n_s_GraphicsBox_create_axes;
static PyObject *__pyx_n_s_GraphicsBox_create_axes_locals_a;
static PyObject *__pyx_n_s_GraphicsBox_create_axes_locals_g;
static PyObject *__pyx_n_s_GraphicsBox_create_axes_locals_l;
static PyObject *__pyx_n_s_GraphicsElement;
static PyObject *__pyx_n_s_GraphicsElement_create_as_style;
static PyObject *__pyx_n_s_GraphicsElement_init;
static PyObject *__pyx_n_s_GraphicsElements;
static PyObject *__pyx_n_s_GraphicsElements_2;
static PyObject *__pyx_n_s_GraphicsElements___init;
static PyObject *__pyx_n_s_GraphicsElements___init_2;
static PyObject *__pyx_n_s_GraphicsElements___init___local;
static PyObject *__pyx_n_s_GraphicsElements___init___local_2;
static PyObject *__pyx_n_s_GraphicsElements___init___local_3;
static PyObject *__pyx_n_s_GraphicsElements_create_style;
static PyObject *__pyx_n_s_GraphicsElements_create_style_l;
static PyObject *__pyx_n_s_GraphicsElements_extent;
static PyObject *__pyx_n_s_GraphicsElements_get_style_clas;
static PyObject *__pyx_n_s_GraphicsElements_set_size;
static PyObject *__pyx_n_s_GraphicsElements_to_asy;
static PyObject *__pyx_n_s_GraphicsElements_to_asy_locals_g;
static PyObject *__pyx_n_s_GraphicsElements_to_svg;
static PyObject *__pyx_n_s_GraphicsElements_to_svg_locals_g;
static PyObject *__pyx_n_s_GraphicsElements_translate;
static PyObject *__pyx_n_s_GraphicsElements_translate_absol;
static PyObject *__pyx_n_s_GraphicsElements_translate_relat;
static PyObject *__pyx_kp_u_Graphics_2;
static PyObject *__pyx_kp_s_Graphics_EdgeForm_Thick_Green_D;
static PyObject *__pyx_n_s_Graphics_apply_makeboxes;
static PyObject *__pyx_n_s_Graphics_apply_makeboxes_locals;
static PyObject *__pyx_n_s_Graphics_apply_makeboxes_locals_2;
static PyObject *__pyx_n_s_Gray;
static PyObject *__pyx_n_u_Gray;
static PyObject *__pyx_n_s_GrayLevel;
static PyObject *__pyx_n_u_GrayLevel;
static PyObject *__pyx_kp_u_GrayLevel_0;
static PyObject *__pyx_kp_u_GrayLevel_0_5;
static PyObject *__pyx_kp_u_GrayLevel_1;
static PyObject *__pyx_kp_s_Gray_GrayLevel_0_5;
static PyObject *__pyx_n_u_Grayscale;
static PyObject *__pyx_n_s_Green;
static PyObject *__pyx_n_u_Green;
static PyObject *__pyx_kp_s_Green_RGBColor_0_1_0;
static PyObject *__pyx_n_u_HSB;
static PyObject *__pyx_n_s_Hm;
static PyObject *__pyx_n_u_HoldAll;
static PyObject *__pyx_n_s_Hue;
static PyObject *__pyx_n_u_Hue;
static PyObject *__pyx_n_s_Hue_hsl_to_rgba;
static PyObject *__pyx_n_s_Hue_hsl_to_rgba_locals_map;
static PyObject *__pyx_n_s_Hue_hsl_to_rgba_locals_trans;
static PyObject *__pyx_n_u_Ignore;
static PyObject *__pyx_n_u_ImageSize;
static PyObject *__pyx_n_s_Inset;
static PyObject *__pyx_n_u_Inset;
static PyObject *__pyx_n_s_InsetBox;
static PyObject *__pyx_n_u_InsetBox;
static PyObject *__pyx_n_s_InsetBox_extent;
static PyObject *__pyx_n_s_InsetBox_init;
static PyObject *__pyx_n_s_InsetBox_to_asy;
static PyObject *__pyx_n_s_InsetBox_to_svg;
static PyObject *__pyx_n_s_InstancableBuiltin;
static PyObject *__pyx_n_s_Integer;
static PyObject *__pyx_kp_u_L;
static PyObject *__pyx_n_s_L1;
static PyObject *__pyx_n_s_L2;
static PyObject *__pyx_n_u_LAB;
static PyObject *__pyx_n_s_LABColor;
static PyObject *__pyx_n_u_LABColor;
static PyObject *__pyx_n_u_LCH;
static PyObject *__pyx_n_s_LCHColor;
static PyObject *__pyx_n_u_LCHColor;
static PyObject *__pyx_n_u_LQC;
static PyObject *__pyx_n_u_LUV;
static PyObject *__pyx_n_s_LUVColor;
static PyObject *__pyx_n_u_LUVColor;
static PyObject *__pyx_n_u_LabelStyle;
static PyObject *__pyx_n_s_Large;
static PyObject *__pyx_n_s_LightRed;
static PyObject *__pyx_n_u_LightRed;
static PyObject *__pyx_n_s_Lighter;
static PyObject *__pyx_kp_u_Lighter_Red_0_85;
static PyObject *__pyx_kp_u_Lighter_c;
static PyObject *__pyx_kp_u_Lighter_c_1_3;
static PyObject *__pyx_kp_u_Lighter_c__f;
static PyObject *__pyx_n_s_Line;
static PyObject *__pyx_n_s_LineBox;
static PyObject *__pyx_n_u_LineBox;
static PyObject *__pyx_n_s_LineBox_init;
static PyObject *__pyx_n_s_LineBox_to_asy;
static PyObject *__pyx_n_s_LineBox_to_svg;
static PyObject *__pyx_n_s_Line_2;
static PyObject *__pyx_n_u_Line_2;
static PyObject *__pyx_n_s_Line_arrows;
static PyObject *__pyx_n_s_Line_arrows_locals_genexpr;
static PyObject *__pyx_n_s_Line_arrows_locals_segments;
static PyObject *__pyx_n_s_Line_make_draw_asy;
static PyObject *__pyx_n_s_Line_make_draw_asy_locals_draw;
static PyObject *__pyx_n_s_Line_make_draw_svg;
static PyObject *__pyx_n_s_Line_make_draw_svg_locals_draw;
static PyObject *__pyx_n_s_Line_make_draw_svg_locals_draw_2;
static PyObject *__pyx_n_u_List;
static PyObject *__pyx_n_s_Lm;
static PyObject *__pyx_kp_u_M;
static PyObject *__pyx_kp_u_M_f_f;
static PyObject *__pyx_n_s_Magenta;
static PyObject *__pyx_n_u_Magenta;
static PyObject *__pyx_kp_s_Magenta_RGBColor_1_0_1;
static PyObject *__pyx_n_u_MakeBoxes;
static PyObject *__pyx_n_s_Medium;
static PyObject *__pyx_n_u_N;
static PyObject *__pyx_kp_u_None;
static PyObject *__pyx_n_s_NotImplementedError;
static PyObject *__pyx_kp_u_NumPy_needs_to_be_installed_for;
static PyObject *__pyx_n_s_Offset;
static PyObject *__pyx_n_u_Offset;
static PyObject *__pyx_kp_u_OptionSyntax;
static PyObject *__pyx_n_s_Orange;
static PyObject *__pyx_n_u_Orange;
static PyObject *__pyx_n_u_Perceptibility;
static PyObject *__pyx_kp_u_Piecewise_Binomial_d_n_x_n_1_x_d;
static PyObject *__pyx_n_u_PlotRange;
static PyObject *__pyx_n_u_PlotRangePadding;
static PyObject *__pyx_n_s_Point;
static PyObject *__pyx_n_u_Point;
static PyObject *__pyx_n_s_PointBox;
static PyObject *__pyx_n_u_PointBox;
static PyObject *__pyx_n_s_PointBox_init;
static PyObject *__pyx_n_s_PointBox_init_locals_genexpr;
static PyObject *__pyx_n_s_PointBox_to_asy;
static PyObject *__pyx_n_s_PointBox_to_svg;
static PyObject *__pyx_n_s_PointSize;
static PyObject *__pyx_n_u_PointSize;
static PyObject *__pyx_n_s_PointSize_get_size;
static PyObject *__pyx_n_s_Polygon;
static PyObject *__pyx_n_u_Polygon;
static PyObject *__pyx_n_s_PolygonBox;
static PyObject *__pyx_n_u_PolygonBox;
static PyObject *__pyx_n_s_PolygonBox_init;
static PyObject *__pyx_n_s_PolygonBox_process_option;
static PyObject *__pyx_n_s_PolygonBox_to_asy;
static PyObject *__pyx_n_s_PolygonBox_to_svg;
static PyObject *__pyx_n_s_PolygonBox_to_svg_locals_genexpr;
static PyObject *__pyx_n_s_Polyline;
static PyObject *__pyx_n_s_Polyline_do_init;
static PyObject *__pyx_n_s_Polyline_do_init_locals_genexpr;
static PyObject *__pyx_n_s_Polyline_extent;
static PyObject *__pyx_n_s_Purple;
static PyObject *__pyx_n_u_Purple;
static PyObject *__pyx_n_u_RGB;
static PyObject *__pyx_n_s_RGBColor;
static PyObject *__pyx_n_u_RGBColor;
static PyObject *__pyx_kp_u_RGBColor_0_0_1;
static PyObject *__pyx_kp_u_RGBColor_0_1_0;
static PyObject *__pyx_kp_u_RGBColor_0_1_1;
static PyObject *__pyx_kp_u_RGBColor_0_5_0_0_5;
static PyObject *__pyx_kp_u_RGBColor_1_0_0;
static PyObject *__pyx_kp_u_RGBColor_1_0_1;
static PyObject *__pyx_kp_u_RGBColor_1_0_5_0;
static PyObject *__pyx_kp_u_RGBColor_1_1_0;
static PyObject *__pyx_n_s_RGBColor_to_rgba;
static PyObject *__pyx_n_s_Rational;
static PyObject *__pyx_n_u_ReadProtected;
static PyObject *__pyx_n_s_Real;
static PyObject *__pyx_n_s_Rectangle;
static PyObject *__pyx_n_u_Rectangle;
static PyObject *__pyx_n_s_RectangleBox;
static PyObject *__pyx_n_u_RectangleBox;
static PyObject *__pyx_n_s_RectangleBox_extent;
static PyObject *__pyx_n_s_RectangleBox_init;
static PyObject *__pyx_n_s_RectangleBox_to_asy;
static PyObject *__pyx_n_s_RectangleBox_to_svg;
static PyObject *__pyx_kp_u_Rectangle_0_0;
static PyObject *__pyx_kp_u_Rectangle_2;
static PyObject *__pyx_n_s_Red;
static PyObject *__pyx_n_u_Red;
static PyObject *__pyx_kp_s_Red_RGBColor_1_0_0;
static PyObject *__pyx_n_s_RegularPolygon;
static PyObject *__pyx_n_u_RegularPolygon;
static PyObject *__pyx_n_s_RegularPolygonBox;
static PyObject *__pyx_n_u_RegularPolygonBox;
static PyObject *__pyx_n_s_RegularPolygonBox_init;
static PyObject *__pyx_n_s_RegularPolygonBox_init_locals_ge;
static PyObject *__pyx_n_s_RegularPolygonBox_init_locals_ve;
static PyObject *__pyx_n_s_RoundBox;
static PyObject *__pyx_n_s_RoundBox_extent;
static PyObject *__pyx_n_s_RoundBox_init;
static PyObject *__pyx_n_s_RoundBox_to_asy;
static PyObject *__pyx_n_s_RoundBox_to_svg;
static PyObject *__pyx_n_u_Rule;
static PyObject *__pyx_n_s_RuntimeError;
static PyObject *__pyx_n_s_SC;
static PyObject *__pyx_n_s_SH;
static PyObject *__pyx_n_s_SL;
static PyObject *__pyx_n_s_SVGTransform;
static PyObject *__pyx_n_s_SVGTransform___init;
static PyObject *__pyx_n_s_SVGTransform_apply;
static PyObject *__pyx_n_s_SVGTransform_matrix;
static PyObject *__pyx_n_s_SVGTransform_rotate;
static PyObject *__pyx_n_s_SVGTransform_scale;
static PyObject *__pyx_n_s_SVGTransform_translate;
static PyObject *__pyx_n_s_Show;
static PyObject *__pyx_n_s_Show_apply;
static PyObject *__pyx_n_s_Size;
static PyObject *__pyx_n_s_Size_init;
static PyObject *__pyx_n_s_Small;
static PyObject *__pyx_n_u_Sphere;
static PyObject *__pyx_n_u_SplineDegree;
static PyObject *__pyx_n_u_StandardForm;
static PyObject *__pyx_n_s_String;
static PyObject *__pyx_n_s_Style;
static PyObject *__pyx_n_u_Style;
static PyObject *__pyx_n_u_StyleBox;
static PyObject *__pyx_kp_u_Style_Graphics_EdgeForm_Black_na;
static PyObject *__pyx_n_s_Style___init;
static PyObject *__pyx_n_s_Style_append;
static PyObject *__pyx_n_s_Style_clone;
static PyObject *__pyx_n_s_Style_extend;
static PyObject *__pyx_n_s_Style_get_default_edge_color;
static PyObject *__pyx_n_s_Style_get_default_face_color;
static PyObject *__pyx_n_s_Style_get_line_width;
static PyObject *__pyx_n_s_Style_get_option;
static PyObject *__pyx_n_s_Style_get_style;
static PyObject *__pyx_n_s_Style_set_option;
static PyObject *__pyx_n_s_Symbol;
static PyObject *__pyx_kp_u_System;
static PyObject *__pyx_kp_u_System_AspectRatio;
static PyObject *__pyx_kp_u_System_Automatic;
static PyObject *__pyx_kp_u_System_Axes;
static PyObject *__pyx_kp_u_System_AxesStyle;
static PyObject *__pyx_kp_u_System_BSplineCurve;
static PyObject *__pyx_kp_u_System_Background;
static PyObject *__pyx_kp_u_System_BezierCurve;
static PyObject *__pyx_kp_u_System_DistanceFunction;
static PyObject *__pyx_kp_u_System_EdgeForm;
static PyObject *__pyx_kp_u_System_FaceForm;
static PyObject *__pyx_kp_u_System_FontColor;
static PyObject *__pyx_kp_u_System_Graphics;
static PyObject *__pyx_kp_u_System_ImageSize;
static PyObject *__pyx_kp_u_System_Inset;
static PyObject *__pyx_kp_u_System_LabelStyle;
static PyObject *__pyx_kp_u_System_Large;
static PyObject *__pyx_kp_u_System_Line;
static PyObject *__pyx_kp_u_System_List;
static PyObject *__pyx_kp_u_System_Medium;
static PyObject *__pyx_kp_u_System_Null;
static PyObject *__pyx_kp_u_System_PlotRange;
static PyObject *__pyx_kp_u_System_Rule;
static PyObject *__pyx_kp_u_System_Small;
static PyObject *__pyx_kp_u_System_SplineDegree;
static PyObject *__pyx_kp_u_System_String;
static PyObject *__pyx_kp_u_System_Style;
static PyObject *__pyx_kp_u_System_StyleBox;
static PyObject *__pyx_kp_u_System_Symbol;
static PyObject *__pyx_kp_u_System_Text;
static PyObject *__pyx_kp_u_System_TicksStyle;
static PyObject *__pyx_kp_u_System_Tiny;
static PyObject *__pyx_kp_u_System_VertexColors;
static PyObject *__pyx_n_s_T;
static PyObject *__pyx_n_s_Text;
static PyObject *__pyx_n_u_Text;
static PyObject *__pyx_n_s_Thick;
static PyObject *__pyx_n_u_Thick;
static PyObject *__pyx_n_s_Thickness;
static PyObject *__pyx_n_s_Thickness_2;
static PyObject *__pyx_n_u_Thickness_2;
static PyObject *__pyx_n_s_Thickness_get_thickness;
static PyObject *__pyx_n_s_Thin;
static PyObject *__pyx_n_u_Thin;
static PyObject *__pyx_n_u_TicksStyle;
static PyObject *__pyx_n_s_Tiny;
static PyObject *__pyx_n_u_TraditionalForm;
static PyObject *__pyx_n_s_TypeError;
static PyObject *__pyx_n_s_ValueError;
static PyObject *__pyx_n_s_White;
static PyObject *__pyx_n_u_White;
static PyObject *__pyx_kp_s_White_GrayLevel_1;
static PyObject *__pyx_n_u_XYZ;
static PyObject *__pyx_n_s_XYZColor;
static PyObject *__pyx_n_u_XYZColor;
static PyObject *__pyx_n_s_Yellow;
static PyObject *__pyx_n_u_Yellow;
static PyObject *__pyx_kp_s_Yellow_RGBColor_1_1_0;
static PyObject *__pyx_n_u_Z;
static PyObject *__pyx_kp_u_Z_2;
static PyObject *__pyx_kp_u__10;
static PyObject *__pyx_kp_u__108;
static PyObject *__pyx_kp_u__109;
static PyObject *__pyx_kp_u__140;
static PyObject *__pyx_kp_u__141;
static PyObject *__pyx_kp_u__142;
static PyObject *__pyx_kp_u__151;
static PyObject *__pyx_kp_u__16;
static PyObject *__pyx_kp_u__17;
static PyObject *__pyx_kp_u__18;
static PyObject *__pyx_n_s__186;
static PyObject *__pyx_kp_u__3;
static PyObject *__pyx_kp_u__30;
static PyObject *__pyx_kp_u__31;
static PyObject *__pyx_kp_u__32;
static PyObject *__pyx_kp_u__33;
static PyObject *__pyx_kp_u__34;
static PyObject *__pyx_kp_u__35;
static PyObject *__pyx_kp_u__4;
static PyObject *__pyx_kp_u__41;
static PyObject *__pyx_kp_u__43;
static PyObject *__pyx_kp_u__5;
static PyObject *__pyx_kp_u__57;
static PyObject *__pyx_kp_u__58;
static PyObject *__pyx_kp_u__6;
static PyObject *__pyx_kp_u__66;
static PyObject *__pyx_kp_u__67;
static PyObject *__pyx_kp_u__7;
static PyObject *__pyx_kp_u__8;
static PyObject *__pyx_kp_u__9;
static PyObject *__pyx_n_s_a;
static PyObject *__pyx_n_s_a1;
static PyObject *__pyx_n_s_a2;
static PyObject *__pyx_n_s_add;
static PyObject *__pyx_n_s_add_element;
static PyObject *__pyx_kp_u_add_s_new_picture_picture_saved;
static PyObject *__pyx_n_s_allow_forms;
static PyObject *__pyx_n_s_alpha;
static PyObject *__pyx_n_s_append;
static PyObject *__pyx_n_s_apply;
static PyObject *__pyx_n_s_apply_makeboxes;
static PyObject *__pyx_n_s_arc;
static PyObject *__pyx_n_s_arc_expr;
static PyObject *__pyx_n_s_arc_params;
static PyObject *__pyx_kp_u_arc_s_s_s_s_s_s;
static PyObject *__pyx_n_u_arg;
static PyObject *__pyx_n_u_argl;
static PyObject *__pyx_n_s_args;
static PyObject *__pyx_n_s_arrow;
static PyObject *__pyx_n_s_arrow_edge;
static PyObject *__pyx_n_s_arrow_pen;
static PyObject *__pyx_n_s_arrow_size;
static PyObject *__pyx_n_s_arrow_spread;
static PyObject *__pyx_n_s_arrow_style;
static PyObject *__pyx_n_s_arrows;
static PyObject *__pyx_n_s_aspect;
static PyObject *__pyx_n_s_aspect_ratio;
static PyObject *__pyx_n_s_asy;
static PyObject *__pyx_n_u_asy;
static PyObject *__pyx_n_s_asy_background;
static PyObject *__pyx_n_s_asy_bezier;
static PyObject *__pyx_n_s_asy_bezier_locals_cubic;
static PyObject *__pyx_n_s_asy_bezier_locals_linear;
static PyObject *__pyx_n_s_asy_bezier_locals_path;
static PyObject *__pyx_n_s_asy_bezier_locals_quadratric;
static PyObject *__pyx_n_s_asy_box;
static PyObject *__pyx_n_s_asy_completely_visible;
static PyObject *__pyx_n_s_asy_number;
static PyObject *__pyx_n_s_asy_regular;
static PyObject *__pyx_n_s_atan2;
static PyObject *__pyx_n_s_atoms;
static PyObject *__pyx_n_s_attributes;
static PyObject *__pyx_n_s_axes;
static PyObject *__pyx_n_s_axes_extra;
static PyObject *__pyx_n_s_axes_style;
static PyObject *__pyx_n_s_axis_ticks;
static PyObject *__pyx_n_s_b;
static PyObject *__pyx_n_s_b1;
static PyObject *__pyx_n_s_b2;
static PyObject *__pyx_n_s_b64encode;
static PyObject *__pyx_n_s_background;
static PyObject *__pyx_n_s_background_color;
static PyObject *__pyx_n_s_base64;
static PyObject *__pyx_n_s_base_height;
static PyObject *__pyx_n_s_base_width;
static PyObject *__pyx_kp_u_begin_asy_usepackage_amsmath_si;
static PyObject *__pyx_n_s_bezier_derivative;
static PyObject *__pyx_n_s_bezier_evaluate;
static PyObject *__pyx_n_s_black;
static PyObject *__pyx_n_s_border;
static PyObject *__pyx_kp_u_box;
static PyObject *__pyx_n_s_box_name;
static PyObject *__pyx_n_s_box_suffix;
static PyObject *__pyx_n_s_boxes_to_tex;
static PyObject *__pyx_n_s_boxes_to_text;
static PyObject *__pyx_n_s_boxes_to_xml;
static PyObject *__pyx_n_s_boxh;
static PyObject *__pyx_n_s_boxw;
static PyObject *__pyx_n_s_brush;
static PyObject *__pyx_n_s_builtin;
static PyObject *__pyx_n_s_builtins;
static PyObject *__pyx_n_s_bx;
static PyObject *__pyx_n_s_by;
static PyObject *__pyx_n_s_c;
static PyObject *__pyx_n_s_c1;
static PyObject *__pyx_n_s_c2;
static PyObject *__pyx_n_s_calc_dimensions;
static PyObject *__pyx_kp_u_cannot_compute_bezier_curve_of_o;
static PyObject *__pyx_kp_u_cannot_convert_from_color_space;
static PyObject *__pyx_n_s_ceil;
static PyObject *__pyx_n_s_chain;
static PyObject *__pyx_n_s_chroma;
static PyObject *__pyx_n_s_cie2000_distance;
static PyObject *__pyx_kp_u_circle_cx;
static PyObject *__pyx_n_s_class;
static PyObject *__pyx_n_s_cline_in_traceback;
static PyObject *__pyx_kp_u_clip;
static PyObject *__pyx_n_s_clone;
static PyObject *__pyx_n_s_close;
static PyObject *__pyx_n_s_closed;
static PyObject *__pyx_n_s_cls;
static PyObject *__pyx_kp_u_cm;
static PyObject *__pyx_kp_u_cm_2;
static PyObject *__pyx_n_s_cmd;
static PyObject *__pyx_n_s_code;
static PyObject *__pyx_n_s_color;
static PyObject *__pyx_kp_u_color_s;
static PyObject *__pyx_n_s_color_space;
static PyObject *__pyx_n_s_color_to_expression;
static PyObject *__pyx_n_s_colors;
static PyObject *__pyx_n_s_colors_orig;
static PyObject *__pyx_n_s_colorspace;
static PyObject *__pyx_n_s_command;
static PyObject *__pyx_n_s_completely_visible_only;
static PyObject *__pyx_n_s_component;
static PyObject *__pyx_n_s_component_distance;
static PyObject *__pyx_n_s_components;
static PyObject *__pyx_n_s_components_sizes;
static PyObject *__pyx_n_s_compute;
static PyObject *__pyx_n_s_connect;
static PyObject *__pyx_n_s_consider_forms;
static PyObject *__pyx_n_s_content;
static PyObject *__pyx_n_s_content_text;
static PyObject *__pyx_kp_u_controls_5g_5g_and_5g_5g_5g_5g;
static PyObject *__pyx_n_s_convert;
static PyObject *__pyx_n_s_convert_color;
static PyObject *__pyx_n_s_converted_color_name;
static PyObject *__pyx_n_s_coords;
static PyObject *__pyx_n_s_copy;
static PyObject *__pyx_n_s_cos;
static PyObject *__pyx_n_s_cp;
static PyObject *__pyx_n_s_cp0;
static PyObject *__pyx_n_s_cp1;
static PyObject *__pyx_n_s_cp2;
static PyObject *__pyx_n_s_cp3;
static PyObject *__pyx_n_s_create;
static PyObject *__pyx_n_s_create_as_style;
static PyObject *__pyx_n_s_create_axes;
static PyObject *__pyx_n_s_create_css;
static PyObject *__pyx_n_s_create_pens;
static PyObject *__pyx_n_s_create_style;
static PyObject *__pyx_n_s_css;
static PyObject *__pyx_n_s_cubic;
static PyObject *__pyx_n_u_currentpen;
static PyObject *__pyx_n_s_curve;
static PyObject *__pyx_n_s_curve_head_name;
static PyObject *__pyx_n_s_curve_points;
static PyObject *__pyx_n_s_custom_arrow;
static PyObject *__pyx_n_s_custom_arrow_2;
static PyObject *__pyx_n_s_cut;
static PyObject *__pyx_n_s_cx;
static PyObject *__pyx_kp_u_cy;
static PyObject *__pyx_n_s_cy_2;
static PyObject *__pyx_kp_u_cycle;
static PyObject *__pyx_kp_u_cycle_2;
static PyObject *__pyx_kp_u_cycle_3;
static PyObject *__pyx_kp_u_cycle_s;
static PyObject *__pyx_n_s_d;
static PyObject *__pyx_n_u_d;
static PyObject *__pyx_n_s_dC;
static PyObject *__pyx_n_s_dH;
static PyObject *__pyx_n_s_dH2;
static PyObject *__pyx_n_s_dL;
static PyObject *__pyx_n_s_da;
static PyObject *__pyx_n_s_data;
static PyObject *__pyx_n_s_data_and_options;
static PyObject *__pyx_n_s_db;
static PyObject *__pyx_n_s_dcp;
static PyObject *__pyx_n_s_decode;
static PyObject *__pyx_n_s_default_arrow;
static PyObject *__pyx_n_s_default_arrow_2;
static PyObject *__pyx_n_s_default_components;
static PyObject *__pyx_n_s_default_size;
static PyObject *__pyx_n_s_default_to_faces;
static PyObject *__pyx_n_s_defined_options;
static PyObject *__pyx_n_s_definitions;
static PyObject *__pyx_n_s_degrees;
static PyObject *__pyx_n_s_dh;
static PyObject *__pyx_n_s_dir;
static PyObject *__pyx_n_s_distance;
static PyObject *__pyx_n_s_distance_function;
static PyObject *__pyx_n_s_distances;
static PyObject *__pyx_n_s_dl;
static PyObject *__pyx_kp_s_dl_dt_AbsoluteThickness_p_dd_se;
static PyObject *__pyx_kp_s_dl_dt_Arrow_p1_p2_dd_represents;
static PyObject *__pyx_kp_s_dl_dt_Arrowheads_s_dd_specifies;
static PyObject *__pyx_kp_s_dl_dt_Automatic_dd_is_used_to_s;
static PyObject *__pyx_kp_s_dl_dt_BezierCurve_p1_p2_dd_repr;
static PyObject *__pyx_kp_s_dl_dt_Blend_c1_c2_dd_represents;
static PyObject *__pyx_kp_s_dl_dt_CMYKColor_c_m_y_k_dd_repr;
static PyObject *__pyx_kp_s_dl_dt_Circle_cx_cy_r_dd_draws_a;
static PyObject *__pyx_kp_s_dl_dt_ColorDistance_c1_c2_dd_re;
static PyObject *__pyx_kp_s_dl_dt_Darker_c_f_dd_is_equivale;
static PyObject *__pyx_kp_s_dl_dt_Disk_cx_cy_r_dd_fills_a_c;
static PyObject *__pyx_kp_s_dl_dt_FilledCurve_segment1_segm;
static PyObject *__pyx_kp_s_dl_dt_FontColor_dd_is_an_option;
static PyObject *__pyx_kp_s_dl_dt_Graphics_primitives_optio;
static PyObject *__pyx_kp_s_dl_dt_GrayLevel_g_dd_represents;
static PyObject *__pyx_kp_s_dl_dt_Hue_h_s_l_a_dd_represents;
static PyObject *__pyx_kp_s_dl_dt_ImageSize_Large_dd_produc;
static PyObject *__pyx_kp_s_dl_dt_ImageSize_Medium_dd_produ;
static PyObject *__pyx_kp_s_dl_dt_ImageSize_Small_dd_produc;
static PyObject *__pyx_kp_s_dl_dt_ImageSize_Tiny_dd_produce;
static PyObject *__pyx_kp_s_dl_dt_LABColor_l_a_b_dd_represe;
static PyObject *__pyx_kp_s_dl_dt_LCHColor_l_c_h_dd_represe;
static PyObject *__pyx_kp_s_dl_dt_LCHColor_l_u_v_dd_represe;
static PyObject *__pyx_kp_s_dl_dt_Lighter_c_f_dd_is_equival;
static PyObject *__pyx_kp_s_dl_dt_Line_point_1_point_2_dd_r;
static PyObject *__pyx_kp_s_dl_dt_PointSize_t_dd_sets_the_d;
static PyObject *__pyx_kp_s_dl_dt_Point_point_1_point_2_dd;
static PyObject *__pyx_kp_s_dl_dt_Polygon_point_1_point_2_d;
static PyObject *__pyx_kp_s_dl_dt_RGBColor_r_g_b_dd_represe;
static PyObject *__pyx_kp_s_dl_dt_Rectangle_xmin_ymin_dd_re;
static PyObject *__pyx_kp_s_dl_dt_RegularPolygon_n_dd_gives;
static PyObject *__pyx_kp_s_dl_dt_Show_graphics_options_dd;
static PyObject *__pyx_kp_s_dl_dt_Text_text_x_y_dd_draws_te;
static PyObject *__pyx_kp_s_dl_dt_Thick_dd_sets_the_line_wi;
static PyObject *__pyx_kp_s_dl_dt_Thickness_t_dd_sets_the_l;
static PyObject *__pyx_kp_s_dl_dt_Thin_dd_sets_the_line_wid;
static PyObject *__pyx_kp_s_dl_dt_XYZColor_x_y_z_dd_represe;
static PyObject *__pyx_kp_u_dl_dt_name_s_dd_represents_the;
static PyObject *__pyx_n_s_do_blend;
static PyObject *__pyx_n_s_do_init;
static PyObject *__pyx_n_s_doc;
static PyObject *__pyx_n_s_doc_2;
static PyObject *__pyx_kp_u_dot;
static PyObject *__pyx_n_s_draw;
static PyObject *__pyx_n_u_draw;
static PyObject *__pyx_kp_u_draw_2;
static PyObject *__pyx_n_s_draw_3;
static PyObject *__pyx_n_s_dumps;
static PyObject *__pyx_n_s_dx;
static PyObject *__pyx_n_s_dy;
static PyObject *__pyx_n_s_e;
static PyObject *__pyx_n_s_edge;
static PyObject *__pyx_n_s_edge_color;
static PyObject *__pyx_n_s_edge_style;
static PyObject *__pyx_n_s_edges;
static PyObject *__pyx_n_s_element;
static PyObject *__pyx_n_s_element_class;
static PyObject *__pyx_n_s_element_heads;
static PyObject *__pyx_n_s_elements;
static PyObject *__pyx_kp_u_ellipse;
static PyObject *__pyx_kp_u_ellipse_cx;
static PyObject *__pyx_n_s_end_angle;
static PyObject *__pyx_kp_u_end_asy;
static PyObject *__pyx_n_s_enumerate;
static PyObject *__pyx_n_s_euclidean_distance;
static PyObject *__pyx_n_s_euclidean_distance_locals_genex;
static PyObject *__pyx_n_s_evaluate;
static PyObject *__pyx_n_s_evaluation;
static PyObject *__pyx_n_u_evaluation;
static PyObject *__pyx_n_s_ex;
static PyObject *__pyx_n_s_exmax;
static PyObject *__pyx_n_s_exmin;
static PyObject *__pyx_n_s_exp;
static PyObject *__pyx_n_s_expr;
static PyObject *__pyx_n_s_expression;
static PyObject *__pyx_n_s_expression_to_color;
static PyObject *__pyx_n_s_ext;
static PyObject *__pyx_n_s_extend;
static PyObject *__pyx_n_s_extent;
static PyObject *__pyx_n_s_extent_height;
static PyObject *__pyx_n_s_extent_width;
static PyObject *__pyx_n_s_extents;
static PyObject *__pyx_n_s_extract_graphics;
static PyObject *__pyx_n_s_extract_graphics_locals_genexpr;
static PyObject *__pyx_n_s_ey;
static PyObject *__pyx_n_s_eymax;
static PyObject *__pyx_n_s_eymin;
static PyObject *__pyx_n_s_f;
static PyObject *__pyx_n_u_f;
static PyObject *__pyx_kp_u_f_2;
static PyObject *__pyx_kp_u_f_f;
static PyObject *__pyx_n_s_face;
static PyObject *__pyx_n_s_face_color;
static PyObject *__pyx_n_s_face_element;
static PyObject *__pyx_n_s_face_style;
static PyObject *__pyx_kp_u_fill;
static PyObject *__pyx_kp_u_fill_none;
static PyObject *__pyx_kp_u_fill_opacity_s;
static PyObject *__pyx_kp_u_fill_rule_evenodd;
static PyObject *__pyx_kp_u_fill_s;
static PyObject *__pyx_kp_u_filldraw;
static PyObject *__pyx_n_u_filldraw_2;
static PyObject *__pyx_kp_u_filldraw_3;
static PyObject *__pyx_n_s_final_pass;
static PyObject *__pyx_n_s_flatten;
static PyObject *__pyx_n_s_flatten_2;
static PyObject *__pyx_n_s_flattened;
static PyObject *__pyx_n_s_floor;
static PyObject *__pyx_n_s_font_color;
static PyObject *__pyx_kp_u_foreignObject_x;
static PyObject *__pyx_n_s_format;
static PyObject *__pyx_n_s_format_transform;
static PyObject *__pyx_n_s_formats;
static PyObject *__pyx_n_s_forms;
static PyObject *__pyx_n_s_frac;
static PyObject *__pyx_n_s_from_python;
static PyObject *__pyx_kp_u_g;
static PyObject *__pyx_kp_u_g_2;
static PyObject *__pyx_kp_u_g_transform;
static PyObject *__pyx_n_s_genexpr;
static PyObject *__pyx_n_s_get;
static PyObject *__pyx_n_s_get_atoms;
static PyObject *__pyx_n_s_get_class;
static PyObject *__pyx_n_s_get_default_edge_color;
static PyObject *__pyx_n_s_get_default_face_color;
static PyObject *__pyx_n_s_get_head_name;
static PyObject *__pyx_n_s_get_image_size;
static PyObject *__pyx_n_s_get_int_value;
static PyObject *__pyx_n_s_get_line_width;
static PyObject *__pyx_n_s_get_name;
static PyObject *__pyx_n_s_get_option;
static PyObject *__pyx_n_s_get_option_values;
static PyObject *__pyx_n_s_get_options;
static PyObject *__pyx_n_s_get_range;
static PyObject *__pyx_n_s_get_sequence;
static PyObject *__pyx_n_s_get_size;
static PyObject *__pyx_n_s_get_string_value;
static PyObject *__pyx_n_s_get_style;
static PyObject *__pyx_n_s_get_style_class;
static PyObject *__pyx_n_s_get_thickness;
static PyObject *__pyx_kp_u_gouraudshade;
static PyObject *__pyx_n_s_graphics;
static PyObject *__pyx_n_s_graphics_box;
static PyObject *__pyx_n_s_graphics_options;
static PyObject *__pyx_n_s_h;
static PyObject *__pyx_n_s_h1;
static PyObject *__pyx_n_s_h2;
static PyObject *__pyx_n_s_has_form;
static PyObject *__pyx_n_s_head;
static PyObject *__pyx_n_s_head_name;
static PyObject *__pyx_n_s_head_points;
static PyObject *__pyx_n_s_heads;
static PyObject *__pyx_kp_u_height;
static PyObject *__pyx_n_s_height_2;
static PyObject *__pyx_n_s_homogenous;
static PyObject *__pyx_n_s_hsl_to_rgba;
static PyObject *__pyx_n_s_hx;
static PyObject *__pyx_n_s_hy;
static PyObject *__pyx_n_s_i;
static PyObject *__pyx_n_s_image_size;
static PyObject *__pyx_n_s_image_size_multipliers;
static PyObject *__pyx_n_u_image_size_multipliers;
static PyObject *__pyx_n_s_import;
static PyObject *__pyx_n_s_include_heads;
static PyObject *__pyx_n_s_index;
static PyObject *__pyx_n_s_init;
static PyObject *__pyx_n_s_init_2;
static PyObject *__pyx_n_s_inside_list;
static PyObject *__pyx_n_u_inside_list;
static PyObject *__pyx_n_s_inside_row;
static PyObject *__pyx_n_u_inside_row;
static PyObject *__pyx_n_u_invarg;
static PyObject *__pyx_n_u_invdist;
static PyObject *__pyx_n_s_is_completely_visible;
static PyObject *__pyx_n_s_is_face_element;
static PyObject *__pyx_n_s_is_numeric;
static PyObject *__pyx_n_s_is_true;
static PyObject *__pyx_n_s_item;
static PyObject *__pyx_n_s_items;
static PyObject *__pyx_n_s_itertools;
static PyObject *__pyx_n_s_json;
static PyObject *__pyx_n_s_k;
static PyObject *__pyx_n_s_kC;
static PyObject *__pyx_n_s_kH;
static PyObject *__pyx_n_s_kL;
static PyObject *__pyx_n_s_key;
static PyObject *__pyx_n_s_keys;
static PyObject *__pyx_n_s_klass;
static PyObject *__pyx_n_s_kwargs;
static PyObject *__pyx_n_s_l;
static PyObject *__pyx_n_s_lab1;
static PyObject *__pyx_n_s_lab2;
static PyObject *__pyx_kp_u_label;
static PyObject *__pyx_n_s_label_style;
static PyObject *__pyx_n_s_large_arc;
static PyObject *__pyx_n_s_leaf;
static PyObject *__pyx_n_s_leaf_name;
static PyObject *__pyx_n_s_leaves;
static PyObject *__pyx_n_s_length;
static PyObject *__pyx_kp_u_light_red;
static PyObject *__pyx_n_s_lightness;
static PyObject *__pyx_n_s_line;
static PyObject *__pyx_n_s_line_colors;
static PyObject *__pyx_n_s_line_index;
static PyObject *__pyx_n_s_linear;
static PyObject *__pyx_n_s_lines;
static PyObject *__pyx_kp_u_linewidth_s;
static PyObject *__pyx_n_s_log10;
static PyObject *__pyx_n_s_lower;
static PyObject *__pyx_n_s_machine_epsilon;
static PyObject *__pyx_n_s_main;
static PyObject *__pyx_n_s_make;
static PyObject *__pyx_n_s_make_draw_asy;
static PyObject *__pyx_n_s_make_draw_svg;
static PyObject *__pyx_n_s_map;
static PyObject *__pyx_kp_u_math;
static PyObject *__pyx_n_s_math_2;
static PyObject *__pyx_kp_u_math_foreignObject;
static PyObject *__pyx_n_s_mathics_builtin_base;
static PyObject *__pyx_n_s_mathics_builtin_colors;
static PyObject *__pyx_n_s_mathics_builtin_graphics;
static PyObject *__pyx_n_s_mathics_builtin_graphics3d;
static PyObject *__pyx_kp_s_mathics_builtin_graphics_py;
static PyObject *__pyx_n_s_mathics_builtin_options;
static PyObject *__pyx_n_s_mathics_core_expression;
static PyObject *__pyx_n_s_mathics_core_numbers;
static PyObject *__pyx_kp_u_matrix;
static PyObject *__pyx_n_s_matrix_2;
static PyObject *__pyx_n_s_max;
static PyObject *__pyx_n_s_max_degree;
static PyObject *__pyx_n_s_max_width;
static PyObject *__pyx_n_s_mesh;
static PyObject *__pyx_kp_u_meshgradient_data_s;
static PyObject *__pyx_n_s_message;
static PyObject *__pyx_n_s_messages;
static PyObject *__pyx_n_s_metaclass;
static PyObject *__pyx_kp_u_mglyph_width;
static PyObject *__pyx_n_s_min;
static PyObject *__pyx_n_s_module;
static PyObject *__pyx_n_s_mt;
static PyObject *__pyx_n_s_mt2;
static PyObject *__pyx_n_s_mt3;
static PyObject *__pyx_n_s_multi;
static PyObject *__pyx_n_s_multi_parts;
static PyObject *__pyx_n_s_n;
static PyObject *__pyx_n_s_n_leaves;
static PyObject *__pyx_n_s_name;
static PyObject *__pyx_n_u_name;
static PyObject *__pyx_n_s_name_2;
static PyObject *__pyx_n_s_name_head;
static PyObject *__pyx_kp_u_name_s_x_List;
static PyObject *__pyx_kp_u_name_s_x___NumericQ_0_1;
static PyObject *__pyx_n_s_neg_y;
static PyObject *__pyx_kp_u_new_int;
static PyObject *__pyx_n_s_new_item;
static PyObject *__pyx_n_s_new_leaf;
static PyObject *__pyx_n_s_new_leaves;
static PyObject *__pyx_kp_u_new_pen;
static PyObject *__pyx_n_s_new_style;
static PyObject *__pyx_n_s_norm;
static PyObject *__pyx_n_s_np;
static PyObject *__pyx_n_u_nullpen;
static PyObject *__pyx_n_s_numpy;
static PyObject *__pyx_n_s_object;
static PyObject *__pyx_n_s_opacity;
static PyObject *__pyx_kp_u_opacity_s;
static PyObject *__pyx_n_s_opos;
static PyObject *__pyx_n_s_option;
static PyObject *__pyx_n_s_options;
static PyObject *__pyx_n_s_options_set;
static PyObject *__pyx_n_s_options_to_rules;
static PyObject *__pyx_n_s_origin_k_x;
static PyObject *__pyx_n_s_origin_x;
static PyObject *__pyx_n_s_origin_y;
static PyObject *__pyx_n_s_ox;
static PyObject *__pyx_kp_u_ox_2;
static PyObject *__pyx_n_s_oy;
static PyObject *__pyx_kp_u_oy_2;
static PyObject *__pyx_n_s_p;
static PyObject *__pyx_n_s_p0;
static PyObject *__pyx_n_s_p1;
static PyObject *__pyx_n_s_p2;
static PyObject *__pyx_n_s_p3;
static PyObject *__pyx_n_s_p_origin;
static PyObject *__pyx_n_s_p_other0;
static PyObject *__pyx_n_s_p_self0;
static PyObject *__pyx_n_s_parse_component;
static PyObject *__pyx_n_s_part;
static PyObject *__pyx_n_s_parts;
static PyObject *__pyx_n_s_path;
static PyObject *__pyx_kp_u_path_d;
static PyObject *__pyx_n_s_paths;
static PyObject *__pyx_n_s_pen;
static PyObject *__pyx_n_s_pens;
static PyObject *__pyx_n_s_phi;
static PyObject *__pyx_n_s_phi0;
static PyObject *__pyx_n_s_pi;
static PyObject *__pyx_n_s_pi2;
static PyObject *__pyx_n_s_pixel_height;
static PyObject *__pyx_n_s_pixel_width;
static PyObject *__pyx_n_s_plot_range;
static PyObject *__pyx_n_s_point;
static PyObject *__pyx_n_s_point_size;
static PyObject *__pyx_n_s_points;
static PyObject *__pyx_n_s_polygon;
static PyObject *__pyx_kp_u_polygon_points;
static PyObject *__pyx_n_s_polyline;
static PyObject *__pyx_kp_u_polyline_points;
static PyObject *__pyx_n_s_pop;
static PyObject *__pyx_n_s_pos;
static PyObject *__pyx_n_s_pre;
static PyObject *__pyx_n_s_prepare;
static PyObject *__pyx_n_s_prepare_elements;
static PyObject *__pyx_n_s_process_option;
static PyObject *__pyx_n_s_px;
static PyObject *__pyx_kp_u_px_height;
static PyObject *__pyx_kp_u_px_src_data_image_svg_xml_base64;
static PyObject *__pyx_n_s_py;
static PyObject *__pyx_n_s_py_a;
static PyObject *__pyx_n_s_py_b;
static PyObject *__pyx_n_s_py_name;
static PyObject *__pyx_n_s_q;
static PyObject *__pyx_n_s_qp0;
static PyObject *__pyx_n_s_qp0x;
static PyObject *__pyx_n_s_qp0y;
static PyObject *__pyx_n_s_qp1;
static PyObject *__pyx_n_s_qp1x;
static PyObject *__pyx_n_s_qp1y;
static PyObject *__pyx_n_s_qp2;
static PyObject *__pyx_n_s_qp2x;
static PyObject *__pyx_n_s_qp2y;
static PyObject *__pyx_n_s_quadratric;
static PyObject *__pyx_n_s_qualname;
static PyObject *__pyx_n_s_qx;
static PyObject *__pyx_n_s_qy;
static PyObject *__pyx_n_s_r;
static PyObject *__pyx_n_s_rT;
static PyObject *__pyx_kp_u_r_2;
static PyObject *__pyx_n_s_radians;
static PyObject *__pyx_n_s_range;
static PyObject *__pyx_kp_u_rect_x;
static PyObject *__pyx_n_s_restructure;
static PyObject *__pyx_n_s_result;
static PyObject *__pyx_n_s_reversed;
static PyObject *__pyx_kp_u_rgb;
static PyObject *__pyx_n_s_rgb_2;
static PyObject *__pyx_n_s_rgba;
static PyObject *__pyx_n_s_rotate;
static PyObject *__pyx_kp_u_rotate_f;
static PyObject *__pyx_n_s_round_step;
static PyObject *__pyx_n_s_round_to_float;
static PyObject *__pyx_n_s_round_to_zero;
static PyObject *__pyx_n_s_rspec;
static PyObject *__pyx_n_s_rules;
static PyObject *__pyx_kp_u_rx;
static PyObject *__pyx_n_s_rx_2;
static PyObject *__pyx_kp_u_ry;
static PyObject *__pyx_n_s_ry_2;
static PyObject *__pyx_n_s_s;
static PyObject *__pyx_n_s_s1;
static PyObject *__pyx_n_s_s2;
static PyObject *__pyx_kp_u_s_2;
static PyObject *__pyx_kp_u_s_s_s_s;
static PyObject *__pyx_kp_u_scale;
static PyObject *__pyx_n_s_scale_2;
static PyObject *__pyx_n_s_seg;
static PyObject *__pyx_n_s_segment;
static PyObject *__pyx_n_s_segments;
static PyObject *__pyx_n_s_self;
static PyObject *__pyx_n_s_send;
static PyObject *__pyx_n_s_set_option;
static PyObject *__pyx_n_s_set_size;
static PyObject *__pyx_n_s_setback;
static PyObject *__pyx_n_s_setback_spec;
static PyObject *__pyx_n_s_shape;
static PyObject *__pyx_kp_u_shift;
static PyObject *__pyx_n_s_shift_2;
static PyObject *__pyx_n_s_shrink;
static PyObject *__pyx_n_s_shrink_one_end;
static PyObject *__pyx_n_s_sin;
static PyObject *__pyx_n_s_size;
static PyObject *__pyx_n_s_size_aspect;
static PyObject *__pyx_n_s_size_multiplier;
static PyObject *__pyx_n_s_size_spec;
static PyObject *__pyx_n_s_sorted;
static PyObject *__pyx_n_s_spec;
static PyObject *__pyx_n_s_specs;
static PyObject *__pyx_n_s_spline_degree;
static PyObject *__pyx_n_s_sqrt;
static PyObject *__pyx_n_s_start_angle;
static PyObject *__pyx_n_s_start_k_x;
static PyObject *__pyx_n_s_start_k_x_small;
static PyObject *__pyx_n_s_staticmethod;
static PyObject *__pyx_n_s_step_x;
static PyObject *__pyx_n_s_step_x_small;
static PyObject *__pyx_n_s_steps_x;
static PyObject *__pyx_n_s_steps_x_small;
static PyObject *__pyx_n_s_strip_context;
static PyObject *__pyx_kp_u_stroke_none;
static PyObject *__pyx_kp_u_stroke_opacity_s;
static PyObject *__pyx_kp_u_stroke_s;
static PyObject *__pyx_n_s_stroke_width;
static PyObject *__pyx_kp_u_stroke_width_fpx;
static PyObject *__pyx_n_s_style;
static PyObject *__pyx_kp_u_style_2;
static PyObject *__pyx_n_s_style_3;
static PyObject *__pyx_n_s_style_and_form_heads;
static PyObject *__pyx_n_s_style_class;
static PyObject *__pyx_kp_u_style_fill;
static PyObject *__pyx_n_s_style_heads;
static PyObject *__pyx_n_s_style_options;
static PyObject *__pyx_kp_u_style_s;
static PyObject *__pyx_n_s_stylebox_style;
static PyObject *__pyx_n_s_styles;
static PyObject *__pyx_n_s_sub_steps;
static PyObject *__pyx_n_s_sub_x;
static PyObject *__pyx_n_s_sum;
static PyObject *__pyx_n_s_super;
static PyObject *__pyx_n_s_svg;
static PyObject *__pyx_n_u_svg;
static PyObject *__pyx_kp_u_svg_2;
static PyObject *__pyx_n_s_svg_bezier;
static PyObject *__pyx_n_s_svg_bezier_locals_path;
static PyObject *__pyx_n_s_svg_bezier_locals_path_locals_g;
static PyObject *__pyx_n_s_svg_xml;
static PyObject *__pyx_kp_u_svg_xmlns_svg_http_www_w3_org_2;
static PyObject *__pyx_n_s_sx;
static PyObject *__pyx_n_s_sy;
static PyObject *__pyx_n_s_symbolic_sizes;
static PyObject *__pyx_n_s_system_symbols;
static PyObject *__pyx_n_s_system_symbols_dict;
static PyObject *__pyx_n_s_t;
static PyObject *__pyx_n_s_t0;
static PyObject *__pyx_n_s_t1;
static PyObject *__pyx_n_s_t2;
static PyObject *__pyx_n_s_t3;
static PyObject *__pyx_n_s_te;
static PyObject *__pyx_n_s_template;
static PyObject *__pyx_n_s_test;
static PyObject *__pyx_n_s_tex;
static PyObject *__pyx_n_s_text_name;
static PyObject *__pyx_n_u_text_name;
static PyObject *__pyx_n_s_throw;
static PyObject *__pyx_n_s_tick_label_d;
static PyObject *__pyx_n_s_tick_label_style;
static PyObject *__pyx_n_s_tick_large_size;
static PyObject *__pyx_n_s_tick_small_size;
static PyObject *__pyx_n_s_ticks;
static PyObject *__pyx_n_s_ticks_int;
static PyObject *__pyx_n_s_ticks_lines;
static PyObject *__pyx_n_s_ticks_small;
static PyObject *__pyx_n_s_ticks_style;
static PyObject *__pyx_n_s_ticks_x;
static PyObject *__pyx_n_s_ticks_x_int;
static PyObject *__pyx_n_s_ticks_x_small;
static PyObject *__pyx_n_s_ticks_y;
static PyObject *__pyx_n_s_ticks_y_int;
static PyObject *__pyx_n_s_ticks_y_small;
static PyObject *__pyx_n_s_tl;
static PyObject *__pyx_kp_u_to;
static PyObject *__pyx_n_s_to_asy;
static PyObject *__pyx_n_s_to_color_space;
static PyObject *__pyx_n_s_to_css;
static PyObject *__pyx_n_s_to_expr;
static PyObject *__pyx_n_s_to_float;
static PyObject *__pyx_n_s_to_js;
static PyObject *__pyx_n_s_to_python;
static PyObject *__pyx_n_s_to_rgba;
static PyObject *__pyx_n_s_to_svg;
static PyObject *__pyx_n_s_total;
static PyObject *__pyx_n_s_total_extent;
static PyObject *__pyx_n_s_trans;
static PyObject *__pyx_n_s_transform;
static PyObject *__pyx_n_s_transformed;
static PyObject *__pyx_n_s_transformed_points;
static PyObject *__pyx_n_s_transforms;
static PyObject *__pyx_n_s_translate;
static PyObject *__pyx_kp_u_translate_2;
static PyObject *__pyx_n_s_translate_absolute;
static PyObject *__pyx_n_s_translate_relative;
static PyObject *__pyx_n_s_ts;
static PyObject *__pyx_n_s_tx;
static PyObject *__pyx_n_s_ty;
static PyObject *__pyx_n_s_type;
static PyObject *__pyx_n_s_u;
static PyObject *__pyx_n_s_union;
static PyObject *__pyx_n_s_update;
static PyObject *__pyx_n_s_use_list;
static PyObject *__pyx_n_u_utf8;
static PyObject *__pyx_n_s_val;
static PyObject *__pyx_n_s_value;
static PyObject *__pyx_n_s_values;
static PyObject *__pyx_n_s_vertex_colors;
static PyObject *__pyx_n_s_vertices;
static PyObject *__pyx_n_s_view_width;
static PyObject *__pyx_n_s_vx;
static PyObject *__pyx_n_s_vy;
static PyObject *__pyx_n_s_w;
static PyObject *__pyx_kp_u_width;
static PyObject *__pyx_n_s_width_2;
static PyObject *__pyx_n_s_x;
static PyObject *__pyx_n_s_x0;
static PyObject *__pyx_n_s_x1;
static PyObject *__pyx_n_s_x2;
static PyObject *__pyx_n_s_xmax;
static PyObject *__pyx_n_s_xmin;
static PyObject *__pyx_n_s_xy;
static PyObject *__pyx_n_s_y;
static PyObject *__pyx_n_s_y1;
static PyObject *__pyx_n_s_y2;
static PyObject *__pyx_kp_u_y_2;
static PyObject *__pyx_n_s_ymax;
static PyObject *__pyx_n_s_ymin;
static PyObject *__pyx_n_s_zip;
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_get_class(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_2coords(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_6Coords___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_graphics, PyObject *__pyx_v_expr, PyObject *__pyx_v_pos, PyObject *__pyx_v_d); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_6Coords_2pos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_6Coords_4add(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_4cut(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_6create_css(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_edge_color, PyObject *__pyx_v_face_color, PyObject *__pyx_v_stroke_width, PyObject *__pyx_v_font_color); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_8asy_number(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_10_to_float(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_12create_pens(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_edge_color, PyObject *__pyx_v_face_color, PyObject *__pyx_v_stroke_width, PyObject *__pyx_v_is_face_element); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_14_data_and_options(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_leaves, PyObject *__pyx_v_defined_options); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_19_euclidean_distance_genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_16_euclidean_distance(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_a, PyObject *__pyx_v_b); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_18_component_distance(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_i); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_20_cie2000_distance(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_lab1, PyObject *__pyx_v_lab2); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_22_CMC_distance(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_lab1, PyObject *__pyx_v_lab2, PyObject *__pyx_v_l, PyObject *__pyx_v_c); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_17_extract_graphics_genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_24_extract_graphics(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_graphics, PyObject *__pyx_v_format, PyObject *__pyx_v_evaluation); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_13_SVGTransform___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_13_SVGTransform_2matrix(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e, PyObject *__pyx_v_f); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_13_SVGTransform_4translate(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_13_SVGTransform_6scale(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_13_SVGTransform_8rotate(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_13_SVGTransform_10apply(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_svg); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_13_ASYTransform___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_13_ASYTransform_2matrix(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e, PyObject *__pyx_v_f); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_13_ASYTransform_4translate(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_13_ASYTransform_6scale(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_13_ASYTransform_8rotate(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_13_ASYTransform_10apply(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_asy); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_4Show_apply(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_graphics, PyObject *__pyx_v_evaluation, PyObject *__pyx_v_options); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_8Graphics_15apply_makeboxes_7convert_genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_8Graphics_15apply_makeboxes_7convert_3genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_8Graphics_15apply_makeboxes_convert(PyObject *__pyx_self, PyObject *__pyx_v_content); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_8Graphics_apply_makeboxes(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_content, PyObject *__pyx_v_evaluation, PyObject *__pyx_v_options); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_16_GraphicsElement_init(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_graphics, PyObject *__pyx_v_item, PyObject *__pyx_v_style); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_16_GraphicsElement_2create_as_style(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_klass, PyObject *__pyx_v_graphics, PyObject *__pyx_v_item); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_6_Color_init(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_components); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_6_Color_2create(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_expr); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_6_Color_4create_as_style(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_klass, CYTHON_UNUSED PyObject *__pyx_v_graphics, PyObject *__pyx_v_item); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_6_Color_6to_css(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_6_Color_8to_asy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_6_Color_10to_js(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_6_Color_12to_expr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_6_Color_14to_rgba(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_6_Color_16to_color_space(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_color_space); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_8RGBColor_to_rgba(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_3Hue_11hsl_to_rgba_map(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_3Hue_11hsl_to_rgba_2trans(PyObject *__pyx_self, PyObject *__pyx_v_t); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_3Hue_hsl_to_rgba(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_26expression_to_color(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_color); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_28color_to_expression(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_components, PyObject *__pyx_v_colorspace); /* proto */
static PyObject *__pyx_lambda_funcdef_7mathics_7builtin_8graphics_13ColorDistance_lambda4(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_c1, PyObject *__pyx_v_c2); /* proto */
static PyObject *__pyx_lambda_funcdef_7mathics_7builtin_8graphics_13ColorDistance_lambda5(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_c1, PyObject *__pyx_v_c2); /* proto */
static PyObject *__pyx_lambda_funcdef_7mathics_7builtin_8graphics_13ColorDistance_lambda6(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_c1, PyObject *__pyx_v_c2); /* proto */
static PyObject *__pyx_lambda_funcdef_7mathics_7builtin_8graphics_13ColorDistance_lambda7(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_c1, PyObject *__pyx_v_c2); /* proto */
static PyObject *__pyx_lambda_funcdef_7mathics_7builtin_8graphics_13ColorDistance_lambda8(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_c1, PyObject *__pyx_v_c2); /* proto */
static PyObject *__pyx_lambda_funcdef_7mathics_7builtin_8graphics_13ColorDistance_lambda9(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_c1, PyObject *__pyx_v_c2); /* proto */
static PyObject *__pyx_lambda_funcdef_7mathics_7builtin_8graphics_13ColorDistance_lambda10(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_c1, PyObject *__pyx_v_c2); /* proto */
static PyObject *__pyx_lambda_funcdef_7mathics_7builtin_8graphics_13ColorDistance_lambda11(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_c1, PyObject *__pyx_v_c2); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_13ColorDistance_5apply_compute(PyObject *__pyx_self, PyObject *__pyx_v_a, PyObject *__pyx_v_b); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_13ColorDistance_5apply_2distance(PyObject *__pyx_self, PyObject *__pyx_v_a, PyObject *__pyx_v_b); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda12(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_c1, PyObject *__pyx_v_c2); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda13(PyObject *__pyx_self, PyObject *__pyx_v_c1, PyObject *__pyx_v_c2); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_13ColorDistance_apply(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_c1, PyObject *__pyx_v_c2, PyObject *__pyx_v_evaluation, PyObject *__pyx_v_options); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_5_Size_init(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_graphics, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_17AbsoluteThickness_get_thickness(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_9Thickness_get_thickness(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_9PointSize_get_size(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_12RectangleBox_init(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_graphics, PyObject *__pyx_v_style, PyObject *__pyx_v_item); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_12RectangleBox_2extent(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_12RectangleBox_4to_svg(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_12RectangleBox_6to_asy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_9_RoundBox_init(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_graphics, PyObject *__pyx_v_style, PyObject *__pyx_v_item); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_9_RoundBox_2extent(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_9_RoundBox_4to_svg(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_9_RoundBox_6to_asy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_7_ArcBox_init(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_graphics, PyObject *__pyx_v_style, PyObject *__pyx_v_item); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_7_ArcBox_2_arc_params(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_7_ArcBox_6to_svg_path(PyObject *__pyx_self, PyObject *__pyx_v_closed); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_7_ArcBox_4to_svg(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_7_ArcBox_6to_asy_4path_genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_7_ArcBox_6to_asy_4path_3genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_7_ArcBox_6to_asy_path(PyObject *__pyx_self, PyObject *__pyx_v_closed); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_7_ArcBox_6to_asy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_9_Polyline_7do_init_genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_9_Polyline_do_init(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_graphics, PyObject *__pyx_v_points); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_9_Polyline_2extent(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_8PointBox_4init_genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_8PointBox_init(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_graphics, PyObject *__pyx_v_style, PyObject *__pyx_v_item); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_8PointBox_2to_svg(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_8PointBox_4to_asy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_7LineBox_init(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_graphics, PyObject *__pyx_v_style, PyObject *__pyx_v_item, PyObject *__pyx_v_lines); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_7LineBox_2to_svg(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_7LineBox_4to_asy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_30_svg_bezier(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_segments); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_11_svg_bezier_4path_genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_11_svg_bezier_path(PyObject *__pyx_self, PyObject *__pyx_v_max_degree, PyObject *__pyx_v_p); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_33_asy_bezier(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_segments); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_11_asy_bezier_cubic(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_p0, PyObject *__pyx_v_p1, PyObject *__pyx_v_p2, PyObject *__pyx_v_p3); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_11_asy_bezier_2quadratric(PyObject *__pyx_self, PyObject *__pyx_v_qp0, PyObject *__pyx_v_qp1, PyObject *__pyx_v_qp2); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_11_asy_bezier_4linear(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_p0, PyObject *__pyx_v_p1); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_11_asy_bezier_6path(PyObject *__pyx_self, PyObject *__pyx_v_max_degree, PyObject *__pyx_v_p); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_14BezierCurveBox_init(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_graphics, PyObject *__pyx_v_style, PyObject *__pyx_v_item, PyObject *__pyx_v_options); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_14BezierCurveBox_2to_svg(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_14BezierCurveBox_4to_asy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_14FilledCurveBox_4init_parse_component(PyObject *__pyx_self, PyObject *__pyx_v_segments); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_14FilledCurveBox_4init_3genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_14FilledCurveBox_init(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_graphics, PyObject *__pyx_v_style, PyObject *__pyx_v_item); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_14FilledCurveBox_6to_svg_components(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_14FilledCurveBox_2to_svg(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_14FilledCurveBox_6to_asy_components(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_14FilledCurveBox_4to_asy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_14FilledCurveBox_6extent(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_10PolygonBox_init(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_graphics, PyObject *__pyx_v_style, PyObject *__pyx_v_item); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_10PolygonBox_2process_option(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_10PolygonBox_6to_svg_genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_10PolygonBox_4to_svg(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_10PolygonBox_6to_asy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_17RegularPolygonBox_4init_vertices(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_17RegularPolygonBox_4init_3genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_17RegularPolygonBox_init(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_graphics, PyObject *__pyx_v_style, PyObject *__pyx_v_item); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_10Arrowheads_init(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_graphics, PyObject *__pyx_v_item); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_10Arrowheads_2_arrow_size(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_s, PyObject *__pyx_v_extent); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_10Arrowheads_5heads_genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_10Arrowheads_4heads(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_extent, PyObject *__pyx_v_default_arrow, PyObject *__pyx_v_custom_arrow); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_36_norm(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_p, PyObject *__pyx_v_q); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_5_Line_13make_draw_svg_4draw_genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_5_Line_13make_draw_svg_draw(PyObject *__pyx_self, PyObject *__pyx_v_points); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_5_Line_make_draw_svg(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_style); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_5_Line_13make_draw_asy_draw(PyObject *__pyx_self, PyObject *__pyx_v_points); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_5_Line_2make_draw_asy(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_pen); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_5_Line_6arrows_3genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_5_Line_6arrows_6genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_5_Line_4arrows(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_points, PyObject *__pyx_v_heads); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_5_Line_6arrows_segments(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_points); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_38_bezier_derivative(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_p); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_40_bezier_evaluate(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_p, PyObject *__pyx_v_t); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_12_BezierCurve___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_spline_degree); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_12_BezierCurve_13make_draw_svg_draw(PyObject *__pyx_self, PyObject *__pyx_v_points); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_12_BezierCurve_2make_draw_svg(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_style); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_12_BezierCurve_13make_draw_asy_draw(PyObject *__pyx_self, PyObject *__pyx_v_points); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_12_BezierCurve_4make_draw_asy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_pen); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_12_BezierCurve_6arrows(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_points, PyObject *__pyx_v_heads); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_8ArrowBox_init(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_graphics, PyObject *__pyx_v_style, PyObject *__pyx_v_item); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_8ArrowBox_13_setback_spec_genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_8ArrowBox_2_setback_spec(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_expr); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_8ArrowBox_14_default_arrow_draw(PyObject *__pyx_self, PyObject *__pyx_v_px, PyObject *__pyx_v_py, PyObject *__pyx_v_vx, PyObject *__pyx_v_vy, PyObject *__pyx_v_t1, PyObject *__pyx_v_s); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_8ArrowBox_4_default_arrow(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_polygon); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda27(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_spec); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_8ArrowBox_6_draw(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_polyline, PyObject *__pyx_v_default_arrow, PyObject *__pyx_v_custom_arrow, PyObject *__pyx_v_extent); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_8ArrowBox_5_draw_setback(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_p, PyObject *__pyx_v_q, PyObject *__pyx_v_d); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_8ArrowBox_5_draw_2shrink_one_end(PyObject *__pyx_self, PyObject *__pyx_v_line, PyObject *__pyx_v_s); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_8ArrowBox_5_draw_4shrink(PyObject *__pyx_self, PyObject *__pyx_v_line, PyObject *__pyx_v_s1, PyObject *__pyx_v_s2); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_8ArrowBox_13_custom_arrow_4make_draw(PyObject *__pyx_self, PyObject *__pyx_v_px, PyObject *__pyx_v_py, PyObject *__pyx_v_vx, PyObject *__pyx_v_vy, PyObject *__pyx_v_t1, PyObject *__pyx_v_s); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_8ArrowBox_13_custom_arrow_make(PyObject *__pyx_self, PyObject *__pyx_v_graphics); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_8ArrowBox_9_custom_arrow(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_format, PyObject *__pyx_v_format_transform); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_8ArrowBox_6to_svg_7polygon_genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_8ArrowBox_6to_svg_polygon(PyObject *__pyx_self, PyObject *__pyx_v_points); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_8ArrowBox_11to_svg(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_8ArrowBox_6to_asy_polygon(PyObject *__pyx_self, PyObject *__pyx_v_points); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_8ArrowBox_13to_asy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_8ArrowBox_6extent_polyline(PyObject *__pyx_self, PyObject *__pyx_v_points); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_8ArrowBox_6extent_3polygon(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_points); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_8ArrowBox_6extent_6default_arrow(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_px, PyObject *__pyx_v_py, CYTHON_UNUSED PyObject *__pyx_v_vx, CYTHON_UNUSED PyObject *__pyx_v_vy, CYTHON_UNUSED PyObject *__pyx_v_t1, CYTHON_UNUSED PyObject *__pyx_v_s); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_8ArrowBox_15extent(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_8InsetBox_init(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_graphics, PyObject *__pyx_v_style, PyObject *__pyx_v_item, PyObject *__pyx_v_content, PyObject *__pyx_v_pos, PyObject *__pyx_v_opos); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_8InsetBox_2extent(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_8InsetBox_4to_svg(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_8InsetBox_6to_asy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_42total_extent(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_extents); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_44_style(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_graphics, PyObject *__pyx_v_item); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_5Style___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_graphics, PyObject *__pyx_v_edge, PyObject *__pyx_v_face); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_5Style_2append(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_item, CYTHON_UNUSED PyObject *__pyx_v_allow_forms); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_5Style_4set_option(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_5Style_6extend(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_style, PyObject *__pyx_v_pre); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_5Style_8clone(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_5Style_10get_default_face_color(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_5Style_12get_default_edge_color(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_5Style_14get_style(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_style_class, PyObject *__pyx_v_face_element, PyObject *__pyx_v_default_to_faces, PyObject *__pyx_v_consider_forms); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_5Style_16get_option(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_5Style_18get_line_width(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_face_element); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_46_flatten(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_leaves); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_17_GraphicsElements_8__init___get_options(PyObject *__pyx_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_17_GraphicsElements_8__init___2stylebox_style(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_style, PyObject *__pyx_v_specs); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_17_GraphicsElements_8__init___4convert(PyObject *__pyx_self, PyObject *__pyx_v_content, PyObject *__pyx_v_style); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_17_GraphicsElements___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_content, PyObject *__pyx_v_evaluation); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_17_GraphicsElements_12create_style_convert(PyObject *__pyx_self, PyObject *__pyx_v_expr); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_17_GraphicsElements_2create_style(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_expr); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_17_GraphicsElements_4get_style_class(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_16GraphicsElements___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_content, PyObject *__pyx_v_evaluation, PyObject *__pyx_v_neg_y); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_16GraphicsElements_2translate(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_coords); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_16GraphicsElements_4translate_absolute(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_d); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_16GraphicsElements_6translate_relative(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_16GraphicsElements_8extent(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_completely_visible_only); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_16GraphicsElements_6to_svg_genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_16GraphicsElements_10to_svg(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_16GraphicsElements_6to_asy_genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_16GraphicsElements_12to_asy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_16GraphicsElements_14set_size(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_xmin, PyObject *__pyx_v_ymin, PyObject *__pyx_v_extent_width, PyObject *__pyx_v_extent_height, PyObject *__pyx_v_pixel_width, PyObject *__pyx_v_pixel_height); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_11GraphicsBox_boxes_to_text(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_leaves, PyObject *__pyx_v_options); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_11GraphicsBox_2_get_image_size(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_options, PyObject *__pyx_v_graphics_options, PyObject *__pyx_v_max_width); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_11GraphicsBox_17_prepare_elements_15calc_dimensions_get_range(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_min, PyObject *__pyx_v_max); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_11GraphicsBox_17_prepare_elements_15calc_dimensions_2genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_11GraphicsBox_17_prepare_elements_calc_dimensions(PyObject *__pyx_self, PyObject *__pyx_v_final_pass); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_11GraphicsBox_4_prepare_elements(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_leaves, PyObject *__pyx_v_options, PyObject *__pyx_v_neg_y, PyObject *__pyx_v_max_width); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_11GraphicsBox_12boxes_to_tex_genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_11GraphicsBox_12boxes_to_tex_3genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_11GraphicsBox_6boxes_to_tex(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_leaves, PyObject *__pyx_v_options); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_11GraphicsBox_12boxes_to_xml_genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_11GraphicsBox_8boxes_to_xml(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_leaves, PyObject *__pyx_v_options); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_11GraphicsBox_10axis_ticks_round_to_zero(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_11GraphicsBox_10axis_ticks_2round_step(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_11GraphicsBox_10axis_ticks(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_xmin, PyObject *__pyx_v_xmax); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_11GraphicsBox_11create_axes_add_element(PyObject *__pyx_self, PyObject *__pyx_v_element); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_11GraphicsBox_11create_axes_2genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_11GraphicsBox_11create_axes_5genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda37(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_y); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda38(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda39(PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda40(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda41(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_y); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda42(PyObject *__pyx_self, PyObject *__pyx_v_y); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_11GraphicsBox_12create_axes(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_elements, PyObject *__pyx_v_graphics_options, PyObject *__pyx_v_xmin, PyObject *__pyx_v_xmax, PyObject *__pyx_v_ymin, PyObject *__pyx_v_ymax); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_5Blend_do_blend(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_colors, PyObject *__pyx_v_values); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_5Blend_2apply(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_colors, PyObject *__pyx_v_u, PyObject *__pyx_v_evaluation); /* proto */
static PyObject *__pyx_pf_7mathics_7builtin_8graphics_12_ColorObject___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct___euclidean_distance(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_1_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_2__extract_graphics(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_3_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_4_apply_makeboxes(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_5_convert(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_6_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_7_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_8_hsl_to_rgba(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_9_apply(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_10_to_svg(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_11_path(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_12_to_asy(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_13_path(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_14_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_15_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_16_do_init(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_17_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_18_init(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_19_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_20__svg_bezier(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_21_path(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_22_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_23__asy_bezier(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_24_path(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_25_init(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_26_parse_component(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_27_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_28_to_svg(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_29_components(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_30_to_asy(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_31_components(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_32_to_svg(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_33_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_34_init(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_35_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_36_vertices(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_37_heads(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_38_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_39_make_draw_svg(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_40_draw(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_41_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_42_make_draw_asy(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_43_draw(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_44_arrows(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_45_segments(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_46_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_47_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_48_make_draw_svg(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_49_draw(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_50_make_draw_asy(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_51_draw(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_52_arrows(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_53__setback_spec(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_54_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_55__default_arrow(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_56_draw(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_57__draw(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_58__custom_arrow(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_59_make(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_60_draw(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_61_to_svg(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_62_polygon(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_63_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_64_to_asy(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_65_polygon(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_66_extent(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_67_polyline(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_68_polygon(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_69_default_arrow(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_70__flatten(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_71___init__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_72_convert(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_73_create_style(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_74_to_svg(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_75_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_76_to_asy(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_77_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_78__prepare_elements(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_79_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_80_boxes_to_tex(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_81_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_82_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_83_boxes_to_xml(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_84_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_85_create_axes(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_86_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_87_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_get = {0, &__pyx_n_s_get, 0, 0, 0};
static PyObject *__pyx_float_0_0;
static PyObject *__pyx_float_0_2;
static PyObject *__pyx_float_0_4;
static PyObject *__pyx_float_0_5;
static PyObject *__pyx_float_1_0;
static PyObject *__pyx_float_1_5;
static PyObject *__pyx_float_2_0;
static PyObject *__pyx_float_5_0;
static PyObject *__pyx_float_0_02;
static PyObject *__pyx_float_0_04;
static PyObject *__pyx_float_0_17;
static PyObject *__pyx_float_0_24;
static PyObject *__pyx_float_0_25;
static PyObject *__pyx_float_0_32;
static PyObject *__pyx_float_0_36;
static PyObject *__pyx_float_0_56;
static PyObject *__pyx_float_10_0;
static PyObject *__pyx_float_0_005;
static PyObject *__pyx_float_0_015;
static PyObject *__pyx_float_0_045;
static PyObject *__pyx_float_0_511;
static PyObject *__pyx_float_0_638;
static PyObject *__pyx_float_0_0131;
static PyObject *__pyx_float_0_0638;
static PyObject *__pyx_float_0_01765;
static PyObject *__pyx_float_0_040975;
static PyObject *__pyx_int_0;
static PyObject *__pyx_int_1;
static PyObject *__pyx_int_2;
static PyObject *__pyx_int_3;
static PyObject *__pyx_int_4;
static PyObject *__pyx_int_5;
static PyObject *__pyx_int_6;
static PyObject *__pyx_int_7;
static PyObject *__pyx_int_8;
static PyObject *__pyx_int_9;
static PyObject *__pyx_int_10;
static PyObject *__pyx_int_16;
static PyObject *__pyx_int_18;
static PyObject *__pyx_int_20;
static PyObject *__pyx_int_25;
static PyObject *__pyx_int_30;
static PyObject *__pyx_int_35;
static PyObject *__pyx_int_50;
static PyObject *__pyx_int_60;
static PyObject *__pyx_int_63;
static PyObject *__pyx_int_90;
static PyObject *__pyx_int_100;
static PyObject *__pyx_int_164;
static PyObject *__pyx_int_168;
static PyObject *__pyx_int_180;
static PyObject *__pyx_int_200;
static PyObject *__pyx_int_275;
static PyObject *__pyx_int_345;
static PyObject *__pyx_int_350;
static PyObject *__pyx_int_360;
static PyObject *__pyx_int_400;
static PyObject *__pyx_int_450;
static PyObject *__pyx_int_500;
static PyObject *__pyx_int_600;
static PyObject *__pyx_int_625;
static PyObject *__pyx_int_1900;
static PyObject *__pyx_int_100000000;
static PyObject *__pyx_int_6103515625;
static PyObject *__pyx_int_neg_1;
static PyObject *__pyx_int_neg_2;
static PyObject *__pyx_int_neg_3;
static PyObject *__pyx_tuple_;
static PyObject *__pyx_tuple__2;
static PyObject *__pyx_slice__13;
static PyObject *__pyx_slice__19;
static PyObject *__pyx_slice__36;
static PyObject *__pyx_slice__56;
static PyObject *__pyx_slice__87;
static PyObject *__pyx_tuple__11;
static PyObject *__pyx_tuple__12;
static PyObject *__pyx_tuple__14;
static PyObject *__pyx_tuple__20;
static PyObject *__pyx_tuple__22;
static PyObject *__pyx_tuple__24;
static PyObject *__pyx_tuple__25;
static PyObject *__pyx_tuple__27;
static PyObject *__pyx_tuple__29;
static PyObject *__pyx_tuple__37;
static PyObject *__pyx_tuple__39;
static PyObject *__pyx_tuple__42;
static PyObject *__pyx_tuple__45;
static PyObject *__pyx_tuple__48;
static PyObject *__pyx_tuple__50;
static PyObject *__pyx_tuple__52;
static PyObject *__pyx_tuple__54;
static PyObject *__pyx_tuple__59;
static PyObject *__pyx_tuple__61;
static PyObject *__pyx_tuple__63;
static PyObject *__pyx_tuple__65;
static PyObject *__pyx_tuple__68;
static PyObject *__pyx_tuple__71;
static PyObject *__pyx_tuple__73;
static PyObject *__pyx_tuple__76;
static PyObject *__pyx_tuple__78;
static PyObject *__pyx_tuple__80;
static PyObject *__pyx_tuple__83;
static PyObject *__pyx_tuple__84;
static PyObject *__pyx_tuple__88;
static PyObject *__pyx_tuple__90;
static PyObject *__pyx_tuple__92;
static PyObject *__pyx_tuple__94;
static PyObject *__pyx_tuple__96;
static PyObject *__pyx_tuple__98;
static PyObject *__pyx_slice__112;
static PyObject *__pyx_slice__113;
static PyObject *__pyx_tuple__100;
static PyObject *__pyx_tuple__102;
static PyObject *__pyx_tuple__104;
static PyObject *__pyx_tuple__106;
static PyObject *__pyx_tuple__110;
static PyObject *__pyx_tuple__114;
static PyObject *__pyx_tuple__116;
static PyObject *__pyx_tuple__118;
static PyObject *__pyx_tuple__120;
static PyObject *__pyx_tuple__121;
static PyObject *__pyx_tuple__122;
static PyObject *__pyx_tuple__124;
static PyObject *__pyx_tuple__125;
static PyObject *__pyx_tuple__126;
static PyObject *__pyx_tuple__127;
static PyObject *__pyx_tuple__128;
static PyObject *__pyx_tuple__129;
static PyObject *__pyx_tuple__130;
static PyObject *__pyx_tuple__131;
static PyObject *__pyx_tuple__132;
static PyObject *__pyx_tuple__133;
static PyObject *__pyx_tuple__134;
static PyObject *__pyx_tuple__135;
static PyObject *__pyx_tuple__137;
static PyObject *__pyx_tuple__139;
static PyObject *__pyx_tuple__143;
static PyObject *__pyx_tuple__145;
static PyObject *__pyx_tuple__147;
static PyObject *__pyx_tuple__148;
static PyObject *__pyx_tuple__149;
static PyObject *__pyx_tuple__152;
static PyObject *__pyx_tuple__154;
static PyObject *__pyx_tuple__156;
static PyObject *__pyx_tuple__157;
static PyObject *__pyx_tuple__159;
static PyObject *__pyx_tuple__160;
static PyObject *__pyx_tuple__162;
static PyObject *__pyx_tuple__164;
static PyObject *__pyx_tuple__166;
static PyObject *__pyx_tuple__168;
static PyObject *__pyx_tuple__169;
static PyObject *__pyx_tuple__171;
static PyObject *__pyx_tuple__173;
static PyObject *__pyx_tuple__175;
static PyObject *__pyx_tuple__176;
static PyObject *__pyx_tuple__178;
static PyObject *__pyx_tuple__180;
static PyObject *__pyx_tuple__182;
static PyObject *__pyx_tuple__184;
static PyObject *__pyx_tuple__187;
static PyObject *__pyx_tuple__189;
static PyObject *__pyx_tuple__191;
static PyObject *__pyx_tuple__193;
static PyObject *__pyx_tuple__195;
static PyObject *__pyx_tuple__197;
static PyObject *__pyx_tuple__199;
static PyObject *__pyx_tuple__201;
static PyObject *__pyx_tuple__203;
static PyObject *__pyx_tuple__205;
static PyObject *__pyx_tuple__207;
static PyObject *__pyx_tuple__209;
static PyObject *__pyx_tuple__211;
static PyObject *__pyx_tuple__213;
static PyObject *__pyx_tuple__215;
static PyObject *__pyx_tuple__217;
static PyObject *__pyx_tuple__219;
static PyObject *__pyx_tuple__220;
static PyObject *__pyx_tuple__222;
static PyObject *__pyx_tuple__223;
static PyObject *__pyx_tuple__224;
static PyObject *__pyx_tuple__226;
static PyObject *__pyx_tuple__227;
static PyObject *__pyx_tuple__229;
static PyObject *__pyx_tuple__231;
static PyObject *__pyx_tuple__233;
static PyObject *__pyx_tuple__235;
static PyObject *__pyx_tuple__237;
static PyObject *__pyx_tuple__239;
static PyObject *__pyx_tuple__241;
static PyObject *__pyx_tuple__243;
static PyObject *__pyx_tuple__245;
static PyObject *__pyx_tuple__247;
static PyObject *__pyx_tuple__249;
static PyObject *__pyx_tuple__251;
static PyObject *__pyx_tuple__253;
static PyObject *__pyx_tuple__255;
static PyObject *__pyx_tuple__256;
static PyObject *__pyx_tuple__258;
static PyObject *__pyx_tuple__260;
static PyObject *__pyx_tuple__262;
static PyObject *__pyx_tuple__264;
static PyObject *__pyx_tuple__266;
static PyObject *__pyx_tuple__268;
static PyObject *__pyx_tuple__270;
static PyObject *__pyx_tuple__272;
static PyObject *__pyx_tuple__274;
static PyObject *__pyx_tuple__276;
static PyObject *__pyx_tuple__278;
static PyObject *__pyx_tuple__280;
static PyObject *__pyx_tuple__282;
static PyObject *__pyx_tuple__284;
static PyObject *__pyx_tuple__286;
static PyObject *__pyx_tuple__288;
static PyObject *__pyx_tuple__290;
static PyObject *__pyx_tuple__292;
static PyObject *__pyx_tuple__293;
static PyObject *__pyx_tuple__295;
static PyObject *__pyx_tuple__297;
static PyObject *__pyx_tuple__299;
static PyObject *__pyx_tuple__300;
static PyObject *__pyx_tuple__302;
static PyObject *__pyx_tuple__304;
static PyObject *__pyx_tuple__305;
static PyObject *__pyx_tuple__306;
static PyObject *__pyx_tuple__308;
static PyObject *__pyx_tuple__310;
static PyObject *__pyx_tuple__312;
static PyObject *__pyx_tuple__314;
static PyObject *__pyx_tuple__315;
static PyObject *__pyx_tuple__317;
static PyObject *__pyx_tuple__319;
static PyObject *__pyx_tuple__321;
static PyObject *__pyx_tuple__323;
static PyObject *__pyx_tuple__324;
static PyObject *__pyx_tuple__326;
static PyObject *__pyx_tuple__328;
static PyObject *__pyx_tuple__330;
static PyObject *__pyx_tuple__332;
static PyObject *__pyx_tuple__334;
static PyObject *__pyx_tuple__335;
static PyObject *__pyx_tuple__337;
static PyObject *__pyx_tuple__338;
static PyObject *__pyx_tuple__340;
static PyObject *__pyx_tuple__342;
static PyObject *__pyx_tuple__344;
static PyObject *__pyx_tuple__345;
static PyObject *__pyx_tuple__347;
static PyObject *__pyx_tuple__349;
static PyObject *__pyx_tuple__351;
static PyObject *__pyx_tuple__352;
static PyObject *__pyx_tuple__354;
static PyObject *__pyx_tuple__356;
static PyObject *__pyx_tuple__357;
static PyObject *__pyx_tuple__359;
static PyObject *__pyx_tuple__360;
static PyObject *__pyx_tuple__362;
static PyObject *__pyx_tuple__364;
static PyObject *__pyx_tuple__365;
static PyObject *__pyx_tuple__367;
static PyObject *__pyx_tuple__369;
static PyObject *__pyx_tuple__371;
static PyObject *__pyx_tuple__373;
static PyObject *__pyx_tuple__375;
static PyObject *__pyx_tuple__376;
static PyObject *__pyx_tuple__378;
static PyObject *__pyx_tuple__380;
static PyObject *__pyx_tuple__382;
static PyObject *__pyx_tuple__384;
static PyObject *__pyx_tuple__386;
static PyObject *__pyx_tuple__387;
static PyObject *__pyx_tuple__389;
static PyObject *__pyx_tuple__390;
static PyObject *__pyx_tuple__392;
static PyObject *__pyx_tuple__393;
static PyObject *__pyx_tuple__395;
static PyObject *__pyx_tuple__397;
static PyObject *__pyx_tuple__398;
static PyObject *__pyx_tuple__400;
static PyObject *__pyx_tuple__402;
static PyObject *__pyx_tuple__404;
static PyObject *__pyx_tuple__406;
static PyObject *__pyx_tuple__407;
static PyObject *__pyx_tuple__409;
static PyObject *__pyx_tuple__411;
static PyObject *__pyx_tuple__412;
static PyObject *__pyx_tuple__413;
static PyObject *__pyx_tuple__414;
static PyObject *__pyx_tuple__416;
static PyObject *__pyx_tuple__418;
static PyObject *__pyx_tuple__420;
static PyObject *__pyx_tuple__422;
static PyObject *__pyx_tuple__423;
static PyObject *__pyx_tuple__425;
static PyObject *__pyx_tuple__427;
static PyObject *__pyx_tuple__429;
static PyObject *__pyx_tuple__431;
static PyObject *__pyx_tuple__432;
static PyObject *__pyx_tuple__434;
static PyObject *__pyx_tuple__436;
static PyObject *__pyx_tuple__438;
static PyObject *__pyx_tuple__439;
static PyObject *__pyx_tuple__441;
static PyObject *__pyx_tuple__443;
static PyObject *__pyx_tuple__445;
static PyObject *__pyx_tuple__446;
static PyObject *__pyx_tuple__448;
static PyObject *__pyx_tuple__450;
static PyObject *__pyx_tuple__452;
static PyObject *__pyx_tuple__454;
static PyObject *__pyx_tuple__455;
static PyObject *__pyx_tuple__457;
static PyObject *__pyx_tuple__459;
static PyObject *__pyx_tuple__461;
static PyObject *__pyx_codeobj__15;
static PyObject *__pyx_codeobj__21;
static PyObject *__pyx_codeobj__23;
static PyObject *__pyx_codeobj__26;
static PyObject *__pyx_codeobj__28;
static PyObject *__pyx_codeobj__38;
static PyObject *__pyx_codeobj__40;
static PyObject *__pyx_codeobj__44;
static PyObject *__pyx_codeobj__46;
static PyObject *__pyx_codeobj__47;
static PyObject *__pyx_codeobj__49;
static PyObject *__pyx_codeobj__51;
static PyObject *__pyx_codeobj__53;
static PyObject *__pyx_codeobj__55;
static PyObject *__pyx_codeobj__60;
static PyObject *__pyx_codeobj__62;
static PyObject *__pyx_codeobj__64;
static PyObject *__pyx_codeobj__69;
static PyObject *__pyx_codeobj__70;
static PyObject *__pyx_codeobj__72;
static PyObject *__pyx_codeobj__74;
static PyObject *__pyx_codeobj__75;
static PyObject *__pyx_codeobj__77;
static PyObject *__pyx_codeobj__79;
static PyObject *__pyx_codeobj__81;
static PyObject *__pyx_codeobj__82;
static PyObject *__pyx_codeobj__85;
static PyObject *__pyx_codeobj__86;
static PyObject *__pyx_codeobj__89;
static PyObject *__pyx_codeobj__91;
static PyObject *__pyx_codeobj__93;
static PyObject *__pyx_codeobj__95;
static PyObject *__pyx_codeobj__97;
static PyObject *__pyx_codeobj__99;
static PyObject *__pyx_codeobj__101;
static PyObject *__pyx_codeobj__103;
static PyObject *__pyx_codeobj__105;
static PyObject *__pyx_codeobj__107;
static PyObject *__pyx_codeobj__111;
static PyObject *__pyx_codeobj__115;
static PyObject *__pyx_codeobj__117;
static PyObject *__pyx_codeobj__119;
static PyObject *__pyx_codeobj__123;
static PyObject *__pyx_codeobj__136;
static PyObject *__pyx_codeobj__138;
static PyObject *__pyx_codeobj__144;
static PyObject *__pyx_codeobj__146;
static PyObject *__pyx_codeobj__150;
static PyObject *__pyx_codeobj__153;
static PyObject *__pyx_codeobj__155;
static PyObject *__pyx_codeobj__158;
static PyObject *__pyx_codeobj__161;
static PyObject *__pyx_codeobj__163;
static PyObject *__pyx_codeobj__165;
static PyObject *__pyx_codeobj__167;
static PyObject *__pyx_codeobj__170;
static PyObject *__pyx_codeobj__172;
static PyObject *__pyx_codeobj__174;
static PyObject *__pyx_codeobj__177;
static PyObject *__pyx_codeobj__179;
static PyObject *__pyx_codeobj__181;
static PyObject *__pyx_codeobj__183;
static PyObject *__pyx_codeobj__185;
static PyObject *__pyx_codeobj__188;
static PyObject *__pyx_codeobj__190;
static PyObject *__pyx_codeobj__192;
static PyObject *__pyx_codeobj__194;
static PyObject *__pyx_codeobj__196;
static PyObject *__pyx_codeobj__198;
static PyObject *__pyx_codeobj__200;
static PyObject *__pyx_codeobj__202;
static PyObject *__pyx_codeobj__204;
static PyObject *__pyx_codeobj__206;
static PyObject *__pyx_codeobj__208;
static PyObject *__pyx_codeobj__210;
static PyObject *__pyx_codeobj__212;
static PyObject *__pyx_codeobj__214;
static PyObject *__pyx_codeobj__216;
static PyObject *__pyx_codeobj__218;
static PyObject *__pyx_codeobj__221;
static PyObject *__pyx_codeobj__225;
static PyObject *__pyx_codeobj__228;
static PyObject *__pyx_codeobj__230;
static PyObject *__pyx_codeobj__232;
static PyObject *__pyx_codeobj__234;
static PyObject *__pyx_codeobj__236;
static PyObject *__pyx_codeobj__238;
static PyObject *__pyx_codeobj__240;
static PyObject *__pyx_codeobj__242;
static PyObject *__pyx_codeobj__244;
static PyObject *__pyx_codeobj__246;
static PyObject *__pyx_codeobj__248;
static PyObject *__pyx_codeobj__250;
static PyObject *__pyx_codeobj__252;
static PyObject *__pyx_codeobj__254;
static PyObject *__pyx_codeobj__257;
static PyObject *__pyx_codeobj__259;
static PyObject *__pyx_codeobj__261;
static PyObject *__pyx_codeobj__263;
static PyObject *__pyx_codeobj__265;
static PyObject *__pyx_codeobj__267;
static PyObject *__pyx_codeobj__269;
static PyObject *__pyx_codeobj__271;
static PyObject *__pyx_codeobj__273;
static PyObject *__pyx_codeobj__275;
static PyObject *__pyx_codeobj__277;
static PyObject *__pyx_codeobj__279;
static PyObject *__pyx_codeobj__281;
static PyObject *__pyx_codeobj__283;
static PyObject *__pyx_codeobj__285;
static PyObject *__pyx_codeobj__287;
static PyObject *__pyx_codeobj__289;
static PyObject *__pyx_codeobj__291;
static PyObject *__pyx_codeobj__294;
static PyObject *__pyx_codeobj__296;
static PyObject *__pyx_codeobj__298;
static PyObject *__pyx_codeobj__301;
static PyObject *__pyx_codeobj__303;
static PyObject *__pyx_codeobj__307;
static PyObject *__pyx_codeobj__309;
static PyObject *__pyx_codeobj__311;
static PyObject *__pyx_codeobj__313;
static PyObject *__pyx_codeobj__316;
static PyObject *__pyx_codeobj__318;
static PyObject *__pyx_codeobj__320;
static PyObject *__pyx_codeobj__322;
static PyObject *__pyx_codeobj__325;
static PyObject *__pyx_codeobj__327;
static PyObject *__pyx_codeobj__329;
static PyObject *__pyx_codeobj__331;
static PyObject *__pyx_codeobj__333;
static PyObject *__pyx_codeobj__336;
static PyObject *__pyx_codeobj__339;
static PyObject *__pyx_codeobj__341;
static PyObject *__pyx_codeobj__343;
static PyObject *__pyx_codeobj__346;
static PyObject *__pyx_codeobj__348;
static PyObject *__pyx_codeobj__350;
static PyObject *__pyx_codeobj__353;
static PyObject *__pyx_codeobj__355;
static PyObject *__pyx_codeobj__358;
static PyObject *__pyx_codeobj__361;
static PyObject *__pyx_codeobj__363;
static PyObject *__pyx_codeobj__366;
static PyObject *__pyx_codeobj__368;
static PyObject *__pyx_codeobj__370;
static PyObject *__pyx_codeobj__372;
static PyObject *__pyx_codeobj__374;
static PyObject *__pyx_codeobj__377;
static PyObject *__pyx_codeobj__379;
static PyObject *__pyx_codeobj__381;
static PyObject *__pyx_codeobj__383;
static PyObject *__pyx_codeobj__385;
static PyObject *__pyx_codeobj__388;
static PyObject *__pyx_codeobj__391;
static PyObject *__pyx_codeobj__394;
static PyObject *__pyx_codeobj__396;
static PyObject *__pyx_codeobj__399;
static PyObject *__pyx_codeobj__401;
static PyObject *__pyx_codeobj__403;
static PyObject *__pyx_codeobj__405;
static PyObject *__pyx_codeobj__408;
static PyObject *__pyx_codeobj__410;
static PyObject *__pyx_codeobj__415;
static PyObject *__pyx_codeobj__417;
static PyObject *__pyx_codeobj__419;
static PyObject *__pyx_codeobj__421;
static PyObject *__pyx_codeobj__424;
static PyObject *__pyx_codeobj__426;
static PyObject *__pyx_codeobj__428;
static PyObject *__pyx_codeobj__430;
static PyObject *__pyx_codeobj__433;
static PyObject *__pyx_codeobj__435;
static PyObject *__pyx_codeobj__437;
static PyObject *__pyx_codeobj__440;
static PyObject *__pyx_codeobj__442;
static PyObject *__pyx_codeobj__444;
static PyObject *__pyx_codeobj__447;
static PyObject *__pyx_codeobj__449;
static PyObject *__pyx_codeobj__451;
static PyObject *__pyx_codeobj__453;
static PyObject *__pyx_codeobj__456;
static PyObject *__pyx_codeobj__458;
static PyObject *__pyx_codeobj__460;
/* Late includes */

/* "mathics/builtin/graphics.py":59
 * 
 * 
 * def get_class(name):             # <<<<<<<<<<<<<<
 *     from mathics.builtin.graphics3d import GLOBALS3D
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_1get_class(PyObject *__pyx_self, PyObject *__pyx_v_name); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_1get_class = {"get_class", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_1get_class, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_1get_class(PyObject *__pyx_self, PyObject *__pyx_v_name) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_class (wrapper)", 0);
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_get_class(__pyx_self, ((PyObject *)__pyx_v_name));

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_get_class(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name) {
  PyObject *__pyx_v_GLOBALS3D = 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;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_class", 0);

  /* "mathics/builtin/graphics.py":60
 * 
 * def get_class(name):
 *     from mathics.builtin.graphics3d import GLOBALS3D             # <<<<<<<<<<<<<<
 * 
 *     c = GLOBALS.get(name)
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_GLOBALS3D);
  __Pyx_GIVEREF(__pyx_n_s_GLOBALS3D);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_GLOBALS3D);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_mathics_builtin_graphics3d, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 60, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_GLOBALS3D); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_GLOBALS3D = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":62
 *     from mathics.builtin.graphics3d import GLOBALS3D
 * 
 *     c = GLOBALS.get(name)             # <<<<<<<<<<<<<<
 *     if c is None:
 *         return GLOBALS3D.get(name)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_GLOBALS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 62, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_get); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 62, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_1, __pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_name);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 62, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_c = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":63
 * 
 *     c = GLOBALS.get(name)
 *     if c is None:             # <<<<<<<<<<<<<<
 *         return GLOBALS3D.get(name)
 *     else:
 */
  __pyx_t_4 = (__pyx_v_c == Py_None);
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (__pyx_t_5) {

    /* "mathics/builtin/graphics.py":64
 *     c = GLOBALS.get(name)
 *     if c is None:
 *         return GLOBALS3D.get(name)             # <<<<<<<<<<<<<<
 *     else:
 *         return c
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_GLOBALS3D, __pyx_n_s_get); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 64, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_1, __pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_name);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 64, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "mathics/builtin/graphics.py":63
 * 
 *     c = GLOBALS.get(name)
 *     if c is None:             # <<<<<<<<<<<<<<
 *         return GLOBALS3D.get(name)
 *     else:
 */
  }

  /* "mathics/builtin/graphics.py":66
 *         return GLOBALS3D.get(name)
 *     else:
 *         return c             # <<<<<<<<<<<<<<
 * 
 *     # globals() does not work with Cython, otherwise one could use something
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_c);
    __pyx_r = __pyx_v_c;
    goto __pyx_L0;
  }

  /* "mathics/builtin/graphics.py":59
 * 
 * 
 * def get_class(name):             # <<<<<<<<<<<<<<
 *     from mathics.builtin.graphics3d import GLOBALS3D
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("mathics.builtin.graphics.get_class", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_GLOBALS3D);
  __Pyx_XDECREF(__pyx_v_c);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":72
 * 
 * 
 * def coords(value):             # <<<<<<<<<<<<<<
 *     if value.has_form("List", 2):
 *         x, y = value.leaves[0].round_to_float(), value.leaves[1].round_to_float()
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_3coords(PyObject *__pyx_self, PyObject *__pyx_v_value); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_3coords = {"coords", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_3coords, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_3coords(PyObject *__pyx_self, PyObject *__pyx_v_value) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("coords (wrapper)", 0);
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_2coords(__pyx_self, ((PyObject *)__pyx_v_value));

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_2coords(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_value) {
  PyObject *__pyx_v_x = NULL;
  PyObject *__pyx_v_y = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("coords", 0);

  /* "mathics/builtin/graphics.py":73
 * 
 * def coords(value):
 *     if value.has_form("List", 2):             # <<<<<<<<<<<<<<
 *         x, y = value.leaves[0].round_to_float(), value.leaves[1].round_to_float()
 *         if x is None or y is None:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_has_form); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 73, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 73, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "mathics/builtin/graphics.py":74
 * def coords(value):
 *     if value.has_form("List", 2):
 *         x, y = value.leaves[0].round_to_float(), value.leaves[1].round_to_float()             # <<<<<<<<<<<<<<
 *         if x is None or y is None:
 *             raise CoordinatesError
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_leaves); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 74, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 74, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_round_to_float); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 74, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 74, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_leaves); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 74, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_4, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 74, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_round_to_float); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 74, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 74, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_x = __pyx_t_2;
    __pyx_t_2 = 0;
    __pyx_v_y = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "mathics/builtin/graphics.py":75
 *     if value.has_form("List", 2):
 *         x, y = value.leaves[0].round_to_float(), value.leaves[1].round_to_float()
 *         if x is None or y is None:             # <<<<<<<<<<<<<<
 *             raise CoordinatesError
 *         return (x, y)
 */
    __pyx_t_6 = (__pyx_v_x == Py_None);
    __pyx_t_7 = (__pyx_t_6 != 0);
    if (!__pyx_t_7) {
    } else {
      __pyx_t_3 = __pyx_t_7;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_t_7 = (__pyx_v_y == Py_None);
    __pyx_t_6 = (__pyx_t_7 != 0);
    __pyx_t_3 = __pyx_t_6;
    __pyx_L5_bool_binop_done:;
    if (unlikely(__pyx_t_3)) {

      /* "mathics/builtin/graphics.py":76
 *         x, y = value.leaves[0].round_to_float(), value.leaves[1].round_to_float()
 *         if x is None or y is None:
 *             raise CoordinatesError             # <<<<<<<<<<<<<<
 *         return (x, y)
 *     raise CoordinatesError
 */
      __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_CoordinatesError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 76, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_ERR(0, 76, __pyx_L1_error)

      /* "mathics/builtin/graphics.py":75
 *     if value.has_form("List", 2):
 *         x, y = value.leaves[0].round_to_float(), value.leaves[1].round_to_float()
 *         if x is None or y is None:             # <<<<<<<<<<<<<<
 *             raise CoordinatesError
 *         return (x, y)
 */
    }

    /* "mathics/builtin/graphics.py":77
 *         if x is None or y is None:
 *             raise CoordinatesError
 *         return (x, y)             # <<<<<<<<<<<<<<
 *     raise CoordinatesError
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 77, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_x);
    __Pyx_GIVEREF(__pyx_v_x);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_x);
    __Pyx_INCREF(__pyx_v_y);
    __Pyx_GIVEREF(__pyx_v_y);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_y);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "mathics/builtin/graphics.py":73
 * 
 * def coords(value):
 *     if value.has_form("List", 2):             # <<<<<<<<<<<<<<
 *         x, y = value.leaves[0].round_to_float(), value.leaves[1].round_to_float()
 *         if x is None or y is None:
 */
  }

  /* "mathics/builtin/graphics.py":78
 *             raise CoordinatesError
 *         return (x, y)
 *     raise CoordinatesError             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_CoordinatesError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 78, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(0, 78, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":72
 * 
 * 
 * def coords(value):             # <<<<<<<<<<<<<<
 *     if value.has_form("List", 2):
 *         x, y = value.leaves[0].round_to_float(), value.leaves[1].round_to_float()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("mathics.builtin.graphics.coords", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XDECREF(__pyx_v_y);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":82
 * 
 * class Coords(object):
 *     def __init__(self, graphics, expr=None, pos=None, d=None):             # <<<<<<<<<<<<<<
 *         self.graphics = graphics
 *         self.p = pos
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_6Coords_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_6Coords_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_6Coords_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_6Coords_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_graphics = 0;
  PyObject *__pyx_v_expr = 0;
  PyObject *__pyx_v_pos = 0;
  PyObject *__pyx_v_d = 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);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_graphics,&__pyx_n_s_expr,&__pyx_n_s_pos,&__pyx_n_s_d,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[2] = ((PyObject *)((PyObject *)Py_None));
    values[3] = ((PyObject *)((PyObject *)Py_None));
    values[4] = ((PyObject *)((PyObject *)Py_None));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_graphics)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 5, 1); __PYX_ERR(0, 82, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_expr);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pos);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_d);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 82, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_graphics = values[1];
    __pyx_v_expr = values[2];
    __pyx_v_pos = values[3];
    __pyx_v_d = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 82, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.Coords.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_6Coords___init__(__pyx_self, __pyx_v_self, __pyx_v_graphics, __pyx_v_expr, __pyx_v_pos, __pyx_v_d);

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_6Coords___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_graphics, PyObject *__pyx_v_expr, PyObject *__pyx_v_pos, PyObject *__pyx_v_d) {
  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;
  Py_ssize_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "mathics/builtin/graphics.py":83
 * class Coords(object):
 *     def __init__(self, graphics, expr=None, pos=None, d=None):
 *         self.graphics = graphics             # <<<<<<<<<<<<<<
 *         self.p = pos
 *         self.d = d
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_graphics, __pyx_v_graphics) < 0) __PYX_ERR(0, 83, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":84
 *     def __init__(self, graphics, expr=None, pos=None, d=None):
 *         self.graphics = graphics
 *         self.p = pos             # <<<<<<<<<<<<<<
 *         self.d = d
 *         if expr is not None:
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_p, __pyx_v_pos) < 0) __PYX_ERR(0, 84, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":85
 *         self.graphics = graphics
 *         self.p = pos
 *         self.d = d             # <<<<<<<<<<<<<<
 *         if expr is not None:
 *             if expr.has_form("Offset", 1, 2):
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_d, __pyx_v_d) < 0) __PYX_ERR(0, 85, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":86
 *         self.p = pos
 *         self.d = d
 *         if expr is not None:             # <<<<<<<<<<<<<<
 *             if expr.has_form("Offset", 1, 2):
 *                 self.d = coords(expr.leaves[0])
 */
  __pyx_t_1 = (__pyx_v_expr != Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "mathics/builtin/graphics.py":87
 *         self.d = d
 *         if expr is not None:
 *             if expr.has_form("Offset", 1, 2):             # <<<<<<<<<<<<<<
 *                 self.d = coords(expr.leaves[0])
 *                 if len(expr.leaves) > 1:
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_expr, __pyx_n_s_has_form); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 87, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 87, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 87, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_2) {

      /* "mathics/builtin/graphics.py":88
 *         if expr is not None:
 *             if expr.has_form("Offset", 1, 2):
 *                 self.d = coords(expr.leaves[0])             # <<<<<<<<<<<<<<
 *                 if len(expr.leaves) > 1:
 *                     self.p = coords(expr.leaves[1])
 */
      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_coords); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 88, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_expr, __pyx_n_s_leaves); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 88, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_5, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 88, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 88, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_d, __pyx_t_4) < 0) __PYX_ERR(0, 88, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "mathics/builtin/graphics.py":89
 *             if expr.has_form("Offset", 1, 2):
 *                 self.d = coords(expr.leaves[0])
 *                 if len(expr.leaves) > 1:             # <<<<<<<<<<<<<<
 *                     self.p = coords(expr.leaves[1])
 *                 else:
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_expr, __pyx_n_s_leaves); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 89, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_7 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 89, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_2 = ((__pyx_t_7 > 1) != 0);
      if (__pyx_t_2) {

        /* "mathics/builtin/graphics.py":90
 *                 self.d = coords(expr.leaves[0])
 *                 if len(expr.leaves) > 1:
 *                     self.p = coords(expr.leaves[1])             # <<<<<<<<<<<<<<
 *                 else:
 *                     self.p = None
 */
        __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_coords); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 90, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_expr, __pyx_n_s_leaves); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 90, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_6, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 90, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_6)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_6);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5);
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 90, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_p, __pyx_t_4) < 0) __PYX_ERR(0, 90, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "mathics/builtin/graphics.py":89
 *             if expr.has_form("Offset", 1, 2):
 *                 self.d = coords(expr.leaves[0])
 *                 if len(expr.leaves) > 1:             # <<<<<<<<<<<<<<
 *                     self.p = coords(expr.leaves[1])
 *                 else:
 */
        goto __pyx_L5;
      }

      /* "mathics/builtin/graphics.py":92
 *                     self.p = coords(expr.leaves[1])
 *                 else:
 *                     self.p = None             # <<<<<<<<<<<<<<
 *             else:
 *                 self.p = coords(expr)
 */
      /*else*/ {
        if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_p, Py_None) < 0) __PYX_ERR(0, 92, __pyx_L1_error)
      }
      __pyx_L5:;

      /* "mathics/builtin/graphics.py":87
 *         self.d = d
 *         if expr is not None:
 *             if expr.has_form("Offset", 1, 2):             # <<<<<<<<<<<<<<
 *                 self.d = coords(expr.leaves[0])
 *                 if len(expr.leaves) > 1:
 */
      goto __pyx_L4;
    }

    /* "mathics/builtin/graphics.py":94
 *                     self.p = None
 *             else:
 *                 self.p = coords(expr)             # <<<<<<<<<<<<<<
 * 
 *     def pos(self):
 */
    /*else*/ {
      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_coords); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 94, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_expr) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_expr);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 94, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_p, __pyx_t_4) < 0) __PYX_ERR(0, 94, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __pyx_L4:;

    /* "mathics/builtin/graphics.py":86
 *         self.p = pos
 *         self.d = d
 *         if expr is not None:             # <<<<<<<<<<<<<<
 *             if expr.has_form("Offset", 1, 2):
 *                 self.d = coords(expr.leaves[0])
 */
  }

  /* "mathics/builtin/graphics.py":82
 * 
 * class Coords(object):
 *     def __init__(self, graphics, expr=None, pos=None, d=None):             # <<<<<<<<<<<<<<
 *         self.graphics = graphics
 *         self.p = pos
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("mathics.builtin.graphics.Coords.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":96
 *                 self.p = coords(expr)
 * 
 *     def pos(self):             # <<<<<<<<<<<<<<
 *         p = self.graphics.translate(self.p)
 *         p = (cut(p[0]), cut(p[1]))
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_6Coords_3pos(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_6Coords_3pos = {"pos", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_6Coords_3pos, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_6Coords_3pos(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("pos (wrapper)", 0);
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_6Coords_2pos(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_6Coords_2pos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_p = NULL;
  PyObject *__pyx_v_d = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("pos", 0);

  /* "mathics/builtin/graphics.py":97
 * 
 *     def pos(self):
 *         p = self.graphics.translate(self.p)             # <<<<<<<<<<<<<<
 *         p = (cut(p[0]), cut(p[1]))
 *         if self.d is not None:
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_graphics); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_translate); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 97, __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_n_s_p); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_p = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":98
 *     def pos(self):
 *         p = self.graphics.translate(self.p)
 *         p = (cut(p[0]), cut(p[1]))             # <<<<<<<<<<<<<<
 *         if self.d is not None:
 *             d = self.graphics.translate_absolute(self.d)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_cut); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 98, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_p, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 98, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_cut); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 98, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_p, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 98, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 98, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 98, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
  __pyx_t_1 = 0;
  __pyx_t_3 = 0;
  __Pyx_DECREF_SET(__pyx_v_p, __pyx_t_2);
  __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":99
 *         p = self.graphics.translate(self.p)
 *         p = (cut(p[0]), cut(p[1]))
 *         if self.d is not None:             # <<<<<<<<<<<<<<
 *             d = self.graphics.translate_absolute(self.d)
 *             return (p[0] + d[0], p[1] + d[1])
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_d); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 99, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = (__pyx_t_2 != Py_None);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "mathics/builtin/graphics.py":100
 *         p = (cut(p[0]), cut(p[1]))
 *         if self.d is not None:
 *             d = self.graphics.translate_absolute(self.d)             # <<<<<<<<<<<<<<
 *             return (p[0] + d[0], p[1] + d[1])
 *         return p
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_graphics); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 100, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_translate_absolute); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 100, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_d); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 100, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 100, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_d = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "mathics/builtin/graphics.py":101
 *         if self.d is not None:
 *             d = self.graphics.translate_absolute(self.d)
 *             return (p[0] + d[0], p[1] + d[1])             # <<<<<<<<<<<<<<
 *         return p
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_p, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 101, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_d, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 101, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 101, __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_1 = __Pyx_GetItemInt(__pyx_v_p, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 101, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_d, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 101, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 101, __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 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 101, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "mathics/builtin/graphics.py":99
 *         p = self.graphics.translate(self.p)
 *         p = (cut(p[0]), cut(p[1]))
 *         if self.d is not None:             # <<<<<<<<<<<<<<
 *             d = self.graphics.translate_absolute(self.d)
 *             return (p[0] + d[0], p[1] + d[1])
 */
  }

  /* "mathics/builtin/graphics.py":102
 *             d = self.graphics.translate_absolute(self.d)
 *             return (p[0] + d[0], p[1] + d[1])
 *         return p             # <<<<<<<<<<<<<<
 * 
 *     def add(self, x, y):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_p);
  __pyx_r = __pyx_v_p;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":96
 *                 self.p = coords(expr)
 * 
 *     def pos(self):             # <<<<<<<<<<<<<<
 *         p = self.graphics.translate(self.p)
 *         p = (cut(p[0]), cut(p[1]))
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("mathics.builtin.graphics.Coords.pos", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_p);
  __Pyx_XDECREF(__pyx_v_d);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":104
 *         return p
 * 
 *     def add(self, x, y):             # <<<<<<<<<<<<<<
 *         p = (self.p[0] + x, self.p[1] + y)
 *         return Coords(self.graphics, pos=p, d=self.d)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_6Coords_5add(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_6Coords_5add = {"add", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_6Coords_5add, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_6Coords_5add(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_x = 0;
  PyObject *__pyx_v_y = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_x,&__pyx_n_s_y,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("add", 1, 3, 3, 1); __PYX_ERR(0, 104, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("add", 1, 3, 3, 2); __PYX_ERR(0, 104, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add") < 0)) __PYX_ERR(0, 104, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_self = values[0];
    __pyx_v_x = values[1];
    __pyx_v_y = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("add", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 104, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.Coords.add", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_6Coords_4add(__pyx_self, __pyx_v_self, __pyx_v_x, __pyx_v_y);

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_6Coords_4add(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y) {
  PyObject *__pyx_v_p = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("add", 0);

  /* "mathics/builtin/graphics.py":105
 * 
 *     def add(self, x, y):
 *         p = (self.p[0] + x, self.p[1] + y)             # <<<<<<<<<<<<<<
 *         return Coords(self.graphics, pos=p, d=self.d)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 105, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 105, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_v_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 105, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 105, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 105, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_v_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 105, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 105, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_v_p = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":106
 *     def add(self, x, y):
 *         p = (self.p[0] + x, self.p[1] + y)
 *         return Coords(self.graphics, pos=p, d=self.d)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Coords); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_graphics); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_pos, __pyx_v_p) < 0) __PYX_ERR(0, 106, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_d); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_d, __pyx_t_4) < 0) __PYX_ERR(0, 106, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":104
 *         return p
 * 
 *     def add(self, x, y):             # <<<<<<<<<<<<<<
 *         p = (self.p[0] + x, self.p[1] + y)
 *         return Coords(self.graphics, pos=p, d=self.d)
 */

  /* 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("mathics.builtin.graphics.Coords.add", __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;
}

/* "mathics/builtin/graphics.py":109
 * 
 * 
 * def cut(value):             # <<<<<<<<<<<<<<
 *     "Cut values in graphics primitives (not displayed otherwise in SVG)"
 *     border = 10 ** 8
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_5cut(PyObject *__pyx_self, PyObject *__pyx_v_value); /*proto*/
static char __pyx_doc_7mathics_7builtin_8graphics_4cut[] = "Cut values in graphics primitives (not displayed otherwise in SVG)";
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_5cut = {"cut", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_5cut, METH_O, __pyx_doc_7mathics_7builtin_8graphics_4cut};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_5cut(PyObject *__pyx_self, PyObject *__pyx_v_value) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cut (wrapper)", 0);
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_4cut(__pyx_self, ((PyObject *)__pyx_v_value));

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_4cut(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_value) {
  PyObject *__pyx_v_border = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cut", 0);
  __Pyx_INCREF(__pyx_v_value);

  /* "mathics/builtin/graphics.py":111
 * def cut(value):
 *     "Cut values in graphics primitives (not displayed otherwise in SVG)"
 *     border = 10 ** 8             # <<<<<<<<<<<<<<
 *     if value < -border:
 *         value = -border
 */
  __Pyx_INCREF(__pyx_int_100000000);
  __pyx_v_border = __pyx_int_100000000;

  /* "mathics/builtin/graphics.py":112
 *     "Cut values in graphics primitives (not displayed otherwise in SVG)"
 *     border = 10 ** 8
 *     if value < -border:             # <<<<<<<<<<<<<<
 *         value = -border
 *     elif value > border:
 */
  __pyx_t_1 = PyNumber_Negative(__pyx_v_border); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_value, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 112, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 112, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "mathics/builtin/graphics.py":113
 *     border = 10 ** 8
 *     if value < -border:
 *         value = -border             # <<<<<<<<<<<<<<
 *     elif value > border:
 *         value = border
 */
    __pyx_t_2 = PyNumber_Negative(__pyx_v_border); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 113, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "mathics/builtin/graphics.py":112
 *     "Cut values in graphics primitives (not displayed otherwise in SVG)"
 *     border = 10 ** 8
 *     if value < -border:             # <<<<<<<<<<<<<<
 *         value = -border
 *     elif value > border:
 */
    goto __pyx_L3;
  }

  /* "mathics/builtin/graphics.py":114
 *     if value < -border:
 *         value = -border
 *     elif value > border:             # <<<<<<<<<<<<<<
 *         value = border
 *     return value
 */
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_value, __pyx_v_border, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 114, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 114, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "mathics/builtin/graphics.py":115
 *         value = -border
 *     elif value > border:
 *         value = border             # <<<<<<<<<<<<<<
 *     return value
 * 
 */
    __Pyx_INCREF(__pyx_v_border);
    __Pyx_DECREF_SET(__pyx_v_value, __pyx_v_border);

    /* "mathics/builtin/graphics.py":114
 *     if value < -border:
 *         value = -border
 *     elif value > border:             # <<<<<<<<<<<<<<
 *         value = border
 *     return value
 */
  }
  __pyx_L3:;

  /* "mathics/builtin/graphics.py":116
 *     elif value > border:
 *         value = border
 *     return value             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_value);
  __pyx_r = __pyx_v_value;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":109
 * 
 * 
 * def cut(value):             # <<<<<<<<<<<<<<
 *     "Cut values in graphics primitives (not displayed otherwise in SVG)"
 *     border = 10 ** 8
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("mathics.builtin.graphics.cut", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_border);
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":119
 * 
 * 
 * def create_css(edge_color=None, face_color=None, stroke_width=None, font_color=None):             # <<<<<<<<<<<<<<
 *     css = []
 *     if edge_color is not None:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_7create_css(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_7create_css = {"create_css", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_7create_css, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_7create_css(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_edge_color = 0;
  PyObject *__pyx_v_face_color = 0;
  PyObject *__pyx_v_stroke_width = 0;
  PyObject *__pyx_v_font_color = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("create_css (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_edge_color,&__pyx_n_s_face_color,&__pyx_n_s_stroke_width,&__pyx_n_s_font_color,0};
    PyObject* values[4] = {0,0,0,0};
    values[0] = ((PyObject *)((PyObject *)Py_None));
    values[1] = ((PyObject *)((PyObject *)Py_None));
    values[2] = ((PyObject *)((PyObject *)Py_None));
    values[3] = ((PyObject *)((PyObject *)Py_None));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edge_color);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_face_color);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stroke_width);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_font_color);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "create_css") < 0)) __PYX_ERR(0, 119, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_edge_color = values[0];
    __pyx_v_face_color = values[1];
    __pyx_v_stroke_width = values[2];
    __pyx_v_font_color = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("create_css", 0, 0, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 119, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.create_css", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_6create_css(__pyx_self, __pyx_v_edge_color, __pyx_v_face_color, __pyx_v_stroke_width, __pyx_v_font_color);

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_6create_css(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_edge_color, PyObject *__pyx_v_face_color, PyObject *__pyx_v_stroke_width, PyObject *__pyx_v_font_color) {
  PyObject *__pyx_v_css = NULL;
  PyObject *__pyx_v_color = NULL;
  PyObject *__pyx_v_opacity = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *(*__pyx_t_7)(PyObject *);
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("create_css", 0);

  /* "mathics/builtin/graphics.py":120
 * 
 * def create_css(edge_color=None, face_color=None, stroke_width=None, font_color=None):
 *     css = []             # <<<<<<<<<<<<<<
 *     if edge_color is not None:
 *         color, opacity = edge_color.to_css()
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 120, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_css = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":121
 * def create_css(edge_color=None, face_color=None, stroke_width=None, font_color=None):
 *     css = []
 *     if edge_color is not None:             # <<<<<<<<<<<<<<
 *         color, opacity = edge_color.to_css()
 *         css.append("stroke: %s" % color)
 */
  __pyx_t_2 = (__pyx_v_edge_color != Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "mathics/builtin/graphics.py":122
 *     css = []
 *     if edge_color is not None:
 *         color, opacity = edge_color.to_css()             # <<<<<<<<<<<<<<
 *         css.append("stroke: %s" % color)
 *         css.append("stroke-opacity: %s" % opacity)
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_edge_color, __pyx_n_s_to_css); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 122, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 122, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
      PyObject* sequence = __pyx_t_1;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 122, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_4 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      #else
      __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 122, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 122, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 122, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext;
      index = 0; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_4);
      index = 1; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_5);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(0, 122, __pyx_L1_error)
      __pyx_t_7 = NULL;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L5_unpacking_done;
      __pyx_L4_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 122, __pyx_L1_error)
      __pyx_L5_unpacking_done:;
    }
    __pyx_v_color = __pyx_t_4;
    __pyx_t_4 = 0;
    __pyx_v_opacity = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "mathics/builtin/graphics.py":123
 *     if edge_color is not None:
 *         color, opacity = edge_color.to_css()
 *         css.append("stroke: %s" % color)             # <<<<<<<<<<<<<<
 *         css.append("stroke-opacity: %s" % opacity)
 *     else:
 */
    __pyx_t_1 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_stroke_s, __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 123, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_css, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 123, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "mathics/builtin/graphics.py":124
 *         color, opacity = edge_color.to_css()
 *         css.append("stroke: %s" % color)
 *         css.append("stroke-opacity: %s" % opacity)             # <<<<<<<<<<<<<<
 *     else:
 *         css.append("stroke: none")
 */
    __pyx_t_1 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_stroke_opacity_s, __pyx_v_opacity); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 124, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_css, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 124, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "mathics/builtin/graphics.py":121
 * def create_css(edge_color=None, face_color=None, stroke_width=None, font_color=None):
 *     css = []
 *     if edge_color is not None:             # <<<<<<<<<<<<<<
 *         color, opacity = edge_color.to_css()
 *         css.append("stroke: %s" % color)
 */
    goto __pyx_L3;
  }

  /* "mathics/builtin/graphics.py":126
 *         css.append("stroke-opacity: %s" % opacity)
 *     else:
 *         css.append("stroke: none")             # <<<<<<<<<<<<<<
 *     if stroke_width is not None:
 *         css.append("stroke-width: %fpx" % stroke_width)
 */
  /*else*/ {
    __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_css, __pyx_kp_u_stroke_none); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 126, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "mathics/builtin/graphics.py":127
 *     else:
 *         css.append("stroke: none")
 *     if stroke_width is not None:             # <<<<<<<<<<<<<<
 *         css.append("stroke-width: %fpx" % stroke_width)
 *     if face_color is not None:
 */
  __pyx_t_3 = (__pyx_v_stroke_width != Py_None);
  __pyx_t_2 = (__pyx_t_3 != 0);
  if (__pyx_t_2) {

    /* "mathics/builtin/graphics.py":128
 *         css.append("stroke: none")
 *     if stroke_width is not None:
 *         css.append("stroke-width: %fpx" % stroke_width)             # <<<<<<<<<<<<<<
 *     if face_color is not None:
 *         color, opacity = face_color.to_css()
 */
    __pyx_t_1 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_stroke_width_fpx, __pyx_v_stroke_width); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 128, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_css, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 128, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "mathics/builtin/graphics.py":127
 *     else:
 *         css.append("stroke: none")
 *     if stroke_width is not None:             # <<<<<<<<<<<<<<
 *         css.append("stroke-width: %fpx" % stroke_width)
 *     if face_color is not None:
 */
  }

  /* "mathics/builtin/graphics.py":129
 *     if stroke_width is not None:
 *         css.append("stroke-width: %fpx" % stroke_width)
 *     if face_color is not None:             # <<<<<<<<<<<<<<
 *         color, opacity = face_color.to_css()
 *         css.append("fill: %s" % color)
 */
  __pyx_t_2 = (__pyx_v_face_color != Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "mathics/builtin/graphics.py":130
 *         css.append("stroke-width: %fpx" % stroke_width)
 *     if face_color is not None:
 *         color, opacity = face_color.to_css()             # <<<<<<<<<<<<<<
 *         css.append("fill: %s" % color)
 *         css.append("fill-opacity: %s" % opacity)
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_face_color, __pyx_n_s_to_css); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 130, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 130, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
      PyObject* sequence = __pyx_t_1;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 130, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_4 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      #else
      __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 130, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 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_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 130, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext;
      index = 0; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_5);
      index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L8_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_4);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(0, 130, __pyx_L1_error)
      __pyx_t_7 = NULL;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L9_unpacking_done;
      __pyx_L8_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 130, __pyx_L1_error)
      __pyx_L9_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_color, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_XDECREF_SET(__pyx_v_opacity, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "mathics/builtin/graphics.py":131
 *     if face_color is not None:
 *         color, opacity = face_color.to_css()
 *         css.append("fill: %s" % color)             # <<<<<<<<<<<<<<
 *         css.append("fill-opacity: %s" % opacity)
 *     else:
 */
    __pyx_t_1 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_fill_s, __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 131, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_css, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 131, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "mathics/builtin/graphics.py":132
 *         color, opacity = face_color.to_css()
 *         css.append("fill: %s" % color)
 *         css.append("fill-opacity: %s" % opacity)             # <<<<<<<<<<<<<<
 *     else:
 *         css.append("fill: none")
 */
    __pyx_t_1 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_fill_opacity_s, __pyx_v_opacity); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 132, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_css, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 132, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "mathics/builtin/graphics.py":129
 *     if stroke_width is not None:
 *         css.append("stroke-width: %fpx" % stroke_width)
 *     if face_color is not None:             # <<<<<<<<<<<<<<
 *         color, opacity = face_color.to_css()
 *         css.append("fill: %s" % color)
 */
    goto __pyx_L7;
  }

  /* "mathics/builtin/graphics.py":134
 *         css.append("fill-opacity: %s" % opacity)
 *     else:
 *         css.append("fill: none")             # <<<<<<<<<<<<<<
 *     if font_color is not None:
 *         color, opacity = font_color.to_css()
 */
  /*else*/ {
    __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_css, __pyx_kp_u_fill_none); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 134, __pyx_L1_error)
  }
  __pyx_L7:;

  /* "mathics/builtin/graphics.py":135
 *     else:
 *         css.append("fill: none")
 *     if font_color is not None:             # <<<<<<<<<<<<<<
 *         color, opacity = font_color.to_css()
 *         css.append("color: %s" % color)
 */
  __pyx_t_3 = (__pyx_v_font_color != Py_None);
  __pyx_t_2 = (__pyx_t_3 != 0);
  if (__pyx_t_2) {

    /* "mathics/builtin/graphics.py":136
 *         css.append("fill: none")
 *     if font_color is not None:
 *         color, opacity = font_color.to_css()             # <<<<<<<<<<<<<<
 *         css.append("color: %s" % color)
 *     return "; ".join(css)
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_font_color, __pyx_n_s_to_css); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 136, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 136, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
      PyObject* sequence = __pyx_t_1;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 136, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_4 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      #else
      __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 136, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 136, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 136, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext;
      index = 0; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L11_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_4);
      index = 1; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L11_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_5);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(0, 136, __pyx_L1_error)
      __pyx_t_7 = NULL;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L12_unpacking_done;
      __pyx_L11_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 136, __pyx_L1_error)
      __pyx_L12_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_color, __pyx_t_4);
    __pyx_t_4 = 0;
    __Pyx_XDECREF_SET(__pyx_v_opacity, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "mathics/builtin/graphics.py":137
 *     if font_color is not None:
 *         color, opacity = font_color.to_css()
 *         css.append("color: %s" % color)             # <<<<<<<<<<<<<<
 *     return "; ".join(css)
 * 
 */
    __pyx_t_1 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_color_s, __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 137, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_css, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 137, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "mathics/builtin/graphics.py":135
 *     else:
 *         css.append("fill: none")
 *     if font_color is not None:             # <<<<<<<<<<<<<<
 *         color, opacity = font_color.to_css()
 *         css.append("color: %s" % color)
 */
  }

  /* "mathics/builtin/graphics.py":138
 *         color, opacity = font_color.to_css()
 *         css.append("color: %s" % color)
 *     return "; ".join(css)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyUnicode_Join(__pyx_kp_u__3, __pyx_v_css); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":119
 * 
 * 
 * def create_css(edge_color=None, face_color=None, stroke_width=None, font_color=None):             # <<<<<<<<<<<<<<
 *     css = []
 *     if edge_color is not None:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("mathics.builtin.graphics.create_css", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_css);
  __Pyx_XDECREF(__pyx_v_color);
  __Pyx_XDECREF(__pyx_v_opacity);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":141
 * 
 * 
 * def asy_number(value):             # <<<<<<<<<<<<<<
 *     return "%.5g" % value
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_9asy_number(PyObject *__pyx_self, PyObject *__pyx_v_value); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_9asy_number = {"asy_number", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_9asy_number, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_9asy_number(PyObject *__pyx_self, PyObject *__pyx_v_value) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("asy_number (wrapper)", 0);
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_8asy_number(__pyx_self, ((PyObject *)__pyx_v_value));

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_8asy_number(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_value) {
  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("asy_number", 0);

  /* "mathics/builtin/graphics.py":142
 * 
 * def asy_number(value):
 *     return "%.5g" % value             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_5g, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 142, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":141
 * 
 * 
 * def asy_number(value):             # <<<<<<<<<<<<<<
 *     return "%.5g" % value
 * 
 */

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

/* "mathics/builtin/graphics.py":145
 * 
 * 
 * def _to_float(x):             # <<<<<<<<<<<<<<
 *     x = x.round_to_float()
 *     if x is None:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_11_to_float(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_11_to_float = {"_to_float", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_11_to_float, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_11_to_float(PyObject *__pyx_self, PyObject *__pyx_v_x) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_to_float (wrapper)", 0);
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_10_to_float(__pyx_self, ((PyObject *)__pyx_v_x));

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

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

  /* "mathics/builtin/graphics.py":146
 * 
 * def _to_float(x):
 *     x = x.round_to_float()             # <<<<<<<<<<<<<<
 *     if x is None:
 *         raise BoxConstructError
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_round_to_float); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 146, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 146, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF_SET(__pyx_v_x, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":147
 * def _to_float(x):
 *     x = x.round_to_float()
 *     if x is None:             # <<<<<<<<<<<<<<
 *         raise BoxConstructError
 *     return x
 */
  __pyx_t_4 = (__pyx_v_x == Py_None);
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (unlikely(__pyx_t_5)) {

    /* "mathics/builtin/graphics.py":148
 *     x = x.round_to_float()
 *     if x is None:
 *         raise BoxConstructError             # <<<<<<<<<<<<<<
 *     return x
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_BoxConstructError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 148, __pyx_L1_error)

    /* "mathics/builtin/graphics.py":147
 * def _to_float(x):
 *     x = x.round_to_float()
 *     if x is None:             # <<<<<<<<<<<<<<
 *         raise BoxConstructError
 *     return x
 */
  }

  /* "mathics/builtin/graphics.py":149
 *     if x is None:
 *         raise BoxConstructError
 *     return x             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_x);
  __pyx_r = __pyx_v_x;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":145
 * 
 * 
 * def _to_float(x):             # <<<<<<<<<<<<<<
 *     x = x.round_to_float()
 *     if x is None:
 */

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

/* "mathics/builtin/graphics.py":152
 * 
 * 
 * def create_pens(             # <<<<<<<<<<<<<<
 *     edge_color=None, face_color=None, stroke_width=None, is_face_element=False
 * ):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_13create_pens(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_13create_pens = {"create_pens", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_13create_pens, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_13create_pens(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_edge_color = 0;
  PyObject *__pyx_v_face_color = 0;
  PyObject *__pyx_v_stroke_width = 0;
  PyObject *__pyx_v_is_face_element = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("create_pens (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_edge_color,&__pyx_n_s_face_color,&__pyx_n_s_stroke_width,&__pyx_n_s_is_face_element,0};
    PyObject* values[4] = {0,0,0,0};

    /* "mathics/builtin/graphics.py":153
 * 
 * def create_pens(
 *     edge_color=None, face_color=None, stroke_width=None, is_face_element=False             # <<<<<<<<<<<<<<
 * ):
 *     result = []
 */
    values[0] = ((PyObject *)((PyObject *)Py_None));
    values[1] = ((PyObject *)((PyObject *)Py_None));
    values[2] = ((PyObject *)((PyObject *)Py_None));
    values[3] = ((PyObject *)((PyObject *)Py_False));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edge_color);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_face_color);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stroke_width);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_is_face_element);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "create_pens") < 0)) __PYX_ERR(0, 152, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_edge_color = values[0];
    __pyx_v_face_color = values[1];
    __pyx_v_stroke_width = values[2];
    __pyx_v_is_face_element = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("create_pens", 0, 0, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 152, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.create_pens", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_12create_pens(__pyx_self, __pyx_v_edge_color, __pyx_v_face_color, __pyx_v_stroke_width, __pyx_v_is_face_element);

  /* "mathics/builtin/graphics.py":152
 * 
 * 
 * def create_pens(             # <<<<<<<<<<<<<<
 *     edge_color=None, face_color=None, stroke_width=None, is_face_element=False
 * ):
 */

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_12create_pens(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_edge_color, PyObject *__pyx_v_face_color, PyObject *__pyx_v_stroke_width, PyObject *__pyx_v_is_face_element) {
  PyObject *__pyx_v_result = NULL;
  PyObject *__pyx_v_brush = NULL;
  PyObject *__pyx_v_opacity = NULL;
  PyObject *__pyx_v_pen = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *(*__pyx_t_7)(PyObject *);
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("create_pens", 0);

  /* "mathics/builtin/graphics.py":155
 *     edge_color=None, face_color=None, stroke_width=None, is_face_element=False
 * ):
 *     result = []             # <<<<<<<<<<<<<<
 *     if face_color is not None:
 *         brush, opacity = face_color.to_asy()
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 155, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":156
 * ):
 *     result = []
 *     if face_color is not None:             # <<<<<<<<<<<<<<
 *         brush, opacity = face_color.to_asy()
 *         if opacity != 1:
 */
  __pyx_t_2 = (__pyx_v_face_color != Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "mathics/builtin/graphics.py":157
 *     result = []
 *     if face_color is not None:
 *         brush, opacity = face_color.to_asy()             # <<<<<<<<<<<<<<
 *         if opacity != 1:
 *             brush += "+opacity(%s)" % asy_number(opacity)
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_face_color, __pyx_n_s_to_asy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 157, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 157, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
      PyObject* sequence = __pyx_t_1;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 157, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_4 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      #else
      __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 157, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 157, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 157, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext;
      index = 0; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_4);
      index = 1; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_5);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(0, 157, __pyx_L1_error)
      __pyx_t_7 = NULL;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L5_unpacking_done;
      __pyx_L4_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 157, __pyx_L1_error)
      __pyx_L5_unpacking_done:;
    }
    __pyx_v_brush = __pyx_t_4;
    __pyx_t_4 = 0;
    __pyx_v_opacity = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "mathics/builtin/graphics.py":158
 *     if face_color is not None:
 *         brush, opacity = face_color.to_asy()
 *         if opacity != 1:             # <<<<<<<<<<<<<<
 *             brush += "+opacity(%s)" % asy_number(opacity)
 *         result.append(brush)
 */
    __pyx_t_1 = __Pyx_PyInt_NeObjC(__pyx_v_opacity, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 158, __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(0, 158, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_3) {

      /* "mathics/builtin/graphics.py":159
 *         brush, opacity = face_color.to_asy()
 *         if opacity != 1:
 *             brush += "+opacity(%s)" % asy_number(opacity)             # <<<<<<<<<<<<<<
 *         result.append(brush)
 *     elif is_face_element:
 */
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_asy_number); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 159, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_v_opacity) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_opacity);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 159, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_opacity_s, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 159, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_brush, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 159, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF_SET(__pyx_v_brush, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "mathics/builtin/graphics.py":158
 *     if face_color is not None:
 *         brush, opacity = face_color.to_asy()
 *         if opacity != 1:             # <<<<<<<<<<<<<<
 *             brush += "+opacity(%s)" % asy_number(opacity)
 *         result.append(brush)
 */
    }

    /* "mathics/builtin/graphics.py":160
 *         if opacity != 1:
 *             brush += "+opacity(%s)" % asy_number(opacity)
 *         result.append(brush)             # <<<<<<<<<<<<<<
 *     elif is_face_element:
 *         result.append("nullpen")
 */
    __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_brush); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 160, __pyx_L1_error)

    /* "mathics/builtin/graphics.py":156
 * ):
 *     result = []
 *     if face_color is not None:             # <<<<<<<<<<<<<<
 *         brush, opacity = face_color.to_asy()
 *         if opacity != 1:
 */
    goto __pyx_L3;
  }

  /* "mathics/builtin/graphics.py":161
 *             brush += "+opacity(%s)" % asy_number(opacity)
 *         result.append(brush)
 *     elif is_face_element:             # <<<<<<<<<<<<<<
 *         result.append("nullpen")
 *     if edge_color is not None:
 */
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_is_face_element); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 161, __pyx_L1_error)
  if (__pyx_t_3) {

    /* "mathics/builtin/graphics.py":162
 *         result.append(brush)
 *     elif is_face_element:
 *         result.append("nullpen")             # <<<<<<<<<<<<<<
 *     if edge_color is not None:
 *         pen, opacity = edge_color.to_asy()
 */
    __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_result, __pyx_n_u_nullpen); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 162, __pyx_L1_error)

    /* "mathics/builtin/graphics.py":161
 *             brush += "+opacity(%s)" % asy_number(opacity)
 *         result.append(brush)
 *     elif is_face_element:             # <<<<<<<<<<<<<<
 *         result.append("nullpen")
 *     if edge_color is not None:
 */
  }
  __pyx_L3:;

  /* "mathics/builtin/graphics.py":163
 *     elif is_face_element:
 *         result.append("nullpen")
 *     if edge_color is not None:             # <<<<<<<<<<<<<<
 *         pen, opacity = edge_color.to_asy()
 *         if opacity != 1:
 */
  __pyx_t_3 = (__pyx_v_edge_color != Py_None);
  __pyx_t_2 = (__pyx_t_3 != 0);
  if (__pyx_t_2) {

    /* "mathics/builtin/graphics.py":164
 *         result.append("nullpen")
 *     if edge_color is not None:
 *         pen, opacity = edge_color.to_asy()             # <<<<<<<<<<<<<<
 *         if opacity != 1:
 *             pen += "+opacity(%s)" % asy_number(opacity)
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_edge_color, __pyx_n_s_to_asy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 164, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 164, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
      PyObject* sequence = __pyx_t_1;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 164, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_4 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      #else
      __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 164, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 164, __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_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 164, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext;
      index = 0; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_5);
      index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L8_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_4);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(0, 164, __pyx_L1_error)
      __pyx_t_7 = NULL;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L9_unpacking_done;
      __pyx_L8_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 164, __pyx_L1_error)
      __pyx_L9_unpacking_done:;
    }
    __pyx_v_pen = __pyx_t_5;
    __pyx_t_5 = 0;
    __Pyx_XDECREF_SET(__pyx_v_opacity, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "mathics/builtin/graphics.py":165
 *     if edge_color is not None:
 *         pen, opacity = edge_color.to_asy()
 *         if opacity != 1:             # <<<<<<<<<<<<<<
 *             pen += "+opacity(%s)" % asy_number(opacity)
 *         if stroke_width is not None:
 */
    __pyx_t_1 = __Pyx_PyInt_NeObjC(__pyx_v_opacity, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 165, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_2) {

      /* "mathics/builtin/graphics.py":166
 *         pen, opacity = edge_color.to_asy()
 *         if opacity != 1:
 *             pen += "+opacity(%s)" % asy_number(opacity)             # <<<<<<<<<<<<<<
 *         if stroke_width is not None:
 *             pen += "+linewidth(%s)" % asy_number(stroke_width)
 */
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_asy_number); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 166, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_opacity) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_opacity);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 166, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_opacity_s, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 166, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_pen, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 166, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF_SET(__pyx_v_pen, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "mathics/builtin/graphics.py":165
 *     if edge_color is not None:
 *         pen, opacity = edge_color.to_asy()
 *         if opacity != 1:             # <<<<<<<<<<<<<<
 *             pen += "+opacity(%s)" % asy_number(opacity)
 *         if stroke_width is not None:
 */
    }

    /* "mathics/builtin/graphics.py":167
 *         if opacity != 1:
 *             pen += "+opacity(%s)" % asy_number(opacity)
 *         if stroke_width is not None:             # <<<<<<<<<<<<<<
 *             pen += "+linewidth(%s)" % asy_number(stroke_width)
 *         result.append(pen)
 */
    __pyx_t_2 = (__pyx_v_stroke_width != Py_None);
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (__pyx_t_3) {

      /* "mathics/builtin/graphics.py":168
 *             pen += "+opacity(%s)" % asy_number(opacity)
 *         if stroke_width is not None:
 *             pen += "+linewidth(%s)" % asy_number(stroke_width)             # <<<<<<<<<<<<<<
 *         result.append(pen)
 *     elif is_face_element:
 */
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_asy_number); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 168, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_stroke_width) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_stroke_width);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 168, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_linewidth_s, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 168, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_pen, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 168, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF_SET(__pyx_v_pen, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "mathics/builtin/graphics.py":167
 *         if opacity != 1:
 *             pen += "+opacity(%s)" % asy_number(opacity)
 *         if stroke_width is not None:             # <<<<<<<<<<<<<<
 *             pen += "+linewidth(%s)" % asy_number(stroke_width)
 *         result.append(pen)
 */
    }

    /* "mathics/builtin/graphics.py":169
 *         if stroke_width is not None:
 *             pen += "+linewidth(%s)" % asy_number(stroke_width)
 *         result.append(pen)             # <<<<<<<<<<<<<<
 *     elif is_face_element:
 *         result.append("nullpen")
 */
    __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_pen); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 169, __pyx_L1_error)

    /* "mathics/builtin/graphics.py":163
 *     elif is_face_element:
 *         result.append("nullpen")
 *     if edge_color is not None:             # <<<<<<<<<<<<<<
 *         pen, opacity = edge_color.to_asy()
 *         if opacity != 1:
 */
    goto __pyx_L7;
  }

  /* "mathics/builtin/graphics.py":170
 *             pen += "+linewidth(%s)" % asy_number(stroke_width)
 *         result.append(pen)
 *     elif is_face_element:             # <<<<<<<<<<<<<<
 *         result.append("nullpen")
 *     return ", ".join(result)
 */
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_is_face_element); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 170, __pyx_L1_error)
  if (__pyx_t_3) {

    /* "mathics/builtin/graphics.py":171
 *         result.append(pen)
 *     elif is_face_element:
 *         result.append("nullpen")             # <<<<<<<<<<<<<<
 *     return ", ".join(result)
 * 
 */
    __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_result, __pyx_n_u_nullpen); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 171, __pyx_L1_error)

    /* "mathics/builtin/graphics.py":170
 *             pen += "+linewidth(%s)" % asy_number(stroke_width)
 *         result.append(pen)
 *     elif is_face_element:             # <<<<<<<<<<<<<<
 *         result.append("nullpen")
 *     return ", ".join(result)
 */
  }
  __pyx_L7:;

  /* "mathics/builtin/graphics.py":172
 *     elif is_face_element:
 *         result.append("nullpen")
 *     return ", ".join(result)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyUnicode_Join(__pyx_kp_u__4, __pyx_v_result); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 172, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":152
 * 
 * 
 * def create_pens(             # <<<<<<<<<<<<<<
 *     edge_color=None, face_color=None, stroke_width=None, is_face_element=False
 * ):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("mathics.builtin.graphics.create_pens", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_brush);
  __Pyx_XDECREF(__pyx_v_opacity);
  __Pyx_XDECREF(__pyx_v_pen);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":175
 * 
 * 
 * def _data_and_options(leaves, defined_options):             # <<<<<<<<<<<<<<
 *     data = []
 *     options = defined_options.copy()
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_15_data_and_options(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_15_data_and_options = {"_data_and_options", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_15_data_and_options, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_15_data_and_options(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_leaves = 0;
  PyObject *__pyx_v_defined_options = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_data_and_options (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_leaves,&__pyx_n_s_defined_options,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_leaves)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_defined_options)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_data_and_options", 1, 2, 2, 1); __PYX_ERR(0, 175, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_data_and_options") < 0)) __PYX_ERR(0, 175, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_leaves = values[0];
    __pyx_v_defined_options = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_data_and_options", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 175, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics._data_and_options", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_14_data_and_options(__pyx_self, __pyx_v_leaves, __pyx_v_defined_options);

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_14_data_and_options(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_leaves, PyObject *__pyx_v_defined_options) {
  PyObject *__pyx_v_data = NULL;
  PyObject *__pyx_v_options = NULL;
  PyObject *__pyx_v_leaf = NULL;
  PyObject *__pyx_v_name = NULL;
  PyObject *__pyx_v_value = NULL;
  PyObject *__pyx_v_name_head = NULL;
  PyObject *__pyx_v_py_name = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *(*__pyx_t_10)(PyObject *);
  int __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_data_and_options", 0);

  /* "mathics/builtin/graphics.py":176
 * 
 * def _data_and_options(leaves, defined_options):
 *     data = []             # <<<<<<<<<<<<<<
 *     options = defined_options.copy()
 *     for leaf in leaves:
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 176, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_data = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":177
 * def _data_and_options(leaves, defined_options):
 *     data = []
 *     options = defined_options.copy()             # <<<<<<<<<<<<<<
 *     for leaf in leaves:
 *         if leaf.get_head_name() == "System`Rule":
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_defined_options, __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_options = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":178
 *     data = []
 *     options = defined_options.copy()
 *     for leaf in leaves:             # <<<<<<<<<<<<<<
 *         if leaf.get_head_name() == "System`Rule":
 *             if len(leaf.leaves) != 2:
 */
  if (likely(PyList_CheckExact(__pyx_v_leaves)) || PyTuple_CheckExact(__pyx_v_leaves)) {
    __pyx_t_1 = __pyx_v_leaves; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_leaves); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 178, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 178, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 178, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 178, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 178, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 178, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_5(__pyx_t_1);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 178, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF_SET(__pyx_v_leaf, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "mathics/builtin/graphics.py":179
 *     options = defined_options.copy()
 *     for leaf in leaves:
 *         if leaf.get_head_name() == "System`Rule":             # <<<<<<<<<<<<<<
 *             if len(leaf.leaves) != 2:
 *                 raise BoxConstructError
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_leaf, __pyx_n_s_get_head_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 179, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 179, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_kp_u_System_Rule, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 179, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_7) {

      /* "mathics/builtin/graphics.py":180
 *     for leaf in leaves:
 *         if leaf.get_head_name() == "System`Rule":
 *             if len(leaf.leaves) != 2:             # <<<<<<<<<<<<<<
 *                 raise BoxConstructError
 *             name, value = leaf.leaves
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_leaf, __pyx_n_s_leaves); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 180, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_8 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 180, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_7 = ((__pyx_t_8 != 2) != 0);
      if (unlikely(__pyx_t_7)) {

        /* "mathics/builtin/graphics.py":181
 *         if leaf.get_head_name() == "System`Rule":
 *             if len(leaf.leaves) != 2:
 *                 raise BoxConstructError             # <<<<<<<<<<<<<<
 *             name, value = leaf.leaves
 *             name_head = name.get_head_name()
 */
        __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_BoxConstructError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 181, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_Raise(__pyx_t_2, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __PYX_ERR(0, 181, __pyx_L1_error)

        /* "mathics/builtin/graphics.py":180
 *     for leaf in leaves:
 *         if leaf.get_head_name() == "System`Rule":
 *             if len(leaf.leaves) != 2:             # <<<<<<<<<<<<<<
 *                 raise BoxConstructError
 *             name, value = leaf.leaves
 */
      }

      /* "mathics/builtin/graphics.py":182
 *             if len(leaf.leaves) != 2:
 *                 raise BoxConstructError
 *             name, value = leaf.leaves             # <<<<<<<<<<<<<<
 *             name_head = name.get_head_name()
 *             if name_head == "System`Symbol":
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_leaf, __pyx_n_s_leaves); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 182, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
        PyObject* sequence = __pyx_t_2;
        Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          __PYX_ERR(0, 182, __pyx_L1_error)
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_6 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_6);
        #else
        __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 182, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 182, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        #endif
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_9 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 182, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext;
        index = 0; __pyx_t_3 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_3)) goto __pyx_L7_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_3);
        index = 1; __pyx_t_6 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_6)) goto __pyx_L7_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_6);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 182, __pyx_L1_error)
        __pyx_t_10 = NULL;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        goto __pyx_L8_unpacking_done;
        __pyx_L7_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_10 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        __PYX_ERR(0, 182, __pyx_L1_error)
        __pyx_L8_unpacking_done:;
      }
      __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "mathics/builtin/graphics.py":183
 *                 raise BoxConstructError
 *             name, value = leaf.leaves
 *             name_head = name.get_head_name()             # <<<<<<<<<<<<<<
 *             if name_head == "System`Symbol":
 *                 py_name = name.get_name()
 */
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_get_head_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 183, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_3 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
        }
      }
      __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 183, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF_SET(__pyx_v_name_head, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "mathics/builtin/graphics.py":184
 *             name, value = leaf.leaves
 *             name_head = name.get_head_name()
 *             if name_head == "System`Symbol":             # <<<<<<<<<<<<<<
 *                 py_name = name.get_name()
 *             elif name_head == "System`String":
 */
      __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_name_head, __pyx_kp_u_System_Symbol, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 184, __pyx_L1_error)
      if (__pyx_t_7) {

        /* "mathics/builtin/graphics.py":185
 *             name_head = name.get_head_name()
 *             if name_head == "System`Symbol":
 *                 py_name = name.get_name()             # <<<<<<<<<<<<<<
 *             elif name_head == "System`String":
 *                 py_name = "System`" + name.get_string_value()
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_get_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 185, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_3 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_3)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_3);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 185, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_XDECREF_SET(__pyx_v_py_name, __pyx_t_2);
        __pyx_t_2 = 0;

        /* "mathics/builtin/graphics.py":184
 *             name, value = leaf.leaves
 *             name_head = name.get_head_name()
 *             if name_head == "System`Symbol":             # <<<<<<<<<<<<<<
 *                 py_name = name.get_name()
 *             elif name_head == "System`String":
 */
        goto __pyx_L9;
      }

      /* "mathics/builtin/graphics.py":186
 *             if name_head == "System`Symbol":
 *                 py_name = name.get_name()
 *             elif name_head == "System`String":             # <<<<<<<<<<<<<<
 *                 py_name = "System`" + name.get_string_value()
 *             else:  # unsupported name type
 */
      __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_name_head, __pyx_kp_u_System_String, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 186, __pyx_L1_error)
      if (likely(__pyx_t_7)) {

        /* "mathics/builtin/graphics.py":187
 *                 py_name = name.get_name()
 *             elif name_head == "System`String":
 *                 py_name = "System`" + name.get_string_value()             # <<<<<<<<<<<<<<
 *             else:  # unsupported name type
 *                 raise BoxConstructError
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_get_string_value); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 187, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_3 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_3)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_3);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 187, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = PyNumber_Add(__pyx_kp_u_System, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 187, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF_SET(__pyx_v_py_name, __pyx_t_6);
        __pyx_t_6 = 0;

        /* "mathics/builtin/graphics.py":186
 *             if name_head == "System`Symbol":
 *                 py_name = name.get_name()
 *             elif name_head == "System`String":             # <<<<<<<<<<<<<<
 *                 py_name = "System`" + name.get_string_value()
 *             else:  # unsupported name type
 */
        goto __pyx_L9;
      }

      /* "mathics/builtin/graphics.py":189
 *                 py_name = "System`" + name.get_string_value()
 *             else:  # unsupported name type
 *                 raise BoxConstructError             # <<<<<<<<<<<<<<
 *             options[py_name] = value
 *         else:
 */
      /*else*/ {
        __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_BoxConstructError); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 189, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_Raise(__pyx_t_6, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __PYX_ERR(0, 189, __pyx_L1_error)
      }
      __pyx_L9:;

      /* "mathics/builtin/graphics.py":190
 *             else:  # unsupported name type
 *                 raise BoxConstructError
 *             options[py_name] = value             # <<<<<<<<<<<<<<
 *         else:
 *             data.append(leaf)
 */
      if (unlikely(PyObject_SetItem(__pyx_v_options, __pyx_v_py_name, __pyx_v_value) < 0)) __PYX_ERR(0, 190, __pyx_L1_error)

      /* "mathics/builtin/graphics.py":179
 *     options = defined_options.copy()
 *     for leaf in leaves:
 *         if leaf.get_head_name() == "System`Rule":             # <<<<<<<<<<<<<<
 *             if len(leaf.leaves) != 2:
 *                 raise BoxConstructError
 */
      goto __pyx_L5;
    }

    /* "mathics/builtin/graphics.py":192
 *             options[py_name] = value
 *         else:
 *             data.append(leaf)             # <<<<<<<<<<<<<<
 *     return data, options
 * 
 */
    /*else*/ {
      __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_data, __pyx_v_leaf); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 192, __pyx_L1_error)
    }
    __pyx_L5:;

    /* "mathics/builtin/graphics.py":178
 *     data = []
 *     options = defined_options.copy()
 *     for leaf in leaves:             # <<<<<<<<<<<<<<
 *         if leaf.get_head_name() == "System`Rule":
 *             if len(leaf.leaves) != 2:
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":193
 *         else:
 *             data.append(leaf)
 *     return data, options             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 193, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_data);
  __Pyx_GIVEREF(__pyx_v_data);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_data);
  __Pyx_INCREF(__pyx_v_options);
  __Pyx_GIVEREF(__pyx_v_options);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_options);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":175
 * 
 * 
 * def _data_and_options(leaves, defined_options):             # <<<<<<<<<<<<<<
 *     data = []
 *     options = defined_options.copy()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("mathics.builtin.graphics._data_and_options", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_data);
  __Pyx_XDECREF(__pyx_v_options);
  __Pyx_XDECREF(__pyx_v_leaf);
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XDECREF(__pyx_v_name_head);
  __Pyx_XDECREF(__pyx_v_py_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":196
 * 
 * 
 * def _euclidean_distance(a, b):             # <<<<<<<<<<<<<<
 *     return sqrt(sum((x1 - x2) * (x1 - x2) for x1, x2 in zip(a, b)))
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_17_euclidean_distance(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_17_euclidean_distance = {"_euclidean_distance", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_17_euclidean_distance, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_17_euclidean_distance(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_a = 0;
  PyObject *__pyx_v_b = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_euclidean_distance (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_b,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_euclidean_distance", 1, 2, 2, 1); __PYX_ERR(0, 196, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_euclidean_distance") < 0)) __PYX_ERR(0, 196, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_a = values[0];
    __pyx_v_b = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_euclidean_distance", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 196, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics._euclidean_distance", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_16_euclidean_distance(__pyx_self, __pyx_v_a, __pyx_v_b);

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

/* "mathics/builtin/graphics.py":197
 * 
 * def _euclidean_distance(a, b):
 *     return sqrt(sum((x1 - x2) * (x1 - x2) for x1, x2 in zip(a, b)))             # <<<<<<<<<<<<<<
 * 
 * 
 */

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_19_euclidean_distance_genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_7mathics_7builtin_8graphics___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_7mathics_7builtin_8graphics___pyx_scope_struct_1_genexpr *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_1_genexpr(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_1_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_1_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 197, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct___euclidean_distance *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7mathics_7builtin_8graphics_19_euclidean_distance_2generator7, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_euclidean_distance_locals_genex, __pyx_n_s_mathics_builtin_graphics); if (unlikely(!gen)) __PYX_ERR(0, 197, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics._euclidean_distance.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_7mathics_7builtin_8graphics_19_euclidean_distance_2generator7(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_1_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_1_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *(*__pyx_t_8)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L8_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 197, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_a)) { __Pyx_RaiseClosureNameError("a"); __PYX_ERR(0, 197, __pyx_L1_error) }
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_b)) { __Pyx_RaiseClosureNameError("b"); __PYX_ERR(0, 197, __pyx_L1_error) }
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_a);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_a);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_a);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_b);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_b);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_b);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 197, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 197, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 197, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 197, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 197, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 197, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_4(__pyx_t_1);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 197, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
      PyObject* sequence = __pyx_t_2;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 197, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_6 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      #else
      __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 197, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 197, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      #endif
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 197, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
      index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L6_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_L6_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_6);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 197, __pyx_L1_error)
      __pyx_t_8 = NULL;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L7_unpacking_done;
      __pyx_L6_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 197, __pyx_L1_error)
      __pyx_L7_unpacking_done:;
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_x1);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_x1, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_x2);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_x2, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    __pyx_t_6 = 0;
    __pyx_t_2 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_x1, __pyx_cur_scope->__pyx_v_x2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 197, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_x1, __pyx_cur_scope->__pyx_v_x2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 197, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = PyNumber_Multiply(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 197, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    __Pyx_XGIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_3;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_4;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L8_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_1);
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_4 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 197, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_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("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":196
 * 
 * 
 * def _euclidean_distance(a, b):             # <<<<<<<<<<<<<<
 *     return sqrt(sum((x1 - x2) * (x1 - x2) for x1, x2 in zip(a, b)))
 * 
 */

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_16_euclidean_distance(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct___euclidean_distance *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_euclidean_distance", 0);
  __pyx_cur_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct___euclidean_distance *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct___euclidean_distance(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct___euclidean_distance, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct___euclidean_distance *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 196, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_a = __pyx_v_a;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_a);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_a);
  __pyx_cur_scope->__pyx_v_b = __pyx_v_b;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_b);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_b);

  /* "mathics/builtin/graphics.py":197
 * 
 * def _euclidean_distance(a, b):
 *     return sqrt(sum((x1 - x2) * (x1 - x2) for x1, x2 in zip(a, b)))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __pyx_pf_7mathics_7builtin_8graphics_19_euclidean_distance_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 197, __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;

  /* "mathics/builtin/graphics.py":196
 * 
 * 
 * def _euclidean_distance(a, b):             # <<<<<<<<<<<<<<
 *     return sqrt(sum((x1 - x2) * (x1 - x2) for x1, x2 in zip(a, b)))
 * 
 */

  /* 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("mathics.builtin.graphics._euclidean_distance", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":200
 * 
 * 
 * def _component_distance(a, b, i):             # <<<<<<<<<<<<<<
 *     return abs(a[i] - b[i])
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_19_component_distance(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_19_component_distance = {"_component_distance", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_19_component_distance, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_19_component_distance(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_a = 0;
  PyObject *__pyx_v_b = 0;
  PyObject *__pyx_v_i = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_component_distance (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_b,&__pyx_n_s_i,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_component_distance", 1, 3, 3, 1); __PYX_ERR(0, 200, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_component_distance", 1, 3, 3, 2); __PYX_ERR(0, 200, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_component_distance") < 0)) __PYX_ERR(0, 200, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_a = values[0];
    __pyx_v_b = values[1];
    __pyx_v_i = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_component_distance", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 200, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics._component_distance", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_18_component_distance(__pyx_self, __pyx_v_a, __pyx_v_b, __pyx_v_i);

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_18_component_distance(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_i) {
  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("_component_distance", 0);

  /* "mathics/builtin/graphics.py":201
 * 
 * def _component_distance(a, b, i):
 *     return abs(a[i] - b[i])             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_a, __pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_b, __pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 201, __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(0, 201, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyNumber_Absolute(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 201, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":200
 * 
 * 
 * def _component_distance(a, b, i):             # <<<<<<<<<<<<<<
 *     return abs(a[i] - b[i])
 * 
 */

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

/* "mathics/builtin/graphics.py":204
 * 
 * 
 * def _cie2000_distance(lab1, lab2):             # <<<<<<<<<<<<<<
 *     # reference: https://en.wikipedia.org/wiki/Color_difference#CIEDE2000
 *     e = machine_epsilon
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_21_cie2000_distance(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_21_cie2000_distance = {"_cie2000_distance", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_21_cie2000_distance, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_21_cie2000_distance(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_lab1 = 0;
  PyObject *__pyx_v_lab2 = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_cie2000_distance (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_lab1,&__pyx_n_s_lab2,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lab1)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lab2)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_cie2000_distance", 1, 2, 2, 1); __PYX_ERR(0, 204, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_cie2000_distance") < 0)) __PYX_ERR(0, 204, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_lab1 = values[0];
    __pyx_v_lab2 = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_cie2000_distance", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 204, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics._cie2000_distance", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_20_cie2000_distance(__pyx_self, __pyx_v_lab1, __pyx_v_lab2);

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_20_cie2000_distance(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_lab1, PyObject *__pyx_v_lab2) {
  PyObject *__pyx_v_e = NULL;
  PyObject *__pyx_v_kL = NULL;
  PyObject *__pyx_v_kC = NULL;
  PyObject *__pyx_v_kH = NULL;
  PyObject *__pyx_v_L1 = NULL;
  PyObject *__pyx_v_L2 = NULL;
  PyObject *__pyx_v_a1 = NULL;
  PyObject *__pyx_v_a2 = NULL;
  PyObject *__pyx_v_b1 = NULL;
  PyObject *__pyx_v_b2 = NULL;
  PyObject *__pyx_v_dL = NULL;
  PyObject *__pyx_v_Lm = NULL;
  PyObject *__pyx_v_C1 = NULL;
  PyObject *__pyx_v_C2 = NULL;
  PyObject *__pyx_v_Cm = NULL;
  PyObject *__pyx_v_dC = NULL;
  PyObject *__pyx_v_h1 = NULL;
  PyObject *__pyx_v_h2 = NULL;
  PyObject *__pyx_v_dh = NULL;
  PyObject *__pyx_v_dH = NULL;
  PyObject *__pyx_v_Hm = NULL;
  PyObject *__pyx_v_T = NULL;
  PyObject *__pyx_v_SL = NULL;
  PyObject *__pyx_v_SC = NULL;
  PyObject *__pyx_v_SH = NULL;
  PyObject *__pyx_v_rT = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_cie2000_distance", 0);

  /* "mathics/builtin/graphics.py":206
 * def _cie2000_distance(lab1, lab2):
 *     # reference: https://en.wikipedia.org/wiki/Color_difference#CIEDE2000
 *     e = machine_epsilon             # <<<<<<<<<<<<<<
 *     kL = kC = kH = 1  # common values
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_machine_epsilon); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 206, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_e = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":207
 *     # reference: https://en.wikipedia.org/wiki/Color_difference#CIEDE2000
 *     e = machine_epsilon
 *     kL = kC = kH = 1  # common values             # <<<<<<<<<<<<<<
 * 
 *     L1, L2 = lab1[0], lab2[0]
 */
  __Pyx_INCREF(__pyx_int_1);
  __pyx_v_kL = __pyx_int_1;
  __Pyx_INCREF(__pyx_int_1);
  __pyx_v_kC = __pyx_int_1;
  __Pyx_INCREF(__pyx_int_1);
  __pyx_v_kH = __pyx_int_1;

  /* "mathics/builtin/graphics.py":209
 *     kL = kC = kH = 1  # common values
 * 
 *     L1, L2 = lab1[0], lab2[0]             # <<<<<<<<<<<<<<
 *     a1, a2 = lab1[1], lab2[1]
 *     b1, b2 = lab1[2], lab2[2]
 */
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_lab1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 209, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_lab2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 209, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_L1 = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v_L2 = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":210
 * 
 *     L1, L2 = lab1[0], lab2[0]
 *     a1, a2 = lab1[1], lab2[1]             # <<<<<<<<<<<<<<
 *     b1, b2 = lab1[2], lab2[2]
 * 
 */
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_lab1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 210, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_lab2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 210, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_a1 = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_v_a2 = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":211
 *     L1, L2 = lab1[0], lab2[0]
 *     a1, a2 = lab1[1], lab2[1]
 *     b1, b2 = lab1[2], lab2[2]             # <<<<<<<<<<<<<<
 * 
 *     dL = L2 - L1
 */
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_lab1, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 211, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_lab2, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 211, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_b1 = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v_b2 = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":213
 *     b1, b2 = lab1[2], lab2[2]
 * 
 *     dL = L2 - L1             # <<<<<<<<<<<<<<
 *     Lm = (L1 + L2) / 2
 *     C1 = sqrt(a1 ** 2 + b1 ** 2)
 */
  __pyx_t_2 = PyNumber_Subtract(__pyx_v_L2, __pyx_v_L1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 213, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_dL = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":214
 * 
 *     dL = L2 - L1
 *     Lm = (L1 + L2) / 2             # <<<<<<<<<<<<<<
 *     C1 = sqrt(a1 ** 2 + b1 ** 2)
 *     C2 = sqrt(a2 ** 2 + b2 ** 2)
 */
  __pyx_t_2 = PyNumber_Add(__pyx_v_L1, __pyx_v_L2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 214, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyInt_TrueDivideObjC(__pyx_t_2, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 214, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_Lm = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":215
 *     dL = L2 - L1
 *     Lm = (L1 + L2) / 2
 *     C1 = sqrt(a1 ** 2 + b1 ** 2)             # <<<<<<<<<<<<<<
 *     C2 = sqrt(a2 ** 2 + b2 ** 2)
 *     Cm = (C1 + C2) / 2
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 215, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyNumber_Power(__pyx_v_a1, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 215, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyNumber_Power(__pyx_v_b1, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 215, __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(0, 215, __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 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 215, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_C1 = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":216
 *     Lm = (L1 + L2) / 2
 *     C1 = sqrt(a1 ** 2 + b1 ** 2)
 *     C2 = sqrt(a2 ** 2 + b2 ** 2)             # <<<<<<<<<<<<<<
 *     Cm = (C1 + C2) / 2
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 216, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = PyNumber_Power(__pyx_v_a2, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 216, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = PyNumber_Power(__pyx_v_b2, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 216, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 216, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 216, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_C2 = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":217
 *     C1 = sqrt(a1 ** 2 + b1 ** 2)
 *     C2 = sqrt(a2 ** 2 + b2 ** 2)
 *     Cm = (C1 + C2) / 2             # <<<<<<<<<<<<<<
 * 
 *     a1 = a1 * (1 + (1 - sqrt(Cm ** 7 / (Cm ** 7 + 25 ** 7))) / 2)
 */
  __pyx_t_1 = PyNumber_Add(__pyx_v_C1, __pyx_v_C2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_TrueDivideObjC(__pyx_t_1, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_Cm = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":219
 *     Cm = (C1 + C2) / 2
 * 
 *     a1 = a1 * (1 + (1 - sqrt(Cm ** 7 / (Cm ** 7 + 25 ** 7))) / 2)             # <<<<<<<<<<<<<<
 *     a2 = a2 * (1 + (1 - sqrt(Cm ** 7 / (Cm ** 7 + 25 ** 7))) / 2)
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 219, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyNumber_Power(__pyx_v_Cm, __pyx_int_7, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 219, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyNumber_Power(__pyx_v_Cm, __pyx_int_7, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 219, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_int_6103515625); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 219, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 219, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 219, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyInt_SubtractCObj(__pyx_int_1, __pyx_t_2, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 219, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyInt_TrueDivideObjC(__pyx_t_1, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 219, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyInt_AddCObj(__pyx_int_1, __pyx_t_2, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 219, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_Multiply(__pyx_v_a1, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 219, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF_SET(__pyx_v_a1, __pyx_t_2);
  __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":220
 * 
 *     a1 = a1 * (1 + (1 - sqrt(Cm ** 7 / (Cm ** 7 + 25 ** 7))) / 2)
 *     a2 = a2 * (1 + (1 - sqrt(Cm ** 7 / (Cm ** 7 + 25 ** 7))) / 2)             # <<<<<<<<<<<<<<
 * 
 *     C1 = sqrt(a1 ** 2 + b1 ** 2)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 220, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyNumber_Power(__pyx_v_Cm, __pyx_int_7, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 220, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyNumber_Power(__pyx_v_Cm, __pyx_int_7, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 220, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = PyNumber_Add(__pyx_t_5, __pyx_int_6103515625); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 220, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyNumber_Divide(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 220, __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_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 220, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyInt_SubtractCObj(__pyx_int_1, __pyx_t_2, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 220, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyInt_TrueDivideObjC(__pyx_t_1, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 220, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyInt_AddCObj(__pyx_int_1, __pyx_t_2, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 220, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_Multiply(__pyx_v_a2, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 220, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF_SET(__pyx_v_a2, __pyx_t_2);
  __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":222
 *     a2 = a2 * (1 + (1 - sqrt(Cm ** 7 / (Cm ** 7 + 25 ** 7))) / 2)
 * 
 *     C1 = sqrt(a1 ** 2 + b1 ** 2)             # <<<<<<<<<<<<<<
 *     C2 = sqrt(a2 ** 2 + b2 ** 2)
 *     Cm = (C1 + C2) / 2
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 222, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyNumber_Power(__pyx_v_a1, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 222, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = PyNumber_Power(__pyx_v_b1, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 222, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 222, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 222, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF_SET(__pyx_v_C1, __pyx_t_2);
  __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":223
 * 
 *     C1 = sqrt(a1 ** 2 + b1 ** 2)
 *     C2 = sqrt(a2 ** 2 + b2 ** 2)             # <<<<<<<<<<<<<<
 *     Cm = (C1 + C2) / 2
 *     dC = C2 - C1
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 223, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyNumber_Power(__pyx_v_a2, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 223, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyNumber_Power(__pyx_v_b2, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 223, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 223, __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_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 223, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF_SET(__pyx_v_C2, __pyx_t_2);
  __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":224
 *     C1 = sqrt(a1 ** 2 + b1 ** 2)
 *     C2 = sqrt(a2 ** 2 + b2 ** 2)
 *     Cm = (C1 + C2) / 2             # <<<<<<<<<<<<<<
 *     dC = C2 - C1
 * 
 */
  __pyx_t_2 = PyNumber_Add(__pyx_v_C1, __pyx_v_C2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyInt_TrueDivideObjC(__pyx_t_2, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF_SET(__pyx_v_Cm, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":225
 *     C2 = sqrt(a2 ** 2 + b2 ** 2)
 *     Cm = (C1 + C2) / 2
 *     dC = C2 - C1             # <<<<<<<<<<<<<<
 * 
 *     h1 = (180 * atan2(b1, a1 + e)) / pi % 360
 */
  __pyx_t_1 = PyNumber_Subtract(__pyx_v_C2, __pyx_v_C1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 225, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_dC = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":227
 *     dC = C2 - C1
 * 
 *     h1 = (180 * atan2(b1, a1 + e)) / pi % 360             # <<<<<<<<<<<<<<
 *     h2 = (180 * atan2(b2, a2 + e)) / pi % 360
 *     if abs(h2 - h1) <= 180:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_atan2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 227, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = PyNumber_Add(__pyx_v_a1, __pyx_v_e); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 227, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_b1, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 227, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_b1, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 227, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else
  #endif
  {
    __pyx_t_4 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 227, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(__pyx_v_b1);
    __Pyx_GIVEREF(__pyx_v_b1);
    PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_6, __pyx_v_b1);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_6, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 227, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_Multiply(__pyx_int_180, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 227, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_pi); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 227, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyNumber_Divide(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 227, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyInt_RemainderObjC(__pyx_t_4, __pyx_int_360, 0x168, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 227, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_h1 = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":228
 * 
 *     h1 = (180 * atan2(b1, a1 + e)) / pi % 360
 *     h2 = (180 * atan2(b2, a2 + e)) / pi % 360             # <<<<<<<<<<<<<<
 *     if abs(h2 - h1) <= 180:
 *         dh = h2 - h1
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_atan2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = PyNumber_Add(__pyx_v_a2, __pyx_v_e); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_6 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_b2, __pyx_t_2};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 228, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_b2, __pyx_t_2};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 228, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else
  #endif
  {
    __pyx_t_3 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 228, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (__pyx_t_5) {
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __pyx_t_5 = NULL;
    }
    __Pyx_INCREF(__pyx_v_b2);
    __Pyx_GIVEREF(__pyx_v_b2);
    PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_6, __pyx_v_b2);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_6, __pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 228, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyNumber_Multiply(__pyx_int_180, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_pi); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyInt_RemainderObjC(__pyx_t_3, __pyx_int_360, 0x168, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_h2 = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":229
 *     h1 = (180 * atan2(b1, a1 + e)) / pi % 360
 *     h2 = (180 * atan2(b2, a2 + e)) / pi % 360
 *     if abs(h2 - h1) <= 180:             # <<<<<<<<<<<<<<
 *         dh = h2 - h1
 *     elif abs(h2 - h1) > 180 and h2 <= h1:
 */
  __pyx_t_1 = PyNumber_Subtract(__pyx_v_h2, __pyx_v_h1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyNumber_Absolute(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 229, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_int_180, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 229, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_7) {

    /* "mathics/builtin/graphics.py":230
 *     h2 = (180 * atan2(b2, a2 + e)) / pi % 360
 *     if abs(h2 - h1) <= 180:
 *         dh = h2 - h1             # <<<<<<<<<<<<<<
 *     elif abs(h2 - h1) > 180 and h2 <= h1:
 *         dh = h2 - h1 + 360
 */
    __pyx_t_1 = PyNumber_Subtract(__pyx_v_h2, __pyx_v_h1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 230, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_dh = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "mathics/builtin/graphics.py":229
 *     h1 = (180 * atan2(b1, a1 + e)) / pi % 360
 *     h2 = (180 * atan2(b2, a2 + e)) / pi % 360
 *     if abs(h2 - h1) <= 180:             # <<<<<<<<<<<<<<
 *         dh = h2 - h1
 *     elif abs(h2 - h1) > 180 and h2 <= h1:
 */
    goto __pyx_L3;
  }

  /* "mathics/builtin/graphics.py":231
 *     if abs(h2 - h1) <= 180:
 *         dh = h2 - h1
 *     elif abs(h2 - h1) > 180 and h2 <= h1:             # <<<<<<<<<<<<<<
 *         dh = h2 - h1 + 360
 *     elif abs(h2 - h1) > 180 and h2 > h1:
 */
  __pyx_t_1 = PyNumber_Subtract(__pyx_v_h2, __pyx_v_h1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyNumber_Absolute(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_int_180, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 231, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_8) {
  } else {
    __pyx_t_7 = __pyx_t_8;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_h2, __pyx_v_h1, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error)
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 231, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_7 = __pyx_t_8;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_7) {

    /* "mathics/builtin/graphics.py":232
 *         dh = h2 - h1
 *     elif abs(h2 - h1) > 180 and h2 <= h1:
 *         dh = h2 - h1 + 360             # <<<<<<<<<<<<<<
 *     elif abs(h2 - h1) > 180 and h2 > h1:
 *         dh = h2 - h1 - 360
 */
    __pyx_t_1 = PyNumber_Subtract(__pyx_v_h2, __pyx_v_h1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 232, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_360, 0x168, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 232, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_dh = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "mathics/builtin/graphics.py":231
 *     if abs(h2 - h1) <= 180:
 *         dh = h2 - h1
 *     elif abs(h2 - h1) > 180 and h2 <= h1:             # <<<<<<<<<<<<<<
 *         dh = h2 - h1 + 360
 *     elif abs(h2 - h1) > 180 and h2 > h1:
 */
    goto __pyx_L3;
  }

  /* "mathics/builtin/graphics.py":233
 *     elif abs(h2 - h1) > 180 and h2 <= h1:
 *         dh = h2 - h1 + 360
 *     elif abs(h2 - h1) > 180 and h2 > h1:             # <<<<<<<<<<<<<<
 *         dh = h2 - h1 - 360
 * 
 */
  __pyx_t_3 = PyNumber_Subtract(__pyx_v_h2, __pyx_v_h1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyNumber_Absolute(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_int_180, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 233, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 233, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_8) {
  } else {
    __pyx_t_7 = __pyx_t_8;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_3 = PyObject_RichCompare(__pyx_v_h2, __pyx_v_h1, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 233, __pyx_L1_error)
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 233, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_7 = __pyx_t_8;
  __pyx_L6_bool_binop_done:;
  if (__pyx_t_7) {

    /* "mathics/builtin/graphics.py":234
 *         dh = h2 - h1 + 360
 *     elif abs(h2 - h1) > 180 and h2 > h1:
 *         dh = h2 - h1 - 360             # <<<<<<<<<<<<<<
 * 
 *     dH = 2 * sqrt(C1 * C2) * sin(radians(dh) / 2)
 */
    __pyx_t_3 = PyNumber_Subtract(__pyx_v_h2, __pyx_v_h1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 234, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_t_3, __pyx_int_360, 0x168, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_dh = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "mathics/builtin/graphics.py":233
 *     elif abs(h2 - h1) > 180 and h2 <= h1:
 *         dh = h2 - h1 + 360
 *     elif abs(h2 - h1) > 180 and h2 > h1:             # <<<<<<<<<<<<<<
 *         dh = h2 - h1 - 360
 * 
 */
  }
  __pyx_L3:;

  /* "mathics/builtin/graphics.py":236
 *         dh = h2 - h1 - 360
 * 
 *     dH = 2 * sqrt(C1 * C2) * sin(radians(dh) / 2)             # <<<<<<<<<<<<<<
 * 
 *     Hm = (h1 + h2) / 2 if abs(h2 - h1) <= 180 else (h1 + h2 + 360) / 2
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 236, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyNumber_Multiply(__pyx_v_C1, __pyx_v_C2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 236, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Multiply(__pyx_int_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 236, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_sin); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 236, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_radians); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 236, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (unlikely(!__pyx_v_dh)) { __Pyx_RaiseUnboundLocalError("dh"); __PYX_ERR(0, 236, __pyx_L1_error) }
  __pyx_t_9 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_9)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_2 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_9, __pyx_v_dh) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_dh);
  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 236, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyInt_TrueDivideObjC(__pyx_t_2, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 236, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_2, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5);
  __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(0, 236, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyNumber_Multiply(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 236, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_dH = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":238
 *     dH = 2 * sqrt(C1 * C2) * sin(radians(dh) / 2)
 * 
 *     Hm = (h1 + h2) / 2 if abs(h2 - h1) <= 180 else (h1 + h2 + 360) / 2             # <<<<<<<<<<<<<<
 *     T = (
 *         1
 */
  __pyx_t_1 = PyNumber_Subtract(__pyx_v_h2, __pyx_v_h1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyNumber_Absolute(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_int_180, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 238, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_7) {
    __pyx_t_1 = PyNumber_Add(__pyx_v_h1, __pyx_v_h2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyInt_TrueDivideObjC(__pyx_t_1, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 238, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __pyx_t_3;
    __pyx_t_3 = 0;
  } else {
    __pyx_t_3 = PyNumber_Add(__pyx_v_h1, __pyx_v_h2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 238, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_360, 0x168, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyInt_TrueDivideObjC(__pyx_t_1, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 238, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __pyx_t_3;
    __pyx_t_3 = 0;
  }
  __pyx_v_Hm = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":241
 *     T = (
 *         1
 *         - 0.17 * cos(radians(Hm - 30))             # <<<<<<<<<<<<<<
 *         + 0.24 * cos(radians(2 * Hm))
 *         + 0.32 * cos(radians(3 * Hm + 6))
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_cos); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_radians); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_v_Hm, __pyx_int_30, 30, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_9 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_9)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_1 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_9, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Multiply(__pyx_float_0_17, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyInt_SubtractCObj(__pyx_int_1, __pyx_t_3, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":242
 *         1
 *         - 0.17 * cos(radians(Hm - 30))
 *         + 0.24 * cos(radians(2 * Hm))             # <<<<<<<<<<<<<<
 *         + 0.32 * cos(radians(3 * Hm + 6))
 *         - 0.2 * cos(radians(4 * Hm - 63))
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_cos); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 242, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_radians); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 242, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_9 = PyNumber_Multiply(__pyx_int_2, __pyx_v_Hm); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 242, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_10 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_10)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_10);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_5 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_10, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 242, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_2, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5);
  __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(0, 242, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_Multiply(__pyx_float_0_24, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 242, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Add(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 242, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":243
 *         - 0.17 * cos(radians(Hm - 30))
 *         + 0.24 * cos(radians(2 * Hm))
 *         + 0.32 * cos(radians(3 * Hm + 6))             # <<<<<<<<<<<<<<
 *         - 0.2 * cos(radians(4 * Hm - 63))
 *     )
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_cos); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 243, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_radians); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 243, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_9 = PyNumber_Multiply(__pyx_int_3, __pyx_v_Hm); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 243, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_10 = __Pyx_PyInt_AddObjC(__pyx_t_9, __pyx_int_6, 6, 0, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 243, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_9)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_5 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_9, __pyx_t_10) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_10);
  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 243, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_2, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5);
  __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(0, 243, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyNumber_Multiply(__pyx_float_0_32, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 243, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 243, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":244
 *         + 0.24 * cos(radians(2 * Hm))
 *         + 0.32 * cos(radians(3 * Hm + 6))
 *         - 0.2 * cos(radians(4 * Hm - 63))             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_cos); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 244, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_radians); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 244, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_10 = PyNumber_Multiply(__pyx_int_4, __pyx_v_Hm); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 244, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_9 = __Pyx_PyInt_SubtractObjC(__pyx_t_10, __pyx_int_63, 63, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 244, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_10)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_10);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_5 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_10, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 244, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_4 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5);
  __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(0, 244, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Multiply(__pyx_float_0_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 244, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyNumber_Subtract(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 244, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_T = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":247
 *     )
 * 
 *     SL = 1 + (0.015 * (Lm - 50) ** 2) / sqrt(20 + (Lm - 50) ** 2)             # <<<<<<<<<<<<<<
 *     SC = 1 + 0.045 * Cm
 *     SH = 1 + 0.015 * Cm * T
 */
  __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_v_Lm, __pyx_int_50, 50, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 247, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyNumber_Power(__pyx_t_4, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 247, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyNumber_Multiply(__pyx_float_0_015, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 247, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 247, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyInt_SubtractObjC(__pyx_v_Lm, __pyx_int_50, 50, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 247, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = PyNumber_Power(__pyx_t_5, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 247, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyInt_AddCObj(__pyx_int_20, __pyx_t_2, 20, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 247, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_2, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5);
  __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(0, 247, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 247, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyInt_AddCObj(__pyx_int_1, __pyx_t_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 247, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_SL = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":248
 * 
 *     SL = 1 + (0.015 * (Lm - 50) ** 2) / sqrt(20 + (Lm - 50) ** 2)
 *     SC = 1 + 0.045 * Cm             # <<<<<<<<<<<<<<
 *     SH = 1 + 0.015 * Cm * T
 * 
 */
  __pyx_t_3 = PyNumber_Multiply(__pyx_float_0_045, __pyx_v_Cm); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 248, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyInt_AddCObj(__pyx_int_1, __pyx_t_3, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 248, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_SC = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":249
 *     SL = 1 + (0.015 * (Lm - 50) ** 2) / sqrt(20 + (Lm - 50) ** 2)
 *     SC = 1 + 0.045 * Cm
 *     SH = 1 + 0.015 * Cm * T             # <<<<<<<<<<<<<<
 * 
 *     rT = (
 */
  __pyx_t_1 = PyNumber_Multiply(__pyx_float_0_015, __pyx_v_Cm); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 249, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_v_T); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 249, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyInt_AddCObj(__pyx_int_1, __pyx_t_3, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 249, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_SH = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":253
 *     rT = (
 *         -2
 *         * sqrt(Cm ** 7 / (Cm ** 7 + 25 ** 7))             # <<<<<<<<<<<<<<
 *         * sin(radians(60 * exp(-((Hm - 275) ** 2 / 25 ** 2))))
 *     )
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 253, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyNumber_Power(__pyx_v_Cm, __pyx_int_7, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 253, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyNumber_Power(__pyx_v_Cm, __pyx_int_7, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 253, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = PyNumber_Add(__pyx_t_5, __pyx_int_6103515625); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 253, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyNumber_Divide(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 253, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5);
  __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(0, 253, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Multiply(__pyx_int_neg_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 253, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":254
 *         -2
 *         * sqrt(Cm ** 7 / (Cm ** 7 + 25 ** 7))
 *         * sin(radians(60 * exp(-((Hm - 275) ** 2 / 25 ** 2))))             # <<<<<<<<<<<<<<
 *     )
 *     return sqrt(
 */
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_sin); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 254, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_radians); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 254, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_exp); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 254, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_11 = __Pyx_PyInt_SubtractObjC(__pyx_v_Hm, __pyx_int_275, 0x113, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 254, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_12 = PyNumber_Power(__pyx_t_11, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 254, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_11 = __Pyx_PyInt_TrueDivideObjC(__pyx_t_12, __pyx_int_625, 0x271, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 254, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = PyNumber_Negative(__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 254, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_11 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
    __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10);
    if (likely(__pyx_t_11)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_11);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_10, function);
    }
  }
  __pyx_t_9 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_11, __pyx_t_12) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_12);
  __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 254, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = PyNumber_Multiply(__pyx_int_60, __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 254, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_9)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_2 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_9, __pyx_t_10) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_10);
  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 254, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 254, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyNumber_Multiply(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 254, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_rT = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":256
 *         * sin(radians(60 * exp(-((Hm - 275) ** 2 / 25 ** 2))))
 *     )
 *     return sqrt(             # <<<<<<<<<<<<<<
 *         (dL / (SL * kL)) ** 2
 *         + (dC / (SC * kC)) ** 2
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 256, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "mathics/builtin/graphics.py":257
 *     )
 *     return sqrt(
 *         (dL / (SL * kL)) ** 2             # <<<<<<<<<<<<<<
 *         + (dC / (SC * kC)) ** 2
 *         + (dH / (SH * kH)) ** 2
 */
  __pyx_t_3 = PyNumber_Multiply(__pyx_v_SL, __pyx_v_kL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 257, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_v_dL, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 257, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Power(__pyx_t_2, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 257, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":258
 *     return sqrt(
 *         (dL / (SL * kL)) ** 2
 *         + (dC / (SC * kC)) ** 2             # <<<<<<<<<<<<<<
 *         + (dH / (SH * kH)) ** 2
 *         + rT * (dC / (SC * kC)) * (dH / (SH * kH))
 */
  __pyx_t_2 = PyNumber_Multiply(__pyx_v_SC, __pyx_v_kC); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyNumber_Divide(__pyx_v_dC, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_Power(__pyx_t_4, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":259
 *         (dL / (SL * kL)) ** 2
 *         + (dC / (SC * kC)) ** 2
 *         + (dH / (SH * kH)) ** 2             # <<<<<<<<<<<<<<
 *         + rT * (dC / (SC * kC)) * (dH / (SH * kH))
 *     )
 */
  __pyx_t_2 = PyNumber_Multiply(__pyx_v_SH, __pyx_v_kH); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 259, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_v_dH, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 259, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_Power(__pyx_t_3, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 259, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Add(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 259, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":260
 *         + (dC / (SC * kC)) ** 2
 *         + (dH / (SH * kH)) ** 2
 *         + rT * (dC / (SC * kC)) * (dH / (SH * kH))             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __pyx_t_2 = PyNumber_Multiply(__pyx_v_SC, __pyx_v_kC); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 260, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyNumber_Divide(__pyx_v_dC, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 260, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_Multiply(__pyx_v_rT, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 260, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyNumber_Multiply(__pyx_v_SH, __pyx_v_kH); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 260, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_10 = __Pyx_PyNumber_Divide(__pyx_v_dH, __pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 260, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyNumber_Multiply(__pyx_t_2, __pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 260, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = PyNumber_Add(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 260, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_5 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_4, __pyx_t_10) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_10);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 256, __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;

  /* "mathics/builtin/graphics.py":204
 * 
 * 
 * def _cie2000_distance(lab1, lab2):             # <<<<<<<<<<<<<<
 *     # reference: https://en.wikipedia.org/wiki/Color_difference#CIEDE2000
 *     e = machine_epsilon
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("mathics.builtin.graphics._cie2000_distance", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_e);
  __Pyx_XDECREF(__pyx_v_kL);
  __Pyx_XDECREF(__pyx_v_kC);
  __Pyx_XDECREF(__pyx_v_kH);
  __Pyx_XDECREF(__pyx_v_L1);
  __Pyx_XDECREF(__pyx_v_L2);
  __Pyx_XDECREF(__pyx_v_a1);
  __Pyx_XDECREF(__pyx_v_a2);
  __Pyx_XDECREF(__pyx_v_b1);
  __Pyx_XDECREF(__pyx_v_b2);
  __Pyx_XDECREF(__pyx_v_dL);
  __Pyx_XDECREF(__pyx_v_Lm);
  __Pyx_XDECREF(__pyx_v_C1);
  __Pyx_XDECREF(__pyx_v_C2);
  __Pyx_XDECREF(__pyx_v_Cm);
  __Pyx_XDECREF(__pyx_v_dC);
  __Pyx_XDECREF(__pyx_v_h1);
  __Pyx_XDECREF(__pyx_v_h2);
  __Pyx_XDECREF(__pyx_v_dh);
  __Pyx_XDECREF(__pyx_v_dH);
  __Pyx_XDECREF(__pyx_v_Hm);
  __Pyx_XDECREF(__pyx_v_T);
  __Pyx_XDECREF(__pyx_v_SL);
  __Pyx_XDECREF(__pyx_v_SC);
  __Pyx_XDECREF(__pyx_v_SH);
  __Pyx_XDECREF(__pyx_v_rT);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":264
 * 
 * 
 * def _CMC_distance(lab1, lab2, l, c):             # <<<<<<<<<<<<<<
 *     # reference https://en.wikipedia.org/wiki/Color_difference#CMC_l:c_.281984.29
 *     L1, L2 = lab1[0], lab2[0]
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_23_CMC_distance(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_23_CMC_distance = {"_CMC_distance", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_23_CMC_distance, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_23_CMC_distance(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_lab1 = 0;
  PyObject *__pyx_v_lab2 = 0;
  PyObject *__pyx_v_l = 0;
  PyObject *__pyx_v_c = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_CMC_distance (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_lab1,&__pyx_n_s_lab2,&__pyx_n_s_l,&__pyx_n_s_c,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lab1)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lab2)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_CMC_distance", 1, 4, 4, 1); __PYX_ERR(0, 264, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_l)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_CMC_distance", 1, 4, 4, 2); __PYX_ERR(0, 264, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_c)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_CMC_distance", 1, 4, 4, 3); __PYX_ERR(0, 264, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_CMC_distance") < 0)) __PYX_ERR(0, 264, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __pyx_v_lab1 = values[0];
    __pyx_v_lab2 = values[1];
    __pyx_v_l = values[2];
    __pyx_v_c = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_CMC_distance", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 264, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics._CMC_distance", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_22_CMC_distance(__pyx_self, __pyx_v_lab1, __pyx_v_lab2, __pyx_v_l, __pyx_v_c);

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_22_CMC_distance(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_lab1, PyObject *__pyx_v_lab2, PyObject *__pyx_v_l, PyObject *__pyx_v_c) {
  PyObject *__pyx_v_L1 = NULL;
  PyObject *__pyx_v_L2 = NULL;
  PyObject *__pyx_v_a1 = NULL;
  PyObject *__pyx_v_a2 = NULL;
  PyObject *__pyx_v_b1 = NULL;
  PyObject *__pyx_v_b2 = NULL;
  PyObject *__pyx_v_dL = NULL;
  PyObject *__pyx_v_da = NULL;
  PyObject *__pyx_v_db = NULL;
  PyObject *__pyx_v_e = NULL;
  PyObject *__pyx_v_C1 = NULL;
  PyObject *__pyx_v_C2 = NULL;
  PyObject *__pyx_v_h1 = NULL;
  PyObject *__pyx_v_dC = NULL;
  PyObject *__pyx_v_dH2 = NULL;
  PyObject *__pyx_v_F = NULL;
  PyObject *__pyx_v_T = NULL;
  PyObject *__pyx_v_SL = NULL;
  PyObject *__pyx_v_SC = NULL;
  PyObject *__pyx_v_SH = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_CMC_distance", 0);

  /* "mathics/builtin/graphics.py":266
 * def _CMC_distance(lab1, lab2, l, c):
 *     # reference https://en.wikipedia.org/wiki/Color_difference#CMC_l:c_.281984.29
 *     L1, L2 = lab1[0], lab2[0]             # <<<<<<<<<<<<<<
 *     a1, a2 = lab1[1], lab2[1]
 *     b1, b2 = lab1[2], lab2[2]
 */
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_lab1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 266, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_lab2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 266, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_L1 = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v_L2 = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":267
 *     # reference https://en.wikipedia.org/wiki/Color_difference#CMC_l:c_.281984.29
 *     L1, L2 = lab1[0], lab2[0]
 *     a1, a2 = lab1[1], lab2[1]             # <<<<<<<<<<<<<<
 *     b1, b2 = lab1[2], lab2[2]
 * 
 */
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_lab1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 267, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_lab2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 267, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_a1 = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_v_a2 = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":268
 *     L1, L2 = lab1[0], lab2[0]
 *     a1, a2 = lab1[1], lab2[1]
 *     b1, b2 = lab1[2], lab2[2]             # <<<<<<<<<<<<<<
 * 
 *     dL, da, db = L2 - L1, a2 - a1, b2 - b1
 */
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_lab1, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 268, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_lab2, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 268, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_b1 = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v_b2 = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":270
 *     b1, b2 = lab1[2], lab2[2]
 * 
 *     dL, da, db = L2 - L1, a2 - a1, b2 - b1             # <<<<<<<<<<<<<<
 *     e = machine_epsilon
 * 
 */
  __pyx_t_2 = PyNumber_Subtract(__pyx_v_L2, __pyx_v_L1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 270, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyNumber_Subtract(__pyx_v_a2, __pyx_v_a1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 270, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyNumber_Subtract(__pyx_v_b2, __pyx_v_b1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 270, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_dL = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_v_da = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v_db = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":271
 * 
 *     dL, da, db = L2 - L1, a2 - a1, b2 - b1
 *     e = machine_epsilon             # <<<<<<<<<<<<<<
 * 
 *     C1 = sqrt(a1 ** 2 + b1 ** 2)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_machine_epsilon); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 271, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_e = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":273
 *     e = machine_epsilon
 * 
 *     C1 = sqrt(a1 ** 2 + b1 ** 2)             # <<<<<<<<<<<<<<
 *     C2 = sqrt(a2 ** 2 + b2 ** 2)
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 273, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Power(__pyx_v_a1, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 273, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyNumber_Power(__pyx_v_b1, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 273, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyNumber_Add(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 273, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 273, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_C1 = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":274
 * 
 *     C1 = sqrt(a1 ** 2 + b1 ** 2)
 *     C2 = sqrt(a2 ** 2 + b2 ** 2)             # <<<<<<<<<<<<<<
 * 
 *     h1 = (180 * atan2(b1, a1 + e)) / pi % 360
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 274, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyNumber_Power(__pyx_v_a2, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 274, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = PyNumber_Power(__pyx_v_b2, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 274, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 274, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 274, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_C2 = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":276
 *     C2 = sqrt(a2 ** 2 + b2 ** 2)
 * 
 *     h1 = (180 * atan2(b1, a1 + e)) / pi % 360             # <<<<<<<<<<<<<<
 *     dC = C2 - C1
 *     dH2 = da ** 2 + db ** 2 - dC ** 2
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_atan2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 276, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Add(__pyx_v_a1, __pyx_v_e); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 276, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
      __pyx_t_6 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_1)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_b1, __pyx_t_2};
    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 276, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_b1, __pyx_t_2};
    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 276, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 276, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_4) {
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
    }
    __Pyx_INCREF(__pyx_v_b1);
    __Pyx_GIVEREF(__pyx_v_b1);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_6, __pyx_v_b1);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_6, __pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 276, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_Multiply(__pyx_int_180, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 276, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pi); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 276, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 276, __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_3 = __Pyx_PyInt_RemainderObjC(__pyx_t_5, __pyx_int_360, 0x168, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 276, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_h1 = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":277
 * 
 *     h1 = (180 * atan2(b1, a1 + e)) / pi % 360
 *     dC = C2 - C1             # <<<<<<<<<<<<<<
 *     dH2 = da ** 2 + db ** 2 - dC ** 2
 *     F = C1 ** 2 / sqrt(C1 ** 4 + 1900)
 */
  __pyx_t_3 = PyNumber_Subtract(__pyx_v_C2, __pyx_v_C1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 277, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_dC = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":278
 *     h1 = (180 * atan2(b1, a1 + e)) / pi % 360
 *     dC = C2 - C1
 *     dH2 = da ** 2 + db ** 2 - dC ** 2             # <<<<<<<<<<<<<<
 *     F = C1 ** 2 / sqrt(C1 ** 4 + 1900)
 *     T = (
 */
  __pyx_t_3 = PyNumber_Power(__pyx_v_da, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 278, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = PyNumber_Power(__pyx_v_db, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 278, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 278, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyNumber_Power(__pyx_v_dC, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 278, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 278, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_dH2 = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":279
 *     dC = C2 - C1
 *     dH2 = da ** 2 + db ** 2 - dC ** 2
 *     F = C1 ** 2 / sqrt(C1 ** 4 + 1900)             # <<<<<<<<<<<<<<
 *     T = (
 *         0.56 + abs(0.2 * cos(radians(h1 + 168)))
 */
  __pyx_t_3 = PyNumber_Power(__pyx_v_C1, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 279, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 279, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Power(__pyx_v_C1, __pyx_int_4, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 279, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_t_2, __pyx_int_1900, 0x76C, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 279, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_5 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 279, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 279, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_F = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":282
 *     T = (
 *         0.56 + abs(0.2 * cos(radians(h1 + 168)))
 *         if (164 <= h1 and h1 <= 345)             # <<<<<<<<<<<<<<
 *         else 0.36 + abs(0.4 * cos(radians(h1 + 35)))
 *     )
 */
  __pyx_t_5 = PyObject_RichCompare(__pyx_int_164, __pyx_v_h1, Py_LE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 282, __pyx_L1_error)
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 282, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_8) {
  } else {
    __pyx_t_7 = __pyx_t_8;
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_t_5 = PyObject_RichCompare(__pyx_v_h1, __pyx_int_345, Py_LE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 282, __pyx_L1_error)
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 282, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_7 = __pyx_t_8;
  __pyx_L3_bool_binop_done:;
  if (__pyx_t_7) {

    /* "mathics/builtin/graphics.py":281
 *     F = C1 ** 2 / sqrt(C1 ** 4 + 1900)
 *     T = (
 *         0.56 + abs(0.2 * cos(radians(h1 + 168)))             # <<<<<<<<<<<<<<
 *         if (164 <= h1 and h1 <= 345)
 *         else 0.36 + abs(0.4 * cos(radians(h1 + 35)))
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_cos); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 281, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_radians); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 281, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_9 = __Pyx_PyInt_AddObjC(__pyx_v_h1, __pyx_int_168, 0xA8, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 281, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_10 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_10)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_4 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_10, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_9);
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 281, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_5 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 281, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyNumber_Multiply(__pyx_float_0_2, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 281, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyNumber_Absolute(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 281, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyFloat_AddCObj(__pyx_float_0_56, __pyx_t_5, 0.56, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 281, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
  } else {

    /* "mathics/builtin/graphics.py":283
 *         0.56 + abs(0.2 * cos(radians(h1 + 168)))
 *         if (164 <= h1 and h1 <= 345)
 *         else 0.36 + abs(0.4 * cos(radians(h1 + 35)))             # <<<<<<<<<<<<<<
 *     )
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_cos); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 283, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_radians); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 283, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_9 = __Pyx_PyInt_AddObjC(__pyx_v_h1, __pyx_int_35, 35, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 283, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_10 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_10)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_4 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_10, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_9);
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 283, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 283, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyNumber_Multiply(__pyx_float_0_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 283, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyNumber_Absolute(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 283, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyFloat_AddCObj(__pyx_float_0_36, __pyx_t_3, 0.36, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 283, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_1 = __pyx_t_5;
    __pyx_t_5 = 0;
  }
  __pyx_v_T = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":286
 *     )
 * 
 *     SL = 0.511 if L1 < 16 else (0.040975 * L1) / (1 + 0.01765 * L1)             # <<<<<<<<<<<<<<
 *     SC = (0.0638 * C1) / (1 + 0.0131 * C1) + 0.638
 *     SH = SC * (F * T + 1 - F)
 */
  __pyx_t_5 = PyObject_RichCompare(__pyx_v_L1, __pyx_int_16, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 286, __pyx_L1_error)
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 286, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_7) {
    __Pyx_INCREF(__pyx_float_0_511);
    __pyx_t_1 = __pyx_float_0_511;
  } else {
    __pyx_t_5 = PyNumber_Multiply(__pyx_float_0_040975, __pyx_v_L1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 286, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = PyNumber_Multiply(__pyx_float_0_01765, __pyx_v_L1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 286, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyInt_AddCObj(__pyx_int_1, __pyx_t_3, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 286, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 286, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
  }
  __pyx_v_SL = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":287
 * 
 *     SL = 0.511 if L1 < 16 else (0.040975 * L1) / (1 + 0.01765 * L1)
 *     SC = (0.0638 * C1) / (1 + 0.0131 * C1) + 0.638             # <<<<<<<<<<<<<<
 *     SH = SC * (F * T + 1 - F)
 *     return sqrt((dL / (l * SL)) ** 2 + (dC / (c * SC)) ** 2 + dH2 / SH ** 2)
 */
  __pyx_t_1 = PyNumber_Multiply(__pyx_float_0_0638, __pyx_v_C1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 287, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyNumber_Multiply(__pyx_float_0_0131, __pyx_v_C1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 287, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyInt_AddCObj(__pyx_int_1, __pyx_t_3, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 287, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 287, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyFloat_AddObjC(__pyx_t_3, __pyx_float_0_638, 0.638, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 287, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_SC = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":288
 *     SL = 0.511 if L1 < 16 else (0.040975 * L1) / (1 + 0.01765 * L1)
 *     SC = (0.0638 * C1) / (1 + 0.0131 * C1) + 0.638
 *     SH = SC * (F * T + 1 - F)             # <<<<<<<<<<<<<<
 *     return sqrt((dL / (l * SL)) ** 2 + (dC / (c * SC)) ** 2 + dH2 / SH ** 2)
 * 
 */
  __pyx_t_4 = PyNumber_Multiply(__pyx_v_F, __pyx_v_T); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 288, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_t_4, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 288, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyNumber_Subtract(__pyx_t_3, __pyx_v_F); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 288, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Multiply(__pyx_v_SC, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 288, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_SH = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":289
 *     SC = (0.0638 * C1) / (1 + 0.0131 * C1) + 0.638
 *     SH = SC * (F * T + 1 - F)
 *     return sqrt((dL / (l * SL)) ** 2 + (dC / (c * SC)) ** 2 + dH2 / SH ** 2)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = PyNumber_Multiply(__pyx_v_l, __pyx_v_SL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyNumber_Divide(__pyx_v_dL, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_Power(__pyx_t_5, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyNumber_Multiply(__pyx_v_c, __pyx_v_SC); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_v_dC, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyNumber_Power(__pyx_t_2, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyNumber_Power(__pyx_v_SH, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_v_dH2, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_1, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":264
 * 
 * 
 * def _CMC_distance(lab1, lab2, l, c):             # <<<<<<<<<<<<<<
 *     # reference https://en.wikipedia.org/wiki/Color_difference#CMC_l:c_.281984.29
 *     L1, L2 = lab1[0], lab2[0]
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("mathics.builtin.graphics._CMC_distance", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_L1);
  __Pyx_XDECREF(__pyx_v_L2);
  __Pyx_XDECREF(__pyx_v_a1);
  __Pyx_XDECREF(__pyx_v_a2);
  __Pyx_XDECREF(__pyx_v_b1);
  __Pyx_XDECREF(__pyx_v_b2);
  __Pyx_XDECREF(__pyx_v_dL);
  __Pyx_XDECREF(__pyx_v_da);
  __Pyx_XDECREF(__pyx_v_db);
  __Pyx_XDECREF(__pyx_v_e);
  __Pyx_XDECREF(__pyx_v_C1);
  __Pyx_XDECREF(__pyx_v_C2);
  __Pyx_XDECREF(__pyx_v_h1);
  __Pyx_XDECREF(__pyx_v_dC);
  __Pyx_XDECREF(__pyx_v_dH2);
  __Pyx_XDECREF(__pyx_v_F);
  __Pyx_XDECREF(__pyx_v_T);
  __Pyx_XDECREF(__pyx_v_SL);
  __Pyx_XDECREF(__pyx_v_SC);
  __Pyx_XDECREF(__pyx_v_SH);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":292
 * 
 * 
 * def _extract_graphics(graphics, format, evaluation):             # <<<<<<<<<<<<<<
 *     graphics_box = Expression("MakeBoxes", graphics).evaluate(evaluation)
 *     builtin = GraphicsBox(expression=False)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_25_extract_graphics(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_25_extract_graphics = {"_extract_graphics", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_25_extract_graphics, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_25_extract_graphics(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_graphics = 0;
  PyObject *__pyx_v_format = 0;
  PyObject *__pyx_v_evaluation = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_extract_graphics (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_graphics,&__pyx_n_s_format,&__pyx_n_s_evaluation,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_graphics)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_extract_graphics", 1, 3, 3, 1); __PYX_ERR(0, 292, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_evaluation)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_extract_graphics", 1, 3, 3, 2); __PYX_ERR(0, 292, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_extract_graphics") < 0)) __PYX_ERR(0, 292, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_graphics = values[0];
    __pyx_v_format = values[1];
    __pyx_v_evaluation = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_extract_graphics", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 292, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics._extract_graphics", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_24_extract_graphics(__pyx_self, __pyx_v_graphics, __pyx_v_format, __pyx_v_evaluation);

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

/* "mathics/builtin/graphics.py":319
 * 
 *     if format == "asy":
 *         code = "\n".join(element.to_asy() for element in elements.elements)             # <<<<<<<<<<<<<<
 *     elif format == "svg":
 *         code = elements.to_svg()
 */

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_17_extract_graphics_genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_3_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_3_genexpr *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_3_genexpr(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_3_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_3_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 319, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_2__extract_graphics *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7mathics_7builtin_8graphics_17_extract_graphics_2generator8, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_extract_graphics_locals_genexpr, __pyx_n_s_mathics_builtin_graphics); if (unlikely(!gen)) __PYX_ERR(0, 319, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics._extract_graphics.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_7mathics_7builtin_8graphics_17_extract_graphics_2generator8(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_3_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_3_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 319, __pyx_L1_error)
  __pyx_r = PyList_New(0); if (unlikely(!__pyx_r)) __PYX_ERR(0, 319, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_elements)) { __Pyx_RaiseClosureNameError("elements"); __PYX_ERR(0, 319, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_elements, __pyx_n_s_elements); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 319, __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(0, 319, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 319, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 319, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 319, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 319, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 319, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 319, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_element);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_element, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_element, __pyx_n_s_to_asy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 319, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 319, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(__Pyx_ListComp_Append(__pyx_r, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 319, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

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

/* "mathics/builtin/graphics.py":292
 * 
 * 
 * def _extract_graphics(graphics, format, evaluation):             # <<<<<<<<<<<<<<
 *     graphics_box = Expression("MakeBoxes", graphics).evaluate(evaluation)
 *     builtin = GraphicsBox(expression=False)
 */

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_24_extract_graphics(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_graphics, PyObject *__pyx_v_format, PyObject *__pyx_v_evaluation) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_2__extract_graphics *__pyx_cur_scope;
  PyObject *__pyx_v_graphics_box = NULL;
  PyObject *__pyx_v_builtin = NULL;
  PyObject *__pyx_v_calc_dimensions = NULL;
  PyObject *__pyx_v_xmin = NULL;
  PyObject *__pyx_v_xmax = NULL;
  PyObject *__pyx_v_ymin = NULL;
  PyObject *__pyx_v_ymax = NULL;
  CYTHON_UNUSED PyObject *__pyx_v__ = NULL;
  PyObject *__pyx_v_ex = NULL;
  PyObject *__pyx_v_ey = NULL;
  PyObject *__pyx_v_sx = NULL;
  PyObject *__pyx_v_sy = NULL;
  PyObject *__pyx_v_ox = NULL;
  PyObject *__pyx_v_oy = NULL;
  PyObject *__pyx_v_code = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_extract_graphics", 0);
  __pyx_cur_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_2__extract_graphics *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_2__extract_graphics(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_2__extract_graphics, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_2__extract_graphics *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 292, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }

  /* "mathics/builtin/graphics.py":293
 * 
 * def _extract_graphics(graphics, format, evaluation):
 *     graphics_box = Expression("MakeBoxes", graphics).evaluate(evaluation)             # <<<<<<<<<<<<<<
 *     builtin = GraphicsBox(expression=False)
 *     elements, calc_dimensions = builtin._prepare_elements(
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Expression); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 293, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_n_u_MakeBoxes, __pyx_v_graphics};
    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 293, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_n_u_MakeBoxes, __pyx_v_graphics};
    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 293, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else
  #endif
  {
    __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 293, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_4) {
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
    }
    __Pyx_INCREF(__pyx_n_u_MakeBoxes);
    __Pyx_GIVEREF(__pyx_n_u_MakeBoxes);
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_n_u_MakeBoxes);
    __Pyx_INCREF(__pyx_v_graphics);
    __Pyx_GIVEREF(__pyx_v_graphics);
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_graphics);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 293, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_evaluate); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 293, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_v_evaluation) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_evaluation);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 293, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_graphics_box = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":294
 * def _extract_graphics(graphics, format, evaluation):
 *     graphics_box = Expression("MakeBoxes", graphics).evaluate(evaluation)
 *     builtin = GraphicsBox(expression=False)             # <<<<<<<<<<<<<<
 *     elements, calc_dimensions = builtin._prepare_elements(
 *         graphics_box.leaves, {"evaluation": evaluation}, neg_y=True
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_GraphicsBox); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 294, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 294, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_expression, Py_False) < 0) __PYX_ERR(0, 294, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 294, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_builtin = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":295
 *     graphics_box = Expression("MakeBoxes", graphics).evaluate(evaluation)
 *     builtin = GraphicsBox(expression=False)
 *     elements, calc_dimensions = builtin._prepare_elements(             # <<<<<<<<<<<<<<
 *         graphics_box.leaves, {"evaluation": evaluation}, neg_y=True
 *     )
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_builtin, __pyx_n_s_prepare_elements); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "mathics/builtin/graphics.py":296
 *     builtin = GraphicsBox(expression=False)
 *     elements, calc_dimensions = builtin._prepare_elements(
 *         graphics_box.leaves, {"evaluation": evaluation}, neg_y=True             # <<<<<<<<<<<<<<
 *     )
 *     xmin, xmax, ymin, ymax, _, _, _, _ = calc_dimensions()
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_graphics_box, __pyx_n_s_leaves); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_evaluation, __pyx_v_evaluation) < 0) __PYX_ERR(0, 296, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":295
 *     graphics_box = Expression("MakeBoxes", graphics).evaluate(evaluation)
 *     builtin = GraphicsBox(expression=False)
 *     elements, calc_dimensions = builtin._prepare_elements(             # <<<<<<<<<<<<<<
 *         graphics_box.leaves, {"evaluation": evaluation}, neg_y=True
 *     )
 */
  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_1);
  __pyx_t_3 = 0;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":296
 *     builtin = GraphicsBox(expression=False)
 *     elements, calc_dimensions = builtin._prepare_elements(
 *         graphics_box.leaves, {"evaluation": evaluation}, neg_y=True             # <<<<<<<<<<<<<<
 *     )
 *     xmin, xmax, ymin, ymax, _, _, _, _ = calc_dimensions()
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_neg_y, Py_True) < 0) __PYX_ERR(0, 296, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":295
 *     graphics_box = Expression("MakeBoxes", graphics).evaluate(evaluation)
 *     builtin = GraphicsBox(expression=False)
 *     elements, calc_dimensions = builtin._prepare_elements(             # <<<<<<<<<<<<<<
 *         graphics_box.leaves, {"evaluation": evaluation}, neg_y=True
 *     )
 */
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
    PyObject* sequence = __pyx_t_3;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 295, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_6 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_6);
    #else
    __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 295, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 295, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    #endif
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 295, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext;
    index = 0; __pyx_t_1 = __pyx_t_7(__pyx_t_2); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    index = 1; __pyx_t_6 = __pyx_t_7(__pyx_t_2); if (unlikely(!__pyx_t_6)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_2), 2) < 0) __PYX_ERR(0, 295, __pyx_L1_error)
    __pyx_t_7 = NULL;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_7 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 295, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_elements = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v_calc_dimensions = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "mathics/builtin/graphics.py":298
 *         graphics_box.leaves, {"evaluation": evaluation}, neg_y=True
 *     )
 *     xmin, xmax, ymin, ymax, _, _, _, _ = calc_dimensions()             # <<<<<<<<<<<<<<
 * 
 *     # xmin, xmax have always been moved to 0 here. the untransformed
 */
  __Pyx_INCREF(__pyx_v_calc_dimensions);
  __pyx_t_6 = __pyx_v_calc_dimensions; __pyx_t_1 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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 != 8)) {
      if (size > 8) __Pyx_RaiseTooManyValuesError(8);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 298, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 2); 
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 3); 
      __pyx_t_8 = PyTuple_GET_ITEM(sequence, 4); 
      __pyx_t_9 = PyTuple_GET_ITEM(sequence, 5); 
      __pyx_t_10 = PyTuple_GET_ITEM(sequence, 6); 
      __pyx_t_11 = PyTuple_GET_ITEM(sequence, 7); 
    } else {
      __pyx_t_6 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyList_GET_ITEM(sequence, 1); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 2); 
      __pyx_t_4 = PyList_GET_ITEM(sequence, 3); 
      __pyx_t_8 = PyList_GET_ITEM(sequence, 4); 
      __pyx_t_9 = PyList_GET_ITEM(sequence, 5); 
      __pyx_t_10 = PyList_GET_ITEM(sequence, 6); 
      __pyx_t_11 = PyList_GET_ITEM(sequence, 7); 
    }
    __Pyx_INCREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_8);
    __Pyx_INCREF(__pyx_t_9);
    __Pyx_INCREF(__pyx_t_10);
    __Pyx_INCREF(__pyx_t_11);
    #else
    {
      Py_ssize_t i;
      PyObject** temps[8] = {&__pyx_t_6,&__pyx_t_1,&__pyx_t_2,&__pyx_t_4,&__pyx_t_8,&__pyx_t_9,&__pyx_t_10,&__pyx_t_11};
      for (i=0; i < 8; i++) {
        PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 298, __pyx_L1_error)
        __Pyx_GOTREF(item);
        *(temps[i]) = item;
      }
    }
    #endif
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    Py_ssize_t index = -1;
    PyObject** temps[8] = {&__pyx_t_6,&__pyx_t_1,&__pyx_t_2,&__pyx_t_4,&__pyx_t_8,&__pyx_t_9,&__pyx_t_10,&__pyx_t_11};
    __pyx_t_12 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 298, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_7 = Py_TYPE(__pyx_t_12)->tp_iternext;
    for (index=0; index < 8; index++) {
      PyObject* item = __pyx_t_7(__pyx_t_12); if (unlikely(!item)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(item);
      *(temps[index]) = item;
    }
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_12), 8) < 0) __PYX_ERR(0, 298, __pyx_L1_error)
    __pyx_t_7 = NULL;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    goto __pyx_L6_unpacking_done;
    __pyx_L5_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_7 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 298, __pyx_L1_error)
    __pyx_L6_unpacking_done:;
  }
  __pyx_v_xmin = __pyx_t_6;
  __pyx_t_6 = 0;
  __pyx_v_xmax = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v_ymin = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_v_ymax = __pyx_t_4;
  __pyx_t_4 = 0;
  __pyx_v__ = __pyx_t_8;
  __pyx_t_8 = 0;
  __Pyx_DECREF_SET(__pyx_v__, __pyx_t_9);
  __pyx_t_9 = 0;
  __Pyx_DECREF_SET(__pyx_v__, __pyx_t_10);
  __pyx_t_10 = 0;
  __Pyx_DECREF_SET(__pyx_v__, __pyx_t_11);
  __pyx_t_11 = 0;

  /* "mathics/builtin/graphics.py":307
 *     # coordinate space.
 * 
 *     ex = elements.extent_width             # <<<<<<<<<<<<<<
 *     ey = elements.extent_height
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_elements, __pyx_n_s_extent_width); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 307, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_ex = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":308
 * 
 *     ex = elements.extent_width
 *     ey = elements.extent_height             # <<<<<<<<<<<<<<
 * 
 *     sx = (xmax - xmin) / ex
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_elements, __pyx_n_s_extent_height); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 308, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_ey = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":310
 *     ey = elements.extent_height
 * 
 *     sx = (xmax - xmin) / ex             # <<<<<<<<<<<<<<
 *     sy = (ymax - ymin) / ey
 * 
 */
  __pyx_t_3 = PyNumber_Subtract(__pyx_v_xmax, __pyx_v_xmin); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 310, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_11 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_v_ex); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 310, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_sx = __pyx_t_11;
  __pyx_t_11 = 0;

  /* "mathics/builtin/graphics.py":311
 * 
 *     sx = (xmax - xmin) / ex
 *     sy = (ymax - ymin) / ey             # <<<<<<<<<<<<<<
 * 
 *     ox = -elements.xmin * sx + xmin
 */
  __pyx_t_11 = PyNumber_Subtract(__pyx_v_ymax, __pyx_v_ymin); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 311, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_11, __pyx_v_ey); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 311, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_v_sy = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":313
 *     sy = (ymax - ymin) / ey
 * 
 *     ox = -elements.xmin * sx + xmin             # <<<<<<<<<<<<<<
 *     oy = -elements.ymin * sy + ymin
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_elements, __pyx_n_s_xmin); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 313, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_11 = PyNumber_Negative(__pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 313, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Multiply(__pyx_t_11, __pyx_v_sx); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 313, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_11 = PyNumber_Add(__pyx_t_3, __pyx_v_xmin); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 313, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_ox = __pyx_t_11;
  __pyx_t_11 = 0;

  /* "mathics/builtin/graphics.py":314
 * 
 *     ox = -elements.xmin * sx + xmin
 *     oy = -elements.ymin * sy + ymin             # <<<<<<<<<<<<<<
 * 
 *     # generate code for svg or asy.
 */
  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_elements, __pyx_n_s_ymin); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 314, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_3 = PyNumber_Negative(__pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 314, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_11 = PyNumber_Multiply(__pyx_t_3, __pyx_v_sy); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 314, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Add(__pyx_t_11, __pyx_v_ymin); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 314, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_v_oy = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":318
 *     # generate code for svg or asy.
 * 
 *     if format == "asy":             # <<<<<<<<<<<<<<
 *         code = "\n".join(element.to_asy() for element in elements.elements)
 *     elif format == "svg":
 */
  __pyx_t_13 = (__Pyx_PyUnicode_Equals(__pyx_v_format, __pyx_n_u_asy, Py_EQ)); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 318, __pyx_L1_error)
  if (__pyx_t_13) {

    /* "mathics/builtin/graphics.py":319
 * 
 *     if format == "asy":
 *         code = "\n".join(element.to_asy() for element in elements.elements)             # <<<<<<<<<<<<<<
 *     elif format == "svg":
 *         code = elements.to_svg()
 */
    __pyx_t_3 = __pyx_pf_7mathics_7builtin_8graphics_17_extract_graphics_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 319, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_11 = __Pyx_Generator_Next(__pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 319, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyUnicode_Join(__pyx_kp_u__5, __pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 319, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_v_code = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "mathics/builtin/graphics.py":318
 *     # generate code for svg or asy.
 * 
 *     if format == "asy":             # <<<<<<<<<<<<<<
 *         code = "\n".join(element.to_asy() for element in elements.elements)
 *     elif format == "svg":
 */
    goto __pyx_L7;
  }

  /* "mathics/builtin/graphics.py":320
 *     if format == "asy":
 *         code = "\n".join(element.to_asy() for element in elements.elements)
 *     elif format == "svg":             # <<<<<<<<<<<<<<
 *         code = elements.to_svg()
 *     else:
 */
  __pyx_t_13 = (__Pyx_PyUnicode_Equals(__pyx_v_format, __pyx_n_u_svg, Py_EQ)); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 320, __pyx_L1_error)
  if (likely(__pyx_t_13)) {

    /* "mathics/builtin/graphics.py":321
 *         code = "\n".join(element.to_asy() for element in elements.elements)
 *     elif format == "svg":
 *         code = elements.to_svg()             # <<<<<<<<<<<<<<
 *     else:
 *         raise NotImplementedError
 */
    __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_elements, __pyx_n_s_to_svg); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 321, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_10 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_11))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_11);
      if (likely(__pyx_t_10)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_11, function);
      }
    }
    __pyx_t_3 = (__pyx_t_10) ? __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_10) : __Pyx_PyObject_CallNoArg(__pyx_t_11);
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 321, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_v_code = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "mathics/builtin/graphics.py":320
 *     if format == "asy":
 *         code = "\n".join(element.to_asy() for element in elements.elements)
 *     elif format == "svg":             # <<<<<<<<<<<<<<
 *         code = elements.to_svg()
 *     else:
 */
    goto __pyx_L7;
  }

  /* "mathics/builtin/graphics.py":323
 *         code = elements.to_svg()
 *     else:
 *         raise NotImplementedError             # <<<<<<<<<<<<<<
 * 
 *     return xmin, xmax, ymin, ymax, ox, oy, ex, ey, code
 */
  /*else*/ {
    __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0);
    __PYX_ERR(0, 323, __pyx_L1_error)
  }
  __pyx_L7:;

  /* "mathics/builtin/graphics.py":325
 *         raise NotImplementedError
 * 
 *     return xmin, xmax, ymin, ymax, ox, oy, ex, ey, code             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = PyTuple_New(9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 325, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_xmin);
  __Pyx_GIVEREF(__pyx_v_xmin);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_xmin);
  __Pyx_INCREF(__pyx_v_xmax);
  __Pyx_GIVEREF(__pyx_v_xmax);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_xmax);
  __Pyx_INCREF(__pyx_v_ymin);
  __Pyx_GIVEREF(__pyx_v_ymin);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_ymin);
  __Pyx_INCREF(__pyx_v_ymax);
  __Pyx_GIVEREF(__pyx_v_ymax);
  PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_ymax);
  __Pyx_INCREF(__pyx_v_ox);
  __Pyx_GIVEREF(__pyx_v_ox);
  PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_v_ox);
  __Pyx_INCREF(__pyx_v_oy);
  __Pyx_GIVEREF(__pyx_v_oy);
  PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_v_oy);
  __Pyx_INCREF(__pyx_v_ex);
  __Pyx_GIVEREF(__pyx_v_ex);
  PyTuple_SET_ITEM(__pyx_t_3, 6, __pyx_v_ex);
  __Pyx_INCREF(__pyx_v_ey);
  __Pyx_GIVEREF(__pyx_v_ey);
  PyTuple_SET_ITEM(__pyx_t_3, 7, __pyx_v_ey);
  __Pyx_INCREF(__pyx_v_code);
  __Pyx_GIVEREF(__pyx_v_code);
  PyTuple_SET_ITEM(__pyx_t_3, 8, __pyx_v_code);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":292
 * 
 * 
 * def _extract_graphics(graphics, format, evaluation):             # <<<<<<<<<<<<<<
 *     graphics_box = Expression("MakeBoxes", graphics).evaluate(evaluation)
 *     builtin = GraphicsBox(expression=False)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("mathics.builtin.graphics._extract_graphics", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_graphics_box);
  __Pyx_XDECREF(__pyx_v_builtin);
  __Pyx_XDECREF(__pyx_v_calc_dimensions);
  __Pyx_XDECREF(__pyx_v_xmin);
  __Pyx_XDECREF(__pyx_v_xmax);
  __Pyx_XDECREF(__pyx_v_ymin);
  __Pyx_XDECREF(__pyx_v_ymax);
  __Pyx_XDECREF(__pyx_v__);
  __Pyx_XDECREF(__pyx_v_ex);
  __Pyx_XDECREF(__pyx_v_ey);
  __Pyx_XDECREF(__pyx_v_sx);
  __Pyx_XDECREF(__pyx_v_sy);
  __Pyx_XDECREF(__pyx_v_ox);
  __Pyx_XDECREF(__pyx_v_oy);
  __Pyx_XDECREF(__pyx_v_code);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":329
 * 
 * class _SVGTransform:
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         self.transforms = []
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_13_SVGTransform_1__init__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_13_SVGTransform_1__init__ = {"__init__", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_13_SVGTransform_1__init__, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_13_SVGTransform_1__init__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_13_SVGTransform___init__(__pyx_self, ((PyObject *)__pyx_v_self));

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

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

  /* "mathics/builtin/graphics.py":330
 * class _SVGTransform:
 *     def __init__(self):
 *         self.transforms = []             # <<<<<<<<<<<<<<
 * 
 *     def matrix(self, a, b, c, d, e, f):
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 330, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_transforms, __pyx_t_1) < 0) __PYX_ERR(0, 330, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":329
 * 
 * class _SVGTransform:
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         self.transforms = []
 * 
 */

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

/* "mathics/builtin/graphics.py":332
 *         self.transforms = []
 * 
 *     def matrix(self, a, b, c, d, e, f):             # <<<<<<<<<<<<<<
 *         # a c e
 *         # b d f
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_13_SVGTransform_3matrix(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_13_SVGTransform_3matrix = {"matrix", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_13_SVGTransform_3matrix, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_13_SVGTransform_3matrix(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_a = 0;
  PyObject *__pyx_v_b = 0;
  PyObject *__pyx_v_c = 0;
  PyObject *__pyx_v_d = 0;
  PyObject *__pyx_v_e = 0;
  PyObject *__pyx_v_f = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("matrix (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_a,&__pyx_n_s_b,&__pyx_n_s_c,&__pyx_n_s_d,&__pyx_n_s_e,&__pyx_n_s_f,0};
    PyObject* values[7] = {0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("matrix", 1, 7, 7, 1); __PYX_ERR(0, 332, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("matrix", 1, 7, 7, 2); __PYX_ERR(0, 332, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_c)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("matrix", 1, 7, 7, 3); __PYX_ERR(0, 332, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_d)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("matrix", 1, 7, 7, 4); __PYX_ERR(0, 332, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_e)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("matrix", 1, 7, 7, 5); __PYX_ERR(0, 332, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_f)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("matrix", 1, 7, 7, 6); __PYX_ERR(0, 332, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "matrix") < 0)) __PYX_ERR(0, 332, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 7) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
    }
    __pyx_v_self = values[0];
    __pyx_v_a = values[1];
    __pyx_v_b = values[2];
    __pyx_v_c = values[3];
    __pyx_v_d = values[4];
    __pyx_v_e = values[5];
    __pyx_v_f = values[6];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("matrix", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 332, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics._SVGTransform.matrix", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_13_SVGTransform_2matrix(__pyx_self, __pyx_v_self, __pyx_v_a, __pyx_v_b, __pyx_v_c, __pyx_v_d, __pyx_v_e, __pyx_v_f);

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_13_SVGTransform_2matrix(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e, PyObject *__pyx_v_f) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  Py_UCS4 __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("matrix", 0);

  /* "mathics/builtin/graphics.py":336
 *         # b d f
 *         # 0 0 1
 *         self.transforms.append("matrix(%f, %f, %f, %f, %f, %f)" % (a, b, c, d, e, f))             # <<<<<<<<<<<<<<
 * 
 *     def translate(self, x, y):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_transforms); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 336, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(13); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 336, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = 0;
  __pyx_t_4 = 127;
  __Pyx_INCREF(__pyx_kp_u_matrix);
  __pyx_t_3 += 7;
  __Pyx_GIVEREF(__pyx_kp_u_matrix);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u_matrix);
  __pyx_t_5 = __Pyx_PyObject_Format(__pyx_v_a, __pyx_n_u_f); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 336, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_4;
  __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_INCREF(__pyx_kp_u__4);
  __pyx_t_3 += 2;
  __Pyx_GIVEREF(__pyx_kp_u__4);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u__4);
  __pyx_t_5 = __Pyx_PyObject_Format(__pyx_v_b, __pyx_n_u_f); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 336, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_4;
  __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_INCREF(__pyx_kp_u__4);
  __pyx_t_3 += 2;
  __Pyx_GIVEREF(__pyx_kp_u__4);
  PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_kp_u__4);
  __pyx_t_5 = __Pyx_PyObject_Format(__pyx_v_c, __pyx_n_u_f); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 336, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_4;
  __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_2, 5, __pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_INCREF(__pyx_kp_u__4);
  __pyx_t_3 += 2;
  __Pyx_GIVEREF(__pyx_kp_u__4);
  PyTuple_SET_ITEM(__pyx_t_2, 6, __pyx_kp_u__4);
  __pyx_t_5 = __Pyx_PyObject_Format(__pyx_v_d, __pyx_n_u_f); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 336, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_4;
  __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_2, 7, __pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_INCREF(__pyx_kp_u__4);
  __pyx_t_3 += 2;
  __Pyx_GIVEREF(__pyx_kp_u__4);
  PyTuple_SET_ITEM(__pyx_t_2, 8, __pyx_kp_u__4);
  __pyx_t_5 = __Pyx_PyObject_Format(__pyx_v_e, __pyx_n_u_f); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 336, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_4;
  __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_2, 9, __pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_INCREF(__pyx_kp_u__4);
  __pyx_t_3 += 2;
  __Pyx_GIVEREF(__pyx_kp_u__4);
  PyTuple_SET_ITEM(__pyx_t_2, 10, __pyx_kp_u__4);
  __pyx_t_5 = __Pyx_PyObject_Format(__pyx_v_f, __pyx_n_u_f); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 336, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_4;
  __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_2, 11, __pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_INCREF(__pyx_kp_u__6);
  __pyx_t_3 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__6);
  PyTuple_SET_ITEM(__pyx_t_2, 12, __pyx_kp_u__6);
  __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_2, 13, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 336, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_6 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_5); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 336, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":332
 *         self.transforms = []
 * 
 *     def matrix(self, a, b, c, d, e, f):             # <<<<<<<<<<<<<<
 *         # a c e
 *         # b d f
 */

  /* 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_AddTraceback("mathics.builtin.graphics._SVGTransform.matrix", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":338
 *         self.transforms.append("matrix(%f, %f, %f, %f, %f, %f)" % (a, b, c, d, e, f))
 * 
 *     def translate(self, x, y):             # <<<<<<<<<<<<<<
 *         self.transforms.append("translate(%f, %f)" % (x, y))
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_13_SVGTransform_5translate(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_13_SVGTransform_5translate = {"translate", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_13_SVGTransform_5translate, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_13_SVGTransform_5translate(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_x = 0;
  PyObject *__pyx_v_y = 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);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_x,&__pyx_n_s_y,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("translate", 1, 3, 3, 1); __PYX_ERR(0, 338, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("translate", 1, 3, 3, 2); __PYX_ERR(0, 338, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "translate") < 0)) __PYX_ERR(0, 338, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_self = values[0];
    __pyx_v_x = values[1];
    __pyx_v_y = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("translate", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 338, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics._SVGTransform.translate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_13_SVGTransform_4translate(__pyx_self, __pyx_v_self, __pyx_v_x, __pyx_v_y);

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_13_SVGTransform_4translate(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  Py_UCS4 __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("translate", 0);

  /* "mathics/builtin/graphics.py":339
 * 
 *     def translate(self, x, y):
 *         self.transforms.append("translate(%f, %f)" % (x, y))             # <<<<<<<<<<<<<<
 * 
 *     def scale(self, x, y):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_transforms); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 339, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 339, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = 0;
  __pyx_t_4 = 127;
  __Pyx_INCREF(__pyx_kp_u_translate_2);
  __pyx_t_3 += 10;
  __Pyx_GIVEREF(__pyx_kp_u_translate_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u_translate_2);
  __pyx_t_5 = __Pyx_PyObject_Format(__pyx_v_x, __pyx_n_u_f); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 339, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_4;
  __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_INCREF(__pyx_kp_u__4);
  __pyx_t_3 += 2;
  __Pyx_GIVEREF(__pyx_kp_u__4);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u__4);
  __pyx_t_5 = __Pyx_PyObject_Format(__pyx_v_y, __pyx_n_u_f); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 339, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_4;
  __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_INCREF(__pyx_kp_u__6);
  __pyx_t_3 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__6);
  PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_kp_u__6);
  __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_2, 5, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 339, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_6 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_5); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 339, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":338
 *         self.transforms.append("matrix(%f, %f, %f, %f, %f, %f)" % (a, b, c, d, e, f))
 * 
 *     def translate(self, x, y):             # <<<<<<<<<<<<<<
 *         self.transforms.append("translate(%f, %f)" % (x, 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_5);
  __Pyx_AddTraceback("mathics.builtin.graphics._SVGTransform.translate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":341
 *         self.transforms.append("translate(%f, %f)" % (x, y))
 * 
 *     def scale(self, x, y):             # <<<<<<<<<<<<<<
 *         self.transforms.append("scale(%f, %f)" % (x, y))
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_13_SVGTransform_7scale(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_13_SVGTransform_7scale = {"scale", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_13_SVGTransform_7scale, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_13_SVGTransform_7scale(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_x = 0;
  PyObject *__pyx_v_y = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("scale (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_x,&__pyx_n_s_y,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scale", 1, 3, 3, 1); __PYX_ERR(0, 341, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scale", 1, 3, 3, 2); __PYX_ERR(0, 341, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "scale") < 0)) __PYX_ERR(0, 341, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_self = values[0];
    __pyx_v_x = values[1];
    __pyx_v_y = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("scale", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 341, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics._SVGTransform.scale", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_13_SVGTransform_6scale(__pyx_self, __pyx_v_self, __pyx_v_x, __pyx_v_y);

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_13_SVGTransform_6scale(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  Py_UCS4 __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("scale", 0);

  /* "mathics/builtin/graphics.py":342
 * 
 *     def scale(self, x, y):
 *         self.transforms.append("scale(%f, %f)" % (x, y))             # <<<<<<<<<<<<<<
 * 
 *     def rotate(self, x):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_transforms); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 342, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 342, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = 0;
  __pyx_t_4 = 127;
  __Pyx_INCREF(__pyx_kp_u_scale);
  __pyx_t_3 += 6;
  __Pyx_GIVEREF(__pyx_kp_u_scale);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u_scale);
  __pyx_t_5 = __Pyx_PyObject_Format(__pyx_v_x, __pyx_n_u_f); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 342, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_4;
  __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_INCREF(__pyx_kp_u__4);
  __pyx_t_3 += 2;
  __Pyx_GIVEREF(__pyx_kp_u__4);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u__4);
  __pyx_t_5 = __Pyx_PyObject_Format(__pyx_v_y, __pyx_n_u_f); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 342, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_4;
  __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_INCREF(__pyx_kp_u__6);
  __pyx_t_3 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__6);
  PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_kp_u__6);
  __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_2, 5, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 342, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_6 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_5); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 342, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":341
 *         self.transforms.append("translate(%f, %f)" % (x, y))
 * 
 *     def scale(self, x, y):             # <<<<<<<<<<<<<<
 *         self.transforms.append("scale(%f, %f)" % (x, 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_5);
  __Pyx_AddTraceback("mathics.builtin.graphics._SVGTransform.scale", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":344
 *         self.transforms.append("scale(%f, %f)" % (x, y))
 * 
 *     def rotate(self, x):             # <<<<<<<<<<<<<<
 *         self.transforms.append("rotate(%f)" % x)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_13_SVGTransform_9rotate(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_13_SVGTransform_9rotate = {"rotate", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_13_SVGTransform_9rotate, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_13_SVGTransform_9rotate(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_x = 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);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_x,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("rotate", 1, 2, 2, 1); __PYX_ERR(0, 344, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rotate") < 0)) __PYX_ERR(0, 344, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_x = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("rotate", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 344, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics._SVGTransform.rotate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_13_SVGTransform_8rotate(__pyx_self, __pyx_v_self, __pyx_v_x);

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

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

  /* "mathics/builtin/graphics.py":345
 * 
 *     def rotate(self, x):
 *         self.transforms.append("rotate(%f)" % x)             # <<<<<<<<<<<<<<
 * 
 *     def apply(self, svg):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_transforms); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 345, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_rotate_f, __pyx_v_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 345, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_2); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 345, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":344
 *         self.transforms.append("scale(%f, %f)" % (x, y))
 * 
 *     def rotate(self, x):             # <<<<<<<<<<<<<<
 *         self.transforms.append("rotate(%f)" % x)
 * 
 */

  /* 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("mathics.builtin.graphics._SVGTransform.rotate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":347
 *         self.transforms.append("rotate(%f)" % x)
 * 
 *     def apply(self, svg):             # <<<<<<<<<<<<<<
 *         return '<g transform="%s">%s</g>' % (" ".join(self.transforms), svg)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_13_SVGTransform_11apply(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_13_SVGTransform_11apply = {"apply", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_13_SVGTransform_11apply, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_13_SVGTransform_11apply(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_svg = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("apply (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_svg,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_svg)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("apply", 1, 2, 2, 1); __PYX_ERR(0, 347, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "apply") < 0)) __PYX_ERR(0, 347, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_svg = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("apply", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 347, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics._SVGTransform.apply", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_13_SVGTransform_10apply(__pyx_self, __pyx_v_self, __pyx_v_svg);

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_13_SVGTransform_10apply(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_svg) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_UCS4 __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("apply", 0);

  /* "mathics/builtin/graphics.py":348
 * 
 *     def apply(self, svg):
 *         return '<g transform="%s">%s</g>' % (" ".join(self.transforms), svg)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 348, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = 0;
  __pyx_t_3 = 127;
  __Pyx_INCREF(__pyx_kp_u_g_transform);
  __pyx_t_2 += 14;
  __Pyx_GIVEREF(__pyx_kp_u_g_transform);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_g_transform);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_transforms); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 348, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyUnicode_Join(__pyx_kp_u__7, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 348, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_INCREF(__pyx_kp_u__8);
  __pyx_t_2 += 2;
  __Pyx_GIVEREF(__pyx_kp_u__8);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u__8);
  __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_svg), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 348, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_INCREF(__pyx_kp_u_g);
  __pyx_t_2 += 4;
  __Pyx_GIVEREF(__pyx_kp_u_g);
  PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u_g);
  __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_1, 5, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 348, __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;

  /* "mathics/builtin/graphics.py":347
 *         self.transforms.append("rotate(%f)" % x)
 * 
 *     def apply(self, svg):             # <<<<<<<<<<<<<<
 *         return '<g transform="%s">%s</g>' % (" ".join(self.transforms), svg)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("mathics.builtin.graphics._SVGTransform.apply", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":363
 *     """
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         self.transforms = []
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_13_ASYTransform_1__init__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_13_ASYTransform_1__init__ = {"__init__", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_13_ASYTransform_1__init__, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_13_ASYTransform_1__init__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_13_ASYTransform___init__(__pyx_self, ((PyObject *)__pyx_v_self));

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

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

  /* "mathics/builtin/graphics.py":364
 * 
 *     def __init__(self):
 *         self.transforms = []             # <<<<<<<<<<<<<<
 * 
 *     def matrix(self, a, b, c, d, e, f):
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_transforms, __pyx_t_1) < 0) __PYX_ERR(0, 364, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":363
 *     """
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         self.transforms = []
 * 
 */

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

/* "mathics/builtin/graphics.py":366
 *         self.transforms = []
 * 
 *     def matrix(self, a, b, c, d, e, f):             # <<<<<<<<<<<<<<
 *         # a c e
 *         # b d f
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_13_ASYTransform_3matrix(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_13_ASYTransform_3matrix = {"matrix", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_13_ASYTransform_3matrix, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_13_ASYTransform_3matrix(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_a = 0;
  PyObject *__pyx_v_b = 0;
  PyObject *__pyx_v_c = 0;
  PyObject *__pyx_v_d = 0;
  PyObject *__pyx_v_e = 0;
  PyObject *__pyx_v_f = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("matrix (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_a,&__pyx_n_s_b,&__pyx_n_s_c,&__pyx_n_s_d,&__pyx_n_s_e,&__pyx_n_s_f,0};
    PyObject* values[7] = {0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("matrix", 1, 7, 7, 1); __PYX_ERR(0, 366, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("matrix", 1, 7, 7, 2); __PYX_ERR(0, 366, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_c)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("matrix", 1, 7, 7, 3); __PYX_ERR(0, 366, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_d)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("matrix", 1, 7, 7, 4); __PYX_ERR(0, 366, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_e)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("matrix", 1, 7, 7, 5); __PYX_ERR(0, 366, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_f)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("matrix", 1, 7, 7, 6); __PYX_ERR(0, 366, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "matrix") < 0)) __PYX_ERR(0, 366, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 7) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
    }
    __pyx_v_self = values[0];
    __pyx_v_a = values[1];
    __pyx_v_b = values[2];
    __pyx_v_c = values[3];
    __pyx_v_d = values[4];
    __pyx_v_e = values[5];
    __pyx_v_f = values[6];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("matrix", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 366, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics._ASYTransform.matrix", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_13_ASYTransform_2matrix(__pyx_self, __pyx_v_self, __pyx_v_a, __pyx_v_b, __pyx_v_c, __pyx_v_d, __pyx_v_e, __pyx_v_f);

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_13_ASYTransform_2matrix(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e, PyObject *__pyx_v_f) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  Py_UCS4 __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("matrix", 0);

  /* "mathics/builtin/graphics.py":371
 *         # 0 0 1
 *         # see http://asymptote.sourceforge.net/doc/Transforms.html#Transforms
 *         self.transforms.append("(%f, %f, %f, %f, %f, %f)" % (e, f, a, c, b, d))             # <<<<<<<<<<<<<<
 * 
 *     def translate(self, x, y):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_transforms); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 371, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(13); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 371, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = 0;
  __pyx_t_4 = 127;
  __Pyx_INCREF(__pyx_kp_u__9);
  __pyx_t_3 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__9);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u__9);
  __pyx_t_5 = __Pyx_PyObject_Format(__pyx_v_e, __pyx_n_u_f); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 371, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_4;
  __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_INCREF(__pyx_kp_u__4);
  __pyx_t_3 += 2;
  __Pyx_GIVEREF(__pyx_kp_u__4);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u__4);
  __pyx_t_5 = __Pyx_PyObject_Format(__pyx_v_f, __pyx_n_u_f); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 371, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_4;
  __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_INCREF(__pyx_kp_u__4);
  __pyx_t_3 += 2;
  __Pyx_GIVEREF(__pyx_kp_u__4);
  PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_kp_u__4);
  __pyx_t_5 = __Pyx_PyObject_Format(__pyx_v_a, __pyx_n_u_f); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 371, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_4;
  __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_2, 5, __pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_INCREF(__pyx_kp_u__4);
  __pyx_t_3 += 2;
  __Pyx_GIVEREF(__pyx_kp_u__4);
  PyTuple_SET_ITEM(__pyx_t_2, 6, __pyx_kp_u__4);
  __pyx_t_5 = __Pyx_PyObject_Format(__pyx_v_c, __pyx_n_u_f); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 371, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_4;
  __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_2, 7, __pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_INCREF(__pyx_kp_u__4);
  __pyx_t_3 += 2;
  __Pyx_GIVEREF(__pyx_kp_u__4);
  PyTuple_SET_ITEM(__pyx_t_2, 8, __pyx_kp_u__4);
  __pyx_t_5 = __Pyx_PyObject_Format(__pyx_v_b, __pyx_n_u_f); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 371, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_4;
  __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_2, 9, __pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_INCREF(__pyx_kp_u__4);
  __pyx_t_3 += 2;
  __Pyx_GIVEREF(__pyx_kp_u__4);
  PyTuple_SET_ITEM(__pyx_t_2, 10, __pyx_kp_u__4);
  __pyx_t_5 = __Pyx_PyObject_Format(__pyx_v_d, __pyx_n_u_f); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 371, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_4;
  __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_2, 11, __pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_INCREF(__pyx_kp_u__6);
  __pyx_t_3 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__6);
  PyTuple_SET_ITEM(__pyx_t_2, 12, __pyx_kp_u__6);
  __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_2, 13, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 371, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_6 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_5); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 371, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":366
 *         self.transforms = []
 * 
 *     def matrix(self, a, b, c, d, e, f):             # <<<<<<<<<<<<<<
 *         # a c e
 *         # b d f
 */

  /* 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_AddTraceback("mathics.builtin.graphics._ASYTransform.matrix", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":373
 *         self.transforms.append("(%f, %f, %f, %f, %f, %f)" % (e, f, a, c, b, d))
 * 
 *     def translate(self, x, y):             # <<<<<<<<<<<<<<
 *         self.transforms.append("shift(%f, %f)" % (x, y))
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_13_ASYTransform_5translate(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_13_ASYTransform_5translate = {"translate", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_13_ASYTransform_5translate, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_13_ASYTransform_5translate(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_x = 0;
  PyObject *__pyx_v_y = 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);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_x,&__pyx_n_s_y,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("translate", 1, 3, 3, 1); __PYX_ERR(0, 373, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("translate", 1, 3, 3, 2); __PYX_ERR(0, 373, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "translate") < 0)) __PYX_ERR(0, 373, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_self = values[0];
    __pyx_v_x = values[1];
    __pyx_v_y = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("translate", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 373, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics._ASYTransform.translate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_13_ASYTransform_4translate(__pyx_self, __pyx_v_self, __pyx_v_x, __pyx_v_y);

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_13_ASYTransform_4translate(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  Py_UCS4 __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("translate", 0);

  /* "mathics/builtin/graphics.py":374
 * 
 *     def translate(self, x, y):
 *         self.transforms.append("shift(%f, %f)" % (x, y))             # <<<<<<<<<<<<<<
 * 
 *     def scale(self, x, y):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_transforms); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 374, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 374, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = 0;
  __pyx_t_4 = 127;
  __Pyx_INCREF(__pyx_kp_u_shift);
  __pyx_t_3 += 6;
  __Pyx_GIVEREF(__pyx_kp_u_shift);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u_shift);
  __pyx_t_5 = __Pyx_PyObject_Format(__pyx_v_x, __pyx_n_u_f); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 374, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_4;
  __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_INCREF(__pyx_kp_u__4);
  __pyx_t_3 += 2;
  __Pyx_GIVEREF(__pyx_kp_u__4);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u__4);
  __pyx_t_5 = __Pyx_PyObject_Format(__pyx_v_y, __pyx_n_u_f); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 374, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_4;
  __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_INCREF(__pyx_kp_u__6);
  __pyx_t_3 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__6);
  PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_kp_u__6);
  __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_2, 5, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 374, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_6 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_5); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 374, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":373
 *         self.transforms.append("(%f, %f, %f, %f, %f, %f)" % (e, f, a, c, b, d))
 * 
 *     def translate(self, x, y):             # <<<<<<<<<<<<<<
 *         self.transforms.append("shift(%f, %f)" % (x, 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_5);
  __Pyx_AddTraceback("mathics.builtin.graphics._ASYTransform.translate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":376
 *         self.transforms.append("shift(%f, %f)" % (x, y))
 * 
 *     def scale(self, x, y):             # <<<<<<<<<<<<<<
 *         self.transforms.append("scale(%f, %f)" % (x, y))
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_13_ASYTransform_7scale(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_13_ASYTransform_7scale = {"scale", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_13_ASYTransform_7scale, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_13_ASYTransform_7scale(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_x = 0;
  PyObject *__pyx_v_y = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("scale (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_x,&__pyx_n_s_y,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scale", 1, 3, 3, 1); __PYX_ERR(0, 376, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scale", 1, 3, 3, 2); __PYX_ERR(0, 376, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "scale") < 0)) __PYX_ERR(0, 376, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_self = values[0];
    __pyx_v_x = values[1];
    __pyx_v_y = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("scale", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 376, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics._ASYTransform.scale", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_13_ASYTransform_6scale(__pyx_self, __pyx_v_self, __pyx_v_x, __pyx_v_y);

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_13_ASYTransform_6scale(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  Py_UCS4 __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("scale", 0);

  /* "mathics/builtin/graphics.py":377
 * 
 *     def scale(self, x, y):
 *         self.transforms.append("scale(%f, %f)" % (x, y))             # <<<<<<<<<<<<<<
 * 
 *     def rotate(self, x):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_transforms); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 377, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 377, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = 0;
  __pyx_t_4 = 127;
  __Pyx_INCREF(__pyx_kp_u_scale);
  __pyx_t_3 += 6;
  __Pyx_GIVEREF(__pyx_kp_u_scale);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u_scale);
  __pyx_t_5 = __Pyx_PyObject_Format(__pyx_v_x, __pyx_n_u_f); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 377, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_4;
  __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_INCREF(__pyx_kp_u__4);
  __pyx_t_3 += 2;
  __Pyx_GIVEREF(__pyx_kp_u__4);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u__4);
  __pyx_t_5 = __Pyx_PyObject_Format(__pyx_v_y, __pyx_n_u_f); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 377, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_4;
  __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_INCREF(__pyx_kp_u__6);
  __pyx_t_3 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__6);
  PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_kp_u__6);
  __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_2, 5, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 377, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_6 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_5); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 377, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":376
 *         self.transforms.append("shift(%f, %f)" % (x, y))
 * 
 *     def scale(self, x, y):             # <<<<<<<<<<<<<<
 *         self.transforms.append("scale(%f, %f)" % (x, 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_5);
  __Pyx_AddTraceback("mathics.builtin.graphics._ASYTransform.scale", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":379
 *         self.transforms.append("scale(%f, %f)" % (x, y))
 * 
 *     def rotate(self, x):             # <<<<<<<<<<<<<<
 *         self.transforms.append("rotate(%f)" % x)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_13_ASYTransform_9rotate(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_13_ASYTransform_9rotate = {"rotate", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_13_ASYTransform_9rotate, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_13_ASYTransform_9rotate(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_x = 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);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_x,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("rotate", 1, 2, 2, 1); __PYX_ERR(0, 379, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rotate") < 0)) __PYX_ERR(0, 379, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_x = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("rotate", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 379, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics._ASYTransform.rotate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_13_ASYTransform_8rotate(__pyx_self, __pyx_v_self, __pyx_v_x);

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

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

  /* "mathics/builtin/graphics.py":380
 * 
 *     def rotate(self, x):
 *         self.transforms.append("rotate(%f)" % x)             # <<<<<<<<<<<<<<
 * 
 *     def apply(self, asy):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_transforms); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 380, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_rotate_f, __pyx_v_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 380, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_2); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 380, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":379
 *         self.transforms.append("scale(%f, %f)" % (x, y))
 * 
 *     def rotate(self, x):             # <<<<<<<<<<<<<<
 *         self.transforms.append("rotate(%f)" % x)
 * 
 */

  /* 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("mathics.builtin.graphics._ASYTransform.rotate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":382
 *         self.transforms.append("rotate(%f)" % x)
 * 
 *     def apply(self, asy):             # <<<<<<<<<<<<<<
 *         return self._template % (" * ".join(self.transforms), asy)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_13_ASYTransform_11apply(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_13_ASYTransform_11apply = {"apply", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_13_ASYTransform_11apply, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_13_ASYTransform_11apply(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_asy = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("apply (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_asy,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_asy)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("apply", 1, 2, 2, 1); __PYX_ERR(0, 382, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "apply") < 0)) __PYX_ERR(0, 382, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_asy = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("apply", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 382, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics._ASYTransform.apply", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_13_ASYTransform_10apply(__pyx_self, __pyx_v_self, __pyx_v_asy);

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_13_ASYTransform_10apply(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_asy) {
  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("apply", 0);

  /* "mathics/builtin/graphics.py":383
 * 
 *     def apply(self, asy):
 *         return self._template % (" * ".join(self.transforms), asy)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_template); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 383, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_transforms); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 383, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyUnicode_Join(__pyx_kp_u__10, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 383, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 383, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
  __Pyx_INCREF(__pyx_v_asy);
  __Pyx_GIVEREF(__pyx_v_asy);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_asy);
  __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Remainder(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 383, __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;

  /* "mathics/builtin/graphics.py":382
 *         self.transforms.append("rotate(%f)" % x)
 * 
 *     def apply(self, asy):             # <<<<<<<<<<<<<<
 *         return self._template % (" * ".join(self.transforms), asy)
 * 
 */

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

/* "mathics/builtin/graphics.py":396
 *     options = GRAPHICS_OPTIONS
 * 
 *     def apply(self, graphics, evaluation, options):             # <<<<<<<<<<<<<<
 *         """Show[graphics_, OptionsPattern[%(name)s]]"""
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_4Show_1apply(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7mathics_7builtin_8graphics_4Show_apply[] = "Show[graphics_, OptionsPattern[%(name)s]]";
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_4Show_1apply = {"apply", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_4Show_1apply, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7mathics_7builtin_8graphics_4Show_apply};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_4Show_1apply(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_graphics = 0;
  PyObject *__pyx_v_evaluation = 0;
  PyObject *__pyx_v_options = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("apply (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_graphics,&__pyx_n_s_evaluation,&__pyx_n_s_options,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_graphics)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("apply", 1, 4, 4, 1); __PYX_ERR(0, 396, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_evaluation)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("apply", 1, 4, 4, 2); __PYX_ERR(0, 396, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_options)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("apply", 1, 4, 4, 3); __PYX_ERR(0, 396, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "apply") < 0)) __PYX_ERR(0, 396, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __pyx_v_self = values[0];
    __pyx_v_graphics = values[1];
    __pyx_v_evaluation = values[2];
    __pyx_v_options = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("apply", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 396, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.Show.apply", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_4Show_apply(__pyx_self, __pyx_v_self, __pyx_v_graphics, __pyx_v_evaluation, __pyx_v_options);

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_4Show_apply(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_graphics, PyObject *__pyx_v_evaluation, PyObject *__pyx_v_options) {
  PyObject *__pyx_v_option = NULL;
  PyObject *__pyx_v_new_leaves = NULL;
  PyObject *__pyx_v_options_set = NULL;
  PyObject *__pyx_v_leaf = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_new_leaf = NULL;
  PyObject *__pyx_v_leaf_name = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  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("apply", 0);
  __Pyx_INCREF(__pyx_v_graphics);

  /* "mathics/builtin/graphics.py":399
 *         """Show[graphics_, OptionsPattern[%(name)s]]"""
 * 
 *         for option in options:             # <<<<<<<<<<<<<<
 *             if option not in ("System`ImageSize",):
 *                 options[option] = Expression("N", options[option]).evaluate(evaluation)
 */
  if (likely(PyList_CheckExact(__pyx_v_options)) || PyTuple_CheckExact(__pyx_v_options)) {
    __pyx_t_1 = __pyx_v_options; __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_options); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 399, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 399, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 399, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 399, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 399, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 399, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 399, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_option, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "mathics/builtin/graphics.py":400
 * 
 *         for option in options:
 *             if option not in ("System`ImageSize",):             # <<<<<<<<<<<<<<
 *                 options[option] = Expression("N", options[option]).evaluate(evaluation)
 * 
 */
    __Pyx_INCREF(__pyx_v_option);
    __pyx_t_4 = __pyx_v_option;
    __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_kp_u_System_ImageSize, Py_NE)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 400, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = (__pyx_t_5 != 0);
    if (__pyx_t_6) {

      /* "mathics/builtin/graphics.py":401
 *         for option in options:
 *             if option not in ("System`ImageSize",):
 *                 options[option] = Expression("N", options[option]).evaluate(evaluation)             # <<<<<<<<<<<<<<
 * 
 *         # The below could probably be done with graphics.filter..
 */
      __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_Expression); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 401, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_v_options, __pyx_v_option); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 401, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = NULL;
      __pyx_t_11 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_8);
        if (likely(__pyx_t_10)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_8, function);
          __pyx_t_11 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_8)) {
        PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_n_u_N, __pyx_t_9};
        __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 401, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
        PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_n_u_N, __pyx_t_9};
        __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 401, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      } else
      #endif
      {
        __pyx_t_12 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 401, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        if (__pyx_t_10) {
          __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_10); __pyx_t_10 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_N);
        __Pyx_GIVEREF(__pyx_n_u_N);
        PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_11, __pyx_n_u_N);
        __Pyx_GIVEREF(__pyx_t_9);
        PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_11, __pyx_t_9);
        __pyx_t_9 = 0;
        __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_12, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 401, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_evaluate); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 401, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_8, function);
        }
      }
      __pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_7, __pyx_v_evaluation) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_evaluation);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 401, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(PyObject_SetItem(__pyx_v_options, __pyx_v_option, __pyx_t_4) < 0)) __PYX_ERR(0, 401, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "mathics/builtin/graphics.py":400
 * 
 *         for option in options:
 *             if option not in ("System`ImageSize",):             # <<<<<<<<<<<<<<
 *                 options[option] = Expression("N", options[option]).evaluate(evaluation)
 * 
 */
    }

    /* "mathics/builtin/graphics.py":399
 *         """Show[graphics_, OptionsPattern[%(name)s]]"""
 * 
 *         for option in options:             # <<<<<<<<<<<<<<
 *             if option not in ("System`ImageSize",):
 *                 options[option] = Expression("N", options[option]).evaluate(evaluation)
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":404
 * 
 *         # The below could probably be done with graphics.filter..
 *         new_leaves = []             # <<<<<<<<<<<<<<
 *         options_set = set(options.keys())
 *         for leaf in graphics.leaves:
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 404, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_new_leaves = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":405
 *         # The below could probably be done with graphics.filter..
 *         new_leaves = []
 *         options_set = set(options.keys())             # <<<<<<<<<<<<<<
 *         for leaf in graphics.leaves:
 *             new_leaf = leaf
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_options, __pyx_n_s_keys); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 405, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_8 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 405, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PySet_New(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 405, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_options_set = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":406
 *         new_leaves = []
 *         options_set = set(options.keys())
 *         for leaf in graphics.leaves:             # <<<<<<<<<<<<<<
 *             new_leaf = leaf
 *             leaf_name = leaf.get_head_name()
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_graphics, __pyx_n_s_leaves); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 406, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
    __pyx_t_1 = __pyx_t_4; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 406, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 406, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 406, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 406, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 406, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 406, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 406, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_leaf, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "mathics/builtin/graphics.py":407
 *         options_set = set(options.keys())
 *         for leaf in graphics.leaves:
 *             new_leaf = leaf             # <<<<<<<<<<<<<<
 *             leaf_name = leaf.get_head_name()
 *             if leaf_name == "System`Rule" and str(leaf.leaves[0]) in options_set:
 */
    __Pyx_INCREF(__pyx_v_leaf);
    __Pyx_XDECREF_SET(__pyx_v_new_leaf, __pyx_v_leaf);

    /* "mathics/builtin/graphics.py":408
 *         for leaf in graphics.leaves:
 *             new_leaf = leaf
 *             leaf_name = leaf.get_head_name()             # <<<<<<<<<<<<<<
 *             if leaf_name == "System`Rule" and str(leaf.leaves[0]) in options_set:
 *                 continue
 */
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_leaf, __pyx_n_s_get_head_name); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 408, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_8, function);
      }
    }
    __pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_8);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 408, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF_SET(__pyx_v_leaf_name, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "mathics/builtin/graphics.py":409
 *             new_leaf = leaf
 *             leaf_name = leaf.get_head_name()
 *             if leaf_name == "System`Rule" and str(leaf.leaves[0]) in options_set:             # <<<<<<<<<<<<<<
 *                 continue
 *             new_leaves.append(leaf)
 */
    __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_v_leaf_name, __pyx_kp_u_System_Rule, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 409, __pyx_L1_error)
    if (__pyx_t_5) {
    } else {
      __pyx_t_6 = __pyx_t_5;
      goto __pyx_L9_bool_binop_done;
    }
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_leaf, __pyx_n_s_leaves); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 409, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 409, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 409, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_5 = (__Pyx_PySet_ContainsTF(__pyx_t_4, __pyx_v_options_set, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 409, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_13 = (__pyx_t_5 != 0);
    __pyx_t_6 = __pyx_t_13;
    __pyx_L9_bool_binop_done:;
    if (__pyx_t_6) {

      /* "mathics/builtin/graphics.py":410
 *             leaf_name = leaf.get_head_name()
 *             if leaf_name == "System`Rule" and str(leaf.leaves[0]) in options_set:
 *                 continue             # <<<<<<<<<<<<<<
 *             new_leaves.append(leaf)
 * 
 */
      goto __pyx_L6_continue;

      /* "mathics/builtin/graphics.py":409
 *             new_leaf = leaf
 *             leaf_name = leaf.get_head_name()
 *             if leaf_name == "System`Rule" and str(leaf.leaves[0]) in options_set:             # <<<<<<<<<<<<<<
 *                 continue
 *             new_leaves.append(leaf)
 */
    }

    /* "mathics/builtin/graphics.py":411
 *             if leaf_name == "System`Rule" and str(leaf.leaves[0]) in options_set:
 *                 continue
 *             new_leaves.append(leaf)             # <<<<<<<<<<<<<<
 * 
 *         new_leaves += options_to_rules(options)
 */
    __pyx_t_14 = __Pyx_PyObject_Append(__pyx_v_new_leaves, __pyx_v_leaf); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 411, __pyx_L1_error)

    /* "mathics/builtin/graphics.py":406
 *         new_leaves = []
 *         options_set = set(options.keys())
 *         for leaf in graphics.leaves:             # <<<<<<<<<<<<<<
 *             new_leaf = leaf
 *             leaf_name = leaf.get_head_name()
 */
    __pyx_L6_continue:;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":413
 *             new_leaves.append(leaf)
 * 
 *         new_leaves += options_to_rules(options)             # <<<<<<<<<<<<<<
 *         graphics = graphics.restructure(graphics.head, new_leaves, evaluation)
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_options_to_rules); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 413, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_8 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_8, __pyx_v_options) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_options);
  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 413, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_new_leaves, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 413, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF_SET(__pyx_v_new_leaves, __pyx_t_4);
  __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":414
 * 
 *         new_leaves += options_to_rules(options)
 *         graphics = graphics.restructure(graphics.head, new_leaves, evaluation)             # <<<<<<<<<<<<<<
 * 
 *         return graphics
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_graphics, __pyx_n_s_restructure); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 414, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_graphics, __pyx_n_s_head); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 414, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_7 = NULL;
  __pyx_t_11 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
      __pyx_t_11 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_1)) {
    PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_t_8, __pyx_v_new_leaves, __pyx_v_evaluation};
    __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_11, 3+__pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 414, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
    PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_t_8, __pyx_v_new_leaves, __pyx_v_evaluation};
    __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_11, 3+__pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 414, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  } else
  #endif
  {
    __pyx_t_12 = PyTuple_New(3+__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 414, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    if (__pyx_t_7) {
      __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_7); __pyx_t_7 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_11, __pyx_t_8);
    __Pyx_INCREF(__pyx_v_new_leaves);
    __Pyx_GIVEREF(__pyx_v_new_leaves);
    PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_11, __pyx_v_new_leaves);
    __Pyx_INCREF(__pyx_v_evaluation);
    __Pyx_GIVEREF(__pyx_v_evaluation);
    PyTuple_SET_ITEM(__pyx_t_12, 2+__pyx_t_11, __pyx_v_evaluation);
    __pyx_t_8 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_12, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 414, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF_SET(__pyx_v_graphics, __pyx_t_4);
  __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":416
 *         graphics = graphics.restructure(graphics.head, new_leaves, evaluation)
 * 
 *         return graphics             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_graphics);
  __pyx_r = __pyx_v_graphics;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":396
 *     options = GRAPHICS_OPTIONS
 * 
 *     def apply(self, graphics, evaluation, options):             # <<<<<<<<<<<<<<
 *         """Show[graphics_, OptionsPattern[%(name)s]]"""
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("mathics.builtin.graphics.Show.apply", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_option);
  __Pyx_XDECREF(__pyx_v_new_leaves);
  __Pyx_XDECREF(__pyx_v_options_set);
  __Pyx_XDECREF(__pyx_v_leaf);
  __Pyx_XDECREF(__pyx_v_new_leaf);
  __Pyx_XDECREF(__pyx_v_leaf_name);
  __Pyx_XDECREF(__pyx_v_graphics);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":470
 *     box_suffix = "Box"
 * 
 *     def apply_makeboxes(self, content, evaluation, options):             # <<<<<<<<<<<<<<
 *         """MakeBoxes[%(name)s[content_, OptionsPattern[%(name)s]],
 *         StandardForm|TraditionalForm|OutputForm]"""
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_8Graphics_1apply_makeboxes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7mathics_7builtin_8graphics_8Graphics_apply_makeboxes[] = "MakeBoxes[%(name)s[content_, OptionsPattern[%(name)s]],\n        StandardForm|TraditionalForm|OutputForm]";
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_8Graphics_1apply_makeboxes = {"apply_makeboxes", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_8Graphics_1apply_makeboxes, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7mathics_7builtin_8graphics_8Graphics_apply_makeboxes};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_8Graphics_1apply_makeboxes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_content = 0;
  PyObject *__pyx_v_evaluation = 0;
  PyObject *__pyx_v_options = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("apply_makeboxes (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_content,&__pyx_n_s_evaluation,&__pyx_n_s_options,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_content)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("apply_makeboxes", 1, 4, 4, 1); __PYX_ERR(0, 470, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_evaluation)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("apply_makeboxes", 1, 4, 4, 2); __PYX_ERR(0, 470, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_options)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("apply_makeboxes", 1, 4, 4, 3); __PYX_ERR(0, 470, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "apply_makeboxes") < 0)) __PYX_ERR(0, 470, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __pyx_v_self = values[0];
    __pyx_v_content = values[1];
    __pyx_v_evaluation = values[2];
    __pyx_v_options = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("apply_makeboxes", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 470, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.Graphics.apply_makeboxes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_8Graphics_apply_makeboxes(__pyx_self, __pyx_v_self, __pyx_v_content, __pyx_v_evaluation, __pyx_v_options);

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

/* "mathics/builtin/graphics.py":474
 *         StandardForm|TraditionalForm|OutputForm]"""
 * 
 *         def convert(content):             # <<<<<<<<<<<<<<
 *             head = content.get_head_name()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_8Graphics_15apply_makeboxes_1convert(PyObject *__pyx_self, PyObject *__pyx_v_content); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_8Graphics_15apply_makeboxes_1convert = {"convert", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_8Graphics_15apply_makeboxes_1convert, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_8Graphics_15apply_makeboxes_1convert(PyObject *__pyx_self, PyObject *__pyx_v_content) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("convert (wrapper)", 0);
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_8Graphics_15apply_makeboxes_convert(__pyx_self, ((PyObject *)__pyx_v_content));

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

/* "mathics/builtin/graphics.py":490
 *                 if any(
 *                     not isinstance(atom, (Integer, Real))
 *                     and not atom.get_name() in GRAPHICS_SYMBOLS             # <<<<<<<<<<<<<<
 *                     for atom in atoms
 *                 ):
 */

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_8Graphics_15apply_makeboxes_7convert_genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_6_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_7mathics_7builtin_8graphics___pyx_scope_struct_6_genexpr *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_6_genexpr(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_6_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_6_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 490, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_5_convert *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7mathics_7builtin_8graphics_8Graphics_15apply_makeboxes_7convert_2generator9, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_Graphics_apply_makeboxes_locals, __pyx_n_s_mathics_builtin_graphics); if (unlikely(!gen)) __PYX_ERR(0, 490, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.Graphics.apply_makeboxes.convert.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_7mathics_7builtin_8graphics_8Graphics_15apply_makeboxes_7convert_2generator9(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_6_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_6_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 490, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":491
 *                     not isinstance(atom, (Integer, Real))
 *                     and not atom.get_name() in GRAPHICS_SYMBOLS
 *                     for atom in atoms             # <<<<<<<<<<<<<<
 *                 ):
 *                     if head == "System`Inset":
 */
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_atoms)) { __Pyx_RaiseClosureNameError("atoms"); __PYX_ERR(0, 491, __pyx_L1_error) }
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_atoms)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_atoms)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_atoms; __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_outer_scope->__pyx_v_atoms); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 491, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 491, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 491, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 491, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 491, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 491, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 491, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_atom);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_atom, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;

    /* "mathics/builtin/graphics.py":489
 *                 atoms = content.get_atoms(include_heads=False)
 *                 if any(
 *                     not isinstance(atom, (Integer, Real))             # <<<<<<<<<<<<<<
 *                     and not atom.get_name() in GRAPHICS_SYMBOLS
 *                     for atom in atoms
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Integer); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 489, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_Real); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 489, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = PyObject_IsInstance(__pyx_cur_scope->__pyx_v_atom, __pyx_t_4); 
    __pyx_t_9 = (__pyx_t_8 != 0);
    if (!__pyx_t_9) {
    } else {
      __pyx_t_7 = __pyx_t_9;
      goto __pyx_L9_bool_binop_done;
    }
    __pyx_t_9 = PyObject_IsInstance(__pyx_cur_scope->__pyx_v_atom, __pyx_t_6); 
    __pyx_t_8 = (__pyx_t_9 != 0);
    __pyx_t_7 = __pyx_t_8;
    __pyx_L9_bool_binop_done:;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_8 = ((!(__pyx_t_7 != 0)) != 0);
    if (__pyx_t_8) {
    } else {
      __pyx_t_5 = __pyx_t_8;
      goto __pyx_L7_bool_binop_done;
    }

    /* "mathics/builtin/graphics.py":490
 *                 if any(
 *                     not isinstance(atom, (Integer, Real))
 *                     and not atom.get_name() in GRAPHICS_SYMBOLS             # <<<<<<<<<<<<<<
 *                     for atom in atoms
 *                 ):
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_atom, __pyx_n_s_get_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 490, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_10 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_10)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_4 = (__pyx_t_10) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_10) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 490, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_GRAPHICS_SYMBOLS); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 490, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = (__Pyx_PySequence_ContainsTF(__pyx_t_4, __pyx_t_6, Py_NE)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 490, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_7 = (__pyx_t_8 != 0);
    __pyx_t_5 = __pyx_t_7;
    __pyx_L7_bool_binop_done:;
    if (__pyx_t_5) {

      /* "mathics/builtin/graphics.py":488
 *                     head = "System`Inset"
 *                 atoms = content.get_atoms(include_heads=False)
 *                 if any(             # <<<<<<<<<<<<<<
 *                     not isinstance(atom, (Integer, Real))
 *                     and not atom.get_name() in GRAPHICS_SYMBOLS
 */
      __Pyx_XDECREF(__pyx_r);

      /* "mathics/builtin/graphics.py":490
 *                 if any(
 *                     not isinstance(atom, (Integer, Real))
 *                     and not atom.get_name() in GRAPHICS_SYMBOLS             # <<<<<<<<<<<<<<
 *                     for atom in atoms
 *                 ):
 */
      __Pyx_INCREF(Py_True);
      __pyx_r = Py_True;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }

    /* "mathics/builtin/graphics.py":491
 *                     not isinstance(atom, (Integer, Real))
 *                     and not atom.get_name() in GRAPHICS_SYMBOLS
 *                     for atom in atoms             # <<<<<<<<<<<<<<
 *                 ):
 *                     if head == "System`Inset":
 */
  }
  /*else*/ {

    /* "mathics/builtin/graphics.py":488
 *                     head = "System`Inset"
 *                 atoms = content.get_atoms(include_heads=False)
 *                 if any(             # <<<<<<<<<<<<<<
 *                     not isinstance(atom, (Integer, Real))
 *                     and not atom.get_name() in GRAPHICS_SYMBOLS
 */
    __Pyx_XDECREF(__pyx_r);

    /* "mathics/builtin/graphics.py":490
 *                 if any(
 *                     not isinstance(atom, (Integer, Real))
 *                     and not atom.get_name() in GRAPHICS_SYMBOLS             # <<<<<<<<<<<<<<
 *                     for atom in atoms
 *                 ):
 */
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L0;
  }

  /* "mathics/builtin/graphics.py":491
 *                     not isinstance(atom, (Integer, Real))
 *                     and not atom.get_name() in GRAPHICS_SYMBOLS
 *                     for atom in atoms             # <<<<<<<<<<<<<<
 *                 ):
 *                     if head == "System`Inset":
 */
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "mathics/builtin/graphics.py":490
 *                 if any(
 *                     not isinstance(atom, (Integer, Real))
 *                     and not atom.get_name() in GRAPHICS_SYMBOLS             # <<<<<<<<<<<<<<
 *                     for atom in atoms
 *                 ):
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7mathics_7builtin_8graphics_8Graphics_15apply_makeboxes_7convert_5generator10(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "mathics/builtin/graphics.py":500
 *                     else:
 *                         n_leaves = (
 *                             Expression("N", leaf).evaluate(evaluation)             # <<<<<<<<<<<<<<
 *                             for leaf in content.leaves
 *                         )
 */

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_8Graphics_15apply_makeboxes_7convert_3genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_7_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_7_genexpr *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_7_genexpr(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_7_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_7_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 500, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_5_convert *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7mathics_7builtin_8graphics_8Graphics_15apply_makeboxes_7convert_5generator10, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_Graphics_apply_makeboxes_locals, __pyx_n_s_mathics_builtin_graphics); if (unlikely(!gen)) __PYX_ERR(0, 500, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.Graphics.apply_makeboxes.convert.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_7mathics_7builtin_8graphics_8Graphics_15apply_makeboxes_7convert_5generator10(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_7_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_7_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 500, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":501
 *                         n_leaves = (
 *                             Expression("N", leaf).evaluate(evaluation)
 *                             for leaf in content.leaves             # <<<<<<<<<<<<<<
 *                         )
 *                 else:
 */
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_content)) { __Pyx_RaiseClosureNameError("content"); __PYX_ERR(0, 501, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_content, __pyx_n_s_leaves); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 501, __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(0, 501, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 501, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 501, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 501, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 501, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 501, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 501, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_leaf);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_leaf, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;

    /* "mathics/builtin/graphics.py":500
 *                     else:
 *                         n_leaves = (
 *                             Expression("N", leaf).evaluate(evaluation)             # <<<<<<<<<<<<<<
 *                             for leaf in content.leaves
 *                         )
 */
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_Expression); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 500, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    __pyx_t_8 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_8 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_6)) {
      PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_n_u_N, __pyx_cur_scope->__pyx_v_leaf};
      __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 500, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_5);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
      PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_n_u_N, __pyx_cur_scope->__pyx_v_leaf};
      __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 500, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_5);
    } else
    #endif
    {
      __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 500, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      if (__pyx_t_7) {
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
      }
      __Pyx_INCREF(__pyx_n_u_N);
      __Pyx_GIVEREF(__pyx_n_u_N);
      PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_n_u_N);
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_leaf);
      __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_leaf);
      PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_cur_scope->__pyx_v_leaf);
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 500, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_evaluate); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 500, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_evaluation)) { __Pyx_RaiseClosureNameError("evaluation"); __PYX_ERR(0, 500, __pyx_L1_error) }
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_5, __pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_evaluation) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_evaluation);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 500, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    __Pyx_XGIVEREF(__pyx_t_2);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_3;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_4;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_2);
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_4 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 500, __pyx_L1_error)

    /* "mathics/builtin/graphics.py":501
 *                         n_leaves = (
 *                             Expression("N", leaf).evaluate(evaluation)
 *                             for leaf in content.leaves             # <<<<<<<<<<<<<<
 *                         )
 *                 else:
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "mathics/builtin/graphics.py":500
 *                     else:
 *                         n_leaves = (
 *                             Expression("N", leaf).evaluate(evaluation)             # <<<<<<<<<<<<<<
 *                             for leaf in content.leaves
 *                         )
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  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_9);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":474
 *         StandardForm|TraditionalForm|OutputForm]"""
 * 
 *         def convert(content):             # <<<<<<<<<<<<<<
 *             head = content.get_head_name()
 * 
 */

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_8Graphics_15apply_makeboxes_convert(PyObject *__pyx_self, PyObject *__pyx_v_content) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_5_convert *__pyx_cur_scope;
  PyObject *__pyx_v_head = NULL;
  PyObject *__pyx_v_n_leaves = NULL;
  PyObject *__pyx_8genexpr2__pyx_v_item = NULL;
  PyObject *__pyx_8genexpr3__pyx_v_item = NULL;
  PyObject *__pyx_8genexpr5__pyx_v_leaf = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("convert", 0);
  __pyx_cur_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_5_convert *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_5_convert(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_5_convert, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_5_convert *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 474, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_4_apply_makeboxes *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  __pyx_cur_scope->__pyx_v_content = __pyx_v_content;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_content);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_content);

  /* "mathics/builtin/graphics.py":475
 * 
 *         def convert(content):
 *             head = content.get_head_name()             # <<<<<<<<<<<<<<
 * 
 *             if head == "System`List":
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_content, __pyx_n_s_get_head_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 475, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 475, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_head = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":477
 *             head = content.get_head_name()
 * 
 *             if head == "System`List":             # <<<<<<<<<<<<<<
 *                 return Expression("List", *[convert(item) for item in content.leaves])
 *             elif head == "System`Style":
 */
  __pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_v_head, __pyx_kp_u_System_List, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 477, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "mathics/builtin/graphics.py":478
 * 
 *             if head == "System`List":
 *                 return Expression("List", *[convert(item) for item in content.leaves])             # <<<<<<<<<<<<<<
 *             elif head == "System`Style":
 *                 return Expression(
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Expression); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 478, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    { /* enter inner scope */
      __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 478, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_content, __pyx_n_s_leaves); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 478, __pyx_L6_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_6 = 0;
        __pyx_t_7 = NULL;
      } else {
        __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 478, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_7 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 478, __pyx_L6_error)
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      for (;;) {
        if (likely(!__pyx_t_7)) {
          if (likely(PyList_CheckExact(__pyx_t_5))) {
            if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_5)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_3 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 478, __pyx_L6_error)
            #else
            __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 478, __pyx_L6_error)
            __Pyx_GOTREF(__pyx_t_3);
            #endif
          } else {
            if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 478, __pyx_L6_error)
            #else
            __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 478, __pyx_L6_error)
            __Pyx_GOTREF(__pyx_t_3);
            #endif
          }
        } else {
          __pyx_t_3 = __pyx_t_7(__pyx_t_5);
          if (unlikely(!__pyx_t_3)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 478, __pyx_L6_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_3);
        }
        __Pyx_XDECREF_SET(__pyx_8genexpr2__pyx_v_item, __pyx_t_3);
        __pyx_t_3 = 0;
        if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_convert)) { __Pyx_RaiseClosureNameError("convert"); __PYX_ERR(0, 478, __pyx_L6_error) }
        __pyx_t_3 = __pyx_pf_7mathics_7builtin_8graphics_8Graphics_15apply_makeboxes_convert(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_convert, __pyx_8genexpr2__pyx_v_item); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 478, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_3);
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 478, __pyx_L6_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_item); __pyx_8genexpr2__pyx_v_item = 0;
      goto __pyx_L9_exit_scope;
      __pyx_L6_error:;
      __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_item); __pyx_8genexpr2__pyx_v_item = 0;
      goto __pyx_L1_error;
      __pyx_L9_exit_scope:;
    } /* exit inner scope */
    __pyx_t_5 = PySequence_Tuple(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 478, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyNumber_Add(__pyx_tuple__11, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 478, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 478, __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_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;

    /* "mathics/builtin/graphics.py":477
 *             head = content.get_head_name()
 * 
 *             if head == "System`List":             # <<<<<<<<<<<<<<
 *                 return Expression("List", *[convert(item) for item in content.leaves])
 *             elif head == "System`Style":
 */
  }

  /* "mathics/builtin/graphics.py":479
 *             if head == "System`List":
 *                 return Expression("List", *[convert(item) for item in content.leaves])
 *             elif head == "System`Style":             # <<<<<<<<<<<<<<
 *                 return Expression(
 *                     "StyleBox", *[convert(item) for item in content.leaves]
 */
  __pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_v_head, __pyx_kp_u_System_Style, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 479, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "mathics/builtin/graphics.py":480
 *                 return Expression("List", *[convert(item) for item in content.leaves])
 *             elif head == "System`Style":
 *                 return Expression(             # <<<<<<<<<<<<<<
 *                     "StyleBox", *[convert(item) for item in content.leaves]
 *                 )
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Expression); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 480, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    { /* enter inner scope */

      /* "mathics/builtin/graphics.py":481
 *             elif head == "System`Style":
 *                 return Expression(
 *                     "StyleBox", *[convert(item) for item in content.leaves]             # <<<<<<<<<<<<<<
 *                 )
 * 
 */
      __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 481, __pyx_L12_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_content, __pyx_n_s_leaves); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 481, __pyx_L12_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(0, 481, __pyx_L12_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_7 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 481, __pyx_L12_error)
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      for (;;) {
        if (likely(!__pyx_t_7)) {
          if (likely(PyList_CheckExact(__pyx_t_3))) {
            if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_3)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 481, __pyx_L12_error)
            #else
            __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 481, __pyx_L12_error)
            __Pyx_GOTREF(__pyx_t_1);
            #endif
          } else {
            if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 481, __pyx_L12_error)
            #else
            __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 481, __pyx_L12_error)
            __Pyx_GOTREF(__pyx_t_1);
            #endif
          }
        } else {
          __pyx_t_1 = __pyx_t_7(__pyx_t_3);
          if (unlikely(!__pyx_t_1)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 481, __pyx_L12_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_1);
        }
        __Pyx_XDECREF_SET(__pyx_8genexpr3__pyx_v_item, __pyx_t_1);
        __pyx_t_1 = 0;
        if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_convert)) { __Pyx_RaiseClosureNameError("convert"); __PYX_ERR(0, 481, __pyx_L12_error) }
        __pyx_t_1 = __pyx_pf_7mathics_7builtin_8graphics_8Graphics_15apply_makeboxes_convert(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_convert, __pyx_8genexpr3__pyx_v_item); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 481, __pyx_L12_error)
        __Pyx_GOTREF(__pyx_t_1);
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 481, __pyx_L12_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_item); __pyx_8genexpr3__pyx_v_item = 0;
      goto __pyx_L15_exit_scope;
      __pyx_L12_error:;
      __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_item); __pyx_8genexpr3__pyx_v_item = 0;
      goto __pyx_L1_error;
      __pyx_L15_exit_scope:;
    } /* exit inner scope */

    /* "mathics/builtin/graphics.py":480
 *                 return Expression("List", *[convert(item) for item in content.leaves])
 *             elif head == "System`Style":
 *                 return Expression(             # <<<<<<<<<<<<<<
 *                     "StyleBox", *[convert(item) for item in content.leaves]
 *                 )
 */
    __pyx_t_3 = PySequence_Tuple(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 480, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyNumber_Add(__pyx_tuple__12, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 480, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 480, __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_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "mathics/builtin/graphics.py":479
 *             if head == "System`List":
 *                 return Expression("List", *[convert(item) for item in content.leaves])
 *             elif head == "System`Style":             # <<<<<<<<<<<<<<
 *                 return Expression(
 *                     "StyleBox", *[convert(item) for item in content.leaves]
 */
  }

  /* "mathics/builtin/graphics.py":484
 *                 )
 * 
 *             if head in element_heads:             # <<<<<<<<<<<<<<
 *                 if head == "System`Text":
 *                     head = "System`Inset"
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_element_heads); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 484, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_v_head, __pyx_t_3, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 484, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_8 = (__pyx_t_4 != 0);
  if (__pyx_t_8) {

    /* "mathics/builtin/graphics.py":485
 * 
 *             if head in element_heads:
 *                 if head == "System`Text":             # <<<<<<<<<<<<<<
 *                     head = "System`Inset"
 *                 atoms = content.get_atoms(include_heads=False)
 */
    __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_head, __pyx_kp_u_System_Text, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 485, __pyx_L1_error)
    if (__pyx_t_8) {

      /* "mathics/builtin/graphics.py":486
 *             if head in element_heads:
 *                 if head == "System`Text":
 *                     head = "System`Inset"             # <<<<<<<<<<<<<<
 *                 atoms = content.get_atoms(include_heads=False)
 *                 if any(
 */
      __Pyx_INCREF(__pyx_kp_u_System_Inset);
      __Pyx_DECREF_SET(__pyx_v_head, __pyx_kp_u_System_Inset);

      /* "mathics/builtin/graphics.py":485
 * 
 *             if head in element_heads:
 *                 if head == "System`Text":             # <<<<<<<<<<<<<<
 *                     head = "System`Inset"
 *                 atoms = content.get_atoms(include_heads=False)
 */
    }

    /* "mathics/builtin/graphics.py":487
 *                 if head == "System`Text":
 *                     head = "System`Inset"
 *                 atoms = content.get_atoms(include_heads=False)             # <<<<<<<<<<<<<<
 *                 if any(
 *                     not isinstance(atom, (Integer, Real))
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_content, __pyx_n_s_get_atoms); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 487, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 487, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_include_heads, Py_False) < 0) __PYX_ERR(0, 487, __pyx_L1_error)
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 487, __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_GIVEREF(__pyx_t_5);
    __pyx_cur_scope->__pyx_v_atoms = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "mathics/builtin/graphics.py":490
 *                 if any(
 *                     not isinstance(atom, (Integer, Real))
 *                     and not atom.get_name() in GRAPHICS_SYMBOLS             # <<<<<<<<<<<<<<
 *                     for atom in atoms
 *                 ):
 */
    __pyx_t_5 = __pyx_pf_7mathics_7builtin_8graphics_8Graphics_15apply_makeboxes_7convert_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 490, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = __Pyx_Generator_Next(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 490, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 490, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "mathics/builtin/graphics.py":488
 *                     head = "System`Inset"
 *                 atoms = content.get_atoms(include_heads=False)
 *                 if any(             # <<<<<<<<<<<<<<
 *                     not isinstance(atom, (Integer, Real))
 *                     and not atom.get_name() in GRAPHICS_SYMBOLS
 */
    if (__pyx_t_8) {

      /* "mathics/builtin/graphics.py":493
 *                     for atom in atoms
 *                 ):
 *                     if head == "System`Inset":             # <<<<<<<<<<<<<<
 *                         n_leaves = [content.leaves[0]] + [
 *                             Expression("N", leaf).evaluate(evaluation)
 */
      __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_head, __pyx_kp_u_System_Inset, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 493, __pyx_L1_error)
      if (__pyx_t_8) {

        /* "mathics/builtin/graphics.py":494
 *                 ):
 *                     if head == "System`Inset":
 *                         n_leaves = [content.leaves[0]] + [             # <<<<<<<<<<<<<<
 *                             Expression("N", leaf).evaluate(evaluation)
 *                             for leaf in content.leaves[1:]
 */
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_content, __pyx_n_s_leaves); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 494, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 494, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 494, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_GIVEREF(__pyx_t_5);
        PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_5);
        __pyx_t_5 = 0;
        { /* enter inner scope */
          __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 494, __pyx_L22_error)
          __Pyx_GOTREF(__pyx_t_5);

          /* "mathics/builtin/graphics.py":496
 *                         n_leaves = [content.leaves[0]] + [
 *                             Expression("N", leaf).evaluate(evaluation)
 *                             for leaf in content.leaves[1:]             # <<<<<<<<<<<<<<
 *                         ]
 *                     else:
 */
          __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_content, __pyx_n_s_leaves); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 496, __pyx_L22_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_t_3, 1, 0, NULL, NULL, &__pyx_slice__13, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 496, __pyx_L22_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
            __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); __pyx_t_6 = 0;
            __pyx_t_7 = NULL;
          } else {
            __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 496, __pyx_L22_error)
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_7 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 496, __pyx_L22_error)
          }
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          for (;;) {
            if (likely(!__pyx_t_7)) {
              if (likely(PyList_CheckExact(__pyx_t_3))) {
                if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_3)) break;
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 496, __pyx_L22_error)
                #else
                __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 496, __pyx_L22_error)
                __Pyx_GOTREF(__pyx_t_1);
                #endif
              } else {
                if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 496, __pyx_L22_error)
                #else
                __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 496, __pyx_L22_error)
                __Pyx_GOTREF(__pyx_t_1);
                #endif
              }
            } else {
              __pyx_t_1 = __pyx_t_7(__pyx_t_3);
              if (unlikely(!__pyx_t_1)) {
                PyObject* exc_type = PyErr_Occurred();
                if (exc_type) {
                  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                  else __PYX_ERR(0, 496, __pyx_L22_error)
                }
                break;
              }
              __Pyx_GOTREF(__pyx_t_1);
            }
            __Pyx_XDECREF_SET(__pyx_8genexpr5__pyx_v_leaf, __pyx_t_1);
            __pyx_t_1 = 0;

            /* "mathics/builtin/graphics.py":495
 *                     if head == "System`Inset":
 *                         n_leaves = [content.leaves[0]] + [
 *                             Expression("N", leaf).evaluate(evaluation)             # <<<<<<<<<<<<<<
 *                             for leaf in content.leaves[1:]
 *                         ]
 */
            __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_Expression); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 495, __pyx_L22_error)
            __Pyx_GOTREF(__pyx_t_10);
            __pyx_t_11 = NULL;
            __pyx_t_12 = 0;
            if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
              __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10);
              if (likely(__pyx_t_11)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
                __Pyx_INCREF(__pyx_t_11);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_10, function);
                __pyx_t_12 = 1;
              }
            }
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_10)) {
              PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_n_u_N, __pyx_8genexpr5__pyx_v_leaf};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 495, __pyx_L22_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) {
              PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_n_u_N, __pyx_8genexpr5__pyx_v_leaf};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 495, __pyx_L22_error)
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_9);
            } else
            #endif
            {
              __pyx_t_13 = PyTuple_New(2+__pyx_t_12); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 495, __pyx_L22_error)
              __Pyx_GOTREF(__pyx_t_13);
              if (__pyx_t_11) {
                __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
              }
              __Pyx_INCREF(__pyx_n_u_N);
              __Pyx_GIVEREF(__pyx_n_u_N);
              PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_12, __pyx_n_u_N);
              __Pyx_INCREF(__pyx_8genexpr5__pyx_v_leaf);
              __Pyx_GIVEREF(__pyx_8genexpr5__pyx_v_leaf);
              PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_12, __pyx_8genexpr5__pyx_v_leaf);
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 495, __pyx_L22_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_evaluate); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 495, __pyx_L22_error)
            __Pyx_GOTREF(__pyx_t_10);
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
            if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_evaluation)) { __Pyx_RaiseClosureNameError("evaluation"); __PYX_ERR(0, 495, __pyx_L22_error) }
            __pyx_t_9 = NULL;
            if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
              __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_10);
              if (likely(__pyx_t_9)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
                __Pyx_INCREF(__pyx_t_9);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_10, function);
              }
            }
            __pyx_t_1 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_9, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_evaluation) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_evaluation);
            __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
            if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 495, __pyx_L22_error)
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 494, __pyx_L22_error)
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

            /* "mathics/builtin/graphics.py":496
 *                         n_leaves = [content.leaves[0]] + [
 *                             Expression("N", leaf).evaluate(evaluation)
 *                             for leaf in content.leaves[1:]             # <<<<<<<<<<<<<<
 *                         ]
 *                     else:
 */
          }
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_leaf); __pyx_8genexpr5__pyx_v_leaf = 0;
          goto __pyx_L25_exit_scope;
          __pyx_L22_error:;
          __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_leaf); __pyx_8genexpr5__pyx_v_leaf = 0;
          goto __pyx_L1_error;
          __pyx_L25_exit_scope:;
        } /* exit inner scope */

        /* "mathics/builtin/graphics.py":494
 *                 ):
 *                     if head == "System`Inset":
 *                         n_leaves = [content.leaves[0]] + [             # <<<<<<<<<<<<<<
 *                             Expression("N", leaf).evaluate(evaluation)
 *                             for leaf in content.leaves[1:]
 */
        __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 494, __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_v_n_leaves = __pyx_t_3;
        __pyx_t_3 = 0;

        /* "mathics/builtin/graphics.py":493
 *                     for atom in atoms
 *                 ):
 *                     if head == "System`Inset":             # <<<<<<<<<<<<<<
 *                         n_leaves = [content.leaves[0]] + [
 *                             Expression("N", leaf).evaluate(evaluation)
 */
        goto __pyx_L19;
      }

      /* "mathics/builtin/graphics.py":500
 *                     else:
 *                         n_leaves = (
 *                             Expression("N", leaf).evaluate(evaluation)             # <<<<<<<<<<<<<<
 *                             for leaf in content.leaves
 *                         )
 */
      /*else*/ {
        __pyx_t_3 = __pyx_pf_7mathics_7builtin_8graphics_8Graphics_15apply_makeboxes_7convert_3genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 500, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_v_n_leaves = __pyx_t_3;
        __pyx_t_3 = 0;
      }
      __pyx_L19:;

      /* "mathics/builtin/graphics.py":488
 *                     head = "System`Inset"
 *                 atoms = content.get_atoms(include_heads=False)
 *                 if any(             # <<<<<<<<<<<<<<
 *                     not isinstance(atom, (Integer, Real))
 *                     and not atom.get_name() in GRAPHICS_SYMBOLS
 */
      goto __pyx_L18;
    }

    /* "mathics/builtin/graphics.py":504
 *                         )
 *                 else:
 *                     n_leaves = content.leaves             # <<<<<<<<<<<<<<
 *                 return Expression(head + self.box_suffix, *n_leaves)
 *             return content
 */
    /*else*/ {
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_content, __pyx_n_s_leaves); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 504, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_v_n_leaves = __pyx_t_3;
      __pyx_t_3 = 0;
    }
    __pyx_L18:;

    /* "mathics/builtin/graphics.py":505
 *                 else:
 *                     n_leaves = content.leaves
 *                 return Expression(head + self.box_suffix, *n_leaves)             # <<<<<<<<<<<<<<
 *             return content
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Expression); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 505, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 505, __pyx_L1_error) }
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self, __pyx_n_s_box_suffix); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 505, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = PyNumber_Add(__pyx_v_head, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 505, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 505, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_v_n_leaves); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 505, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyNumber_Add(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 505, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 505, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "mathics/builtin/graphics.py":484
 *                 )
 * 
 *             if head in element_heads:             # <<<<<<<<<<<<<<
 *                 if head == "System`Text":
 *                     head = "System`Inset"
 */
  }

  /* "mathics/builtin/graphics.py":506
 *                     n_leaves = content.leaves
 *                 return Expression(head + self.box_suffix, *n_leaves)
 *             return content             # <<<<<<<<<<<<<<
 * 
 *         for option in options:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_content);
  __pyx_r = __pyx_cur_scope->__pyx_v_content;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":474
 *         StandardForm|TraditionalForm|OutputForm]"""
 * 
 *         def convert(content):             # <<<<<<<<<<<<<<
 *             head = content.get_head_name()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("mathics.builtin.graphics.Graphics.apply_makeboxes.convert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_head);
  __Pyx_XDECREF(__pyx_v_n_leaves);
  __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_item);
  __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_item);
  __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_leaf);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":470
 *     box_suffix = "Box"
 * 
 *     def apply_makeboxes(self, content, evaluation, options):             # <<<<<<<<<<<<<<
 *         """MakeBoxes[%(name)s[content_, OptionsPattern[%(name)s]],
 *         StandardForm|TraditionalForm|OutputForm]"""
 */

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_8Graphics_apply_makeboxes(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_content, PyObject *__pyx_v_evaluation, PyObject *__pyx_v_options) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_4_apply_makeboxes *__pyx_cur_scope;
  PyObject *__pyx_v_option = NULL;
  PyObject *__pyx_v_box_name = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("apply_makeboxes", 0);
  __pyx_cur_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_4_apply_makeboxes *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_4_apply_makeboxes(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_4_apply_makeboxes, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_4_apply_makeboxes *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 470, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self);
  __pyx_cur_scope->__pyx_v_evaluation = __pyx_v_evaluation;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_evaluation);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_evaluation);

  /* "mathics/builtin/graphics.py":474
 *         StandardForm|TraditionalForm|OutputForm]"""
 * 
 *         def convert(content):             # <<<<<<<<<<<<<<
 *             head = content.get_head_name()
 * 
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_8Graphics_15apply_makeboxes_1convert, 0, __pyx_n_s_Graphics_apply_makeboxes_locals_2, ((PyObject*)__pyx_cur_scope), __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_convert = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":508
 *             return content
 * 
 *         for option in options:             # <<<<<<<<<<<<<<
 *             if option not in ("System`ImageSize",):
 *                 options[option] = Expression("N", options[option]).evaluate(evaluation)
 */
  if (likely(PyList_CheckExact(__pyx_v_options)) || PyTuple_CheckExact(__pyx_v_options)) {
    __pyx_t_1 = __pyx_v_options; __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_options); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 508, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 508, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 508, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 508, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 508, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 508, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 508, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_option, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "mathics/builtin/graphics.py":509
 * 
 *         for option in options:
 *             if option not in ("System`ImageSize",):             # <<<<<<<<<<<<<<
 *                 options[option] = Expression("N", options[option]).evaluate(evaluation)
 *         box_name = "Graphics" + self.box_suffix
 */
    __Pyx_INCREF(__pyx_v_option);
    __pyx_t_4 = __pyx_v_option;
    __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_kp_u_System_ImageSize, Py_NE)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 509, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = (__pyx_t_5 != 0);
    if (__pyx_t_6) {

      /* "mathics/builtin/graphics.py":510
 *         for option in options:
 *             if option not in ("System`ImageSize",):
 *                 options[option] = Expression("N", options[option]).evaluate(evaluation)             # <<<<<<<<<<<<<<
 *         box_name = "Graphics" + self.box_suffix
 *         return Expression(box_name, convert(content), *options_to_rules(options))
 */
      __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_Expression); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 510, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_v_options, __pyx_v_option); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 510, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = NULL;
      __pyx_t_11 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_8);
        if (likely(__pyx_t_10)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_8, function);
          __pyx_t_11 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_8)) {
        PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_n_u_N, __pyx_t_9};
        __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 510, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
        PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_n_u_N, __pyx_t_9};
        __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 510, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      } else
      #endif
      {
        __pyx_t_12 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 510, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        if (__pyx_t_10) {
          __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_10); __pyx_t_10 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_N);
        __Pyx_GIVEREF(__pyx_n_u_N);
        PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_11, __pyx_n_u_N);
        __Pyx_GIVEREF(__pyx_t_9);
        PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_11, __pyx_t_9);
        __pyx_t_9 = 0;
        __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_12, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 510, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_evaluate); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 510, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_8, function);
        }
      }
      __pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_7, __pyx_cur_scope->__pyx_v_evaluation) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_cur_scope->__pyx_v_evaluation);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 510, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(PyObject_SetItem(__pyx_v_options, __pyx_v_option, __pyx_t_4) < 0)) __PYX_ERR(0, 510, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "mathics/builtin/graphics.py":509
 * 
 *         for option in options:
 *             if option not in ("System`ImageSize",):             # <<<<<<<<<<<<<<
 *                 options[option] = Expression("N", options[option]).evaluate(evaluation)
 *         box_name = "Graphics" + self.box_suffix
 */
    }

    /* "mathics/builtin/graphics.py":508
 *             return content
 * 
 *         for option in options:             # <<<<<<<<<<<<<<
 *             if option not in ("System`ImageSize",):
 *                 options[option] = Expression("N", options[option]).evaluate(evaluation)
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":511
 *             if option not in ("System`ImageSize",):
 *                 options[option] = Expression("N", options[option]).evaluate(evaluation)
 *         box_name = "Graphics" + self.box_suffix             # <<<<<<<<<<<<<<
 *         return Expression(box_name, convert(content), *options_to_rules(options))
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_box_suffix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 511, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyNumber_Add(__pyx_n_u_Graphics, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 511, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_box_name = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":512
 *                 options[option] = Expression("N", options[option]).evaluate(evaluation)
 *         box_name = "Graphics" + self.box_suffix
 *         return Expression(box_name, convert(content), *options_to_rules(options))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Expression); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 512, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = __pyx_pf_7mathics_7builtin_8graphics_8Graphics_15apply_makeboxes_convert(__pyx_cur_scope->__pyx_v_convert, __pyx_v_content); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 512, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 512, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_INCREF(__pyx_v_box_name);
  __Pyx_GIVEREF(__pyx_v_box_name);
  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_box_name);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_1);
  __pyx_t_1 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_options_to_rules); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 512, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_12 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_12)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_12);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
    }
  }
  __pyx_t_1 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_12, __pyx_v_options) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_options);
  __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 512, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 512, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_Add(__pyx_t_8, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 512, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 512, __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_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":470
 *     box_suffix = "Box"
 * 
 *     def apply_makeboxes(self, content, evaluation, options):             # <<<<<<<<<<<<<<
 *         """MakeBoxes[%(name)s[content_, OptionsPattern[%(name)s]],
 *         StandardForm|TraditionalForm|OutputForm]"""
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("mathics.builtin.graphics.Graphics.apply_makeboxes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_option);
  __Pyx_XDECREF(__pyx_v_box_name);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":516
 * 
 * class _GraphicsElement(InstancableBuiltin):
 *     def init(self, graphics, item=None, style=None):             # <<<<<<<<<<<<<<
 *         if item is not None and not item.has_form(self.get_name(), None):
 *             raise BoxConstructError
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_16_GraphicsElement_1init(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_16_GraphicsElement_1init = {"init", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_16_GraphicsElement_1init, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_16_GraphicsElement_1init(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_graphics = 0;
  PyObject *__pyx_v_item = 0;
  PyObject *__pyx_v_style = 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);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_graphics,&__pyx_n_s_item,&__pyx_n_s_style,0};
    PyObject* values[4] = {0,0,0,0};
    values[2] = ((PyObject *)((PyObject *)Py_None));
    values[3] = ((PyObject *)((PyObject *)Py_None));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_graphics)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("init", 0, 2, 4, 1); __PYX_ERR(0, 516, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_item);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_style);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "init") < 0)) __PYX_ERR(0, 516, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_graphics = values[1];
    __pyx_v_item = values[2];
    __pyx_v_style = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("init", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 516, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics._GraphicsElement.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_16_GraphicsElement_init(__pyx_self, __pyx_v_self, __pyx_v_graphics, __pyx_v_item, __pyx_v_style);

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_16_GraphicsElement_init(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_graphics, PyObject *__pyx_v_item, PyObject *__pyx_v_style) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("init", 0);

  /* "mathics/builtin/graphics.py":517
 * class _GraphicsElement(InstancableBuiltin):
 *     def init(self, graphics, item=None, style=None):
 *         if item is not None and not item.has_form(self.get_name(), None):             # <<<<<<<<<<<<<<
 *             raise BoxConstructError
 *         self.graphics = graphics
 */
  __pyx_t_2 = (__pyx_v_item != Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_item, __pyx_n_s_has_form); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 517, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_get_name); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 517, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
    }
  }
  __pyx_t_6 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 517, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = NULL;
  __pyx_t_9 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
      __pyx_t_9 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_5)) {
    PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, Py_None};
    __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 517, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
    PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, Py_None};
    __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 517, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else
  #endif
  {
    __pyx_t_8 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 517, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    if (__pyx_t_7) {
      __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_9, __pyx_t_6);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_9, Py_None);
    __pyx_t_6 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 517, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 517, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_2 = ((!__pyx_t_3) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (unlikely(__pyx_t_1)) {

    /* "mathics/builtin/graphics.py":518
 *     def init(self, graphics, item=None, style=None):
 *         if item is not None and not item.has_form(self.get_name(), None):
 *             raise BoxConstructError             # <<<<<<<<<<<<<<
 *         self.graphics = graphics
 *         self.style = style
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_BoxConstructError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 518, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(0, 518, __pyx_L1_error)

    /* "mathics/builtin/graphics.py":517
 * class _GraphicsElement(InstancableBuiltin):
 *     def init(self, graphics, item=None, style=None):
 *         if item is not None and not item.has_form(self.get_name(), None):             # <<<<<<<<<<<<<<
 *             raise BoxConstructError
 *         self.graphics = graphics
 */
  }

  /* "mathics/builtin/graphics.py":519
 *         if item is not None and not item.has_form(self.get_name(), None):
 *             raise BoxConstructError
 *         self.graphics = graphics             # <<<<<<<<<<<<<<
 *         self.style = style
 *         self.is_completely_visible = False  # True for axis elements
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_graphics, __pyx_v_graphics) < 0) __PYX_ERR(0, 519, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":520
 *             raise BoxConstructError
 *         self.graphics = graphics
 *         self.style = style             # <<<<<<<<<<<<<<
 *         self.is_completely_visible = False  # True for axis elements
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_style, __pyx_v_style) < 0) __PYX_ERR(0, 520, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":521
 *         self.graphics = graphics
 *         self.style = style
 *         self.is_completely_visible = False  # True for axis elements             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_is_completely_visible, Py_False) < 0) __PYX_ERR(0, 521, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":516
 * 
 * class _GraphicsElement(InstancableBuiltin):
 *     def init(self, graphics, item=None, style=None):             # <<<<<<<<<<<<<<
 *         if item is not None and not item.has_form(self.get_name(), None):
 *             raise BoxConstructError
 */

  /* 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("mathics.builtin.graphics._GraphicsElement.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":524
 * 
 *     @staticmethod
 *     def create_as_style(klass, graphics, item):             # <<<<<<<<<<<<<<
 *         return klass(graphics, item)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_16_GraphicsElement_3create_as_style(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_16_GraphicsElement_3create_as_style = {"create_as_style", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_16_GraphicsElement_3create_as_style, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_16_GraphicsElement_3create_as_style(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_klass = 0;
  PyObject *__pyx_v_graphics = 0;
  PyObject *__pyx_v_item = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("create_as_style (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_klass,&__pyx_n_s_graphics,&__pyx_n_s_item,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_klass)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_graphics)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("create_as_style", 1, 3, 3, 1); __PYX_ERR(0, 524, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_item)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("create_as_style", 1, 3, 3, 2); __PYX_ERR(0, 524, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "create_as_style") < 0)) __PYX_ERR(0, 524, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_klass = values[0];
    __pyx_v_graphics = values[1];
    __pyx_v_item = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("create_as_style", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 524, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics._GraphicsElement.create_as_style", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_16_GraphicsElement_2create_as_style(__pyx_self, __pyx_v_klass, __pyx_v_graphics, __pyx_v_item);

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_16_GraphicsElement_2create_as_style(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_klass, PyObject *__pyx_v_graphics, PyObject *__pyx_v_item) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("create_as_style", 0);

  /* "mathics/builtin/graphics.py":525
 *     @staticmethod
 *     def create_as_style(klass, graphics, item):
 *         return klass(graphics, item)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_klass);
  __pyx_t_2 = __pyx_v_klass; __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_graphics, __pyx_v_item};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_graphics, __pyx_v_item};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 525, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(__pyx_v_graphics);
    __Pyx_GIVEREF(__pyx_v_graphics);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_graphics);
    __Pyx_INCREF(__pyx_v_item);
    __Pyx_GIVEREF(__pyx_v_item);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_item);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":524
 * 
 *     @staticmethod
 *     def create_as_style(klass, graphics, item):             # <<<<<<<<<<<<<<
 *         return klass(graphics, item)
 * 
 */

  /* 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("mathics.builtin.graphics._GraphicsElement.create_as_style", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":547
 *     default_components = []
 * 
 *     def init(self, item=None, components=None):             # <<<<<<<<<<<<<<
 *         super(_Color, self).init(None, item)
 *         if item is not None:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_6_Color_1init(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_6_Color_1init = {"init", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_6_Color_1init, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_6_Color_1init(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_item = 0;
  PyObject *__pyx_v_components = 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);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_item,&__pyx_n_s_components,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)((PyObject *)Py_None));
    values[2] = ((PyObject *)((PyObject *)Py_None));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_item);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_components);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "init") < 0)) __PYX_ERR(0, 547, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_item = values[1];
    __pyx_v_components = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("init", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 547, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics._Color.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_6_Color_init(__pyx_self, __pyx_v_self, __pyx_v_item, __pyx_v_components);

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_6_Color_init(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_components) {
  PyObject *__pyx_v_leaves = NULL;
  PyObject *__pyx_8genexpr7__pyx_v_value = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  PyObject *__pyx_t_10 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("init", 0);
  __Pyx_INCREF(__pyx_v_components);

  /* "mathics/builtin/graphics.py":548
 * 
 *     def init(self, item=None, components=None):
 *         super(_Color, self).init(None, item)             # <<<<<<<<<<<<<<
 *         if item is not None:
 *             leaves = item.leaves
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Color); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 548, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 548, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_INCREF(__pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 548, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 548, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_2, Py_None, __pyx_v_item};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 548, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_2, Py_None, __pyx_v_item};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 548, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 548, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_2) {
      __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
    }
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, Py_None);
    __Pyx_INCREF(__pyx_v_item);
    __Pyx_GIVEREF(__pyx_v_item);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_item);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 548, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":549
 *     def init(self, item=None, components=None):
 *         super(_Color, self).init(None, item)
 *         if item is not None:             # <<<<<<<<<<<<<<
 *             leaves = item.leaves
 *             if len(leaves) in self.components_sizes:
 */
  __pyx_t_6 = (__pyx_v_item != Py_None);
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "mathics/builtin/graphics.py":550
 *         super(_Color, self).init(None, item)
 *         if item is not None:
 *             leaves = item.leaves             # <<<<<<<<<<<<<<
 *             if len(leaves) in self.components_sizes:
 *                 # we must not clip here; we copy the components, without clipping,
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_item, __pyx_n_s_leaves); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 550, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_leaves = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "mathics/builtin/graphics.py":551
 *         if item is not None:
 *             leaves = item.leaves
 *             if len(leaves) in self.components_sizes:             # <<<<<<<<<<<<<<
 *                 # we must not clip here; we copy the components, without clipping,
 *                 # e.g. RGBColor[-1, 0, 0] stays RGBColor[-1, 0, 0]. this is especially
 */
    __pyx_t_8 = PyObject_Length(__pyx_v_leaves); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 551, __pyx_L1_error)
    __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 551, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_components_sizes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 551, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_t_3, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 551, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_6 = (__pyx_t_7 != 0);
    if (likely(__pyx_t_6)) {

      /* "mathics/builtin/graphics.py":556
 *                 # important for color spaces like LAB that have negative components.
 * 
 *                 components = [value.round_to_float() for value in leaves]             # <<<<<<<<<<<<<<
 *                 if None in components:
 *                     raise ColorError
 */
      { /* enter inner scope */
        __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 556, __pyx_L7_error)
        __Pyx_GOTREF(__pyx_t_3);
        if (likely(PyList_CheckExact(__pyx_v_leaves)) || PyTuple_CheckExact(__pyx_v_leaves)) {
          __pyx_t_1 = __pyx_v_leaves; __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_leaves); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 556, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_9 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 556, __pyx_L7_error)
        }
        for (;;) {
          if (likely(!__pyx_t_9)) {
            if (likely(PyList_CheckExact(__pyx_t_1))) {
              if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_1)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 556, __pyx_L7_error)
              #else
              __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 556, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_5);
              #endif
            } else {
              if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 556, __pyx_L7_error)
              #else
              __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 556, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_5);
              #endif
            }
          } else {
            __pyx_t_5 = __pyx_t_9(__pyx_t_1);
            if (unlikely(!__pyx_t_5)) {
              PyObject* exc_type = PyErr_Occurred();
              if (exc_type) {
                if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                else __PYX_ERR(0, 556, __pyx_L7_error)
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_5);
          }
          __Pyx_XDECREF_SET(__pyx_8genexpr7__pyx_v_value, __pyx_t_5);
          __pyx_t_5 = 0;
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_8genexpr7__pyx_v_value, __pyx_n_s_round_to_float); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 556, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_10 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
            __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_2);
            if (likely(__pyx_t_10)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
              __Pyx_INCREF(__pyx_t_10);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_2, function);
            }
          }
          __pyx_t_5 = (__pyx_t_10) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_10) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 556, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 556, __pyx_L7_error)
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_value); __pyx_8genexpr7__pyx_v_value = 0;
        goto __pyx_L10_exit_scope;
        __pyx_L7_error:;
        __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_value); __pyx_8genexpr7__pyx_v_value = 0;
        goto __pyx_L1_error;
        __pyx_L10_exit_scope:;
      } /* exit inner scope */
      __Pyx_DECREF_SET(__pyx_v_components, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "mathics/builtin/graphics.py":557
 * 
 *                 components = [value.round_to_float() for value in leaves]
 *                 if None in components:             # <<<<<<<<<<<<<<
 *                     raise ColorError
 * 
 */
      __pyx_t_6 = (__Pyx_PySequence_ContainsTF(Py_None, __pyx_v_components, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 557, __pyx_L1_error)
      __pyx_t_7 = (__pyx_t_6 != 0);
      if (unlikely(__pyx_t_7)) {

        /* "mathics/builtin/graphics.py":558
 *                 components = [value.round_to_float() for value in leaves]
 *                 if None in components:
 *                     raise ColorError             # <<<<<<<<<<<<<<
 * 
 *                 # the following lines always extend to the maximum available
 */
        __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ColorError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 558, __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(0, 558, __pyx_L1_error)

        /* "mathics/builtin/graphics.py":557
 * 
 *                 components = [value.round_to_float() for value in leaves]
 *                 if None in components:             # <<<<<<<<<<<<<<
 *                     raise ColorError
 * 
 */
      }

      /* "mathics/builtin/graphics.py":565
 *                 # to do in this general context. poke1024
 * 
 *                 if len(components) < 3:             # <<<<<<<<<<<<<<
 *                     components.extend(self.default_components[len(components) :])
 * 
 */
      __pyx_t_8 = PyObject_Length(__pyx_v_components); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 565, __pyx_L1_error)
      __pyx_t_7 = ((__pyx_t_8 < 3) != 0);
      if (__pyx_t_7) {

        /* "mathics/builtin/graphics.py":566
 * 
 *                 if len(components) < 3:
 *                     components.extend(self.default_components[len(components) :])             # <<<<<<<<<<<<<<
 * 
 *                 self.components = components
 */
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_components, __pyx_n_s_extend); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 566, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_default_components); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 566, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_8 = PyObject_Length(__pyx_v_components); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 566, __pyx_L1_error)
        __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_t_5, __pyx_t_8, 0, NULL, NULL, NULL, 1, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 566, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
          if (likely(__pyx_t_5)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_1, function);
          }
        }
        __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2);
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 566, __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;

        /* "mathics/builtin/graphics.py":565
 *                 # to do in this general context. poke1024
 * 
 *                 if len(components) < 3:             # <<<<<<<<<<<<<<
 *                     components.extend(self.default_components[len(components) :])
 * 
 */
      }

      /* "mathics/builtin/graphics.py":568
 *                     components.extend(self.default_components[len(components) :])
 * 
 *                 self.components = components             # <<<<<<<<<<<<<<
 *             else:
 *                 raise ColorError
 */
      if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_components, __pyx_v_components) < 0) __PYX_ERR(0, 568, __pyx_L1_error)

      /* "mathics/builtin/graphics.py":551
 *         if item is not None:
 *             leaves = item.leaves
 *             if len(leaves) in self.components_sizes:             # <<<<<<<<<<<<<<
 *                 # we must not clip here; we copy the components, without clipping,
 *                 # e.g. RGBColor[-1, 0, 0] stays RGBColor[-1, 0, 0]. this is especially
 */
      goto __pyx_L4;
    }

    /* "mathics/builtin/graphics.py":570
 *                 self.components = components
 *             else:
 *                 raise ColorError             # <<<<<<<<<<<<<<
 *         elif components is not None:
 *             self.components = components
 */
    /*else*/ {
      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ColorError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 570, __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(0, 570, __pyx_L1_error)
    }
    __pyx_L4:;

    /* "mathics/builtin/graphics.py":549
 *     def init(self, item=None, components=None):
 *         super(_Color, self).init(None, item)
 *         if item is not None:             # <<<<<<<<<<<<<<
 *             leaves = item.leaves
 *             if len(leaves) in self.components_sizes:
 */
    goto __pyx_L3;
  }

  /* "mathics/builtin/graphics.py":571
 *             else:
 *                 raise ColorError
 *         elif components is not None:             # <<<<<<<<<<<<<<
 *             self.components = components
 * 
 */
  __pyx_t_7 = (__pyx_v_components != Py_None);
  __pyx_t_6 = (__pyx_t_7 != 0);
  if (__pyx_t_6) {

    /* "mathics/builtin/graphics.py":572
 *                 raise ColorError
 *         elif components is not None:
 *             self.components = components             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_components, __pyx_v_components) < 0) __PYX_ERR(0, 572, __pyx_L1_error)

    /* "mathics/builtin/graphics.py":571
 *             else:
 *                 raise ColorError
 *         elif components is not None:             # <<<<<<<<<<<<<<
 *             self.components = components
 * 
 */
  }
  __pyx_L3:;

  /* "mathics/builtin/graphics.py":547
 *     default_components = []
 * 
 *     def init(self, item=None, components=None):             # <<<<<<<<<<<<<<
 *         super(_Color, self).init(None, item)
 *         if item is not None:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("mathics.builtin.graphics._Color.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_leaves);
  __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_value);
  __Pyx_XDECREF(__pyx_v_components);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":575
 * 
 *     @staticmethod
 *     def create(expr):             # <<<<<<<<<<<<<<
 *         head = expr.get_head_name()
 *         cls = get_class(head)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_6_Color_3create(PyObject *__pyx_self, PyObject *__pyx_v_expr); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_6_Color_3create = {"create", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_6_Color_3create, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_6_Color_3create(PyObject *__pyx_self, PyObject *__pyx_v_expr) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("create (wrapper)", 0);
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_6_Color_2create(__pyx_self, ((PyObject *)__pyx_v_expr));

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_6_Color_2create(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_expr) {
  PyObject *__pyx_v_head = NULL;
  PyObject *__pyx_v_cls = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("create", 0);

  /* "mathics/builtin/graphics.py":576
 *     @staticmethod
 *     def create(expr):
 *         head = expr.get_head_name()             # <<<<<<<<<<<<<<
 *         cls = get_class(head)
 *         if cls is None:
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_expr, __pyx_n_s_get_head_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 576, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 576, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_head = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":577
 *     def create(expr):
 *         head = expr.get_head_name()
 *         cls = get_class(head)             # <<<<<<<<<<<<<<
 *         if cls is None:
 *             raise ColorError
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_get_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 577, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_head) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_head);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 577, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_cls = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":578
 *         head = expr.get_head_name()
 *         cls = get_class(head)
 *         if cls is None:             # <<<<<<<<<<<<<<
 *             raise ColorError
 *         return cls(expr)
 */
  __pyx_t_4 = (__pyx_v_cls == Py_None);
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (unlikely(__pyx_t_5)) {

    /* "mathics/builtin/graphics.py":579
 *         cls = get_class(head)
 *         if cls is None:
 *             raise ColorError             # <<<<<<<<<<<<<<
 *         return cls(expr)
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ColorError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 579, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 579, __pyx_L1_error)

    /* "mathics/builtin/graphics.py":578
 *         head = expr.get_head_name()
 *         cls = get_class(head)
 *         if cls is None:             # <<<<<<<<<<<<<<
 *             raise ColorError
 *         return cls(expr)
 */
  }

  /* "mathics/builtin/graphics.py":580
 *         if cls is None:
 *             raise ColorError
 *         return cls(expr)             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_cls);
  __pyx_t_2 = __pyx_v_cls; __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_expr) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_expr);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 580, __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;

  /* "mathics/builtin/graphics.py":575
 * 
 *     @staticmethod
 *     def create(expr):             # <<<<<<<<<<<<<<
 *         head = expr.get_head_name()
 *         cls = get_class(head)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("mathics.builtin.graphics._Color.create", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_head);
  __Pyx_XDECREF(__pyx_v_cls);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":583
 * 
 *     @staticmethod
 *     def create_as_style(klass, graphics, item):             # <<<<<<<<<<<<<<
 *         return klass(item)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_6_Color_5create_as_style(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_6_Color_5create_as_style = {"create_as_style", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_6_Color_5create_as_style, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_6_Color_5create_as_style(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_klass = 0;
  CYTHON_UNUSED PyObject *__pyx_v_graphics = 0;
  PyObject *__pyx_v_item = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("create_as_style (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_klass,&__pyx_n_s_graphics,&__pyx_n_s_item,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_klass)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_graphics)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("create_as_style", 1, 3, 3, 1); __PYX_ERR(0, 583, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_item)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("create_as_style", 1, 3, 3, 2); __PYX_ERR(0, 583, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "create_as_style") < 0)) __PYX_ERR(0, 583, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_klass = values[0];
    __pyx_v_graphics = values[1];
    __pyx_v_item = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("create_as_style", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 583, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics._Color.create_as_style", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_6_Color_4create_as_style(__pyx_self, __pyx_v_klass, __pyx_v_graphics, __pyx_v_item);

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_6_Color_4create_as_style(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_klass, CYTHON_UNUSED PyObject *__pyx_v_graphics, PyObject *__pyx_v_item) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("create_as_style", 0);

  /* "mathics/builtin/graphics.py":584
 *     @staticmethod
 *     def create_as_style(klass, graphics, item):
 *         return klass(item)             # <<<<<<<<<<<<<<
 * 
 *     def to_css(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_klass);
  __pyx_t_2 = __pyx_v_klass; __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_item) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_item);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 584, __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;

  /* "mathics/builtin/graphics.py":583
 * 
 *     @staticmethod
 *     def create_as_style(klass, graphics, item):             # <<<<<<<<<<<<<<
 *         return klass(item)
 * 
 */

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

/* "mathics/builtin/graphics.py":586
 *         return klass(item)
 * 
 *     def to_css(self):             # <<<<<<<<<<<<<<
 *         rgba = self.to_rgba()
 *         alpha = rgba[3] if len(rgba) > 3 else 1.0
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_6_Color_7to_css(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_6_Color_7to_css = {"to_css", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_6_Color_7to_css, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_6_Color_7to_css(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_css (wrapper)", 0);
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_6_Color_6to_css(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_6_Color_6to_css(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_rgba = NULL;
  PyObject *__pyx_v_alpha = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  Py_UCS4 __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_css", 0);

  /* "mathics/builtin/graphics.py":587
 * 
 *     def to_css(self):
 *         rgba = self.to_rgba()             # <<<<<<<<<<<<<<
 *         alpha = rgba[3] if len(rgba) > 3 else 1.0
 *         return (
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_to_rgba); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 587, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 587, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_rgba = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":588
 *     def to_css(self):
 *         rgba = self.to_rgba()
 *         alpha = rgba[3] if len(rgba) > 3 else 1.0             # <<<<<<<<<<<<<<
 *         return (
 *             r"rgb(%f%%, %f%%, %f%%)" % (rgba[0] * 100, rgba[1] * 100, rgba[2] * 100),
 */
  __pyx_t_4 = PyObject_Length(__pyx_v_rgba); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 588, __pyx_L1_error)
  if (((__pyx_t_4 > 3) != 0)) {
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_rgba, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 588, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
  } else {
    __Pyx_INCREF(__pyx_float_1_0);
    __pyx_t_1 = __pyx_float_1_0;
  }
  __pyx_v_alpha = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":589
 *         rgba = self.to_rgba()
 *         alpha = rgba[3] if len(rgba) > 3 else 1.0
 *         return (             # <<<<<<<<<<<<<<
 *             r"rgb(%f%%, %f%%, %f%%)" % (rgba[0] * 100, rgba[1] * 100, rgba[2] * 100),
 *             alpha,
 */
  __Pyx_XDECREF(__pyx_r);

  /* "mathics/builtin/graphics.py":590
 *         alpha = rgba[3] if len(rgba) > 3 else 1.0
 *         return (
 *             r"rgb(%f%%, %f%%, %f%%)" % (rgba[0] * 100, rgba[1] * 100, rgba[2] * 100),             # <<<<<<<<<<<<<<
 *             alpha,
 *         )
 */
  __pyx_t_1 = PyTuple_New(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 590, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = 0;
  __pyx_t_5 = 127;
  __Pyx_INCREF(__pyx_kp_u_rgb);
  __pyx_t_4 += 4;
  __Pyx_GIVEREF(__pyx_kp_u_rgb);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_rgb);
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_rgba, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 590, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyNumber_Multiply(__pyx_t_2, __pyx_int_100); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 590, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Format(__pyx_t_3, __pyx_n_u_f); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 590, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_5) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_5;
  __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
  __pyx_t_2 = 0;
  __Pyx_INCREF(__pyx_kp_u__16);
  __pyx_t_4 += 3;
  __Pyx_GIVEREF(__pyx_kp_u__16);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u__16);
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_rgba, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 590, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyNumber_Multiply(__pyx_t_2, __pyx_int_100); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 590, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Format(__pyx_t_3, __pyx_n_u_f); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 590, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_5) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_5;
  __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_2);
  __pyx_t_2 = 0;
  __Pyx_INCREF(__pyx_kp_u__16);
  __pyx_t_4 += 3;
  __Pyx_GIVEREF(__pyx_kp_u__16);
  PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u__16);
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_rgba, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 590, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyNumber_Multiply(__pyx_t_2, __pyx_int_100); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 590, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Format(__pyx_t_3, __pyx_n_u_f); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 590, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_5) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_5;
  __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_t_2);
  __pyx_t_2 = 0;
  __Pyx_INCREF(__pyx_kp_u__17);
  __pyx_t_4 += 2;
  __Pyx_GIVEREF(__pyx_kp_u__17);
  PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_kp_u__17);
  __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_1, 7, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 590, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":591
 *         return (
 *             r"rgb(%f%%, %f%%, %f%%)" % (rgba[0] * 100, rgba[1] * 100, rgba[2] * 100),
 *             alpha,             # <<<<<<<<<<<<<<
 *         )
 * 
 */
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 590, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __Pyx_INCREF(__pyx_v_alpha);
  __Pyx_GIVEREF(__pyx_v_alpha);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_alpha);
  __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":586
 *         return klass(item)
 * 
 *     def to_css(self):             # <<<<<<<<<<<<<<
 *         rgba = self.to_rgba()
 *         alpha = rgba[3] if len(rgba) > 3 else 1.0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("mathics.builtin.graphics._Color.to_css", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_rgba);
  __Pyx_XDECREF(__pyx_v_alpha);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":594
 *         )
 * 
 *     def to_asy(self):             # <<<<<<<<<<<<<<
 *         rgba = self.to_rgba()
 *         alpha = rgba[3] if len(rgba) > 3 else 1.0
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_6_Color_9to_asy(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_6_Color_9to_asy = {"to_asy", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_6_Color_9to_asy, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_6_Color_9to_asy(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_asy (wrapper)", 0);
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_6_Color_8to_asy(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_6_Color_8to_asy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_rgba = NULL;
  PyObject *__pyx_v_alpha = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  Py_UCS4 __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_asy", 0);

  /* "mathics/builtin/graphics.py":595
 * 
 *     def to_asy(self):
 *         rgba = self.to_rgba()             # <<<<<<<<<<<<<<
 *         alpha = rgba[3] if len(rgba) > 3 else 1.0
 *         return (
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_to_rgba); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 595, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 595, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_rgba = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":596
 *     def to_asy(self):
 *         rgba = self.to_rgba()
 *         alpha = rgba[3] if len(rgba) > 3 else 1.0             # <<<<<<<<<<<<<<
 *         return (
 *             r"rgb(%s, %s, %s)"
 */
  __pyx_t_4 = PyObject_Length(__pyx_v_rgba); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 596, __pyx_L1_error)
  if (((__pyx_t_4 > 3) != 0)) {
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_rgba, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 596, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
  } else {
    __Pyx_INCREF(__pyx_float_1_0);
    __pyx_t_1 = __pyx_float_1_0;
  }
  __pyx_v_alpha = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":597
 *         rgba = self.to_rgba()
 *         alpha = rgba[3] if len(rgba) > 3 else 1.0
 *         return (             # <<<<<<<<<<<<<<
 *             r"rgb(%s, %s, %s)"
 *             % (asy_number(rgba[0]), asy_number(rgba[1]), asy_number(rgba[2])),
 */
  __Pyx_XDECREF(__pyx_r);

  /* "mathics/builtin/graphics.py":598
 *         alpha = rgba[3] if len(rgba) > 3 else 1.0
 *         return (
 *             r"rgb(%s, %s, %s)"             # <<<<<<<<<<<<<<
 *             % (asy_number(rgba[0]), asy_number(rgba[1]), asy_number(rgba[2])),
 *             alpha,
 */
  __pyx_t_1 = PyTuple_New(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 598, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = 0;
  __pyx_t_5 = 127;
  __Pyx_INCREF(__pyx_kp_u_rgb);
  __pyx_t_4 += 4;
  __Pyx_GIVEREF(__pyx_kp_u_rgb);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_rgb);

  /* "mathics/builtin/graphics.py":599
 *         return (
 *             r"rgb(%s, %s, %s)"
 *             % (asy_number(rgba[0]), asy_number(rgba[1]), asy_number(rgba[2])),             # <<<<<<<<<<<<<<
 *             alpha,
 *         )
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_asy_number); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 599, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_rgba, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 599, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 599, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_2), __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 599, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_5 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_5) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_5;
  __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
  __pyx_t_3 = 0;
  __Pyx_INCREF(__pyx_kp_u__4);
  __pyx_t_4 += 2;
  __Pyx_GIVEREF(__pyx_kp_u__4);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u__4);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_asy_number); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 599, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_rgba, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 599, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 599, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_3), __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 599, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_5) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_5;
  __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_2);
  __pyx_t_2 = 0;
  __Pyx_INCREF(__pyx_kp_u__4);
  __pyx_t_4 += 2;
  __Pyx_GIVEREF(__pyx_kp_u__4);
  PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u__4);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_asy_number); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 599, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_rgba, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 599, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 599, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_2), __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 599, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_5 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_5) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_5;
  __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_t_3);
  __pyx_t_3 = 0;
  __Pyx_INCREF(__pyx_kp_u__6);
  __pyx_t_4 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__6);
  PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_kp_u__6);

  /* "mathics/builtin/graphics.py":598
 *         alpha = rgba[3] if len(rgba) > 3 else 1.0
 *         return (
 *             r"rgb(%s, %s, %s)"             # <<<<<<<<<<<<<<
 *             % (asy_number(rgba[0]), asy_number(rgba[1]), asy_number(rgba[2])),
 *             alpha,
 */
  __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_1, 7, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 598, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":600
 *             r"rgb(%s, %s, %s)"
 *             % (asy_number(rgba[0]), asy_number(rgba[1]), asy_number(rgba[2])),
 *             alpha,             # <<<<<<<<<<<<<<
 *         )
 * 
 */
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 598, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
  __Pyx_INCREF(__pyx_v_alpha);
  __Pyx_GIVEREF(__pyx_v_alpha);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_alpha);
  __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":594
 *         )
 * 
 *     def to_asy(self):             # <<<<<<<<<<<<<<
 *         rgba = self.to_rgba()
 *         alpha = rgba[3] if len(rgba) > 3 else 1.0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("mathics.builtin.graphics._Color.to_asy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_rgba);
  __Pyx_XDECREF(__pyx_v_alpha);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":603
 *         )
 * 
 *     def to_js(self):             # <<<<<<<<<<<<<<
 *         return self.to_rgba()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_6_Color_11to_js(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_6_Color_11to_js = {"to_js", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_6_Color_11to_js, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_6_Color_11to_js(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_js (wrapper)", 0);
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_6_Color_10to_js(__pyx_self, ((PyObject *)__pyx_v_self));

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

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

  /* "mathics/builtin/graphics.py":604
 * 
 *     def to_js(self):
 *         return self.to_rgba()             # <<<<<<<<<<<<<<
 * 
 *     def to_expr(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_to_rgba); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 604, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 604, __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;

  /* "mathics/builtin/graphics.py":603
 *         )
 * 
 *     def to_js(self):             # <<<<<<<<<<<<<<
 *         return self.to_rgba()
 * 
 */

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

/* "mathics/builtin/graphics.py":606
 *         return self.to_rgba()
 * 
 *     def to_expr(self):             # <<<<<<<<<<<<<<
 *         return Expression(self.get_name(), *self.components)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_6_Color_13to_expr(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_6_Color_13to_expr = {"to_expr", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_6_Color_13to_expr, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_6_Color_13to_expr(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_expr (wrapper)", 0);
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_6_Color_12to_expr(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_6_Color_12to_expr(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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_expr", 0);

  /* "mathics/builtin/graphics.py":607
 * 
 *     def to_expr(self):
 *         return Expression(self.get_name(), *self.components)             # <<<<<<<<<<<<<<
 * 
 *     def to_rgba(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Expression); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 607, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_get_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 607, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 607, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 607, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_components); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 607, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 607, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 607, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 607, __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_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":606
 *         return self.to_rgba()
 * 
 *     def to_expr(self):             # <<<<<<<<<<<<<<
 *         return Expression(self.get_name(), *self.components)
 * 
 */

  /* 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("mathics.builtin.graphics._Color.to_expr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":609
 *         return Expression(self.get_name(), *self.components)
 * 
 *     def to_rgba(self):             # <<<<<<<<<<<<<<
 *         return self.to_color_space("RGB")
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_6_Color_15to_rgba(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_6_Color_15to_rgba = {"to_rgba", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_6_Color_15to_rgba, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_6_Color_15to_rgba(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_rgba (wrapper)", 0);
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_6_Color_14to_rgba(__pyx_self, ((PyObject *)__pyx_v_self));

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

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

  /* "mathics/builtin/graphics.py":610
 * 
 *     def to_rgba(self):
 *         return self.to_color_space("RGB")             # <<<<<<<<<<<<<<
 * 
 *     def to_color_space(self, color_space):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_to_color_space); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 610, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_n_u_RGB) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_n_u_RGB);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 610, __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;

  /* "mathics/builtin/graphics.py":609
 *         return Expression(self.get_name(), *self.components)
 * 
 *     def to_rgba(self):             # <<<<<<<<<<<<<<
 *         return self.to_color_space("RGB")
 * 
 */

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

/* "mathics/builtin/graphics.py":612
 *         return self.to_color_space("RGB")
 * 
 *     def to_color_space(self, color_space):             # <<<<<<<<<<<<<<
 *         components = convert_color(self.components, self.color_space, color_space)
 *         if components is None:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_6_Color_17to_color_space(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_6_Color_17to_color_space = {"to_color_space", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_6_Color_17to_color_space, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_6_Color_17to_color_space(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_color_space = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_color_space (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_color_space,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_color_space)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("to_color_space", 1, 2, 2, 1); __PYX_ERR(0, 612, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "to_color_space") < 0)) __PYX_ERR(0, 612, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_color_space = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("to_color_space", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 612, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics._Color.to_color_space", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_6_Color_16to_color_space(__pyx_self, __pyx_v_self, __pyx_v_color_space);

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_6_Color_16to_color_space(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_color_space) {
  PyObject *__pyx_v_components = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  Py_UCS4 __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_color_space", 0);

  /* "mathics/builtin/graphics.py":613
 * 
 *     def to_color_space(self, color_space):
 *         components = convert_color(self.components, self.color_space, color_space)             # <<<<<<<<<<<<<<
 *         if components is None:
 *             raise ValueError(
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_convert_color); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 613, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_components); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 613, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_color_space); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 613, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_t_3, __pyx_t_4, __pyx_v_color_space};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 613, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_t_3, __pyx_t_4, __pyx_v_color_space};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 613, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else
  #endif
  {
    __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 613, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_5) {
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_4);
    __Pyx_INCREF(__pyx_v_color_space);
    __Pyx_GIVEREF(__pyx_v_color_space);
    PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_v_color_space);
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 613, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_components = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":614
 *     def to_color_space(self, color_space):
 *         components = convert_color(self.components, self.color_space, color_space)
 *         if components is None:             # <<<<<<<<<<<<<<
 *             raise ValueError(
 *                 "cannot convert from color space %s to %s."
 */
  __pyx_t_8 = (__pyx_v_components == Py_None);
  __pyx_t_9 = (__pyx_t_8 != 0);
  if (unlikely(__pyx_t_9)) {

    /* "mathics/builtin/graphics.py":616
 *         if components is None:
 *             raise ValueError(
 *                 "cannot convert from color space %s to %s."             # <<<<<<<<<<<<<<
 *                 % (self.color_space, color_space)
 *             )
 */
    __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 616, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_10 = 0;
    __pyx_t_11 = 127;
    __Pyx_INCREF(__pyx_kp_u_cannot_convert_from_color_space);
    __pyx_t_10 += 32;
    __Pyx_GIVEREF(__pyx_kp_u_cannot_convert_from_color_space);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_cannot_convert_from_color_space);

    /* "mathics/builtin/graphics.py":617
 *             raise ValueError(
 *                 "cannot convert from color space %s to %s."
 *                 % (self.color_space, color_space)             # <<<<<<<<<<<<<<
 *             )
 *         return components
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_color_space); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 617, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_7 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_2), __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 617, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_11 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_11) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_11;
    __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_7);
    __pyx_t_7 = 0;
    __Pyx_INCREF(__pyx_kp_u_to);
    __pyx_t_10 += 4;
    __Pyx_GIVEREF(__pyx_kp_u_to);
    PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_to);
    __pyx_t_7 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_color_space), __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 617, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_11 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_11) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_11;
    __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_7);
    __pyx_t_7 = 0;
    __Pyx_INCREF(__pyx_kp_u__18);
    __pyx_t_10 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__18);
    PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u__18);

    /* "mathics/builtin/graphics.py":616
 *         if components is None:
 *             raise ValueError(
 *                 "cannot convert from color space %s to %s."             # <<<<<<<<<<<<<<
 *                 % (self.color_space, color_space)
 *             )
 */
    __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_1, 5, __pyx_t_10, __pyx_t_11); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 616, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "mathics/builtin/graphics.py":615
 *         components = convert_color(self.components, self.color_space, color_space)
 *         if components is None:
 *             raise ValueError(             # <<<<<<<<<<<<<<
 *                 "cannot convert from color space %s to %s."
 *                 % (self.color_space, color_space)
 */
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 615, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 615, __pyx_L1_error)

    /* "mathics/builtin/graphics.py":614
 *     def to_color_space(self, color_space):
 *         components = convert_color(self.components, self.color_space, color_space)
 *         if components is None:             # <<<<<<<<<<<<<<
 *             raise ValueError(
 *                 "cannot convert from color space %s to %s."
 */
  }

  /* "mathics/builtin/graphics.py":619
 *                 % (self.color_space, color_space)
 *             )
 *         return components             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_components);
  __pyx_r = __pyx_v_components;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":612
 *         return self.to_color_space("RGB")
 * 
 *     def to_color_space(self, color_space):             # <<<<<<<<<<<<<<
 *         components = convert_color(self.components, self.color_space, color_space)
 *         if components is None:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("mathics.builtin.graphics._Color.to_color_space", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_components);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":644
 *     default_components = [0, 0, 0, 1]
 * 
 *     def to_rgba(self):             # <<<<<<<<<<<<<<
 *         return self.components
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_8RGBColor_1to_rgba(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_8RGBColor_1to_rgba = {"to_rgba", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_8RGBColor_1to_rgba, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_8RGBColor_1to_rgba(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_rgba (wrapper)", 0);
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_8RGBColor_to_rgba(__pyx_self, ((PyObject *)__pyx_v_self));

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

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

  /* "mathics/builtin/graphics.py":645
 * 
 *     def to_rgba(self):
 *         return self.components             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_components); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 645, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":644
 *     default_components = [0, 0, 0, 1]
 * 
 *     def to_rgba(self):             # <<<<<<<<<<<<<<
 *         return self.components
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("mathics.builtin.graphics.RGBColor.to_rgba", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":743
 *     default_components = [0, 1, 1, 1]
 * 
 *     def hsl_to_rgba(self):             # <<<<<<<<<<<<<<
 *         h, s, l = self.components[:3]
 *         if l < 0.5:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_3Hue_1hsl_to_rgba(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_3Hue_1hsl_to_rgba = {"hsl_to_rgba", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_3Hue_1hsl_to_rgba, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_3Hue_1hsl_to_rgba(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("hsl_to_rgba (wrapper)", 0);
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_3Hue_hsl_to_rgba(__pyx_self, ((PyObject *)__pyx_v_self));

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

/* "mathics/builtin/graphics.py":753
 *         rgb = (h + 1 / 3, h, h - 1 / 3)
 * 
 *         def map(value):             # <<<<<<<<<<<<<<
 *             if value < 0:
 *                 value += 1
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_3Hue_11hsl_to_rgba_1map(PyObject *__pyx_self, PyObject *__pyx_v_value); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_3Hue_11hsl_to_rgba_1map = {"map", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_3Hue_11hsl_to_rgba_1map, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_3Hue_11hsl_to_rgba_1map(PyObject *__pyx_self, PyObject *__pyx_v_value) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("map (wrapper)", 0);
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_3Hue_11hsl_to_rgba_map(__pyx_self, ((PyObject *)__pyx_v_value));

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_3Hue_11hsl_to_rgba_map(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_value) {
  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("map", 0);
  __Pyx_INCREF(__pyx_v_value);

  /* "mathics/builtin/graphics.py":754
 * 
 *         def map(value):
 *             if value < 0:             # <<<<<<<<<<<<<<
 *                 value += 1
 *             if value > 1:
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_value, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 754, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 754, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "mathics/builtin/graphics.py":755
 *         def map(value):
 *             if value < 0:
 *                 value += 1             # <<<<<<<<<<<<<<
 *             if value > 1:
 *                 value -= 1
 */
    __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_value, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 755, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "mathics/builtin/graphics.py":754
 * 
 *         def map(value):
 *             if value < 0:             # <<<<<<<<<<<<<<
 *                 value += 1
 *             if value > 1:
 */
  }

  /* "mathics/builtin/graphics.py":756
 *             if value < 0:
 *                 value += 1
 *             if value > 1:             # <<<<<<<<<<<<<<
 *                 value -= 1
 *             return value
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_value, __pyx_int_1, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 756, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 756, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "mathics/builtin/graphics.py":757
 *                 value += 1
 *             if value > 1:
 *                 value -= 1             # <<<<<<<<<<<<<<
 *             return value
 * 
 */
    __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_v_value, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 757, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "mathics/builtin/graphics.py":756
 *             if value < 0:
 *                 value += 1
 *             if value > 1:             # <<<<<<<<<<<<<<
 *                 value -= 1
 *             return value
 */
  }

  /* "mathics/builtin/graphics.py":758
 *             if value > 1:
 *                 value -= 1
 *             return value             # <<<<<<<<<<<<<<
 * 
 *         def trans(t):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_value);
  __pyx_r = __pyx_v_value;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":753
 *         rgb = (h + 1 / 3, h, h - 1 / 3)
 * 
 *         def map(value):             # <<<<<<<<<<<<<<
 *             if value < 0:
 *                 value += 1
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("mathics.builtin.graphics.Hue.hsl_to_rgba.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":760
 *             return value
 * 
 *         def trans(t):             # <<<<<<<<<<<<<<
 *             if t < 1 / 6:
 *                 return p + ((q - p) * 6 * t)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_3Hue_11hsl_to_rgba_3trans(PyObject *__pyx_self, PyObject *__pyx_v_t); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_3Hue_11hsl_to_rgba_3trans = {"trans", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_3Hue_11hsl_to_rgba_3trans, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_3Hue_11hsl_to_rgba_3trans(PyObject *__pyx_self, PyObject *__pyx_v_t) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("trans (wrapper)", 0);
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_3Hue_11hsl_to_rgba_2trans(__pyx_self, ((PyObject *)__pyx_v_t));

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_3Hue_11hsl_to_rgba_2trans(PyObject *__pyx_self, PyObject *__pyx_v_t) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_8_hsl_to_rgba *__pyx_cur_scope;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_8_hsl_to_rgba *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("trans", 0);
  __pyx_outer_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_8_hsl_to_rgba *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "mathics/builtin/graphics.py":761
 * 
 *         def trans(t):
 *             if t < 1 / 6:             # <<<<<<<<<<<<<<
 *                 return p + ((q - p) * 6 * t)
 *             elif t < 1 / 2:
 */
  __pyx_t_1 = PyFloat_FromDouble((1.0 / 6.0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 761, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_t, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 761, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 761, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "mathics/builtin/graphics.py":762
 *         def trans(t):
 *             if t < 1 / 6:
 *                 return p + ((q - p) * 6 * t)             # <<<<<<<<<<<<<<
 *             elif t < 1 / 2:
 *                 return q
 */
    __Pyx_XDECREF(__pyx_r);
    if (unlikely(!__pyx_cur_scope->__pyx_v_p)) { __Pyx_RaiseClosureNameError("p"); __PYX_ERR(0, 762, __pyx_L1_error) }
    if (unlikely(!__pyx_cur_scope->__pyx_v_q)) { __Pyx_RaiseClosureNameError("q"); __PYX_ERR(0, 762, __pyx_L1_error) }
    if (unlikely(!__pyx_cur_scope->__pyx_v_p)) { __Pyx_RaiseClosureNameError("p"); __PYX_ERR(0, 762, __pyx_L1_error) }
    __pyx_t_2 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_q, __pyx_cur_scope->__pyx_v_p); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 762, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyNumber_Multiply(__pyx_t_2, __pyx_int_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 762, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyNumber_Multiply(__pyx_t_1, __pyx_v_t); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 762, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyNumber_Add(__pyx_cur_scope->__pyx_v_p, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 762, __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;

    /* "mathics/builtin/graphics.py":761
 * 
 *         def trans(t):
 *             if t < 1 / 6:             # <<<<<<<<<<<<<<
 *                 return p + ((q - p) * 6 * t)
 *             elif t < 1 / 2:
 */
  }

  /* "mathics/builtin/graphics.py":763
 *             if t < 1 / 6:
 *                 return p + ((q - p) * 6 * t)
 *             elif t < 1 / 2:             # <<<<<<<<<<<<<<
 *                 return q
 *             elif t < 2 / 3:
 */
  __pyx_t_1 = PyFloat_FromDouble((1.0 / 2.0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 763, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_t, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 763, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 763, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "mathics/builtin/graphics.py":764
 *                 return p + ((q - p) * 6 * t)
 *             elif t < 1 / 2:
 *                 return q             # <<<<<<<<<<<<<<
 *             elif t < 2 / 3:
 *                 return p + ((q - p) * 6 * (2 / 3 - t))
 */
    __Pyx_XDECREF(__pyx_r);
    if (unlikely(!__pyx_cur_scope->__pyx_v_q)) { __Pyx_RaiseClosureNameError("q"); __PYX_ERR(0, 764, __pyx_L1_error) }
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_q);
    __pyx_r = __pyx_cur_scope->__pyx_v_q;
    goto __pyx_L0;

    /* "mathics/builtin/graphics.py":763
 *             if t < 1 / 6:
 *                 return p + ((q - p) * 6 * t)
 *             elif t < 1 / 2:             # <<<<<<<<<<<<<<
 *                 return q
 *             elif t < 2 / 3:
 */
  }

  /* "mathics/builtin/graphics.py":765
 *             elif t < 1 / 2:
 *                 return q
 *             elif t < 2 / 3:             # <<<<<<<<<<<<<<
 *                 return p + ((q - p) * 6 * (2 / 3 - t))
 *             else:
 */
  __pyx_t_2 = PyFloat_FromDouble((2.0 / 3.0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 765, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_t, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 765, __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(0, 765, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {

    /* "mathics/builtin/graphics.py":766
 *                 return q
 *             elif t < 2 / 3:
 *                 return p + ((q - p) * 6 * (2 / 3 - t))             # <<<<<<<<<<<<<<
 *             else:
 *                 return p
 */
    __Pyx_XDECREF(__pyx_r);
    if (unlikely(!__pyx_cur_scope->__pyx_v_p)) { __Pyx_RaiseClosureNameError("p"); __PYX_ERR(0, 766, __pyx_L1_error) }
    if (unlikely(!__pyx_cur_scope->__pyx_v_q)) { __Pyx_RaiseClosureNameError("q"); __PYX_ERR(0, 766, __pyx_L1_error) }
    if (unlikely(!__pyx_cur_scope->__pyx_v_p)) { __Pyx_RaiseClosureNameError("p"); __PYX_ERR(0, 766, __pyx_L1_error) }
    __pyx_t_1 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_q, __pyx_cur_scope->__pyx_v_p); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 766, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyNumber_Multiply(__pyx_t_1, __pyx_int_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 766, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyFloat_FromDouble((2.0 / 3.0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 766, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyNumber_Subtract(__pyx_t_1, __pyx_v_t); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 766, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyNumber_Multiply(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 766, __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_Add(__pyx_cur_scope->__pyx_v_p, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 766, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "mathics/builtin/graphics.py":765
 *             elif t < 1 / 2:
 *                 return q
 *             elif t < 2 / 3:             # <<<<<<<<<<<<<<
 *                 return p + ((q - p) * 6 * (2 / 3 - t))
 *             else:
 */
  }

  /* "mathics/builtin/graphics.py":768
 *                 return p + ((q - p) * 6 * (2 / 3 - t))
 *             else:
 *                 return p             # <<<<<<<<<<<<<<
 * 
 *         result = tuple([trans(list(map(t))) for t in rgb]) + (self.components[3],)
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    if (unlikely(!__pyx_cur_scope->__pyx_v_p)) { __Pyx_RaiseClosureNameError("p"); __PYX_ERR(0, 768, __pyx_L1_error) }
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_p);
    __pyx_r = __pyx_cur_scope->__pyx_v_p;
    goto __pyx_L0;
  }

  /* "mathics/builtin/graphics.py":760
 *             return value
 * 
 *         def trans(t):             # <<<<<<<<<<<<<<
 *             if t < 1 / 6:
 *                 return p + ((q - p) * 6 * t)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("mathics.builtin.graphics.Hue.hsl_to_rgba.trans", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":743
 *     default_components = [0, 1, 1, 1]
 * 
 *     def hsl_to_rgba(self):             # <<<<<<<<<<<<<<
 *         h, s, l = self.components[:3]
 *         if l < 0.5:
 */

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_3Hue_hsl_to_rgba(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_8_hsl_to_rgba *__pyx_cur_scope;
  PyObject *__pyx_v_h = NULL;
  PyObject *__pyx_v_s = NULL;
  PyObject *__pyx_v_l = NULL;
  PyObject *__pyx_v_rgb = NULL;
  PyObject *__pyx_v_map = 0;
  PyObject *__pyx_v_trans = 0;
  PyObject *__pyx_v_result = NULL;
  PyObject *__pyx_8genexpr8__pyx_v_t = 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_t_7;
  Py_ssize_t __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("hsl_to_rgba", 0);
  __pyx_cur_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_8_hsl_to_rgba *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_8_hsl_to_rgba(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_8_hsl_to_rgba, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_8_hsl_to_rgba *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 743, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }

  /* "mathics/builtin/graphics.py":744
 * 
 *     def hsl_to_rgba(self):
 *         h, s, l = self.components[:3]             # <<<<<<<<<<<<<<
 *         if l < 0.5:
 *             q = l * (1 + s)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_components); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 744, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_t_1, 0, 3, NULL, NULL, &__pyx_slice__19, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 744, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  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(0, 744, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); 
    } else {
      __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
      __pyx_t_4 = PyList_GET_ITEM(sequence, 2); 
    }
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    #else
    __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 744, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 744, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 744, __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(0, 744, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext;
    index = 0; __pyx_t_1 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    index = 1; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 2; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 3) < 0) __PYX_ERR(0, 744, __pyx_L1_error)
    __pyx_t_6 = NULL;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_6 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 744, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  __pyx_v_h = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v_s = __pyx_t_3;
  __pyx_t_3 = 0;
  __pyx_v_l = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":745
 *     def hsl_to_rgba(self):
 *         h, s, l = self.components[:3]
 *         if l < 0.5:             # <<<<<<<<<<<<<<
 *             q = l * (1 + s)
 *         else:
 */
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_l, __pyx_float_0_5, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 745, __pyx_L1_error)
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 745, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_7) {

    /* "mathics/builtin/graphics.py":746
 *         h, s, l = self.components[:3]
 *         if l < 0.5:
 *             q = l * (1 + s)             # <<<<<<<<<<<<<<
 *         else:
 *             q = l + s - l * s
 */
    __pyx_t_2 = __Pyx_PyInt_AddCObj(__pyx_int_1, __pyx_v_s, 1, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 746, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyNumber_Multiply(__pyx_v_l, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 746, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_cur_scope->__pyx_v_q = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "mathics/builtin/graphics.py":745
 *     def hsl_to_rgba(self):
 *         h, s, l = self.components[:3]
 *         if l < 0.5:             # <<<<<<<<<<<<<<
 *             q = l * (1 + s)
 *         else:
 */
    goto __pyx_L5;
  }

  /* "mathics/builtin/graphics.py":748
 *             q = l * (1 + s)
 *         else:
 *             q = l + s - l * s             # <<<<<<<<<<<<<<
 *         p = 2 * l - q
 * 
 */
  /*else*/ {
    __pyx_t_4 = PyNumber_Add(__pyx_v_l, __pyx_v_s); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 748, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = PyNumber_Multiply(__pyx_v_l, __pyx_v_s); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 748, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyNumber_Subtract(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 748, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_cur_scope->__pyx_v_q = __pyx_t_3;
    __pyx_t_3 = 0;
  }
  __pyx_L5:;

  /* "mathics/builtin/graphics.py":749
 *         else:
 *             q = l + s - l * s
 *         p = 2 * l - q             # <<<<<<<<<<<<<<
 * 
 *         rgb = (h + 1 / 3, h, h - 1 / 3)
 */
  __pyx_t_3 = PyNumber_Multiply(__pyx_int_2, __pyx_v_l); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 749, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyNumber_Subtract(__pyx_t_3, __pyx_cur_scope->__pyx_v_q); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 749, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_cur_scope->__pyx_v_p = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":751
 *         p = 2 * l - q
 * 
 *         rgb = (h + 1 / 3, h, h - 1 / 3)             # <<<<<<<<<<<<<<
 * 
 *         def map(value):
 */
  __pyx_t_2 = PyFloat_FromDouble((1.0 / 3.0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 751, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyNumber_Add(__pyx_v_h, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 751, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyFloat_FromDouble((1.0 / 3.0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 751, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyNumber_Subtract(__pyx_v_h, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 751, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 751, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
  __Pyx_INCREF(__pyx_v_h);
  __Pyx_GIVEREF(__pyx_v_h);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_h);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_4);
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_v_rgb = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":753
 *         rgb = (h + 1 / 3, h, h - 1 / 3)
 * 
 *         def map(value):             # <<<<<<<<<<<<<<
 *             if value < 0:
 *                 value += 1
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_3Hue_11hsl_to_rgba_1map, 0, __pyx_n_s_Hue_hsl_to_rgba_locals_map, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__21)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 753, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_map = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":760
 *             return value
 * 
 *         def trans(t):             # <<<<<<<<<<<<<<
 *             if t < 1 / 6:
 *                 return p + ((q - p) * 6 * t)
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_3Hue_11hsl_to_rgba_3trans, 0, __pyx_n_s_Hue_hsl_to_rgba_locals_trans, ((PyObject*)__pyx_cur_scope), __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__23)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 760, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_trans = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":770
 *                 return p
 * 
 *         result = tuple([trans(list(map(t))) for t in rgb]) + (self.components[3],)             # <<<<<<<<<<<<<<
 *         return result
 * 
 */
  { /* enter inner scope */
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 770, __pyx_L8_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __pyx_v_rgb; __Pyx_INCREF(__pyx_t_4); __pyx_t_8 = 0;
    for (;;) {
      if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 770, __pyx_L8_error)
      #else
      __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 770, __pyx_L8_error)
      __Pyx_GOTREF(__pyx_t_3);
      #endif
      __Pyx_XDECREF_SET(__pyx_8genexpr8__pyx_v_t, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_3 = __pyx_pf_7mathics_7builtin_8graphics_3Hue_11hsl_to_rgba_map(__pyx_v_map, __pyx_8genexpr8__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 770, __pyx_L8_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = PySequence_List(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 770, __pyx_L8_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __pyx_pf_7mathics_7builtin_8graphics_3Hue_11hsl_to_rgba_2trans(__pyx_v_trans, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 770, __pyx_L8_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 770, __pyx_L8_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_t); __pyx_8genexpr8__pyx_v_t = 0;
    goto __pyx_L11_exit_scope;
    __pyx_L8_error:;
    __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_t); __pyx_8genexpr8__pyx_v_t = 0;
    goto __pyx_L1_error;
    __pyx_L11_exit_scope:;
  } /* exit inner scope */
  __pyx_t_4 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 770, __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_n_s_components); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 770, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 770, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 770, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Add(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 770, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_result = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":771
 * 
 *         result = tuple([trans(list(map(t))) for t in rgb]) + (self.components[3],)
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":743
 *     default_components = [0, 1, 1, 1]
 * 
 *     def hsl_to_rgba(self):             # <<<<<<<<<<<<<<
 *         h, s, l = self.components[:3]
 *         if l < 0.5:
 */

  /* 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("mathics.builtin.graphics.Hue.hsl_to_rgba", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_h);
  __Pyx_XDECREF(__pyx_v_s);
  __Pyx_XDECREF(__pyx_v_l);
  __Pyx_XDECREF(__pyx_v_rgb);
  __Pyx_XDECREF(__pyx_v_map);
  __Pyx_XDECREF(__pyx_v_trans);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_t);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":790
 * 
 * 
 * def expression_to_color(color):             # <<<<<<<<<<<<<<
 *     try:
 *         return _Color.create(color)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_27expression_to_color(PyObject *__pyx_self, PyObject *__pyx_v_color); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_27expression_to_color = {"expression_to_color", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_27expression_to_color, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_27expression_to_color(PyObject *__pyx_self, PyObject *__pyx_v_color) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("expression_to_color (wrapper)", 0);
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_26expression_to_color(__pyx_self, ((PyObject *)__pyx_v_color));

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_26expression_to_color(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_color) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("expression_to_color", 0);

  /* "mathics/builtin/graphics.py":791
 * 
 * def expression_to_color(color):
 *     try:             # <<<<<<<<<<<<<<
 *         return _Color.create(color)
 *     except ColorError:
 */
  {
    __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:*/ {

      /* "mathics/builtin/graphics.py":792
 * def expression_to_color(color):
 *     try:
 *         return _Color.create(color)             # <<<<<<<<<<<<<<
 *     except ColorError:
 *         return None
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Color); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 792, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_create); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 792, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
        }
      }
      __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_5, __pyx_v_color) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_color);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 792, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L7_try_return;

      /* "mathics/builtin/graphics.py":791
 * 
 * def expression_to_color(color):
 *     try:             # <<<<<<<<<<<<<<
 *         return _Color.create(color)
 *     except ColorError:
 */
    }
    __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;

    /* "mathics/builtin/graphics.py":793
 *     try:
 *         return _Color.create(color)
 *     except ColorError:             # <<<<<<<<<<<<<<
 *         return None
 * 
 */
    __Pyx_ErrFetch(&__pyx_t_4, &__pyx_t_6, &__pyx_t_5);
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_ColorError); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 793, __pyx_L5_except_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_4, __pyx_t_7);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_ErrRestore(__pyx_t_4, __pyx_t_6, __pyx_t_5);
    __pyx_t_4 = 0; __pyx_t_6 = 0; __pyx_t_5 = 0;
    if (__pyx_t_8) {
      __Pyx_AddTraceback("mathics.builtin.graphics.expression_to_color", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_4) < 0) __PYX_ERR(0, 793, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_4);

      /* "mathics/builtin/graphics.py":794
 *         return _Color.create(color)
 *     except ColorError:
 *         return None             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L6_except_return;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "mathics/builtin/graphics.py":791
 * 
 * def expression_to_color(color):
 *     try:             # <<<<<<<<<<<<<<
 *         return _Color.create(color)
 *     except ColorError:
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L7_try_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
  }

  /* "mathics/builtin/graphics.py":790
 * 
 * 
 * def expression_to_color(color):             # <<<<<<<<<<<<<<
 *     try:
 *         return _Color.create(color)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("mathics.builtin.graphics.expression_to_color", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":797
 * 
 * 
 * def color_to_expression(components, colorspace):             # <<<<<<<<<<<<<<
 *     if colorspace == "Grayscale":
 *         converted_color_name = "GrayLevel"
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_29color_to_expression(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_29color_to_expression = {"color_to_expression", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_29color_to_expression, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_29color_to_expression(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_components = 0;
  PyObject *__pyx_v_colorspace = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("color_to_expression (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_components,&__pyx_n_s_colorspace,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_components)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_colorspace)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("color_to_expression", 1, 2, 2, 1); __PYX_ERR(0, 797, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "color_to_expression") < 0)) __PYX_ERR(0, 797, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_components = values[0];
    __pyx_v_colorspace = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("color_to_expression", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 797, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.color_to_expression", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_28color_to_expression(__pyx_self, __pyx_v_components, __pyx_v_colorspace);

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_28color_to_expression(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_components, PyObject *__pyx_v_colorspace) {
  PyObject *__pyx_v_converted_color_name = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("color_to_expression", 0);

  /* "mathics/builtin/graphics.py":798
 * 
 * def color_to_expression(components, colorspace):
 *     if colorspace == "Grayscale":             # <<<<<<<<<<<<<<
 *         converted_color_name = "GrayLevel"
 *     elif colorspace == "HSB":
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_colorspace, __pyx_n_u_Grayscale, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 798, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "mathics/builtin/graphics.py":799
 * def color_to_expression(components, colorspace):
 *     if colorspace == "Grayscale":
 *         converted_color_name = "GrayLevel"             # <<<<<<<<<<<<<<
 *     elif colorspace == "HSB":
 *         converted_color_name = "Hue"
 */
    __Pyx_INCREF(__pyx_n_u_GrayLevel);
    __pyx_v_converted_color_name = __pyx_n_u_GrayLevel;

    /* "mathics/builtin/graphics.py":798
 * 
 * def color_to_expression(components, colorspace):
 *     if colorspace == "Grayscale":             # <<<<<<<<<<<<<<
 *         converted_color_name = "GrayLevel"
 *     elif colorspace == "HSB":
 */
    goto __pyx_L3;
  }

  /* "mathics/builtin/graphics.py":800
 *     if colorspace == "Grayscale":
 *         converted_color_name = "GrayLevel"
 *     elif colorspace == "HSB":             # <<<<<<<<<<<<<<
 *         converted_color_name = "Hue"
 *     else:
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_colorspace, __pyx_n_u_HSB, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 800, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "mathics/builtin/graphics.py":801
 *         converted_color_name = "GrayLevel"
 *     elif colorspace == "HSB":
 *         converted_color_name = "Hue"             # <<<<<<<<<<<<<<
 *     else:
 *         converted_color_name = colorspace + "Color"
 */
    __Pyx_INCREF(__pyx_n_u_Hue);
    __pyx_v_converted_color_name = __pyx_n_u_Hue;

    /* "mathics/builtin/graphics.py":800
 *     if colorspace == "Grayscale":
 *         converted_color_name = "GrayLevel"
 *     elif colorspace == "HSB":             # <<<<<<<<<<<<<<
 *         converted_color_name = "Hue"
 *     else:
 */
    goto __pyx_L3;
  }

  /* "mathics/builtin/graphics.py":803
 *         converted_color_name = "Hue"
 *     else:
 *         converted_color_name = colorspace + "Color"             # <<<<<<<<<<<<<<
 * 
 *     return Expression(converted_color_name, *components)
 */
  /*else*/ {
    __pyx_t_2 = PyNumber_Add(__pyx_v_colorspace, __pyx_n_u_Color_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 803, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_converted_color_name = __pyx_t_2;
    __pyx_t_2 = 0;
  }
  __pyx_L3:;

  /* "mathics/builtin/graphics.py":805
 *         converted_color_name = colorspace + "Color"
 * 
 *     return Expression(converted_color_name, *components)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Expression); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 805, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 805, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_converted_color_name);
  __Pyx_GIVEREF(__pyx_v_converted_color_name);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_converted_color_name);
  __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_components); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 805, __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(0, 805, __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 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 805, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":797
 * 
 * 
 * def color_to_expression(components, colorspace):             # <<<<<<<<<<<<<<
 *     if colorspace == "Grayscale":
 *         converted_color_name = "GrayLevel"
 */

  /* 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("mathics.builtin.graphics.color_to_expression", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_converted_color_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":855
 * 
 *     _distances = {
 *         "CIE76": lambda c1, c2: _euclidean_distance(             # <<<<<<<<<<<<<<
 *             c1.to_color_space("LAB")[:3], c2.to_color_space("LAB")[:3]
 *         ),
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_13ColorDistance_2lambda4(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_13ColorDistance_2lambda4 = {"lambda4", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_13ColorDistance_2lambda4, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_13ColorDistance_2lambda4(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_c1 = 0;
  PyObject *__pyx_v_c2 = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda4 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_c1,&__pyx_n_s_c2,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_c1)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_c2)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("lambda4", 1, 2, 2, 1); __PYX_ERR(0, 855, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lambda4") < 0)) __PYX_ERR(0, 855, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_c1 = values[0];
    __pyx_v_c2 = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("lambda4", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 855, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.ColorDistance.lambda4", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_lambda_funcdef_7mathics_7builtin_8graphics_13ColorDistance_lambda4(__pyx_self, __pyx_v_c1, __pyx_v_c2);

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

static PyObject *__pyx_lambda_funcdef_7mathics_7builtin_8graphics_13ColorDistance_lambda4(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_c1, PyObject *__pyx_v_c2) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("lambda4", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_euclidean_distance); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 855, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "mathics/builtin/graphics.py":856
 *     _distances = {
 *         "CIE76": lambda c1, c2: _euclidean_distance(
 *             c1.to_color_space("LAB")[:3], c2.to_color_space("LAB")[:3]             # <<<<<<<<<<<<<<
 *         ),
 *         "CIE94": lambda c1, c2: _euclidean_distance(
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_c1, __pyx_n_s_to_color_space); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 856, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_n_u_LAB) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_n_u_LAB);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 856, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_t_3, 0, 3, NULL, NULL, &__pyx_slice__19, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 856, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_c2, __pyx_n_s_to_color_space); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 856, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_n_u_LAB) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_n_u_LAB);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 856, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_t_3, 0, 3, NULL, NULL, &__pyx_slice__19, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 856, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_7 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_t_4, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 855, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_t_4, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 855, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else
  #endif
  {
    __pyx_t_6 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 855, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_7, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_7, __pyx_t_5);
    __pyx_t_4 = 0;
    __pyx_t_5 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 855, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":855
 * 
 *     _distances = {
 *         "CIE76": lambda c1, c2: _euclidean_distance(             # <<<<<<<<<<<<<<
 *             c1.to_color_space("LAB")[:3], c2.to_color_space("LAB")[:3]
 *         ),
 */

  /* 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("mathics.builtin.graphics.ColorDistance.lambda4", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":858
 *             c1.to_color_space("LAB")[:3], c2.to_color_space("LAB")[:3]
 *         ),
 *         "CIE94": lambda c1, c2: _euclidean_distance(             # <<<<<<<<<<<<<<
 *             c1.to_color_space("LCH")[:3], c2.to_color_space("LCH")[:3]
 *         ),
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_13ColorDistance_3lambda5(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_13ColorDistance_3lambda5 = {"lambda5", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_13ColorDistance_3lambda5, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_13ColorDistance_3lambda5(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_c1 = 0;
  PyObject *__pyx_v_c2 = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda5 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_c1,&__pyx_n_s_c2,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_c1)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_c2)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("lambda5", 1, 2, 2, 1); __PYX_ERR(0, 858, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lambda5") < 0)) __PYX_ERR(0, 858, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_c1 = values[0];
    __pyx_v_c2 = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("lambda5", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 858, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.ColorDistance.lambda5", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_lambda_funcdef_7mathics_7builtin_8graphics_13ColorDistance_lambda5(__pyx_self, __pyx_v_c1, __pyx_v_c2);

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

static PyObject *__pyx_lambda_funcdef_7mathics_7builtin_8graphics_13ColorDistance_lambda5(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_c1, PyObject *__pyx_v_c2) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("lambda5", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_euclidean_distance); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 858, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "mathics/builtin/graphics.py":859
 *         ),
 *         "CIE94": lambda c1, c2: _euclidean_distance(
 *             c1.to_color_space("LCH")[:3], c2.to_color_space("LCH")[:3]             # <<<<<<<<<<<<<<
 *         ),
 *         "CIE2000": lambda c1, c2: _cie2000_distance(
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_c1, __pyx_n_s_to_color_space); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 859, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_n_u_LCH) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_n_u_LCH);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 859, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_t_3, 0, 3, NULL, NULL, &__pyx_slice__19, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 859, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_c2, __pyx_n_s_to_color_space); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 859, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_n_u_LCH) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_n_u_LCH);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 859, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_t_3, 0, 3, NULL, NULL, &__pyx_slice__19, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 859, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_7 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_t_4, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 858, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_t_4, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 858, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else
  #endif
  {
    __pyx_t_6 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 858, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_7, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_7, __pyx_t_5);
    __pyx_t_4 = 0;
    __pyx_t_5 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 858, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":858
 *             c1.to_color_space("LAB")[:3], c2.to_color_space("LAB")[:3]
 *         ),
 *         "CIE94": lambda c1, c2: _euclidean_distance(             # <<<<<<<<<<<<<<
 *             c1.to_color_space("LCH")[:3], c2.to_color_space("LCH")[:3]
 *         ),
 */

  /* 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("mathics.builtin.graphics.ColorDistance.lambda5", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":861
 *             c1.to_color_space("LCH")[:3], c2.to_color_space("LCH")[:3]
 *         ),
 *         "CIE2000": lambda c1, c2: _cie2000_distance(             # <<<<<<<<<<<<<<
 *             100 * c1.to_color_space("LAB")[:3], 100 * c2.to_color_space("LAB")[:3]
 *         )
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_13ColorDistance_4lambda6(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_13ColorDistance_4lambda6 = {"lambda6", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_13ColorDistance_4lambda6, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_13ColorDistance_4lambda6(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_c1 = 0;
  PyObject *__pyx_v_c2 = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda6 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_c1,&__pyx_n_s_c2,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_c1)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_c2)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("lambda6", 1, 2, 2, 1); __PYX_ERR(0, 861, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lambda6") < 0)) __PYX_ERR(0, 861, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_c1 = values[0];
    __pyx_v_c2 = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("lambda6", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 861, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.ColorDistance.lambda6", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_lambda_funcdef_7mathics_7builtin_8graphics_13ColorDistance_lambda6(__pyx_self, __pyx_v_c1, __pyx_v_c2);

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

static PyObject *__pyx_lambda_funcdef_7mathics_7builtin_8graphics_13ColorDistance_lambda6(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_c1, PyObject *__pyx_v_c2) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("lambda6", 0);

  /* "mathics/builtin/graphics.py":864
 *             100 * c1.to_color_space("LAB")[:3], 100 * c2.to_color_space("LAB")[:3]
 *         )
 *         / 100,             # <<<<<<<<<<<<<<
 *         "CIEDE2000": lambda c1, c2: _cie2000_distance(
 *             100 * c1.to_color_space("LAB")[:3], 100 * c2.to_color_space("LAB")[:3]
 */
  __Pyx_XDECREF(__pyx_r);

  /* "mathics/builtin/graphics.py":861
 *             c1.to_color_space("LCH")[:3], c2.to_color_space("LCH")[:3]
 *         ),
 *         "CIE2000": lambda c1, c2: _cie2000_distance(             # <<<<<<<<<<<<<<
 *             100 * c1.to_color_space("LAB")[:3], 100 * c2.to_color_space("LAB")[:3]
 *         )
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_cie2000_distance); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 861, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "mathics/builtin/graphics.py":862
 *         ),
 *         "CIE2000": lambda c1, c2: _cie2000_distance(
 *             100 * c1.to_color_space("LAB")[:3], 100 * c2.to_color_space("LAB")[:3]             # <<<<<<<<<<<<<<
 *         )
 *         / 100,
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_c1, __pyx_n_s_to_color_space); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 862, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_n_u_LAB) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_n_u_LAB);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 862, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_t_3, 0, 3, NULL, NULL, &__pyx_slice__19, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 862, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Multiply(__pyx_int_100, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 862, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_c2, __pyx_n_s_to_color_space); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 862, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_n_u_LAB) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_n_u_LAB);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 862, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_t_4, 0, 3, NULL, NULL, &__pyx_slice__19, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 862, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyNumber_Multiply(__pyx_int_100, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 862, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_7 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_3, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 861, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_3, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 861, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else
  #endif
  {
    __pyx_t_6 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 861, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_5) {
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_7, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_7, __pyx_t_4);
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 861, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":864
 *             100 * c1.to_color_space("LAB")[:3], 100 * c2.to_color_space("LAB")[:3]
 *         )
 *         / 100,             # <<<<<<<<<<<<<<
 *         "CIEDE2000": lambda c1, c2: _cie2000_distance(
 *             100 * c1.to_color_space("LAB")[:3], 100 * c2.to_color_space("LAB")[:3]
 */
  __pyx_t_2 = __Pyx_PyInt_TrueDivideObjC(__pyx_t_1, __pyx_int_100, 0x64, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 864, __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;

  /* "mathics/builtin/graphics.py":861
 *             c1.to_color_space("LCH")[:3], c2.to_color_space("LCH")[:3]
 *         ),
 *         "CIE2000": lambda c1, c2: _cie2000_distance(             # <<<<<<<<<<<<<<
 *             100 * c1.to_color_space("LAB")[:3], 100 * c2.to_color_space("LAB")[:3]
 *         )
 */

  /* 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("mathics.builtin.graphics.ColorDistance.lambda6", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":865
 *         )
 *         / 100,
 *         "CIEDE2000": lambda c1, c2: _cie2000_distance(             # <<<<<<<<<<<<<<
 *             100 * c1.to_color_space("LAB")[:3], 100 * c2.to_color_space("LAB")[:3]
 *         )
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_13ColorDistance_5lambda7(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_13ColorDistance_5lambda7 = {"lambda7", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_13ColorDistance_5lambda7, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_13ColorDistance_5lambda7(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_c1 = 0;
  PyObject *__pyx_v_c2 = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda7 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_c1,&__pyx_n_s_c2,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_c1)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_c2)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("lambda7", 1, 2, 2, 1); __PYX_ERR(0, 865, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lambda7") < 0)) __PYX_ERR(0, 865, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_c1 = values[0];
    __pyx_v_c2 = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("lambda7", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 865, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.ColorDistance.lambda7", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_lambda_funcdef_7mathics_7builtin_8graphics_13ColorDistance_lambda7(__pyx_self, __pyx_v_c1, __pyx_v_c2);

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

static PyObject *__pyx_lambda_funcdef_7mathics_7builtin_8graphics_13ColorDistance_lambda7(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_c1, PyObject *__pyx_v_c2) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("lambda7", 0);

  /* "mathics/builtin/graphics.py":868
 *             100 * c1.to_color_space("LAB")[:3], 100 * c2.to_color_space("LAB")[:3]
 *         )
 *         / 100,             # <<<<<<<<<<<<<<
 *         "DeltaL": lambda c1, c2: _component_distance(
 *             c1.to_color_space("LCH"), c2.to_color_space("LCH"), 0
 */
  __Pyx_XDECREF(__pyx_r);

  /* "mathics/builtin/graphics.py":865
 *         )
 *         / 100,
 *         "CIEDE2000": lambda c1, c2: _cie2000_distance(             # <<<<<<<<<<<<<<
 *             100 * c1.to_color_space("LAB")[:3], 100 * c2.to_color_space("LAB")[:3]
 *         )
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_cie2000_distance); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 865, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "mathics/builtin/graphics.py":866
 *         / 100,
 *         "CIEDE2000": lambda c1, c2: _cie2000_distance(
 *             100 * c1.to_color_space("LAB")[:3], 100 * c2.to_color_space("LAB")[:3]             # <<<<<<<<<<<<<<
 *         )
 *         / 100,
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_c1, __pyx_n_s_to_color_space); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 866, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_n_u_LAB) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_n_u_LAB);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 866, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_t_3, 0, 3, NULL, NULL, &__pyx_slice__19, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 866, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Multiply(__pyx_int_100, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 866, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_c2, __pyx_n_s_to_color_space); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 866, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_n_u_LAB) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_n_u_LAB);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 866, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_t_4, 0, 3, NULL, NULL, &__pyx_slice__19, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 866, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyNumber_Multiply(__pyx_int_100, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 866, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_7 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_3, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 865, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_3, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 865, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else
  #endif
  {
    __pyx_t_6 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 865, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_5) {
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_7, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_7, __pyx_t_4);
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 865, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":868
 *             100 * c1.to_color_space("LAB")[:3], 100 * c2.to_color_space("LAB")[:3]
 *         )
 *         / 100,             # <<<<<<<<<<<<<<
 *         "DeltaL": lambda c1, c2: _component_distance(
 *             c1.to_color_space("LCH"), c2.to_color_space("LCH"), 0
 */
  __pyx_t_2 = __Pyx_PyInt_TrueDivideObjC(__pyx_t_1, __pyx_int_100, 0x64, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 868, __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;

  /* "mathics/builtin/graphics.py":865
 *         )
 *         / 100,
 *         "CIEDE2000": lambda c1, c2: _cie2000_distance(             # <<<<<<<<<<<<<<
 *             100 * c1.to_color_space("LAB")[:3], 100 * c2.to_color_space("LAB")[:3]
 *         )
 */

  /* 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("mathics.builtin.graphics.ColorDistance.lambda7", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":869
 *         )
 *         / 100,
 *         "DeltaL": lambda c1, c2: _component_distance(             # <<<<<<<<<<<<<<
 *             c1.to_color_space("LCH"), c2.to_color_space("LCH"), 0
 *         ),
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_13ColorDistance_6lambda8(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_13ColorDistance_6lambda8 = {"lambda8", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_13ColorDistance_6lambda8, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_13ColorDistance_6lambda8(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_c1 = 0;
  PyObject *__pyx_v_c2 = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda8 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_c1,&__pyx_n_s_c2,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_c1)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_c2)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("lambda8", 1, 2, 2, 1); __PYX_ERR(0, 869, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lambda8") < 0)) __PYX_ERR(0, 869, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_c1 = values[0];
    __pyx_v_c2 = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("lambda8", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 869, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.ColorDistance.lambda8", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_lambda_funcdef_7mathics_7builtin_8graphics_13ColorDistance_lambda8(__pyx_self, __pyx_v_c1, __pyx_v_c2);

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

static PyObject *__pyx_lambda_funcdef_7mathics_7builtin_8graphics_13ColorDistance_lambda8(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_c1, PyObject *__pyx_v_c2) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("lambda8", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_component_distance); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 869, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "mathics/builtin/graphics.py":870
 *         / 100,
 *         "DeltaL": lambda c1, c2: _component_distance(
 *             c1.to_color_space("LCH"), c2.to_color_space("LCH"), 0             # <<<<<<<<<<<<<<
 *         ),
 *         "DeltaC": lambda c1, c2: _component_distance(
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_c1, __pyx_n_s_to_color_space); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 870, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_n_u_LCH) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_n_u_LCH);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 870, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_c2, __pyx_n_s_to_color_space); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 870, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_n_u_LCH) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_n_u_LCH);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 870, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_7 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_t_3, __pyx_t_4, __pyx_int_0};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 869, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_t_3, __pyx_t_4, __pyx_int_0};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 869, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else
  #endif
  {
    __pyx_t_6 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 869, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_5) {
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_7, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_7, __pyx_t_4);
    __Pyx_INCREF(__pyx_int_0);
    __Pyx_GIVEREF(__pyx_int_0);
    PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_7, __pyx_int_0);
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 869, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":869
 *         )
 *         / 100,
 *         "DeltaL": lambda c1, c2: _component_distance(             # <<<<<<<<<<<<<<
 *             c1.to_color_space("LCH"), c2.to_color_space("LCH"), 0
 *         ),
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("mathics.builtin.graphics.ColorDistance.lambda8", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":872
 *             c1.to_color_space("LCH"), c2.to_color_space("LCH"), 0
 *         ),
 *         "DeltaC": lambda c1, c2: _component_distance(             # <<<<<<<<<<<<<<
 *             c1.to_color_space("LCH"), c2.to_color_space("LCH"), 1
 *         ),
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_13ColorDistance_7lambda9(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_13ColorDistance_7lambda9 = {"lambda9", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_13ColorDistance_7lambda9, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_13ColorDistance_7lambda9(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_c1 = 0;
  PyObject *__pyx_v_c2 = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda9 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_c1,&__pyx_n_s_c2,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_c1)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_c2)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("lambda9", 1, 2, 2, 1); __PYX_ERR(0, 872, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lambda9") < 0)) __PYX_ERR(0, 872, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_c1 = values[0];
    __pyx_v_c2 = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("lambda9", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 872, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.ColorDistance.lambda9", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_lambda_funcdef_7mathics_7builtin_8graphics_13ColorDistance_lambda9(__pyx_self, __pyx_v_c1, __pyx_v_c2);

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

static PyObject *__pyx_lambda_funcdef_7mathics_7builtin_8graphics_13ColorDistance_lambda9(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_c1, PyObject *__pyx_v_c2) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("lambda9", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_component_distance); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 872, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "mathics/builtin/graphics.py":873
 *         ),
 *         "DeltaC": lambda c1, c2: _component_distance(
 *             c1.to_color_space("LCH"), c2.to_color_space("LCH"), 1             # <<<<<<<<<<<<<<
 *         ),
 *         "DeltaH": lambda c1, c2: _component_distance(
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_c1, __pyx_n_s_to_color_space); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 873, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_n_u_LCH) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_n_u_LCH);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 873, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_c2, __pyx_n_s_to_color_space); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 873, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_n_u_LCH) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_n_u_LCH);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 873, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_7 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_t_3, __pyx_t_4, __pyx_int_1};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 872, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_t_3, __pyx_t_4, __pyx_int_1};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 872, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else
  #endif
  {
    __pyx_t_6 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 872, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_5) {
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_7, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_7, __pyx_t_4);
    __Pyx_INCREF(__pyx_int_1);
    __Pyx_GIVEREF(__pyx_int_1);
    PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_7, __pyx_int_1);
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 872, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":872
 *             c1.to_color_space("LCH"), c2.to_color_space("LCH"), 0
 *         ),
 *         "DeltaC": lambda c1, c2: _component_distance(             # <<<<<<<<<<<<<<
 *             c1.to_color_space("LCH"), c2.to_color_space("LCH"), 1
 *         ),
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("mathics.builtin.graphics.ColorDistance.lambda9", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":875
 *             c1.to_color_space("LCH"), c2.to_color_space("LCH"), 1
 *         ),
 *         "DeltaH": lambda c1, c2: _component_distance(             # <<<<<<<<<<<<<<
 *             c1.to_color_space("LCH"), c2.to_color_space("LCH"), 2
 *         ),
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_13ColorDistance_8lambda10(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_13ColorDistance_8lambda10 = {"lambda10", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_13ColorDistance_8lambda10, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_13ColorDistance_8lambda10(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_c1 = 0;
  PyObject *__pyx_v_c2 = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda10 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_c1,&__pyx_n_s_c2,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_c1)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_c2)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("lambda10", 1, 2, 2, 1); __PYX_ERR(0, 875, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lambda10") < 0)) __PYX_ERR(0, 875, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_c1 = values[0];
    __pyx_v_c2 = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("lambda10", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 875, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.ColorDistance.lambda10", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_lambda_funcdef_7mathics_7builtin_8graphics_13ColorDistance_lambda10(__pyx_self, __pyx_v_c1, __pyx_v_c2);

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

static PyObject *__pyx_lambda_funcdef_7mathics_7builtin_8graphics_13ColorDistance_lambda10(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_c1, PyObject *__pyx_v_c2) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("lambda10", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_component_distance); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 875, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "mathics/builtin/graphics.py":876
 *         ),
 *         "DeltaH": lambda c1, c2: _component_distance(
 *             c1.to_color_space("LCH"), c2.to_color_space("LCH"), 2             # <<<<<<<<<<<<<<
 *         ),
 *         "CMC": lambda c1, c2: _CMC_distance(
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_c1, __pyx_n_s_to_color_space); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 876, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_n_u_LCH) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_n_u_LCH);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 876, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_c2, __pyx_n_s_to_color_space); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 876, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_n_u_LCH) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_n_u_LCH);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 876, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_7 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_t_3, __pyx_t_4, __pyx_int_2};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 875, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_t_3, __pyx_t_4, __pyx_int_2};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 875, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else
  #endif
  {
    __pyx_t_6 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 875, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_5) {
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_7, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_7, __pyx_t_4);
    __Pyx_INCREF(__pyx_int_2);
    __Pyx_GIVEREF(__pyx_int_2);
    PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_7, __pyx_int_2);
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 875, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":875
 *             c1.to_color_space("LCH"), c2.to_color_space("LCH"), 1
 *         ),
 *         "DeltaH": lambda c1, c2: _component_distance(             # <<<<<<<<<<<<<<
 *             c1.to_color_space("LCH"), c2.to_color_space("LCH"), 2
 *         ),
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("mathics.builtin.graphics.ColorDistance.lambda10", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":878
 *             c1.to_color_space("LCH"), c2.to_color_space("LCH"), 2
 *         ),
 *         "CMC": lambda c1, c2: _CMC_distance(             # <<<<<<<<<<<<<<
 *             100 * c1.to_color_space("LAB")[:3], 100 * c2.to_color_space("LAB")[:3], 1, 1
 *         )
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_13ColorDistance_9lambda11(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_13ColorDistance_9lambda11 = {"lambda11", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_13ColorDistance_9lambda11, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_13ColorDistance_9lambda11(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_c1 = 0;
  PyObject *__pyx_v_c2 = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda11 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_c1,&__pyx_n_s_c2,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_c1)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_c2)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("lambda11", 1, 2, 2, 1); __PYX_ERR(0, 878, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lambda11") < 0)) __PYX_ERR(0, 878, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_c1 = values[0];
    __pyx_v_c2 = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("lambda11", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 878, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.ColorDistance.lambda11", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_lambda_funcdef_7mathics_7builtin_8graphics_13ColorDistance_lambda11(__pyx_self, __pyx_v_c1, __pyx_v_c2);

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

static PyObject *__pyx_lambda_funcdef_7mathics_7builtin_8graphics_13ColorDistance_lambda11(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_c1, PyObject *__pyx_v_c2) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("lambda11", 0);

  /* "mathics/builtin/graphics.py":881
 *             100 * c1.to_color_space("LAB")[:3], 100 * c2.to_color_space("LAB")[:3], 1, 1
 *         )
 *         / 100,             # <<<<<<<<<<<<<<
 *     }
 * 
 */
  __Pyx_XDECREF(__pyx_r);

  /* "mathics/builtin/graphics.py":878
 *             c1.to_color_space("LCH"), c2.to_color_space("LCH"), 2
 *         ),
 *         "CMC": lambda c1, c2: _CMC_distance(             # <<<<<<<<<<<<<<
 *             100 * c1.to_color_space("LAB")[:3], 100 * c2.to_color_space("LAB")[:3], 1, 1
 *         )
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_CMC_distance); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 878, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "mathics/builtin/graphics.py":879
 *         ),
 *         "CMC": lambda c1, c2: _CMC_distance(
 *             100 * c1.to_color_space("LAB")[:3], 100 * c2.to_color_space("LAB")[:3], 1, 1             # <<<<<<<<<<<<<<
 *         )
 *         / 100,
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_c1, __pyx_n_s_to_color_space); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 879, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_n_u_LAB) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_n_u_LAB);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 879, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_t_3, 0, 3, NULL, NULL, &__pyx_slice__19, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 879, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Multiply(__pyx_int_100, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 879, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_c2, __pyx_n_s_to_color_space); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 879, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_n_u_LAB) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_n_u_LAB);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 879, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_t_4, 0, 3, NULL, NULL, &__pyx_slice__19, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 879, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyNumber_Multiply(__pyx_int_100, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 879, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_7 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_t_3, __pyx_t_4, __pyx_int_1, __pyx_int_1};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 4+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 878, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_t_3, __pyx_t_4, __pyx_int_1, __pyx_int_1};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 4+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 878, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else
  #endif
  {
    __pyx_t_6 = PyTuple_New(4+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 878, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_5) {
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_7, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_7, __pyx_t_4);
    __Pyx_INCREF(__pyx_int_1);
    __Pyx_GIVEREF(__pyx_int_1);
    PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_7, __pyx_int_1);
    __Pyx_INCREF(__pyx_int_1);
    __Pyx_GIVEREF(__pyx_int_1);
    PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_7, __pyx_int_1);
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 878, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":881
 *             100 * c1.to_color_space("LAB")[:3], 100 * c2.to_color_space("LAB")[:3], 1, 1
 *         )
 *         / 100,             # <<<<<<<<<<<<<<
 *     }
 * 
 */
  __pyx_t_2 = __Pyx_PyInt_TrueDivideObjC(__pyx_t_1, __pyx_int_100, 0x64, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 881, __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;

  /* "mathics/builtin/graphics.py":878
 *             c1.to_color_space("LCH"), c2.to_color_space("LCH"), 2
 *         ),
 *         "CMC": lambda c1, c2: _CMC_distance(             # <<<<<<<<<<<<<<
 *             100 * c1.to_color_space("LAB")[:3], 100 * c2.to_color_space("LAB")[:3], 1, 1
 *         )
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("mathics.builtin.graphics.ColorDistance.lambda11", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":884
 *     }
 * 
 *     def apply(self, c1, c2, evaluation, options):             # <<<<<<<<<<<<<<
 *         "ColorDistance[c1_, c2_, OptionsPattern[ColorDistance]]"
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_13ColorDistance_1apply(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7mathics_7builtin_8graphics_13ColorDistance_apply[] = "ColorDistance[c1_, c2_, OptionsPattern[ColorDistance]]";
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_13ColorDistance_1apply = {"apply", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_13ColorDistance_1apply, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7mathics_7builtin_8graphics_13ColorDistance_apply};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_13ColorDistance_1apply(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_c1 = 0;
  PyObject *__pyx_v_c2 = 0;
  PyObject *__pyx_v_evaluation = 0;
  PyObject *__pyx_v_options = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("apply (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_c1,&__pyx_n_s_c2,&__pyx_n_s_evaluation,&__pyx_n_s_options,0};
    PyObject* values[5] = {0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_c1)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("apply", 1, 5, 5, 1); __PYX_ERR(0, 884, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_c2)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("apply", 1, 5, 5, 2); __PYX_ERR(0, 884, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_evaluation)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("apply", 1, 5, 5, 3); __PYX_ERR(0, 884, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_options)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("apply", 1, 5, 5, 4); __PYX_ERR(0, 884, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "apply") < 0)) __PYX_ERR(0, 884, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
    }
    __pyx_v_self = values[0];
    __pyx_v_c1 = values[1];
    __pyx_v_c2 = values[2];
    __pyx_v_evaluation = values[3];
    __pyx_v_options = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("apply", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 884, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.ColorDistance.apply", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_13ColorDistance_apply(__pyx_self, __pyx_v_self, __pyx_v_c1, __pyx_v_c2, __pyx_v_evaluation, __pyx_v_options);

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

/* "mathics/builtin/graphics.py":948
 *         else:
 * 
 *             def compute(a, b):             # <<<<<<<<<<<<<<
 *                 return Expression(
 *                     "Apply",
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_13ColorDistance_5apply_1compute(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_13ColorDistance_5apply_1compute = {"compute", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_13ColorDistance_5apply_1compute, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_13ColorDistance_5apply_1compute(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_a = 0;
  PyObject *__pyx_v_b = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("compute (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_b,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("compute", 1, 2, 2, 1); __PYX_ERR(0, 948, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "compute") < 0)) __PYX_ERR(0, 948, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_a = values[0];
    __pyx_v_b = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("compute", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 948, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.ColorDistance.apply.compute", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_13ColorDistance_5apply_compute(__pyx_self, __pyx_v_a, __pyx_v_b);

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_13ColorDistance_5apply_compute(PyObject *__pyx_self, PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_9_apply *__pyx_cur_scope;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_9_apply *__pyx_outer_scope;
  PyObject *__pyx_8genexpr9__pyx_v_val = NULL;
  PyObject *__pyx_9genexpr10__pyx_v_val = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  Py_ssize_t __pyx_t_10;
  PyObject *(*__pyx_t_11)(PyObject *);
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("compute", 0);
  __pyx_outer_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_9_apply *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "mathics/builtin/graphics.py":949
 * 
 *             def compute(a, b):
 *                 return Expression(             # <<<<<<<<<<<<<<
 *                     "Apply",
 *                     distance_function,
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Expression); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 949, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "mathics/builtin/graphics.py":951
 *                 return Expression(
 *                     "Apply",
 *                     distance_function,             # <<<<<<<<<<<<<<
 *                     Expression(
 *                         "List",
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_distance_function)) { __Pyx_RaiseClosureNameError("distance_function"); __PYX_ERR(0, 951, __pyx_L1_error) }

  /* "mathics/builtin/graphics.py":952
 *                     "Apply",
 *                     distance_function,
 *                     Expression(             # <<<<<<<<<<<<<<
 *                         "List",
 *                         Expression(
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Expression); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 952, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "mathics/builtin/graphics.py":954
 *                     Expression(
 *                         "List",
 *                         Expression(             # <<<<<<<<<<<<<<
 *                             "List", *[Real(val) for val in a.to_color_space("LAB")]
 *                         ),
 */
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Expression); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 954, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  { /* enter inner scope */

    /* "mathics/builtin/graphics.py":955
 *                         "List",
 *                         Expression(
 *                             "List", *[Real(val) for val in a.to_color_space("LAB")]             # <<<<<<<<<<<<<<
 *                         ),
 *                         Expression(
 */
    __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 955, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_a, __pyx_n_s_to_color_space); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 955, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_8, function);
      }
    }
    __pyx_t_7 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_9, __pyx_n_u_LAB) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_n_u_LAB);
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 955, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (likely(PyList_CheckExact(__pyx_t_7)) || PyTuple_CheckExact(__pyx_t_7)) {
      __pyx_t_8 = __pyx_t_7; __Pyx_INCREF(__pyx_t_8); __pyx_t_10 = 0;
      __pyx_t_11 = NULL;
    } else {
      __pyx_t_10 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 955, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_11 = Py_TYPE(__pyx_t_8)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 955, __pyx_L5_error)
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    for (;;) {
      if (likely(!__pyx_t_11)) {
        if (likely(PyList_CheckExact(__pyx_t_8))) {
          if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_8)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_7 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_10); __Pyx_INCREF(__pyx_t_7); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 955, __pyx_L5_error)
          #else
          __pyx_t_7 = PySequence_ITEM(__pyx_t_8, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 955, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_7);
          #endif
        } else {
          if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_8)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_10); __Pyx_INCREF(__pyx_t_7); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 955, __pyx_L5_error)
          #else
          __pyx_t_7 = PySequence_ITEM(__pyx_t_8, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 955, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_7);
          #endif
        }
      } else {
        __pyx_t_7 = __pyx_t_11(__pyx_t_8);
        if (unlikely(!__pyx_t_7)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 955, __pyx_L5_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_7);
      }
      __Pyx_XDECREF_SET(__pyx_8genexpr9__pyx_v_val, __pyx_t_7);
      __pyx_t_7 = 0;
      __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_Real); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 955, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_12 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
        __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_9);
        if (likely(__pyx_t_12)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
          __Pyx_INCREF(__pyx_t_12);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_9, function);
        }
      }
      __pyx_t_7 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_12, __pyx_8genexpr9__pyx_v_val) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_8genexpr9__pyx_v_val);
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 955, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_6, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 955, __pyx_L5_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_val); __pyx_8genexpr9__pyx_v_val = 0;
    goto __pyx_L8_exit_scope;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_val); __pyx_8genexpr9__pyx_v_val = 0;
    goto __pyx_L1_error;
    __pyx_L8_exit_scope:;
  } /* exit inner scope */

  /* "mathics/builtin/graphics.py":954
 *                     Expression(
 *                         "List",
 *                         Expression(             # <<<<<<<<<<<<<<
 *                             "List", *[Real(val) for val in a.to_color_space("LAB")]
 *                         ),
 */
  __pyx_t_8 = PySequence_Tuple(__pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 954, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyNumber_Add(__pyx_tuple__11, __pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 954, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 954, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "mathics/builtin/graphics.py":957
 *                             "List", *[Real(val) for val in a.to_color_space("LAB")]
 *                         ),
 *                         Expression(             # <<<<<<<<<<<<<<
 *                             "List", *[Real(val) for val in b.to_color_space("LAB")]
 *                         ),
 */
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_Expression); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 957, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  { /* enter inner scope */

    /* "mathics/builtin/graphics.py":958
 *                         ),
 *                         Expression(
 *                             "List", *[Real(val) for val in b.to_color_space("LAB")]             # <<<<<<<<<<<<<<
 *                         ),
 *                     ),
 */
    __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 958, __pyx_L11_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_b, __pyx_n_s_to_color_space); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 958, __pyx_L11_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_12 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
      __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_9);
      if (likely(__pyx_t_12)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
        __Pyx_INCREF(__pyx_t_12);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_9, function);
      }
    }
    __pyx_t_7 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_12, __pyx_n_u_LAB) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_n_u_LAB);
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 958, __pyx_L11_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (likely(PyList_CheckExact(__pyx_t_7)) || PyTuple_CheckExact(__pyx_t_7)) {
      __pyx_t_9 = __pyx_t_7; __Pyx_INCREF(__pyx_t_9); __pyx_t_10 = 0;
      __pyx_t_11 = NULL;
    } else {
      __pyx_t_10 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 958, __pyx_L11_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_11 = Py_TYPE(__pyx_t_9)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 958, __pyx_L11_error)
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    for (;;) {
      if (likely(!__pyx_t_11)) {
        if (likely(PyList_CheckExact(__pyx_t_9))) {
          if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_9)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_7 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_10); __Pyx_INCREF(__pyx_t_7); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 958, __pyx_L11_error)
          #else
          __pyx_t_7 = PySequence_ITEM(__pyx_t_9, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 958, __pyx_L11_error)
          __Pyx_GOTREF(__pyx_t_7);
          #endif
        } else {
          if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_9)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_10); __Pyx_INCREF(__pyx_t_7); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 958, __pyx_L11_error)
          #else
          __pyx_t_7 = PySequence_ITEM(__pyx_t_9, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 958, __pyx_L11_error)
          __Pyx_GOTREF(__pyx_t_7);
          #endif
        }
      } else {
        __pyx_t_7 = __pyx_t_11(__pyx_t_9);
        if (unlikely(!__pyx_t_7)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 958, __pyx_L11_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_7);
      }
      __Pyx_XDECREF_SET(__pyx_9genexpr10__pyx_v_val, __pyx_t_7);
      __pyx_t_7 = 0;
      __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_Real); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 958, __pyx_L11_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_13 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) {
        __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12);
        if (likely(__pyx_t_13)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
          __Pyx_INCREF(__pyx_t_13);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_12, function);
        }
      }
      __pyx_t_7 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_12, __pyx_t_13, __pyx_9genexpr10__pyx_v_val) : __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_9genexpr10__pyx_v_val);
      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 958, __pyx_L11_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 958, __pyx_L11_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_9genexpr10__pyx_v_val); __pyx_9genexpr10__pyx_v_val = 0;
    goto __pyx_L14_exit_scope;
    __pyx_L11_error:;
    __Pyx_XDECREF(__pyx_9genexpr10__pyx_v_val); __pyx_9genexpr10__pyx_v_val = 0;
    goto __pyx_L1_error;
    __pyx_L14_exit_scope:;
  } /* exit inner scope */

  /* "mathics/builtin/graphics.py":957
 *                             "List", *[Real(val) for val in a.to_color_space("LAB")]
 *                         ),
 *                         Expression(             # <<<<<<<<<<<<<<
 *                             "List", *[Real(val) for val in b.to_color_space("LAB")]
 *                         ),
 */
  __pyx_t_9 = PySequence_Tuple(__pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 957, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyNumber_Add(__pyx_tuple__11, __pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 957, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 957, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  __pyx_t_14 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_14 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_n_u_List, __pyx_t_8, __pyx_t_9};
    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_14, 3+__pyx_t_14); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 952, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_n_u_List, __pyx_t_8, __pyx_t_9};
    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_14, 3+__pyx_t_14); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 952, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  } else
  #endif
  {
    __pyx_t_6 = PyTuple_New(3+__pyx_t_14); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 952, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_5) {
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
    }
    __Pyx_INCREF(__pyx_n_u_List);
    __Pyx_GIVEREF(__pyx_n_u_List);
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_14, __pyx_n_u_List);
    __Pyx_GIVEREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_14, __pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_9);
    PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_14, __pyx_t_9);
    __pyx_t_8 = 0;
    __pyx_t_9 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 952, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  __pyx_t_14 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_14 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_n_u_Apply, __pyx_cur_scope->__pyx_v_distance_function, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_14, 3+__pyx_t_14); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 949, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_n_u_Apply, __pyx_cur_scope->__pyx_v_distance_function, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_14, 3+__pyx_t_14); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 949, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  {
    __pyx_t_6 = PyTuple_New(3+__pyx_t_14); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 949, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_4) {
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
    }
    __Pyx_INCREF(__pyx_n_u_Apply);
    __Pyx_GIVEREF(__pyx_n_u_Apply);
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_14, __pyx_n_u_Apply);
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_distance_function);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_distance_function);
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_14, __pyx_cur_scope->__pyx_v_distance_function);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_14, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 949, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":948
 *         else:
 * 
 *             def compute(a, b):             # <<<<<<<<<<<<<<
 *                 return Expression(
 *                     "Apply",
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("mathics.builtin.graphics.ColorDistance.apply.compute", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_val);
  __Pyx_XDECREF(__pyx_9genexpr10__pyx_v_val);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":967
 *             return
 * 
 *         def distance(a, b):             # <<<<<<<<<<<<<<
 *             try:
 *                 py_a = _Color.create(a)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_13ColorDistance_5apply_3distance(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_13ColorDistance_5apply_3distance = {"distance", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_13ColorDistance_5apply_3distance, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_13ColorDistance_5apply_3distance(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_a = 0;
  PyObject *__pyx_v_b = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("distance (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_b,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("distance", 1, 2, 2, 1); __PYX_ERR(0, 967, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "distance") < 0)) __PYX_ERR(0, 967, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_a = values[0];
    __pyx_v_b = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("distance", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 967, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.ColorDistance.apply.distance", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_13ColorDistance_5apply_2distance(__pyx_self, __pyx_v_a, __pyx_v_b);

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_13ColorDistance_5apply_2distance(PyObject *__pyx_self, PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_9_apply *__pyx_cur_scope;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_9_apply *__pyx_outer_scope;
  PyObject *__pyx_v_py_a = NULL;
  PyObject *__pyx_v_py_b = NULL;
  PyObject *__pyx_v_result = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("distance", 0);
  __pyx_outer_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_9_apply *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "mathics/builtin/graphics.py":968
 * 
 *         def distance(a, b):
 *             try:             # <<<<<<<<<<<<<<
 *                 py_a = _Color.create(a)
 *                 py_b = _Color.create(b)
 */
  {
    __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:*/ {

      /* "mathics/builtin/graphics.py":969
 *         def distance(a, b):
 *             try:
 *                 py_a = _Color.create(a)             # <<<<<<<<<<<<<<
 *                 py_b = _Color.create(b)
 *             except ColorError:
 */
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Color); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 969, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_create); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 969, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
        }
      }
      __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_5, __pyx_v_a) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_a);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 969, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_v_py_a = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "mathics/builtin/graphics.py":970
 *             try:
 *                 py_a = _Color.create(a)
 *                 py_b = _Color.create(b)             # <<<<<<<<<<<<<<
 *             except ColorError:
 *                 evaluation.message("ColorDistance", "invarg", a, b)
 */
      __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_Color); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 970, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_create); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 970, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_b) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_b);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 970, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_py_b = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "mathics/builtin/graphics.py":968
 * 
 *         def distance(a, b):
 *             try:             # <<<<<<<<<<<<<<
 *                 py_a = _Color.create(a)
 *                 py_b = _Color.create(b)
 */
    }
    __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;

    /* "mathics/builtin/graphics.py":971
 *                 py_a = _Color.create(a)
 *                 py_b = _Color.create(b)
 *             except ColorError:             # <<<<<<<<<<<<<<
 *                 evaluation.message("ColorDistance", "invarg", a, b)
 *                 raise
 */
    __Pyx_ErrFetch(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6);
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_ColorError); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 971, __pyx_L5_except_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_4, __pyx_t_7);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_ErrRestore(__pyx_t_4, __pyx_t_5, __pyx_t_6);
    __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0;
    if (__pyx_t_8) {
      __Pyx_AddTraceback("mathics.builtin.graphics.ColorDistance.apply.distance", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) __PYX_ERR(0, 971, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_4);

      /* "mathics/builtin/graphics.py":972
 *                 py_b = _Color.create(b)
 *             except ColorError:
 *                 evaluation.message("ColorDistance", "invarg", a, b)             # <<<<<<<<<<<<<<
 *                 raise
 *             result = from_python(compute(py_a, py_b))
 */
      if (unlikely(!__pyx_cur_scope->__pyx_v_evaluation)) { __Pyx_RaiseClosureNameError("evaluation"); __PYX_ERR(0, 972, __pyx_L5_except_error) }
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_evaluation, __pyx_n_s_message); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 972, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
        if (likely(__pyx_t_10)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_9, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_9)) {
        PyObject *__pyx_temp[5] = {__pyx_t_10, __pyx_n_u_ColorDistance, __pyx_n_u_invarg, __pyx_v_a, __pyx_v_b};
        __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 972, __pyx_L5_except_error)
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_GOTREF(__pyx_t_7);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
        PyObject *__pyx_temp[5] = {__pyx_t_10, __pyx_n_u_ColorDistance, __pyx_n_u_invarg, __pyx_v_a, __pyx_v_b};
        __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 972, __pyx_L5_except_error)
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_GOTREF(__pyx_t_7);
      } else
      #endif
      {
        __pyx_t_11 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 972, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (__pyx_t_10) {
          __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); __pyx_t_10 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_ColorDistance);
        __Pyx_GIVEREF(__pyx_n_u_ColorDistance);
        PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_8, __pyx_n_u_ColorDistance);
        __Pyx_INCREF(__pyx_n_u_invarg);
        __Pyx_GIVEREF(__pyx_n_u_invarg);
        PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_8, __pyx_n_u_invarg);
        __Pyx_INCREF(__pyx_v_a);
        __Pyx_GIVEREF(__pyx_v_a);
        PyTuple_SET_ITEM(__pyx_t_11, 2+__pyx_t_8, __pyx_v_a);
        __Pyx_INCREF(__pyx_v_b);
        __Pyx_GIVEREF(__pyx_v_b);
        PyTuple_SET_ITEM(__pyx_t_11, 3+__pyx_t_8, __pyx_v_b);
        __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_11, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 972, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      }
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "mathics/builtin/graphics.py":973
 *             except ColorError:
 *                 evaluation.message("ColorDistance", "invarg", a, b)
 *                 raise             # <<<<<<<<<<<<<<
 *             result = from_python(compute(py_a, py_b))
 *             return result
 */
      __Pyx_GIVEREF(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_ErrRestoreWithState(__pyx_t_6, __pyx_t_5, __pyx_t_4);
      __pyx_t_6 = 0; __pyx_t_5 = 0; __pyx_t_4 = 0; 
      __PYX_ERR(0, 973, __pyx_L5_except_error)
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "mathics/builtin/graphics.py":968
 * 
 *         def distance(a, b):
 *             try:             # <<<<<<<<<<<<<<
 *                 py_a = _Color.create(a)
 *                 py_b = _Color.create(b)
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L8_try_end:;
  }

  /* "mathics/builtin/graphics.py":974
 *                 evaluation.message("ColorDistance", "invarg", a, b)
 *                 raise
 *             result = from_python(compute(py_a, py_b))             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_from_python); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 974, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (unlikely(!__pyx_cur_scope->__pyx_v_compute)) { __Pyx_RaiseClosureNameError("compute"); __PYX_ERR(0, 974, __pyx_L1_error) }
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_compute);
  __pyx_t_7 = __pyx_cur_scope->__pyx_v_compute; __pyx_t_9 = NULL;
  __pyx_t_8 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_9)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
      __pyx_t_8 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_7)) {
    PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_v_py_a, __pyx_v_py_b};
    __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 974, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_GOTREF(__pyx_t_6);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
    PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_v_py_a, __pyx_v_py_b};
    __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 974, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_GOTREF(__pyx_t_6);
  } else
  #endif
  {
    __pyx_t_11 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 974, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    if (__pyx_t_9) {
      __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); __pyx_t_9 = NULL;
    }
    __Pyx_INCREF(__pyx_v_py_a);
    __Pyx_GIVEREF(__pyx_v_py_a);
    PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_8, __pyx_v_py_a);
    __Pyx_INCREF(__pyx_v_py_b);
    __Pyx_GIVEREF(__pyx_v_py_b);
    PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_8, __pyx_v_py_b);
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_11, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 974, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  }
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 974, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_result = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":975
 *                 raise
 *             result = from_python(compute(py_a, py_b))
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         try:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":967
 *             return
 * 
 *         def distance(a, b):             # <<<<<<<<<<<<<<
 *             try:
 *                 py_a = _Color.create(a)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("mathics.builtin.graphics.ColorDistance.apply.distance", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_py_a);
  __Pyx_XDECREF(__pyx_v_py_b);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":905
 *                 if distance_function.leaves[1].get_string_value() == "Acceptability":
 *                     compute = (
 *                         lambda c1, c2: _CMC_distance(             # <<<<<<<<<<<<<<
 *                             100 * c1.to_color_space("LAB")[:3],
 *                             100 * c2.to_color_space("LAB")[:3],
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_13ColorDistance_5apply_4lambda12(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_13ColorDistance_5apply_4lambda12 = {"lambda12", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_13ColorDistance_5apply_4lambda12, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_13ColorDistance_5apply_4lambda12(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_c1 = 0;
  PyObject *__pyx_v_c2 = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda12 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_c1,&__pyx_n_s_c2,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_c1)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_c2)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("lambda12", 1, 2, 2, 1); __PYX_ERR(0, 905, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lambda12") < 0)) __PYX_ERR(0, 905, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_c1 = values[0];
    __pyx_v_c2 = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("lambda12", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 905, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.ColorDistance.apply.lambda12", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_lambda_funcdef_lambda12(__pyx_self, __pyx_v_c1, __pyx_v_c2);

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

static PyObject *__pyx_lambda_funcdef_lambda12(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_c1, PyObject *__pyx_v_c2) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("lambda12", 0);

  /* "mathics/builtin/graphics.py":911
 *                             1,
 *                         )
 *                         / 100             # <<<<<<<<<<<<<<
 *                     )
 *                 elif distance_function.leaves[1].get_string_value() == "Perceptibility":
 */
  __Pyx_XDECREF(__pyx_r);

  /* "mathics/builtin/graphics.py":905
 *                 if distance_function.leaves[1].get_string_value() == "Acceptability":
 *                     compute = (
 *                         lambda c1, c2: _CMC_distance(             # <<<<<<<<<<<<<<
 *                             100 * c1.to_color_space("LAB")[:3],
 *                             100 * c2.to_color_space("LAB")[:3],
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_CMC_distance); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 905, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "mathics/builtin/graphics.py":906
 *                     compute = (
 *                         lambda c1, c2: _CMC_distance(
 *                             100 * c1.to_color_space("LAB")[:3],             # <<<<<<<<<<<<<<
 *                             100 * c2.to_color_space("LAB")[:3],
 *                             2,
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_c1, __pyx_n_s_to_color_space); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 906, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_n_u_LAB) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_n_u_LAB);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 906, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_t_3, 0, 3, NULL, NULL, &__pyx_slice__19, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 906, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Multiply(__pyx_int_100, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 906, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":907
 *                         lambda c1, c2: _CMC_distance(
 *                             100 * c1.to_color_space("LAB")[:3],
 *                             100 * c2.to_color_space("LAB")[:3],             # <<<<<<<<<<<<<<
 *                             2,
 *                             1,
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_c2, __pyx_n_s_to_color_space); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 907, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_n_u_LAB) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_n_u_LAB);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 907, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_t_4, 0, 3, NULL, NULL, &__pyx_slice__19, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 907, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyNumber_Multiply(__pyx_int_100, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 907, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_7 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_t_3, __pyx_t_4, __pyx_int_2, __pyx_int_1};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 4+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 905, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_t_3, __pyx_t_4, __pyx_int_2, __pyx_int_1};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 4+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 905, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else
  #endif
  {
    __pyx_t_6 = PyTuple_New(4+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 905, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_5) {
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_7, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_7, __pyx_t_4);
    __Pyx_INCREF(__pyx_int_2);
    __Pyx_GIVEREF(__pyx_int_2);
    PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_7, __pyx_int_2);
    __Pyx_INCREF(__pyx_int_1);
    __Pyx_GIVEREF(__pyx_int_1);
    PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_7, __pyx_int_1);
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 905, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":911
 *                             1,
 *                         )
 *                         / 100             # <<<<<<<<<<<<<<
 *                     )
 *                 elif distance_function.leaves[1].get_string_value() == "Perceptibility":
 */
  __pyx_t_2 = __Pyx_PyInt_TrueDivideObjC(__pyx_t_1, __pyx_int_100, 0x64, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 911, __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;

  /* "mathics/builtin/graphics.py":905
 *                 if distance_function.leaves[1].get_string_value() == "Acceptability":
 *                     compute = (
 *                         lambda c1, c2: _CMC_distance(             # <<<<<<<<<<<<<<
 *                             100 * c1.to_color_space("LAB")[:3],
 *                             100 * c2.to_color_space("LAB")[:3],
 */

  /* 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("mathics.builtin.graphics.ColorDistance.apply.lambda12", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":932
 *                             )
 *                             compute = (
 *                                 lambda c1, c2: _CMC_distance(             # <<<<<<<<<<<<<<
 *                                     100 * c1.to_color_space("LAB")[:3],
 *                                     100 * c2.to_color_space("LAB")[:3],
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_13ColorDistance_5apply_5lambda13(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_13ColorDistance_5apply_5lambda13 = {"lambda13", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_13ColorDistance_5apply_5lambda13, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_13ColorDistance_5apply_5lambda13(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_c1 = 0;
  PyObject *__pyx_v_c2 = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda13 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_c1,&__pyx_n_s_c2,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_c1)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_c2)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("lambda13", 1, 2, 2, 1); __PYX_ERR(0, 932, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lambda13") < 0)) __PYX_ERR(0, 932, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_c1 = values[0];
    __pyx_v_c2 = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("lambda13", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 932, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.ColorDistance.apply.lambda13", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_lambda_funcdef_lambda13(__pyx_self, __pyx_v_c1, __pyx_v_c2);

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

static PyObject *__pyx_lambda_funcdef_lambda13(PyObject *__pyx_self, PyObject *__pyx_v_c1, PyObject *__pyx_v_c2) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_9_apply *__pyx_cur_scope;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_9_apply *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("lambda13", 0);
  __pyx_outer_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_9_apply *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "mathics/builtin/graphics.py":938
 *                                     chroma,
 *                                 )
 *                                 / 100             # <<<<<<<<<<<<<<
 *                             )
 * 
 */
  __Pyx_XDECREF(__pyx_r);

  /* "mathics/builtin/graphics.py":932
 *                             )
 *                             compute = (
 *                                 lambda c1, c2: _CMC_distance(             # <<<<<<<<<<<<<<
 *                                     100 * c1.to_color_space("LAB")[:3],
 *                                     100 * c2.to_color_space("LAB")[:3],
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_CMC_distance); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 932, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "mathics/builtin/graphics.py":933
 *                             compute = (
 *                                 lambda c1, c2: _CMC_distance(
 *                                     100 * c1.to_color_space("LAB")[:3],             # <<<<<<<<<<<<<<
 *                                     100 * c2.to_color_space("LAB")[:3],
 *                                     lightness,
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_c1, __pyx_n_s_to_color_space); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 933, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_n_u_LAB) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_n_u_LAB);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 933, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_t_3, 0, 3, NULL, NULL, &__pyx_slice__19, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 933, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Multiply(__pyx_int_100, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 933, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":934
 *                                 lambda c1, c2: _CMC_distance(
 *                                     100 * c1.to_color_space("LAB")[:3],
 *                                     100 * c2.to_color_space("LAB")[:3],             # <<<<<<<<<<<<<<
 *                                     lightness,
 *                                     chroma,
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_c2, __pyx_n_s_to_color_space); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 934, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_n_u_LAB) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_n_u_LAB);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 934, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_t_4, 0, 3, NULL, NULL, &__pyx_slice__19, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 934, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyNumber_Multiply(__pyx_int_100, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 934, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":935
 *                                     100 * c1.to_color_space("LAB")[:3],
 *                                     100 * c2.to_color_space("LAB")[:3],
 *                                     lightness,             # <<<<<<<<<<<<<<
 *                                     chroma,
 *                                 )
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_lightness)) { __Pyx_RaiseClosureNameError("lightness"); __PYX_ERR(0, 935, __pyx_L1_error) }

  /* "mathics/builtin/graphics.py":936
 *                                     100 * c2.to_color_space("LAB")[:3],
 *                                     lightness,
 *                                     chroma,             # <<<<<<<<<<<<<<
 *                                 )
 *                                 / 100
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_chroma)) { __Pyx_RaiseClosureNameError("chroma"); __PYX_ERR(0, 936, __pyx_L1_error) }
  __pyx_t_5 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_7 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_t_3, __pyx_t_4, __pyx_cur_scope->__pyx_v_lightness, __pyx_cur_scope->__pyx_v_chroma};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 4+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 932, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_t_3, __pyx_t_4, __pyx_cur_scope->__pyx_v_lightness, __pyx_cur_scope->__pyx_v_chroma};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 4+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 932, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else
  #endif
  {
    __pyx_t_6 = PyTuple_New(4+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 932, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_5) {
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_7, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_7, __pyx_t_4);
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_lightness);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_lightness);
    PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_7, __pyx_cur_scope->__pyx_v_lightness);
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_chroma);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_chroma);
    PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_7, __pyx_cur_scope->__pyx_v_chroma);
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 932, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":938
 *                                     chroma,
 *                                 )
 *                                 / 100             # <<<<<<<<<<<<<<
 *                             )
 * 
 */
  __pyx_t_2 = __Pyx_PyInt_TrueDivideObjC(__pyx_t_1, __pyx_int_100, 0x64, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 938, __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;

  /* "mathics/builtin/graphics.py":932
 *                             )
 *                             compute = (
 *                                 lambda c1, c2: _CMC_distance(             # <<<<<<<<<<<<<<
 *                                     100 * c1.to_color_space("LAB")[:3],
 *                                     100 * c2.to_color_space("LAB")[:3],
 */

  /* 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("mathics.builtin.graphics.ColorDistance.apply.lambda13", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":884
 *     }
 * 
 *     def apply(self, c1, c2, evaluation, options):             # <<<<<<<<<<<<<<
 *         "ColorDistance[c1_, c2_, OptionsPattern[ColorDistance]]"
 * 
 */

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_13ColorDistance_apply(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_c1, PyObject *__pyx_v_c2, PyObject *__pyx_v_evaluation, PyObject *__pyx_v_options) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_9_apply *__pyx_cur_scope;
  CYTHON_UNUSED PyObject *__pyx_v_np = NULL;
  PyObject *__pyx_v_distance = 0;
  PyObject *__pyx_9genexpr11__pyx_v_a = NULL;
  PyObject *__pyx_9genexpr11__pyx_v_b = NULL;
  PyObject *__pyx_9genexpr12__pyx_v_c = NULL;
  PyObject *__pyx_9genexpr13__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 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  int __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  PyObject *(*__pyx_t_15)(PyObject *);
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *(*__pyx_t_18)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("apply", 0);
  __pyx_cur_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_9_apply *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_9_apply(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_9_apply, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_9_apply *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 884, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_evaluation = __pyx_v_evaluation;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_evaluation);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_evaluation);

  /* "mathics/builtin/graphics.py":889
 *         # If numpy is not installed, 100 * c1.to_color_space returns
 *         # a list of 100 x 3 elements, instead of doing elementwise multiplication
 *         try:             # <<<<<<<<<<<<<<
 *             import numpy as np
 *         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:*/ {

      /* "mathics/builtin/graphics.py":890
 *         # a list of 100 x 3 elements, instead of doing elementwise multiplication
 *         try:
 *             import numpy as np             # <<<<<<<<<<<<<<
 *         except:
 *             raise RuntimeError("NumPy needs to be installed for ColorDistance")
 */
      __pyx_t_4 = __Pyx_Import(__pyx_n_s_numpy, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 890, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_v_np = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "mathics/builtin/graphics.py":889
 *         # If numpy is not installed, 100 * c1.to_color_space returns
 *         # a list of 100 x 3 elements, instead of doing elementwise multiplication
 *         try:             # <<<<<<<<<<<<<<
 *             import numpy as np
 *         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_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "mathics/builtin/graphics.py":891
 *         try:
 *             import numpy as np
 *         except:             # <<<<<<<<<<<<<<
 *             raise RuntimeError("NumPy needs to be installed for ColorDistance")
 * 
 */
    /*except:*/ {
      __Pyx_AddTraceback("mathics.builtin.graphics.ColorDistance.apply", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6) < 0) __PYX_ERR(0, 891, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);

      /* "mathics/builtin/graphics.py":892
 *             import numpy as np
 *         except:
 *             raise RuntimeError("NumPy needs to be installed for ColorDistance")             # <<<<<<<<<<<<<<
 * 
 *         distance_function = options.get("System`DistanceFunction")
 */
      __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 892, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_Raise(__pyx_t_7, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __PYX_ERR(0, 892, __pyx_L5_except_error)
    }
    __pyx_L5_except_error:;

    /* "mathics/builtin/graphics.py":889
 *         # If numpy is not installed, 100 * c1.to_color_space returns
 *         # a list of 100 x 3 elements, instead of doing elementwise multiplication
 *         try:             # <<<<<<<<<<<<<<
 *             import numpy as np
 *         except:
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L8_try_end:;
  }

  /* "mathics/builtin/graphics.py":894
 *             raise RuntimeError("NumPy needs to be installed for ColorDistance")
 * 
 *         distance_function = options.get("System`DistanceFunction")             # <<<<<<<<<<<<<<
 *         compute = None
 *         if isinstance(distance_function, String):
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_options, __pyx_n_s_get); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 894, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_6 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_kp_u_System_DistanceFunction) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_kp_u_System_DistanceFunction);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 894, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_cur_scope->__pyx_v_distance_function = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "mathics/builtin/graphics.py":895
 * 
 *         distance_function = options.get("System`DistanceFunction")
 *         compute = None             # <<<<<<<<<<<<<<
 *         if isinstance(distance_function, String):
 *             compute = ColorDistance._distances.get(distance_function.get_string_value())
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __pyx_cur_scope->__pyx_v_compute = Py_None;

  /* "mathics/builtin/graphics.py":896
 *         distance_function = options.get("System`DistanceFunction")
 *         compute = None
 *         if isinstance(distance_function, String):             # <<<<<<<<<<<<<<
 *             compute = ColorDistance._distances.get(distance_function.get_string_value())
 *             if not compute:
 */
  __pyx_t_6 = __pyx_cur_scope->__pyx_v_distance_function;
  __Pyx_INCREF(__pyx_t_6);
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_String); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 896, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_8 = PyObject_IsInstance(__pyx_t_6, __pyx_t_5); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 896, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_9 = (__pyx_t_8 != 0);
  if (__pyx_t_9) {

    /* "mathics/builtin/graphics.py":897
 *         compute = None
 *         if isinstance(distance_function, String):
 *             compute = ColorDistance._distances.get(distance_function.get_string_value())             # <<<<<<<<<<<<<<
 *             if not compute:
 *                 evaluation.message("ColorDistance", "invdist", distance_function)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_ColorDistance); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 897, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_distances); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 897, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_get); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 897, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_distance_function, __pyx_n_s_get_string_value); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 897, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_10 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_10)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    __pyx_t_4 = (__pyx_t_10) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_10) : __Pyx_PyObject_CallNoArg(__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 897, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 897, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_compute);
    __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_compute, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_5 = 0;

    /* "mathics/builtin/graphics.py":898
 *         if isinstance(distance_function, String):
 *             compute = ColorDistance._distances.get(distance_function.get_string_value())
 *             if not compute:             # <<<<<<<<<<<<<<
 *                 evaluation.message("ColorDistance", "invdist", distance_function)
 *                 return
 */
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_compute); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 898, __pyx_L1_error)
    __pyx_t_8 = ((!__pyx_t_9) != 0);
    if (__pyx_t_8) {

      /* "mathics/builtin/graphics.py":899
 *             compute = ColorDistance._distances.get(distance_function.get_string_value())
 *             if not compute:
 *                 evaluation.message("ColorDistance", "invdist", distance_function)             # <<<<<<<<<<<<<<
 *                 return
 *         elif distance_function.has_form("List", 2):
 */
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_evaluation, __pyx_n_s_message); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 899, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_4 = NULL;
      __pyx_t_11 = 0;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_11 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_n_u_ColorDistance, __pyx_n_u_invdist, __pyx_cur_scope->__pyx_v_distance_function};
        __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_11, 3+__pyx_t_11); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 899, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_5);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_n_u_ColorDistance, __pyx_n_u_invdist, __pyx_cur_scope->__pyx_v_distance_function};
        __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_11, 3+__pyx_t_11); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 899, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_5);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(3+__pyx_t_11); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 899, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_ColorDistance);
        __Pyx_GIVEREF(__pyx_n_u_ColorDistance);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_11, __pyx_n_u_ColorDistance);
        __Pyx_INCREF(__pyx_n_u_invdist);
        __Pyx_GIVEREF(__pyx_n_u_invdist);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_11, __pyx_n_u_invdist);
        __Pyx_INCREF(__pyx_cur_scope->__pyx_v_distance_function);
        __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_distance_function);
        PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_11, __pyx_cur_scope->__pyx_v_distance_function);
        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 899, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "mathics/builtin/graphics.py":900
 *             if not compute:
 *                 evaluation.message("ColorDistance", "invdist", distance_function)
 *                 return             # <<<<<<<<<<<<<<
 *         elif distance_function.has_form("List", 2):
 *             if distance_function.leaves[0].get_string_value() == "CMC":
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L0;

      /* "mathics/builtin/graphics.py":898
 *         if isinstance(distance_function, String):
 *             compute = ColorDistance._distances.get(distance_function.get_string_value())
 *             if not compute:             # <<<<<<<<<<<<<<
 *                 evaluation.message("ColorDistance", "invdist", distance_function)
 *                 return
 */
    }

    /* "mathics/builtin/graphics.py":896
 *         distance_function = options.get("System`DistanceFunction")
 *         compute = None
 *         if isinstance(distance_function, String):             # <<<<<<<<<<<<<<
 *             compute = ColorDistance._distances.get(distance_function.get_string_value())
 *             if not compute:
 */
    goto __pyx_L11;
  }

  /* "mathics/builtin/graphics.py":901
 *                 evaluation.message("ColorDistance", "invdist", distance_function)
 *                 return
 *         elif distance_function.has_form("List", 2):             # <<<<<<<<<<<<<<
 *             if distance_function.leaves[0].get_string_value() == "CMC":
 *                 if distance_function.leaves[1].get_string_value() == "Acceptability":
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_distance_function, __pyx_n_s_has_form); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 901, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 901, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 901, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__pyx_t_8) {

    /* "mathics/builtin/graphics.py":902
 *                 return
 *         elif distance_function.has_form("List", 2):
 *             if distance_function.leaves[0].get_string_value() == "CMC":             # <<<<<<<<<<<<<<
 *                 if distance_function.leaves[1].get_string_value() == "Acceptability":
 *                     compute = (
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_distance_function, __pyx_n_s_leaves); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 902, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_5, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 902, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_get_string_value); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 902, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_6 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 902, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_t_6, __pyx_n_u_CMC, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 902, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (__pyx_t_8) {

      /* "mathics/builtin/graphics.py":903
 *         elif distance_function.has_form("List", 2):
 *             if distance_function.leaves[0].get_string_value() == "CMC":
 *                 if distance_function.leaves[1].get_string_value() == "Acceptability":             # <<<<<<<<<<<<<<
 *                     compute = (
 *                         lambda c1, c2: _CMC_distance(
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_distance_function, __pyx_n_s_leaves); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 903, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_5, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 903, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_get_string_value); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 903, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_6 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 903, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_t_6, __pyx_n_u_Acceptability, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 903, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (__pyx_t_8) {

        /* "mathics/builtin/graphics.py":905
 *                 if distance_function.leaves[1].get_string_value() == "Acceptability":
 *                     compute = (
 *                         lambda c1, c2: _CMC_distance(             # <<<<<<<<<<<<<<
 *                             100 * c1.to_color_space("LAB")[:3],
 *                             100 * c2.to_color_space("LAB")[:3],
 */
        __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_13ColorDistance_5apply_4lambda12, 0, __pyx_n_s_ColorDistance_apply_locals_lambd, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 905, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_compute);
        __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_compute, __pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_6);
        __pyx_t_6 = 0;

        /* "mathics/builtin/graphics.py":903
 *         elif distance_function.has_form("List", 2):
 *             if distance_function.leaves[0].get_string_value() == "CMC":
 *                 if distance_function.leaves[1].get_string_value() == "Acceptability":             # <<<<<<<<<<<<<<
 *                     compute = (
 *                         lambda c1, c2: _CMC_distance(
 */
        goto __pyx_L14;
      }

      /* "mathics/builtin/graphics.py":913
 *                         / 100
 *                     )
 *                 elif distance_function.leaves[1].get_string_value() == "Perceptibility":             # <<<<<<<<<<<<<<
 *                     compute = ColorDistance._distances.get("CMC")
 * 
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_distance_function, __pyx_n_s_leaves); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 913, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_5, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 913, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_get_string_value); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 913, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_6 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 913, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_t_6, __pyx_n_u_Perceptibility, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 913, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (__pyx_t_8) {

        /* "mathics/builtin/graphics.py":914
 *                     )
 *                 elif distance_function.leaves[1].get_string_value() == "Perceptibility":
 *                     compute = ColorDistance._distances.get("CMC")             # <<<<<<<<<<<<<<
 * 
 *                 elif distance_function.leaves[1].has_form("List", 2):
 */
        __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ColorDistance); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 914, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_distances); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 914, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_get); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 914, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_5, function);
          }
        }
        __pyx_t_6 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, __pyx_n_u_CMC) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_n_u_CMC);
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 914, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_compute);
        __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_compute, __pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_6);
        __pyx_t_6 = 0;

        /* "mathics/builtin/graphics.py":913
 *                         / 100
 *                     )
 *                 elif distance_function.leaves[1].get_string_value() == "Perceptibility":             # <<<<<<<<<<<<<<
 *                     compute = ColorDistance._distances.get("CMC")
 * 
 */
        goto __pyx_L14;
      }

      /* "mathics/builtin/graphics.py":916
 *                     compute = ColorDistance._distances.get("CMC")
 * 
 *                 elif distance_function.leaves[1].has_form("List", 2):             # <<<<<<<<<<<<<<
 *                     if isinstance(
 *                         distance_function.leaves[1].leaves[0], Integer
 */
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_distance_function, __pyx_n_s_leaves); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 916, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_6, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 916, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_has_form); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 916, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 916, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 916, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_8) {

        /* "mathics/builtin/graphics.py":918
 *                 elif distance_function.leaves[1].has_form("List", 2):
 *                     if isinstance(
 *                         distance_function.leaves[1].leaves[0], Integer             # <<<<<<<<<<<<<<
 *                     ) and isinstance(distance_function.leaves[1].leaves[1], Integer):
 *                         if (
 */
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_distance_function, __pyx_n_s_leaves); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 918, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_5, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 918, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_leaves); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 918, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_5, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 918, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Integer); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 918, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);

        /* "mathics/builtin/graphics.py":917
 * 
 *                 elif distance_function.leaves[1].has_form("List", 2):
 *                     if isinstance(             # <<<<<<<<<<<<<<
 *                         distance_function.leaves[1].leaves[0], Integer
 *                     ) and isinstance(distance_function.leaves[1].leaves[1], Integer):
 */
        __pyx_t_9 = PyObject_IsInstance(__pyx_t_6, __pyx_t_5); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 917, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_12 = (__pyx_t_9 != 0);
        if (__pyx_t_12) {
        } else {
          __pyx_t_8 = __pyx_t_12;
          goto __pyx_L16_bool_binop_done;
        }

        /* "mathics/builtin/graphics.py":919
 *                     if isinstance(
 *                         distance_function.leaves[1].leaves[0], Integer
 *                     ) and isinstance(distance_function.leaves[1].leaves[1], Integer):             # <<<<<<<<<<<<<<
 *                         if (
 *                             distance_function.leaves[1].leaves[0].get_int_value() > 0
 */
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_distance_function, __pyx_n_s_leaves); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 919, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_5, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 919, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_leaves); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 919, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_5, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 919, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Integer); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 919, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_12 = PyObject_IsInstance(__pyx_t_6, __pyx_t_5); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 919, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_9 = (__pyx_t_12 != 0);
        __pyx_t_8 = __pyx_t_9;
        __pyx_L16_bool_binop_done:;

        /* "mathics/builtin/graphics.py":917
 * 
 *                 elif distance_function.leaves[1].has_form("List", 2):
 *                     if isinstance(             # <<<<<<<<<<<<<<
 *                         distance_function.leaves[1].leaves[0], Integer
 *                     ) and isinstance(distance_function.leaves[1].leaves[1], Integer):
 */
        if (__pyx_t_8) {

          /* "mathics/builtin/graphics.py":921
 *                     ) and isinstance(distance_function.leaves[1].leaves[1], Integer):
 *                         if (
 *                             distance_function.leaves[1].leaves[0].get_int_value() > 0             # <<<<<<<<<<<<<<
 *                             and distance_function.leaves[1].leaves[1].get_int_value()
 *                             > 0
 */
          __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_distance_function, __pyx_n_s_leaves); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 921, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_6, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 921, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_leaves); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 921, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_6, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 921, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_get_int_value); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 921, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __pyx_t_7 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
            __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
            if (likely(__pyx_t_7)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
              __Pyx_INCREF(__pyx_t_7);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_6, function);
            }
          }
          __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 921, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_t_6 = PyObject_RichCompare(__pyx_t_5, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 921, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 921, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (__pyx_t_9) {
          } else {
            __pyx_t_8 = __pyx_t_9;
            goto __pyx_L19_bool_binop_done;
          }

          /* "mathics/builtin/graphics.py":922
 *                         if (
 *                             distance_function.leaves[1].leaves[0].get_int_value() > 0
 *                             and distance_function.leaves[1].leaves[1].get_int_value()             # <<<<<<<<<<<<<<
 *                             > 0
 *                         ):
 */
          __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_distance_function, __pyx_n_s_leaves); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 922, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_5, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 922, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_leaves); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 922, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_5, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 922, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_get_int_value); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 922, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __pyx_t_7 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
            __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
            if (likely(__pyx_t_7)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
              __Pyx_INCREF(__pyx_t_7);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_5, function);
            }
          }
          __pyx_t_6 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 922, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_t_5 = PyObject_RichCompare(__pyx_t_6, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 923, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

          /* "mathics/builtin/graphics.py":923
 *                             distance_function.leaves[1].leaves[0].get_int_value() > 0
 *                             and distance_function.leaves[1].leaves[1].get_int_value()
 *                             > 0             # <<<<<<<<<<<<<<
 *                         ):
 *                             lightness = (
 */
          __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 923, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_L19_bool_binop_done:;

          /* "mathics/builtin/graphics.py":920
 *                         distance_function.leaves[1].leaves[0], Integer
 *                     ) and isinstance(distance_function.leaves[1].leaves[1], Integer):
 *                         if (             # <<<<<<<<<<<<<<
 *                             distance_function.leaves[1].leaves[0].get_int_value() > 0
 *                             and distance_function.leaves[1].leaves[1].get_int_value()
 */
          if (__pyx_t_8) {

            /* "mathics/builtin/graphics.py":926
 *                         ):
 *                             lightness = (
 *                                 distance_function.leaves[1].leaves[0].get_int_value()             # <<<<<<<<<<<<<<
 *                             )
 *                             chroma = (
 */
            __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_distance_function, __pyx_n_s_leaves); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 926, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_6);
            __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_6, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 926, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_7);
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_leaves); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 926, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_6);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_6, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 926, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_7);
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_get_int_value); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 926, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_6);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            __pyx_t_7 = NULL;
            if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
              __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
              if (likely(__pyx_t_7)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
                __Pyx_INCREF(__pyx_t_7);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_6, function);
              }
            }
            __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 926, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_GIVEREF(__pyx_t_5);
            __pyx_cur_scope->__pyx_v_lightness = __pyx_t_5;
            __pyx_t_5 = 0;

            /* "mathics/builtin/graphics.py":929
 *                             )
 *                             chroma = (
 *                                 distance_function.leaves[1].leaves[1].get_int_value()             # <<<<<<<<<<<<<<
 *                             )
 *                             compute = (
 */
            __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_distance_function, __pyx_n_s_leaves); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 929, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_6);
            __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_6, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 929, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_7);
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_leaves); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 929, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_6);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_6, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 929, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_7);
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_get_int_value); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 929, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_6);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            __pyx_t_7 = NULL;
            if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
              __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
              if (likely(__pyx_t_7)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
                __Pyx_INCREF(__pyx_t_7);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_6, function);
              }
            }
            __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 929, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_GIVEREF(__pyx_t_5);
            __pyx_cur_scope->__pyx_v_chroma = __pyx_t_5;
            __pyx_t_5 = 0;

            /* "mathics/builtin/graphics.py":932
 *                             )
 *                             compute = (
 *                                 lambda c1, c2: _CMC_distance(             # <<<<<<<<<<<<<<
 *                                     100 * c1.to_color_space("LAB")[:3],
 *                                     100 * c2.to_color_space("LAB")[:3],
 */
            __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_13ColorDistance_5apply_5lambda13, 0, __pyx_n_s_ColorDistance_apply_locals_lambd, ((PyObject*)__pyx_cur_scope), __pyx_n_s_mathics_builtin_graphics, __pyx_d, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 932, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_compute);
            __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_compute, __pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_5);
            __pyx_t_5 = 0;

            /* "mathics/builtin/graphics.py":920
 *                         distance_function.leaves[1].leaves[0], Integer
 *                     ) and isinstance(distance_function.leaves[1].leaves[1], Integer):
 *                         if (             # <<<<<<<<<<<<<<
 *                             distance_function.leaves[1].leaves[0].get_int_value() > 0
 *                             and distance_function.leaves[1].leaves[1].get_int_value()
 */
          }

          /* "mathics/builtin/graphics.py":917
 * 
 *                 elif distance_function.leaves[1].has_form("List", 2):
 *                     if isinstance(             # <<<<<<<<<<<<<<
 *                         distance_function.leaves[1].leaves[0], Integer
 *                     ) and isinstance(distance_function.leaves[1].leaves[1], Integer):
 */
        }

        /* "mathics/builtin/graphics.py":916
 *                     compute = ColorDistance._distances.get("CMC")
 * 
 *                 elif distance_function.leaves[1].has_form("List", 2):             # <<<<<<<<<<<<<<
 *                     if isinstance(
 *                         distance_function.leaves[1].leaves[0], Integer
 */
      }
      __pyx_L14:;

      /* "mathics/builtin/graphics.py":902
 *                 return
 *         elif distance_function.has_form("List", 2):
 *             if distance_function.leaves[0].get_string_value() == "CMC":             # <<<<<<<<<<<<<<
 *                 if distance_function.leaves[1].get_string_value() == "Acceptability":
 *                     compute = (
 */
    }

    /* "mathics/builtin/graphics.py":901
 *                 evaluation.message("ColorDistance", "invdist", distance_function)
 *                 return
 *         elif distance_function.has_form("List", 2):             # <<<<<<<<<<<<<<
 *             if distance_function.leaves[0].get_string_value() == "CMC":
 *                 if distance_function.leaves[1].get_string_value() == "Acceptability":
 */
    goto __pyx_L11;
  }

  /* "mathics/builtin/graphics.py":942
 * 
 *         elif (
 *             isinstance(distance_function, Symbol)             # <<<<<<<<<<<<<<
 *             and distance_function.get_name() == "System`Automatic"
 *         ):
 */
  __pyx_t_5 = __pyx_cur_scope->__pyx_v_distance_function;
  __Pyx_INCREF(__pyx_t_5);
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_Symbol); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 942, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_9 = PyObject_IsInstance(__pyx_t_5, __pyx_t_6); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 942, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_12 = (__pyx_t_9 != 0);
  if (__pyx_t_12) {
  } else {
    __pyx_t_8 = __pyx_t_12;
    goto __pyx_L21_bool_binop_done;
  }

  /* "mathics/builtin/graphics.py":943
 *         elif (
 *             isinstance(distance_function, Symbol)
 *             and distance_function.get_name() == "System`Automatic"             # <<<<<<<<<<<<<<
 *         ):
 *             compute = ColorDistance._distances.get("CIE76")
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_distance_function, __pyx_n_s_get_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 943, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_6 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 943, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_12 = (__Pyx_PyUnicode_Equals(__pyx_t_6, __pyx_kp_u_System_Automatic, Py_EQ)); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 943, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_8 = __pyx_t_12;
  __pyx_L21_bool_binop_done:;

  /* "mathics/builtin/graphics.py":941
 *                             )
 * 
 *         elif (             # <<<<<<<<<<<<<<
 *             isinstance(distance_function, Symbol)
 *             and distance_function.get_name() == "System`Automatic"
 */
  if (__pyx_t_8) {

    /* "mathics/builtin/graphics.py":945
 *             and distance_function.get_name() == "System`Automatic"
 *         ):
 *             compute = ColorDistance._distances.get("CIE76")             # <<<<<<<<<<<<<<
 *         else:
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ColorDistance); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 945, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_distances); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 945, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_get); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 945, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_6 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, __pyx_n_u_CIE76) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_n_u_CIE76);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 945, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_compute);
    __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_compute, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    __pyx_t_6 = 0;

    /* "mathics/builtin/graphics.py":941
 *                             )
 * 
 *         elif (             # <<<<<<<<<<<<<<
 *             isinstance(distance_function, Symbol)
 *             and distance_function.get_name() == "System`Automatic"
 */
    goto __pyx_L11;
  }

  /* "mathics/builtin/graphics.py":948
 *         else:
 * 
 *             def compute(a, b):             # <<<<<<<<<<<<<<
 *                 return Expression(
 *                     "Apply",
 */
  /*else*/ {
    __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_13ColorDistance_5apply_1compute, 0, __pyx_n_s_ColorDistance_apply_locals_compu, ((PyObject*)__pyx_cur_scope), __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__26)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 948, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_compute);
    __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_compute, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    __pyx_t_6 = 0;
  }
  __pyx_L11:;

  /* "mathics/builtin/graphics.py":963
 *                 )
 * 
 *         if compute == None:             # <<<<<<<<<<<<<<
 *             evaluation.message("ColorDistance", "invdist", distance_function)
 *             return
 */
  __pyx_t_6 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_compute, Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 963, __pyx_L1_error)
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 963, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__pyx_t_8) {

    /* "mathics/builtin/graphics.py":964
 * 
 *         if compute == None:
 *             evaluation.message("ColorDistance", "invdist", distance_function)             # <<<<<<<<<<<<<<
 *             return
 * 
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_evaluation, __pyx_n_s_message); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 964, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = NULL;
    __pyx_t_11 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_11 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_n_u_ColorDistance, __pyx_n_u_invdist, __pyx_cur_scope->__pyx_v_distance_function};
      __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_11, 3+__pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 964, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_6);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_n_u_ColorDistance, __pyx_n_u_invdist, __pyx_cur_scope->__pyx_v_distance_function};
      __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_11, 3+__pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 964, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_6);
    } else
    #endif
    {
      __pyx_t_4 = PyTuple_New(3+__pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 964, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (__pyx_t_7) {
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7); __pyx_t_7 = NULL;
      }
      __Pyx_INCREF(__pyx_n_u_ColorDistance);
      __Pyx_GIVEREF(__pyx_n_u_ColorDistance);
      PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_11, __pyx_n_u_ColorDistance);
      __Pyx_INCREF(__pyx_n_u_invdist);
      __Pyx_GIVEREF(__pyx_n_u_invdist);
      PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_11, __pyx_n_u_invdist);
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_distance_function);
      __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_distance_function);
      PyTuple_SET_ITEM(__pyx_t_4, 2+__pyx_t_11, __pyx_cur_scope->__pyx_v_distance_function);
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 964, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "mathics/builtin/graphics.py":965
 *         if compute == None:
 *             evaluation.message("ColorDistance", "invdist", distance_function)
 *             return             # <<<<<<<<<<<<<<
 * 
 *         def distance(a, b):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "mathics/builtin/graphics.py":963
 *                 )
 * 
 *         if compute == None:             # <<<<<<<<<<<<<<
 *             evaluation.message("ColorDistance", "invdist", distance_function)
 *             return
 */
  }

  /* "mathics/builtin/graphics.py":967
 *             return
 * 
 *         def distance(a, b):             # <<<<<<<<<<<<<<
 *             try:
 *                 py_a = _Color.create(a)
 */
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_13ColorDistance_5apply_3distance, 0, __pyx_n_s_ColorDistance_apply_locals_dista, ((PyObject*)__pyx_cur_scope), __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__28)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 967, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_v_distance = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "mathics/builtin/graphics.py":977
 *             return result
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             if c1.get_head_name() == "System`List":
 *                 if c2.get_head_name() == "System`List":
 */
  {
    __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:*/ {

      /* "mathics/builtin/graphics.py":978
 * 
 *         try:
 *             if c1.get_head_name() == "System`List":             # <<<<<<<<<<<<<<
 *                 if c2.get_head_name() == "System`List":
 *                     if len(c1.leaves) != len(c2.leaves):
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_c1, __pyx_n_s_get_head_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 978, __pyx_L24_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_6 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 978, __pyx_L24_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_t_6, __pyx_kp_u_System_List, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 978, __pyx_L24_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (__pyx_t_8) {

        /* "mathics/builtin/graphics.py":979
 *         try:
 *             if c1.get_head_name() == "System`List":
 *                 if c2.get_head_name() == "System`List":             # <<<<<<<<<<<<<<
 *                     if len(c1.leaves) != len(c2.leaves):
 *                         evaluation.message("ColorDistance", "invarg", c1, c2)
 */
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_c2, __pyx_n_s_get_head_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 979, __pyx_L24_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_5, function);
          }
        }
        __pyx_t_6 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 979, __pyx_L24_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_t_6, __pyx_kp_u_System_List, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 979, __pyx_L24_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (__pyx_t_8) {

          /* "mathics/builtin/graphics.py":980
 *             if c1.get_head_name() == "System`List":
 *                 if c2.get_head_name() == "System`List":
 *                     if len(c1.leaves) != len(c2.leaves):             # <<<<<<<<<<<<<<
 *                         evaluation.message("ColorDistance", "invarg", c1, c2)
 *                         return
 */
          __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_c1, __pyx_n_s_leaves); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 980, __pyx_L24_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_13 = PyObject_Length(__pyx_t_6); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 980, __pyx_L24_error)
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_c2, __pyx_n_s_leaves); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 980, __pyx_L24_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_14 = PyObject_Length(__pyx_t_6); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1))) __PYX_ERR(0, 980, __pyx_L24_error)
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_t_8 = ((__pyx_t_13 != __pyx_t_14) != 0);
          if (__pyx_t_8) {

            /* "mathics/builtin/graphics.py":981
 *                 if c2.get_head_name() == "System`List":
 *                     if len(c1.leaves) != len(c2.leaves):
 *                         evaluation.message("ColorDistance", "invarg", c1, c2)             # <<<<<<<<<<<<<<
 *                         return
 *                     else:
 */
            __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_evaluation, __pyx_n_s_message); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 981, __pyx_L24_error)
            __Pyx_GOTREF(__pyx_t_5);
            __pyx_t_4 = NULL;
            __pyx_t_11 = 0;
            if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
              __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
              if (likely(__pyx_t_4)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
                __Pyx_INCREF(__pyx_t_4);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_5, function);
                __pyx_t_11 = 1;
              }
            }
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_5)) {
              PyObject *__pyx_temp[5] = {__pyx_t_4, __pyx_n_u_ColorDistance, __pyx_n_u_invarg, __pyx_v_c1, __pyx_v_c2};
              __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_11, 4+__pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 981, __pyx_L24_error)
              __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
              __Pyx_GOTREF(__pyx_t_6);
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
              PyObject *__pyx_temp[5] = {__pyx_t_4, __pyx_n_u_ColorDistance, __pyx_n_u_invarg, __pyx_v_c1, __pyx_v_c2};
              __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_11, 4+__pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 981, __pyx_L24_error)
              __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
              __Pyx_GOTREF(__pyx_t_6);
            } else
            #endif
            {
              __pyx_t_7 = PyTuple_New(4+__pyx_t_11); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 981, __pyx_L24_error)
              __Pyx_GOTREF(__pyx_t_7);
              if (__pyx_t_4) {
                __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL;
              }
              __Pyx_INCREF(__pyx_n_u_ColorDistance);
              __Pyx_GIVEREF(__pyx_n_u_ColorDistance);
              PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_11, __pyx_n_u_ColorDistance);
              __Pyx_INCREF(__pyx_n_u_invarg);
              __Pyx_GIVEREF(__pyx_n_u_invarg);
              PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_11, __pyx_n_u_invarg);
              __Pyx_INCREF(__pyx_v_c1);
              __Pyx_GIVEREF(__pyx_v_c1);
              PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_11, __pyx_v_c1);
              __Pyx_INCREF(__pyx_v_c2);
              __Pyx_GIVEREF(__pyx_v_c2);
              PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_11, __pyx_v_c2);
              __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 981, __pyx_L24_error)
              __Pyx_GOTREF(__pyx_t_6);
              __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            }
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

            /* "mathics/builtin/graphics.py":982
 *                     if len(c1.leaves) != len(c2.leaves):
 *                         evaluation.message("ColorDistance", "invarg", c1, c2)
 *                         return             # <<<<<<<<<<<<<<
 *                     else:
 *                         return Expression(
 */
            __Pyx_XDECREF(__pyx_r);
            __pyx_r = Py_None; __Pyx_INCREF(Py_None);
            goto __pyx_L28_try_return;

            /* "mathics/builtin/graphics.py":980
 *             if c1.get_head_name() == "System`List":
 *                 if c2.get_head_name() == "System`List":
 *                     if len(c1.leaves) != len(c2.leaves):             # <<<<<<<<<<<<<<
 *                         evaluation.message("ColorDistance", "invarg", c1, c2)
 *                         return
 */
          }

          /* "mathics/builtin/graphics.py":984
 *                         return
 *                     else:
 *                         return Expression(             # <<<<<<<<<<<<<<
 *                             "List",
 *                             *[distance(a, b) for a, b in zip(c1.leaves, c2.leaves)]
 */
          /*else*/ {
            __Pyx_XDECREF(__pyx_r);
            __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_Expression); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 984, __pyx_L24_error)
            __Pyx_GOTREF(__pyx_t_6);
            { /* enter inner scope */

              /* "mathics/builtin/graphics.py":986
 *                         return Expression(
 *                             "List",
 *                             *[distance(a, b) for a, b in zip(c1.leaves, c2.leaves)]             # <<<<<<<<<<<<<<
 *                         )
 *                 else:
 */
              __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 986, __pyx_L35_error)
              __Pyx_GOTREF(__pyx_t_5);
              __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_c1, __pyx_n_s_leaves); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 986, __pyx_L35_error)
              __Pyx_GOTREF(__pyx_t_7);
              __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_c2, __pyx_n_s_leaves); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 986, __pyx_L35_error)
              __Pyx_GOTREF(__pyx_t_4);
              __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 986, __pyx_L35_error)
              __Pyx_GOTREF(__pyx_t_10);
              __Pyx_GIVEREF(__pyx_t_7);
              PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_7);
              __Pyx_GIVEREF(__pyx_t_4);
              PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_4);
              __pyx_t_7 = 0;
              __pyx_t_4 = 0;
              __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 986, __pyx_L35_error)
              __Pyx_GOTREF(__pyx_t_4);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
              if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
                __pyx_t_10 = __pyx_t_4; __Pyx_INCREF(__pyx_t_10); __pyx_t_14 = 0;
                __pyx_t_15 = NULL;
              } else {
                __pyx_t_14 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 986, __pyx_L35_error)
                __Pyx_GOTREF(__pyx_t_10);
                __pyx_t_15 = Py_TYPE(__pyx_t_10)->tp_iternext; if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 986, __pyx_L35_error)
              }
              __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
              for (;;) {
                if (likely(!__pyx_t_15)) {
                  if (likely(PyList_CheckExact(__pyx_t_10))) {
                    if (__pyx_t_14 >= PyList_GET_SIZE(__pyx_t_10)) break;
                    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                    __pyx_t_4 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_14); __Pyx_INCREF(__pyx_t_4); __pyx_t_14++; if (unlikely(0 < 0)) __PYX_ERR(0, 986, __pyx_L35_error)
                    #else
                    __pyx_t_4 = PySequence_ITEM(__pyx_t_10, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 986, __pyx_L35_error)
                    __Pyx_GOTREF(__pyx_t_4);
                    #endif
                  } else {
                    if (__pyx_t_14 >= PyTuple_GET_SIZE(__pyx_t_10)) break;
                    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                    __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_14); __Pyx_INCREF(__pyx_t_4); __pyx_t_14++; if (unlikely(0 < 0)) __PYX_ERR(0, 986, __pyx_L35_error)
                    #else
                    __pyx_t_4 = PySequence_ITEM(__pyx_t_10, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 986, __pyx_L35_error)
                    __Pyx_GOTREF(__pyx_t_4);
                    #endif
                  }
                } else {
                  __pyx_t_4 = __pyx_t_15(__pyx_t_10);
                  if (unlikely(!__pyx_t_4)) {
                    PyObject* exc_type = PyErr_Occurred();
                    if (exc_type) {
                      if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                      else __PYX_ERR(0, 986, __pyx_L35_error)
                    }
                    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(0, 986, __pyx_L35_error)
                  }
                  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                  if (likely(PyTuple_CheckExact(sequence))) {
                    __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); 
                    __pyx_t_16 = PyTuple_GET_ITEM(sequence, 1); 
                  } else {
                    __pyx_t_7 = PyList_GET_ITEM(sequence, 0); 
                    __pyx_t_16 = PyList_GET_ITEM(sequence, 1); 
                  }
                  __Pyx_INCREF(__pyx_t_7);
                  __Pyx_INCREF(__pyx_t_16);
                  #else
                  __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 986, __pyx_L35_error)
                  __Pyx_GOTREF(__pyx_t_7);
                  __pyx_t_16 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 986, __pyx_L35_error)
                  __Pyx_GOTREF(__pyx_t_16);
                  #endif
                  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
                } else {
                  Py_ssize_t index = -1;
                  __pyx_t_17 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 986, __pyx_L35_error)
                  __Pyx_GOTREF(__pyx_t_17);
                  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
                  __pyx_t_18 = Py_TYPE(__pyx_t_17)->tp_iternext;
                  index = 0; __pyx_t_7 = __pyx_t_18(__pyx_t_17); if (unlikely(!__pyx_t_7)) goto __pyx_L38_unpacking_failed;
                  __Pyx_GOTREF(__pyx_t_7);
                  index = 1; __pyx_t_16 = __pyx_t_18(__pyx_t_17); if (unlikely(!__pyx_t_16)) goto __pyx_L38_unpacking_failed;
                  __Pyx_GOTREF(__pyx_t_16);
                  if (__Pyx_IternextUnpackEndCheck(__pyx_t_18(__pyx_t_17), 2) < 0) __PYX_ERR(0, 986, __pyx_L35_error)
                  __pyx_t_18 = NULL;
                  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
                  goto __pyx_L39_unpacking_done;
                  __pyx_L38_unpacking_failed:;
                  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
                  __pyx_t_18 = NULL;
                  if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
                  __PYX_ERR(0, 986, __pyx_L35_error)
                  __pyx_L39_unpacking_done:;
                }
                __Pyx_XDECREF_SET(__pyx_9genexpr11__pyx_v_a, __pyx_t_7);
                __pyx_t_7 = 0;
                __Pyx_XDECREF_SET(__pyx_9genexpr11__pyx_v_b, __pyx_t_16);
                __pyx_t_16 = 0;
                __pyx_t_4 = __pyx_pf_7mathics_7builtin_8graphics_13ColorDistance_5apply_2distance(__pyx_v_distance, __pyx_9genexpr11__pyx_v_a, __pyx_9genexpr11__pyx_v_b); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 986, __pyx_L35_error)
                __Pyx_GOTREF(__pyx_t_4);
                if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 986, __pyx_L35_error)
                __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
              }
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
              __Pyx_XDECREF(__pyx_9genexpr11__pyx_v_a); __pyx_9genexpr11__pyx_v_a = 0;
              __Pyx_XDECREF(__pyx_9genexpr11__pyx_v_b); __pyx_9genexpr11__pyx_v_b = 0;
              goto __pyx_L40_exit_scope;
              __pyx_L35_error:;
              __Pyx_XDECREF(__pyx_9genexpr11__pyx_v_a); __pyx_9genexpr11__pyx_v_a = 0;
              __Pyx_XDECREF(__pyx_9genexpr11__pyx_v_b); __pyx_9genexpr11__pyx_v_b = 0;
              goto __pyx_L24_error;
              __pyx_L40_exit_scope:;
            } /* exit inner scope */

            /* "mathics/builtin/graphics.py":984
 *                         return
 *                     else:
 *                         return Expression(             # <<<<<<<<<<<<<<
 *                             "List",
 *                             *[distance(a, b) for a, b in zip(c1.leaves, c2.leaves)]
 */
            __pyx_t_10 = PySequence_Tuple(__pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 984, __pyx_L24_error)
            __Pyx_GOTREF(__pyx_t_10);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            __pyx_t_5 = PyNumber_Add(__pyx_tuple__11, __pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 984, __pyx_L24_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 984, __pyx_L24_error)
            __Pyx_GOTREF(__pyx_t_10);
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            __pyx_r = __pyx_t_10;
            __pyx_t_10 = 0;
            goto __pyx_L28_try_return;
          }

          /* "mathics/builtin/graphics.py":979
 *         try:
 *             if c1.get_head_name() == "System`List":
 *                 if c2.get_head_name() == "System`List":             # <<<<<<<<<<<<<<
 *                     if len(c1.leaves) != len(c2.leaves):
 *                         evaluation.message("ColorDistance", "invarg", c1, c2)
 */
        }

        /* "mathics/builtin/graphics.py":989
 *                         )
 *                 else:
 *                     return Expression("List", *[distance(c, c2) for c in c1.leaves])             # <<<<<<<<<<<<<<
 *             elif c2.get_head_name() == "System`List":
 *                 return Expression("List", *[distance(c1, c) for c in c2.leaves])
 */
        /*else*/ {
          __Pyx_XDECREF(__pyx_r);
          __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_Expression); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 989, __pyx_L24_error)
          __Pyx_GOTREF(__pyx_t_10);
          { /* enter inner scope */
            __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 989, __pyx_L43_error)
            __Pyx_GOTREF(__pyx_t_5);
            __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_c1, __pyx_n_s_leaves); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 989, __pyx_L43_error)
            __Pyx_GOTREF(__pyx_t_6);
            if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) {
              __pyx_t_4 = __pyx_t_6; __Pyx_INCREF(__pyx_t_4); __pyx_t_14 = 0;
              __pyx_t_15 = NULL;
            } else {
              __pyx_t_14 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 989, __pyx_L43_error)
              __Pyx_GOTREF(__pyx_t_4);
              __pyx_t_15 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 989, __pyx_L43_error)
            }
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            for (;;) {
              if (likely(!__pyx_t_15)) {
                if (likely(PyList_CheckExact(__pyx_t_4))) {
                  if (__pyx_t_14 >= PyList_GET_SIZE(__pyx_t_4)) break;
                  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                  __pyx_t_6 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_14); __Pyx_INCREF(__pyx_t_6); __pyx_t_14++; if (unlikely(0 < 0)) __PYX_ERR(0, 989, __pyx_L43_error)
                  #else
                  __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 989, __pyx_L43_error)
                  __Pyx_GOTREF(__pyx_t_6);
                  #endif
                } else {
                  if (__pyx_t_14 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
                  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                  __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_14); __Pyx_INCREF(__pyx_t_6); __pyx_t_14++; if (unlikely(0 < 0)) __PYX_ERR(0, 989, __pyx_L43_error)
                  #else
                  __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 989, __pyx_L43_error)
                  __Pyx_GOTREF(__pyx_t_6);
                  #endif
                }
              } else {
                __pyx_t_6 = __pyx_t_15(__pyx_t_4);
                if (unlikely(!__pyx_t_6)) {
                  PyObject* exc_type = PyErr_Occurred();
                  if (exc_type) {
                    if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                    else __PYX_ERR(0, 989, __pyx_L43_error)
                  }
                  break;
                }
                __Pyx_GOTREF(__pyx_t_6);
              }
              __Pyx_XDECREF_SET(__pyx_9genexpr12__pyx_v_c, __pyx_t_6);
              __pyx_t_6 = 0;
              __pyx_t_6 = __pyx_pf_7mathics_7builtin_8graphics_13ColorDistance_5apply_2distance(__pyx_v_distance, __pyx_9genexpr12__pyx_v_c, __pyx_v_c2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 989, __pyx_L43_error)
              __Pyx_GOTREF(__pyx_t_6);
              if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 989, __pyx_L43_error)
              __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            }
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_XDECREF(__pyx_9genexpr12__pyx_v_c); __pyx_9genexpr12__pyx_v_c = 0;
            goto __pyx_L46_exit_scope;
            __pyx_L43_error:;
            __Pyx_XDECREF(__pyx_9genexpr12__pyx_v_c); __pyx_9genexpr12__pyx_v_c = 0;
            goto __pyx_L24_error;
            __pyx_L46_exit_scope:;
          } /* exit inner scope */
          __pyx_t_4 = PySequence_Tuple(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 989, __pyx_L24_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_t_5 = PyNumber_Add(__pyx_tuple__11, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 989, __pyx_L24_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 989, __pyx_L24_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_r = __pyx_t_4;
          __pyx_t_4 = 0;
          goto __pyx_L28_try_return;
        }

        /* "mathics/builtin/graphics.py":978
 * 
 *         try:
 *             if c1.get_head_name() == "System`List":             # <<<<<<<<<<<<<<
 *                 if c2.get_head_name() == "System`List":
 *                     if len(c1.leaves) != len(c2.leaves):
 */
      }

      /* "mathics/builtin/graphics.py":990
 *                 else:
 *                     return Expression("List", *[distance(c, c2) for c in c1.leaves])
 *             elif c2.get_head_name() == "System`List":             # <<<<<<<<<<<<<<
 *                 return Expression("List", *[distance(c1, c) for c in c2.leaves])
 *             else:
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_c2, __pyx_n_s_get_head_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 990, __pyx_L24_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_10 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_10)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_4 = (__pyx_t_10) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_10) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 990, __pyx_L24_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_kp_u_System_List, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 990, __pyx_L24_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_8) {

        /* "mathics/builtin/graphics.py":991
 *                     return Expression("List", *[distance(c, c2) for c in c1.leaves])
 *             elif c2.get_head_name() == "System`List":
 *                 return Expression("List", *[distance(c1, c) for c in c2.leaves])             # <<<<<<<<<<<<<<
 *             else:
 *                 return distance(c1, c2)
 */
        __Pyx_XDECREF(__pyx_r);
        __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Expression); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 991, __pyx_L24_error)
        __Pyx_GOTREF(__pyx_t_4);
        { /* enter inner scope */
          __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 991, __pyx_L49_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_c2, __pyx_n_s_leaves); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 991, __pyx_L49_error)
          __Pyx_GOTREF(__pyx_t_10);
          if (likely(PyList_CheckExact(__pyx_t_10)) || PyTuple_CheckExact(__pyx_t_10)) {
            __pyx_t_6 = __pyx_t_10; __Pyx_INCREF(__pyx_t_6); __pyx_t_14 = 0;
            __pyx_t_15 = NULL;
          } else {
            __pyx_t_14 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 991, __pyx_L49_error)
            __Pyx_GOTREF(__pyx_t_6);
            __pyx_t_15 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 991, __pyx_L49_error)
          }
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          for (;;) {
            if (likely(!__pyx_t_15)) {
              if (likely(PyList_CheckExact(__pyx_t_6))) {
                if (__pyx_t_14 >= PyList_GET_SIZE(__pyx_t_6)) break;
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                __pyx_t_10 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_14); __Pyx_INCREF(__pyx_t_10); __pyx_t_14++; if (unlikely(0 < 0)) __PYX_ERR(0, 991, __pyx_L49_error)
                #else
                __pyx_t_10 = PySequence_ITEM(__pyx_t_6, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 991, __pyx_L49_error)
                __Pyx_GOTREF(__pyx_t_10);
                #endif
              } else {
                if (__pyx_t_14 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_14); __Pyx_INCREF(__pyx_t_10); __pyx_t_14++; if (unlikely(0 < 0)) __PYX_ERR(0, 991, __pyx_L49_error)
                #else
                __pyx_t_10 = PySequence_ITEM(__pyx_t_6, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 991, __pyx_L49_error)
                __Pyx_GOTREF(__pyx_t_10);
                #endif
              }
            } else {
              __pyx_t_10 = __pyx_t_15(__pyx_t_6);
              if (unlikely(!__pyx_t_10)) {
                PyObject* exc_type = PyErr_Occurred();
                if (exc_type) {
                  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                  else __PYX_ERR(0, 991, __pyx_L49_error)
                }
                break;
              }
              __Pyx_GOTREF(__pyx_t_10);
            }
            __Pyx_XDECREF_SET(__pyx_9genexpr13__pyx_v_c, __pyx_t_10);
            __pyx_t_10 = 0;
            __pyx_t_10 = __pyx_pf_7mathics_7builtin_8graphics_13ColorDistance_5apply_2distance(__pyx_v_distance, __pyx_v_c1, __pyx_9genexpr13__pyx_v_c); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 991, __pyx_L49_error)
            __Pyx_GOTREF(__pyx_t_10);
            if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_10))) __PYX_ERR(0, 991, __pyx_L49_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          }
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_XDECREF(__pyx_9genexpr13__pyx_v_c); __pyx_9genexpr13__pyx_v_c = 0;
          goto __pyx_L52_exit_scope;
          __pyx_L49_error:;
          __Pyx_XDECREF(__pyx_9genexpr13__pyx_v_c); __pyx_9genexpr13__pyx_v_c = 0;
          goto __pyx_L24_error;
          __pyx_L52_exit_scope:;
        } /* exit inner scope */
        __pyx_t_6 = PySequence_Tuple(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 991, __pyx_L24_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = PyNumber_Add(__pyx_tuple__11, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 991, __pyx_L24_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 991, __pyx_L24_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_r = __pyx_t_6;
        __pyx_t_6 = 0;
        goto __pyx_L28_try_return;

        /* "mathics/builtin/graphics.py":990
 *                 else:
 *                     return Expression("List", *[distance(c, c2) for c in c1.leaves])
 *             elif c2.get_head_name() == "System`List":             # <<<<<<<<<<<<<<
 *                 return Expression("List", *[distance(c1, c) for c in c2.leaves])
 *             else:
 */
      }

      /* "mathics/builtin/graphics.py":993
 *                 return Expression("List", *[distance(c1, c) for c in c2.leaves])
 *             else:
 *                 return distance(c1, c2)             # <<<<<<<<<<<<<<
 *         except ColorError:
 *             return
 */
      /*else*/ {
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_6 = __pyx_pf_7mathics_7builtin_8graphics_13ColorDistance_5apply_2distance(__pyx_v_distance, __pyx_v_c1, __pyx_v_c2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 993, __pyx_L24_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_r = __pyx_t_6;
        __pyx_t_6 = 0;
        goto __pyx_L28_try_return;
      }

      /* "mathics/builtin/graphics.py":977
 *             return result
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             if c1.get_head_name() == "System`List":
 *                 if c2.get_head_name() == "System`List":
 */
    }
    __pyx_L24_error:;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
    __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "mathics/builtin/graphics.py":994
 *             else:
 *                 return distance(c1, c2)
 *         except ColorError:             # <<<<<<<<<<<<<<
 *             return
 *         except NotImplementedError:
 */
    __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4);
    __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_ColorError); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 994, __pyx_L26_except_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_11 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_6, __pyx_t_10);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_ErrRestore(__pyx_t_6, __pyx_t_5, __pyx_t_4);
    __pyx_t_6 = 0; __pyx_t_5 = 0; __pyx_t_4 = 0;
    if (__pyx_t_11) {
      __Pyx_AddTraceback("mathics.builtin.graphics.ColorDistance.apply", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6) < 0) __PYX_ERR(0, 994, __pyx_L26_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);

      /* "mathics/builtin/graphics.py":995
 *                 return distance(c1, c2)
 *         except ColorError:
 *             return             # <<<<<<<<<<<<<<
 *         except NotImplementedError:
 *             evaluation.message("ColorDistance", "invdist", distance_function)
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L27_except_return;
    }

    /* "mathics/builtin/graphics.py":996
 *         except ColorError:
 *             return
 *         except NotImplementedError:             # <<<<<<<<<<<<<<
 *             evaluation.message("ColorDistance", "invdist", distance_function)
 *             return
 */
    __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_NotImplementedError);
    if (__pyx_t_11) {
      __Pyx_AddTraceback("mathics.builtin.graphics.ColorDistance.apply", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) __PYX_ERR(0, 996, __pyx_L26_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_4);

      /* "mathics/builtin/graphics.py":997
 *             return
 *         except NotImplementedError:
 *             evaluation.message("ColorDistance", "invdist", distance_function)             # <<<<<<<<<<<<<<
 *             return
 * 
 */
      __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_evaluation, __pyx_n_s_message); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 997, __pyx_L26_except_error)
      __Pyx_GOTREF(__pyx_t_16);
      __pyx_t_7 = NULL;
      __pyx_t_11 = 0;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_16))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_16);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_16, function);
          __pyx_t_11 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_16)) {
        PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_n_u_ColorDistance, __pyx_n_u_invdist, __pyx_cur_scope->__pyx_v_distance_function};
        __pyx_t_10 = __Pyx_PyFunction_FastCall(__pyx_t_16, __pyx_temp+1-__pyx_t_11, 3+__pyx_t_11); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 997, __pyx_L26_except_error)
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_10);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_16)) {
        PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_n_u_ColorDistance, __pyx_n_u_invdist, __pyx_cur_scope->__pyx_v_distance_function};
        __pyx_t_10 = __Pyx_PyCFunction_FastCall(__pyx_t_16, __pyx_temp+1-__pyx_t_11, 3+__pyx_t_11); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 997, __pyx_L26_except_error)
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_10);
      } else
      #endif
      {
        __pyx_t_17 = PyTuple_New(3+__pyx_t_11); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 997, __pyx_L26_except_error)
        __Pyx_GOTREF(__pyx_t_17);
        if (__pyx_t_7) {
          __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_7); __pyx_t_7 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_ColorDistance);
        __Pyx_GIVEREF(__pyx_n_u_ColorDistance);
        PyTuple_SET_ITEM(__pyx_t_17, 0+__pyx_t_11, __pyx_n_u_ColorDistance);
        __Pyx_INCREF(__pyx_n_u_invdist);
        __Pyx_GIVEREF(__pyx_n_u_invdist);
        PyTuple_SET_ITEM(__pyx_t_17, 1+__pyx_t_11, __pyx_n_u_invdist);
        __Pyx_INCREF(__pyx_cur_scope->__pyx_v_distance_function);
        __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_distance_function);
        PyTuple_SET_ITEM(__pyx_t_17, 2+__pyx_t_11, __pyx_cur_scope->__pyx_v_distance_function);
        __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_16, __pyx_t_17, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 997, __pyx_L26_except_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      }
      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

      /* "mathics/builtin/graphics.py":998
 *         except NotImplementedError:
 *             evaluation.message("ColorDistance", "invdist", distance_function)
 *             return             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L27_except_return;
    }
    goto __pyx_L26_except_error;
    __pyx_L26_except_error:;

    /* "mathics/builtin/graphics.py":977
 *             return result
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             if c1.get_head_name() == "System`List":
 *                 if c2.get_head_name() == "System`List":
 */
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_2, __pyx_t_1);
    goto __pyx_L1_error;
    __pyx_L28_try_return:;
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_2, __pyx_t_1);
    goto __pyx_L0;
    __pyx_L27_except_return:;
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_2, __pyx_t_1);
    goto __pyx_L0;
  }

  /* "mathics/builtin/graphics.py":884
 *     }
 * 
 *     def apply(self, c1, c2, evaluation, options):             # <<<<<<<<<<<<<<
 *         "ColorDistance[c1_, c2_, OptionsPattern[ColorDistance]]"
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_AddTraceback("mathics.builtin.graphics.ColorDistance.apply", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_np);
  __Pyx_XDECREF(__pyx_v_distance);
  __Pyx_XDECREF(__pyx_9genexpr11__pyx_v_a);
  __Pyx_XDECREF(__pyx_9genexpr11__pyx_v_b);
  __Pyx_XDECREF(__pyx_9genexpr12__pyx_v_c);
  __Pyx_XDECREF(__pyx_9genexpr13__pyx_v_c);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":1002
 * 
 * class _Size(_GraphicsElement):
 *     def init(self, graphics, item=None, value=None):             # <<<<<<<<<<<<<<
 *         super(_Size, self).init(graphics, item)
 *         if item is not None:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_5_Size_1init(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_5_Size_1init = {"init", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_5_Size_1init, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_5_Size_1init(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_graphics = 0;
  PyObject *__pyx_v_item = 0;
  PyObject *__pyx_v_value = 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);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_graphics,&__pyx_n_s_item,&__pyx_n_s_value,0};
    PyObject* values[4] = {0,0,0,0};
    values[2] = ((PyObject *)((PyObject *)Py_None));
    values[3] = ((PyObject *)((PyObject *)Py_None));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_graphics)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("init", 0, 2, 4, 1); __PYX_ERR(0, 1002, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_item);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "init") < 0)) __PYX_ERR(0, 1002, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_graphics = values[1];
    __pyx_v_item = values[2];
    __pyx_v_value = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("init", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1002, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics._Size.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_5_Size_init(__pyx_self, __pyx_v_self, __pyx_v_graphics, __pyx_v_item, __pyx_v_value);

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_5_Size_init(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_graphics, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("init", 0);

  /* "mathics/builtin/graphics.py":1003
 * class _Size(_GraphicsElement):
 *     def init(self, graphics, item=None, value=None):
 *         super(_Size, self).init(graphics, item)             # <<<<<<<<<<<<<<
 *         if item is not None:
 *             self.value = item.leaves[0].round_to_float()
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1003, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1003, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_INCREF(__pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1003, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1003, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_graphics, __pyx_v_item};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1003, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_graphics, __pyx_v_item};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1003, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1003, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_2) {
      __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
    }
    __Pyx_INCREF(__pyx_v_graphics);
    __Pyx_GIVEREF(__pyx_v_graphics);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_graphics);
    __Pyx_INCREF(__pyx_v_item);
    __Pyx_GIVEREF(__pyx_v_item);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_item);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1003, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1004
 *     def init(self, graphics, item=None, value=None):
 *         super(_Size, self).init(graphics, item)
 *         if item is not None:             # <<<<<<<<<<<<<<
 *             self.value = item.leaves[0].round_to_float()
 *         elif value is not None:
 */
  __pyx_t_6 = (__pyx_v_item != Py_None);
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "mathics/builtin/graphics.py":1005
 *         super(_Size, self).init(graphics, item)
 *         if item is not None:
 *             self.value = item.leaves[0].round_to_float()             # <<<<<<<<<<<<<<
 *         elif value is not None:
 *             self.value = value
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_item, __pyx_n_s_leaves); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1005, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1005, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_round_to_float); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1005, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1005, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_value, __pyx_t_1) < 0) __PYX_ERR(0, 1005, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "mathics/builtin/graphics.py":1004
 *     def init(self, graphics, item=None, value=None):
 *         super(_Size, self).init(graphics, item)
 *         if item is not None:             # <<<<<<<<<<<<<<
 *             self.value = item.leaves[0].round_to_float()
 *         elif value is not None:
 */
    goto __pyx_L3;
  }

  /* "mathics/builtin/graphics.py":1006
 *         if item is not None:
 *             self.value = item.leaves[0].round_to_float()
 *         elif value is not None:             # <<<<<<<<<<<<<<
 *             self.value = value
 *         else:
 */
  __pyx_t_7 = (__pyx_v_value != Py_None);
  __pyx_t_6 = (__pyx_t_7 != 0);
  if (likely(__pyx_t_6)) {

    /* "mathics/builtin/graphics.py":1007
 *             self.value = item.leaves[0].round_to_float()
 *         elif value is not None:
 *             self.value = value             # <<<<<<<<<<<<<<
 *         else:
 *             raise BoxConstructError
 */
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_value, __pyx_v_value) < 0) __PYX_ERR(0, 1007, __pyx_L1_error)

    /* "mathics/builtin/graphics.py":1006
 *         if item is not None:
 *             self.value = item.leaves[0].round_to_float()
 *         elif value is not None:             # <<<<<<<<<<<<<<
 *             self.value = value
 *         else:
 */
    goto __pyx_L3;
  }

  /* "mathics/builtin/graphics.py":1009
 *             self.value = value
 *         else:
 *             raise BoxConstructError             # <<<<<<<<<<<<<<
 *         if self.value < 0:
 *             raise BoxConstructError
 */
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_BoxConstructError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1009, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 1009, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "mathics/builtin/graphics.py":1010
 *         else:
 *             raise BoxConstructError
 *         if self.value < 0:             # <<<<<<<<<<<<<<
 *             raise BoxConstructError
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1010, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1010, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 1010, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(__pyx_t_6)) {

    /* "mathics/builtin/graphics.py":1011
 *             raise BoxConstructError
 *         if self.value < 0:
 *             raise BoxConstructError             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_BoxConstructError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1011, __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(0, 1011, __pyx_L1_error)

    /* "mathics/builtin/graphics.py":1010
 *         else:
 *             raise BoxConstructError
 *         if self.value < 0:             # <<<<<<<<<<<<<<
 *             raise BoxConstructError
 * 
 */
  }

  /* "mathics/builtin/graphics.py":1002
 * 
 * class _Size(_GraphicsElement):
 *     def init(self, graphics, item=None, value=None):             # <<<<<<<<<<<<<<
 *         super(_Size, self).init(graphics, item)
 *         if item is not None:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("mathics.builtin.graphics._Size.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":1030
 *     """
 * 
 *     def get_thickness(self):             # <<<<<<<<<<<<<<
 *         return self.graphics.translate_absolute((self.value, 0))[0]
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_17AbsoluteThickness_1get_thickness(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_17AbsoluteThickness_1get_thickness = {"get_thickness", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_17AbsoluteThickness_1get_thickness, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_17AbsoluteThickness_1get_thickness(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_thickness (wrapper)", 0);
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_17AbsoluteThickness_get_thickness(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_17AbsoluteThickness_get_thickness(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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_thickness", 0);

  /* "mathics/builtin/graphics.py":1031
 * 
 *     def get_thickness(self):
 *         return self.graphics.translate_absolute((self.value, 0))[0]             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_graphics); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1031, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_translate_absolute); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1031, __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_n_s_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1031, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1031, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_0);
  __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1031, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1031, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":1030
 *     """
 * 
 *     def get_thickness(self):             # <<<<<<<<<<<<<<
 *         return self.graphics.translate_absolute((self.value, 0))[0]
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("mathics.builtin.graphics.AbsoluteThickness.get_thickness", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":1046
 *     """
 * 
 *     def get_thickness(self):             # <<<<<<<<<<<<<<
 *         return self.graphics.translate_relative(self.value)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_9Thickness_1get_thickness(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_9Thickness_1get_thickness = {"get_thickness", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_9Thickness_1get_thickness, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_9Thickness_1get_thickness(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_thickness (wrapper)", 0);
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_9Thickness_get_thickness(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_9Thickness_get_thickness(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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_thickness", 0);

  /* "mathics/builtin/graphics.py":1047
 * 
 *     def get_thickness(self):
 *         return self.graphics.translate_relative(self.value)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_graphics); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1047, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_translate_relative); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1047, __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_n_s_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1047, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1047, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":1046
 *     """
 * 
 *     def get_thickness(self):             # <<<<<<<<<<<<<<
 *         return self.graphics.translate_relative(self.value)
 * 
 */

  /* 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("mathics.builtin.graphics.Thickness.get_thickness", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":1084
 *     """
 * 
 *     def get_size(self):             # <<<<<<<<<<<<<<
 *         return self.graphics.view_width * self.value
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_9PointSize_1get_size(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_9PointSize_1get_size = {"get_size", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_9PointSize_1get_size, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_9PointSize_1get_size(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_size (wrapper)", 0);
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_9PointSize_get_size(__pyx_self, ((PyObject *)__pyx_v_self));

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

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

  /* "mathics/builtin/graphics.py":1085
 * 
 *     def get_size(self):
 *         return self.graphics.view_width * self.value             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_graphics); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1085, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_view_width); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1085, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1085, __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(0, 1085, __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_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":1084
 *     """
 * 
 *     def get_size(self):             # <<<<<<<<<<<<<<
 *         return self.graphics.view_width * self.value
 * 
 */

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

/* "mathics/builtin/graphics.py":1201
 * 
 * class RectangleBox(_GraphicsElement):
 *     def init(self, graphics, style, item):             # <<<<<<<<<<<<<<
 *         super(RectangleBox, self).init(graphics, item, style)
 *         if len(item.leaves) not in (1, 2):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_12RectangleBox_1init(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_12RectangleBox_1init = {"init", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_12RectangleBox_1init, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_12RectangleBox_1init(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_graphics = 0;
  PyObject *__pyx_v_style = 0;
  PyObject *__pyx_v_item = 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);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_graphics,&__pyx_n_s_style,&__pyx_n_s_item,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_graphics)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("init", 1, 4, 4, 1); __PYX_ERR(0, 1201, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_style)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("init", 1, 4, 4, 2); __PYX_ERR(0, 1201, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_item)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("init", 1, 4, 4, 3); __PYX_ERR(0, 1201, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "init") < 0)) __PYX_ERR(0, 1201, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __pyx_v_self = values[0];
    __pyx_v_graphics = values[1];
    __pyx_v_style = values[2];
    __pyx_v_item = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("init", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1201, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.RectangleBox.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_12RectangleBox_init(__pyx_self, __pyx_v_self, __pyx_v_graphics, __pyx_v_style, __pyx_v_item);

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_12RectangleBox_init(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_graphics, PyObject *__pyx_v_style, PyObject *__pyx_v_item) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  PyObject *__pyx_t_10 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("init", 0);

  /* "mathics/builtin/graphics.py":1202
 * class RectangleBox(_GraphicsElement):
 *     def init(self, graphics, style, item):
 *         super(RectangleBox, self).init(graphics, item, style)             # <<<<<<<<<<<<<<
 *         if len(item.leaves) not in (1, 2):
 *             raise BoxConstructError
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_RectangleBox); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1202, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1202, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_INCREF(__pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1202, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1202, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_v_graphics, __pyx_v_item, __pyx_v_style};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1202, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_v_graphics, __pyx_v_item, __pyx_v_style};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1202, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1202, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_2) {
      __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
    }
    __Pyx_INCREF(__pyx_v_graphics);
    __Pyx_GIVEREF(__pyx_v_graphics);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_graphics);
    __Pyx_INCREF(__pyx_v_item);
    __Pyx_GIVEREF(__pyx_v_item);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_item);
    __Pyx_INCREF(__pyx_v_style);
    __Pyx_GIVEREF(__pyx_v_style);
    PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_style);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1202, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1203
 *     def init(self, graphics, style, item):
 *         super(RectangleBox, self).init(graphics, item, style)
 *         if len(item.leaves) not in (1, 2):             # <<<<<<<<<<<<<<
 *             raise BoxConstructError
 *         self.edge_color, self.face_color = style.get_style(_Color, face_element=True)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_item, __pyx_n_s_leaves); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1203, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1203, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_8 = ((__pyx_t_6 != 1) != 0);
  if (__pyx_t_8) {
  } else {
    __pyx_t_7 = __pyx_t_8;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_8 = ((__pyx_t_6 != 2) != 0);
  __pyx_t_7 = __pyx_t_8;
  __pyx_L4_bool_binop_done:;
  __pyx_t_8 = (__pyx_t_7 != 0);
  if (unlikely(__pyx_t_8)) {

    /* "mathics/builtin/graphics.py":1204
 *         super(RectangleBox, self).init(graphics, item, style)
 *         if len(item.leaves) not in (1, 2):
 *             raise BoxConstructError             # <<<<<<<<<<<<<<
 *         self.edge_color, self.face_color = style.get_style(_Color, face_element=True)
 *         self.p1 = Coords(graphics, item.leaves[0])
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_BoxConstructError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1204, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 1204, __pyx_L1_error)

    /* "mathics/builtin/graphics.py":1203
 *     def init(self, graphics, style, item):
 *         super(RectangleBox, self).init(graphics, item, style)
 *         if len(item.leaves) not in (1, 2):             # <<<<<<<<<<<<<<
 *             raise BoxConstructError
 *         self.edge_color, self.face_color = style.get_style(_Color, face_element=True)
 */
  }

  /* "mathics/builtin/graphics.py":1205
 *         if len(item.leaves) not in (1, 2):
 *             raise BoxConstructError
 *         self.edge_color, self.face_color = style.get_style(_Color, face_element=True)             # <<<<<<<<<<<<<<
 *         self.p1 = Coords(graphics, item.leaves[0])
 *         if len(item.leaves) == 1:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_style, __pyx_n_s_get_style); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1205, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Color); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1205, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1205, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1205, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_face_element, Py_True) < 0) __PYX_ERR(0, 1205, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1205, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
    PyObject* sequence = __pyx_t_2;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 1205, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_5);
    #else
    __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1205, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1205, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    #endif
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1205, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_9 = Py_TYPE(__pyx_t_1)->tp_iternext;
    index = 0; __pyx_t_3 = __pyx_t_9(__pyx_t_1); if (unlikely(!__pyx_t_3)) goto __pyx_L6_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 1; __pyx_t_5 = __pyx_t_9(__pyx_t_1); if (unlikely(!__pyx_t_5)) goto __pyx_L6_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_1), 2) < 0) __PYX_ERR(0, 1205, __pyx_L1_error)
    __pyx_t_9 = NULL;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L7_unpacking_done;
    __pyx_L6_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_9 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 1205, __pyx_L1_error)
    __pyx_L7_unpacking_done:;
  }
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_edge_color, __pyx_t_3) < 0) __PYX_ERR(0, 1205, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_face_color, __pyx_t_5) < 0) __PYX_ERR(0, 1205, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":1206
 *             raise BoxConstructError
 *         self.edge_color, self.face_color = style.get_style(_Color, face_element=True)
 *         self.p1 = Coords(graphics, item.leaves[0])             # <<<<<<<<<<<<<<
 *         if len(item.leaves) == 1:
 *             self.p2 = self.p1.add(1, 1)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Coords); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1206, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_item, __pyx_n_s_leaves); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1206, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1206, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_5)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_graphics, __pyx_t_1};
    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1206, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_graphics, __pyx_t_1};
    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1206, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else
  #endif
  {
    __pyx_t_10 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1206, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(__pyx_v_graphics);
    __Pyx_GIVEREF(__pyx_v_graphics);
    PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_4, __pyx_v_graphics);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_4, __pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1206, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_p1, __pyx_t_2) < 0) __PYX_ERR(0, 1206, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":1207
 *         self.edge_color, self.face_color = style.get_style(_Color, face_element=True)
 *         self.p1 = Coords(graphics, item.leaves[0])
 *         if len(item.leaves) == 1:             # <<<<<<<<<<<<<<
 *             self.p2 = self.p1.add(1, 1)
 *         elif len(item.leaves) == 2:
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_item, __pyx_n_s_leaves); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1207, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_8 = ((__pyx_t_6 == 1) != 0);
  if (__pyx_t_8) {

    /* "mathics/builtin/graphics.py":1208
 *         self.p1 = Coords(graphics, item.leaves[0])
 *         if len(item.leaves) == 1:
 *             self.p2 = self.p1.add(1, 1)             # <<<<<<<<<<<<<<
 *         elif len(item.leaves) == 2:
 *             self.p2 = Coords(graphics, item.leaves[1])
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1208, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_add); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1208, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1208, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_p2, __pyx_t_2) < 0) __PYX_ERR(0, 1208, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "mathics/builtin/graphics.py":1207
 *         self.edge_color, self.face_color = style.get_style(_Color, face_element=True)
 *         self.p1 = Coords(graphics, item.leaves[0])
 *         if len(item.leaves) == 1:             # <<<<<<<<<<<<<<
 *             self.p2 = self.p1.add(1, 1)
 *         elif len(item.leaves) == 2:
 */
    goto __pyx_L8;
  }

  /* "mathics/builtin/graphics.py":1209
 *         if len(item.leaves) == 1:
 *             self.p2 = self.p1.add(1, 1)
 *         elif len(item.leaves) == 2:             # <<<<<<<<<<<<<<
 *             self.p2 = Coords(graphics, item.leaves[1])
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_item, __pyx_n_s_leaves); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1209, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1209, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_8 = ((__pyx_t_6 == 2) != 0);
  if (__pyx_t_8) {

    /* "mathics/builtin/graphics.py":1210
 *             self.p2 = self.p1.add(1, 1)
 *         elif len(item.leaves) == 2:
 *             self.p2 = Coords(graphics, item.leaves[1])             # <<<<<<<<<<<<<<
 * 
 *     def extent(self):
 */
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Coords); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1210, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_item, __pyx_n_s_leaves); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1210, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_10, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1210, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_10 = NULL;
    __pyx_t_4 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_10)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_4 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_v_graphics, __pyx_t_1};
      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1210, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_v_graphics, __pyx_t_1};
      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1210, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    } else
    #endif
    {
      __pyx_t_3 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1210, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (__pyx_t_10) {
        __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_10); __pyx_t_10 = NULL;
      }
      __Pyx_INCREF(__pyx_v_graphics);
      __Pyx_GIVEREF(__pyx_v_graphics);
      PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_4, __pyx_v_graphics);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_4, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1210, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_p2, __pyx_t_2) < 0) __PYX_ERR(0, 1210, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "mathics/builtin/graphics.py":1209
 *         if len(item.leaves) == 1:
 *             self.p2 = self.p1.add(1, 1)
 *         elif len(item.leaves) == 2:             # <<<<<<<<<<<<<<
 *             self.p2 = Coords(graphics, item.leaves[1])
 * 
 */
  }
  __pyx_L8:;

  /* "mathics/builtin/graphics.py":1201
 * 
 * class RectangleBox(_GraphicsElement):
 *     def init(self, graphics, style, item):             # <<<<<<<<<<<<<<
 *         super(RectangleBox, self).init(graphics, item, style)
 *         if len(item.leaves) not in (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_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("mathics.builtin.graphics.RectangleBox.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":1212
 *             self.p2 = Coords(graphics, item.leaves[1])
 * 
 *     def extent(self):             # <<<<<<<<<<<<<<
 *         l = self.style.get_line_width(face_element=True) / 2
 *         result = []
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_12RectangleBox_3extent(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_12RectangleBox_3extent = {"extent", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_12RectangleBox_3extent, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_12RectangleBox_3extent(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("extent (wrapper)", 0);
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_12RectangleBox_2extent(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_12RectangleBox_2extent(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_l = NULL;
  PyObject *__pyx_v_result = NULL;
  PyObject *__pyx_v_p = NULL;
  PyObject *__pyx_v_x = NULL;
  PyObject *__pyx_v_y = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *(*__pyx_t_7)(PyObject *);
  int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("extent", 0);

  /* "mathics/builtin/graphics.py":1213
 * 
 *     def extent(self):
 *         l = self.style.get_line_width(face_element=True) / 2             # <<<<<<<<<<<<<<
 *         result = []
 *         for p in [self.p1, self.p2]:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_style); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1213, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_get_line_width); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1213, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1213, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_face_element, Py_True) < 0) __PYX_ERR(0, 1213, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1213, __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_1 = __Pyx_PyInt_TrueDivideObjC(__pyx_t_3, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1213, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_l = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1214
 *     def extent(self):
 *         l = self.style.get_line_width(face_element=True) / 2
 *         result = []             # <<<<<<<<<<<<<<
 *         for p in [self.p1, self.p2]:
 *             x, y = p.pos()
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1214, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1215
 *         l = self.style.get_line_width(face_element=True) / 2
 *         result = []
 *         for p in [self.p1, self.p2]:             # <<<<<<<<<<<<<<
 *             x, y = p.pos()
 *             result.extend(
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1215, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1215, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1215, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
  __pyx_t_1 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (__pyx_t_4 >= 2) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 1215, __pyx_L1_error)
    #else
    __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1215, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_p, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "mathics/builtin/graphics.py":1216
 *         result = []
 *         for p in [self.p1, self.p2]:
 *             x, y = p.pos()             # <<<<<<<<<<<<<<
 *             result.extend(
 *                 [(x - l, y - l), (x - l, y + l), (x + l, y - l), (x + l, y + l)]
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_p, __pyx_n_s_pos); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1216, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1216, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
      PyObject* sequence = __pyx_t_2;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 1216, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_5);
      #else
      __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1216, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1216, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      #endif
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_6 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1216, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext;
      index = 0; __pyx_t_1 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_1);
      index = 1; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_5);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(0, 1216, __pyx_L1_error)
      __pyx_t_7 = NULL;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L6_unpacking_done;
      __pyx_L5_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 1216, __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;

    /* "mathics/builtin/graphics.py":1218
 *             x, y = p.pos()
 *             result.extend(
 *                 [(x - l, y - l), (x - l, y + l), (x + l, y - l), (x + l, y + l)]             # <<<<<<<<<<<<<<
 *             )
 *         return result
 */
    __pyx_t_2 = PyNumber_Subtract(__pyx_v_x, __pyx_v_l); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1218, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = PyNumber_Subtract(__pyx_v_y, __pyx_v_l); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1218, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1218, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5);
    __pyx_t_2 = 0;
    __pyx_t_5 = 0;

    /* "mathics/builtin/graphics.py":1217
 *         for p in [self.p1, self.p2]:
 *             x, y = p.pos()
 *             result.extend(             # <<<<<<<<<<<<<<
 *                 [(x - l, y - l), (x - l, y + l), (x + l, y - l), (x + l, y + l)]
 *             )
 */
    __pyx_t_8 = __Pyx_ListComp_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 1217, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "mathics/builtin/graphics.py":1218
 *             x, y = p.pos()
 *             result.extend(
 *                 [(x - l, y - l), (x - l, y + l), (x + l, y - l), (x + l, y + l)]             # <<<<<<<<<<<<<<
 *             )
 *         return result
 */
    __pyx_t_1 = PyNumber_Subtract(__pyx_v_x, __pyx_v_l); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1218, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyNumber_Add(__pyx_v_y, __pyx_v_l); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1218, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1218, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5);
    __pyx_t_1 = 0;
    __pyx_t_5 = 0;

    /* "mathics/builtin/graphics.py":1217
 *         for p in [self.p1, self.p2]:
 *             x, y = p.pos()
 *             result.extend(             # <<<<<<<<<<<<<<
 *                 [(x - l, y - l), (x - l, y + l), (x + l, y - l), (x + l, y + l)]
 *             )
 */
    __pyx_t_9 = __Pyx_ListComp_Append(__pyx_v_result, __pyx_t_2); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 1217, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "mathics/builtin/graphics.py":1218
 *             x, y = p.pos()
 *             result.extend(
 *                 [(x - l, y - l), (x - l, y + l), (x + l, y - l), (x + l, y + l)]             # <<<<<<<<<<<<<<
 *             )
 *         return result
 */
    __pyx_t_2 = PyNumber_Add(__pyx_v_x, __pyx_v_l); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1218, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = PyNumber_Subtract(__pyx_v_y, __pyx_v_l); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1218, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1218, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5);
    __pyx_t_2 = 0;
    __pyx_t_5 = 0;

    /* "mathics/builtin/graphics.py":1217
 *         for p in [self.p1, self.p2]:
 *             x, y = p.pos()
 *             result.extend(             # <<<<<<<<<<<<<<
 *                 [(x - l, y - l), (x - l, y + l), (x + l, y - l), (x + l, y + l)]
 *             )
 */
    __pyx_t_10 = __Pyx_ListComp_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 1217, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "mathics/builtin/graphics.py":1218
 *             x, y = p.pos()
 *             result.extend(
 *                 [(x - l, y - l), (x - l, y + l), (x + l, y - l), (x + l, y + l)]             # <<<<<<<<<<<<<<
 *             )
 *         return result
 */
    __pyx_t_1 = PyNumber_Add(__pyx_v_x, __pyx_v_l); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1218, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyNumber_Add(__pyx_v_y, __pyx_v_l); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1218, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1218, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5);
    __pyx_t_1 = 0;
    __pyx_t_5 = 0;

    /* "mathics/builtin/graphics.py":1217
 *         for p in [self.p1, self.p2]:
 *             x, y = p.pos()
 *             result.extend(             # <<<<<<<<<<<<<<
 *                 [(x - l, y - l), (x - l, y + l), (x + l, y - l), (x + l, y + l)]
 *             )
 */
    __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_2); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 1217, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    (void)((__pyx_t_8 | (__pyx_t_9 | (__pyx_t_10 | __pyx_t_11))));

    /* "mathics/builtin/graphics.py":1215
 *         l = self.style.get_line_width(face_element=True) / 2
 *         result = []
 *         for p in [self.p1, self.p2]:             # <<<<<<<<<<<<<<
 *             x, y = p.pos()
 *             result.extend(
 */
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":1220
 *                 [(x - l, y - l), (x - l, y + l), (x + l, y - l), (x + l, y + l)]
 *             )
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     def to_svg(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":1212
 *             self.p2 = Coords(graphics, item.leaves[1])
 * 
 *     def extent(self):             # <<<<<<<<<<<<<<
 *         l = self.style.get_line_width(face_element=True) / 2
 *         result = []
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("mathics.builtin.graphics.RectangleBox.extent", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_l);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_p);
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XDECREF(__pyx_v_y);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":1222
 *         return result
 * 
 *     def to_svg(self):             # <<<<<<<<<<<<<<
 *         l = self.style.get_line_width(face_element=True)
 *         x1, y1 = self.p1.pos()
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_12RectangleBox_5to_svg(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_12RectangleBox_5to_svg = {"to_svg", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_12RectangleBox_5to_svg, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_12RectangleBox_5to_svg(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_svg (wrapper)", 0);
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_12RectangleBox_4to_svg(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_12RectangleBox_4to_svg(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_l = NULL;
  PyObject *__pyx_v_x1 = NULL;
  PyObject *__pyx_v_y1 = NULL;
  PyObject *__pyx_v_x2 = NULL;
  PyObject *__pyx_v_y2 = NULL;
  PyObject *__pyx_v_xmin = NULL;
  PyObject *__pyx_v_ymin = NULL;
  PyObject *__pyx_v_w = NULL;
  PyObject *__pyx_v_h = NULL;
  PyObject *__pyx_v_style = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *(*__pyx_t_5)(PyObject *);
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  Py_ssize_t __pyx_t_10;
  Py_UCS4 __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_svg", 0);

  /* "mathics/builtin/graphics.py":1223
 * 
 *     def to_svg(self):
 *         l = self.style.get_line_width(face_element=True)             # <<<<<<<<<<<<<<
 *         x1, y1 = self.p1.pos()
 *         x2, y2 = self.p2.pos()
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_style); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1223, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_get_line_width); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1223, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1223, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_face_element, Py_True) < 0) __PYX_ERR(0, 1223, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1223, __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_v_l = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":1224
 *     def to_svg(self):
 *         l = self.style.get_line_width(face_element=True)
 *         x1, y1 = self.p1.pos()             # <<<<<<<<<<<<<<
 *         x2, y2 = self.p2.pos()
 *         xmin = min(x1, x2)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_pos); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
    PyObject* sequence = __pyx_t_3;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 1224, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_1);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1224, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1224, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    #endif
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1224, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 1; __pyx_t_1 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) __PYX_ERR(0, 1224, __pyx_L1_error)
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 1224, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  __pyx_v_x1 = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_v_y1 = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1225
 *         l = self.style.get_line_width(face_element=True)
 *         x1, y1 = self.p1.pos()
 *         x2, y2 = self.p2.pos()             # <<<<<<<<<<<<<<
 *         xmin = min(x1, x2)
 *         ymin = min(y1, y2)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1225, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_pos); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1225, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1225, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
    PyObject* sequence = __pyx_t_3;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 1225, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_1);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1225, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1225, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    #endif
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1225, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 1; __pyx_t_1 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) __PYX_ERR(0, 1225, __pyx_L1_error)
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L6_unpacking_done;
    __pyx_L5_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 1225, __pyx_L1_error)
    __pyx_L6_unpacking_done:;
  }
  __pyx_v_x2 = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_v_y2 = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1226
 *         x1, y1 = self.p1.pos()
 *         x2, y2 = self.p2.pos()
 *         xmin = min(x1, x2)             # <<<<<<<<<<<<<<
 *         ymin = min(y1, y2)
 *         w = max(x1, x2) - xmin
 */
  __Pyx_INCREF(__pyx_v_x2);
  __pyx_t_3 = __pyx_v_x2;
  __Pyx_INCREF(__pyx_v_x1);
  __pyx_t_1 = __pyx_v_x1;
  __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1226, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 1226, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_6) {
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_2 = __pyx_t_3;
  } else {
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_2 = __pyx_t_1;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __pyx_t_2;
  __Pyx_INCREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_xmin = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":1227
 *         x2, y2 = self.p2.pos()
 *         xmin = min(x1, x2)
 *         ymin = min(y1, y2)             # <<<<<<<<<<<<<<
 *         w = max(x1, x2) - xmin
 *         h = max(y1, y2) - ymin
 */
  __Pyx_INCREF(__pyx_v_y2);
  __pyx_t_3 = __pyx_v_y2;
  __Pyx_INCREF(__pyx_v_y1);
  __pyx_t_2 = __pyx_v_y1;
  __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1227, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 1227, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_6) {
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_1 = __pyx_t_3;
  } else {
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_1 = __pyx_t_2;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __pyx_t_1;
  __Pyx_INCREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_ymin = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":1228
 *         xmin = min(x1, x2)
 *         ymin = min(y1, y2)
 *         w = max(x1, x2) - xmin             # <<<<<<<<<<<<<<
 *         h = max(y1, y2) - ymin
 *         style = create_css(self.edge_color, self.face_color, l)
 */
  __Pyx_INCREF(__pyx_v_x2);
  __pyx_t_3 = __pyx_v_x2;
  __Pyx_INCREF(__pyx_v_x1);
  __pyx_t_1 = __pyx_v_x1;
  __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1228, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 1228, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_6) {
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_2 = __pyx_t_3;
  } else {
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_2 = __pyx_t_1;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Subtract(__pyx_t_2, __pyx_v_xmin); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_w = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":1229
 *         ymin = min(y1, y2)
 *         w = max(x1, x2) - xmin
 *         h = max(y1, y2) - ymin             # <<<<<<<<<<<<<<
 *         style = create_css(self.edge_color, self.face_color, l)
 *         return '<rect x="%f" y="%f" width="%f" height="%f" style="%s" />' % (
 */
  __Pyx_INCREF(__pyx_v_y2);
  __pyx_t_3 = __pyx_v_y2;
  __Pyx_INCREF(__pyx_v_y1);
  __pyx_t_2 = __pyx_v_y1;
  __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1229, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 1229, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_6) {
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_1 = __pyx_t_3;
  } else {
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_1 = __pyx_t_2;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_v_ymin); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1229, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_h = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":1230
 *         w = max(x1, x2) - xmin
 *         h = max(y1, y2) - ymin
 *         style = create_css(self.edge_color, self.face_color, l)             # <<<<<<<<<<<<<<
 *         return '<rect x="%f" y="%f" width="%f" height="%f" style="%s" />' % (
 *             xmin,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_create_css); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_edge_color); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_face_color); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = NULL;
  __pyx_t_8 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
      __pyx_t_8 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_1)) {
    PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_t_2, __pyx_t_4, __pyx_v_l};
    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1230, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
    PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_t_2, __pyx_t_4, __pyx_v_l};
    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1230, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else
  #endif
  {
    __pyx_t_9 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1230, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    if (__pyx_t_7) {
      __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_4);
    __Pyx_INCREF(__pyx_v_l);
    __Pyx_GIVEREF(__pyx_v_l);
    PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_v_l);
    __pyx_t_2 = 0;
    __pyx_t_4 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1230, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_style = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":1231
 *         h = max(y1, y2) - ymin
 *         style = create_css(self.edge_color, self.face_color, l)
 *         return '<rect x="%f" y="%f" width="%f" height="%f" style="%s" />' % (             # <<<<<<<<<<<<<<
 *             xmin,
 *             ymin,
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = PyTuple_New(11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_10 = 0;
  __pyx_t_11 = 127;
  __Pyx_INCREF(__pyx_kp_u_rect_x);
  __pyx_t_10 += 9;
  __Pyx_GIVEREF(__pyx_kp_u_rect_x);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_rect_x);

  /* "mathics/builtin/graphics.py":1232
 *         style = create_css(self.edge_color, self.face_color, l)
 *         return '<rect x="%f" y="%f" width="%f" height="%f" style="%s" />' % (
 *             xmin,             # <<<<<<<<<<<<<<
 *             ymin,
 *             w,
 */
  __pyx_t_1 = __Pyx_PyObject_Format(__pyx_v_xmin, __pyx_n_u_f); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1232, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_11 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_11) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_11;
  __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
  __pyx_t_1 = 0;
  __Pyx_INCREF(__pyx_kp_u_y_2);
  __pyx_t_10 += 5;
  __Pyx_GIVEREF(__pyx_kp_u_y_2);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u_y_2);

  /* "mathics/builtin/graphics.py":1233
 *         return '<rect x="%f" y="%f" width="%f" height="%f" style="%s" />' % (
 *             xmin,
 *             ymin,             # <<<<<<<<<<<<<<
 *             w,
 *             h,
 */
  __pyx_t_1 = __Pyx_PyObject_Format(__pyx_v_ymin, __pyx_n_u_f); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_11 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_11) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_11;
  __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_1);
  __pyx_t_1 = 0;
  __Pyx_INCREF(__pyx_kp_u_width);
  __pyx_t_10 += 9;
  __Pyx_GIVEREF(__pyx_kp_u_width);
  PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_kp_u_width);

  /* "mathics/builtin/graphics.py":1234
 *             xmin,
 *             ymin,
 *             w,             # <<<<<<<<<<<<<<
 *             h,
 *             style,
 */
  __pyx_t_1 = __Pyx_PyObject_Format(__pyx_v_w, __pyx_n_u_f); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1234, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_11 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_11) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_11;
  __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_t_1);
  __pyx_t_1 = 0;
  __Pyx_INCREF(__pyx_kp_u_height);
  __pyx_t_10 += 10;
  __Pyx_GIVEREF(__pyx_kp_u_height);
  PyTuple_SET_ITEM(__pyx_t_3, 6, __pyx_kp_u_height);

  /* "mathics/builtin/graphics.py":1235
 *             ymin,
 *             w,
 *             h,             # <<<<<<<<<<<<<<
 *             style,
 *         )
 */
  __pyx_t_1 = __Pyx_PyObject_Format(__pyx_v_h, __pyx_n_u_f); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1235, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_11 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_11) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_11;
  __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 7, __pyx_t_1);
  __pyx_t_1 = 0;
  __Pyx_INCREF(__pyx_kp_u_style_2);
  __pyx_t_10 += 9;
  __Pyx_GIVEREF(__pyx_kp_u_style_2);
  PyTuple_SET_ITEM(__pyx_t_3, 8, __pyx_kp_u_style_2);

  /* "mathics/builtin/graphics.py":1236
 *             w,
 *             h,
 *             style,             # <<<<<<<<<<<<<<
 *         )
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_style), __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1236, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_11 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_11) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_11;
  __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 9, __pyx_t_1);
  __pyx_t_1 = 0;
  __Pyx_INCREF(__pyx_kp_u__30);
  __pyx_t_10 += 4;
  __Pyx_GIVEREF(__pyx_kp_u__30);
  PyTuple_SET_ITEM(__pyx_t_3, 10, __pyx_kp_u__30);

  /* "mathics/builtin/graphics.py":1231
 *         h = max(y1, y2) - ymin
 *         style = create_css(self.edge_color, self.face_color, l)
 *         return '<rect x="%f" y="%f" width="%f" height="%f" style="%s" />' % (             # <<<<<<<<<<<<<<
 *             xmin,
 *             ymin,
 */
  __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_3, 11, __pyx_t_10, __pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":1222
 *         return result
 * 
 *     def to_svg(self):             # <<<<<<<<<<<<<<
 *         l = self.style.get_line_width(face_element=True)
 *         x1, y1 = self.p1.pos()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("mathics.builtin.graphics.RectangleBox.to_svg", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_l);
  __Pyx_XDECREF(__pyx_v_x1);
  __Pyx_XDECREF(__pyx_v_y1);
  __Pyx_XDECREF(__pyx_v_x2);
  __Pyx_XDECREF(__pyx_v_y2);
  __Pyx_XDECREF(__pyx_v_xmin);
  __Pyx_XDECREF(__pyx_v_ymin);
  __Pyx_XDECREF(__pyx_v_w);
  __Pyx_XDECREF(__pyx_v_h);
  __Pyx_XDECREF(__pyx_v_style);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":1239
 *         )
 * 
 *     def to_asy(self):             # <<<<<<<<<<<<<<
 *         l = self.style.get_line_width(face_element=True)
 *         x1, y1 = self.p1.pos()
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_12RectangleBox_7to_asy(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_12RectangleBox_7to_asy = {"to_asy", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_12RectangleBox_7to_asy, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_12RectangleBox_7to_asy(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_asy (wrapper)", 0);
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_12RectangleBox_6to_asy(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_12RectangleBox_6to_asy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_l = NULL;
  PyObject *__pyx_v_x1 = NULL;
  PyObject *__pyx_v_y1 = NULL;
  PyObject *__pyx_v_x2 = NULL;
  PyObject *__pyx_v_y2 = NULL;
  PyObject *__pyx_v_pens = 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 *);
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  Py_UCS4 __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_asy", 0);

  /* "mathics/builtin/graphics.py":1240
 * 
 *     def to_asy(self):
 *         l = self.style.get_line_width(face_element=True)             # <<<<<<<<<<<<<<
 *         x1, y1 = self.p1.pos()
 *         x2, y2 = self.p2.pos()
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_style); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1240, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_get_line_width); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1240, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1240, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_face_element, Py_True) < 0) __PYX_ERR(0, 1240, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1240, __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_v_l = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":1241
 *     def to_asy(self):
 *         l = self.style.get_line_width(face_element=True)
 *         x1, y1 = self.p1.pos()             # <<<<<<<<<<<<<<
 *         x2, y2 = self.p2.pos()
 *         pens = create_pens(self.edge_color, self.face_color, l, is_face_element=True)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_pos); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
    PyObject* sequence = __pyx_t_3;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 1241, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_1);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1241, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1241, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    #endif
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1241, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 1; __pyx_t_1 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) __PYX_ERR(0, 1241, __pyx_L1_error)
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 1241, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  __pyx_v_x1 = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_v_y1 = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1242
 *         l = self.style.get_line_width(face_element=True)
 *         x1, y1 = self.p1.pos()
 *         x2, y2 = self.p2.pos()             # <<<<<<<<<<<<<<
 *         pens = create_pens(self.edge_color, self.face_color, l, is_face_element=True)
 *         x1, x2, y1, y2 = asy_number(x1), asy_number(x2), asy_number(y1), asy_number(y2)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1242, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_pos); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1242, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1242, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
    PyObject* sequence = __pyx_t_3;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 1242, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_1);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1242, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1242, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    #endif
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1242, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 1; __pyx_t_1 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) __PYX_ERR(0, 1242, __pyx_L1_error)
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L6_unpacking_done;
    __pyx_L5_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 1242, __pyx_L1_error)
    __pyx_L6_unpacking_done:;
  }
  __pyx_v_x2 = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_v_y2 = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1243
 *         x1, y1 = self.p1.pos()
 *         x2, y2 = self.p2.pos()
 *         pens = create_pens(self.edge_color, self.face_color, l, is_face_element=True)             # <<<<<<<<<<<<<<
 *         x1, x2, y1, y2 = asy_number(x1), asy_number(x2), asy_number(y1), asy_number(y2)
 *         return "filldraw((%s,%s)--(%s,%s)--(%s,%s)--(%s,%s)--cycle, %s);" % (
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_create_pens); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1243, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_edge_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1243, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_face_color); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1243, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1243, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
  __Pyx_INCREF(__pyx_v_l);
  __Pyx_GIVEREF(__pyx_v_l);
  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_l);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1243, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_is_face_element, Py_True) < 0) __PYX_ERR(0, 1243, __pyx_L1_error)
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1243, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_pens = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1244
 *         x2, y2 = self.p2.pos()
 *         pens = create_pens(self.edge_color, self.face_color, l, is_face_element=True)
 *         x1, x2, y1, y2 = asy_number(x1), asy_number(x2), asy_number(y1), asy_number(y2)             # <<<<<<<<<<<<<<
 *         return "filldraw((%s,%s)--(%s,%s)--(%s,%s)--(%s,%s)--cycle, %s);" % (
 *             x1,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_asy_number); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1244, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v_x1) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_x1);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1244, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_asy_number); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1244, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_v_x2) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_x2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1244, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_asy_number); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1244, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_6, __pyx_v_y1) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_y1);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1244, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_asy_number); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1244, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_v_y2) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_y2);
  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1244, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF_SET(__pyx_v_x1, __pyx_t_1);
  __pyx_t_1 = 0;
  __Pyx_DECREF_SET(__pyx_v_x2, __pyx_t_2);
  __pyx_t_2 = 0;
  __Pyx_DECREF_SET(__pyx_v_y1, __pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_DECREF_SET(__pyx_v_y2, __pyx_t_3);
  __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":1245
 *         pens = create_pens(self.edge_color, self.face_color, l, is_face_element=True)
 *         x1, x2, y1, y2 = asy_number(x1), asy_number(x2), asy_number(y1), asy_number(y2)
 *         return "filldraw((%s,%s)--(%s,%s)--(%s,%s)--(%s,%s)--cycle, %s);" % (             # <<<<<<<<<<<<<<
 *             x1,
 *             y1,
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = PyTuple_New(19); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1245, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_8 = 0;
  __pyx_t_9 = 127;
  __Pyx_INCREF(__pyx_kp_u_filldraw);
  __pyx_t_8 += 10;
  __Pyx_GIVEREF(__pyx_kp_u_filldraw);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_filldraw);

  /* "mathics/builtin/graphics.py":1246
 *         x1, x2, y1, y2 = asy_number(x1), asy_number(x2), asy_number(y1), asy_number(y2)
 *         return "filldraw((%s,%s)--(%s,%s)--(%s,%s)--(%s,%s)--cycle, %s);" % (
 *             x1,             # <<<<<<<<<<<<<<
 *             y1,
 *             x2,
 */
  __pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_x1), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1246, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_9;
  __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_kp_u__31);
  __pyx_t_8 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__31);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u__31);

  /* "mathics/builtin/graphics.py":1247
 *         return "filldraw((%s,%s)--(%s,%s)--(%s,%s)--(%s,%s)--cycle, %s);" % (
 *             x1,
 *             y1,             # <<<<<<<<<<<<<<
 *             x2,
 *             y1,
 */
  __pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_y1), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1247, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_9;
  __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_kp_u__32);
  __pyx_t_8 += 4;
  __Pyx_GIVEREF(__pyx_kp_u__32);
  PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_kp_u__32);

  /* "mathics/builtin/graphics.py":1248
 *             x1,
 *             y1,
 *             x2,             # <<<<<<<<<<<<<<
 *             y1,
 *             x2,
 */
  __pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_x2), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1248, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_9;
  __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_kp_u__31);
  __pyx_t_8 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__31);
  PyTuple_SET_ITEM(__pyx_t_3, 6, __pyx_kp_u__31);

  /* "mathics/builtin/graphics.py":1249
 *             y1,
 *             x2,
 *             y1,             # <<<<<<<<<<<<<<
 *             x2,
 *             y2,
 */
  __pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_y1), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1249, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_9;
  __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_3, 7, __pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_kp_u__32);
  __pyx_t_8 += 4;
  __Pyx_GIVEREF(__pyx_kp_u__32);
  PyTuple_SET_ITEM(__pyx_t_3, 8, __pyx_kp_u__32);

  /* "mathics/builtin/graphics.py":1250
 *             x2,
 *             y1,
 *             x2,             # <<<<<<<<<<<<<<
 *             y2,
 *             x1,
 */
  __pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_x2), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1250, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_9;
  __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_3, 9, __pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_kp_u__31);
  __pyx_t_8 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__31);
  PyTuple_SET_ITEM(__pyx_t_3, 10, __pyx_kp_u__31);

  /* "mathics/builtin/graphics.py":1251
 *             y1,
 *             x2,
 *             y2,             # <<<<<<<<<<<<<<
 *             x1,
 *             y2,
 */
  __pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_y2), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1251, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_9;
  __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_3, 11, __pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_kp_u__32);
  __pyx_t_8 += 4;
  __Pyx_GIVEREF(__pyx_kp_u__32);
  PyTuple_SET_ITEM(__pyx_t_3, 12, __pyx_kp_u__32);

  /* "mathics/builtin/graphics.py":1252
 *             x2,
 *             y2,
 *             x1,             # <<<<<<<<<<<<<<
 *             y2,
 *             pens,
 */
  __pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_x1), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1252, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_9;
  __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_3, 13, __pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_kp_u__31);
  __pyx_t_8 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__31);
  PyTuple_SET_ITEM(__pyx_t_3, 14, __pyx_kp_u__31);

  /* "mathics/builtin/graphics.py":1253
 *             y2,
 *             x1,
 *             y2,             # <<<<<<<<<<<<<<
 *             pens,
 *         )
 */
  __pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_y2), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1253, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_9;
  __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_3, 15, __pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_kp_u_cycle);
  __pyx_t_8 += 10;
  __Pyx_GIVEREF(__pyx_kp_u_cycle);
  PyTuple_SET_ITEM(__pyx_t_3, 16, __pyx_kp_u_cycle);

  /* "mathics/builtin/graphics.py":1254
 *             x1,
 *             y2,
 *             pens,             # <<<<<<<<<<<<<<
 *         )
 * 
 */
  __pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_pens), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1254, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_9;
  __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_3, 17, __pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_kp_u__33);
  __pyx_t_8 += 2;
  __Pyx_GIVEREF(__pyx_kp_u__33);
  PyTuple_SET_ITEM(__pyx_t_3, 18, __pyx_kp_u__33);

  /* "mathics/builtin/graphics.py":1245
 *         pens = create_pens(self.edge_color, self.face_color, l, is_face_element=True)
 *         x1, x2, y1, y2 = asy_number(x1), asy_number(x2), asy_number(y1), asy_number(y2)
 *         return "filldraw((%s,%s)--(%s,%s)--(%s,%s)--(%s,%s)--cycle, %s);" % (             # <<<<<<<<<<<<<<
 *             x1,
 *             y1,
 */
  __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_3, 19, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1245, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":1239
 *         )
 * 
 *     def to_asy(self):             # <<<<<<<<<<<<<<
 *         l = self.style.get_line_width(face_element=True)
 *         x1, y1 = self.p1.pos()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("mathics.builtin.graphics.RectangleBox.to_asy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_l);
  __Pyx_XDECREF(__pyx_v_x1);
  __Pyx_XDECREF(__pyx_v_y1);
  __Pyx_XDECREF(__pyx_v_x2);
  __Pyx_XDECREF(__pyx_v_y2);
  __Pyx_XDECREF(__pyx_v_pens);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":1261
 *     face_element = None
 * 
 *     def init(self, graphics, style, item):             # <<<<<<<<<<<<<<
 *         super(_RoundBox, self).init(graphics, item, style)
 *         if len(item.leaves) not in (1, 2):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_9_RoundBox_1init(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_9_RoundBox_1init = {"init", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_9_RoundBox_1init, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_9_RoundBox_1init(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_graphics = 0;
  PyObject *__pyx_v_style = 0;
  PyObject *__pyx_v_item = 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);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_graphics,&__pyx_n_s_style,&__pyx_n_s_item,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_graphics)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("init", 1, 4, 4, 1); __PYX_ERR(0, 1261, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_style)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("init", 1, 4, 4, 2); __PYX_ERR(0, 1261, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_item)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("init", 1, 4, 4, 3); __PYX_ERR(0, 1261, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "init") < 0)) __PYX_ERR(0, 1261, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __pyx_v_self = values[0];
    __pyx_v_graphics = values[1];
    __pyx_v_style = values[2];
    __pyx_v_item = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("init", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1261, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics._RoundBox.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_9_RoundBox_init(__pyx_self, __pyx_v_self, __pyx_v_graphics, __pyx_v_style, __pyx_v_item);

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_9_RoundBox_init(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_graphics, PyObject *__pyx_v_style, PyObject *__pyx_v_item) {
  PyObject *__pyx_v_rx = NULL;
  PyObject *__pyx_v_ry = NULL;
  PyObject *__pyx_v_r = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  PyObject *__pyx_t_10 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("init", 0);

  /* "mathics/builtin/graphics.py":1262
 * 
 *     def init(self, graphics, style, item):
 *         super(_RoundBox, self).init(graphics, item, style)             # <<<<<<<<<<<<<<
 *         if len(item.leaves) not in (1, 2):
 *             raise BoxConstructError
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_RoundBox); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1262, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1262, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_INCREF(__pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1262, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1262, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_v_graphics, __pyx_v_item, __pyx_v_style};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1262, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_v_graphics, __pyx_v_item, __pyx_v_style};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1262, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1262, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_2) {
      __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
    }
    __Pyx_INCREF(__pyx_v_graphics);
    __Pyx_GIVEREF(__pyx_v_graphics);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_graphics);
    __Pyx_INCREF(__pyx_v_item);
    __Pyx_GIVEREF(__pyx_v_item);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_item);
    __Pyx_INCREF(__pyx_v_style);
    __Pyx_GIVEREF(__pyx_v_style);
    PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_style);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1262, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1263
 *     def init(self, graphics, style, item):
 *         super(_RoundBox, self).init(graphics, item, style)
 *         if len(item.leaves) not in (1, 2):             # <<<<<<<<<<<<<<
 *             raise BoxConstructError
 *         self.edge_color, self.face_color = style.get_style(
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_item, __pyx_n_s_leaves); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1263, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1263, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_8 = ((__pyx_t_6 != 1) != 0);
  if (__pyx_t_8) {
  } else {
    __pyx_t_7 = __pyx_t_8;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_8 = ((__pyx_t_6 != 2) != 0);
  __pyx_t_7 = __pyx_t_8;
  __pyx_L4_bool_binop_done:;
  __pyx_t_8 = (__pyx_t_7 != 0);
  if (unlikely(__pyx_t_8)) {

    /* "mathics/builtin/graphics.py":1264
 *         super(_RoundBox, self).init(graphics, item, style)
 *         if len(item.leaves) not in (1, 2):
 *             raise BoxConstructError             # <<<<<<<<<<<<<<
 *         self.edge_color, self.face_color = style.get_style(
 *             _Color, face_element=self.face_element
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_BoxConstructError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1264, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 1264, __pyx_L1_error)

    /* "mathics/builtin/graphics.py":1263
 *     def init(self, graphics, style, item):
 *         super(_RoundBox, self).init(graphics, item, style)
 *         if len(item.leaves) not in (1, 2):             # <<<<<<<<<<<<<<
 *             raise BoxConstructError
 *         self.edge_color, self.face_color = style.get_style(
 */
  }

  /* "mathics/builtin/graphics.py":1265
 *         if len(item.leaves) not in (1, 2):
 *             raise BoxConstructError
 *         self.edge_color, self.face_color = style.get_style(             # <<<<<<<<<<<<<<
 *             _Color, face_element=self.face_element
 *         )
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_style, __pyx_n_s_get_style); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "mathics/builtin/graphics.py":1266
 *             raise BoxConstructError
 *         self.edge_color, self.face_color = style.get_style(
 *             _Color, face_element=self.face_element             # <<<<<<<<<<<<<<
 *         )
 *         self.c = Coords(graphics, item.leaves[0])
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Color); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1266, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "mathics/builtin/graphics.py":1265
 *         if len(item.leaves) not in (1, 2):
 *             raise BoxConstructError
 *         self.edge_color, self.face_color = style.get_style(             # <<<<<<<<<<<<<<
 *             _Color, face_element=self.face_element
 *         )
 */
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
  __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":1266
 *             raise BoxConstructError
 *         self.edge_color, self.face_color = style.get_style(
 *             _Color, face_element=self.face_element             # <<<<<<<<<<<<<<
 *         )
 *         self.c = Coords(graphics, item.leaves[0])
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1266, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_face_element); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1266, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_face_element, __pyx_t_2) < 0) __PYX_ERR(0, 1266, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":1265
 *         if len(item.leaves) not in (1, 2):
 *             raise BoxConstructError
 *         self.edge_color, self.face_color = style.get_style(             # <<<<<<<<<<<<<<
 *             _Color, face_element=self.face_element
 *         )
 */
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
    PyObject* sequence = __pyx_t_2;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 1265, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_5);
    #else
    __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1265, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1265, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    #endif
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1265, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_9 = Py_TYPE(__pyx_t_1)->tp_iternext;
    index = 0; __pyx_t_3 = __pyx_t_9(__pyx_t_1); if (unlikely(!__pyx_t_3)) goto __pyx_L6_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 1; __pyx_t_5 = __pyx_t_9(__pyx_t_1); if (unlikely(!__pyx_t_5)) goto __pyx_L6_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_1), 2) < 0) __PYX_ERR(0, 1265, __pyx_L1_error)
    __pyx_t_9 = NULL;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L7_unpacking_done;
    __pyx_L6_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_9 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 1265, __pyx_L1_error)
    __pyx_L7_unpacking_done:;
  }
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_edge_color, __pyx_t_3) < 0) __PYX_ERR(0, 1265, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_face_color, __pyx_t_5) < 0) __PYX_ERR(0, 1265, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":1268
 *             _Color, face_element=self.face_element
 *         )
 *         self.c = Coords(graphics, item.leaves[0])             # <<<<<<<<<<<<<<
 *         if len(item.leaves) == 1:
 *             rx = ry = 1
 */
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Coords); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1268, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_item, __pyx_n_s_leaves); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1268, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1268, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_5)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_graphics, __pyx_t_1};
    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1268, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_graphics, __pyx_t_1};
    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1268, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else
  #endif
  {
    __pyx_t_10 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1268, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(__pyx_v_graphics);
    __Pyx_GIVEREF(__pyx_v_graphics);
    PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_4, __pyx_v_graphics);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_4, __pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1268, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_c, __pyx_t_2) < 0) __PYX_ERR(0, 1268, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":1269
 *         )
 *         self.c = Coords(graphics, item.leaves[0])
 *         if len(item.leaves) == 1:             # <<<<<<<<<<<<<<
 *             rx = ry = 1
 *         elif len(item.leaves) == 2:
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_item, __pyx_n_s_leaves); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1269, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1269, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_8 = ((__pyx_t_6 == 1) != 0);
  if (__pyx_t_8) {

    /* "mathics/builtin/graphics.py":1270
 *         self.c = Coords(graphics, item.leaves[0])
 *         if len(item.leaves) == 1:
 *             rx = ry = 1             # <<<<<<<<<<<<<<
 *         elif len(item.leaves) == 2:
 *             r = item.leaves[1]
 */
    __Pyx_INCREF(__pyx_int_1);
    __pyx_v_rx = __pyx_int_1;
    __Pyx_INCREF(__pyx_int_1);
    __pyx_v_ry = __pyx_int_1;

    /* "mathics/builtin/graphics.py":1269
 *         )
 *         self.c = Coords(graphics, item.leaves[0])
 *         if len(item.leaves) == 1:             # <<<<<<<<<<<<<<
 *             rx = ry = 1
 *         elif len(item.leaves) == 2:
 */
    goto __pyx_L8;
  }

  /* "mathics/builtin/graphics.py":1271
 *         if len(item.leaves) == 1:
 *             rx = ry = 1
 *         elif len(item.leaves) == 2:             # <<<<<<<<<<<<<<
 *             r = item.leaves[1]
 *             if r.has_form("List", 2):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_item, __pyx_n_s_leaves); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1271, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1271, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_8 = ((__pyx_t_6 == 2) != 0);
  if (__pyx_t_8) {

    /* "mathics/builtin/graphics.py":1272
 *             rx = ry = 1
 *         elif len(item.leaves) == 2:
 *             r = item.leaves[1]             # <<<<<<<<<<<<<<
 *             if r.has_form("List", 2):
 *                 rx = r.leaves[0].round_to_float()
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_item, __pyx_n_s_leaves); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1272, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1272, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_r = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "mathics/builtin/graphics.py":1273
 *         elif len(item.leaves) == 2:
 *             r = item.leaves[1]
 *             if r.has_form("List", 2):             # <<<<<<<<<<<<<<
 *                 rx = r.leaves[0].round_to_float()
 *                 ry = r.leaves[1].round_to_float()
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_has_form); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1273, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1273, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 1273, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_8) {

      /* "mathics/builtin/graphics.py":1274
 *             r = item.leaves[1]
 *             if r.has_form("List", 2):
 *                 rx = r.leaves[0].round_to_float()             # <<<<<<<<<<<<<<
 *                 ry = r.leaves[1].round_to_float()
 *             else:
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_leaves); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1274, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_10 = __Pyx_GetItemInt(__pyx_t_5, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1274, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_round_to_float); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1274, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_10)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_2 = (__pyx_t_10) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_10) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1274, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_rx = __pyx_t_2;
      __pyx_t_2 = 0;

      /* "mathics/builtin/graphics.py":1275
 *             if r.has_form("List", 2):
 *                 rx = r.leaves[0].round_to_float()
 *                 ry = r.leaves[1].round_to_float()             # <<<<<<<<<<<<<<
 *             else:
 *                 rx = ry = r.round_to_float()
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_leaves); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1275, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_10 = __Pyx_GetItemInt(__pyx_t_5, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1275, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_round_to_float); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1275, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_10)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_2 = (__pyx_t_10) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_10) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1275, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_ry = __pyx_t_2;
      __pyx_t_2 = 0;

      /* "mathics/builtin/graphics.py":1273
 *         elif len(item.leaves) == 2:
 *             r = item.leaves[1]
 *             if r.has_form("List", 2):             # <<<<<<<<<<<<<<
 *                 rx = r.leaves[0].round_to_float()
 *                 ry = r.leaves[1].round_to_float()
 */
      goto __pyx_L9;
    }

    /* "mathics/builtin/graphics.py":1277
 *                 ry = r.leaves[1].round_to_float()
 *             else:
 *                 rx = ry = r.round_to_float()             # <<<<<<<<<<<<<<
 *         self.r = self.c.add(rx, ry)
 * 
 */
    /*else*/ {
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_round_to_float); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1277, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_10 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_10)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_2 = (__pyx_t_10) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_10) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1277, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_INCREF(__pyx_t_2);
      __pyx_v_rx = __pyx_t_2;
      __Pyx_INCREF(__pyx_t_2);
      __pyx_v_ry = __pyx_t_2;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __pyx_L9:;

    /* "mathics/builtin/graphics.py":1271
 *         if len(item.leaves) == 1:
 *             rx = ry = 1
 *         elif len(item.leaves) == 2:             # <<<<<<<<<<<<<<
 *             r = item.leaves[1]
 *             if r.has_form("List", 2):
 */
  }
  __pyx_L8:;

  /* "mathics/builtin/graphics.py":1278
 *             else:
 *                 rx = ry = r.round_to_float()
 *         self.r = self.c.add(rx, ry)             # <<<<<<<<<<<<<<
 * 
 *     def extent(self):
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_c); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1278, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_add); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1278, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_v_rx)) { __Pyx_RaiseUnboundLocalError("rx"); __PYX_ERR(0, 1278, __pyx_L1_error) }
  if (unlikely(!__pyx_v_ry)) { __Pyx_RaiseUnboundLocalError("ry"); __PYX_ERR(0, 1278, __pyx_L1_error) }
  __pyx_t_5 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_10);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_10, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_10)) {
    PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_rx, __pyx_v_ry};
    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1278, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) {
    PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_rx, __pyx_v_ry};
    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1278, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else
  #endif
  {
    __pyx_t_1 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1278, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (__pyx_t_5) {
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); __pyx_t_5 = NULL;
    }
    __Pyx_INCREF(__pyx_v_rx);
    __Pyx_GIVEREF(__pyx_v_rx);
    PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_4, __pyx_v_rx);
    __Pyx_INCREF(__pyx_v_ry);
    __Pyx_GIVEREF(__pyx_v_ry);
    PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_4, __pyx_v_ry);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1278, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_r, __pyx_t_2) < 0) __PYX_ERR(0, 1278, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":1261
 *     face_element = None
 * 
 *     def init(self, graphics, style, item):             # <<<<<<<<<<<<<<
 *         super(_RoundBox, self).init(graphics, item, style)
 *         if len(item.leaves) not in (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_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("mathics.builtin.graphics._RoundBox.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_rx);
  __Pyx_XDECREF(__pyx_v_ry);
  __Pyx_XDECREF(__pyx_v_r);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":1280
 *         self.r = self.c.add(rx, ry)
 * 
 *     def extent(self):             # <<<<<<<<<<<<<<
 *         l = self.style.get_line_width(face_element=self.face_element) / 2
 *         x, y = self.c.pos()
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_9_RoundBox_3extent(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_9_RoundBox_3extent = {"extent", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_9_RoundBox_3extent, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_9_RoundBox_3extent(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("extent (wrapper)", 0);
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_9_RoundBox_2extent(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_9_RoundBox_2extent(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_l = NULL;
  PyObject *__pyx_v_x = NULL;
  PyObject *__pyx_v_y = NULL;
  PyObject *__pyx_v_rx = NULL;
  PyObject *__pyx_v_ry = 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 *);
  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("extent", 0);

  /* "mathics/builtin/graphics.py":1281
 * 
 *     def extent(self):
 *         l = self.style.get_line_width(face_element=self.face_element) / 2             # <<<<<<<<<<<<<<
 *         x, y = self.c.pos()
 *         rx, ry = self.r.pos()
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_style); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1281, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_get_line_width); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1281, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1281, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_face_element); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1281, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_face_element, __pyx_t_3) < 0) __PYX_ERR(0, 1281, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1281, __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_1 = __Pyx_PyInt_TrueDivideObjC(__pyx_t_3, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1281, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_l = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1282
 *     def extent(self):
 *         l = self.style.get_line_width(face_element=self.face_element) / 2
 *         x, y = self.c.pos()             # <<<<<<<<<<<<<<
 *         rx, ry = self.r.pos()
 *         rx -= x
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_c); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1282, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_pos); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1282, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1282, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
    PyObject* sequence = __pyx_t_1;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 1282, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_3);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1282, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1282, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1282, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) __PYX_ERR(0, 1282, __pyx_L1_error)
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 1282, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  __pyx_v_x = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_v_y = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":1283
 *         l = self.style.get_line_width(face_element=self.face_element) / 2
 *         x, y = self.c.pos()
 *         rx, ry = self.r.pos()             # <<<<<<<<<<<<<<
 *         rx -= x
 *         ry = y - ry
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1283, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_pos); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1283, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1283, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
    PyObject* sequence = __pyx_t_1;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 1283, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_3);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1283, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1283, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1283, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) __PYX_ERR(0, 1283, __pyx_L1_error)
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L6_unpacking_done;
    __pyx_L5_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 1283, __pyx_L1_error)
    __pyx_L6_unpacking_done:;
  }
  __pyx_v_rx = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_v_ry = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":1284
 *         x, y = self.c.pos()
 *         rx, ry = self.r.pos()
 *         rx -= x             # <<<<<<<<<<<<<<
 *         ry = y - ry
 *         rx += l
 */
  __pyx_t_1 = PyNumber_InPlaceSubtract(__pyx_v_rx, __pyx_v_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1284, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_rx, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1285
 *         rx, ry = self.r.pos()
 *         rx -= x
 *         ry = y - ry             # <<<<<<<<<<<<<<
 *         rx += l
 *         ry += l
 */
  __pyx_t_1 = PyNumber_Subtract(__pyx_v_y, __pyx_v_ry); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1285, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_ry, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1286
 *         rx -= x
 *         ry = y - ry
 *         rx += l             # <<<<<<<<<<<<<<
 *         ry += l
 *         return [(x - rx, y - ry), (x - rx, y + ry), (x + rx, y - ry), (x + rx, y + ry)]
 */
  __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_rx, __pyx_v_l); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1286, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_rx, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1287
 *         ry = y - ry
 *         rx += l
 *         ry += l             # <<<<<<<<<<<<<<
 *         return [(x - rx, y - ry), (x - rx, y + ry), (x + rx, y - ry), (x + rx, y + ry)]
 * 
 */
  __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_ry, __pyx_v_l); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1287, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_ry, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1288
 *         rx += l
 *         ry += l
 *         return [(x - rx, y - ry), (x - rx, y + ry), (x + rx, y - ry), (x + rx, y + ry)]             # <<<<<<<<<<<<<<
 * 
 *     def to_svg(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyNumber_Subtract(__pyx_v_x, __pyx_v_rx); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1288, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyNumber_Subtract(__pyx_v_y, __pyx_v_ry); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1288, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1288, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
  __pyx_t_1 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Subtract(__pyx_v_x, __pyx_v_rx); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1288, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyNumber_Add(__pyx_v_y, __pyx_v_ry); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1288, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1288, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
  __pyx_t_3 = 0;
  __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_Add(__pyx_v_x, __pyx_v_rx); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1288, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyNumber_Subtract(__pyx_v_y, __pyx_v_ry); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1288, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1288, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3);
  __pyx_t_1 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Add(__pyx_v_x, __pyx_v_rx); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1288, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyNumber_Add(__pyx_v_y, __pyx_v_ry); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1288, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1288, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_1);
  __pyx_t_3 = 0;
  __pyx_t_1 = 0;
  __pyx_t_1 = PyList_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1288, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_4);
  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_6);
  PyList_SET_ITEM(__pyx_t_1, 2, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_7);
  PyList_SET_ITEM(__pyx_t_1, 3, __pyx_t_7);
  __pyx_t_2 = 0;
  __pyx_t_4 = 0;
  __pyx_t_6 = 0;
  __pyx_t_7 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":1280
 *         self.r = self.c.add(rx, ry)
 * 
 *     def extent(self):             # <<<<<<<<<<<<<<
 *         l = self.style.get_line_width(face_element=self.face_element) / 2
 *         x, y = self.c.pos()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("mathics.builtin.graphics._RoundBox.extent", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_l);
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XDECREF(__pyx_v_y);
  __Pyx_XDECREF(__pyx_v_rx);
  __Pyx_XDECREF(__pyx_v_ry);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":1290
 *         return [(x - rx, y - ry), (x - rx, y + ry), (x + rx, y - ry), (x + rx, y + ry)]
 * 
 *     def to_svg(self):             # <<<<<<<<<<<<<<
 *         x, y = self.c.pos()
 *         rx, ry = self.r.pos()
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_9_RoundBox_5to_svg(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_9_RoundBox_5to_svg = {"to_svg", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_9_RoundBox_5to_svg, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_9_RoundBox_5to_svg(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_svg (wrapper)", 0);
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_9_RoundBox_4to_svg(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_9_RoundBox_4to_svg(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_x = NULL;
  PyObject *__pyx_v_y = NULL;
  PyObject *__pyx_v_rx = NULL;
  PyObject *__pyx_v_ry = NULL;
  PyObject *__pyx_v_l = NULL;
  PyObject *__pyx_v_style = 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 *);
  Py_ssize_t __pyx_t_6;
  Py_UCS4 __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_svg", 0);

  /* "mathics/builtin/graphics.py":1291
 * 
 *     def to_svg(self):
 *         x, y = self.c.pos()             # <<<<<<<<<<<<<<
 *         rx, ry = self.r.pos()
 *         rx -= x
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_c); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pos); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
    PyObject* sequence = __pyx_t_1;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 1291, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    #else
    __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1291, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1291, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1291, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 1; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) __PYX_ERR(0, 1291, __pyx_L1_error)
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 1291, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  __pyx_v_x = __pyx_t_3;
  __pyx_t_3 = 0;
  __pyx_v_y = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":1292
 *     def to_svg(self):
 *         x, y = self.c.pos()
 *         rx, ry = self.r.pos()             # <<<<<<<<<<<<<<
 *         rx -= x
 *         ry = y - ry
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1292, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pos); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1292, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1292, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
    PyObject* sequence = __pyx_t_1;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 1292, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    #else
    __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1292, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1292, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1292, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 1; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) __PYX_ERR(0, 1292, __pyx_L1_error)
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L6_unpacking_done;
    __pyx_L5_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 1292, __pyx_L1_error)
    __pyx_L6_unpacking_done:;
  }
  __pyx_v_rx = __pyx_t_3;
  __pyx_t_3 = 0;
  __pyx_v_ry = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":1293
 *         x, y = self.c.pos()
 *         rx, ry = self.r.pos()
 *         rx -= x             # <<<<<<<<<<<<<<
 *         ry = y - ry
 *         l = self.style.get_line_width(face_element=self.face_element)
 */
  __pyx_t_1 = PyNumber_InPlaceSubtract(__pyx_v_rx, __pyx_v_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1293, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_rx, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1294
 *         rx, ry = self.r.pos()
 *         rx -= x
 *         ry = y - ry             # <<<<<<<<<<<<<<
 *         l = self.style.get_line_width(face_element=self.face_element)
 *         style = create_css(self.edge_color, self.face_color, stroke_width=l)
 */
  __pyx_t_1 = PyNumber_Subtract(__pyx_v_y, __pyx_v_ry); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1294, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_ry, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1295
 *         rx -= x
 *         ry = y - ry
 *         l = self.style.get_line_width(face_element=self.face_element)             # <<<<<<<<<<<<<<
 *         style = create_css(self.edge_color, self.face_color, stroke_width=l)
 *         return '<ellipse cx="%f" cy="%f" rx="%f" ry="%f" style="%s" />' % (
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_style); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_get_line_width); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_face_element); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_face_element, __pyx_t_3) < 0) __PYX_ERR(0, 1295, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1295, __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_v_l = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":1296
 *         ry = y - ry
 *         l = self.style.get_line_width(face_element=self.face_element)
 *         style = create_css(self.edge_color, self.face_color, stroke_width=l)             # <<<<<<<<<<<<<<
 *         return '<ellipse cx="%f" cy="%f" rx="%f" ry="%f" style="%s" />' % (
 *             x,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_create_css); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_edge_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_face_color); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_stroke_width, __pyx_v_l) < 0) __PYX_ERR(0, 1296, __pyx_L1_error)
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_style = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1297
 *         l = self.style.get_line_width(face_element=self.face_element)
 *         style = create_css(self.edge_color, self.face_color, stroke_width=l)
 *         return '<ellipse cx="%f" cy="%f" rx="%f" ry="%f" style="%s" />' % (             # <<<<<<<<<<<<<<
 *             x,
 *             y,
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1297, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = 0;
  __pyx_t_7 = 127;
  __Pyx_INCREF(__pyx_kp_u_ellipse_cx);
  __pyx_t_6 += 13;
  __Pyx_GIVEREF(__pyx_kp_u_ellipse_cx);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_ellipse_cx);

  /* "mathics/builtin/graphics.py":1298
 *         style = create_css(self.edge_color, self.face_color, stroke_width=l)
 *         return '<ellipse cx="%f" cy="%f" rx="%f" ry="%f" style="%s" />' % (
 *             x,             # <<<<<<<<<<<<<<
 *             y,
 *             rx,
 */
  __pyx_t_2 = __Pyx_PyObject_Format(__pyx_v_x, __pyx_n_u_f); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_7;
  __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
  __pyx_t_2 = 0;
  __Pyx_INCREF(__pyx_kp_u_cy);
  __pyx_t_6 += 6;
  __Pyx_GIVEREF(__pyx_kp_u_cy);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_cy);

  /* "mathics/builtin/graphics.py":1299
 *         return '<ellipse cx="%f" cy="%f" rx="%f" ry="%f" style="%s" />' % (
 *             x,
 *             y,             # <<<<<<<<<<<<<<
 *             rx,
 *             ry,
 */
  __pyx_t_2 = __Pyx_PyObject_Format(__pyx_v_y, __pyx_n_u_f); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1299, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_7;
  __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_2);
  __pyx_t_2 = 0;
  __Pyx_INCREF(__pyx_kp_u_rx);
  __pyx_t_6 += 6;
  __Pyx_GIVEREF(__pyx_kp_u_rx);
  PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u_rx);

  /* "mathics/builtin/graphics.py":1300
 *             x,
 *             y,
 *             rx,             # <<<<<<<<<<<<<<
 *             ry,
 *             style,
 */
  __pyx_t_2 = __Pyx_PyObject_Format(__pyx_v_rx, __pyx_n_u_f); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1300, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_7;
  __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_t_2);
  __pyx_t_2 = 0;
  __Pyx_INCREF(__pyx_kp_u_ry);
  __pyx_t_6 += 6;
  __Pyx_GIVEREF(__pyx_kp_u_ry);
  PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_kp_u_ry);

  /* "mathics/builtin/graphics.py":1301
 *             y,
 *             rx,
 *             ry,             # <<<<<<<<<<<<<<
 *             style,
 *         )
 */
  __pyx_t_2 = __Pyx_PyObject_Format(__pyx_v_ry, __pyx_n_u_f); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1301, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_7;
  __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 7, __pyx_t_2);
  __pyx_t_2 = 0;
  __Pyx_INCREF(__pyx_kp_u_style_2);
  __pyx_t_6 += 9;
  __Pyx_GIVEREF(__pyx_kp_u_style_2);
  PyTuple_SET_ITEM(__pyx_t_1, 8, __pyx_kp_u_style_2);

  /* "mathics/builtin/graphics.py":1302
 *             rx,
 *             ry,
 *             style,             # <<<<<<<<<<<<<<
 *         )
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_style), __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1302, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_7;
  __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 9, __pyx_t_2);
  __pyx_t_2 = 0;
  __Pyx_INCREF(__pyx_kp_u__30);
  __pyx_t_6 += 4;
  __Pyx_GIVEREF(__pyx_kp_u__30);
  PyTuple_SET_ITEM(__pyx_t_1, 10, __pyx_kp_u__30);

  /* "mathics/builtin/graphics.py":1297
 *         l = self.style.get_line_width(face_element=self.face_element)
 *         style = create_css(self.edge_color, self.face_color, stroke_width=l)
 *         return '<ellipse cx="%f" cy="%f" rx="%f" ry="%f" style="%s" />' % (             # <<<<<<<<<<<<<<
 *             x,
 *             y,
 */
  __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_1, 11, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1297, __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;

  /* "mathics/builtin/graphics.py":1290
 *         return [(x - rx, y - ry), (x - rx, y + ry), (x + rx, y - ry), (x + rx, y + ry)]
 * 
 *     def to_svg(self):             # <<<<<<<<<<<<<<
 *         x, y = self.c.pos()
 *         rx, ry = self.r.pos()
 */

  /* 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("mathics.builtin.graphics._RoundBox.to_svg", __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_rx);
  __Pyx_XDECREF(__pyx_v_ry);
  __Pyx_XDECREF(__pyx_v_l);
  __Pyx_XDECREF(__pyx_v_style);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":1305
 *         )
 * 
 *     def to_asy(self):             # <<<<<<<<<<<<<<
 *         x, y = self.c.pos()
 *         rx, ry = self.r.pos()
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_9_RoundBox_7to_asy(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_9_RoundBox_7to_asy = {"to_asy", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_9_RoundBox_7to_asy, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_9_RoundBox_7to_asy(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_asy (wrapper)", 0);
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_9_RoundBox_6to_asy(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_9_RoundBox_6to_asy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_x = NULL;
  PyObject *__pyx_v_y = NULL;
  PyObject *__pyx_v_rx = NULL;
  PyObject *__pyx_v_ry = NULL;
  PyObject *__pyx_v_l = NULL;
  PyObject *__pyx_v_pen = NULL;
  PyObject *__pyx_v_cmd = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *(*__pyx_t_5)(PyObject *);
  int __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  Py_UCS4 __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_asy", 0);

  /* "mathics/builtin/graphics.py":1306
 * 
 *     def to_asy(self):
 *         x, y = self.c.pos()             # <<<<<<<<<<<<<<
 *         rx, ry = self.r.pos()
 *         rx -= x
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_c); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1306, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pos); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1306, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1306, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
    PyObject* sequence = __pyx_t_1;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 1306, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    #else
    __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1306, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1306, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1306, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 1; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) __PYX_ERR(0, 1306, __pyx_L1_error)
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 1306, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  __pyx_v_x = __pyx_t_3;
  __pyx_t_3 = 0;
  __pyx_v_y = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":1307
 *     def to_asy(self):
 *         x, y = self.c.pos()
 *         rx, ry = self.r.pos()             # <<<<<<<<<<<<<<
 *         rx -= x
 *         ry -= y
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1307, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pos); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1307, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1307, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
    PyObject* sequence = __pyx_t_1;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 1307, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    #else
    __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1307, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1307, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1307, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 1; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) __PYX_ERR(0, 1307, __pyx_L1_error)
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L6_unpacking_done;
    __pyx_L5_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 1307, __pyx_L1_error)
    __pyx_L6_unpacking_done:;
  }
  __pyx_v_rx = __pyx_t_3;
  __pyx_t_3 = 0;
  __pyx_v_ry = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":1308
 *         x, y = self.c.pos()
 *         rx, ry = self.r.pos()
 *         rx -= x             # <<<<<<<<<<<<<<
 *         ry -= y
 *         l = self.style.get_line_width(face_element=self.face_element)
 */
  __pyx_t_1 = PyNumber_InPlaceSubtract(__pyx_v_rx, __pyx_v_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1308, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_rx, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1309
 *         rx, ry = self.r.pos()
 *         rx -= x
 *         ry -= y             # <<<<<<<<<<<<<<
 *         l = self.style.get_line_width(face_element=self.face_element)
 *         pen = create_pens(
 */
  __pyx_t_1 = PyNumber_InPlaceSubtract(__pyx_v_ry, __pyx_v_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1309, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_ry, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1310
 *         rx -= x
 *         ry -= y
 *         l = self.style.get_line_width(face_element=self.face_element)             # <<<<<<<<<<<<<<
 *         pen = create_pens(
 *             edge_color=self.edge_color,
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_style); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1310, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_get_line_width); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1310, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1310, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_face_element); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1310, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_face_element, __pyx_t_3) < 0) __PYX_ERR(0, 1310, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1310, __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_v_l = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":1311
 *         ry -= y
 *         l = self.style.get_line_width(face_element=self.face_element)
 *         pen = create_pens(             # <<<<<<<<<<<<<<
 *             edge_color=self.edge_color,
 *             face_color=self.face_color,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_create_pens); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1311, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "mathics/builtin/graphics.py":1312
 *         l = self.style.get_line_width(face_element=self.face_element)
 *         pen = create_pens(
 *             edge_color=self.edge_color,             # <<<<<<<<<<<<<<
 *             face_color=self.face_color,
 *             stroke_width=l,
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1312, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_edge_color); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1312, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_edge_color, __pyx_t_2) < 0) __PYX_ERR(0, 1312, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":1313
 *         pen = create_pens(
 *             edge_color=self.edge_color,
 *             face_color=self.face_color,             # <<<<<<<<<<<<<<
 *             stroke_width=l,
 *             is_face_element=self.face_element,
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_face_color); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1313, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_face_color, __pyx_t_2) < 0) __PYX_ERR(0, 1312, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":1314
 *             edge_color=self.edge_color,
 *             face_color=self.face_color,
 *             stroke_width=l,             # <<<<<<<<<<<<<<
 *             is_face_element=self.face_element,
 *         )
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_stroke_width, __pyx_v_l) < 0) __PYX_ERR(0, 1312, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1315
 *             face_color=self.face_color,
 *             stroke_width=l,
 *             is_face_element=self.face_element,             # <<<<<<<<<<<<<<
 *         )
 *         cmd = "filldraw" if self.face_element else "draw"
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_face_element); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1315, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_is_face_element, __pyx_t_2) < 0) __PYX_ERR(0, 1312, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":1311
 *         ry -= y
 *         l = self.style.get_line_width(face_element=self.face_element)
 *         pen = create_pens(             # <<<<<<<<<<<<<<
 *             edge_color=self.edge_color,
 *             face_color=self.face_color,
 */
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1311, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_pen = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":1317
 *             is_face_element=self.face_element,
 *         )
 *         cmd = "filldraw" if self.face_element else "draw"             # <<<<<<<<<<<<<<
 *         return "%s(ellipse((%s,%s),%s,%s), %s);" % (
 *             cmd,
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_face_element); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1317, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 1317, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_6) {
    __Pyx_INCREF(__pyx_n_u_filldraw_2);
    __pyx_t_2 = __pyx_n_u_filldraw_2;
  } else {
    __Pyx_INCREF(__pyx_n_u_draw);
    __pyx_t_2 = __pyx_n_u_draw;
  }
  __pyx_v_cmd = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":1318
 *         )
 *         cmd = "filldraw" if self.face_element else "draw"
 *         return "%s(ellipse((%s,%s),%s,%s), %s);" % (             # <<<<<<<<<<<<<<
 *             cmd,
 *             asy_number(x),
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyTuple_New(12); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1318, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_7 = 0;
  __pyx_t_8 = 127;

  /* "mathics/builtin/graphics.py":1319
 *         cmd = "filldraw" if self.face_element else "draw"
 *         return "%s(ellipse((%s,%s),%s,%s), %s);" % (
 *             cmd,             # <<<<<<<<<<<<<<
 *             asy_number(x),
 *             asy_number(y),
 */
  __pyx_t_1 = __Pyx_PyUnicode_Unicode(__pyx_v_cmd); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1319, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_8 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_8) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_8;
  __pyx_t_7 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __Pyx_INCREF(__pyx_kp_u_ellipse);
  __pyx_t_7 += 10;
  __Pyx_GIVEREF(__pyx_kp_u_ellipse);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_kp_u_ellipse);

  /* "mathics/builtin/graphics.py":1320
 *         return "%s(ellipse((%s,%s),%s,%s), %s);" % (
 *             cmd,
 *             asy_number(x),             # <<<<<<<<<<<<<<
 *             asy_number(y),
 *             asy_number(rx),
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_asy_number); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1320, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_x) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_x);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1320, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_1), __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1320, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_8 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_8) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_8;
  __pyx_t_7 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_3);
  __pyx_t_3 = 0;
  __Pyx_INCREF(__pyx_kp_u__31);
  __pyx_t_7 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__31);
  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_kp_u__31);

  /* "mathics/builtin/graphics.py":1321
 *             cmd,
 *             asy_number(x),
 *             asy_number(y),             # <<<<<<<<<<<<<<
 *             asy_number(rx),
 *             asy_number(ry),
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_asy_number); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1321, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_4, __pyx_v_y) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_y);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1321, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_3), __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1321, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_8 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_8) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_8;
  __pyx_t_7 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_t_1);
  __pyx_t_1 = 0;
  __Pyx_INCREF(__pyx_kp_u__34);
  __pyx_t_7 += 2;
  __Pyx_GIVEREF(__pyx_kp_u__34);
  PyTuple_SET_ITEM(__pyx_t_2, 5, __pyx_kp_u__34);

  /* "mathics/builtin/graphics.py":1322
 *             asy_number(x),
 *             asy_number(y),
 *             asy_number(rx),             # <<<<<<<<<<<<<<
 *             asy_number(ry),
 *             pen,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_asy_number); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1322, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_rx) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_rx);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1322, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_1), __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1322, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_8 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_8) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_8;
  __pyx_t_7 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_2, 6, __pyx_t_3);
  __pyx_t_3 = 0;
  __Pyx_INCREF(__pyx_kp_u__31);
  __pyx_t_7 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__31);
  PyTuple_SET_ITEM(__pyx_t_2, 7, __pyx_kp_u__31);

  /* "mathics/builtin/graphics.py":1323
 *             asy_number(y),
 *             asy_number(rx),
 *             asy_number(ry),             # <<<<<<<<<<<<<<
 *             pen,
 *         )
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_asy_number); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1323, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_4, __pyx_v_ry) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_ry);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1323, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_3), __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1323, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_8 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_8) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_8;
  __pyx_t_7 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 8, __pyx_t_1);
  __pyx_t_1 = 0;
  __Pyx_INCREF(__pyx_kp_u__35);
  __pyx_t_7 += 3;
  __Pyx_GIVEREF(__pyx_kp_u__35);
  PyTuple_SET_ITEM(__pyx_t_2, 9, __pyx_kp_u__35);

  /* "mathics/builtin/graphics.py":1324
 *             asy_number(rx),
 *             asy_number(ry),
 *             pen,             # <<<<<<<<<<<<<<
 *         )
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_pen), __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1324, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_8 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_8) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_8;
  __pyx_t_7 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 10, __pyx_t_1);
  __pyx_t_1 = 0;
  __Pyx_INCREF(__pyx_kp_u__33);
  __pyx_t_7 += 2;
  __Pyx_GIVEREF(__pyx_kp_u__33);
  PyTuple_SET_ITEM(__pyx_t_2, 11, __pyx_kp_u__33);

  /* "mathics/builtin/graphics.py":1318
 *         )
 *         cmd = "filldraw" if self.face_element else "draw"
 *         return "%s(ellipse((%s,%s),%s,%s), %s);" % (             # <<<<<<<<<<<<<<
 *             cmd,
 *             asy_number(x),
 */
  __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_2, 12, __pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1318, __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;

  /* "mathics/builtin/graphics.py":1305
 *         )
 * 
 *     def to_asy(self):             # <<<<<<<<<<<<<<
 *         x, y = self.c.pos()
 *         rx, ry = self.r.pos()
 */

  /* 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("mathics.builtin.graphics._RoundBox.to_asy", __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_rx);
  __Pyx_XDECREF(__pyx_v_ry);
  __Pyx_XDECREF(__pyx_v_l);
  __Pyx_XDECREF(__pyx_v_pen);
  __Pyx_XDECREF(__pyx_v_cmd);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":1329
 * 
 * class _ArcBox(_RoundBox):
 *     def init(self, graphics, style, item):             # <<<<<<<<<<<<<<
 *         if len(item.leaves) == 3:
 *             arc_expr = item.leaves[2]
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_7_ArcBox_1init(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_7_ArcBox_1init = {"init", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_7_ArcBox_1init, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_7_ArcBox_1init(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_graphics = 0;
  PyObject *__pyx_v_style = 0;
  PyObject *__pyx_v_item = 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);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_graphics,&__pyx_n_s_style,&__pyx_n_s_item,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_graphics)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("init", 1, 4, 4, 1); __PYX_ERR(0, 1329, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_style)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("init", 1, 4, 4, 2); __PYX_ERR(0, 1329, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_item)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("init", 1, 4, 4, 3); __PYX_ERR(0, 1329, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "init") < 0)) __PYX_ERR(0, 1329, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __pyx_v_self = values[0];
    __pyx_v_graphics = values[1];
    __pyx_v_style = values[2];
    __pyx_v_item = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("init", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1329, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics._ArcBox.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_7_ArcBox_init(__pyx_self, __pyx_v_self, __pyx_v_graphics, __pyx_v_style, __pyx_v_item);

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_7_ArcBox_init(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_graphics, PyObject *__pyx_v_style, PyObject *__pyx_v_item) {
  PyObject *__pyx_v_arc_expr = NULL;
  PyObject *__pyx_v_arc = NULL;
  PyObject *__pyx_v_pi2 = NULL;
  PyObject *__pyx_v_start_angle = NULL;
  PyObject *__pyx_v_end_angle = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("init", 0);
  __Pyx_INCREF(__pyx_v_item);

  /* "mathics/builtin/graphics.py":1330
 * class _ArcBox(_RoundBox):
 *     def init(self, graphics, style, item):
 *         if len(item.leaves) == 3:             # <<<<<<<<<<<<<<
 *             arc_expr = item.leaves[2]
 *             if arc_expr.get_head_name() != "System`List":
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_item, __pyx_n_s_leaves); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1330, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1330, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = ((__pyx_t_2 == 3) != 0);
  if (__pyx_t_3) {

    /* "mathics/builtin/graphics.py":1331
 *     def init(self, graphics, style, item):
 *         if len(item.leaves) == 3:
 *             arc_expr = item.leaves[2]             # <<<<<<<<<<<<<<
 *             if arc_expr.get_head_name() != "System`List":
 *                 raise BoxConstructError
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_item, __pyx_n_s_leaves); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1331, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1331, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_arc_expr = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "mathics/builtin/graphics.py":1332
 *         if len(item.leaves) == 3:
 *             arc_expr = item.leaves[2]
 *             if arc_expr.get_head_name() != "System`List":             # <<<<<<<<<<<<<<
 *                 raise BoxConstructError
 *             arc = arc_expr.leaves
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arc_expr, __pyx_n_s_get_head_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1332, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1332, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_kp_u_System_List, Py_NE)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1332, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(__pyx_t_3)) {

      /* "mathics/builtin/graphics.py":1333
 *             arc_expr = item.leaves[2]
 *             if arc_expr.get_head_name() != "System`List":
 *                 raise BoxConstructError             # <<<<<<<<<<<<<<
 *             arc = arc_expr.leaves
 *             pi2 = 2 * pi
 */
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_BoxConstructError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1333, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __PYX_ERR(0, 1333, __pyx_L1_error)

      /* "mathics/builtin/graphics.py":1332
 *         if len(item.leaves) == 3:
 *             arc_expr = item.leaves[2]
 *             if arc_expr.get_head_name() != "System`List":             # <<<<<<<<<<<<<<
 *                 raise BoxConstructError
 *             arc = arc_expr.leaves
 */
    }

    /* "mathics/builtin/graphics.py":1334
 *             if arc_expr.get_head_name() != "System`List":
 *                 raise BoxConstructError
 *             arc = arc_expr.leaves             # <<<<<<<<<<<<<<
 *             pi2 = 2 * pi
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_arc_expr, __pyx_n_s_leaves); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1334, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_v_arc = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "mathics/builtin/graphics.py":1335
 *                 raise BoxConstructError
 *             arc = arc_expr.leaves
 *             pi2 = 2 * pi             # <<<<<<<<<<<<<<
 * 
 *             start_angle = arc[0].round_to_float()
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pi); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1335, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyNumber_Multiply(__pyx_int_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1335, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_pi2 = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "mathics/builtin/graphics.py":1337
 *             pi2 = 2 * pi
 * 
 *             start_angle = arc[0].round_to_float()             # <<<<<<<<<<<<<<
 *             end_angle = arc[1].round_to_float()
 * 
 */
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_arc, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1337, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_round_to_float); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1337, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1337, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_start_angle = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "mathics/builtin/graphics.py":1338
 * 
 *             start_angle = arc[0].round_to_float()
 *             end_angle = arc[1].round_to_float()             # <<<<<<<<<<<<<<
 * 
 *             if start_angle is None or end_angle is None:
 */
    __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_arc, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1338, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_round_to_float); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1338, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1338, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_end_angle = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "mathics/builtin/graphics.py":1340
 *             end_angle = arc[1].round_to_float()
 * 
 *             if start_angle is None or end_angle is None:             # <<<<<<<<<<<<<<
 *                 raise BoxConstructError
 *             elif end_angle >= start_angle + pi2:  # full circle?
 */
    __pyx_t_6 = (__pyx_v_start_angle == Py_None);
    __pyx_t_7 = (__pyx_t_6 != 0);
    if (!__pyx_t_7) {
    } else {
      __pyx_t_3 = __pyx_t_7;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_7 = (__pyx_v_end_angle == Py_None);
    __pyx_t_6 = (__pyx_t_7 != 0);
    __pyx_t_3 = __pyx_t_6;
    __pyx_L6_bool_binop_done:;
    if (unlikely(__pyx_t_3)) {

      /* "mathics/builtin/graphics.py":1341
 * 
 *             if start_angle is None or end_angle is None:
 *                 raise BoxConstructError             # <<<<<<<<<<<<<<
 *             elif end_angle >= start_angle + pi2:  # full circle?
 *                 self.arc = None
 */
      __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_BoxConstructError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1341, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_ERR(0, 1341, __pyx_L1_error)

      /* "mathics/builtin/graphics.py":1340
 *             end_angle = arc[1].round_to_float()
 * 
 *             if start_angle is None or end_angle is None:             # <<<<<<<<<<<<<<
 *                 raise BoxConstructError
 *             elif end_angle >= start_angle + pi2:  # full circle?
 */
    }

    /* "mathics/builtin/graphics.py":1342
 *             if start_angle is None or end_angle is None:
 *                 raise BoxConstructError
 *             elif end_angle >= start_angle + pi2:  # full circle?             # <<<<<<<<<<<<<<
 *                 self.arc = None
 *             else:
 */
    __pyx_t_1 = PyNumber_Add(__pyx_v_start_angle, __pyx_v_pi2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1342, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyObject_RichCompare(__pyx_v_end_angle, __pyx_t_1, Py_GE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1342, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1342, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_3) {

      /* "mathics/builtin/graphics.py":1343
 *                 raise BoxConstructError
 *             elif end_angle >= start_angle + pi2:  # full circle?
 *                 self.arc = None             # <<<<<<<<<<<<<<
 *             else:
 *                 if end_angle <= start_angle:
 */
      if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_arc, Py_None) < 0) __PYX_ERR(0, 1343, __pyx_L1_error)

      /* "mathics/builtin/graphics.py":1342
 *             if start_angle is None or end_angle is None:
 *                 raise BoxConstructError
 *             elif end_angle >= start_angle + pi2:  # full circle?             # <<<<<<<<<<<<<<
 *                 self.arc = None
 *             else:
 */
      goto __pyx_L5;
    }

    /* "mathics/builtin/graphics.py":1345
 *                 self.arc = None
 *             else:
 *                 if end_angle <= start_angle:             # <<<<<<<<<<<<<<
 *                     self.arc = (end_angle, start_angle)
 *                 else:
 */
    /*else*/ {
      __pyx_t_4 = PyObject_RichCompare(__pyx_v_end_angle, __pyx_v_start_angle, Py_LE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1345, __pyx_L1_error)
      __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1345, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_3) {

        /* "mathics/builtin/graphics.py":1346
 *             else:
 *                 if end_angle <= start_angle:
 *                     self.arc = (end_angle, start_angle)             # <<<<<<<<<<<<<<
 *                 else:
 *                     self.arc = (start_angle, end_angle)
 */
        __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1346, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_INCREF(__pyx_v_end_angle);
        __Pyx_GIVEREF(__pyx_v_end_angle);
        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_end_angle);
        __Pyx_INCREF(__pyx_v_start_angle);
        __Pyx_GIVEREF(__pyx_v_start_angle);
        PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_start_angle);
        if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_arc, __pyx_t_4) < 0) __PYX_ERR(0, 1346, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "mathics/builtin/graphics.py":1345
 *                 self.arc = None
 *             else:
 *                 if end_angle <= start_angle:             # <<<<<<<<<<<<<<
 *                     self.arc = (end_angle, start_angle)
 *                 else:
 */
        goto __pyx_L8;
      }

      /* "mathics/builtin/graphics.py":1348
 *                     self.arc = (end_angle, start_angle)
 *                 else:
 *                     self.arc = (start_angle, end_angle)             # <<<<<<<<<<<<<<
 * 
 *             item = Expression(item.get_head_name(), *item.leaves[:2])
 */
      /*else*/ {
        __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1348, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_INCREF(__pyx_v_start_angle);
        __Pyx_GIVEREF(__pyx_v_start_angle);
        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_start_angle);
        __Pyx_INCREF(__pyx_v_end_angle);
        __Pyx_GIVEREF(__pyx_v_end_angle);
        PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_end_angle);
        if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_arc, __pyx_t_4) < 0) __PYX_ERR(0, 1348, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
      __pyx_L8:;
    }
    __pyx_L5:;

    /* "mathics/builtin/graphics.py":1350
 *                     self.arc = (start_angle, end_angle)
 * 
 *             item = Expression(item.get_head_name(), *item.leaves[:2])             # <<<<<<<<<<<<<<
 *         else:
 *             self.arc = None
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Expression); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1350, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_item, __pyx_n_s_get_head_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1350, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1350, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1350, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_item, __pyx_n_s_leaves); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1350, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = __Pyx_PyObject_GetSlice(__pyx_t_1, 0, 2, NULL, NULL, &__pyx_slice__36, 0, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1350, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1350, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = PyNumber_Add(__pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1350, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1350, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF_SET(__pyx_v_item, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "mathics/builtin/graphics.py":1330
 * class _ArcBox(_RoundBox):
 *     def init(self, graphics, style, item):
 *         if len(item.leaves) == 3:             # <<<<<<<<<<<<<<
 *             arc_expr = item.leaves[2]
 *             if arc_expr.get_head_name() != "System`List":
 */
    goto __pyx_L3;
  }

  /* "mathics/builtin/graphics.py":1352
 *             item = Expression(item.get_head_name(), *item.leaves[:2])
 *         else:
 *             self.arc = None             # <<<<<<<<<<<<<<
 *         super(_ArcBox, self).init(graphics, style, item)
 * 
 */
  /*else*/ {
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_arc, Py_None) < 0) __PYX_ERR(0, 1352, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "mathics/builtin/graphics.py":1353
 *         else:
 *             self.arc = None
 *         super(_ArcBox, self).init(graphics, style, item)             # <<<<<<<<<<<<<<
 * 
 *     def _arc_params(self):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_ArcBox); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1353, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1353, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_8);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_8);
  __Pyx_INCREF(__pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_self);
  __pyx_t_8 = 0;
  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_4, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1353, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_init); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1353, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = NULL;
  __pyx_t_9 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_9 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[4] = {__pyx_t_8, __pyx_v_graphics, __pyx_v_style, __pyx_v_item};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1353, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[4] = {__pyx_t_8, __pyx_v_graphics, __pyx_v_style, __pyx_v_item};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1353, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(3+__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1353, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_8) {
      __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_8); __pyx_t_8 = NULL;
    }
    __Pyx_INCREF(__pyx_v_graphics);
    __Pyx_GIVEREF(__pyx_v_graphics);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_9, __pyx_v_graphics);
    __Pyx_INCREF(__pyx_v_style);
    __Pyx_GIVEREF(__pyx_v_style);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_9, __pyx_v_style);
    __Pyx_INCREF(__pyx_v_item);
    __Pyx_GIVEREF(__pyx_v_item);
    PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_9, __pyx_v_item);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1353, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1329
 * 
 * class _ArcBox(_RoundBox):
 *     def init(self, graphics, style, item):             # <<<<<<<<<<<<<<
 *         if len(item.leaves) == 3:
 *             arc_expr = item.leaves[2]
 */

  /* 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_8);
  __Pyx_AddTraceback("mathics.builtin.graphics._ArcBox.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_arc_expr);
  __Pyx_XDECREF(__pyx_v_arc);
  __Pyx_XDECREF(__pyx_v_pi2);
  __Pyx_XDECREF(__pyx_v_start_angle);
  __Pyx_XDECREF(__pyx_v_end_angle);
  __Pyx_XDECREF(__pyx_v_item);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":1355
 *         super(_ArcBox, self).init(graphics, style, item)
 * 
 *     def _arc_params(self):             # <<<<<<<<<<<<<<
 *         x, y = self.c.pos()
 *         rx, ry = self.r.pos()
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_7_ArcBox_3_arc_params(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_7_ArcBox_3_arc_params = {"_arc_params", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_7_ArcBox_3_arc_params, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_7_ArcBox_3_arc_params(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_arc_params (wrapper)", 0);
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_7_ArcBox_2_arc_params(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_7_ArcBox_2_arc_params(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_x = NULL;
  PyObject *__pyx_v_y = NULL;
  PyObject *__pyx_v_rx = NULL;
  PyObject *__pyx_v_ry = NULL;
  PyObject *__pyx_v_start_angle = NULL;
  PyObject *__pyx_v_end_angle = NULL;
  long __pyx_v_large_arc;
  PyObject *__pyx_v_sx = NULL;
  PyObject *__pyx_v_sy = NULL;
  PyObject *__pyx_v_ex = NULL;
  PyObject *__pyx_v_ey = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *(*__pyx_t_5)(PyObject *);
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_arc_params", 0);

  /* "mathics/builtin/graphics.py":1356
 * 
 *     def _arc_params(self):
 *         x, y = self.c.pos()             # <<<<<<<<<<<<<<
 *         rx, ry = self.r.pos()
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_c); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1356, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pos); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1356, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1356, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
    PyObject* sequence = __pyx_t_1;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 1356, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    #else
    __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1356, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1356, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1356, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 1; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) __PYX_ERR(0, 1356, __pyx_L1_error)
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 1356, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  __pyx_v_x = __pyx_t_3;
  __pyx_t_3 = 0;
  __pyx_v_y = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":1357
 *     def _arc_params(self):
 *         x, y = self.c.pos()
 *         rx, ry = self.r.pos()             # <<<<<<<<<<<<<<
 * 
 *         rx -= x
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1357, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pos); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1357, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1357, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
    PyObject* sequence = __pyx_t_1;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 1357, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    #else
    __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1357, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1357, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1357, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 1; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) __PYX_ERR(0, 1357, __pyx_L1_error)
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L6_unpacking_done;
    __pyx_L5_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 1357, __pyx_L1_error)
    __pyx_L6_unpacking_done:;
  }
  __pyx_v_rx = __pyx_t_3;
  __pyx_t_3 = 0;
  __pyx_v_ry = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":1359
 *         rx, ry = self.r.pos()
 * 
 *         rx -= x             # <<<<<<<<<<<<<<
 *         ry -= y
 * 
 */
  __pyx_t_1 = PyNumber_InPlaceSubtract(__pyx_v_rx, __pyx_v_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1359, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_rx, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1360
 * 
 *         rx -= x
 *         ry -= y             # <<<<<<<<<<<<<<
 * 
 *         start_angle, end_angle = self.arc
 */
  __pyx_t_1 = PyNumber_InPlaceSubtract(__pyx_v_ry, __pyx_v_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1360, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_ry, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1362
 *         ry -= y
 * 
 *         start_angle, end_angle = self.arc             # <<<<<<<<<<<<<<
 * 
 *         if end_angle - start_angle <= pi:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_arc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1362, __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(0, 1362, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_3);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1362, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1362, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1362, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L7_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_L7_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) __PYX_ERR(0, 1362, __pyx_L1_error)
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L8_unpacking_done;
    __pyx_L7_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 1362, __pyx_L1_error)
    __pyx_L8_unpacking_done:;
  }
  __pyx_v_start_angle = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_v_end_angle = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":1364
 *         start_angle, end_angle = self.arc
 * 
 *         if end_angle - start_angle <= pi:             # <<<<<<<<<<<<<<
 *             large_arc = 0
 *         else:
 */
  __pyx_t_1 = PyNumber_Subtract(__pyx_v_end_angle, __pyx_v_start_angle); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pi); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_LE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1364, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 1364, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_6) {

    /* "mathics/builtin/graphics.py":1365
 * 
 *         if end_angle - start_angle <= pi:
 *             large_arc = 0             # <<<<<<<<<<<<<<
 *         else:
 *             large_arc = 1
 */
    __pyx_v_large_arc = 0;

    /* "mathics/builtin/graphics.py":1364
 *         start_angle, end_angle = self.arc
 * 
 *         if end_angle - start_angle <= pi:             # <<<<<<<<<<<<<<
 *             large_arc = 0
 *         else:
 */
    goto __pyx_L9;
  }

  /* "mathics/builtin/graphics.py":1367
 *             large_arc = 0
 *         else:
 *             large_arc = 1             # <<<<<<<<<<<<<<
 * 
 *         sx = x + rx * cos(start_angle)
 */
  /*else*/ {
    __pyx_v_large_arc = 1;
  }
  __pyx_L9:;

  /* "mathics/builtin/graphics.py":1369
 *             large_arc = 1
 * 
 *         sx = x + rx * cos(start_angle)             # <<<<<<<<<<<<<<
 *         sy = y + ry * sin(start_angle)
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_cos); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1369, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_1, __pyx_v_start_angle) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_start_angle);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1369, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Multiply(__pyx_v_rx, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1369, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_Add(__pyx_v_x, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1369, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_sx = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":1370
 * 
 *         sx = x + rx * cos(start_angle)
 *         sy = y + ry * sin(start_angle)             # <<<<<<<<<<<<<<
 * 
 *         ex = x + rx * cos(end_angle)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_sin); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_1, __pyx_v_start_angle) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_start_angle);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Multiply(__pyx_v_ry, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_Add(__pyx_v_y, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_sy = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":1372
 *         sy = y + ry * sin(start_angle)
 * 
 *         ex = x + rx * cos(end_angle)             # <<<<<<<<<<<<<<
 *         ey = y + ry * sin(end_angle)
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_cos); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1372, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_1, __pyx_v_end_angle) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_end_angle);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1372, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Multiply(__pyx_v_rx, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1372, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_Add(__pyx_v_x, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1372, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_ex = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":1373
 * 
 *         ex = x + rx * cos(end_angle)
 *         ey = y + ry * sin(end_angle)             # <<<<<<<<<<<<<<
 * 
 *         return x, y, abs(rx), abs(ry), sx, sy, ex, ey, large_arc
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_sin); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1373, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_1, __pyx_v_end_angle) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_end_angle);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1373, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Multiply(__pyx_v_ry, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1373, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_Add(__pyx_v_y, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1373, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_ey = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":1375
 *         ey = y + ry * sin(end_angle)
 * 
 *         return x, y, abs(rx), abs(ry), sx, sy, ex, ey, large_arc             # <<<<<<<<<<<<<<
 * 
 *     def to_svg(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyNumber_Absolute(__pyx_v_rx); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1375, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyNumber_Absolute(__pyx_v_ry); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1375, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_large_arc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1375, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyTuple_New(9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1375, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_x);
  __Pyx_GIVEREF(__pyx_v_x);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_x);
  __Pyx_INCREF(__pyx_v_y);
  __Pyx_GIVEREF(__pyx_v_y);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_y);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_3);
  __Pyx_INCREF(__pyx_v_sx);
  __Pyx_GIVEREF(__pyx_v_sx);
  PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_v_sx);
  __Pyx_INCREF(__pyx_v_sy);
  __Pyx_GIVEREF(__pyx_v_sy);
  PyTuple_SET_ITEM(__pyx_t_4, 5, __pyx_v_sy);
  __Pyx_INCREF(__pyx_v_ex);
  __Pyx_GIVEREF(__pyx_v_ex);
  PyTuple_SET_ITEM(__pyx_t_4, 6, __pyx_v_ex);
  __Pyx_INCREF(__pyx_v_ey);
  __Pyx_GIVEREF(__pyx_v_ey);
  PyTuple_SET_ITEM(__pyx_t_4, 7, __pyx_v_ey);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 8, __pyx_t_1);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_1 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":1355
 *         super(_ArcBox, self).init(graphics, style, item)
 * 
 *     def _arc_params(self):             # <<<<<<<<<<<<<<
 *         x, y = self.c.pos()
 *         rx, ry = self.r.pos()
 */

  /* 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("mathics.builtin.graphics._ArcBox._arc_params", __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_rx);
  __Pyx_XDECREF(__pyx_v_ry);
  __Pyx_XDECREF(__pyx_v_start_angle);
  __Pyx_XDECREF(__pyx_v_end_angle);
  __Pyx_XDECREF(__pyx_v_sx);
  __Pyx_XDECREF(__pyx_v_sy);
  __Pyx_XDECREF(__pyx_v_ex);
  __Pyx_XDECREF(__pyx_v_ey);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":1377
 *         return x, y, abs(rx), abs(ry), sx, sy, ex, ey, large_arc
 * 
 *     def to_svg(self):             # <<<<<<<<<<<<<<
 *         if self.arc is None:
 *             return super(_ArcBox, self).to_svg()
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_7_ArcBox_5to_svg(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_7_ArcBox_5to_svg = {"to_svg", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_7_ArcBox_5to_svg, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_7_ArcBox_5to_svg(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_svg (wrapper)", 0);
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_7_ArcBox_4to_svg(__pyx_self, ((PyObject *)__pyx_v_self));

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

/* "mathics/builtin/graphics.py":1383
 *         x, y, rx, ry, sx, sy, ex, ey, large_arc = self._arc_params()
 * 
 *         def path(closed):             # <<<<<<<<<<<<<<
 *             if closed:
 *                 yield "M %f,%f" % (x, y)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_7_ArcBox_6to_svg_1path(PyObject *__pyx_self, PyObject *__pyx_v_closed); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_7_ArcBox_6to_svg_1path = {"path", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_7_ArcBox_6to_svg_1path, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_7_ArcBox_6to_svg_1path(PyObject *__pyx_self, PyObject *__pyx_v_closed) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("path (wrapper)", 0);
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_7_ArcBox_6to_svg_path(__pyx_self, ((PyObject *)__pyx_v_closed));

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_7_ArcBox_6to_svg_path(PyObject *__pyx_self, PyObject *__pyx_v_closed) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_11_path *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("path", 0);
  __pyx_cur_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_11_path *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_11_path(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_11_path, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_11_path *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1383, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_10_to_svg *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  __pyx_cur_scope->__pyx_v_closed = __pyx_v_closed;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_closed);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_closed);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7mathics_7builtin_8graphics_7_ArcBox_6to_svg_2generator11, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_path, __pyx_n_s_ArcBox_to_svg_locals_path, __pyx_n_s_mathics_builtin_graphics); if (unlikely(!gen)) __PYX_ERR(0, 1383, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics._ArcBox.to_svg.path", __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_7mathics_7builtin_8graphics_7_ArcBox_6to_svg_2generator11(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_11_path *__pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_11_path *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  Py_UCS4 __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("path", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L5_resume_from_yield;
    case 2: goto __pyx_L6_resume_from_yield;
    case 3: goto __pyx_L7_resume_from_yield;
    case 4: goto __pyx_L8_resume_from_yield;
    case 5: goto __pyx_L10_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1383, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1384
 * 
 *         def path(closed):
 *             if closed:             # <<<<<<<<<<<<<<
 *                 yield "M %f,%f" % (x, y)
 *                 yield "L %f,%f" % (sx, sy)
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_closed); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1384, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "mathics/builtin/graphics.py":1385
 *         def path(closed):
 *             if closed:
 *                 yield "M %f,%f" % (x, y)             # <<<<<<<<<<<<<<
 *                 yield "L %f,%f" % (sx, sy)
 *             else:
 */
    __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1385, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = 0;
    __pyx_t_4 = 127;
    __Pyx_INCREF(__pyx_kp_u_M);
    __pyx_t_3 += 2;
    __Pyx_GIVEREF(__pyx_kp_u_M);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u_M);
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_x)) { __Pyx_RaiseClosureNameError("x"); __PYX_ERR(0, 1385, __pyx_L1_error) }
    __pyx_t_5 = __Pyx_PyObject_Format(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_x, __pyx_n_u_f); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1385, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_4;
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_INCREF(__pyx_kp_u__31);
    __pyx_t_3 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__31);
    PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u__31);
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_y)) { __Pyx_RaiseClosureNameError("y"); __PYX_ERR(0, 1385, __pyx_L1_error) }
    __pyx_t_5 = __Pyx_PyObject_Format(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_y, __pyx_n_u_f); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1385, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_4;
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_2, 4, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1385, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L5_resume_from_yield:;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1385, __pyx_L1_error)

    /* "mathics/builtin/graphics.py":1386
 *             if closed:
 *                 yield "M %f,%f" % (x, y)
 *                 yield "L %f,%f" % (sx, sy)             # <<<<<<<<<<<<<<
 *             else:
 *                 yield "M %f,%f" % (sx, sy)
 */
    __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1386, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = 0;
    __pyx_t_4 = 127;
    __Pyx_INCREF(__pyx_kp_u_L);
    __pyx_t_3 += 2;
    __Pyx_GIVEREF(__pyx_kp_u_L);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_u_L);
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_sx)) { __Pyx_RaiseClosureNameError("sx"); __PYX_ERR(0, 1386, __pyx_L1_error) }
    __pyx_t_2 = __Pyx_PyObject_Format(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_sx, __pyx_n_u_f); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1386, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_4;
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
    __pyx_t_2 = 0;
    __Pyx_INCREF(__pyx_kp_u__31);
    __pyx_t_3 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__31);
    PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_kp_u__31);
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_sy)) { __Pyx_RaiseClosureNameError("sy"); __PYX_ERR(0, 1386, __pyx_L1_error) }
    __pyx_t_2 = __Pyx_PyObject_Format(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_sy, __pyx_n_u_f); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1386, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_4;
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_5, 4, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1386, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 2;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1386, __pyx_L1_error)

    /* "mathics/builtin/graphics.py":1384
 * 
 *         def path(closed):
 *             if closed:             # <<<<<<<<<<<<<<
 *                 yield "M %f,%f" % (x, y)
 *                 yield "L %f,%f" % (sx, sy)
 */
    goto __pyx_L4;
  }

  /* "mathics/builtin/graphics.py":1388
 *                 yield "L %f,%f" % (sx, sy)
 *             else:
 *                 yield "M %f,%f" % (sx, sy)             # <<<<<<<<<<<<<<
 * 
 *             yield "A %f,%f,0,%d,0,%f,%f" % (rx, ry, large_arc, ex, ey)
 */
  /*else*/ {
    __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1388, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = 0;
    __pyx_t_4 = 127;
    __Pyx_INCREF(__pyx_kp_u_M);
    __pyx_t_3 += 2;
    __Pyx_GIVEREF(__pyx_kp_u_M);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u_M);
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_sx)) { __Pyx_RaiseClosureNameError("sx"); __PYX_ERR(0, 1388, __pyx_L1_error) }
    __pyx_t_5 = __Pyx_PyObject_Format(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_sx, __pyx_n_u_f); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1388, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_4;
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_INCREF(__pyx_kp_u__31);
    __pyx_t_3 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__31);
    PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u__31);
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_sy)) { __Pyx_RaiseClosureNameError("sy"); __PYX_ERR(0, 1388, __pyx_L1_error) }
    __pyx_t_5 = __Pyx_PyObject_Format(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_sy, __pyx_n_u_f); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1388, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_4;
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_2, 4, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1388, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 3;
    return __pyx_r;
    __pyx_L7_resume_from_yield:;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1388, __pyx_L1_error)
  }
  __pyx_L4:;

  /* "mathics/builtin/graphics.py":1390
 *                 yield "M %f,%f" % (sx, sy)
 * 
 *             yield "A %f,%f,0,%d,0,%f,%f" % (rx, ry, large_arc, ex, ey)             # <<<<<<<<<<<<<<
 * 
 *             if closed:
 */
  __pyx_t_5 = PyTuple_New(10); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1390, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = 0;
  __pyx_t_4 = 127;
  __Pyx_INCREF(__pyx_kp_u_A);
  __pyx_t_3 += 2;
  __Pyx_GIVEREF(__pyx_kp_u_A);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_u_A);
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_rx)) { __Pyx_RaiseClosureNameError("rx"); __PYX_ERR(0, 1390, __pyx_L1_error) }
  __pyx_t_2 = __Pyx_PyObject_Format(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_rx, __pyx_n_u_f); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1390, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_4;
  __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
  __pyx_t_2 = 0;
  __Pyx_INCREF(__pyx_kp_u__31);
  __pyx_t_3 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__31);
  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_kp_u__31);
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_ry)) { __Pyx_RaiseClosureNameError("ry"); __PYX_ERR(0, 1390, __pyx_L1_error) }
  __pyx_t_2 = __Pyx_PyObject_Format(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_ry, __pyx_n_u_f); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1390, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_4;
  __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_2);
  __pyx_t_2 = 0;
  __Pyx_INCREF(__pyx_kp_u_0);
  __pyx_t_3 += 3;
  __Pyx_GIVEREF(__pyx_kp_u_0);
  PyTuple_SET_ITEM(__pyx_t_5, 4, __pyx_kp_u_0);
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_large_arc)) { __Pyx_RaiseClosureNameError("large_arc"); __PYX_ERR(0, 1390, __pyx_L1_error) }
  __pyx_t_2 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_IntOrLong(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_large_arc), __pyx_n_u_d); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1390, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_4;
  __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_5, 5, __pyx_t_2);
  __pyx_t_2 = 0;
  __Pyx_INCREF(__pyx_kp_u_0);
  __pyx_t_3 += 3;
  __Pyx_GIVEREF(__pyx_kp_u_0);
  PyTuple_SET_ITEM(__pyx_t_5, 6, __pyx_kp_u_0);
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_ex)) { __Pyx_RaiseClosureNameError("ex"); __PYX_ERR(0, 1390, __pyx_L1_error) }
  __pyx_t_2 = __Pyx_PyObject_Format(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_ex, __pyx_n_u_f); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1390, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_4;
  __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_5, 7, __pyx_t_2);
  __pyx_t_2 = 0;
  __Pyx_INCREF(__pyx_kp_u__31);
  __pyx_t_3 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__31);
  PyTuple_SET_ITEM(__pyx_t_5, 8, __pyx_kp_u__31);
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_ey)) { __Pyx_RaiseClosureNameError("ey"); __PYX_ERR(0, 1390, __pyx_L1_error) }
  __pyx_t_2 = __Pyx_PyObject_Format(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_ey, __pyx_n_u_f); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1390, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_4;
  __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_5, 9, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_5, 10, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1390, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  /* return from generator, yielding value */
  __pyx_generator->resume_label = 4;
  return __pyx_r;
  __pyx_L8_resume_from_yield:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1390, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1392
 *             yield "A %f,%f,0,%d,0,%f,%f" % (rx, ry, large_arc, ex, ey)
 * 
 *             if closed:             # <<<<<<<<<<<<<<
 *                 yield "Z"
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_closed); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1392, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "mathics/builtin/graphics.py":1393
 * 
 *             if closed:
 *                 yield "Z"             # <<<<<<<<<<<<<<
 * 
 *         l = self.style.get_line_width(face_element=self.face_element)
 */
    __Pyx_INCREF(__pyx_n_u_Z);
    __pyx_r = __pyx_n_u_Z;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 5;
    return __pyx_r;
    __pyx_L10_resume_from_yield:;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1393, __pyx_L1_error)

    /* "mathics/builtin/graphics.py":1392
 *             yield "A %f,%f,0,%d,0,%f,%f" % (rx, ry, large_arc, ex, ey)
 * 
 *             if closed:             # <<<<<<<<<<<<<<
 *                 yield "Z"
 * 
 */
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "mathics/builtin/graphics.py":1383
 *         x, y, rx, ry, sx, sy, ex, ey, large_arc = self._arc_params()
 * 
 *         def path(closed):             # <<<<<<<<<<<<<<
 *             if closed:
 *                 yield "M %f,%f" % (x, y)
 */

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

/* "mathics/builtin/graphics.py":1377
 *         return x, y, abs(rx), abs(ry), sx, sy, ex, ey, large_arc
 * 
 *     def to_svg(self):             # <<<<<<<<<<<<<<
 *         if self.arc is None:
 *             return super(_ArcBox, self).to_svg()
 */

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_7_ArcBox_4to_svg(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_10_to_svg *__pyx_cur_scope;
  PyObject *__pyx_v_path = 0;
  PyObject *__pyx_v_l = NULL;
  PyObject *__pyx_v_style = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *(*__pyx_t_14)(PyObject *);
  Py_ssize_t __pyx_t_15;
  Py_UCS4 __pyx_t_16;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_svg", 0);
  __pyx_cur_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_10_to_svg *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_10_to_svg(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_10_to_svg, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_10_to_svg *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1377, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }

  /* "mathics/builtin/graphics.py":1378
 * 
 *     def to_svg(self):
 *         if self.arc is None:             # <<<<<<<<<<<<<<
 *             return super(_ArcBox, self).to_svg()
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_arc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1378, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__pyx_t_1 == Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "mathics/builtin/graphics.py":1379
 *     def to_svg(self):
 *         if self.arc is None:
 *             return super(_ArcBox, self).to_svg()             # <<<<<<<<<<<<<<
 * 
 *         x, y, rx, ry, sx, sy, ex, ey, large_arc = self._arc_params()
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ArcBox); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1379, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1379, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
    __Pyx_INCREF(__pyx_v_self);
    __Pyx_GIVEREF(__pyx_v_self);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_self);
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1379, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_to_svg); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1379, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1379, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "mathics/builtin/graphics.py":1378
 * 
 *     def to_svg(self):
 *         if self.arc is None:             # <<<<<<<<<<<<<<
 *             return super(_ArcBox, self).to_svg()
 * 
 */
  }

  /* "mathics/builtin/graphics.py":1381
 *             return super(_ArcBox, self).to_svg()
 * 
 *         x, y, rx, ry, sx, sy, ex, ey, large_arc = self._arc_params()             # <<<<<<<<<<<<<<
 * 
 *         def path(closed):
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_arc_params); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1381, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1381, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
    PyObject* sequence = __pyx_t_1;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 9)) {
      if (size > 9) __Pyx_RaiseTooManyValuesError(9);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 1381, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
      __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); 
      __pyx_t_7 = PyTuple_GET_ITEM(sequence, 3); 
      __pyx_t_8 = PyTuple_GET_ITEM(sequence, 4); 
      __pyx_t_9 = PyTuple_GET_ITEM(sequence, 5); 
      __pyx_t_10 = PyTuple_GET_ITEM(sequence, 6); 
      __pyx_t_11 = PyTuple_GET_ITEM(sequence, 7); 
      __pyx_t_12 = PyTuple_GET_ITEM(sequence, 8); 
    } else {
      __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_4 = PyList_GET_ITEM(sequence, 1); 
      __pyx_t_6 = PyList_GET_ITEM(sequence, 2); 
      __pyx_t_7 = PyList_GET_ITEM(sequence, 3); 
      __pyx_t_8 = PyList_GET_ITEM(sequence, 4); 
      __pyx_t_9 = PyList_GET_ITEM(sequence, 5); 
      __pyx_t_10 = PyList_GET_ITEM(sequence, 6); 
      __pyx_t_11 = PyList_GET_ITEM(sequence, 7); 
      __pyx_t_12 = PyList_GET_ITEM(sequence, 8); 
    }
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_t_7);
    __Pyx_INCREF(__pyx_t_8);
    __Pyx_INCREF(__pyx_t_9);
    __Pyx_INCREF(__pyx_t_10);
    __Pyx_INCREF(__pyx_t_11);
    __Pyx_INCREF(__pyx_t_12);
    #else
    {
      Py_ssize_t i;
      PyObject** temps[9] = {&__pyx_t_5,&__pyx_t_4,&__pyx_t_6,&__pyx_t_7,&__pyx_t_8,&__pyx_t_9,&__pyx_t_10,&__pyx_t_11,&__pyx_t_12};
      for (i=0; i < 9; i++) {
        PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 1381, __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[9] = {&__pyx_t_5,&__pyx_t_4,&__pyx_t_6,&__pyx_t_7,&__pyx_t_8,&__pyx_t_9,&__pyx_t_10,&__pyx_t_11,&__pyx_t_12};
    __pyx_t_13 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1381, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_14 = Py_TYPE(__pyx_t_13)->tp_iternext;
    for (index=0; index < 9; index++) {
      PyObject* item = __pyx_t_14(__pyx_t_13); if (unlikely(!item)) goto __pyx_L4_unpacking_failed;
      __Pyx_GOTREF(item);
      *(temps[index]) = item;
    }
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 9) < 0) __PYX_ERR(0, 1381, __pyx_L1_error)
    __pyx_t_14 = NULL;
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __pyx_t_14 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 1381, __pyx_L1_error)
    __pyx_L5_unpacking_done:;
  }
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_cur_scope->__pyx_v_x = __pyx_t_5;
  __pyx_t_5 = 0;
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_cur_scope->__pyx_v_y = __pyx_t_4;
  __pyx_t_4 = 0;
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_cur_scope->__pyx_v_rx = __pyx_t_6;
  __pyx_t_6 = 0;
  __Pyx_GIVEREF(__pyx_t_7);
  __pyx_cur_scope->__pyx_v_ry = __pyx_t_7;
  __pyx_t_7 = 0;
  __Pyx_GIVEREF(__pyx_t_8);
  __pyx_cur_scope->__pyx_v_sx = __pyx_t_8;
  __pyx_t_8 = 0;
  __Pyx_GIVEREF(__pyx_t_9);
  __pyx_cur_scope->__pyx_v_sy = __pyx_t_9;
  __pyx_t_9 = 0;
  __Pyx_GIVEREF(__pyx_t_10);
  __pyx_cur_scope->__pyx_v_ex = __pyx_t_10;
  __pyx_t_10 = 0;
  __Pyx_GIVEREF(__pyx_t_11);
  __pyx_cur_scope->__pyx_v_ey = __pyx_t_11;
  __pyx_t_11 = 0;
  __Pyx_GIVEREF(__pyx_t_12);
  __pyx_cur_scope->__pyx_v_large_arc = __pyx_t_12;
  __pyx_t_12 = 0;

  /* "mathics/builtin/graphics.py":1383
 *         x, y, rx, ry, sx, sy, ex, ey, large_arc = self._arc_params()
 * 
 *         def path(closed):             # <<<<<<<<<<<<<<
 *             if closed:
 *                 yield "M %f,%f" % (x, y)
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_7_ArcBox_6to_svg_1path, 0, __pyx_n_s_ArcBox_to_svg_locals_path, ((PyObject*)__pyx_cur_scope), __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__38)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1383, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_path = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1395
 *                 yield "Z"
 * 
 *         l = self.style.get_line_width(face_element=self.face_element)             # <<<<<<<<<<<<<<
 *         style = create_css(self.edge_color, self.face_color, stroke_width=l)
 *         return '<path d="%s" style="%s" />' % (" ".join(path(self.face_element)), style)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_style); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1395, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_get_line_width); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1395, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1395, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_face_element); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1395, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_face_element, __pyx_t_11) < 0) __PYX_ERR(0, 1395, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1395, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_l = __pyx_t_11;
  __pyx_t_11 = 0;

  /* "mathics/builtin/graphics.py":1396
 * 
 *         l = self.style.get_line_width(face_element=self.face_element)
 *         style = create_css(self.edge_color, self.face_color, stroke_width=l)             # <<<<<<<<<<<<<<
 *         return '<path d="%s" style="%s" />' % (" ".join(path(self.face_element)), style)
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_create_css); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1396, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_edge_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1396, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_face_color); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1396, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1396, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_12);
  PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_12);
  __pyx_t_1 = 0;
  __pyx_t_12 = 0;
  __pyx_t_12 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1396, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_stroke_width, __pyx_v_l) < 0) __PYX_ERR(0, 1396, __pyx_L1_error)
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_10, __pyx_t_12); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1396, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __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_v_style = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1397
 *         l = self.style.get_line_width(face_element=self.face_element)
 *         style = create_css(self.edge_color, self.face_color, stroke_width=l)
 *         return '<path d="%s" style="%s" />' % (" ".join(path(self.face_element)), style)             # <<<<<<<<<<<<<<
 * 
 *     def to_asy(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1397, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_15 = 0;
  __pyx_t_16 = 127;
  __Pyx_INCREF(__pyx_kp_u_path_d);
  __pyx_t_15 += 9;
  __Pyx_GIVEREF(__pyx_kp_u_path_d);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_path_d);
  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_face_element); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1397, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_10 = __pyx_pf_7mathics_7builtin_8graphics_7_ArcBox_6to_svg_path(__pyx_v_path, __pyx_t_12); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1397, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = PyUnicode_Join(__pyx_kp_u__7, __pyx_t_10); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1397, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_16 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_12) > __pyx_t_16) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_12) : __pyx_t_16;
  __pyx_t_15 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_12);
  __Pyx_GIVEREF(__pyx_t_12);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_12);
  __pyx_t_12 = 0;
  __Pyx_INCREF(__pyx_kp_u_style_2);
  __pyx_t_15 += 9;
  __Pyx_GIVEREF(__pyx_kp_u_style_2);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_style_2);
  __pyx_t_12 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_style), __pyx_empty_unicode); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1397, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_16 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_12) > __pyx_t_16) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_12) : __pyx_t_16;
  __pyx_t_15 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_12);
  __Pyx_GIVEREF(__pyx_t_12);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_12);
  __pyx_t_12 = 0;
  __Pyx_INCREF(__pyx_kp_u__30);
  __pyx_t_15 += 4;
  __Pyx_GIVEREF(__pyx_kp_u__30);
  PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u__30);
  __pyx_t_12 = __Pyx_PyUnicode_Join(__pyx_t_1, 5, __pyx_t_15, __pyx_t_16); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1397, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_12;
  __pyx_t_12 = 0;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":1377
 *         return x, y, abs(rx), abs(ry), sx, sy, ex, ey, large_arc
 * 
 *     def to_svg(self):             # <<<<<<<<<<<<<<
 *         if self.arc is None:
 *             return super(_ArcBox, self).to_svg()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("mathics.builtin.graphics._ArcBox.to_svg", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_path);
  __Pyx_XDECREF(__pyx_v_l);
  __Pyx_XDECREF(__pyx_v_style);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":1399
 *         return '<path d="%s" style="%s" />' % (" ".join(path(self.face_element)), style)
 * 
 *     def to_asy(self):             # <<<<<<<<<<<<<<
 *         if self.arc is None:
 *             return super(_ArcBox, self).to_asy()
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_7_ArcBox_7to_asy(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_7_ArcBox_7to_asy = {"to_asy", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_7_ArcBox_7to_asy, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_7_ArcBox_7to_asy(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_asy (wrapper)", 0);
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_7_ArcBox_6to_asy(__pyx_self, ((PyObject *)__pyx_v_self));

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

/* "mathics/builtin/graphics.py":1405
 *         x, y, rx, ry, sx, sy, ex, ey, large_arc = self._arc_params()
 * 
 *         def path(closed):             # <<<<<<<<<<<<<<
 *             if closed:
 *                 yield "(%s,%s)--(%s,%s)--" % tuple(
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_7_ArcBox_6to_asy_1path(PyObject *__pyx_self, PyObject *__pyx_v_closed); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_7_ArcBox_6to_asy_1path = {"path", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_7_ArcBox_6to_asy_1path, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_7_ArcBox_6to_asy_1path(PyObject *__pyx_self, PyObject *__pyx_v_closed) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("path (wrapper)", 0);
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_7_ArcBox_6to_asy_path(__pyx_self, ((PyObject *)__pyx_v_closed));

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

/* "mathics/builtin/graphics.py":1408
 *             if closed:
 *                 yield "(%s,%s)--(%s,%s)--" % tuple(
 *                     asy_number(t) for t in (x, y, sx, sy)             # <<<<<<<<<<<<<<
 *                 )
 * 
 */

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_7_ArcBox_6to_asy_4path_genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_14_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_7mathics_7builtin_8graphics___pyx_scope_struct_14_genexpr *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_14_genexpr(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_14_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_14_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1408, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_13_path *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7mathics_7builtin_8graphics_7_ArcBox_6to_asy_4path_2generator13, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_ArcBox_to_asy_locals_path_local, __pyx_n_s_mathics_builtin_graphics); if (unlikely(!gen)) __PYX_ERR(0, 1408, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics._ArcBox.to_asy.path.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_7mathics_7builtin_8graphics_7_ArcBox_6to_asy_4path_2generator13(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_14_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_14_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1408, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_x)) { __Pyx_RaiseClosureNameError("x"); __PYX_ERR(0, 1408, __pyx_L1_error) }
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_y)) { __Pyx_RaiseClosureNameError("y"); __PYX_ERR(0, 1408, __pyx_L1_error) }
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_sx)) { __Pyx_RaiseClosureNameError("sx"); __PYX_ERR(0, 1408, __pyx_L1_error) }
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_sy)) { __Pyx_RaiseClosureNameError("sy"); __PYX_ERR(0, 1408, __pyx_L1_error) }
  __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1408, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_x);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_x);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_x);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_y);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_y);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_y);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_sx);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_sx);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_sx);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_sy);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_sy);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_sy);
  __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (__pyx_t_3 >= 4) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 1408, __pyx_L1_error)
    #else
    __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1408, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    #endif
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_t);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_t, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_asy_number); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1408, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_cur_scope->__pyx_v_t) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_cur_scope->__pyx_v_t);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1408, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    __Pyx_XGIVEREF(__pyx_t_2);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_1 = __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_2 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_2);
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_1;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1408, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  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("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7mathics_7builtin_8graphics_7_ArcBox_6to_asy_4path_5generator14(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "mathics/builtin/graphics.py":1412
 * 
 *             yield "arc((%s,%s), (%s, %s), (%s, %s))" % tuple(
 *                 asy_number(t) for t in (x, y, sx, sy, ex, ey)             # <<<<<<<<<<<<<<
 *             )
 * 
 */

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_7_ArcBox_6to_asy_4path_3genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_15_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_7mathics_7builtin_8graphics___pyx_scope_struct_15_genexpr *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_15_genexpr(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_15_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_15_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1412, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_13_path *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7mathics_7builtin_8graphics_7_ArcBox_6to_asy_4path_5generator14, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_ArcBox_to_asy_locals_path_local, __pyx_n_s_mathics_builtin_graphics); if (unlikely(!gen)) __PYX_ERR(0, 1412, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics._ArcBox.to_asy.path.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_7mathics_7builtin_8graphics_7_ArcBox_6to_asy_4path_5generator14(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_15_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_15_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1412, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_x)) { __Pyx_RaiseClosureNameError("x"); __PYX_ERR(0, 1412, __pyx_L1_error) }
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_y)) { __Pyx_RaiseClosureNameError("y"); __PYX_ERR(0, 1412, __pyx_L1_error) }
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_sx)) { __Pyx_RaiseClosureNameError("sx"); __PYX_ERR(0, 1412, __pyx_L1_error) }
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_sy)) { __Pyx_RaiseClosureNameError("sy"); __PYX_ERR(0, 1412, __pyx_L1_error) }
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_ex)) { __Pyx_RaiseClosureNameError("ex"); __PYX_ERR(0, 1412, __pyx_L1_error) }
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_ey)) { __Pyx_RaiseClosureNameError("ey"); __PYX_ERR(0, 1412, __pyx_L1_error) }
  __pyx_t_1 = PyTuple_New(6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1412, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_x);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_x);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_x);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_y);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_y);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_y);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_sx);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_sx);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_sx);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_sy);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_sy);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_sy);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_ex);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_ex);
  PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_ex);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_ey);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_ey);
  PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_ey);
  __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (__pyx_t_3 >= 6) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 1412, __pyx_L1_error)
    #else
    __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1412, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    #endif
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_t);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_t, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_asy_number); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1412, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_cur_scope->__pyx_v_t) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_cur_scope->__pyx_v_t);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1412, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    __Pyx_XGIVEREF(__pyx_t_2);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_1 = __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_2 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_2);
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_1;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1412, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  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("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":1405
 *         x, y, rx, ry, sx, sy, ex, ey, large_arc = self._arc_params()
 * 
 *         def path(closed):             # <<<<<<<<<<<<<<
 *             if closed:
 *                 yield "(%s,%s)--(%s,%s)--" % tuple(
 */

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_7_ArcBox_6to_asy_path(PyObject *__pyx_self, PyObject *__pyx_v_closed) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_13_path *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("path", 0);
  __pyx_cur_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_13_path *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_13_path(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_13_path, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_13_path *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1405, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_12_to_asy *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  __pyx_cur_scope->__pyx_v_closed = __pyx_v_closed;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_closed);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_closed);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7mathics_7builtin_8graphics_7_ArcBox_6to_asy_2generator12, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_path, __pyx_n_s_ArcBox_to_asy_locals_path, __pyx_n_s_mathics_builtin_graphics); if (unlikely(!gen)) __PYX_ERR(0, 1405, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics._ArcBox.to_asy.path", __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_7mathics_7builtin_8graphics_7_ArcBox_6to_asy_2generator12(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_13_path *__pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_13_path *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("path", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L5_resume_from_yield;
    case 2: goto __pyx_L6_resume_from_yield;
    case 3: goto __pyx_L8_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1405, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1406
 * 
 *         def path(closed):
 *             if closed:             # <<<<<<<<<<<<<<
 *                 yield "(%s,%s)--(%s,%s)--" % tuple(
 *                     asy_number(t) for t in (x, y, sx, sy)
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_closed); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1406, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "mathics/builtin/graphics.py":1408
 *             if closed:
 *                 yield "(%s,%s)--(%s,%s)--" % tuple(
 *                     asy_number(t) for t in (x, y, sx, sy)             # <<<<<<<<<<<<<<
 *                 )
 * 
 */
    __pyx_t_2 = __pyx_pf_7mathics_7builtin_8graphics_7_ArcBox_6to_asy_4path_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1408, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "mathics/builtin/graphics.py":1407
 *         def path(closed):
 *             if closed:
 *                 yield "(%s,%s)--(%s,%s)--" % tuple(             # <<<<<<<<<<<<<<
 *                     asy_number(t) for t in (x, y, sx, sy)
 *                 )
 */
    __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1407, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyUnicode_Format(__pyx_kp_u_s_s_s_s, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1407, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L5_resume_from_yield:;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1407, __pyx_L1_error)

    /* "mathics/builtin/graphics.py":1406
 * 
 *         def path(closed):
 *             if closed:             # <<<<<<<<<<<<<<
 *                 yield "(%s,%s)--(%s,%s)--" % tuple(
 *                     asy_number(t) for t in (x, y, sx, sy)
 */
  }

  /* "mathics/builtin/graphics.py":1412
 * 
 *             yield "arc((%s,%s), (%s, %s), (%s, %s))" % tuple(
 *                 asy_number(t) for t in (x, y, sx, sy, ex, ey)             # <<<<<<<<<<<<<<
 *             )
 * 
 */
  __pyx_t_2 = __pyx_pf_7mathics_7builtin_8graphics_7_ArcBox_6to_asy_4path_3genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1412, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "mathics/builtin/graphics.py":1411
 *                 )
 * 
 *             yield "arc((%s,%s), (%s, %s), (%s, %s))" % tuple(             # <<<<<<<<<<<<<<
 *                 asy_number(t) for t in (x, y, sx, sy, ex, ey)
 *             )
 */
  __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1411, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyUnicode_Format(__pyx_kp_u_arc_s_s_s_s_s_s, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1411, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  /* return from generator, yielding value */
  __pyx_generator->resume_label = 2;
  return __pyx_r;
  __pyx_L6_resume_from_yield:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1411, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1415
 *             )
 * 
 *             if closed:             # <<<<<<<<<<<<<<
 *                 yield "--cycle"
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_closed); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1415, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "mathics/builtin/graphics.py":1416
 * 
 *             if closed:
 *                 yield "--cycle"             # <<<<<<<<<<<<<<
 * 
 *         l = self.style.get_line_width(face_element=self.face_element)
 */
    __Pyx_INCREF(__pyx_kp_u_cycle_2);
    __pyx_r = __pyx_kp_u_cycle_2;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 3;
    return __pyx_r;
    __pyx_L8_resume_from_yield:;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1416, __pyx_L1_error)

    /* "mathics/builtin/graphics.py":1415
 *             )
 * 
 *             if closed:             # <<<<<<<<<<<<<<
 *                 yield "--cycle"
 * 
 */
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "mathics/builtin/graphics.py":1405
 *         x, y, rx, ry, sx, sy, ex, ey, large_arc = self._arc_params()
 * 
 *         def path(closed):             # <<<<<<<<<<<<<<
 *             if closed:
 *                 yield "(%s,%s)--(%s,%s)--" % tuple(
 */

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

/* "mathics/builtin/graphics.py":1399
 *         return '<path d="%s" style="%s" />' % (" ".join(path(self.face_element)), style)
 * 
 *     def to_asy(self):             # <<<<<<<<<<<<<<
 *         if self.arc is None:
 *             return super(_ArcBox, self).to_asy()
 */

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_7_ArcBox_6to_asy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_12_to_asy *__pyx_cur_scope;
  CYTHON_UNUSED PyObject *__pyx_v_rx = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_ry = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_large_arc = NULL;
  PyObject *__pyx_v_path = 0;
  PyObject *__pyx_v_l = NULL;
  PyObject *__pyx_v_pen = NULL;
  PyObject *__pyx_v_command = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *(*__pyx_t_14)(PyObject *);
  Py_ssize_t __pyx_t_15;
  Py_UCS4 __pyx_t_16;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_asy", 0);
  __pyx_cur_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_12_to_asy *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_12_to_asy(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_12_to_asy, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_12_to_asy *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1399, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }

  /* "mathics/builtin/graphics.py":1400
 * 
 *     def to_asy(self):
 *         if self.arc is None:             # <<<<<<<<<<<<<<
 *             return super(_ArcBox, self).to_asy()
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_arc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1400, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__pyx_t_1 == Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "mathics/builtin/graphics.py":1401
 *     def to_asy(self):
 *         if self.arc is None:
 *             return super(_ArcBox, self).to_asy()             # <<<<<<<<<<<<<<
 * 
 *         x, y, rx, ry, sx, sy, ex, ey, large_arc = self._arc_params()
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ArcBox); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1401, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1401, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
    __Pyx_INCREF(__pyx_v_self);
    __Pyx_GIVEREF(__pyx_v_self);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_self);
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1401, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_to_asy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1401, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1401, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "mathics/builtin/graphics.py":1400
 * 
 *     def to_asy(self):
 *         if self.arc is None:             # <<<<<<<<<<<<<<
 *             return super(_ArcBox, self).to_asy()
 * 
 */
  }

  /* "mathics/builtin/graphics.py":1403
 *             return super(_ArcBox, self).to_asy()
 * 
 *         x, y, rx, ry, sx, sy, ex, ey, large_arc = self._arc_params()             # <<<<<<<<<<<<<<
 * 
 *         def path(closed):
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_arc_params); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1403, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1403, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
    PyObject* sequence = __pyx_t_1;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 9)) {
      if (size > 9) __Pyx_RaiseTooManyValuesError(9);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 1403, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
      __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); 
      __pyx_t_7 = PyTuple_GET_ITEM(sequence, 3); 
      __pyx_t_8 = PyTuple_GET_ITEM(sequence, 4); 
      __pyx_t_9 = PyTuple_GET_ITEM(sequence, 5); 
      __pyx_t_10 = PyTuple_GET_ITEM(sequence, 6); 
      __pyx_t_11 = PyTuple_GET_ITEM(sequence, 7); 
      __pyx_t_12 = PyTuple_GET_ITEM(sequence, 8); 
    } else {
      __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_4 = PyList_GET_ITEM(sequence, 1); 
      __pyx_t_6 = PyList_GET_ITEM(sequence, 2); 
      __pyx_t_7 = PyList_GET_ITEM(sequence, 3); 
      __pyx_t_8 = PyList_GET_ITEM(sequence, 4); 
      __pyx_t_9 = PyList_GET_ITEM(sequence, 5); 
      __pyx_t_10 = PyList_GET_ITEM(sequence, 6); 
      __pyx_t_11 = PyList_GET_ITEM(sequence, 7); 
      __pyx_t_12 = PyList_GET_ITEM(sequence, 8); 
    }
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_t_7);
    __Pyx_INCREF(__pyx_t_8);
    __Pyx_INCREF(__pyx_t_9);
    __Pyx_INCREF(__pyx_t_10);
    __Pyx_INCREF(__pyx_t_11);
    __Pyx_INCREF(__pyx_t_12);
    #else
    {
      Py_ssize_t i;
      PyObject** temps[9] = {&__pyx_t_5,&__pyx_t_4,&__pyx_t_6,&__pyx_t_7,&__pyx_t_8,&__pyx_t_9,&__pyx_t_10,&__pyx_t_11,&__pyx_t_12};
      for (i=0; i < 9; i++) {
        PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 1403, __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[9] = {&__pyx_t_5,&__pyx_t_4,&__pyx_t_6,&__pyx_t_7,&__pyx_t_8,&__pyx_t_9,&__pyx_t_10,&__pyx_t_11,&__pyx_t_12};
    __pyx_t_13 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1403, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_14 = Py_TYPE(__pyx_t_13)->tp_iternext;
    for (index=0; index < 9; index++) {
      PyObject* item = __pyx_t_14(__pyx_t_13); if (unlikely(!item)) goto __pyx_L4_unpacking_failed;
      __Pyx_GOTREF(item);
      *(temps[index]) = item;
    }
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 9) < 0) __PYX_ERR(0, 1403, __pyx_L1_error)
    __pyx_t_14 = NULL;
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __pyx_t_14 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 1403, __pyx_L1_error)
    __pyx_L5_unpacking_done:;
  }
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_cur_scope->__pyx_v_x = __pyx_t_5;
  __pyx_t_5 = 0;
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_cur_scope->__pyx_v_y = __pyx_t_4;
  __pyx_t_4 = 0;
  __pyx_v_rx = __pyx_t_6;
  __pyx_t_6 = 0;
  __pyx_v_ry = __pyx_t_7;
  __pyx_t_7 = 0;
  __Pyx_GIVEREF(__pyx_t_8);
  __pyx_cur_scope->__pyx_v_sx = __pyx_t_8;
  __pyx_t_8 = 0;
  __Pyx_GIVEREF(__pyx_t_9);
  __pyx_cur_scope->__pyx_v_sy = __pyx_t_9;
  __pyx_t_9 = 0;
  __Pyx_GIVEREF(__pyx_t_10);
  __pyx_cur_scope->__pyx_v_ex = __pyx_t_10;
  __pyx_t_10 = 0;
  __Pyx_GIVEREF(__pyx_t_11);
  __pyx_cur_scope->__pyx_v_ey = __pyx_t_11;
  __pyx_t_11 = 0;
  __pyx_v_large_arc = __pyx_t_12;
  __pyx_t_12 = 0;

  /* "mathics/builtin/graphics.py":1405
 *         x, y, rx, ry, sx, sy, ex, ey, large_arc = self._arc_params()
 * 
 *         def path(closed):             # <<<<<<<<<<<<<<
 *             if closed:
 *                 yield "(%s,%s)--(%s,%s)--" % tuple(
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_7_ArcBox_6to_asy_1path, 0, __pyx_n_s_ArcBox_to_asy_locals_path, ((PyObject*)__pyx_cur_scope), __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__40)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1405, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_path = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1418
 *                 yield "--cycle"
 * 
 *         l = self.style.get_line_width(face_element=self.face_element)             # <<<<<<<<<<<<<<
 *         pen = create_pens(
 *             edge_color=self.edge_color,
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_style); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1418, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_get_line_width); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1418, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1418, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_face_element); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1418, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_face_element, __pyx_t_11) < 0) __PYX_ERR(0, 1418, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1418, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_l = __pyx_t_11;
  __pyx_t_11 = 0;

  /* "mathics/builtin/graphics.py":1419
 * 
 *         l = self.style.get_line_width(face_element=self.face_element)
 *         pen = create_pens(             # <<<<<<<<<<<<<<
 *             edge_color=self.edge_color,
 *             face_color=self.face_color,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_create_pens); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1419, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);

  /* "mathics/builtin/graphics.py":1420
 *         l = self.style.get_line_width(face_element=self.face_element)
 *         pen = create_pens(
 *             edge_color=self.edge_color,             # <<<<<<<<<<<<<<
 *             face_color=self.face_color,
 *             stroke_width=l,
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_edge_color); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_edge_color, __pyx_t_12) < 0) __PYX_ERR(0, 1420, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

  /* "mathics/builtin/graphics.py":1421
 *         pen = create_pens(
 *             edge_color=self.edge_color,
 *             face_color=self.face_color,             # <<<<<<<<<<<<<<
 *             stroke_width=l,
 *             is_face_element=self.face_element,
 */
  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_face_color); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1421, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_face_color, __pyx_t_12) < 0) __PYX_ERR(0, 1420, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

  /* "mathics/builtin/graphics.py":1422
 *             edge_color=self.edge_color,
 *             face_color=self.face_color,
 *             stroke_width=l,             # <<<<<<<<<<<<<<
 *             is_face_element=self.face_element,
 *         )
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_stroke_width, __pyx_v_l) < 0) __PYX_ERR(0, 1420, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1423
 *             face_color=self.face_color,
 *             stroke_width=l,
 *             is_face_element=self.face_element,             # <<<<<<<<<<<<<<
 *         )
 *         command = "filldraw" if self.face_element else "draw"
 */
  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_face_element); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1423, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_is_face_element, __pyx_t_12) < 0) __PYX_ERR(0, 1420, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

  /* "mathics/builtin/graphics.py":1419
 * 
 *         l = self.style.get_line_width(face_element=self.face_element)
 *         pen = create_pens(             # <<<<<<<<<<<<<<
 *             edge_color=self.edge_color,
 *             face_color=self.face_color,
 */
  __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1419, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_pen = __pyx_t_12;
  __pyx_t_12 = 0;

  /* "mathics/builtin/graphics.py":1425
 *             is_face_element=self.face_element,
 *         )
 *         command = "filldraw" if self.face_element else "draw"             # <<<<<<<<<<<<<<
 *         return "%s(%s, %s);" % (command, "".join(path(self.face_element)), pen)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_face_element); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1425, __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(0, 1425, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {
    __Pyx_INCREF(__pyx_n_u_filldraw_2);
    __pyx_t_12 = __pyx_n_u_filldraw_2;
  } else {
    __Pyx_INCREF(__pyx_n_u_draw);
    __pyx_t_12 = __pyx_n_u_draw;
  }
  __pyx_v_command = ((PyObject*)__pyx_t_12);
  __pyx_t_12 = 0;

  /* "mathics/builtin/graphics.py":1426
 *         )
 *         command = "filldraw" if self.face_element else "draw"
 *         return "%s(%s, %s);" % (command, "".join(path(self.face_element)), pen)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_12 = PyTuple_New(6); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1426, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_15 = 0;
  __pyx_t_16 = 127;
  __pyx_t_1 = __Pyx_PyUnicode_Unicode(__pyx_v_command); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1426, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_16 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_16) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_16;
  __pyx_t_15 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __Pyx_INCREF(__pyx_kp_u__9);
  __pyx_t_15 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__9);
  PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_kp_u__9);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_face_element); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1426, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_11 = __pyx_pf_7mathics_7builtin_8graphics_7_ArcBox_6to_asy_path(__pyx_v_path, __pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1426, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyUnicode_Join(__pyx_kp_u__41, __pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1426, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_16 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_16) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_16;
  __pyx_t_15 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_t_1);
  __pyx_t_1 = 0;
  __Pyx_INCREF(__pyx_kp_u__4);
  __pyx_t_15 += 2;
  __Pyx_GIVEREF(__pyx_kp_u__4);
  PyTuple_SET_ITEM(__pyx_t_12, 3, __pyx_kp_u__4);
  __pyx_t_1 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_pen), __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1426, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_16 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_16) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_16;
  __pyx_t_15 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_12, 4, __pyx_t_1);
  __pyx_t_1 = 0;
  __Pyx_INCREF(__pyx_kp_u__33);
  __pyx_t_15 += 2;
  __Pyx_GIVEREF(__pyx_kp_u__33);
  PyTuple_SET_ITEM(__pyx_t_12, 5, __pyx_kp_u__33);
  __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_12, 6, __pyx_t_15, __pyx_t_16); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1426, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":1399
 *         return '<path d="%s" style="%s" />' % (" ".join(path(self.face_element)), style)
 * 
 *     def to_asy(self):             # <<<<<<<<<<<<<<
 *         if self.arc is None:
 *             return super(_ArcBox, self).to_asy()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("mathics.builtin.graphics._ArcBox.to_asy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_rx);
  __Pyx_XDECREF(__pyx_v_ry);
  __Pyx_XDECREF(__pyx_v_large_arc);
  __Pyx_XDECREF(__pyx_v_path);
  __Pyx_XDECREF(__pyx_v_l);
  __Pyx_XDECREF(__pyx_v_pen);
  __Pyx_XDECREF(__pyx_v_command);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":1438
 * 
 * class _Polyline(_GraphicsElement):
 *     def do_init(self, graphics, points):             # <<<<<<<<<<<<<<
 *         if not points.has_form("List", None):
 *             raise BoxConstructError
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_9_Polyline_1do_init(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_9_Polyline_1do_init = {"do_init", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_9_Polyline_1do_init, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_9_Polyline_1do_init(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_graphics = 0;
  PyObject *__pyx_v_points = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("do_init (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_graphics,&__pyx_n_s_points,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_graphics)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("do_init", 1, 3, 3, 1); __PYX_ERR(0, 1438, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_points)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("do_init", 1, 3, 3, 2); __PYX_ERR(0, 1438, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "do_init") < 0)) __PYX_ERR(0, 1438, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_self = values[0];
    __pyx_v_graphics = values[1];
    __pyx_v_points = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("do_init", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1438, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics._Polyline.do_init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_9_Polyline_do_init(__pyx_self, __pyx_v_self, __pyx_v_graphics, __pyx_v_points);

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

/* "mathics/builtin/graphics.py":1444
 *             points.leaves
 *             and points.leaves[0].has_form("List", None)
 *             and all(leaf.has_form("List", None) for leaf in points.leaves[0].leaves)             # <<<<<<<<<<<<<<
 *         ):
 *             leaves = points.leaves
 */

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_9_Polyline_7do_init_genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_17_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_17_genexpr *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_17_genexpr(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_17_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_17_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1444, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_16_do_init *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7mathics_7builtin_8graphics_9_Polyline_7do_init_2generator15, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_Polyline_do_init_locals_genexpr, __pyx_n_s_mathics_builtin_graphics); if (unlikely(!gen)) __PYX_ERR(0, 1444, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics._Polyline.do_init.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_7mathics_7builtin_8graphics_9_Polyline_7do_init_2generator15(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_17_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_17_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1444, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_points)) { __Pyx_RaiseClosureNameError("points"); __PYX_ERR(0, 1444, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_points, __pyx_n_s_leaves); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1444, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1444, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_leaves); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1444, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_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(0, 1444, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1444, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 1444, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1444, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 1444, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1444, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1444, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_leaf);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_leaf, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_leaf, __pyx_n_s_has_form); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1444, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1444, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 1444, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_7 = ((!__pyx_t_6) != 0);
    if (__pyx_t_7) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_False);
      __pyx_r = Py_False;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      goto __pyx_L0;
    }
  }
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_True);
    __pyx_r = Py_True;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

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

/* "mathics/builtin/graphics.py":1438
 * 
 * class _Polyline(_GraphicsElement):
 *     def do_init(self, graphics, points):             # <<<<<<<<<<<<<<
 *         if not points.has_form("List", None):
 *             raise BoxConstructError
 */

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_9_Polyline_do_init(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_graphics, PyObject *__pyx_v_points) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_16_do_init *__pyx_cur_scope;
  PyObject *__pyx_v_leaves = NULL;
  PyObject *__pyx_v_lines = NULL;
  PyObject *__pyx_v_leaf = NULL;
  PyObject *__pyx_9genexpr17__pyx_v_line = NULL;
  PyObject *__pyx_9genexpr18__pyx_v_point = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  Py_ssize_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("do_init", 0);
  __pyx_cur_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_16_do_init *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_16_do_init(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_16_do_init, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_16_do_init *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1438, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_points = __pyx_v_points;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_points);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_points);

  /* "mathics/builtin/graphics.py":1439
 * class _Polyline(_GraphicsElement):
 *     def do_init(self, graphics, points):
 *         if not points.has_form("List", None):             # <<<<<<<<<<<<<<
 *             raise BoxConstructError
 *         if (
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_points, __pyx_n_s_has_form); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1439, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1439, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1439, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = ((!__pyx_t_3) != 0);
  if (unlikely(__pyx_t_4)) {

    /* "mathics/builtin/graphics.py":1440
 *     def do_init(self, graphics, points):
 *         if not points.has_form("List", None):
 *             raise BoxConstructError             # <<<<<<<<<<<<<<
 *         if (
 *             points.leaves
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_BoxConstructError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1440, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 1440, __pyx_L1_error)

    /* "mathics/builtin/graphics.py":1439
 * class _Polyline(_GraphicsElement):
 *     def do_init(self, graphics, points):
 *         if not points.has_form("List", None):             # <<<<<<<<<<<<<<
 *             raise BoxConstructError
 *         if (
 */
  }

  /* "mathics/builtin/graphics.py":1442
 *             raise BoxConstructError
 *         if (
 *             points.leaves             # <<<<<<<<<<<<<<
 *             and points.leaves[0].has_form("List", None)
 *             and all(leaf.has_form("List", None) for leaf in points.leaves[0].leaves)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_points, __pyx_n_s_leaves); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1442, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1442, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {
  } else {
    __pyx_t_4 = __pyx_t_3;
    goto __pyx_L5_bool_binop_done;
  }

  /* "mathics/builtin/graphics.py":1443
 *         if (
 *             points.leaves
 *             and points.leaves[0].has_form("List", None)             # <<<<<<<<<<<<<<
 *             and all(leaf.has_form("List", None) for leaf in points.leaves[0].leaves)
 *         ):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_points, __pyx_n_s_leaves); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1443, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1443, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_has_form); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1443, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1443, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1443, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {
  } else {
    __pyx_t_4 = __pyx_t_3;
    goto __pyx_L5_bool_binop_done;
  }

  /* "mathics/builtin/graphics.py":1444
 *             points.leaves
 *             and points.leaves[0].has_form("List", None)
 *             and all(leaf.has_form("List", None) for leaf in points.leaves[0].leaves)             # <<<<<<<<<<<<<<
 *         ):
 *             leaves = points.leaves
 */
  __pyx_t_1 = __pyx_pf_7mathics_7builtin_8graphics_9_Polyline_7do_init_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1444, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_Generator_Next(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1444, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1444, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __pyx_t_3;
  __pyx_L5_bool_binop_done:;

  /* "mathics/builtin/graphics.py":1441
 *         if not points.has_form("List", None):
 *             raise BoxConstructError
 *         if (             # <<<<<<<<<<<<<<
 *             points.leaves
 *             and points.leaves[0].has_form("List", None)
 */
  if (__pyx_t_4) {

    /* "mathics/builtin/graphics.py":1446
 *             and all(leaf.has_form("List", None) for leaf in points.leaves[0].leaves)
 *         ):
 *             leaves = points.leaves             # <<<<<<<<<<<<<<
 *             self.multi_parts = True
 *         else:
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_points, __pyx_n_s_leaves); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1446, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_leaves = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "mathics/builtin/graphics.py":1447
 *         ):
 *             leaves = points.leaves
 *             self.multi_parts = True             # <<<<<<<<<<<<<<
 *         else:
 *             leaves = [Expression("List", *points.leaves)]
 */
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_multi_parts, Py_True) < 0) __PYX_ERR(0, 1447, __pyx_L1_error)

    /* "mathics/builtin/graphics.py":1441
 *         if not points.has_form("List", None):
 *             raise BoxConstructError
 *         if (             # <<<<<<<<<<<<<<
 *             points.leaves
 *             and points.leaves[0].has_form("List", None)
 */
    goto __pyx_L4;
  }

  /* "mathics/builtin/graphics.py":1449
 *             self.multi_parts = True
 *         else:
 *             leaves = [Expression("List", *points.leaves)]             # <<<<<<<<<<<<<<
 *             self.multi_parts = False
 *         lines = []
 */
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Expression); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1449, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_points, __pyx_n_s_leaves); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1449, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1449, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyNumber_Add(__pyx_tuple__11, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1449, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1449, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1449, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_5);
    PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_v_leaves = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "mathics/builtin/graphics.py":1450
 *         else:
 *             leaves = [Expression("List", *points.leaves)]
 *             self.multi_parts = False             # <<<<<<<<<<<<<<
 *         lines = []
 *         for leaf in leaves:
 */
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_multi_parts, Py_False) < 0) __PYX_ERR(0, 1450, __pyx_L1_error)
  }
  __pyx_L4:;

  /* "mathics/builtin/graphics.py":1451
 *             leaves = [Expression("List", *points.leaves)]
 *             self.multi_parts = False
 *         lines = []             # <<<<<<<<<<<<<<
 *         for leaf in leaves:
 *             if leaf.has_form("List", None):
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1451, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_lines = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1452
 *             self.multi_parts = False
 *         lines = []
 *         for leaf in leaves:             # <<<<<<<<<<<<<<
 *             if leaf.has_form("List", None):
 *                 lines.append(leaf.leaves)
 */
  if (likely(PyList_CheckExact(__pyx_v_leaves)) || PyTuple_CheckExact(__pyx_v_leaves)) {
    __pyx_t_1 = __pyx_v_leaves; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = 0;
    __pyx_t_7 = NULL;
  } else {
    __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_leaves); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1452, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1452, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_7)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 1452, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1452, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      } else {
        if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 1452, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1452, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      }
    } else {
      __pyx_t_5 = __pyx_t_7(__pyx_t_1);
      if (unlikely(!__pyx_t_5)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1452, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_XDECREF_SET(__pyx_v_leaf, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "mathics/builtin/graphics.py":1453
 *         lines = []
 *         for leaf in leaves:
 *             if leaf.has_form("List", None):             # <<<<<<<<<<<<<<
 *                 lines.append(leaf.leaves)
 *             else:
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_leaf, __pyx_n_s_has_form); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1453, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1453, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1453, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (likely(__pyx_t_4)) {

      /* "mathics/builtin/graphics.py":1454
 *         for leaf in leaves:
 *             if leaf.has_form("List", None):
 *                 lines.append(leaf.leaves)             # <<<<<<<<<<<<<<
 *             else:
 *                 raise BoxConstructError
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_leaf, __pyx_n_s_leaves); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1454, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_lines, __pyx_t_2); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 1454, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "mathics/builtin/graphics.py":1453
 *         lines = []
 *         for leaf in leaves:
 *             if leaf.has_form("List", None):             # <<<<<<<<<<<<<<
 *                 lines.append(leaf.leaves)
 *             else:
 */
      goto __pyx_L10;
    }

    /* "mathics/builtin/graphics.py":1456
 *                 lines.append(leaf.leaves)
 *             else:
 *                 raise BoxConstructError             # <<<<<<<<<<<<<<
 *         self.lines = [
 *             [graphics.coords(graphics, point) for point in line] for line in lines
 */
    /*else*/ {
      __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_BoxConstructError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1456, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(0, 1456, __pyx_L1_error)
    }
    __pyx_L10:;

    /* "mathics/builtin/graphics.py":1452
 *             self.multi_parts = False
 *         lines = []
 *         for leaf in leaves:             # <<<<<<<<<<<<<<
 *             if leaf.has_form("List", None):
 *                 lines.append(leaf.leaves)
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1457
 *             else:
 *                 raise BoxConstructError
 *         self.lines = [             # <<<<<<<<<<<<<<
 *             [graphics.coords(graphics, point) for point in line] for line in lines
 *         ]
 */
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1457, __pyx_L13_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "mathics/builtin/graphics.py":1458
 *                 raise BoxConstructError
 *         self.lines = [
 *             [graphics.coords(graphics, point) for point in line] for line in lines             # <<<<<<<<<<<<<<
 *         ]
 * 
 */
    __pyx_t_2 = __pyx_v_lines; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0;
    for (;;) {
      if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 1458, __pyx_L13_error)
      #else
      __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1458, __pyx_L13_error)
      __Pyx_GOTREF(__pyx_t_5);
      #endif
      __Pyx_XDECREF_SET(__pyx_9genexpr17__pyx_v_line, __pyx_t_5);
      __pyx_t_5 = 0;
      { /* enter inner scope */
        __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1458, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        if (likely(PyList_CheckExact(__pyx_9genexpr17__pyx_v_line)) || PyTuple_CheckExact(__pyx_9genexpr17__pyx_v_line)) {
          __pyx_t_9 = __pyx_9genexpr17__pyx_v_line; __Pyx_INCREF(__pyx_t_9); __pyx_t_10 = 0;
          __pyx_t_7 = NULL;
        } else {
          __pyx_t_10 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_9genexpr17__pyx_v_line); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1458, __pyx_L18_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_7 = Py_TYPE(__pyx_t_9)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1458, __pyx_L18_error)
        }
        for (;;) {
          if (likely(!__pyx_t_7)) {
            if (likely(PyList_CheckExact(__pyx_t_9))) {
              if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_9)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_11 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_10); __Pyx_INCREF(__pyx_t_11); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 1458, __pyx_L18_error)
              #else
              __pyx_t_11 = PySequence_ITEM(__pyx_t_9, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1458, __pyx_L18_error)
              __Pyx_GOTREF(__pyx_t_11);
              #endif
            } else {
              if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_9)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_11 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_10); __Pyx_INCREF(__pyx_t_11); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 1458, __pyx_L18_error)
              #else
              __pyx_t_11 = PySequence_ITEM(__pyx_t_9, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1458, __pyx_L18_error)
              __Pyx_GOTREF(__pyx_t_11);
              #endif
            }
          } else {
            __pyx_t_11 = __pyx_t_7(__pyx_t_9);
            if (unlikely(!__pyx_t_11)) {
              PyObject* exc_type = PyErr_Occurred();
              if (exc_type) {
                if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                else __PYX_ERR(0, 1458, __pyx_L18_error)
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_11);
          }
          __Pyx_XDECREF_SET(__pyx_9genexpr18__pyx_v_point, __pyx_t_11);
          __pyx_t_11 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_graphics, __pyx_n_s_coords); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1458, __pyx_L18_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_13 = NULL;
          __pyx_t_14 = 0;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_13)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_13);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
              __pyx_t_14 = 1;
            }
          }
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_12)) {
            PyObject *__pyx_temp[3] = {__pyx_t_13, __pyx_v_graphics, __pyx_9genexpr18__pyx_v_point};
            __pyx_t_11 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1458, __pyx_L18_error)
            __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
            __Pyx_GOTREF(__pyx_t_11);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
            PyObject *__pyx_temp[3] = {__pyx_t_13, __pyx_v_graphics, __pyx_9genexpr18__pyx_v_point};
            __pyx_t_11 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1458, __pyx_L18_error)
            __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
            __Pyx_GOTREF(__pyx_t_11);
          } else
          #endif
          {
            __pyx_t_15 = PyTuple_New(2+__pyx_t_14); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1458, __pyx_L18_error)
            __Pyx_GOTREF(__pyx_t_15);
            if (__pyx_t_13) {
              __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_13); __pyx_t_13 = NULL;
            }
            __Pyx_INCREF(__pyx_v_graphics);
            __Pyx_GIVEREF(__pyx_v_graphics);
            PyTuple_SET_ITEM(__pyx_t_15, 0+__pyx_t_14, __pyx_v_graphics);
            __Pyx_INCREF(__pyx_9genexpr18__pyx_v_point);
            __Pyx_GIVEREF(__pyx_9genexpr18__pyx_v_point);
            PyTuple_SET_ITEM(__pyx_t_15, 1+__pyx_t_14, __pyx_9genexpr18__pyx_v_point);
            __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_15, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1458, __pyx_L18_error)
            __Pyx_GOTREF(__pyx_t_11);
            __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_11))) __PYX_ERR(0, 1458, __pyx_L18_error)
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        }
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_XDECREF(__pyx_9genexpr18__pyx_v_point); __pyx_9genexpr18__pyx_v_point = 0;
        goto __pyx_L21_exit_scope;
        __pyx_L18_error:;
        __Pyx_XDECREF(__pyx_9genexpr18__pyx_v_point); __pyx_9genexpr18__pyx_v_point = 0;
        goto __pyx_L13_error;
        __pyx_L21_exit_scope:;
      } /* exit inner scope */
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 1457, __pyx_L13_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_9genexpr17__pyx_v_line); __pyx_9genexpr17__pyx_v_line = 0;
    goto __pyx_L22_exit_scope;
    __pyx_L13_error:;
    __Pyx_XDECREF(__pyx_9genexpr17__pyx_v_line); __pyx_9genexpr17__pyx_v_line = 0;
    goto __pyx_L1_error;
    __pyx_L22_exit_scope:;
  } /* exit inner scope */

  /* "mathics/builtin/graphics.py":1457
 *             else:
 *                 raise BoxConstructError
 *         self.lines = [             # <<<<<<<<<<<<<<
 *             [graphics.coords(graphics, point) for point in line] for line in lines
 *         ]
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_lines, __pyx_t_1) < 0) __PYX_ERR(0, 1457, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1438
 * 
 * class _Polyline(_GraphicsElement):
 *     def do_init(self, graphics, points):             # <<<<<<<<<<<<<<
 *         if not points.has_form("List", None):
 *             raise BoxConstructError
 */

  /* 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_9);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_AddTraceback("mathics.builtin.graphics._Polyline.do_init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_leaves);
  __Pyx_XDECREF(__pyx_v_lines);
  __Pyx_XDECREF(__pyx_v_leaf);
  __Pyx_XDECREF(__pyx_9genexpr17__pyx_v_line);
  __Pyx_XDECREF(__pyx_9genexpr18__pyx_v_point);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":1461
 *         ]
 * 
 *     def extent(self):             # <<<<<<<<<<<<<<
 *         l = self.style.get_line_width(face_element=False)
 *         result = []
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_9_Polyline_3extent(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_9_Polyline_3extent = {"extent", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_9_Polyline_3extent, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_9_Polyline_3extent(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("extent (wrapper)", 0);
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_9_Polyline_2extent(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_9_Polyline_2extent(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_l = NULL;
  PyObject *__pyx_v_result = NULL;
  PyObject *__pyx_v_line = NULL;
  PyObject *__pyx_v_c = NULL;
  PyObject *__pyx_v_x = NULL;
  PyObject *__pyx_v_y = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *(*__pyx_t_11)(PyObject *);
  int __pyx_t_12;
  int __pyx_t_13;
  int __pyx_t_14;
  int __pyx_t_15;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("extent", 0);

  /* "mathics/builtin/graphics.py":1462
 * 
 *     def extent(self):
 *         l = self.style.get_line_width(face_element=False)             # <<<<<<<<<<<<<<
 *         result = []
 *         for line in self.lines:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_style); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1462, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_get_line_width); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1462, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1462, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_face_element, Py_False) < 0) __PYX_ERR(0, 1462, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1462, __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_v_l = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":1463
 *     def extent(self):
 *         l = self.style.get_line_width(face_element=False)
 *         result = []             # <<<<<<<<<<<<<<
 *         for line in self.lines:
 *             for c in line:
 */
  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1463, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_result = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":1464
 *         l = self.style.get_line_width(face_element=False)
 *         result = []
 *         for line in self.lines:             # <<<<<<<<<<<<<<
 *             for c in line:
 *                 x, y = c.pos()
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lines); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1464, __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_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1464, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1464, __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))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 1464, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1464, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 1464, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1464, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      }
    } else {
      __pyx_t_3 = __pyx_t_5(__pyx_t_1);
      if (unlikely(!__pyx_t_3)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1464, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_XDECREF_SET(__pyx_v_line, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "mathics/builtin/graphics.py":1465
 *         result = []
 *         for line in self.lines:
 *             for c in line:             # <<<<<<<<<<<<<<
 *                 x, y = c.pos()
 *                 result.extend(
 */
    if (likely(PyList_CheckExact(__pyx_v_line)) || PyTuple_CheckExact(__pyx_v_line)) {
      __pyx_t_3 = __pyx_v_line; __Pyx_INCREF(__pyx_t_3); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_line); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1465, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_7 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1465, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_7)) {
        if (likely(PyList_CheckExact(__pyx_t_3))) {
          if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 1465, __pyx_L1_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1465, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        } else {
          if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 1465, __pyx_L1_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1465, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        }
      } else {
        __pyx_t_2 = __pyx_t_7(__pyx_t_3);
        if (unlikely(!__pyx_t_2)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 1465, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_XDECREF_SET(__pyx_v_c, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "mathics/builtin/graphics.py":1466
 *         for line in self.lines:
 *             for c in line:
 *                 x, y = c.pos()             # <<<<<<<<<<<<<<
 *                 result.extend(
 *                     [(x - l, y - l), (x - l, y + l), (x + l, y - l), (x + l, y + l)]
 */
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_c, __pyx_n_s_pos); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1466, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
        if (likely(__pyx_t_9)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_8, function);
        }
      }
      __pyx_t_2 = (__pyx_t_9) ? __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_9) : __Pyx_PyObject_CallNoArg(__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1466, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
        PyObject* sequence = __pyx_t_2;
        Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          __PYX_ERR(0, 1466, __pyx_L1_error)
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_8 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_9 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_9);
        #else
        __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1466, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1466, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        #endif
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_10 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1466, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_11 = Py_TYPE(__pyx_t_10)->tp_iternext;
        index = 0; __pyx_t_8 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_8)) goto __pyx_L7_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_8);
        index = 1; __pyx_t_9 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_9)) goto __pyx_L7_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_9);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < 0) __PYX_ERR(0, 1466, __pyx_L1_error)
        __pyx_t_11 = NULL;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        goto __pyx_L8_unpacking_done;
        __pyx_L7_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_11 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        __PYX_ERR(0, 1466, __pyx_L1_error)
        __pyx_L8_unpacking_done:;
      }
      __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_8);
      __pyx_t_8 = 0;
      __Pyx_XDECREF_SET(__pyx_v_y, __pyx_t_9);
      __pyx_t_9 = 0;

      /* "mathics/builtin/graphics.py":1468
 *                 x, y = c.pos()
 *                 result.extend(
 *                     [(x - l, y - l), (x - l, y + l), (x + l, y - l), (x + l, y + l)]             # <<<<<<<<<<<<<<
 *                 )
 *         return result
 */
      __pyx_t_2 = PyNumber_Subtract(__pyx_v_x, __pyx_v_l); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1468, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_9 = PyNumber_Subtract(__pyx_v_y, __pyx_v_l); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1468, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1468, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_9);
      PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_9);
      __pyx_t_2 = 0;
      __pyx_t_9 = 0;

      /* "mathics/builtin/graphics.py":1467
 *             for c in line:
 *                 x, y = c.pos()
 *                 result.extend(             # <<<<<<<<<<<<<<
 *                     [(x - l, y - l), (x - l, y + l), (x + l, y - l), (x + l, y + l)]
 *                 )
 */
      __pyx_t_12 = __Pyx_ListComp_Append(__pyx_v_result, __pyx_t_8); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 1467, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "mathics/builtin/graphics.py":1468
 *                 x, y = c.pos()
 *                 result.extend(
 *                     [(x - l, y - l), (x - l, y + l), (x + l, y - l), (x + l, y + l)]             # <<<<<<<<<<<<<<
 *                 )
 *         return result
 */
      __pyx_t_8 = PyNumber_Subtract(__pyx_v_x, __pyx_v_l); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1468, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = PyNumber_Add(__pyx_v_y, __pyx_v_l); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1468, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1468, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_8);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_9);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_9);
      __pyx_t_8 = 0;
      __pyx_t_9 = 0;

      /* "mathics/builtin/graphics.py":1467
 *             for c in line:
 *                 x, y = c.pos()
 *                 result.extend(             # <<<<<<<<<<<<<<
 *                     [(x - l, y - l), (x - l, y + l), (x + l, y - l), (x + l, y + l)]
 *                 )
 */
      __pyx_t_13 = __Pyx_ListComp_Append(__pyx_v_result, __pyx_t_2); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(0, 1467, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "mathics/builtin/graphics.py":1468
 *                 x, y = c.pos()
 *                 result.extend(
 *                     [(x - l, y - l), (x - l, y + l), (x + l, y - l), (x + l, y + l)]             # <<<<<<<<<<<<<<
 *                 )
 *         return result
 */
      __pyx_t_2 = PyNumber_Add(__pyx_v_x, __pyx_v_l); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1468, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_9 = PyNumber_Subtract(__pyx_v_y, __pyx_v_l); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1468, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1468, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_9);
      PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_9);
      __pyx_t_2 = 0;
      __pyx_t_9 = 0;

      /* "mathics/builtin/graphics.py":1467
 *             for c in line:
 *                 x, y = c.pos()
 *                 result.extend(             # <<<<<<<<<<<<<<
 *                     [(x - l, y - l), (x - l, y + l), (x + l, y - l), (x + l, y + l)]
 *                 )
 */
      __pyx_t_14 = __Pyx_ListComp_Append(__pyx_v_result, __pyx_t_8); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 1467, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "mathics/builtin/graphics.py":1468
 *                 x, y = c.pos()
 *                 result.extend(
 *                     [(x - l, y - l), (x - l, y + l), (x + l, y - l), (x + l, y + l)]             # <<<<<<<<<<<<<<
 *                 )
 *         return result
 */
      __pyx_t_8 = PyNumber_Add(__pyx_v_x, __pyx_v_l); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1468, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = PyNumber_Add(__pyx_v_y, __pyx_v_l); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1468, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1468, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_8);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_9);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_9);
      __pyx_t_8 = 0;
      __pyx_t_9 = 0;

      /* "mathics/builtin/graphics.py":1467
 *             for c in line:
 *                 x, y = c.pos()
 *                 result.extend(             # <<<<<<<<<<<<<<
 *                     [(x - l, y - l), (x - l, y + l), (x + l, y - l), (x + l, y + l)]
 *                 )
 */
      __pyx_t_15 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_2); if (unlikely(__pyx_t_15 == ((int)-1))) __PYX_ERR(0, 1467, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      (void)((__pyx_t_12 | (__pyx_t_13 | (__pyx_t_14 | __pyx_t_15))));

      /* "mathics/builtin/graphics.py":1465
 *         result = []
 *         for line in self.lines:
 *             for c in line:             # <<<<<<<<<<<<<<
 *                 x, y = c.pos()
 *                 result.extend(
 */
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "mathics/builtin/graphics.py":1464
 *         l = self.style.get_line_width(face_element=False)
 *         result = []
 *         for line in self.lines:             # <<<<<<<<<<<<<<
 *             for c in line:
 *                 x, y = c.pos()
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1470
 *                     [(x - l, y - l), (x - l, y + l), (x + l, y - l), (x + l, y + l)]
 *                 )
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":1461
 *         ]
 * 
 *     def extent(self):             # <<<<<<<<<<<<<<
 *         l = self.style.get_line_width(face_element=False)
 *         result = []
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("mathics.builtin.graphics._Polyline.extent", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_l);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_line);
  __Pyx_XDECREF(__pyx_v_c);
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XDECREF(__pyx_v_y);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":1496
 * 
 * class PointBox(_Polyline):
 *     def init(self, graphics, style, item=None):             # <<<<<<<<<<<<<<
 *         super(PointBox, self).init(graphics, item, style)
 *         self.edge_color, self.face_color = style.get_style(_Color, face_element=True)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_8PointBox_1init(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_8PointBox_1init = {"init", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_8PointBox_1init, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_8PointBox_1init(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_graphics = 0;
  PyObject *__pyx_v_style = 0;
  PyObject *__pyx_v_item = 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);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_graphics,&__pyx_n_s_style,&__pyx_n_s_item,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = ((PyObject *)((PyObject *)Py_None));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_graphics)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("init", 0, 3, 4, 1); __PYX_ERR(0, 1496, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_style)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("init", 0, 3, 4, 2); __PYX_ERR(0, 1496, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_item);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "init") < 0)) __PYX_ERR(0, 1496, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_graphics = values[1];
    __pyx_v_style = values[2];
    __pyx_v_item = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("init", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1496, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.PointBox.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_8PointBox_init(__pyx_self, __pyx_v_self, __pyx_v_graphics, __pyx_v_style, __pyx_v_item);

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

/* "mathics/builtin/graphics.py":1504
 *             points = item.leaves[0]
 *             if points.has_form("List", None) and len(points.leaves) != 0:
 *                 if all(not leaf.has_form("List", None) for leaf in points.leaves):             # <<<<<<<<<<<<<<
 *                     points = Expression("List", points)
 *             self.do_init(graphics, points)
 */

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_8PointBox_4init_genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_19_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_7mathics_7builtin_8graphics___pyx_scope_struct_19_genexpr *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_19_genexpr(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_19_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_19_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1504, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_18_init *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7mathics_7builtin_8graphics_8PointBox_4init_2generator16, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_PointBox_init_locals_genexpr, __pyx_n_s_mathics_builtin_graphics); if (unlikely(!gen)) __PYX_ERR(0, 1504, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.PointBox.init.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_7mathics_7builtin_8graphics_8PointBox_4init_2generator16(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_19_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_19_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1504, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_points)) { __Pyx_RaiseClosureNameError("points"); __PYX_ERR(0, 1504, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_points, __pyx_n_s_leaves); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1504, __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(0, 1504, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1504, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 1504, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1504, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 1504, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1504, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1504, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_leaf);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_leaf, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_leaf, __pyx_n_s_has_form); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1504, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1504, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 1504, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_7 = ((!((!__pyx_t_6) != 0)) != 0);
    if (__pyx_t_7) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_False);
      __pyx_r = Py_False;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      goto __pyx_L0;
    }
  }
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_True);
    __pyx_r = Py_True;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

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

/* "mathics/builtin/graphics.py":1496
 * 
 * class PointBox(_Polyline):
 *     def init(self, graphics, style, item=None):             # <<<<<<<<<<<<<<
 *         super(PointBox, self).init(graphics, item, style)
 *         self.edge_color, self.face_color = style.get_style(_Color, face_element=True)
 */

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_8PointBox_init(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_graphics, PyObject *__pyx_v_style, PyObject *__pyx_v_item) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_18_init *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *(*__pyx_t_6)(PyObject *);
  int __pyx_t_7;
  int __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("init", 0);
  __pyx_cur_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_18_init *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_18_init(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_18_init, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_18_init *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1496, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }

  /* "mathics/builtin/graphics.py":1497
 * class PointBox(_Polyline):
 *     def init(self, graphics, style, item=None):
 *         super(PointBox, self).init(graphics, item, style)             # <<<<<<<<<<<<<<
 *         self.edge_color, self.face_color = style.get_style(_Color, face_element=True)
 *         if item is not None:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PointBox); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1497, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1497, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_INCREF(__pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1497, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1497, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_v_graphics, __pyx_v_item, __pyx_v_style};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1497, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_v_graphics, __pyx_v_item, __pyx_v_style};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1497, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1497, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_2) {
      __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
    }
    __Pyx_INCREF(__pyx_v_graphics);
    __Pyx_GIVEREF(__pyx_v_graphics);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_graphics);
    __Pyx_INCREF(__pyx_v_item);
    __Pyx_GIVEREF(__pyx_v_item);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_item);
    __Pyx_INCREF(__pyx_v_style);
    __Pyx_GIVEREF(__pyx_v_style);
    PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_style);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1497, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1498
 *     def init(self, graphics, style, item=None):
 *         super(PointBox, self).init(graphics, item, style)
 *         self.edge_color, self.face_color = style.get_style(_Color, face_element=True)             # <<<<<<<<<<<<<<
 *         if item is not None:
 *             if len(item.leaves) != 1:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_style, __pyx_n_s_get_style); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1498, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Color); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1498, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1498, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1498, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_face_element, Py_True) < 0) __PYX_ERR(0, 1498, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1498, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
    PyObject* sequence = __pyx_t_2;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 1498, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_5);
    #else
    __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1498, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1498, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    #endif
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1498, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_6 = Py_TYPE(__pyx_t_1)->tp_iternext;
    index = 0; __pyx_t_3 = __pyx_t_6(__pyx_t_1); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 1; __pyx_t_5 = __pyx_t_6(__pyx_t_1); if (unlikely(!__pyx_t_5)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_1), 2) < 0) __PYX_ERR(0, 1498, __pyx_L1_error)
    __pyx_t_6 = NULL;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_6 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 1498, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_edge_color, __pyx_t_3) < 0) __PYX_ERR(0, 1498, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_face_color, __pyx_t_5) < 0) __PYX_ERR(0, 1498, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":1499
 *         super(PointBox, self).init(graphics, item, style)
 *         self.edge_color, self.face_color = style.get_style(_Color, face_element=True)
 *         if item is not None:             # <<<<<<<<<<<<<<
 *             if len(item.leaves) != 1:
 *                 raise BoxConstructError
 */
  __pyx_t_7 = (__pyx_v_item != Py_None);
  __pyx_t_8 = (__pyx_t_7 != 0);
  if (likely(__pyx_t_8)) {

    /* "mathics/builtin/graphics.py":1500
 *         self.edge_color, self.face_color = style.get_style(_Color, face_element=True)
 *         if item is not None:
 *             if len(item.leaves) != 1:             # <<<<<<<<<<<<<<
 *                 raise BoxConstructError
 *             points = item.leaves[0]
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_item, __pyx_n_s_leaves); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1500, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_9 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1500, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_8 = ((__pyx_t_9 != 1) != 0);
    if (unlikely(__pyx_t_8)) {

      /* "mathics/builtin/graphics.py":1501
 *         if item is not None:
 *             if len(item.leaves) != 1:
 *                 raise BoxConstructError             # <<<<<<<<<<<<<<
 *             points = item.leaves[0]
 *             if points.has_form("List", None) and len(points.leaves) != 0:
 */
      __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_BoxConstructError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1501, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(0, 1501, __pyx_L1_error)

      /* "mathics/builtin/graphics.py":1500
 *         self.edge_color, self.face_color = style.get_style(_Color, face_element=True)
 *         if item is not None:
 *             if len(item.leaves) != 1:             # <<<<<<<<<<<<<<
 *                 raise BoxConstructError
 *             points = item.leaves[0]
 */
    }

    /* "mathics/builtin/graphics.py":1502
 *             if len(item.leaves) != 1:
 *                 raise BoxConstructError
 *             points = item.leaves[0]             # <<<<<<<<<<<<<<
 *             if points.has_form("List", None) and len(points.leaves) != 0:
 *                 if all(not leaf.has_form("List", None) for leaf in points.leaves):
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_item, __pyx_n_s_leaves); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1502, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1502, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_cur_scope->__pyx_v_points = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "mathics/builtin/graphics.py":1503
 *                 raise BoxConstructError
 *             points = item.leaves[0]
 *             if points.has_form("List", None) and len(points.leaves) != 0:             # <<<<<<<<<<<<<<
 *                 if all(not leaf.has_form("List", None) for leaf in points.leaves):
 *                     points = Expression("List", points)
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_points, __pyx_n_s_has_form); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1503, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1503, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 1503, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_7) {
    } else {
      __pyx_t_8 = __pyx_t_7;
      goto __pyx_L8_bool_binop_done;
    }
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_points, __pyx_n_s_leaves); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1503, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_9 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1503, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_7 = ((__pyx_t_9 != 0) != 0);
    __pyx_t_8 = __pyx_t_7;
    __pyx_L8_bool_binop_done:;
    if (__pyx_t_8) {

      /* "mathics/builtin/graphics.py":1504
 *             points = item.leaves[0]
 *             if points.has_form("List", None) and len(points.leaves) != 0:
 *                 if all(not leaf.has_form("List", None) for leaf in points.leaves):             # <<<<<<<<<<<<<<
 *                     points = Expression("List", points)
 *             self.do_init(graphics, points)
 */
      __pyx_t_2 = __pyx_pf_7mathics_7builtin_8graphics_8PointBox_4init_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1504, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = __Pyx_Generator_Next(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1504, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 1504, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_8) {

        /* "mathics/builtin/graphics.py":1505
 *             if points.has_form("List", None) and len(points.leaves) != 0:
 *                 if all(not leaf.has_form("List", None) for leaf in points.leaves):
 *                     points = Expression("List", points)             # <<<<<<<<<<<<<<
 *             self.do_init(graphics, points)
 *         else:
 */
        __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Expression); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1505, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_3 = NULL;
        __pyx_t_4 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
          if (likely(__pyx_t_3)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
            __Pyx_INCREF(__pyx_t_3);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_2, function);
            __pyx_t_4 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_2)) {
          PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_n_u_List, __pyx_cur_scope->__pyx_v_points};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1505, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_GOTREF(__pyx_t_5);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
          PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_n_u_List, __pyx_cur_scope->__pyx_v_points};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1505, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_GOTREF(__pyx_t_5);
        } else
        #endif
        {
          __pyx_t_1 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1505, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          if (__pyx_t_3) {
            __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); __pyx_t_3 = NULL;
          }
          __Pyx_INCREF(__pyx_n_u_List);
          __Pyx_GIVEREF(__pyx_n_u_List);
          PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_4, __pyx_n_u_List);
          __Pyx_INCREF(__pyx_cur_scope->__pyx_v_points);
          __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_points);
          PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_4, __pyx_cur_scope->__pyx_v_points);
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1505, __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_GOTREF(__pyx_cur_scope->__pyx_v_points);
        __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_points, __pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_5);
        __pyx_t_5 = 0;

        /* "mathics/builtin/graphics.py":1504
 *             points = item.leaves[0]
 *             if points.has_form("List", None) and len(points.leaves) != 0:
 *                 if all(not leaf.has_form("List", None) for leaf in points.leaves):             # <<<<<<<<<<<<<<
 *                     points = Expression("List", points)
 *             self.do_init(graphics, points)
 */
      }

      /* "mathics/builtin/graphics.py":1503
 *                 raise BoxConstructError
 *             points = item.leaves[0]
 *             if points.has_form("List", None) and len(points.leaves) != 0:             # <<<<<<<<<<<<<<
 *                 if all(not leaf.has_form("List", None) for leaf in points.leaves):
 *                     points = Expression("List", points)
 */
    }

    /* "mathics/builtin/graphics.py":1506
 *                 if all(not leaf.has_form("List", None) for leaf in points.leaves):
 *                     points = Expression("List", points)
 *             self.do_init(graphics, points)             # <<<<<<<<<<<<<<
 *         else:
 *             raise BoxConstructError
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_do_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1506, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = NULL;
    __pyx_t_4 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_4 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_graphics, __pyx_cur_scope->__pyx_v_points};
      __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1506, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_GOTREF(__pyx_t_5);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_graphics, __pyx_cur_scope->__pyx_v_points};
      __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1506, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_GOTREF(__pyx_t_5);
    } else
    #endif
    {
      __pyx_t_3 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1506, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (__pyx_t_1) {
        __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __pyx_t_1 = NULL;
      }
      __Pyx_INCREF(__pyx_v_graphics);
      __Pyx_GIVEREF(__pyx_v_graphics);
      PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_4, __pyx_v_graphics);
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_points);
      __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_points);
      PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_4, __pyx_cur_scope->__pyx_v_points);
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1506, __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_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "mathics/builtin/graphics.py":1499
 *         super(PointBox, self).init(graphics, item, style)
 *         self.edge_color, self.face_color = style.get_style(_Color, face_element=True)
 *         if item is not None:             # <<<<<<<<<<<<<<
 *             if len(item.leaves) != 1:
 *                 raise BoxConstructError
 */
    goto __pyx_L5;
  }

  /* "mathics/builtin/graphics.py":1508
 *             self.do_init(graphics, points)
 *         else:
 *             raise BoxConstructError             # <<<<<<<<<<<<<<
 * 
 *     def to_svg(self):
 */
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_BoxConstructError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1508, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __PYX_ERR(0, 1508, __pyx_L1_error)
  }
  __pyx_L5:;

  /* "mathics/builtin/graphics.py":1496
 * 
 * class PointBox(_Polyline):
 *     def init(self, graphics, style, item=None):             # <<<<<<<<<<<<<<
 *         super(PointBox, self).init(graphics, item, style)
 *         self.edge_color, self.face_color = style.get_style(_Color, face_element=True)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("mathics.builtin.graphics.PointBox.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":1510
 *             raise BoxConstructError
 * 
 *     def to_svg(self):             # <<<<<<<<<<<<<<
 *         point_size, _ = self.style.get_style(PointSize, face_element=False)
 *         if point_size is None:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_8PointBox_3to_svg(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_8PointBox_3to_svg = {"to_svg", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_8PointBox_3to_svg, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_8PointBox_3to_svg(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_svg (wrapper)", 0);
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_8PointBox_2to_svg(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_8PointBox_2to_svg(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_point_size = NULL;
  CYTHON_UNUSED PyObject *__pyx_v__ = NULL;
  PyObject *__pyx_v_size = NULL;
  PyObject *__pyx_v_style = NULL;
  PyObject *__pyx_v_svg = NULL;
  PyObject *__pyx_v_line = NULL;
  PyObject *__pyx_v_coords = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *(*__pyx_t_5)(PyObject *);
  int __pyx_t_6;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  Py_ssize_t __pyx_t_10;
  PyObject *(*__pyx_t_11)(PyObject *);
  Py_ssize_t __pyx_t_12;
  Py_UCS4 __pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_svg", 0);

  /* "mathics/builtin/graphics.py":1511
 * 
 *     def to_svg(self):
 *         point_size, _ = self.style.get_style(PointSize, face_element=False)             # <<<<<<<<<<<<<<
 *         if point_size is None:
 *             point_size = PointSize(self.graphics, value=0.005)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_style); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1511, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_get_style); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1511, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_PointSize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1511, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1511, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1511, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_face_element, Py_False) < 0) __PYX_ERR(0, 1511, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1511, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
    PyObject* sequence = __pyx_t_4;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 1511, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_3);
    #else
    __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1511, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1511, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_2 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1511, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext;
    index = 0; __pyx_t_1 = __pyx_t_5(__pyx_t_2); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_2); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_2), 2) < 0) __PYX_ERR(0, 1511, __pyx_L1_error)
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 1511, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  __pyx_v_point_size = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v__ = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":1512
 *     def to_svg(self):
 *         point_size, _ = self.style.get_style(PointSize, face_element=False)
 *         if point_size is None:             # <<<<<<<<<<<<<<
 *             point_size = PointSize(self.graphics, value=0.005)
 *         size = point_size.get_size()
 */
  __pyx_t_6 = (__pyx_v_point_size == Py_None);
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "mathics/builtin/graphics.py":1513
 *         point_size, _ = self.style.get_style(PointSize, face_element=False)
 *         if point_size is None:
 *             point_size = PointSize(self.graphics, value=0.005)             # <<<<<<<<<<<<<<
 *         size = point_size.get_size()
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_PointSize); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1513, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_graphics); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1513, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1513, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1513, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_value, __pyx_float_0_005) < 0) __PYX_ERR(0, 1513, __pyx_L1_error)
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1513, __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_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF_SET(__pyx_v_point_size, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "mathics/builtin/graphics.py":1512
 *     def to_svg(self):
 *         point_size, _ = self.style.get_style(PointSize, face_element=False)
 *         if point_size is None:             # <<<<<<<<<<<<<<
 *             point_size = PointSize(self.graphics, value=0.005)
 *         size = point_size.get_size()
 */
  }

  /* "mathics/builtin/graphics.py":1514
 *         if point_size is None:
 *             point_size = PointSize(self.graphics, value=0.005)
 *         size = point_size.get_size()             # <<<<<<<<<<<<<<
 * 
 *         style = create_css(
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_point_size, __pyx_n_s_get_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1514, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1514, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_size = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":1516
 *         size = point_size.get_size()
 * 
 *         style = create_css(             # <<<<<<<<<<<<<<
 *             edge_color=self.edge_color, stroke_width=0, face_color=self.face_color
 *         )
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_create_css); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1516, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "mathics/builtin/graphics.py":1517
 * 
 *         style = create_css(
 *             edge_color=self.edge_color, stroke_width=0, face_color=self.face_color             # <<<<<<<<<<<<<<
 *         )
 *         svg = ""
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1517, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_edge_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1517, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_edge_color, __pyx_t_1) < 0) __PYX_ERR(0, 1517, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_stroke_width, __pyx_int_0) < 0) __PYX_ERR(0, 1517, __pyx_L1_error)
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_face_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1517, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_face_color, __pyx_t_1) < 0) __PYX_ERR(0, 1517, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1516
 *         size = point_size.get_size()
 * 
 *         style = create_css(             # <<<<<<<<<<<<<<
 *             edge_color=self.edge_color, stroke_width=0, face_color=self.face_color
 *         )
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1516, __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_v_style = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1519
 *             edge_color=self.edge_color, stroke_width=0, face_color=self.face_color
 *         )
 *         svg = ""             # <<<<<<<<<<<<<<
 *         for line in self.lines:
 *             for coords in line:
 */
  __Pyx_INCREF(__pyx_kp_u__41);
  __pyx_v_svg = __pyx_kp_u__41;

  /* "mathics/builtin/graphics.py":1520
 *         )
 *         svg = ""
 *         for line in self.lines:             # <<<<<<<<<<<<<<
 *             for coords in line:
 *                 svg += '<circle cx="%f" cy="%f" r="%f" style="%s" />' % (
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lines); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1520, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); __pyx_t_8 = 0;
    __pyx_t_9 = NULL;
  } else {
    __pyx_t_8 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1520, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_9 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1520, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_9)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 1520, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1520, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 1520, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1520, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_9(__pyx_t_3);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1520, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_line, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "mathics/builtin/graphics.py":1521
 *         svg = ""
 *         for line in self.lines:
 *             for coords in line:             # <<<<<<<<<<<<<<
 *                 svg += '<circle cx="%f" cy="%f" r="%f" style="%s" />' % (
 *                     coords.pos()[0],
 */
    if (likely(PyList_CheckExact(__pyx_v_line)) || PyTuple_CheckExact(__pyx_v_line)) {
      __pyx_t_1 = __pyx_v_line; __Pyx_INCREF(__pyx_t_1); __pyx_t_10 = 0;
      __pyx_t_11 = NULL;
    } else {
      __pyx_t_10 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_line); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1521, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_11 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1521, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_11)) {
        if (likely(PyList_CheckExact(__pyx_t_1))) {
          if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_10); __Pyx_INCREF(__pyx_t_2); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 1521, __pyx_L1_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1521, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        } else {
          if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_10); __Pyx_INCREF(__pyx_t_2); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 1521, __pyx_L1_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1521, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        }
      } else {
        __pyx_t_2 = __pyx_t_11(__pyx_t_1);
        if (unlikely(!__pyx_t_2)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 1521, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_XDECREF_SET(__pyx_v_coords, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "mathics/builtin/graphics.py":1522
 *         for line in self.lines:
 *             for coords in line:
 *                 svg += '<circle cx="%f" cy="%f" r="%f" style="%s" />' % (             # <<<<<<<<<<<<<<
 *                     coords.pos()[0],
 *                     coords.pos()[1],
 */
      __pyx_t_2 = PyTuple_New(9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1522, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_12 = 0;
      __pyx_t_13 = 127;
      __Pyx_INCREF(__pyx_kp_u_circle_cx);
      __pyx_t_12 += 12;
      __Pyx_GIVEREF(__pyx_kp_u_circle_cx);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u_circle_cx);

      /* "mathics/builtin/graphics.py":1523
 *             for coords in line:
 *                 svg += '<circle cx="%f" cy="%f" r="%f" style="%s" />' % (
 *                     coords.pos()[0],             # <<<<<<<<<<<<<<
 *                     coords.pos()[1],
 *                     size,
 */
      __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_coords, __pyx_n_s_pos); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1523, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);
      __pyx_t_15 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_14))) {
        __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_14);
        if (likely(__pyx_t_15)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
          __Pyx_INCREF(__pyx_t_15);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_14, function);
        }
      }
      __pyx_t_4 = (__pyx_t_15) ? __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_t_15) : __Pyx_PyObject_CallNoArg(__pyx_t_14);
      __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1523, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_14 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1523, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_Format(__pyx_t_14, __pyx_n_u_f); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1523, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_13 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_13) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_13;
      __pyx_t_12 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
      __pyx_t_4 = 0;
      __Pyx_INCREF(__pyx_kp_u_cy);
      __pyx_t_12 += 6;
      __Pyx_GIVEREF(__pyx_kp_u_cy);
      PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u_cy);

      /* "mathics/builtin/graphics.py":1524
 *                 svg += '<circle cx="%f" cy="%f" r="%f" style="%s" />' % (
 *                     coords.pos()[0],
 *                     coords.pos()[1],             # <<<<<<<<<<<<<<
 *                     size,
 *                     style,
 */
      __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_coords, __pyx_n_s_pos); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1524, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);
      __pyx_t_15 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_14))) {
        __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_14);
        if (likely(__pyx_t_15)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
          __Pyx_INCREF(__pyx_t_15);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_14, function);
        }
      }
      __pyx_t_4 = (__pyx_t_15) ? __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_t_15) : __Pyx_PyObject_CallNoArg(__pyx_t_14);
      __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1524, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_14 = __Pyx_GetItemInt(__pyx_t_4, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1524, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_Format(__pyx_t_14, __pyx_n_u_f); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1524, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_13 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_13) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_13;
      __pyx_t_12 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_4);
      __pyx_t_4 = 0;
      __Pyx_INCREF(__pyx_kp_u_r_2);
      __pyx_t_12 += 5;
      __Pyx_GIVEREF(__pyx_kp_u_r_2);
      PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_kp_u_r_2);

      /* "mathics/builtin/graphics.py":1525
 *                     coords.pos()[0],
 *                     coords.pos()[1],
 *                     size,             # <<<<<<<<<<<<<<
 *                     style,
 *                 )
 */
      __pyx_t_4 = __Pyx_PyObject_Format(__pyx_v_size, __pyx_n_u_f); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1525, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_13 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_13) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_13;
      __pyx_t_12 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_2, 5, __pyx_t_4);
      __pyx_t_4 = 0;
      __Pyx_INCREF(__pyx_kp_u_style_2);
      __pyx_t_12 += 9;
      __Pyx_GIVEREF(__pyx_kp_u_style_2);
      PyTuple_SET_ITEM(__pyx_t_2, 6, __pyx_kp_u_style_2);

      /* "mathics/builtin/graphics.py":1526
 *                     coords.pos()[1],
 *                     size,
 *                     style,             # <<<<<<<<<<<<<<
 *                 )
 *         return svg
 */
      __pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_style), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1526, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_13 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_13) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_13;
      __pyx_t_12 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_2, 7, __pyx_t_4);
      __pyx_t_4 = 0;
      __Pyx_INCREF(__pyx_kp_u__30);
      __pyx_t_12 += 4;
      __Pyx_GIVEREF(__pyx_kp_u__30);
      PyTuple_SET_ITEM(__pyx_t_2, 8, __pyx_kp_u__30);

      /* "mathics/builtin/graphics.py":1522
 *         for line in self.lines:
 *             for coords in line:
 *                 svg += '<circle cx="%f" cy="%f" r="%f" style="%s" />' % (             # <<<<<<<<<<<<<<
 *                     coords.pos()[0],
 *                     coords.pos()[1],
 */
      __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_2, 9, __pyx_t_12, __pyx_t_13); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1522, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_v_svg, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1522, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF_SET(__pyx_v_svg, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "mathics/builtin/graphics.py":1521
 *         svg = ""
 *         for line in self.lines:
 *             for coords in line:             # <<<<<<<<<<<<<<
 *                 svg += '<circle cx="%f" cy="%f" r="%f" style="%s" />' % (
 *                     coords.pos()[0],
 */
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "mathics/builtin/graphics.py":1520
 *         )
 *         svg = ""
 *         for line in self.lines:             # <<<<<<<<<<<<<<
 *             for coords in line:
 *                 svg += '<circle cx="%f" cy="%f" r="%f" style="%s" />' % (
 */
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":1528
 *                     style,
 *                 )
 *         return svg             # <<<<<<<<<<<<<<
 * 
 *     def to_asy(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_svg);
  __pyx_r = __pyx_v_svg;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":1510
 *             raise BoxConstructError
 * 
 *     def to_svg(self):             # <<<<<<<<<<<<<<
 *         point_size, _ = self.style.get_style(PointSize, face_element=False)
 *         if point_size is None:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_AddTraceback("mathics.builtin.graphics.PointBox.to_svg", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_point_size);
  __Pyx_XDECREF(__pyx_v__);
  __Pyx_XDECREF(__pyx_v_size);
  __Pyx_XDECREF(__pyx_v_style);
  __Pyx_XDECREF(__pyx_v_svg);
  __Pyx_XDECREF(__pyx_v_line);
  __Pyx_XDECREF(__pyx_v_coords);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":1530
 *         return svg
 * 
 *     def to_asy(self):             # <<<<<<<<<<<<<<
 *         pen = create_pens(face_color=self.face_color, is_face_element=False)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_8PointBox_5to_asy(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_8PointBox_5to_asy = {"to_asy", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_8PointBox_5to_asy, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_8PointBox_5to_asy(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_asy (wrapper)", 0);
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_8PointBox_4to_asy(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_8PointBox_4to_asy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_pen = NULL;
  PyObject *__pyx_v_asy = NULL;
  PyObject *__pyx_v_line = NULL;
  PyObject *__pyx_v_coords = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  Py_ssize_t __pyx_t_8;
  Py_UCS4 __pyx_t_9;
  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("to_asy", 0);

  /* "mathics/builtin/graphics.py":1531
 * 
 *     def to_asy(self):
 *         pen = create_pens(face_color=self.face_color, is_face_element=False)             # <<<<<<<<<<<<<<
 * 
 *         asy = ""
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_create_pens); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1531, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1531, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_face_color); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1531, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_face_color, __pyx_t_3) < 0) __PYX_ERR(0, 1531, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_is_face_element, Py_False) < 0) __PYX_ERR(0, 1531, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1531, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_pen = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":1533
 *         pen = create_pens(face_color=self.face_color, is_face_element=False)
 * 
 *         asy = ""             # <<<<<<<<<<<<<<
 *         for line in self.lines:
 *             for coords in line:
 */
  __Pyx_INCREF(__pyx_kp_u__41);
  __pyx_v_asy = __pyx_kp_u__41;

  /* "mathics/builtin/graphics.py":1534
 * 
 *         asy = ""
 *         for line in self.lines:             # <<<<<<<<<<<<<<
 *             for coords in line:
 *                 asy += "dot(%s, %s);" % (coords.pos(), pen)
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lines); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1534, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
    __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1534, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1534, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 1534, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1534, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 1534, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1534, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      }
    } else {
      __pyx_t_3 = __pyx_t_5(__pyx_t_2);
      if (unlikely(!__pyx_t_3)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1534, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_XDECREF_SET(__pyx_v_line, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "mathics/builtin/graphics.py":1535
 *         asy = ""
 *         for line in self.lines:
 *             for coords in line:             # <<<<<<<<<<<<<<
 *                 asy += "dot(%s, %s);" % (coords.pos(), pen)
 * 
 */
    if (likely(PyList_CheckExact(__pyx_v_line)) || PyTuple_CheckExact(__pyx_v_line)) {
      __pyx_t_3 = __pyx_v_line; __Pyx_INCREF(__pyx_t_3); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_line); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1535, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_7 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1535, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_7)) {
        if (likely(PyList_CheckExact(__pyx_t_3))) {
          if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 1535, __pyx_L1_error)
          #else
          __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1535, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          #endif
        } else {
          if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 1535, __pyx_L1_error)
          #else
          __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1535, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          #endif
        }
      } else {
        __pyx_t_1 = __pyx_t_7(__pyx_t_3);
        if (unlikely(!__pyx_t_1)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 1535, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_1);
      }
      __Pyx_XDECREF_SET(__pyx_v_coords, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "mathics/builtin/graphics.py":1536
 *         for line in self.lines:
 *             for coords in line:
 *                 asy += "dot(%s, %s);" % (coords.pos(), pen)             # <<<<<<<<<<<<<<
 * 
 *         return asy
 */
      __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1536, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_8 = 0;
      __pyx_t_9 = 127;
      __Pyx_INCREF(__pyx_kp_u_dot);
      __pyx_t_8 += 4;
      __Pyx_GIVEREF(__pyx_kp_u_dot);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_dot);
      __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_coords, __pyx_n_s_pos); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1536, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_12 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_11))) {
        __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11);
        if (likely(__pyx_t_12)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
          __Pyx_INCREF(__pyx_t_12);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_11, function);
        }
      }
      __pyx_t_10 = (__pyx_t_12) ? __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_12) : __Pyx_PyObject_CallNoArg(__pyx_t_11);
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1536, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_11 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_10), __pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1536, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) : __pyx_t_9;
      __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11);
      __Pyx_GIVEREF(__pyx_t_11);
      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_11);
      __pyx_t_11 = 0;
      __Pyx_INCREF(__pyx_kp_u__4);
      __pyx_t_8 += 2;
      __Pyx_GIVEREF(__pyx_kp_u__4);
      PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u__4);
      __pyx_t_11 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_pen), __pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1536, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) : __pyx_t_9;
      __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11);
      __Pyx_GIVEREF(__pyx_t_11);
      PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_11);
      __pyx_t_11 = 0;
      __Pyx_INCREF(__pyx_kp_u__33);
      __pyx_t_8 += 2;
      __Pyx_GIVEREF(__pyx_kp_u__33);
      PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u__33);
      __pyx_t_11 = __Pyx_PyUnicode_Join(__pyx_t_1, 5, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1536, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_v_asy, __pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1536, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF_SET(__pyx_v_asy, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "mathics/builtin/graphics.py":1535
 *         asy = ""
 *         for line in self.lines:
 *             for coords in line:             # <<<<<<<<<<<<<<
 *                 asy += "dot(%s, %s);" % (coords.pos(), pen)
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "mathics/builtin/graphics.py":1534
 * 
 *         asy = ""
 *         for line in self.lines:             # <<<<<<<<<<<<<<
 *             for coords in line:
 *                 asy += "dot(%s, %s);" % (coords.pos(), pen)
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":1538
 *                 asy += "dot(%s, %s);" % (coords.pos(), pen)
 * 
 *         return asy             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_asy);
  __pyx_r = __pyx_v_asy;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":1530
 *         return svg
 * 
 *     def to_asy(self):             # <<<<<<<<<<<<<<
 *         pen = create_pens(face_color=self.face_color, is_face_element=False)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("mathics.builtin.graphics.PointBox.to_asy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_pen);
  __Pyx_XDECREF(__pyx_v_asy);
  __Pyx_XDECREF(__pyx_v_line);
  __Pyx_XDECREF(__pyx_v_coords);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":1561
 * 
 * class LineBox(_Polyline):
 *     def init(self, graphics, style, item=None, lines=None):             # <<<<<<<<<<<<<<
 *         super(LineBox, self).init(graphics, item, style)
 *         self.edge_color, _ = style.get_style(_Color, face_element=False)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_7LineBox_1init(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_7LineBox_1init = {"init", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_7LineBox_1init, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_7LineBox_1init(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_graphics = 0;
  PyObject *__pyx_v_style = 0;
  PyObject *__pyx_v_item = 0;
  PyObject *__pyx_v_lines = 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);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_graphics,&__pyx_n_s_style,&__pyx_n_s_item,&__pyx_n_s_lines,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[3] = ((PyObject *)((PyObject *)Py_None));
    values[4] = ((PyObject *)((PyObject *)Py_None));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_graphics)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("init", 0, 3, 5, 1); __PYX_ERR(0, 1561, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_style)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("init", 0, 3, 5, 2); __PYX_ERR(0, 1561, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_item);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lines);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "init") < 0)) __PYX_ERR(0, 1561, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_graphics = values[1];
    __pyx_v_style = values[2];
    __pyx_v_item = values[3];
    __pyx_v_lines = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("init", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1561, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.LineBox.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_7LineBox_init(__pyx_self, __pyx_v_self, __pyx_v_graphics, __pyx_v_style, __pyx_v_item, __pyx_v_lines);

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_7LineBox_init(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_graphics, PyObject *__pyx_v_style, PyObject *__pyx_v_item, PyObject *__pyx_v_lines) {
  CYTHON_UNUSED PyObject *__pyx_v__ = NULL;
  PyObject *__pyx_v_points = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *(*__pyx_t_6)(PyObject *);
  int __pyx_t_7;
  int __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("init", 0);

  /* "mathics/builtin/graphics.py":1562
 * class LineBox(_Polyline):
 *     def init(self, graphics, style, item=None, lines=None):
 *         super(LineBox, self).init(graphics, item, style)             # <<<<<<<<<<<<<<
 *         self.edge_color, _ = style.get_style(_Color, face_element=False)
 *         if item is not None:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_LineBox); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1562, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1562, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_INCREF(__pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1562, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1562, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_v_graphics, __pyx_v_item, __pyx_v_style};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1562, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_v_graphics, __pyx_v_item, __pyx_v_style};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1562, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1562, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_2) {
      __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
    }
    __Pyx_INCREF(__pyx_v_graphics);
    __Pyx_GIVEREF(__pyx_v_graphics);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_graphics);
    __Pyx_INCREF(__pyx_v_item);
    __Pyx_GIVEREF(__pyx_v_item);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_item);
    __Pyx_INCREF(__pyx_v_style);
    __Pyx_GIVEREF(__pyx_v_style);
    PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_style);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1562, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1563
 *     def init(self, graphics, style, item=None, lines=None):
 *         super(LineBox, self).init(graphics, item, style)
 *         self.edge_color, _ = style.get_style(_Color, face_element=False)             # <<<<<<<<<<<<<<
 *         if item is not None:
 *             if len(item.leaves) != 1:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_style, __pyx_n_s_get_style); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1563, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Color); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1563, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1563, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1563, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_face_element, Py_False) < 0) __PYX_ERR(0, 1563, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1563, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
    PyObject* sequence = __pyx_t_2;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 1563, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_5);
    #else
    __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1563, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1563, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    #endif
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1563, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_6 = Py_TYPE(__pyx_t_1)->tp_iternext;
    index = 0; __pyx_t_3 = __pyx_t_6(__pyx_t_1); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 1; __pyx_t_5 = __pyx_t_6(__pyx_t_1); if (unlikely(!__pyx_t_5)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_1), 2) < 0) __PYX_ERR(0, 1563, __pyx_L1_error)
    __pyx_t_6 = NULL;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_6 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 1563, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_edge_color, __pyx_t_3) < 0) __PYX_ERR(0, 1563, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v__ = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":1564
 *         super(LineBox, self).init(graphics, item, style)
 *         self.edge_color, _ = style.get_style(_Color, face_element=False)
 *         if item is not None:             # <<<<<<<<<<<<<<
 *             if len(item.leaves) != 1:
 *                 raise BoxConstructError
 */
  __pyx_t_7 = (__pyx_v_item != Py_None);
  __pyx_t_8 = (__pyx_t_7 != 0);
  if (__pyx_t_8) {

    /* "mathics/builtin/graphics.py":1565
 *         self.edge_color, _ = style.get_style(_Color, face_element=False)
 *         if item is not None:
 *             if len(item.leaves) != 1:             # <<<<<<<<<<<<<<
 *                 raise BoxConstructError
 *             points = item.leaves[0]
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_item, __pyx_n_s_leaves); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1565, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_9 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1565, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_8 = ((__pyx_t_9 != 1) != 0);
    if (unlikely(__pyx_t_8)) {

      /* "mathics/builtin/graphics.py":1566
 *         if item is not None:
 *             if len(item.leaves) != 1:
 *                 raise BoxConstructError             # <<<<<<<<<<<<<<
 *             points = item.leaves[0]
 *             self.do_init(graphics, points)
 */
      __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_BoxConstructError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1566, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(0, 1566, __pyx_L1_error)

      /* "mathics/builtin/graphics.py":1565
 *         self.edge_color, _ = style.get_style(_Color, face_element=False)
 *         if item is not None:
 *             if len(item.leaves) != 1:             # <<<<<<<<<<<<<<
 *                 raise BoxConstructError
 *             points = item.leaves[0]
 */
    }

    /* "mathics/builtin/graphics.py":1567
 *             if len(item.leaves) != 1:
 *                 raise BoxConstructError
 *             points = item.leaves[0]             # <<<<<<<<<<<<<<
 *             self.do_init(graphics, points)
 *         elif lines is not None:
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_item, __pyx_n_s_leaves); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1567, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1567, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_points = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "mathics/builtin/graphics.py":1568
 *                 raise BoxConstructError
 *             points = item.leaves[0]
 *             self.do_init(graphics, points)             # <<<<<<<<<<<<<<
 *         elif lines is not None:
 *             self.lines = lines
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_do_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1568, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    __pyx_t_4 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_4 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_graphics, __pyx_v_points};
      __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1568, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_5);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_graphics, __pyx_v_points};
      __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1568, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_5);
    } else
    #endif
    {
      __pyx_t_1 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1568, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (__pyx_t_3) {
        __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); __pyx_t_3 = NULL;
      }
      __Pyx_INCREF(__pyx_v_graphics);
      __Pyx_GIVEREF(__pyx_v_graphics);
      PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_4, __pyx_v_graphics);
      __Pyx_INCREF(__pyx_v_points);
      __Pyx_GIVEREF(__pyx_v_points);
      PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_4, __pyx_v_points);
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1568, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "mathics/builtin/graphics.py":1564
 *         super(LineBox, self).init(graphics, item, style)
 *         self.edge_color, _ = style.get_style(_Color, face_element=False)
 *         if item is not None:             # <<<<<<<<<<<<<<
 *             if len(item.leaves) != 1:
 *                 raise BoxConstructError
 */
    goto __pyx_L5;
  }

  /* "mathics/builtin/graphics.py":1569
 *             points = item.leaves[0]
 *             self.do_init(graphics, points)
 *         elif lines is not None:             # <<<<<<<<<<<<<<
 *             self.lines = lines
 *         else:
 */
  __pyx_t_8 = (__pyx_v_lines != Py_None);
  __pyx_t_7 = (__pyx_t_8 != 0);
  if (likely(__pyx_t_7)) {

    /* "mathics/builtin/graphics.py":1570
 *             self.do_init(graphics, points)
 *         elif lines is not None:
 *             self.lines = lines             # <<<<<<<<<<<<<<
 *         else:
 *             raise BoxConstructError
 */
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_lines, __pyx_v_lines) < 0) __PYX_ERR(0, 1570, __pyx_L1_error)

    /* "mathics/builtin/graphics.py":1569
 *             points = item.leaves[0]
 *             self.do_init(graphics, points)
 *         elif lines is not None:             # <<<<<<<<<<<<<<
 *             self.lines = lines
 *         else:
 */
    goto __pyx_L5;
  }

  /* "mathics/builtin/graphics.py":1572
 *             self.lines = lines
 *         else:
 *             raise BoxConstructError             # <<<<<<<<<<<<<<
 * 
 *     def to_svg(self):
 */
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_BoxConstructError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1572, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __PYX_ERR(0, 1572, __pyx_L1_error)
  }
  __pyx_L5:;

  /* "mathics/builtin/graphics.py":1561
 * 
 * class LineBox(_Polyline):
 *     def init(self, graphics, style, item=None, lines=None):             # <<<<<<<<<<<<<<
 *         super(LineBox, self).init(graphics, item, style)
 *         self.edge_color, _ = style.get_style(_Color, face_element=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_5);
  __Pyx_AddTraceback("mathics.builtin.graphics.LineBox.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v__);
  __Pyx_XDECREF(__pyx_v_points);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":1574
 *             raise BoxConstructError
 * 
 *     def to_svg(self):             # <<<<<<<<<<<<<<
 *         l = self.style.get_line_width(face_element=False)
 *         style = create_css(edge_color=self.edge_color, stroke_width=l)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_7LineBox_3to_svg(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_7LineBox_3to_svg = {"to_svg", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_7LineBox_3to_svg, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_7LineBox_3to_svg(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_svg (wrapper)", 0);
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_7LineBox_2to_svg(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_7LineBox_2to_svg(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_l = NULL;
  PyObject *__pyx_v_style = NULL;
  PyObject *__pyx_v_svg = NULL;
  PyObject *__pyx_v_line = NULL;
  PyObject *__pyx_9genexpr20__pyx_v_coords = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  Py_ssize_t __pyx_t_6;
  Py_UCS4 __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  PyObject *(*__pyx_t_10)(PyObject *);
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_svg", 0);

  /* "mathics/builtin/graphics.py":1575
 * 
 *     def to_svg(self):
 *         l = self.style.get_line_width(face_element=False)             # <<<<<<<<<<<<<<
 *         style = create_css(edge_color=self.edge_color, stroke_width=l)
 *         svg = ""
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_style); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1575, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_get_line_width); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1575, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1575, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_face_element, Py_False) < 0) __PYX_ERR(0, 1575, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1575, __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_v_l = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":1576
 *     def to_svg(self):
 *         l = self.style.get_line_width(face_element=False)
 *         style = create_css(edge_color=self.edge_color, stroke_width=l)             # <<<<<<<<<<<<<<
 *         svg = ""
 *         for line in self.lines:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_create_css); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1576, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1576, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_edge_color); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1576, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_edge_color, __pyx_t_2) < 0) __PYX_ERR(0, 1576, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_stroke_width, __pyx_v_l) < 0) __PYX_ERR(0, 1576, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1576, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_style = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":1577
 *         l = self.style.get_line_width(face_element=False)
 *         style = create_css(edge_color=self.edge_color, stroke_width=l)
 *         svg = ""             # <<<<<<<<<<<<<<
 *         for line in self.lines:
 *             svg += '<polyline points="%s" style="%s" />' % (
 */
  __Pyx_INCREF(__pyx_kp_u__41);
  __pyx_v_svg = __pyx_kp_u__41;

  /* "mathics/builtin/graphics.py":1578
 *         style = create_css(edge_color=self.edge_color, stroke_width=l)
 *         svg = ""
 *         for line in self.lines:             # <<<<<<<<<<<<<<
 *             svg += '<polyline points="%s" style="%s" />' % (
 *                 " ".join(["%f,%f" % coords.pos() for coords in line]),
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lines); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1578, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1578, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1578, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 1578, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1578, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 1578, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1578, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_5(__pyx_t_1);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1578, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF_SET(__pyx_v_line, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "mathics/builtin/graphics.py":1579
 *         svg = ""
 *         for line in self.lines:
 *             svg += '<polyline points="%s" style="%s" />' % (             # <<<<<<<<<<<<<<
 *                 " ".join(["%f,%f" % coords.pos() for coords in line]),
 *                 style,
 */
    __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1579, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = 0;
    __pyx_t_7 = 127;
    __Pyx_INCREF(__pyx_kp_u_polyline_points);
    __pyx_t_6 += 18;
    __Pyx_GIVEREF(__pyx_kp_u_polyline_points);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u_polyline_points);

    /* "mathics/builtin/graphics.py":1580
 *         for line in self.lines:
 *             svg += '<polyline points="%s" style="%s" />' % (
 *                 " ".join(["%f,%f" % coords.pos() for coords in line]),             # <<<<<<<<<<<<<<
 *                 style,
 *             )
 */
    { /* enter inner scope */
      __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1580, __pyx_L7_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (likely(PyList_CheckExact(__pyx_v_line)) || PyTuple_CheckExact(__pyx_v_line)) {
        __pyx_t_8 = __pyx_v_line; __Pyx_INCREF(__pyx_t_8); __pyx_t_9 = 0;
        __pyx_t_10 = NULL;
      } else {
        __pyx_t_9 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_v_line); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1580, __pyx_L7_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_10 = Py_TYPE(__pyx_t_8)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1580, __pyx_L7_error)
      }
      for (;;) {
        if (likely(!__pyx_t_10)) {
          if (likely(PyList_CheckExact(__pyx_t_8))) {
            if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_8)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_11 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_9); __Pyx_INCREF(__pyx_t_11); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 1580, __pyx_L7_error)
            #else
            __pyx_t_11 = PySequence_ITEM(__pyx_t_8, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1580, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_11);
            #endif
          } else {
            if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_8)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_11 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_9); __Pyx_INCREF(__pyx_t_11); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 1580, __pyx_L7_error)
            #else
            __pyx_t_11 = PySequence_ITEM(__pyx_t_8, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1580, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_11);
            #endif
          }
        } else {
          __pyx_t_11 = __pyx_t_10(__pyx_t_8);
          if (unlikely(!__pyx_t_11)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 1580, __pyx_L7_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_11);
        }
        __Pyx_XDECREF_SET(__pyx_9genexpr20__pyx_v_coords, __pyx_t_11);
        __pyx_t_11 = 0;
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr20__pyx_v_coords, __pyx_n_s_pos); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1580, __pyx_L7_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_12, function);
          }
        }
        __pyx_t_11 = (__pyx_t_13) ? __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_13) : __Pyx_PyObject_CallNoArg(__pyx_t_12);
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1580, __pyx_L7_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_f_f, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1580, __pyx_L7_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_12))) __PYX_ERR(0, 1580, __pyx_L7_error)
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_9genexpr20__pyx_v_coords); __pyx_9genexpr20__pyx_v_coords = 0;
      goto __pyx_L10_exit_scope;
      __pyx_L7_error:;
      __Pyx_XDECREF(__pyx_9genexpr20__pyx_v_coords); __pyx_9genexpr20__pyx_v_coords = 0;
      goto __pyx_L1_error;
      __pyx_L10_exit_scope:;
    } /* exit inner scope */
    __pyx_t_8 = PyUnicode_Join(__pyx_kp_u__7, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1580, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) : __pyx_t_7;
    __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_8);
    __pyx_t_8 = 0;
    __Pyx_INCREF(__pyx_kp_u_style_2);
    __pyx_t_6 += 9;
    __Pyx_GIVEREF(__pyx_kp_u_style_2);
    PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u_style_2);

    /* "mathics/builtin/graphics.py":1581
 *             svg += '<polyline points="%s" style="%s" />' % (
 *                 " ".join(["%f,%f" % coords.pos() for coords in line]),
 *                 style,             # <<<<<<<<<<<<<<
 *             )
 *         return svg
 */
    __pyx_t_8 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_style), __pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1581, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) : __pyx_t_7;
    __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_8);
    __pyx_t_8 = 0;
    __Pyx_INCREF(__pyx_kp_u__30);
    __pyx_t_6 += 4;
    __Pyx_GIVEREF(__pyx_kp_u__30);
    PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_kp_u__30);

    /* "mathics/builtin/graphics.py":1579
 *         svg = ""
 *         for line in self.lines:
 *             svg += '<polyline points="%s" style="%s" />' % (             # <<<<<<<<<<<<<<
 *                 " ".join(["%f,%f" % coords.pos() for coords in line]),
 *                 style,
 */
    __pyx_t_8 = __Pyx_PyUnicode_Join(__pyx_t_2, 5, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1579, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_v_svg, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1579, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF_SET(__pyx_v_svg, ((PyObject*)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "mathics/builtin/graphics.py":1578
 *         style = create_css(edge_color=self.edge_color, stroke_width=l)
 *         svg = ""
 *         for line in self.lines:             # <<<<<<<<<<<<<<
 *             svg += '<polyline points="%s" style="%s" />' % (
 *                 " ".join(["%f,%f" % coords.pos() for coords in line]),
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1583
 *                 style,
 *             )
 *         return svg             # <<<<<<<<<<<<<<
 * 
 *     def to_asy(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_svg);
  __pyx_r = __pyx_v_svg;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":1574
 *             raise BoxConstructError
 * 
 *     def to_svg(self):             # <<<<<<<<<<<<<<
 *         l = self.style.get_line_width(face_element=False)
 *         style = create_css(edge_color=self.edge_color, stroke_width=l)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("mathics.builtin.graphics.LineBox.to_svg", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_l);
  __Pyx_XDECREF(__pyx_v_style);
  __Pyx_XDECREF(__pyx_v_svg);
  __Pyx_XDECREF(__pyx_v_line);
  __Pyx_XDECREF(__pyx_9genexpr20__pyx_v_coords);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":1585
 *         return svg
 * 
 *     def to_asy(self):             # <<<<<<<<<<<<<<
 *         l = self.style.get_line_width(face_element=False)
 *         pen = create_pens(edge_color=self.edge_color, stroke_width=l)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_7LineBox_5to_asy(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_7LineBox_5to_asy = {"to_asy", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_7LineBox_5to_asy, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_7LineBox_5to_asy(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_asy (wrapper)", 0);
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_7LineBox_4to_asy(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_7LineBox_4to_asy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_l = NULL;
  PyObject *__pyx_v_pen = NULL;
  PyObject *__pyx_v_asy = NULL;
  PyObject *__pyx_v_line = NULL;
  PyObject *__pyx_v_path = NULL;
  PyObject *__pyx_9genexpr21__pyx_v_coords = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  Py_UCS4 __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_asy", 0);

  /* "mathics/builtin/graphics.py":1586
 * 
 *     def to_asy(self):
 *         l = self.style.get_line_width(face_element=False)             # <<<<<<<<<<<<<<
 *         pen = create_pens(edge_color=self.edge_color, stroke_width=l)
 *         asy = ""
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_style); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1586, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_get_line_width); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1586, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1586, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_face_element, Py_False) < 0) __PYX_ERR(0, 1586, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1586, __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_v_l = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":1587
 *     def to_asy(self):
 *         l = self.style.get_line_width(face_element=False)
 *         pen = create_pens(edge_color=self.edge_color, stroke_width=l)             # <<<<<<<<<<<<<<
 *         asy = ""
 *         for line in self.lines:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_create_pens); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1587, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1587, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_edge_color); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1587, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_edge_color, __pyx_t_2) < 0) __PYX_ERR(0, 1587, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_stroke_width, __pyx_v_l) < 0) __PYX_ERR(0, 1587, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1587, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_pen = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":1588
 *         l = self.style.get_line_width(face_element=False)
 *         pen = create_pens(edge_color=self.edge_color, stroke_width=l)
 *         asy = ""             # <<<<<<<<<<<<<<
 *         for line in self.lines:
 *             path = "--".join(["(%.5g,%5g)" % coords.pos() for coords in line])
 */
  __Pyx_INCREF(__pyx_kp_u__41);
  __pyx_v_asy = __pyx_kp_u__41;

  /* "mathics/builtin/graphics.py":1589
 *         pen = create_pens(edge_color=self.edge_color, stroke_width=l)
 *         asy = ""
 *         for line in self.lines:             # <<<<<<<<<<<<<<
 *             path = "--".join(["(%.5g,%5g)" % coords.pos() for coords in line])
 *             asy += "draw(%s, %s);" % (path, pen)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lines); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1589, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1589, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1589, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 1589, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1589, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 1589, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1589, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_5(__pyx_t_1);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1589, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF_SET(__pyx_v_line, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "mathics/builtin/graphics.py":1590
 *         asy = ""
 *         for line in self.lines:
 *             path = "--".join(["(%.5g,%5g)" % coords.pos() for coords in line])             # <<<<<<<<<<<<<<
 *             asy += "draw(%s, %s);" % (path, pen)
 *         return asy
 */
    { /* enter inner scope */
      __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1590, __pyx_L7_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (likely(PyList_CheckExact(__pyx_v_line)) || PyTuple_CheckExact(__pyx_v_line)) {
        __pyx_t_3 = __pyx_v_line; __Pyx_INCREF(__pyx_t_3); __pyx_t_6 = 0;
        __pyx_t_7 = NULL;
      } else {
        __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_line); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1590, __pyx_L7_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_7 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1590, __pyx_L7_error)
      }
      for (;;) {
        if (likely(!__pyx_t_7)) {
          if (likely(PyList_CheckExact(__pyx_t_3))) {
            if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_3)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_8 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 1590, __pyx_L7_error)
            #else
            __pyx_t_8 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1590, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_8);
            #endif
          } else {
            if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 1590, __pyx_L7_error)
            #else
            __pyx_t_8 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1590, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_8);
            #endif
          }
        } else {
          __pyx_t_8 = __pyx_t_7(__pyx_t_3);
          if (unlikely(!__pyx_t_8)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 1590, __pyx_L7_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_8);
        }
        __Pyx_XDECREF_SET(__pyx_9genexpr21__pyx_v_coords, __pyx_t_8);
        __pyx_t_8 = 0;
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr21__pyx_v_coords, __pyx_n_s_pos); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1590, __pyx_L7_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_10 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
          __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
          if (likely(__pyx_t_10)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
            __Pyx_INCREF(__pyx_t_10);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_9, function);
          }
        }
        __pyx_t_8 = (__pyx_t_10) ? __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10) : __Pyx_PyObject_CallNoArg(__pyx_t_9);
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1590, __pyx_L7_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_5g_5g, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1590, __pyx_L7_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 1590, __pyx_L7_error)
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_9genexpr21__pyx_v_coords); __pyx_9genexpr21__pyx_v_coords = 0;
      goto __pyx_L10_exit_scope;
      __pyx_L7_error:;
      __Pyx_XDECREF(__pyx_9genexpr21__pyx_v_coords); __pyx_9genexpr21__pyx_v_coords = 0;
      goto __pyx_L1_error;
      __pyx_L10_exit_scope:;
    } /* exit inner scope */
    __pyx_t_3 = PyUnicode_Join(__pyx_kp_u__43, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1590, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF_SET(__pyx_v_path, ((PyObject*)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "mathics/builtin/graphics.py":1591
 *         for line in self.lines:
 *             path = "--".join(["(%.5g,%5g)" % coords.pos() for coords in line])
 *             asy += "draw(%s, %s);" % (path, pen)             # <<<<<<<<<<<<<<
 *         return asy
 * 
 */
    __pyx_t_3 = PyTuple_New(5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1591, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = 0;
    __pyx_t_11 = 127;
    __Pyx_INCREF(__pyx_kp_u_draw_2);
    __pyx_t_6 += 5;
    __Pyx_GIVEREF(__pyx_kp_u_draw_2);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_draw_2);
    __pyx_t_2 = __Pyx_PyUnicode_Unicode(__pyx_v_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1591, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_11 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_11) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_11;
    __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
    __pyx_t_2 = 0;
    __Pyx_INCREF(__pyx_kp_u__4);
    __pyx_t_6 += 2;
    __Pyx_GIVEREF(__pyx_kp_u__4);
    PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u__4);
    __pyx_t_2 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_pen), __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1591, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_11 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_11) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_11;
    __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_2);
    __pyx_t_2 = 0;
    __Pyx_INCREF(__pyx_kp_u__33);
    __pyx_t_6 += 2;
    __Pyx_GIVEREF(__pyx_kp_u__33);
    PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_kp_u__33);
    __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_3, 5, __pyx_t_6, __pyx_t_11); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1591, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_v_asy, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1591, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF_SET(__pyx_v_asy, ((PyObject*)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "mathics/builtin/graphics.py":1589
 *         pen = create_pens(edge_color=self.edge_color, stroke_width=l)
 *         asy = ""
 *         for line in self.lines:             # <<<<<<<<<<<<<<
 *             path = "--".join(["(%.5g,%5g)" % coords.pos() for coords in line])
 *             asy += "draw(%s, %s);" % (path, pen)
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1592
 *             path = "--".join(["(%.5g,%5g)" % coords.pos() for coords in line])
 *             asy += "draw(%s, %s);" % (path, pen)
 *         return asy             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_asy);
  __pyx_r = __pyx_v_asy;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":1585
 *         return svg
 * 
 *     def to_asy(self):             # <<<<<<<<<<<<<<
 *         l = self.style.get_line_width(face_element=False)
 *         pen = create_pens(edge_color=self.edge_color, stroke_width=l)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("mathics.builtin.graphics.LineBox.to_asy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_l);
  __Pyx_XDECREF(__pyx_v_pen);
  __Pyx_XDECREF(__pyx_v_asy);
  __Pyx_XDECREF(__pyx_v_line);
  __Pyx_XDECREF(__pyx_v_path);
  __Pyx_XDECREF(__pyx_9genexpr21__pyx_v_coords);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7mathics_7builtin_8graphics_32generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "mathics/builtin/graphics.py":1595
 * 
 * 
 * def _svg_bezier(*segments):             # <<<<<<<<<<<<<<
 *     # see https://www.w3.org/TR/SVG/paths.html#PathDataCubicBezierCommands
 *     # see https://docs.webplatform.org/wiki/svg/tutorials/smarter_svg_shapes
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_31_svg_bezier(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_31_svg_bezier = {"_svg_bezier", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_31_svg_bezier, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_31_svg_bezier(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_segments = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_svg_bezier (wrapper)", 0);
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "_svg_bezier", 0))) return NULL;
  __Pyx_INCREF(__pyx_args);
  __pyx_v_segments = __pyx_args;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_30_svg_bezier(__pyx_self, __pyx_v_segments);

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_30_svg_bezier(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_segments) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_20__svg_bezier *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_svg_bezier", 0);
  __pyx_cur_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_20__svg_bezier *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_20__svg_bezier(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_20__svg_bezier, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_20__svg_bezier *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1595, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_segments = __pyx_v_segments;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_segments);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_segments);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7mathics_7builtin_8graphics_32generator, __pyx_codeobj__44, (PyObject *) __pyx_cur_scope, __pyx_n_s_svg_bezier, __pyx_n_s_svg_bezier, __pyx_n_s_mathics_builtin_graphics); if (unlikely(!gen)) __PYX_ERR(0, 1595, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics._svg_bezier", __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_7mathics_7builtin_8graphics_11_svg_bezier_2generator17(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "mathics/builtin/graphics.py":1607
 *     forms = "LQC"  # SVG commands for line, quadratic bezier, cubic bezier
 * 
 *     def path(max_degree, p):             # <<<<<<<<<<<<<<
 *         max_degree = min(max_degree, len(forms))
 *         while p:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_11_svg_bezier_1path(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_11_svg_bezier_1path = {"path", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_11_svg_bezier_1path, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_11_svg_bezier_1path(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_max_degree = 0;
  PyObject *__pyx_v_p = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("path (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_max_degree,&__pyx_n_s_p,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_degree)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_p)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("path", 1, 2, 2, 1); __PYX_ERR(0, 1607, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "path") < 0)) __PYX_ERR(0, 1607, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_max_degree = values[0];
    __pyx_v_p = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("path", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1607, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics._svg_bezier.path", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_11_svg_bezier_path(__pyx_self, __pyx_v_max_degree, __pyx_v_p);

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

/* "mathics/builtin/graphics.py":1613
 *             if n < 1:
 *                 raise BoxConstructError
 *             yield forms[n - 1] + " ".join("%f,%f" % xy for xy in p[:n])             # <<<<<<<<<<<<<<
 *             p = p[n:]
 * 
 */

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_11_svg_bezier_4path_genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_22_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_22_genexpr *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_22_genexpr(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_22_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_22_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1613, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_21_path *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7mathics_7builtin_8graphics_11_svg_bezier_4path_2generator18, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_svg_bezier_locals_path_locals_g, __pyx_n_s_mathics_builtin_graphics); if (unlikely(!gen)) __PYX_ERR(0, 1613, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics._svg_bezier.path.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_7mathics_7builtin_8graphics_11_svg_bezier_4path_2generator18(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_22_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_22_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1613, __pyx_L1_error)
  __pyx_r = PyList_New(0); if (unlikely(!__pyx_r)) __PYX_ERR(0, 1613, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_p)) { __Pyx_RaiseClosureNameError("p"); __PYX_ERR(0, 1613, __pyx_L1_error) }
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_n)) { __Pyx_RaiseClosureNameError("n"); __PYX_ERR(0, 1613, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_p, 0, 0, NULL, &__pyx_cur_scope->__pyx_outer_scope->__pyx_v_n, NULL, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1613, __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(0, 1613, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1613, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 1613, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1613, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 1613, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1613, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1613, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_xy);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_xy, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_f_f, __pyx_cur_scope->__pyx_v_xy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1613, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (unlikely(__Pyx_ListComp_Append(__pyx_r, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 1613, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

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

/* "mathics/builtin/graphics.py":1607
 *     forms = "LQC"  # SVG commands for line, quadratic bezier, cubic bezier
 * 
 *     def path(max_degree, p):             # <<<<<<<<<<<<<<
 *         max_degree = min(max_degree, len(forms))
 *         while p:
 */

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_11_svg_bezier_path(PyObject *__pyx_self, PyObject *__pyx_v_max_degree, PyObject *__pyx_v_p) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_21_path *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("path", 0);
  __pyx_cur_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_21_path *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_21_path(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_21_path, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_21_path *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1607, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_20__svg_bezier *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  __pyx_cur_scope->__pyx_v_max_degree = __pyx_v_max_degree;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_max_degree);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_max_degree);
  __pyx_cur_scope->__pyx_v_p = __pyx_v_p;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_p);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_p);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7mathics_7builtin_8graphics_11_svg_bezier_2generator17, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_path, __pyx_n_s_svg_bezier_locals_path, __pyx_n_s_mathics_builtin_graphics); if (unlikely(!gen)) __PYX_ERR(0, 1607, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics._svg_bezier.path", __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_7mathics_7builtin_8graphics_11_svg_bezier_2generator17(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_21_path *__pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_21_path *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("path", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L7_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1607, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1608
 * 
 *     def path(max_degree, p):
 *         max_degree = min(max_degree, len(forms))             # <<<<<<<<<<<<<<
 *         while p:
 *             n = min(max_degree, len(p))  # 1, 2, or 3
 */
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_forms)) { __Pyx_RaiseClosureNameError("forms"); __PYX_ERR(0, 1608, __pyx_L1_error) }
  __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_forms;
  __Pyx_INCREF(__pyx_t_1);
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(0, 1608, __pyx_L1_error)
  }
  __pyx_t_2 = __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1608, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_max_degree);
  __pyx_t_1 = __pyx_cur_scope->__pyx_v_max_degree;
  __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1608, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1608, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 1608, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_6) {
    __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1608, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = __pyx_t_5;
    __pyx_t_5 = 0;
  } else {
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_3 = __pyx_t_1;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __pyx_t_3;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_max_degree);
  __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_max_degree, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1609
 *     def path(max_degree, p):
 *         max_degree = min(max_degree, len(forms))
 *         while p:             # <<<<<<<<<<<<<<
 *             n = min(max_degree, len(p))  # 1, 2, or 3
 *             if n < 1:
 */
  while (1) {
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_p); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 1609, __pyx_L1_error)
    if (!__pyx_t_6) break;

    /* "mathics/builtin/graphics.py":1610
 *         max_degree = min(max_degree, len(forms))
 *         while p:
 *             n = min(max_degree, len(p))  # 1, 2, or 3             # <<<<<<<<<<<<<<
 *             if n < 1:
 *                 raise BoxConstructError
 */
    __pyx_t_1 = __pyx_cur_scope->__pyx_v_p;
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1610, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_max_degree);
    __pyx_t_1 = __pyx_cur_scope->__pyx_v_max_degree;
    __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1610, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1610, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 1610, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_6) {
      __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1610, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __pyx_t_4;
      __pyx_t_4 = 0;
    } else {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __pyx_t_3;
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_n);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_n, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;

    /* "mathics/builtin/graphics.py":1611
 *         while p:
 *             n = min(max_degree, len(p))  # 1, 2, or 3
 *             if n < 1:             # <<<<<<<<<<<<<<
 *                 raise BoxConstructError
 *             yield forms[n - 1] + " ".join("%f,%f" % xy for xy in p[:n])
 */
    __pyx_t_1 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_n, __pyx_int_1, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1611, __pyx_L1_error)
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 1611, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(__pyx_t_6)) {

      /* "mathics/builtin/graphics.py":1612
 *             n = min(max_degree, len(p))  # 1, 2, or 3
 *             if n < 1:
 *                 raise BoxConstructError             # <<<<<<<<<<<<<<
 *             yield forms[n - 1] + " ".join("%f,%f" % xy for xy in p[:n])
 *             p = p[n:]
 */
      __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_BoxConstructError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1612, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_ERR(0, 1612, __pyx_L1_error)

      /* "mathics/builtin/graphics.py":1611
 *         while p:
 *             n = min(max_degree, len(p))  # 1, 2, or 3
 *             if n < 1:             # <<<<<<<<<<<<<<
 *                 raise BoxConstructError
 *             yield forms[n - 1] + " ".join("%f,%f" % xy for xy in p[:n])
 */
    }

    /* "mathics/builtin/graphics.py":1613
 *             if n < 1:
 *                 raise BoxConstructError
 *             yield forms[n - 1] + " ".join("%f,%f" % xy for xy in p[:n])             # <<<<<<<<<<<<<<
 *             p = p[n:]
 * 
 */
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_forms)) { __Pyx_RaiseClosureNameError("forms"); __PYX_ERR(0, 1613, __pyx_L1_error) }
    __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_cur_scope->__pyx_v_n, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1613, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_forms, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1613, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __pyx_pf_7mathics_7builtin_8graphics_11_svg_bezier_4path_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1613, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_Generator_Next(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1613, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyUnicode_Join(__pyx_kp_u__7, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1613, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1613, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L7_resume_from_yield:;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1613, __pyx_L1_error)

    /* "mathics/builtin/graphics.py":1614
 *                 raise BoxConstructError
 *             yield forms[n - 1] + " ".join("%f,%f" % xy for xy in p[:n])
 *             p = p[n:]             # <<<<<<<<<<<<<<
 * 
 *     k, p = segments[0]
 */
    __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_cur_scope->__pyx_v_p, 0, 0, &__pyx_cur_scope->__pyx_v_n, NULL, NULL, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1614, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_p);
    __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_p, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "mathics/builtin/graphics.py":1607
 *     forms = "LQC"  # SVG commands for line, quadratic bezier, cubic bezier
 * 
 *     def path(max_degree, p):             # <<<<<<<<<<<<<<
 *         max_degree = min(max_degree, len(forms))
 *         while p:
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  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_AddTraceback("path", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":1595
 * 
 * 
 * def _svg_bezier(*segments):             # <<<<<<<<<<<<<<
 *     # see https://www.w3.org/TR/SVG/paths.html#PathDataCubicBezierCommands
 *     # see https://docs.webplatform.org/wiki/svg/tutorials/smarter_svg_shapes
 */

static PyObject *__pyx_gb_7mathics_7builtin_8graphics_32generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_20__svg_bezier *__pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_20__svg_bezier *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *(*__pyx_t_8)(PyObject *);
  Py_ssize_t __pyx_t_9;
  PyObject *(*__pyx_t_10)(PyObject *);
  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_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_svg_bezier", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L11_resume_from_yield;
    case 2: goto __pyx_L14_resume_from_yield;
    case 3: goto __pyx_L21_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1595, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1599
 *     # see https://docs.webplatform.org/wiki/svg/tutorials/smarter_svg_shapes
 * 
 *     while segments and not segments[0][1]:             # <<<<<<<<<<<<<<
 *         segments = segments[1:]
 * 
 */
  while (1) {
    __pyx_t_2 = (PyTuple_GET_SIZE(__pyx_cur_scope->__pyx_v_segments) != 0);
    if (__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_3 = __Pyx_GetItemInt_Tuple(__pyx_cur_scope->__pyx_v_segments, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1599, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1599, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1599, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = ((!__pyx_t_2) != 0);
    __pyx_t_1 = __pyx_t_5;
    __pyx_L6_bool_binop_done:;
    if (!__pyx_t_1) break;

    /* "mathics/builtin/graphics.py":1600
 * 
 *     while segments and not segments[0][1]:
 *         segments = segments[1:]             # <<<<<<<<<<<<<<
 * 
 *     if not segments:
 */
    __pyx_t_4 = __Pyx_PyTuple_GetSlice(__pyx_cur_scope->__pyx_v_segments, 1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1600, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_segments);
    __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_segments, ((PyObject*)__pyx_t_4));
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
  }

  /* "mathics/builtin/graphics.py":1602
 *         segments = segments[1:]
 * 
 *     if not segments:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_1 = (PyTuple_GET_SIZE(__pyx_cur_scope->__pyx_v_segments) != 0);
  __pyx_t_5 = ((!__pyx_t_1) != 0);
  if (__pyx_t_5) {

    /* "mathics/builtin/graphics.py":1603
 * 
 *     if not segments:
 *         return             # <<<<<<<<<<<<<<
 * 
 *     forms = "LQC"  # SVG commands for line, quadratic bezier, cubic bezier
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = NULL;
    goto __pyx_L0;

    /* "mathics/builtin/graphics.py":1602
 *         segments = segments[1:]
 * 
 *     if not segments:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  }

  /* "mathics/builtin/graphics.py":1605
 *         return
 * 
 *     forms = "LQC"  # SVG commands for line, quadratic bezier, cubic bezier             # <<<<<<<<<<<<<<
 * 
 *     def path(max_degree, p):
 */
  __Pyx_INCREF(__pyx_n_u_LQC);
  __Pyx_GIVEREF(__pyx_n_u_LQC);
  __pyx_cur_scope->__pyx_v_forms = __pyx_n_u_LQC;

  /* "mathics/builtin/graphics.py":1607
 *     forms = "LQC"  # SVG commands for line, quadratic bezier, cubic bezier
 * 
 *     def path(max_degree, p):             # <<<<<<<<<<<<<<
 *         max_degree = min(max_degree, len(forms))
 *         while p:
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_11_svg_bezier_1path, 0, __pyx_n_s_svg_bezier_locals_path, ((PyObject*)__pyx_cur_scope), __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1607, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_cur_scope->__pyx_v_path = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":1616
 *             p = p[n:]
 * 
 *     k, p = segments[0]             # <<<<<<<<<<<<<<
 *     yield "M%f,%f" % p[0]
 * 
 */
  __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_cur_scope->__pyx_v_segments, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1616, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
    PyObject* sequence = __pyx_t_4;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 1616, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_6 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_6);
    #else
    __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1616, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1616, __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(0, 1616, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
    index = 0; __pyx_t_3 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_3)) goto __pyx_L9_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L9_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 1616, __pyx_L1_error)
    __pyx_t_8 = NULL;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    goto __pyx_L10_unpacking_done;
    __pyx_L9_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_8 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 1616, __pyx_L1_error)
    __pyx_L10_unpacking_done:;
  }
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_cur_scope->__pyx_v_k = __pyx_t_3;
  __pyx_t_3 = 0;
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_cur_scope->__pyx_v_p = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "mathics/builtin/graphics.py":1617
 * 
 *     k, p = segments[0]
 *     yield "M%f,%f" % p[0]             # <<<<<<<<<<<<<<
 * 
 *     for s in path(k, p[1:]):
 */
  __pyx_t_4 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_p, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1617, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_M_f_f, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1617, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 0;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  /* return from generator, yielding value */
  __pyx_generator->resume_label = 1;
  return __pyx_r;
  __pyx_L11_resume_from_yield:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1617, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1619
 *     yield "M%f,%f" % p[0]
 * 
 *     for s in path(k, p[1:]):             # <<<<<<<<<<<<<<
 *         yield s
 * 
 */
  __pyx_t_6 = __Pyx_PyObject_GetSlice(__pyx_cur_scope->__pyx_v_p, 1, 0, NULL, NULL, &__pyx_slice__13, 1, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1619, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = __pyx_pf_7mathics_7builtin_8graphics_11_svg_bezier_path(__pyx_cur_scope->__pyx_v_path, __pyx_cur_scope->__pyx_v_k, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1619, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
    __pyx_t_6 = __pyx_t_4; __Pyx_INCREF(__pyx_t_6); __pyx_t_9 = 0;
    __pyx_t_10 = NULL;
  } else {
    __pyx_t_9 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1619, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_10 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1619, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  for (;;) {
    if (likely(!__pyx_t_10)) {
      if (likely(PyList_CheckExact(__pyx_t_6))) {
        if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_6)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_9); __Pyx_INCREF(__pyx_t_4); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 1619, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_6, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1619, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_9); __Pyx_INCREF(__pyx_t_4); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 1619, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_6, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1619, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_10(__pyx_t_6);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1619, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_s);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_s, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;

    /* "mathics/builtin/graphics.py":1620
 * 
 *     for s in path(k, p[1:]):
 *         yield s             # <<<<<<<<<<<<<<
 * 
 *     for k, p in segments[1:]:
 */
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_s);
    __pyx_r = __pyx_cur_scope->__pyx_v_s;
    __Pyx_XGIVEREF(__pyx_t_6);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_6;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_9;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_10;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 2;
    return __pyx_r;
    __pyx_L14_resume_from_yield:;
    __pyx_t_6 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_6);
    __pyx_t_9 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_10 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1620, __pyx_L1_error)

    /* "mathics/builtin/graphics.py":1619
 *     yield "M%f,%f" % p[0]
 * 
 *     for s in path(k, p[1:]):             # <<<<<<<<<<<<<<
 *         yield s
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "mathics/builtin/graphics.py":1622
 *         yield s
 * 
 *     for k, p in segments[1:]:             # <<<<<<<<<<<<<<
 *         for s in path(k, p):
 *             yield s
 */
  __pyx_t_6 = __Pyx_PyTuple_GetSlice(__pyx_cur_scope->__pyx_v_segments, 1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1622, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = __pyx_t_6; __Pyx_INCREF(__pyx_t_4); __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  for (;;) {
    if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_9); __Pyx_INCREF(__pyx_t_6); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 1622, __pyx_L1_error)
    #else
    __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1622, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    #endif
    if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) {
      PyObject* sequence = __pyx_t_6;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 1622, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_7 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_7);
      #else
      __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1622, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1622, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      #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(0, 1622, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_8 = Py_TYPE(__pyx_t_11)->tp_iternext;
      index = 0; __pyx_t_3 = __pyx_t_8(__pyx_t_11); if (unlikely(!__pyx_t_3)) goto __pyx_L17_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_3);
      index = 1; __pyx_t_7 = __pyx_t_8(__pyx_t_11); if (unlikely(!__pyx_t_7)) goto __pyx_L17_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_7);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_11), 2) < 0) __PYX_ERR(0, 1622, __pyx_L1_error)
      __pyx_t_8 = NULL;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      goto __pyx_L18_unpacking_done;
      __pyx_L17_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_8 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 1622, __pyx_L1_error)
      __pyx_L18_unpacking_done:;
    }
    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_k);
    __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_k, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_p);
    __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_p, __pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    __pyx_t_7 = 0;

    /* "mathics/builtin/graphics.py":1623
 * 
 *     for k, p in segments[1:]:
 *         for s in path(k, p):             # <<<<<<<<<<<<<<
 *             yield s
 * 
 */
    __pyx_t_6 = __pyx_pf_7mathics_7builtin_8graphics_11_svg_bezier_path(__pyx_cur_scope->__pyx_v_path, __pyx_cur_scope->__pyx_v_k, __pyx_cur_scope->__pyx_v_p); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1623, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) {
      __pyx_t_7 = __pyx_t_6; __Pyx_INCREF(__pyx_t_7); __pyx_t_12 = 0;
      __pyx_t_10 = NULL;
    } else {
      __pyx_t_12 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1623, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_10 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1623, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    for (;;) {
      if (likely(!__pyx_t_10)) {
        if (likely(PyList_CheckExact(__pyx_t_7))) {
          if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_7)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_6 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_12); __Pyx_INCREF(__pyx_t_6); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 1623, __pyx_L1_error)
          #else
          __pyx_t_6 = PySequence_ITEM(__pyx_t_7, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1623, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          #endif
        } else {
          if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_12); __Pyx_INCREF(__pyx_t_6); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 1623, __pyx_L1_error)
          #else
          __pyx_t_6 = PySequence_ITEM(__pyx_t_7, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1623, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          #endif
        }
      } else {
        __pyx_t_6 = __pyx_t_10(__pyx_t_7);
        if (unlikely(!__pyx_t_6)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 1623, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_6);
      }
      __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_s);
      __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_s, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_6);
      __pyx_t_6 = 0;

      /* "mathics/builtin/graphics.py":1624
 *     for k, p in segments[1:]:
 *         for s in path(k, p):
 *             yield s             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_s);
      __pyx_r = __pyx_cur_scope->__pyx_v_s;
      __Pyx_XGIVEREF(__pyx_t_4);
      __pyx_cur_scope->__pyx_t_0 = __pyx_t_4;
      __Pyx_XGIVEREF(__pyx_t_7);
      __pyx_cur_scope->__pyx_t_3 = __pyx_t_7;
      __pyx_cur_scope->__pyx_t_1 = __pyx_t_9;
      __pyx_cur_scope->__pyx_t_2 = __pyx_t_10;
      __pyx_cur_scope->__pyx_t_4 = __pyx_t_12;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
      /* return from generator, yielding value */
      __pyx_generator->resume_label = 3;
      return __pyx_r;
      __pyx_L21_resume_from_yield:;
      __pyx_t_4 = __pyx_cur_scope->__pyx_t_0;
      __pyx_cur_scope->__pyx_t_0 = 0;
      __Pyx_XGOTREF(__pyx_t_4);
      __pyx_t_7 = __pyx_cur_scope->__pyx_t_3;
      __pyx_cur_scope->__pyx_t_3 = 0;
      __Pyx_XGOTREF(__pyx_t_7);
      __pyx_t_9 = __pyx_cur_scope->__pyx_t_1;
      __pyx_t_10 = __pyx_cur_scope->__pyx_t_2;
      __pyx_t_12 = __pyx_cur_scope->__pyx_t_4;
      if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1624, __pyx_L1_error)

      /* "mathics/builtin/graphics.py":1623
 * 
 *     for k, p in segments[1:]:
 *         for s in path(k, p):             # <<<<<<<<<<<<<<
 *             yield s
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "mathics/builtin/graphics.py":1622
 *         yield s
 * 
 *     for k, p in segments[1:]:             # <<<<<<<<<<<<<<
 *         for s in path(k, p):
 *             yield s
 */
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "mathics/builtin/graphics.py":1595
 * 
 * 
 * def _svg_bezier(*segments):             # <<<<<<<<<<<<<<
 *     # see https://www.w3.org/TR/SVG/paths.html#PathDataCubicBezierCommands
 *     # see https://docs.webplatform.org/wiki/svg/tutorials/smarter_svg_shapes
 */

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

/* "mathics/builtin/graphics.py":1627
 * 
 * 
 * def _asy_bezier(*segments):             # <<<<<<<<<<<<<<
 *     # see http://asymptote.sourceforge.net/doc/Bezier-curves.html#Bezier-curves
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_34_asy_bezier(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_34_asy_bezier = {"_asy_bezier", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_34_asy_bezier, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_34_asy_bezier(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_segments = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_asy_bezier (wrapper)", 0);
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "_asy_bezier", 0))) return NULL;
  __Pyx_INCREF(__pyx_args);
  __pyx_v_segments = __pyx_args;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_33_asy_bezier(__pyx_self, __pyx_v_segments);

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_33_asy_bezier(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_segments) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_23__asy_bezier *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_asy_bezier", 0);
  __pyx_cur_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_23__asy_bezier *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_23__asy_bezier(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_23__asy_bezier, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_23__asy_bezier *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1627, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_segments = __pyx_v_segments;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_segments);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_segments);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7mathics_7builtin_8graphics_35generator1, __pyx_codeobj__47, (PyObject *) __pyx_cur_scope, __pyx_n_s_asy_bezier, __pyx_n_s_asy_bezier, __pyx_n_s_mathics_builtin_graphics); if (unlikely(!gen)) __PYX_ERR(0, 1627, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics._asy_bezier", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":1636
 *         return
 * 
 *     def cubic(p0, p1, p2, p3):             # <<<<<<<<<<<<<<
 *         return "..controls(%.5g,%.5g) and (%.5g,%.5g)..(%.5g,%.5g)" % tuple(
 *             list(chain(p1, p2, p3))
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_11_asy_bezier_1cubic(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_11_asy_bezier_1cubic = {"cubic", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_11_asy_bezier_1cubic, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_11_asy_bezier_1cubic(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_p0 = 0;
  PyObject *__pyx_v_p1 = 0;
  PyObject *__pyx_v_p2 = 0;
  PyObject *__pyx_v_p3 = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cubic (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_p0,&__pyx_n_s_p1,&__pyx_n_s_p2,&__pyx_n_s_p3,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_p0)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_p1)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cubic", 1, 4, 4, 1); __PYX_ERR(0, 1636, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_p2)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cubic", 1, 4, 4, 2); __PYX_ERR(0, 1636, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_p3)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cubic", 1, 4, 4, 3); __PYX_ERR(0, 1636, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cubic") < 0)) __PYX_ERR(0, 1636, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __pyx_v_p0 = values[0];
    __pyx_v_p1 = values[1];
    __pyx_v_p2 = values[2];
    __pyx_v_p3 = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("cubic", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1636, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics._asy_bezier.cubic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_11_asy_bezier_cubic(__pyx_self, __pyx_v_p0, __pyx_v_p1, __pyx_v_p2, __pyx_v_p3);

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_11_asy_bezier_cubic(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_p0, PyObject *__pyx_v_p1, PyObject *__pyx_v_p2, PyObject *__pyx_v_p3) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cubic", 0);

  /* "mathics/builtin/graphics.py":1637
 * 
 *     def cubic(p0, p1, p2, p3):
 *         return "..controls(%.5g,%.5g) and (%.5g,%.5g)..(%.5g,%.5g)" % tuple(             # <<<<<<<<<<<<<<
 *             list(chain(p1, p2, p3))
 *         )
 */
  __Pyx_XDECREF(__pyx_r);

  /* "mathics/builtin/graphics.py":1638
 *     def cubic(p0, p1, p2, p3):
 *         return "..controls(%.5g,%.5g) and (%.5g,%.5g)..(%.5g,%.5g)" % tuple(
 *             list(chain(p1, p2, p3))             # <<<<<<<<<<<<<<
 *         )
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_chain); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1638, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_p1, __pyx_v_p2, __pyx_v_p3};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1638, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_p1, __pyx_v_p2, __pyx_v_p3};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1638, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1638, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(__pyx_v_p1);
    __Pyx_GIVEREF(__pyx_v_p1);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_p1);
    __Pyx_INCREF(__pyx_v_p2);
    __Pyx_GIVEREF(__pyx_v_p2);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_p2);
    __Pyx_INCREF(__pyx_v_p3);
    __Pyx_GIVEREF(__pyx_v_p3);
    PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_p3);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1638, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PySequence_List(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1638, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1637
 * 
 *     def cubic(p0, p1, p2, p3):
 *         return "..controls(%.5g,%.5g) and (%.5g,%.5g)..(%.5g,%.5g)" % tuple(             # <<<<<<<<<<<<<<
 *             list(chain(p1, p2, p3))
 *         )
 */
  __pyx_t_1 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1637, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyUnicode_Format(__pyx_kp_u_controls_5g_5g_and_5g_5g_5g_5g, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1637, __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;

  /* "mathics/builtin/graphics.py":1636
 *         return
 * 
 *     def cubic(p0, p1, p2, p3):             # <<<<<<<<<<<<<<
 *         return "..controls(%.5g,%.5g) and (%.5g,%.5g)..(%.5g,%.5g)" % tuple(
 *             list(chain(p1, p2, p3))
 */

  /* 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("mathics.builtin.graphics._asy_bezier.cubic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":1641
 *         )
 * 
 *     def quadratric(qp0, qp1, qp2):             # <<<<<<<<<<<<<<
 *         # asymptote only supports cubic beziers, so we convert this quadratic
 *         # bezier to a cubic bezier, see http://fontforge.github.io/bezier.html
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_11_asy_bezier_3quadratric(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_11_asy_bezier_3quadratric = {"quadratric", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_11_asy_bezier_3quadratric, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_11_asy_bezier_3quadratric(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_qp0 = 0;
  PyObject *__pyx_v_qp1 = 0;
  PyObject *__pyx_v_qp2 = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("quadratric (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_qp0,&__pyx_n_s_qp1,&__pyx_n_s_qp2,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_qp0)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_qp1)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("quadratric", 1, 3, 3, 1); __PYX_ERR(0, 1641, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_qp2)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("quadratric", 1, 3, 3, 2); __PYX_ERR(0, 1641, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "quadratric") < 0)) __PYX_ERR(0, 1641, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_qp0 = values[0];
    __pyx_v_qp1 = values[1];
    __pyx_v_qp2 = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("quadratric", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1641, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics._asy_bezier.quadratric", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_11_asy_bezier_2quadratric(__pyx_self, __pyx_v_qp0, __pyx_v_qp1, __pyx_v_qp2);

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_11_asy_bezier_2quadratric(PyObject *__pyx_self, PyObject *__pyx_v_qp0, PyObject *__pyx_v_qp1, PyObject *__pyx_v_qp2) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_23__asy_bezier *__pyx_cur_scope;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_23__asy_bezier *__pyx_outer_scope;
  PyObject *__pyx_v_qp0x = NULL;
  PyObject *__pyx_v_qp0y = NULL;
  PyObject *__pyx_v_qp1x = NULL;
  PyObject *__pyx_v_qp1y = NULL;
  PyObject *__pyx_v_qp2x = NULL;
  PyObject *__pyx_v_qp2y = NULL;
  double __pyx_v_t;
  PyObject *__pyx_v_cp0 = NULL;
  PyObject *__pyx_v_cp1 = NULL;
  PyObject *__pyx_v_cp2 = NULL;
  PyObject *__pyx_v_cp3 = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("quadratric", 0);
  __pyx_outer_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_23__asy_bezier *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "mathics/builtin/graphics.py":1650
 *         # CP2 = QP2 + 2 / 3 * (QP1 - QP2)
 * 
 *         qp0x, qp0y = qp0             # <<<<<<<<<<<<<<
 *         qp1x, qp1y = qp1
 *         qp2x, qp2y = qp2
 */
  if ((likely(PyTuple_CheckExact(__pyx_v_qp0))) || (PyList_CheckExact(__pyx_v_qp0))) {
    PyObject* sequence = __pyx_v_qp0;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 1650, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_2);
    #else
    __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1650, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1650, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
  } else {
    Py_ssize_t index = -1;
    __pyx_t_3 = PyObject_GetIter(__pyx_v_qp0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1650, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext;
    index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) __PYX_ERR(0, 1650, __pyx_L1_error)
    __pyx_t_4 = NULL;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 1650, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  __pyx_v_qp0x = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v_qp0y = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":1651
 * 
 *         qp0x, qp0y = qp0
 *         qp1x, qp1y = qp1             # <<<<<<<<<<<<<<
 *         qp2x, qp2y = qp2
 * 
 */
  if ((likely(PyTuple_CheckExact(__pyx_v_qp1))) || (PyList_CheckExact(__pyx_v_qp1))) {
    PyObject* sequence = __pyx_v_qp1;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 1651, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_1);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1651, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1651, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    #endif
  } else {
    Py_ssize_t index = -1;
    __pyx_t_3 = PyObject_GetIter(__pyx_v_qp1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1651, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext;
    index = 0; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 1; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) __PYX_ERR(0, 1651, __pyx_L1_error)
    __pyx_t_4 = NULL;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L6_unpacking_done;
    __pyx_L5_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 1651, __pyx_L1_error)
    __pyx_L6_unpacking_done:;
  }
  __pyx_v_qp1x = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_v_qp1y = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1652
 *         qp0x, qp0y = qp0
 *         qp1x, qp1y = qp1
 *         qp2x, qp2y = qp2             # <<<<<<<<<<<<<<
 * 
 *         t = 2.0 / 3.0
 */
  if ((likely(PyTuple_CheckExact(__pyx_v_qp2))) || (PyList_CheckExact(__pyx_v_qp2))) {
    PyObject* sequence = __pyx_v_qp2;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 1652, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_2);
    #else
    __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1652, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1652, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
  } else {
    Py_ssize_t index = -1;
    __pyx_t_3 = PyObject_GetIter(__pyx_v_qp2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1652, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext;
    index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L7_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L7_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) __PYX_ERR(0, 1652, __pyx_L1_error)
    __pyx_t_4 = NULL;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_unpacking_done;
    __pyx_L7_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 1652, __pyx_L1_error)
    __pyx_L8_unpacking_done:;
  }
  __pyx_v_qp2x = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v_qp2y = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":1654
 *         qp2x, qp2y = qp2
 * 
 *         t = 2.0 / 3.0             # <<<<<<<<<<<<<<
 *         cp0 = qp0
 *         cp1 = (qp0x + t * (qp1x - qp0x), qp0y + t * (qp1y - qp0y))
 */
  __pyx_v_t = (2.0 / 3.0);

  /* "mathics/builtin/graphics.py":1655
 * 
 *         t = 2.0 / 3.0
 *         cp0 = qp0             # <<<<<<<<<<<<<<
 *         cp1 = (qp0x + t * (qp1x - qp0x), qp0y + t * (qp1y - qp0y))
 *         cp2 = (qp2x + t * (qp1x - qp2x), qp2y + t * (qp1y - qp2y))
 */
  __Pyx_INCREF(__pyx_v_qp0);
  __pyx_v_cp0 = __pyx_v_qp0;

  /* "mathics/builtin/graphics.py":1656
 *         t = 2.0 / 3.0
 *         cp0 = qp0
 *         cp1 = (qp0x + t * (qp1x - qp0x), qp0y + t * (qp1y - qp0y))             # <<<<<<<<<<<<<<
 *         cp2 = (qp2x + t * (qp1x - qp2x), qp2y + t * (qp1y - qp2y))
 *         cp3 = qp2
 */
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_t); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1656, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyNumber_Subtract(__pyx_v_qp1x, __pyx_v_qp0x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1656, __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(0, 1656, __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_1 = PyNumber_Add(__pyx_v_qp0x, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1656, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1656, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyNumber_Subtract(__pyx_v_qp1y, __pyx_v_qp0y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1656, __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(0, 1656, __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_Add(__pyx_v_qp0y, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1656, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1656, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_v_cp1 = ((PyObject*)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":1657
 *         cp0 = qp0
 *         cp1 = (qp0x + t * (qp1x - qp0x), qp0y + t * (qp1y - qp0y))
 *         cp2 = (qp2x + t * (qp1x - qp2x), qp2y + t * (qp1y - qp2y))             # <<<<<<<<<<<<<<
 *         cp3 = qp2
 * 
 */
  __pyx_t_5 = PyFloat_FromDouble(__pyx_v_t); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1657, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = PyNumber_Subtract(__pyx_v_qp1x, __pyx_v_qp2x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1657, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyNumber_Multiply(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1657, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_Add(__pyx_v_qp2x, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1657, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_t); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1657, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyNumber_Subtract(__pyx_v_qp1y, __pyx_v_qp2y); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1657, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1657, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyNumber_Add(__pyx_v_qp2y, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1657, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1657, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5);
  __pyx_t_2 = 0;
  __pyx_t_5 = 0;
  __pyx_v_cp2 = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":1658
 *         cp1 = (qp0x + t * (qp1x - qp0x), qp0y + t * (qp1y - qp0y))
 *         cp2 = (qp2x + t * (qp1x - qp2x), qp2y + t * (qp1y - qp2y))
 *         cp3 = qp2             # <<<<<<<<<<<<<<
 * 
 *         return cubic(cp0, cp1, cp2, cp3)
 */
  __Pyx_INCREF(__pyx_v_qp2);
  __pyx_v_cp3 = __pyx_v_qp2;

  /* "mathics/builtin/graphics.py":1660
 *         cp3 = qp2
 * 
 *         return cubic(cp0, cp1, cp2, cp3)             # <<<<<<<<<<<<<<
 * 
 *     def linear(p0, p1):
 */
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_cubic)) { __Pyx_RaiseClosureNameError("cubic"); __PYX_ERR(0, 1660, __pyx_L1_error) }
  __pyx_t_3 = __pyx_pf_7mathics_7builtin_8graphics_11_asy_bezier_cubic(__pyx_cur_scope->__pyx_v_cubic, __pyx_v_cp0, __pyx_v_cp1, __pyx_v_cp2, __pyx_v_cp3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1660, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":1641
 *         )
 * 
 *     def quadratric(qp0, qp1, qp2):             # <<<<<<<<<<<<<<
 *         # asymptote only supports cubic beziers, so we convert this quadratic
 *         # bezier to a cubic bezier, see http://fontforge.github.io/bezier.html
 */

  /* 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("mathics.builtin.graphics._asy_bezier.quadratric", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_qp0x);
  __Pyx_XDECREF(__pyx_v_qp0y);
  __Pyx_XDECREF(__pyx_v_qp1x);
  __Pyx_XDECREF(__pyx_v_qp1y);
  __Pyx_XDECREF(__pyx_v_qp2x);
  __Pyx_XDECREF(__pyx_v_qp2y);
  __Pyx_XDECREF(__pyx_v_cp0);
  __Pyx_XDECREF(__pyx_v_cp1);
  __Pyx_XDECREF(__pyx_v_cp2);
  __Pyx_XDECREF(__pyx_v_cp3);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":1662
 *         return cubic(cp0, cp1, cp2, cp3)
 * 
 *     def linear(p0, p1):             # <<<<<<<<<<<<<<
 *         return "--(%.5g,%.5g)" % p1
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_11_asy_bezier_5linear(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_11_asy_bezier_5linear = {"linear", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_11_asy_bezier_5linear, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_11_asy_bezier_5linear(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_p0 = 0;
  PyObject *__pyx_v_p1 = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("linear (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_p0,&__pyx_n_s_p1,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_p0)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_p1)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("linear", 1, 2, 2, 1); __PYX_ERR(0, 1662, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "linear") < 0)) __PYX_ERR(0, 1662, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_p0 = values[0];
    __pyx_v_p1 = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("linear", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1662, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics._asy_bezier.linear", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_11_asy_bezier_4linear(__pyx_self, __pyx_v_p0, __pyx_v_p1);

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_11_asy_bezier_4linear(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_p0, PyObject *__pyx_v_p1) {
  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("linear", 0);

  /* "mathics/builtin/graphics.py":1663
 * 
 *     def linear(p0, p1):
 *         return "--(%.5g,%.5g)" % p1             # <<<<<<<<<<<<<<
 * 
 *     forms = (linear, quadratric, cubic)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_5g_5g_2, __pyx_v_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1663, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":1662
 *         return cubic(cp0, cp1, cp2, cp3)
 * 
 *     def linear(p0, p1):             # <<<<<<<<<<<<<<
 *         return "--(%.5g,%.5g)" % p1
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("mathics.builtin.graphics._asy_bezier.linear", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7mathics_7builtin_8graphics_11_asy_bezier_8generator19(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "mathics/builtin/graphics.py":1667
 *     forms = (linear, quadratric, cubic)
 * 
 *     def path(max_degree, p):             # <<<<<<<<<<<<<<
 *         max_degree = min(max_degree, len(forms))
 *         while p:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_11_asy_bezier_7path(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_11_asy_bezier_7path = {"path", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_11_asy_bezier_7path, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_11_asy_bezier_7path(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_max_degree = 0;
  PyObject *__pyx_v_p = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("path (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_max_degree,&__pyx_n_s_p,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_degree)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_p)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("path", 1, 2, 2, 1); __PYX_ERR(0, 1667, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "path") < 0)) __PYX_ERR(0, 1667, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_max_degree = values[0];
    __pyx_v_p = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("path", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1667, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics._asy_bezier.path", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_11_asy_bezier_6path(__pyx_self, __pyx_v_max_degree, __pyx_v_p);

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_11_asy_bezier_6path(PyObject *__pyx_self, PyObject *__pyx_v_max_degree, PyObject *__pyx_v_p) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_24_path *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("path", 0);
  __pyx_cur_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_24_path *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_24_path(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_24_path, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_24_path *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1667, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_23__asy_bezier *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  __pyx_cur_scope->__pyx_v_max_degree = __pyx_v_max_degree;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_max_degree);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_max_degree);
  __pyx_cur_scope->__pyx_v_p = __pyx_v_p;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_p);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_p);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7mathics_7builtin_8graphics_11_asy_bezier_8generator19, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_path, __pyx_n_s_asy_bezier_locals_path, __pyx_n_s_mathics_builtin_graphics); if (unlikely(!gen)) __PYX_ERR(0, 1667, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics._asy_bezier.path", __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_7mathics_7builtin_8graphics_11_asy_bezier_8generator19(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_24_path *__pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_24_path *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("path", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L7_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1667, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1668
 * 
 *     def path(max_degree, p):
 *         max_degree = min(max_degree, len(forms))             # <<<<<<<<<<<<<<
 *         while p:
 *             n = min(max_degree, len(p) - 1)  # 1, 2, or 3
 */
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_forms)) { __Pyx_RaiseClosureNameError("forms"); __PYX_ERR(0, 1668, __pyx_L1_error) }
  __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_forms;
  __Pyx_INCREF(__pyx_t_1);
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(0, 1668, __pyx_L1_error)
  }
  __pyx_t_2 = PyTuple_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1668, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_max_degree);
  __pyx_t_1 = __pyx_cur_scope->__pyx_v_max_degree;
  __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1668, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1668, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 1668, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_6) {
    __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1668, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = __pyx_t_5;
    __pyx_t_5 = 0;
  } else {
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_3 = __pyx_t_1;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __pyx_t_3;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_max_degree);
  __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_max_degree, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1669
 *     def path(max_degree, p):
 *         max_degree = min(max_degree, len(forms))
 *         while p:             # <<<<<<<<<<<<<<
 *             n = min(max_degree, len(p) - 1)  # 1, 2, or 3
 *             if n < 1:
 */
  while (1) {
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_p); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 1669, __pyx_L1_error)
    if (!__pyx_t_6) break;

    /* "mathics/builtin/graphics.py":1670
 *         max_degree = min(max_degree, len(forms))
 *         while p:
 *             n = min(max_degree, len(p) - 1)  # 1, 2, or 3             # <<<<<<<<<<<<<<
 *             if n < 1:
 *                 break
 */
    __pyx_t_2 = PyObject_Length(__pyx_cur_scope->__pyx_v_p); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1670, __pyx_L1_error)
    __pyx_t_7 = (__pyx_t_2 - 1);
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_max_degree);
    __pyx_t_1 = __pyx_cur_scope->__pyx_v_max_degree;
    __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1670, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1670, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 1670, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_6) {
      __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1670, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __pyx_t_4;
      __pyx_t_4 = 0;
    } else {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __pyx_t_3;
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_n);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_n, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;

    /* "mathics/builtin/graphics.py":1671
 *         while p:
 *             n = min(max_degree, len(p) - 1)  # 1, 2, or 3
 *             if n < 1:             # <<<<<<<<<<<<<<
 *                 break
 *             yield forms[n - 1](*p[: n + 1])
 */
    __pyx_t_1 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_n, __pyx_int_1, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1671, __pyx_L1_error)
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 1671, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_6) {

      /* "mathics/builtin/graphics.py":1672
 *             n = min(max_degree, len(p) - 1)  # 1, 2, or 3
 *             if n < 1:
 *                 break             # <<<<<<<<<<<<<<
 *             yield forms[n - 1](*p[: n + 1])
 *             p = p[n:]
 */
      goto __pyx_L5_break;

      /* "mathics/builtin/graphics.py":1671
 *         while p:
 *             n = min(max_degree, len(p) - 1)  # 1, 2, or 3
 *             if n < 1:             # <<<<<<<<<<<<<<
 *                 break
 *             yield forms[n - 1](*p[: n + 1])
 */
    }

    /* "mathics/builtin/graphics.py":1673
 *             if n < 1:
 *                 break
 *             yield forms[n - 1](*p[: n + 1])             # <<<<<<<<<<<<<<
 *             p = p[n:]
 * 
 */
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_forms)) { __Pyx_RaiseClosureNameError("forms"); __PYX_ERR(0, 1673, __pyx_L1_error) }
    if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_forms == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(0, 1673, __pyx_L1_error)
    }
    __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_cur_scope->__pyx_v_n, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1673, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_forms, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1673, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_cur_scope->__pyx_v_n, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1673, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_cur_scope->__pyx_v_p, 0, 0, NULL, &__pyx_t_1, NULL, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1673, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1673, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1673, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L7_resume_from_yield:;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1673, __pyx_L1_error)

    /* "mathics/builtin/graphics.py":1674
 *                 break
 *             yield forms[n - 1](*p[: n + 1])
 *             p = p[n:]             # <<<<<<<<<<<<<<
 * 
 *     k, p = segments[0]
 */
    __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_cur_scope->__pyx_v_p, 0, 0, &__pyx_cur_scope->__pyx_v_n, NULL, NULL, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1674, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_p);
    __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_p, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
  }
  __pyx_L5_break:;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "mathics/builtin/graphics.py":1667
 *     forms = (linear, quadratric, cubic)
 * 
 *     def path(max_degree, p):             # <<<<<<<<<<<<<<
 *         max_degree = min(max_degree, len(forms))
 *         while p:
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  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_AddTraceback("path", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":1627
 * 
 * 
 * def _asy_bezier(*segments):             # <<<<<<<<<<<<<<
 *     # see http://asymptote.sourceforge.net/doc/Bezier-curves.html#Bezier-curves
 * 
 */

static PyObject *__pyx_gb_7mathics_7builtin_8graphics_35generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_23__asy_bezier *__pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_23__asy_bezier *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *(*__pyx_t_8)(PyObject *);
  Py_ssize_t __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  PyObject *(*__pyx_t_13)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_asy_bezier", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L11_resume_from_yield;
    case 2: goto __pyx_L18_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1627, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1630
 *     # see http://asymptote.sourceforge.net/doc/Bezier-curves.html#Bezier-curves
 * 
 *     while segments and not segments[0][1]:             # <<<<<<<<<<<<<<
 *         segments = segments[1:]
 * 
 */
  while (1) {
    __pyx_t_2 = (PyTuple_GET_SIZE(__pyx_cur_scope->__pyx_v_segments) != 0);
    if (__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_3 = __Pyx_GetItemInt_Tuple(__pyx_cur_scope->__pyx_v_segments, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1630, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1630, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1630, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = ((!__pyx_t_2) != 0);
    __pyx_t_1 = __pyx_t_5;
    __pyx_L6_bool_binop_done:;
    if (!__pyx_t_1) break;

    /* "mathics/builtin/graphics.py":1631
 * 
 *     while segments and not segments[0][1]:
 *         segments = segments[1:]             # <<<<<<<<<<<<<<
 * 
 *     if not segments:
 */
    __pyx_t_4 = __Pyx_PyTuple_GetSlice(__pyx_cur_scope->__pyx_v_segments, 1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1631, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_segments);
    __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_segments, ((PyObject*)__pyx_t_4));
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
  }

  /* "mathics/builtin/graphics.py":1633
 *         segments = segments[1:]
 * 
 *     if not segments:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_1 = (PyTuple_GET_SIZE(__pyx_cur_scope->__pyx_v_segments) != 0);
  __pyx_t_5 = ((!__pyx_t_1) != 0);
  if (__pyx_t_5) {

    /* "mathics/builtin/graphics.py":1634
 * 
 *     if not segments:
 *         return             # <<<<<<<<<<<<<<
 * 
 *     def cubic(p0, p1, p2, p3):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = NULL;
    goto __pyx_L0;

    /* "mathics/builtin/graphics.py":1633
 *         segments = segments[1:]
 * 
 *     if not segments:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  }

  /* "mathics/builtin/graphics.py":1636
 *         return
 * 
 *     def cubic(p0, p1, p2, p3):             # <<<<<<<<<<<<<<
 *         return "..controls(%.5g,%.5g) and (%.5g,%.5g)..(%.5g,%.5g)" % tuple(
 *             list(chain(p1, p2, p3))
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_11_asy_bezier_1cubic, 0, __pyx_n_s_asy_bezier_locals_cubic, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__49)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1636, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_cur_scope->__pyx_v_cubic = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":1641
 *         )
 * 
 *     def quadratric(qp0, qp1, qp2):             # <<<<<<<<<<<<<<
 *         # asymptote only supports cubic beziers, so we convert this quadratic
 *         # bezier to a cubic bezier, see http://fontforge.github.io/bezier.html
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_11_asy_bezier_3quadratric, 0, __pyx_n_s_asy_bezier_locals_quadratric, ((PyObject*)__pyx_cur_scope), __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__51)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1641, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_cur_scope->__pyx_v_quadratric = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":1662
 *         return cubic(cp0, cp1, cp2, cp3)
 * 
 *     def linear(p0, p1):             # <<<<<<<<<<<<<<
 *         return "--(%.5g,%.5g)" % p1
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_11_asy_bezier_5linear, 0, __pyx_n_s_asy_bezier_locals_linear, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__53)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1662, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_cur_scope->__pyx_v_linear = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":1665
 *         return "--(%.5g,%.5g)" % p1
 * 
 *     forms = (linear, quadratric, cubic)             # <<<<<<<<<<<<<<
 * 
 *     def path(max_degree, p):
 */
  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1665, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_linear);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_linear);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_cur_scope->__pyx_v_linear);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_quadratric);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_quadratric);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_cur_scope->__pyx_v_quadratric);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_cubic);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_cubic);
  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_cur_scope->__pyx_v_cubic);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_cur_scope->__pyx_v_forms = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":1667
 *     forms = (linear, quadratric, cubic)
 * 
 *     def path(max_degree, p):             # <<<<<<<<<<<<<<
 *         max_degree = min(max_degree, len(forms))
 *         while p:
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_11_asy_bezier_7path, 0, __pyx_n_s_asy_bezier_locals_path, ((PyObject*)__pyx_cur_scope), __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__55)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1667, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_cur_scope->__pyx_v_path = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":1676
 *             p = p[n:]
 * 
 *     k, p = segments[0]             # <<<<<<<<<<<<<<
 *     yield "(%.5g,%.5g)" % p[0]
 * 
 */
  __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_cur_scope->__pyx_v_segments, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1676, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
    PyObject* sequence = __pyx_t_4;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 1676, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_6 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_6);
    #else
    __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1676, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1676, __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(0, 1676, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
    index = 0; __pyx_t_3 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_3)) goto __pyx_L9_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L9_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 1676, __pyx_L1_error)
    __pyx_t_8 = NULL;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    goto __pyx_L10_unpacking_done;
    __pyx_L9_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_8 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 1676, __pyx_L1_error)
    __pyx_L10_unpacking_done:;
  }
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_cur_scope->__pyx_v_k = __pyx_t_3;
  __pyx_t_3 = 0;
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_cur_scope->__pyx_v_p = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "mathics/builtin/graphics.py":1677
 * 
 *     k, p = segments[0]
 *     yield "(%.5g,%.5g)" % p[0]             # <<<<<<<<<<<<<<
 * 
 *     connect = []
 */
  __pyx_t_4 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_p, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1677, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_5g_5g_3, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1677, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 0;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  /* return from generator, yielding value */
  __pyx_generator->resume_label = 1;
  return __pyx_r;
  __pyx_L11_resume_from_yield:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1677, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1679
 *     yield "(%.5g,%.5g)" % p[0]
 * 
 *     connect = []             # <<<<<<<<<<<<<<
 *     for k, p in segments:
 *         for s in path(k, list(chain(connect, p))):
 */
  __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1679, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_cur_scope->__pyx_v_connect = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "mathics/builtin/graphics.py":1680
 * 
 *     connect = []
 *     for k, p in segments:             # <<<<<<<<<<<<<<
 *         for s in path(k, list(chain(connect, p))):
 *             yield s
 */
  __pyx_t_6 = __pyx_cur_scope->__pyx_v_segments; __Pyx_INCREF(__pyx_t_6); __pyx_t_9 = 0;
  for (;;) {
    if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_9); __Pyx_INCREF(__pyx_t_4); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 1680, __pyx_L1_error)
    #else
    __pyx_t_4 = PySequence_ITEM(__pyx_t_6, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1680, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    #endif
    if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
      PyObject* sequence = __pyx_t_4;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 1680, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_7 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_7);
      #else
      __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1680, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1680, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      #endif
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_10 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1680, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_8 = Py_TYPE(__pyx_t_10)->tp_iternext;
      index = 0; __pyx_t_3 = __pyx_t_8(__pyx_t_10); if (unlikely(!__pyx_t_3)) goto __pyx_L14_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_3);
      index = 1; __pyx_t_7 = __pyx_t_8(__pyx_t_10); if (unlikely(!__pyx_t_7)) goto __pyx_L14_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_7);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_10), 2) < 0) __PYX_ERR(0, 1680, __pyx_L1_error)
      __pyx_t_8 = NULL;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L15_unpacking_done;
      __pyx_L14_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_8 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 1680, __pyx_L1_error)
      __pyx_L15_unpacking_done:;
    }
    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_k);
    __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_k, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_p);
    __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_p, __pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    __pyx_t_7 = 0;

    /* "mathics/builtin/graphics.py":1681
 *     connect = []
 *     for k, p in segments:
 *         for s in path(k, list(chain(connect, p))):             # <<<<<<<<<<<<<<
 *             yield s
 *         connect = p[-1:]
 */
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_chain); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1681, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_3 = NULL;
    __pyx_t_11 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
        __pyx_t_11 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_7)) {
      PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_cur_scope->__pyx_v_connect, __pyx_cur_scope->__pyx_v_p};
      __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1681, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_4);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
      PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_cur_scope->__pyx_v_connect, __pyx_cur_scope->__pyx_v_p};
      __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1681, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_4);
    } else
    #endif
    {
      __pyx_t_10 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1681, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      if (__pyx_t_3) {
        __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); __pyx_t_3 = NULL;
      }
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_connect);
      __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_connect);
      PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_11, __pyx_cur_scope->__pyx_v_connect);
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_p);
      __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_p);
      PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_11, __pyx_cur_scope->__pyx_v_p);
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1681, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = PySequence_List(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1681, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __pyx_pf_7mathics_7builtin_8graphics_11_asy_bezier_6path(__pyx_cur_scope->__pyx_v_path, __pyx_cur_scope->__pyx_v_k, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1681, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
      __pyx_t_7 = __pyx_t_4; __Pyx_INCREF(__pyx_t_7); __pyx_t_12 = 0;
      __pyx_t_13 = NULL;
    } else {
      __pyx_t_12 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1681, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_13 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1681, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    for (;;) {
      if (likely(!__pyx_t_13)) {
        if (likely(PyList_CheckExact(__pyx_t_7))) {
          if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_7)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_4 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_12); __Pyx_INCREF(__pyx_t_4); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 1681, __pyx_L1_error)
          #else
          __pyx_t_4 = PySequence_ITEM(__pyx_t_7, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1681, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          #endif
        } else {
          if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_12); __Pyx_INCREF(__pyx_t_4); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 1681, __pyx_L1_error)
          #else
          __pyx_t_4 = PySequence_ITEM(__pyx_t_7, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1681, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          #endif
        }
      } else {
        __pyx_t_4 = __pyx_t_13(__pyx_t_7);
        if (unlikely(!__pyx_t_4)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 1681, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_4);
      }
      __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_s);
      __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_s, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      __pyx_t_4 = 0;

      /* "mathics/builtin/graphics.py":1682
 *     for k, p in segments:
 *         for s in path(k, list(chain(connect, p))):
 *             yield s             # <<<<<<<<<<<<<<
 *         connect = p[-1:]
 * 
 */
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_s);
      __pyx_r = __pyx_cur_scope->__pyx_v_s;
      __Pyx_XGIVEREF(__pyx_t_6);
      __pyx_cur_scope->__pyx_t_0 = __pyx_t_6;
      __Pyx_XGIVEREF(__pyx_t_7);
      __pyx_cur_scope->__pyx_t_1 = __pyx_t_7;
      __pyx_cur_scope->__pyx_t_2 = __pyx_t_9;
      __pyx_cur_scope->__pyx_t_3 = __pyx_t_12;
      __pyx_cur_scope->__pyx_t_4 = __pyx_t_13;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
      /* return from generator, yielding value */
      __pyx_generator->resume_label = 2;
      return __pyx_r;
      __pyx_L18_resume_from_yield:;
      __pyx_t_6 = __pyx_cur_scope->__pyx_t_0;
      __pyx_cur_scope->__pyx_t_0 = 0;
      __Pyx_XGOTREF(__pyx_t_6);
      __pyx_t_7 = __pyx_cur_scope->__pyx_t_1;
      __pyx_cur_scope->__pyx_t_1 = 0;
      __Pyx_XGOTREF(__pyx_t_7);
      __pyx_t_9 = __pyx_cur_scope->__pyx_t_2;
      __pyx_t_12 = __pyx_cur_scope->__pyx_t_3;
      __pyx_t_13 = __pyx_cur_scope->__pyx_t_4;
      if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1682, __pyx_L1_error)

      /* "mathics/builtin/graphics.py":1681
 *     connect = []
 *     for k, p in segments:
 *         for s in path(k, list(chain(connect, p))):             # <<<<<<<<<<<<<<
 *             yield s
 *         connect = p[-1:]
 */
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "mathics/builtin/graphics.py":1683
 *         for s in path(k, list(chain(connect, p))):
 *             yield s
 *         connect = p[-1:]             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_7 = __Pyx_PyObject_GetSlice(__pyx_cur_scope->__pyx_v_p, -1L, 0, NULL, NULL, &__pyx_slice__56, 1, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1683, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_connect);
    __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_connect, __pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    __pyx_t_7 = 0;

    /* "mathics/builtin/graphics.py":1680
 * 
 *     connect = []
 *     for k, p in segments:             # <<<<<<<<<<<<<<
 *         for s in path(k, list(chain(connect, p))):
 *             yield s
 */
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "mathics/builtin/graphics.py":1627
 * 
 * 
 * def _asy_bezier(*segments):             # <<<<<<<<<<<<<<
 *     # see http://asymptote.sourceforge.net/doc/Bezier-curves.html#Bezier-curves
 * 
 */

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

/* "mathics/builtin/graphics.py":1718
 * 
 * class BezierCurveBox(_Polyline):
 *     def init(self, graphics, style, item, options):             # <<<<<<<<<<<<<<
 *         super(BezierCurveBox, self).init(graphics, item, style)
 *         if len(item.leaves) != 1 or item.leaves[0].get_head_name() != "System`List":
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_14BezierCurveBox_1init(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_14BezierCurveBox_1init = {"init", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_14BezierCurveBox_1init, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_14BezierCurveBox_1init(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_graphics = 0;
  PyObject *__pyx_v_style = 0;
  PyObject *__pyx_v_item = 0;
  PyObject *__pyx_v_options = 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);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_graphics,&__pyx_n_s_style,&__pyx_n_s_item,&__pyx_n_s_options,0};
    PyObject* values[5] = {0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_graphics)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("init", 1, 5, 5, 1); __PYX_ERR(0, 1718, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_style)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("init", 1, 5, 5, 2); __PYX_ERR(0, 1718, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_item)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("init", 1, 5, 5, 3); __PYX_ERR(0, 1718, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_options)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("init", 1, 5, 5, 4); __PYX_ERR(0, 1718, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "init") < 0)) __PYX_ERR(0, 1718, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
    }
    __pyx_v_self = values[0];
    __pyx_v_graphics = values[1];
    __pyx_v_style = values[2];
    __pyx_v_item = values[3];
    __pyx_v_options = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("init", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1718, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.BezierCurveBox.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_14BezierCurveBox_init(__pyx_self, __pyx_v_self, __pyx_v_graphics, __pyx_v_style, __pyx_v_item, __pyx_v_options);

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_14BezierCurveBox_init(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_graphics, PyObject *__pyx_v_style, PyObject *__pyx_v_item, PyObject *__pyx_v_options) {
  CYTHON_UNUSED PyObject *__pyx_v__ = NULL;
  PyObject *__pyx_v_points = NULL;
  PyObject *__pyx_v_spline_degree = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  int __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("init", 0);

  /* "mathics/builtin/graphics.py":1719
 * class BezierCurveBox(_Polyline):
 *     def init(self, graphics, style, item, options):
 *         super(BezierCurveBox, self).init(graphics, item, style)             # <<<<<<<<<<<<<<
 *         if len(item.leaves) != 1 or item.leaves[0].get_head_name() != "System`List":
 *             raise BoxConstructError
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_BezierCurveBox); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1719, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1719, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_INCREF(__pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1719, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1719, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_v_graphics, __pyx_v_item, __pyx_v_style};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1719, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_v_graphics, __pyx_v_item, __pyx_v_style};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1719, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1719, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_2) {
      __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
    }
    __Pyx_INCREF(__pyx_v_graphics);
    __Pyx_GIVEREF(__pyx_v_graphics);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_graphics);
    __Pyx_INCREF(__pyx_v_item);
    __Pyx_GIVEREF(__pyx_v_item);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_item);
    __Pyx_INCREF(__pyx_v_style);
    __Pyx_GIVEREF(__pyx_v_style);
    PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_style);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1719, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1720
 *     def init(self, graphics, style, item, options):
 *         super(BezierCurveBox, self).init(graphics, item, style)
 *         if len(item.leaves) != 1 or item.leaves[0].get_head_name() != "System`List":             # <<<<<<<<<<<<<<
 *             raise BoxConstructError
 *         self.edge_color, _ = style.get_style(_Color, face_element=False)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_item, __pyx_n_s_leaves); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1720, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1720, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_8 = ((__pyx_t_7 != 1) != 0);
  if (!__pyx_t_8) {
  } else {
    __pyx_t_6 = __pyx_t_8;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_item, __pyx_n_s_leaves); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1720, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1720, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_get_head_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1720, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1720, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_System_List, Py_NE)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 1720, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = __pyx_t_8;
  __pyx_L4_bool_binop_done:;
  if (unlikely(__pyx_t_6)) {

    /* "mathics/builtin/graphics.py":1721
 *         super(BezierCurveBox, self).init(graphics, item, style)
 *         if len(item.leaves) != 1 or item.leaves[0].get_head_name() != "System`List":
 *             raise BoxConstructError             # <<<<<<<<<<<<<<
 *         self.edge_color, _ = style.get_style(_Color, face_element=False)
 *         points = item.leaves[0]
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_BoxConstructError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1721, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 1721, __pyx_L1_error)

    /* "mathics/builtin/graphics.py":1720
 *     def init(self, graphics, style, item, options):
 *         super(BezierCurveBox, self).init(graphics, item, style)
 *         if len(item.leaves) != 1 or item.leaves[0].get_head_name() != "System`List":             # <<<<<<<<<<<<<<
 *             raise BoxConstructError
 *         self.edge_color, _ = style.get_style(_Color, face_element=False)
 */
  }

  /* "mathics/builtin/graphics.py":1722
 *         if len(item.leaves) != 1 or item.leaves[0].get_head_name() != "System`List":
 *             raise BoxConstructError
 *         self.edge_color, _ = style.get_style(_Color, face_element=False)             # <<<<<<<<<<<<<<
 *         points = item.leaves[0]
 *         self.do_init(graphics, points)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_style, __pyx_n_s_get_style); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1722, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Color); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1722, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1722, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1722, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_face_element, Py_False) < 0) __PYX_ERR(0, 1722, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1722, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
    PyObject* sequence = __pyx_t_2;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 1722, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_5);
    #else
    __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1722, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1722, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    #endif
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1722, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_9 = Py_TYPE(__pyx_t_1)->tp_iternext;
    index = 0; __pyx_t_3 = __pyx_t_9(__pyx_t_1); if (unlikely(!__pyx_t_3)) goto __pyx_L6_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 1; __pyx_t_5 = __pyx_t_9(__pyx_t_1); if (unlikely(!__pyx_t_5)) goto __pyx_L6_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_1), 2) < 0) __PYX_ERR(0, 1722, __pyx_L1_error)
    __pyx_t_9 = NULL;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L7_unpacking_done;
    __pyx_L6_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_9 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 1722, __pyx_L1_error)
    __pyx_L7_unpacking_done:;
  }
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_edge_color, __pyx_t_3) < 0) __PYX_ERR(0, 1722, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v__ = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":1723
 *             raise BoxConstructError
 *         self.edge_color, _ = style.get_style(_Color, face_element=False)
 *         points = item.leaves[0]             # <<<<<<<<<<<<<<
 *         self.do_init(graphics, points)
 *         spline_degree = options.get("System`SplineDegree")
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_item, __pyx_n_s_leaves); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1723, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1723, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_points = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":1724
 *         self.edge_color, _ = style.get_style(_Color, face_element=False)
 *         points = item.leaves[0]
 *         self.do_init(graphics, points)             # <<<<<<<<<<<<<<
 *         spline_degree = options.get("System`SplineDegree")
 *         if not isinstance(spline_degree, Integer):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_do_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1724, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_graphics, __pyx_v_points};
    __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1724, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_5);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_graphics, __pyx_v_points};
    __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1724, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_5);
  } else
  #endif
  {
    __pyx_t_1 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1724, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(__pyx_v_graphics);
    __Pyx_GIVEREF(__pyx_v_graphics);
    PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_4, __pyx_v_graphics);
    __Pyx_INCREF(__pyx_v_points);
    __Pyx_GIVEREF(__pyx_v_points);
    PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_4, __pyx_v_points);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1724, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":1725
 *         points = item.leaves[0]
 *         self.do_init(graphics, points)
 *         spline_degree = options.get("System`SplineDegree")             # <<<<<<<<<<<<<<
 *         if not isinstance(spline_degree, Integer):
 *             raise BoxConstructError
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_options, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1725, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_5 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_1, __pyx_kp_u_System_SplineDegree) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_u_System_SplineDegree);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1725, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_spline_degree = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":1726
 *         self.do_init(graphics, points)
 *         spline_degree = options.get("System`SplineDegree")
 *         if not isinstance(spline_degree, Integer):             # <<<<<<<<<<<<<<
 *             raise BoxConstructError
 *         self.spline_degree = spline_degree.get_int_value()
 */
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Integer); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1726, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyObject_IsInstance(__pyx_v_spline_degree, __pyx_t_5); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 1726, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_8 = ((!(__pyx_t_6 != 0)) != 0);
  if (unlikely(__pyx_t_8)) {

    /* "mathics/builtin/graphics.py":1727
 *         spline_degree = options.get("System`SplineDegree")
 *         if not isinstance(spline_degree, Integer):
 *             raise BoxConstructError             # <<<<<<<<<<<<<<
 *         self.spline_degree = spline_degree.get_int_value()
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_BoxConstructError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1727, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __PYX_ERR(0, 1727, __pyx_L1_error)

    /* "mathics/builtin/graphics.py":1726
 *         self.do_init(graphics, points)
 *         spline_degree = options.get("System`SplineDegree")
 *         if not isinstance(spline_degree, Integer):             # <<<<<<<<<<<<<<
 *             raise BoxConstructError
 *         self.spline_degree = spline_degree.get_int_value()
 */
  }

  /* "mathics/builtin/graphics.py":1728
 *         if not isinstance(spline_degree, Integer):
 *             raise BoxConstructError
 *         self.spline_degree = spline_degree.get_int_value()             # <<<<<<<<<<<<<<
 * 
 *     def to_svg(self):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_spline_degree, __pyx_n_s_get_int_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1728, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_5 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1728, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_spline_degree, __pyx_t_5) < 0) __PYX_ERR(0, 1728, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":1718
 * 
 * class BezierCurveBox(_Polyline):
 *     def init(self, graphics, style, item, options):             # <<<<<<<<<<<<<<
 *         super(BezierCurveBox, self).init(graphics, item, style)
 *         if len(item.leaves) != 1 or item.leaves[0].get_head_name() != "System`List":
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("mathics.builtin.graphics.BezierCurveBox.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v__);
  __Pyx_XDECREF(__pyx_v_points);
  __Pyx_XDECREF(__pyx_v_spline_degree);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":1730
 *         self.spline_degree = spline_degree.get_int_value()
 * 
 *     def to_svg(self):             # <<<<<<<<<<<<<<
 *         l = self.style.get_line_width(face_element=False)
 *         style = create_css(edge_color=self.edge_color, stroke_width=l)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_14BezierCurveBox_3to_svg(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_14BezierCurveBox_3to_svg = {"to_svg", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_14BezierCurveBox_3to_svg, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_14BezierCurveBox_3to_svg(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_svg (wrapper)", 0);
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_14BezierCurveBox_2to_svg(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_14BezierCurveBox_2to_svg(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_l = NULL;
  PyObject *__pyx_v_style = NULL;
  PyObject *__pyx_v_svg = NULL;
  PyObject *__pyx_v_line = NULL;
  PyObject *__pyx_v_s = NULL;
  PyObject *__pyx_9genexpr23__pyx_v_xy = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  PyObject *(*__pyx_t_10)(PyObject *);
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  Py_UCS4 __pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_svg", 0);

  /* "mathics/builtin/graphics.py":1731
 * 
 *     def to_svg(self):
 *         l = self.style.get_line_width(face_element=False)             # <<<<<<<<<<<<<<
 *         style = create_css(edge_color=self.edge_color, stroke_width=l)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_style); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1731, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_get_line_width); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1731, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1731, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_face_element, Py_False) < 0) __PYX_ERR(0, 1731, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1731, __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_v_l = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":1732
 *     def to_svg(self):
 *         l = self.style.get_line_width(face_element=False)
 *         style = create_css(edge_color=self.edge_color, stroke_width=l)             # <<<<<<<<<<<<<<
 * 
 *         svg = ""
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_create_css); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1732, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1732, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_edge_color); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1732, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_edge_color, __pyx_t_2) < 0) __PYX_ERR(0, 1732, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_stroke_width, __pyx_v_l) < 0) __PYX_ERR(0, 1732, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1732, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_style = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":1734
 *         style = create_css(edge_color=self.edge_color, stroke_width=l)
 * 
 *         svg = ""             # <<<<<<<<<<<<<<
 *         for line in self.lines:
 *             s = " ".join(_svg_bezier((self.spline_degree, [xy.pos() for xy in line])))
 */
  __Pyx_INCREF(__pyx_kp_u__41);
  __pyx_v_svg = __pyx_kp_u__41;

  /* "mathics/builtin/graphics.py":1735
 * 
 *         svg = ""
 *         for line in self.lines:             # <<<<<<<<<<<<<<
 *             s = " ".join(_svg_bezier((self.spline_degree, [xy.pos() for xy in line])))
 *             svg += '<path d="%s" style="%s"/>' % (s, style)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lines); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1735, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1735, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1735, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 1735, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1735, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 1735, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1735, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_5(__pyx_t_1);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1735, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF_SET(__pyx_v_line, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "mathics/builtin/graphics.py":1736
 *         svg = ""
 *         for line in self.lines:
 *             s = " ".join(_svg_bezier((self.spline_degree, [xy.pos() for xy in line])))             # <<<<<<<<<<<<<<
 *             svg += '<path d="%s" style="%s"/>' % (s, style)
 *         return svg
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_svg_bezier); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1736, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_spline_degree); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1736, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    { /* enter inner scope */
      __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1736, __pyx_L7_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (likely(PyList_CheckExact(__pyx_v_line)) || PyTuple_CheckExact(__pyx_v_line)) {
        __pyx_t_8 = __pyx_v_line; __Pyx_INCREF(__pyx_t_8); __pyx_t_9 = 0;
        __pyx_t_10 = NULL;
      } else {
        __pyx_t_9 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_v_line); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1736, __pyx_L7_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_10 = Py_TYPE(__pyx_t_8)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1736, __pyx_L7_error)
      }
      for (;;) {
        if (likely(!__pyx_t_10)) {
          if (likely(PyList_CheckExact(__pyx_t_8))) {
            if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_8)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_11 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_9); __Pyx_INCREF(__pyx_t_11); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 1736, __pyx_L7_error)
            #else
            __pyx_t_11 = PySequence_ITEM(__pyx_t_8, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1736, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_11);
            #endif
          } else {
            if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_8)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_11 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_9); __Pyx_INCREF(__pyx_t_11); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 1736, __pyx_L7_error)
            #else
            __pyx_t_11 = PySequence_ITEM(__pyx_t_8, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1736, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_11);
            #endif
          }
        } else {
          __pyx_t_11 = __pyx_t_10(__pyx_t_8);
          if (unlikely(!__pyx_t_11)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 1736, __pyx_L7_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_11);
        }
        __Pyx_XDECREF_SET(__pyx_9genexpr23__pyx_v_xy, __pyx_t_11);
        __pyx_t_11 = 0;
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr23__pyx_v_xy, __pyx_n_s_pos); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1736, __pyx_L7_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_12, function);
          }
        }
        __pyx_t_11 = (__pyx_t_13) ? __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_13) : __Pyx_PyObject_CallNoArg(__pyx_t_12);
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1736, __pyx_L7_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)__pyx_t_11))) __PYX_ERR(0, 1736, __pyx_L7_error)
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      }
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_9genexpr23__pyx_v_xy); __pyx_9genexpr23__pyx_v_xy = 0;
      goto __pyx_L10_exit_scope;
      __pyx_L7_error:;
      __Pyx_XDECREF(__pyx_9genexpr23__pyx_v_xy); __pyx_9genexpr23__pyx_v_xy = 0;
      goto __pyx_L1_error;
      __pyx_L10_exit_scope:;
    } /* exit inner scope */
    __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1736, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7);
    __pyx_t_6 = 0;
    __pyx_t_7 = 0;
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_7, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_8);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1736, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyUnicode_Join(__pyx_kp_u__7, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1736, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF_SET(__pyx_v_s, ((PyObject*)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "mathics/builtin/graphics.py":1737
 *         for line in self.lines:
 *             s = " ".join(_svg_bezier((self.spline_degree, [xy.pos() for xy in line])))
 *             svg += '<path d="%s" style="%s"/>' % (s, style)             # <<<<<<<<<<<<<<
 *         return svg
 * 
 */
    __pyx_t_3 = PyTuple_New(5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1737, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_9 = 0;
    __pyx_t_14 = 127;
    __Pyx_INCREF(__pyx_kp_u_path_d);
    __pyx_t_9 += 9;
    __Pyx_GIVEREF(__pyx_kp_u_path_d);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_path_d);
    __pyx_t_2 = __Pyx_PyUnicode_Unicode(__pyx_v_s); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1737, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_14 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_14) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_14;
    __pyx_t_9 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
    __pyx_t_2 = 0;
    __Pyx_INCREF(__pyx_kp_u_style_2);
    __pyx_t_9 += 9;
    __Pyx_GIVEREF(__pyx_kp_u_style_2);
    PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u_style_2);
    __pyx_t_2 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_style), __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1737, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_14 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_14) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_14;
    __pyx_t_9 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_2);
    __pyx_t_2 = 0;
    __Pyx_INCREF(__pyx_kp_u__57);
    __pyx_t_9 += 3;
    __Pyx_GIVEREF(__pyx_kp_u__57);
    PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_kp_u__57);
    __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_3, 5, __pyx_t_9, __pyx_t_14); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1737, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_v_svg, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1737, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF_SET(__pyx_v_svg, ((PyObject*)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "mathics/builtin/graphics.py":1735
 * 
 *         svg = ""
 *         for line in self.lines:             # <<<<<<<<<<<<<<
 *             s = " ".join(_svg_bezier((self.spline_degree, [xy.pos() for xy in line])))
 *             svg += '<path d="%s" style="%s"/>' % (s, style)
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1738
 *             s = " ".join(_svg_bezier((self.spline_degree, [xy.pos() for xy in line])))
 *             svg += '<path d="%s" style="%s"/>' % (s, style)
 *         return svg             # <<<<<<<<<<<<<<
 * 
 *     def to_asy(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_svg);
  __pyx_r = __pyx_v_svg;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":1730
 *         self.spline_degree = spline_degree.get_int_value()
 * 
 *     def to_svg(self):             # <<<<<<<<<<<<<<
 *         l = self.style.get_line_width(face_element=False)
 *         style = create_css(edge_color=self.edge_color, stroke_width=l)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("mathics.builtin.graphics.BezierCurveBox.to_svg", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_l);
  __Pyx_XDECREF(__pyx_v_style);
  __Pyx_XDECREF(__pyx_v_svg);
  __Pyx_XDECREF(__pyx_v_line);
  __Pyx_XDECREF(__pyx_v_s);
  __Pyx_XDECREF(__pyx_9genexpr23__pyx_v_xy);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":1740
 *         return svg
 * 
 *     def to_asy(self):             # <<<<<<<<<<<<<<
 *         l = self.style.get_line_width(face_element=False)
 *         pen = create_pens(edge_color=self.edge_color, stroke_width=l)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_14BezierCurveBox_5to_asy(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_14BezierCurveBox_5to_asy = {"to_asy", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_14BezierCurveBox_5to_asy, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_14BezierCurveBox_5to_asy(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_asy (wrapper)", 0);
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_14BezierCurveBox_4to_asy(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_14BezierCurveBox_4to_asy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_l = NULL;
  PyObject *__pyx_v_pen = NULL;
  PyObject *__pyx_v_asy = NULL;
  PyObject *__pyx_v_line = NULL;
  PyObject *__pyx_v_path = NULL;
  PyObject *__pyx_9genexpr24__pyx_v_xy = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  PyObject *(*__pyx_t_10)(PyObject *);
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  Py_UCS4 __pyx_t_16;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_asy", 0);

  /* "mathics/builtin/graphics.py":1741
 * 
 *     def to_asy(self):
 *         l = self.style.get_line_width(face_element=False)             # <<<<<<<<<<<<<<
 *         pen = create_pens(edge_color=self.edge_color, stroke_width=l)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_style); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1741, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_get_line_width); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1741, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1741, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_face_element, Py_False) < 0) __PYX_ERR(0, 1741, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1741, __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_v_l = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":1742
 *     def to_asy(self):
 *         l = self.style.get_line_width(face_element=False)
 *         pen = create_pens(edge_color=self.edge_color, stroke_width=l)             # <<<<<<<<<<<<<<
 * 
 *         asy = ""
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_create_pens); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1742, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1742, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_edge_color); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1742, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_edge_color, __pyx_t_2) < 0) __PYX_ERR(0, 1742, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_stroke_width, __pyx_v_l) < 0) __PYX_ERR(0, 1742, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1742, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_pen = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":1744
 *         pen = create_pens(edge_color=self.edge_color, stroke_width=l)
 * 
 *         asy = ""             # <<<<<<<<<<<<<<
 *         for line in self.lines:
 *             for path in _asy_bezier((self.spline_degree, [xy.pos() for xy in line])):
 */
  __Pyx_INCREF(__pyx_kp_u__41);
  __pyx_v_asy = __pyx_kp_u__41;

  /* "mathics/builtin/graphics.py":1745
 * 
 *         asy = ""
 *         for line in self.lines:             # <<<<<<<<<<<<<<
 *             for path in _asy_bezier((self.spline_degree, [xy.pos() for xy in line])):
 *                 if path[:2] == "..":
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lines); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1745, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1745, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1745, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 1745, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1745, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 1745, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1745, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_5(__pyx_t_1);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1745, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF_SET(__pyx_v_line, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "mathics/builtin/graphics.py":1746
 *         asy = ""
 *         for line in self.lines:
 *             for path in _asy_bezier((self.spline_degree, [xy.pos() for xy in line])):             # <<<<<<<<<<<<<<
 *                 if path[:2] == "..":
 *                     path = "(0.,0.)" + path
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_asy_bezier); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1746, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_spline_degree); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1746, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    { /* enter inner scope */
      __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1746, __pyx_L9_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (likely(PyList_CheckExact(__pyx_v_line)) || PyTuple_CheckExact(__pyx_v_line)) {
        __pyx_t_8 = __pyx_v_line; __Pyx_INCREF(__pyx_t_8); __pyx_t_9 = 0;
        __pyx_t_10 = NULL;
      } else {
        __pyx_t_9 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_v_line); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1746, __pyx_L9_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_10 = Py_TYPE(__pyx_t_8)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1746, __pyx_L9_error)
      }
      for (;;) {
        if (likely(!__pyx_t_10)) {
          if (likely(PyList_CheckExact(__pyx_t_8))) {
            if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_8)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_11 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_9); __Pyx_INCREF(__pyx_t_11); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 1746, __pyx_L9_error)
            #else
            __pyx_t_11 = PySequence_ITEM(__pyx_t_8, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1746, __pyx_L9_error)
            __Pyx_GOTREF(__pyx_t_11);
            #endif
          } else {
            if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_8)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_11 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_9); __Pyx_INCREF(__pyx_t_11); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 1746, __pyx_L9_error)
            #else
            __pyx_t_11 = PySequence_ITEM(__pyx_t_8, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1746, __pyx_L9_error)
            __Pyx_GOTREF(__pyx_t_11);
            #endif
          }
        } else {
          __pyx_t_11 = __pyx_t_10(__pyx_t_8);
          if (unlikely(!__pyx_t_11)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 1746, __pyx_L9_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_11);
        }
        __Pyx_XDECREF_SET(__pyx_9genexpr24__pyx_v_xy, __pyx_t_11);
        __pyx_t_11 = 0;
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr24__pyx_v_xy, __pyx_n_s_pos); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1746, __pyx_L9_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_12, function);
          }
        }
        __pyx_t_11 = (__pyx_t_13) ? __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_13) : __Pyx_PyObject_CallNoArg(__pyx_t_12);
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1746, __pyx_L9_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)__pyx_t_11))) __PYX_ERR(0, 1746, __pyx_L9_error)
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      }
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_9genexpr24__pyx_v_xy); __pyx_9genexpr24__pyx_v_xy = 0;
      goto __pyx_L12_exit_scope;
      __pyx_L9_error:;
      __Pyx_XDECREF(__pyx_9genexpr24__pyx_v_xy); __pyx_9genexpr24__pyx_v_xy = 0;
      goto __pyx_L1_error;
      __pyx_L12_exit_scope:;
    } /* exit inner scope */
    __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1746, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7);
    __pyx_t_6 = 0;
    __pyx_t_7 = 0;
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_7, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_8);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1746, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
      __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_9 = 0;
      __pyx_t_10 = NULL;
    } else {
      __pyx_t_9 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1746, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_10 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1746, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    for (;;) {
      if (likely(!__pyx_t_10)) {
        if (likely(PyList_CheckExact(__pyx_t_3))) {
          if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_9); __Pyx_INCREF(__pyx_t_2); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 1746, __pyx_L1_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1746, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        } else {
          if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_9); __Pyx_INCREF(__pyx_t_2); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 1746, __pyx_L1_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1746, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        }
      } else {
        __pyx_t_2 = __pyx_t_10(__pyx_t_3);
        if (unlikely(!__pyx_t_2)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 1746, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_XDECREF_SET(__pyx_v_path, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "mathics/builtin/graphics.py":1747
 *         for line in self.lines:
 *             for path in _asy_bezier((self.spline_degree, [xy.pos() for xy in line])):
 *                 if path[:2] == "..":             # <<<<<<<<<<<<<<
 *                     path = "(0.,0.)" + path
 *                 asy += "draw(%s, %s);" % (path, pen)
 */
      __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_path, 0, 2, NULL, NULL, &__pyx_slice__36, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1747, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_14 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_kp_u__58, Py_EQ)); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 1747, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (__pyx_t_14) {

        /* "mathics/builtin/graphics.py":1748
 *             for path in _asy_bezier((self.spline_degree, [xy.pos() for xy in line])):
 *                 if path[:2] == "..":
 *                     path = "(0.,0.)" + path             # <<<<<<<<<<<<<<
 *                 asy += "draw(%s, %s);" % (path, pen)
 *         return asy
 */
        __pyx_t_2 = PyNumber_Add(__pyx_kp_u_0_0, __pyx_v_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1748, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF_SET(__pyx_v_path, __pyx_t_2);
        __pyx_t_2 = 0;

        /* "mathics/builtin/graphics.py":1747
 *         for line in self.lines:
 *             for path in _asy_bezier((self.spline_degree, [xy.pos() for xy in line])):
 *                 if path[:2] == "..":             # <<<<<<<<<<<<<<
 *                     path = "(0.,0.)" + path
 *                 asy += "draw(%s, %s);" % (path, pen)
 */
      }

      /* "mathics/builtin/graphics.py":1749
 *                 if path[:2] == "..":
 *                     path = "(0.,0.)" + path
 *                 asy += "draw(%s, %s);" % (path, pen)             # <<<<<<<<<<<<<<
 *         return asy
 * 
 */
      __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1749, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_15 = 0;
      __pyx_t_16 = 127;
      __Pyx_INCREF(__pyx_kp_u_draw_2);
      __pyx_t_15 += 5;
      __Pyx_GIVEREF(__pyx_kp_u_draw_2);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u_draw_2);
      __pyx_t_8 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_path), __pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1749, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_16 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) > __pyx_t_16) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) : __pyx_t_16;
      __pyx_t_15 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_8);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_8);
      __pyx_t_8 = 0;
      __Pyx_INCREF(__pyx_kp_u__4);
      __pyx_t_15 += 2;
      __Pyx_GIVEREF(__pyx_kp_u__4);
      PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u__4);
      __pyx_t_8 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_pen), __pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1749, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_16 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) > __pyx_t_16) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) : __pyx_t_16;
      __pyx_t_15 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_8);
      PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_8);
      __pyx_t_8 = 0;
      __Pyx_INCREF(__pyx_kp_u__33);
      __pyx_t_15 += 2;
      __Pyx_GIVEREF(__pyx_kp_u__33);
      PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_kp_u__33);
      __pyx_t_8 = __Pyx_PyUnicode_Join(__pyx_t_2, 5, __pyx_t_15, __pyx_t_16); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1749, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_v_asy, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1749, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF_SET(__pyx_v_asy, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "mathics/builtin/graphics.py":1746
 *         asy = ""
 *         for line in self.lines:
 *             for path in _asy_bezier((self.spline_degree, [xy.pos() for xy in line])):             # <<<<<<<<<<<<<<
 *                 if path[:2] == "..":
 *                     path = "(0.,0.)" + path
 */
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "mathics/builtin/graphics.py":1745
 * 
 *         asy = ""
 *         for line in self.lines:             # <<<<<<<<<<<<<<
 *             for path in _asy_bezier((self.spline_degree, [xy.pos() for xy in line])):
 *                 if path[:2] == "..":
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1750
 *                     path = "(0.,0.)" + path
 *                 asy += "draw(%s, %s);" % (path, pen)
 *         return asy             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_asy);
  __pyx_r = __pyx_v_asy;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":1740
 *         return svg
 * 
 *     def to_asy(self):             # <<<<<<<<<<<<<<
 *         l = self.style.get_line_width(face_element=False)
 *         pen = create_pens(edge_color=self.edge_color, stroke_width=l)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("mathics.builtin.graphics.BezierCurveBox.to_asy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_l);
  __Pyx_XDECREF(__pyx_v_pen);
  __Pyx_XDECREF(__pyx_v_asy);
  __Pyx_XDECREF(__pyx_v_line);
  __Pyx_XDECREF(__pyx_v_path);
  __Pyx_XDECREF(__pyx_9genexpr24__pyx_v_xy);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":1771
 * 
 * class FilledCurveBox(_GraphicsElement):
 *     def init(self, graphics, style, item=None):             # <<<<<<<<<<<<<<
 *         super(FilledCurveBox, self).init(graphics, item, style)
 *         self.edge_color, self.face_color = style.get_style(_Color, face_element=True)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_14FilledCurveBox_1init(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_14FilledCurveBox_1init = {"init", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_14FilledCurveBox_1init, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_14FilledCurveBox_1init(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_graphics = 0;
  PyObject *__pyx_v_style = 0;
  PyObject *__pyx_v_item = 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);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_graphics,&__pyx_n_s_style,&__pyx_n_s_item,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = ((PyObject *)((PyObject *)Py_None));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_graphics)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("init", 0, 3, 4, 1); __PYX_ERR(0, 1771, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_style)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("init", 0, 3, 4, 2); __PYX_ERR(0, 1771, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_item);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "init") < 0)) __PYX_ERR(0, 1771, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_graphics = values[1];
    __pyx_v_style = values[2];
    __pyx_v_item = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("init", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1771, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.FilledCurveBox.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_14FilledCurveBox_init(__pyx_self, __pyx_v_self, __pyx_v_graphics, __pyx_v_style, __pyx_v_item);

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

/* "mathics/builtin/graphics.py":1780
 *             leaves = item.leaves[0].leaves
 * 
 *             def parse_component(segments):             # <<<<<<<<<<<<<<
 *                 for segment in segments:
 *                     head = segment.get_head_name()
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_14FilledCurveBox_4init_1parse_component(PyObject *__pyx_self, PyObject *__pyx_v_segments); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_14FilledCurveBox_4init_1parse_component = {"parse_component", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_14FilledCurveBox_4init_1parse_component, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_14FilledCurveBox_4init_1parse_component(PyObject *__pyx_self, PyObject *__pyx_v_segments) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("parse_component (wrapper)", 0);
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_14FilledCurveBox_4init_parse_component(__pyx_self, ((PyObject *)__pyx_v_segments));

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_14FilledCurveBox_4init_parse_component(PyObject *__pyx_self, PyObject *__pyx_v_segments) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_26_parse_component *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("parse_component", 0);
  __pyx_cur_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_26_parse_component *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_26_parse_component(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_26_parse_component, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_26_parse_component *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1780, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_25_init *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  __pyx_cur_scope->__pyx_v_segments = __pyx_v_segments;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_segments);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_segments);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7mathics_7builtin_8graphics_14FilledCurveBox_4init_2generator20, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_parse_component, __pyx_n_s_FilledCurveBox_init_locals_parse, __pyx_n_s_mathics_builtin_graphics); if (unlikely(!gen)) __PYX_ERR(0, 1780, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.FilledCurveBox.init.parse_component", __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_7mathics_7builtin_8graphics_14FilledCurveBox_4init_2generator20(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_26_parse_component *__pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_26_parse_component *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *(*__pyx_t_12)(PyObject *);
  int __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  PyObject *(*__pyx_t_15)(PyObject *);
  Py_ssize_t __pyx_t_16;
  PyObject *(*__pyx_t_17)(PyObject *);
  PyObject *__pyx_t_18 = NULL;
  int __pyx_t_19;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("parse_component", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L15_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1780, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1781
 * 
 *             def parse_component(segments):
 *                 for segment in segments:             # <<<<<<<<<<<<<<
 *                     head = segment.get_head_name()
 * 
 */
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_segments)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_segments)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_v_segments; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_segments); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1781, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1781, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 1781, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1781, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 1781, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1781, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1781, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_segment);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_segment, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;

    /* "mathics/builtin/graphics.py":1782
 *             def parse_component(segments):
 *                 for segment in segments:
 *                     head = segment.get_head_name()             # <<<<<<<<<<<<<<
 * 
 *                     if head == "System`Line":
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_segment, __pyx_n_s_get_head_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1782, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1782, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_head);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_head, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;

    /* "mathics/builtin/graphics.py":1784
 *                     head = segment.get_head_name()
 * 
 *                     if head == "System`Line":             # <<<<<<<<<<<<<<
 *                         k = 1
 *                         parts = segment.leaves
 */
    __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_cur_scope->__pyx_v_head, __pyx_kp_u_System_Line, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 1784, __pyx_L1_error)
    if (__pyx_t_7) {

      /* "mathics/builtin/graphics.py":1785
 * 
 *                     if head == "System`Line":
 *                         k = 1             # <<<<<<<<<<<<<<
 *                         parts = segment.leaves
 *                     elif head == "System`BezierCurve":
 */
      __Pyx_INCREF(__pyx_int_1);
      __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_k);
      __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_k, __pyx_int_1);
      __Pyx_GIVEREF(__pyx_int_1);

      /* "mathics/builtin/graphics.py":1786
 *                     if head == "System`Line":
 *                         k = 1
 *                         parts = segment.leaves             # <<<<<<<<<<<<<<
 *                     elif head == "System`BezierCurve":
 *                         parts, options = _data_and_options(segment.leaves, {})
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_segment, __pyx_n_s_leaves); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1786, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_parts);
      __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_parts, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      __pyx_t_4 = 0;

      /* "mathics/builtin/graphics.py":1784
 *                     head = segment.get_head_name()
 * 
 *                     if head == "System`Line":             # <<<<<<<<<<<<<<
 *                         k = 1
 *                         parts = segment.leaves
 */
      goto __pyx_L6;
    }

    /* "mathics/builtin/graphics.py":1787
 *                         k = 1
 *                         parts = segment.leaves
 *                     elif head == "System`BezierCurve":             # <<<<<<<<<<<<<<
 *                         parts, options = _data_and_options(segment.leaves, {})
 *                         spline_degree = options.get("SplineDegree", Integer(3))
 */
    __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_cur_scope->__pyx_v_head, __pyx_kp_u_System_BezierCurve, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 1787, __pyx_L1_error)
    if (__pyx_t_7) {

      /* "mathics/builtin/graphics.py":1788
 *                         parts = segment.leaves
 *                     elif head == "System`BezierCurve":
 *                         parts, options = _data_and_options(segment.leaves, {})             # <<<<<<<<<<<<<<
 *                         spline_degree = options.get("SplineDegree", Integer(3))
 *                         if not isinstance(spline_degree, Integer):
 */
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_data_and_options); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1788, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_segment, __pyx_n_s_leaves); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1788, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_8 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1788, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = NULL;
      __pyx_t_10 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_9)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
          __pyx_t_10 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_5)) {
        PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_6, __pyx_t_8};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1788, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
        PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_6, __pyx_t_8};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1788, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      } else
      #endif
      {
        __pyx_t_11 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1788, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (__pyx_t_9) {
          __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); __pyx_t_9 = NULL;
        }
        __Pyx_GIVEREF(__pyx_t_6);
        PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_10, __pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_8);
        PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_10, __pyx_t_8);
        __pyx_t_6 = 0;
        __pyx_t_8 = 0;
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_11, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1788, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
        PyObject* sequence = __pyx_t_4;
        Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          __PYX_ERR(0, 1788, __pyx_L1_error)
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_11 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_11 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_11);
        #else
        __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1788, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_11 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1788, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        #endif
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_8 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1788, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_12 = Py_TYPE(__pyx_t_8)->tp_iternext;
        index = 0; __pyx_t_5 = __pyx_t_12(__pyx_t_8); if (unlikely(!__pyx_t_5)) goto __pyx_L7_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_5);
        index = 1; __pyx_t_11 = __pyx_t_12(__pyx_t_8); if (unlikely(!__pyx_t_11)) goto __pyx_L7_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_11);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_8), 2) < 0) __PYX_ERR(0, 1788, __pyx_L1_error)
        __pyx_t_12 = 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_12 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        __PYX_ERR(0, 1788, __pyx_L1_error)
        __pyx_L8_unpacking_done:;
      }
      __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_parts);
      __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_parts, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      __pyx_t_5 = 0;
      __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_options);
      __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_options, __pyx_t_11);
      __Pyx_GIVEREF(__pyx_t_11);
      __pyx_t_11 = 0;

      /* "mathics/builtin/graphics.py":1789
 *                     elif head == "System`BezierCurve":
 *                         parts, options = _data_and_options(segment.leaves, {})
 *                         spline_degree = options.get("SplineDegree", Integer(3))             # <<<<<<<<<<<<<<
 *                         if not isinstance(spline_degree, Integer):
 *                             raise BoxConstructError
 */
      __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_options, __pyx_n_s_get); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1789, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_Integer); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1789, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_8);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_8, function);
        }
      }
      __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_6, __pyx_int_3) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_int_3);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1789, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = NULL;
      __pyx_t_10 = 0;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_11))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_11);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_11, function);
          __pyx_t_10 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_11)) {
        PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_n_u_SplineDegree, __pyx_t_5};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_11, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1789, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_11)) {
        PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_n_u_SplineDegree, __pyx_t_5};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_11, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1789, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1789, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_8) {
          __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_8); __pyx_t_8 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_SplineDegree);
        __Pyx_GIVEREF(__pyx_n_u_SplineDegree);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_10, __pyx_n_u_SplineDegree);
        __Pyx_GIVEREF(__pyx_t_5);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_10, __pyx_t_5);
        __pyx_t_5 = 0;
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1789, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_spline_degree);
      __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_spline_degree, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      __pyx_t_4 = 0;

      /* "mathics/builtin/graphics.py":1790
 *                         parts, options = _data_and_options(segment.leaves, {})
 *                         spline_degree = options.get("SplineDegree", Integer(3))
 *                         if not isinstance(spline_degree, Integer):             # <<<<<<<<<<<<<<
 *                             raise BoxConstructError
 *                         k = spline_degree.get_int_value()
 */
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Integer); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1790, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_7 = PyObject_IsInstance(__pyx_cur_scope->__pyx_v_spline_degree, __pyx_t_4); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 1790, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_13 = ((!(__pyx_t_7 != 0)) != 0);
      if (unlikely(__pyx_t_13)) {

        /* "mathics/builtin/graphics.py":1791
 *                         spline_degree = options.get("SplineDegree", Integer(3))
 *                         if not isinstance(spline_degree, Integer):
 *                             raise BoxConstructError             # <<<<<<<<<<<<<<
 *                         k = spline_degree.get_int_value()
 *                     elif head == "System`BSplineCurve":
 */
        __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_BoxConstructError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1791, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_Raise(__pyx_t_4, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __PYX_ERR(0, 1791, __pyx_L1_error)

        /* "mathics/builtin/graphics.py":1790
 *                         parts, options = _data_and_options(segment.leaves, {})
 *                         spline_degree = options.get("SplineDegree", Integer(3))
 *                         if not isinstance(spline_degree, Integer):             # <<<<<<<<<<<<<<
 *                             raise BoxConstructError
 *                         k = spline_degree.get_int_value()
 */
      }

      /* "mathics/builtin/graphics.py":1792
 *                         if not isinstance(spline_degree, Integer):
 *                             raise BoxConstructError
 *                         k = spline_degree.get_int_value()             # <<<<<<<<<<<<<<
 *                     elif head == "System`BSplineCurve":
 *                         raise NotImplementedError  # FIXME convert bspline to bezier here
 */
      __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_spline_degree, __pyx_n_s_get_int_value); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1792, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_11))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_11);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_11, function);
        }
      }
      __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_11);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1792, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_k);
      __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_k, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      __pyx_t_4 = 0;

      /* "mathics/builtin/graphics.py":1787
 *                         k = 1
 *                         parts = segment.leaves
 *                     elif head == "System`BezierCurve":             # <<<<<<<<<<<<<<
 *                         parts, options = _data_and_options(segment.leaves, {})
 *                         spline_degree = options.get("SplineDegree", Integer(3))
 */
      goto __pyx_L6;
    }

    /* "mathics/builtin/graphics.py":1793
 *                             raise BoxConstructError
 *                         k = spline_degree.get_int_value()
 *                     elif head == "System`BSplineCurve":             # <<<<<<<<<<<<<<
 *                         raise NotImplementedError  # FIXME convert bspline to bezier here
 *                         parts = segment.leaves
 */
    __pyx_t_13 = (__Pyx_PyUnicode_Equals(__pyx_cur_scope->__pyx_v_head, __pyx_kp_u_System_BSplineCurve, Py_EQ)); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 1793, __pyx_L1_error)
    if (unlikely(__pyx_t_13)) {

      /* "mathics/builtin/graphics.py":1794
 *                         k = spline_degree.get_int_value()
 *                     elif head == "System`BSplineCurve":
 *                         raise NotImplementedError  # FIXME convert bspline to bezier here             # <<<<<<<<<<<<<<
 *                         parts = segment.leaves
 *                     else:
 */
      __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0);
      __PYX_ERR(0, 1794, __pyx_L1_error)

      /* "mathics/builtin/graphics.py":1793
 *                             raise BoxConstructError
 *                         k = spline_degree.get_int_value()
 *                     elif head == "System`BSplineCurve":             # <<<<<<<<<<<<<<
 *                         raise NotImplementedError  # FIXME convert bspline to bezier here
 *                         parts = segment.leaves
 */
    }

    /* "mathics/builtin/graphics.py":1797
 *                         parts = segment.leaves
 *                     else:
 *                         raise BoxConstructError             # <<<<<<<<<<<<<<
 * 
 *                     coords = []
 */
    /*else*/ {
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_BoxConstructError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1797, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __PYX_ERR(0, 1797, __pyx_L1_error)
    }
    __pyx_L6:;

    /* "mathics/builtin/graphics.py":1799
 *                         raise BoxConstructError
 * 
 *                     coords = []             # <<<<<<<<<<<<<<
 * 
 *                     for part in parts:
 */
    __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1799, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_coords);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_coords, ((PyObject*)__pyx_t_4));
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;

    /* "mathics/builtin/graphics.py":1801
 *                     coords = []
 * 
 *                     for part in parts:             # <<<<<<<<<<<<<<
 *                         if part.get_head_name() != "System`List":
 *                             raise BoxConstructError
 */
    if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_parts)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_parts)) {
      __pyx_t_4 = __pyx_cur_scope->__pyx_v_parts; __Pyx_INCREF(__pyx_t_4); __pyx_t_14 = 0;
      __pyx_t_15 = NULL;
    } else {
      __pyx_t_14 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_parts); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1801, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_15 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1801, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_15)) {
        if (likely(PyList_CheckExact(__pyx_t_4))) {
          if (__pyx_t_14 >= PyList_GET_SIZE(__pyx_t_4)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_11 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_14); __Pyx_INCREF(__pyx_t_11); __pyx_t_14++; if (unlikely(0 < 0)) __PYX_ERR(0, 1801, __pyx_L1_error)
          #else
          __pyx_t_11 = PySequence_ITEM(__pyx_t_4, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1801, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_11);
          #endif
        } else {
          if (__pyx_t_14 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_11 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_14); __Pyx_INCREF(__pyx_t_11); __pyx_t_14++; if (unlikely(0 < 0)) __PYX_ERR(0, 1801, __pyx_L1_error)
          #else
          __pyx_t_11 = PySequence_ITEM(__pyx_t_4, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1801, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_11);
          #endif
        }
      } else {
        __pyx_t_11 = __pyx_t_15(__pyx_t_4);
        if (unlikely(!__pyx_t_11)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 1801, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_11);
      }
      __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_part);
      __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_part, __pyx_t_11);
      __Pyx_GIVEREF(__pyx_t_11);
      __pyx_t_11 = 0;

      /* "mathics/builtin/graphics.py":1802
 * 
 *                     for part in parts:
 *                         if part.get_head_name() != "System`List":             # <<<<<<<<<<<<<<
 *                             raise BoxConstructError
 *                         coords.extend(
 */
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_part, __pyx_n_s_get_head_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1802, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
        }
      }
      __pyx_t_11 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1802, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_13 = (__Pyx_PyUnicode_Equals(__pyx_t_11, __pyx_kp_u_System_List, Py_NE)); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 1802, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      if (unlikely(__pyx_t_13)) {

        /* "mathics/builtin/graphics.py":1803
 *                     for part in parts:
 *                         if part.get_head_name() != "System`List":
 *                             raise BoxConstructError             # <<<<<<<<<<<<<<
 *                         coords.extend(
 *                             [graphics.coords(graphics, xy) for xy in part.leaves]
 */
        __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_BoxConstructError); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1803, __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(0, 1803, __pyx_L1_error)

        /* "mathics/builtin/graphics.py":1802
 * 
 *                     for part in parts:
 *                         if part.get_head_name() != "System`List":             # <<<<<<<<<<<<<<
 *                             raise BoxConstructError
 *                         coords.extend(
 */
      }

      /* "mathics/builtin/graphics.py":1804
 *                         if part.get_head_name() != "System`List":
 *                             raise BoxConstructError
 *                         coords.extend(             # <<<<<<<<<<<<<<
 *                             [graphics.coords(graphics, xy) for xy in part.leaves]
 *                         )
 */
      { /* enter inner scope */

        /* "mathics/builtin/graphics.py":1805
 *                             raise BoxConstructError
 *                         coords.extend(
 *                             [graphics.coords(graphics, xy) for xy in part.leaves]             # <<<<<<<<<<<<<<
 *                         )
 * 
 */
        __pyx_t_11 = PyList_New(0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1805, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_part, __pyx_n_s_leaves); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1805, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) {
          __pyx_t_5 = __pyx_t_6; __Pyx_INCREF(__pyx_t_5); __pyx_t_16 = 0;
          __pyx_t_17 = NULL;
        } else {
          __pyx_t_16 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1805, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_17 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1805, __pyx_L1_error)
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        for (;;) {
          if (likely(!__pyx_t_17)) {
            if (likely(PyList_CheckExact(__pyx_t_5))) {
              if (__pyx_t_16 >= PyList_GET_SIZE(__pyx_t_5)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_6 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_16); __Pyx_INCREF(__pyx_t_6); __pyx_t_16++; if (unlikely(0 < 0)) __PYX_ERR(0, 1805, __pyx_L1_error)
              #else
              __pyx_t_6 = PySequence_ITEM(__pyx_t_5, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1805, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_6);
              #endif
            } else {
              if (__pyx_t_16 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_16); __Pyx_INCREF(__pyx_t_6); __pyx_t_16++; if (unlikely(0 < 0)) __PYX_ERR(0, 1805, __pyx_L1_error)
              #else
              __pyx_t_6 = PySequence_ITEM(__pyx_t_5, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1805, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_6);
              #endif
            }
          } else {
            __pyx_t_6 = __pyx_t_17(__pyx_t_5);
            if (unlikely(!__pyx_t_6)) {
              PyObject* exc_type = PyErr_Occurred();
              if (exc_type) {
                if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                else __PYX_ERR(0, 1805, __pyx_L1_error)
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_6);
          }
          __Pyx_XGOTREF(__pyx_cur_scope->__pyx_9genexpr25__pyx_v_xy);
          __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_9genexpr25__pyx_v_xy, __pyx_t_6);
          __Pyx_GIVEREF(__pyx_t_6);
          __pyx_t_6 = 0;
          if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_graphics)) { __Pyx_RaiseClosureNameError("graphics"); __PYX_ERR(0, 1805, __pyx_L1_error) }
          __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_graphics, __pyx_n_s_coords); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1805, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_graphics)) { __Pyx_RaiseClosureNameError("graphics"); __PYX_ERR(0, 1805, __pyx_L1_error) }
          __pyx_t_9 = NULL;
          __pyx_t_10 = 0;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
            __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
            if (likely(__pyx_t_9)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
              __Pyx_INCREF(__pyx_t_9);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_8, function);
              __pyx_t_10 = 1;
            }
          }
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_8)) {
            PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_graphics, __pyx_cur_scope->__pyx_9genexpr25__pyx_v_xy};
            __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1805, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
            __Pyx_GOTREF(__pyx_t_6);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
            PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_graphics, __pyx_cur_scope->__pyx_9genexpr25__pyx_v_xy};
            __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1805, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
            __Pyx_GOTREF(__pyx_t_6);
          } else
          #endif
          {
            __pyx_t_18 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1805, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_18);
            if (__pyx_t_9) {
              __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_9); __pyx_t_9 = NULL;
            }
            __Pyx_INCREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_graphics);
            __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_graphics);
            PyTuple_SET_ITEM(__pyx_t_18, 0+__pyx_t_10, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_graphics);
            __Pyx_INCREF(__pyx_cur_scope->__pyx_9genexpr25__pyx_v_xy);
            __Pyx_GIVEREF(__pyx_cur_scope->__pyx_9genexpr25__pyx_v_xy);
            PyTuple_SET_ITEM(__pyx_t_18, 1+__pyx_t_10, __pyx_cur_scope->__pyx_9genexpr25__pyx_v_xy);
            __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_18, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1805, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_6);
            __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
          }
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (unlikely(__Pyx_ListComp_Append(__pyx_t_11, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 1805, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        }
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      } /* exit inner scope */

      /* "mathics/builtin/graphics.py":1804
 *                         if part.get_head_name() != "System`List":
 *                             raise BoxConstructError
 *                         coords.extend(             # <<<<<<<<<<<<<<
 *                             [graphics.coords(graphics, xy) for xy in part.leaves]
 *                         )
 */
      __pyx_t_19 = __Pyx_PyList_Extend(__pyx_cur_scope->__pyx_v_coords, __pyx_t_11); if (unlikely(__pyx_t_19 == ((int)-1))) __PYX_ERR(0, 1804, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

      /* "mathics/builtin/graphics.py":1801
 *                     coords = []
 * 
 *                     for part in parts:             # <<<<<<<<<<<<<<
 *                         if part.get_head_name() != "System`List":
 *                             raise BoxConstructError
 */
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "mathics/builtin/graphics.py":1808
 *                         )
 * 
 *                     yield k, coords             # <<<<<<<<<<<<<<
 * 
 *             if all(x.get_head_name() == "System`List" for x in leaves):
 */
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1808, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_k);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_k);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_cur_scope->__pyx_v_k);
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_coords);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_coords);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_cur_scope->__pyx_v_coords);
    __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_L15_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1808, __pyx_L1_error)

    /* "mathics/builtin/graphics.py":1781
 * 
 *             def parse_component(segments):
 *                 for segment in segments:             # <<<<<<<<<<<<<<
 *                     head = segment.get_head_name()
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "mathics/builtin/graphics.py":1780
 *             leaves = item.leaves[0].leaves
 * 
 *             def parse_component(segments):             # <<<<<<<<<<<<<<
 *                 for segment in segments:
 *                     head = segment.get_head_name()
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  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_11);
  __Pyx_XDECREF(__pyx_t_18);
  __Pyx_AddTraceback("parse_component", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7mathics_7builtin_8graphics_14FilledCurveBox_4init_5generator21(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "mathics/builtin/graphics.py":1810
 *                     yield k, coords
 * 
 *             if all(x.get_head_name() == "System`List" for x in leaves):             # <<<<<<<<<<<<<<
 *                 self.components = [list(parse_component(x)) for x in leaves]
 *             else:
 */

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_14FilledCurveBox_4init_3genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_27_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_27_genexpr *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_27_genexpr(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_27_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_27_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1810, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_25_init *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7mathics_7builtin_8graphics_14FilledCurveBox_4init_5generator21, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_FilledCurveBox_init_locals_genex, __pyx_n_s_mathics_builtin_graphics); if (unlikely(!gen)) __PYX_ERR(0, 1810, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.FilledCurveBox.init.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_7mathics_7builtin_8graphics_14FilledCurveBox_4init_5generator21(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_27_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_27_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1810, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_leaves)) { __Pyx_RaiseClosureNameError("leaves"); __PYX_ERR(0, 1810, __pyx_L1_error) }
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_leaves)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_leaves)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_leaves; __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_outer_scope->__pyx_v_leaves); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1810, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1810, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 1810, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1810, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 1810, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1810, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1810, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_x);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_x, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_x, __pyx_n_s_get_head_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1810, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1810, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_kp_u_System_List, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 1810, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_8 = ((!__pyx_t_7) != 0);
    if (__pyx_t_8) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_False);
      __pyx_r = Py_False;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
  }
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_True);
    __pyx_r = Py_True;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

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

/* "mathics/builtin/graphics.py":1771
 * 
 * class FilledCurveBox(_GraphicsElement):
 *     def init(self, graphics, style, item=None):             # <<<<<<<<<<<<<<
 *         super(FilledCurveBox, self).init(graphics, item, style)
 *         self.edge_color, self.face_color = style.get_style(_Color, face_element=True)
 */

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_14FilledCurveBox_init(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_graphics, PyObject *__pyx_v_style, PyObject *__pyx_v_item) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_25_init *__pyx_cur_scope;
  PyObject *__pyx_v_parse_component = 0;
  PyObject *__pyx_9genexpr27__pyx_v_x = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *(*__pyx_t_6)(PyObject *);
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  PyObject *(*__pyx_t_11)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("init", 0);
  __pyx_cur_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_25_init *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_25_init(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_25_init, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_25_init *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1771, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_graphics = __pyx_v_graphics;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_graphics);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_graphics);

  /* "mathics/builtin/graphics.py":1772
 * class FilledCurveBox(_GraphicsElement):
 *     def init(self, graphics, style, item=None):
 *         super(FilledCurveBox, self).init(graphics, item, style)             # <<<<<<<<<<<<<<
 *         self.edge_color, self.face_color = style.get_style(_Color, face_element=True)
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FilledCurveBox); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1772, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1772, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_INCREF(__pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1772, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1772, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_cur_scope->__pyx_v_graphics, __pyx_v_item, __pyx_v_style};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1772, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_cur_scope->__pyx_v_graphics, __pyx_v_item, __pyx_v_style};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1772, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1772, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_2) {
      __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
    }
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_graphics);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_graphics);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_cur_scope->__pyx_v_graphics);
    __Pyx_INCREF(__pyx_v_item);
    __Pyx_GIVEREF(__pyx_v_item);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_item);
    __Pyx_INCREF(__pyx_v_style);
    __Pyx_GIVEREF(__pyx_v_style);
    PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_style);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1772, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1773
 *     def init(self, graphics, style, item=None):
 *         super(FilledCurveBox, self).init(graphics, item, style)
 *         self.edge_color, self.face_color = style.get_style(_Color, face_element=True)             # <<<<<<<<<<<<<<
 * 
 *         if item is not None and item.leaves and item.leaves[0].has_form("List", None):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_style, __pyx_n_s_get_style); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1773, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Color); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1773, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1773, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1773, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_face_element, Py_True) < 0) __PYX_ERR(0, 1773, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1773, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
    PyObject* sequence = __pyx_t_2;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 1773, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_5);
    #else
    __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1773, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1773, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    #endif
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1773, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_6 = Py_TYPE(__pyx_t_1)->tp_iternext;
    index = 0; __pyx_t_3 = __pyx_t_6(__pyx_t_1); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 1; __pyx_t_5 = __pyx_t_6(__pyx_t_1); if (unlikely(!__pyx_t_5)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_1), 2) < 0) __PYX_ERR(0, 1773, __pyx_L1_error)
    __pyx_t_6 = NULL;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_6 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 1773, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_edge_color, __pyx_t_3) < 0) __PYX_ERR(0, 1773, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_face_color, __pyx_t_5) < 0) __PYX_ERR(0, 1773, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":1775
 *         self.edge_color, self.face_color = style.get_style(_Color, face_element=True)
 * 
 *         if item is not None and item.leaves and item.leaves[0].has_form("List", None):             # <<<<<<<<<<<<<<
 *             if len(item.leaves) != 1:
 *                 raise BoxConstructError
 */
  __pyx_t_8 = (__pyx_v_item != Py_None);
  __pyx_t_9 = (__pyx_t_8 != 0);
  if (__pyx_t_9) {
  } else {
    __pyx_t_7 = __pyx_t_9;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_item, __pyx_n_s_leaves); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1775, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 1775, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_9) {
  } else {
    __pyx_t_7 = __pyx_t_9;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_item, __pyx_n_s_leaves); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1775, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1775, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_has_form); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1775, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1775, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 1775, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_7 = __pyx_t_9;
  __pyx_L6_bool_binop_done:;
  if (likely(__pyx_t_7)) {

    /* "mathics/builtin/graphics.py":1776
 * 
 *         if item is not None and item.leaves and item.leaves[0].has_form("List", None):
 *             if len(item.leaves) != 1:             # <<<<<<<<<<<<<<
 *                 raise BoxConstructError
 *             leaves = item.leaves[0].leaves
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_item, __pyx_n_s_leaves); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1776, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_10 = PyObject_Length(__pyx_t_5); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1776, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_7 = ((__pyx_t_10 != 1) != 0);
    if (unlikely(__pyx_t_7)) {

      /* "mathics/builtin/graphics.py":1777
 *         if item is not None and item.leaves and item.leaves[0].has_form("List", None):
 *             if len(item.leaves) != 1:
 *                 raise BoxConstructError             # <<<<<<<<<<<<<<
 *             leaves = item.leaves[0].leaves
 * 
 */
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_BoxConstructError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1777, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_Raise(__pyx_t_5, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __PYX_ERR(0, 1777, __pyx_L1_error)

      /* "mathics/builtin/graphics.py":1776
 * 
 *         if item is not None and item.leaves and item.leaves[0].has_form("List", None):
 *             if len(item.leaves) != 1:             # <<<<<<<<<<<<<<
 *                 raise BoxConstructError
 *             leaves = item.leaves[0].leaves
 */
    }

    /* "mathics/builtin/graphics.py":1778
 *             if len(item.leaves) != 1:
 *                 raise BoxConstructError
 *             leaves = item.leaves[0].leaves             # <<<<<<<<<<<<<<
 * 
 *             def parse_component(segments):
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_item, __pyx_n_s_leaves); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1778, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_5, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1778, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_leaves); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1778, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_cur_scope->__pyx_v_leaves = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "mathics/builtin/graphics.py":1780
 *             leaves = item.leaves[0].leaves
 * 
 *             def parse_component(segments):             # <<<<<<<<<<<<<<
 *                 for segment in segments:
 *                     head = segment.get_head_name()
 */
    __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_14FilledCurveBox_4init_1parse_component, 0, __pyx_n_s_FilledCurveBox_init_locals_parse, ((PyObject*)__pyx_cur_scope), __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__60)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1780, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_v_parse_component = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "mathics/builtin/graphics.py":1810
 *                     yield k, coords
 * 
 *             if all(x.get_head_name() == "System`List" for x in leaves):             # <<<<<<<<<<<<<<
 *                 self.components = [list(parse_component(x)) for x in leaves]
 *             else:
 */
    __pyx_t_5 = __pyx_pf_7mathics_7builtin_8graphics_14FilledCurveBox_4init_3genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1810, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = __Pyx_Generator_Next(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1810, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 1810, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_7) {

      /* "mathics/builtin/graphics.py":1811
 * 
 *             if all(x.get_head_name() == "System`List" for x in leaves):
 *                 self.components = [list(parse_component(x)) for x in leaves]             # <<<<<<<<<<<<<<
 *             else:
 *                 self.components = [list(parse_component(leaves))]
 */
      { /* enter inner scope */
        __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1811, __pyx_L13_error)
        __Pyx_GOTREF(__pyx_t_2);
        if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_leaves)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_leaves)) {
          __pyx_t_5 = __pyx_cur_scope->__pyx_v_leaves; __Pyx_INCREF(__pyx_t_5); __pyx_t_10 = 0;
          __pyx_t_11 = NULL;
        } else {
          __pyx_t_10 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_leaves); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1811, __pyx_L13_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_11 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1811, __pyx_L13_error)
        }
        for (;;) {
          if (likely(!__pyx_t_11)) {
            if (likely(PyList_CheckExact(__pyx_t_5))) {
              if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_5)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_3 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 1811, __pyx_L13_error)
              #else
              __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1811, __pyx_L13_error)
              __Pyx_GOTREF(__pyx_t_3);
              #endif
            } else {
              if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 1811, __pyx_L13_error)
              #else
              __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1811, __pyx_L13_error)
              __Pyx_GOTREF(__pyx_t_3);
              #endif
            }
          } else {
            __pyx_t_3 = __pyx_t_11(__pyx_t_5);
            if (unlikely(!__pyx_t_3)) {
              PyObject* exc_type = PyErr_Occurred();
              if (exc_type) {
                if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                else __PYX_ERR(0, 1811, __pyx_L13_error)
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_3);
          }
          __Pyx_XDECREF_SET(__pyx_9genexpr27__pyx_v_x, __pyx_t_3);
          __pyx_t_3 = 0;
          __pyx_t_3 = __pyx_pf_7mathics_7builtin_8graphics_14FilledCurveBox_4init_parse_component(__pyx_v_parse_component, __pyx_9genexpr27__pyx_v_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1811, __pyx_L13_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_1 = PySequence_List(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1811, __pyx_L13_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 1811, __pyx_L13_error)
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        }
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_9genexpr27__pyx_v_x); __pyx_9genexpr27__pyx_v_x = 0;
        goto __pyx_L16_exit_scope;
        __pyx_L13_error:;
        __Pyx_XDECREF(__pyx_9genexpr27__pyx_v_x); __pyx_9genexpr27__pyx_v_x = 0;
        goto __pyx_L1_error;
        __pyx_L16_exit_scope:;
      } /* exit inner scope */
      if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_components, __pyx_t_2) < 0) __PYX_ERR(0, 1811, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "mathics/builtin/graphics.py":1810
 *                     yield k, coords
 * 
 *             if all(x.get_head_name() == "System`List" for x in leaves):             # <<<<<<<<<<<<<<
 *                 self.components = [list(parse_component(x)) for x in leaves]
 *             else:
 */
      goto __pyx_L10;
    }

    /* "mathics/builtin/graphics.py":1813
 *                 self.components = [list(parse_component(x)) for x in leaves]
 *             else:
 *                 self.components = [list(parse_component(leaves))]             # <<<<<<<<<<<<<<
 *         else:
 *             raise BoxConstructError
 */
    /*else*/ {
      __pyx_t_2 = __pyx_cur_scope->__pyx_v_leaves;
      __Pyx_INCREF(__pyx_t_2);
      __pyx_t_5 = __pyx_pf_7mathics_7builtin_8graphics_14FilledCurveBox_4init_parse_component(__pyx_v_parse_component, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1813, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PySequence_List(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1813, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1813, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_2);
      PyList_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
      __pyx_t_2 = 0;
      if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_components, __pyx_t_5) < 0) __PYX_ERR(0, 1813, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __pyx_L10:;

    /* "mathics/builtin/graphics.py":1775
 *         self.edge_color, self.face_color = style.get_style(_Color, face_element=True)
 * 
 *         if item is not None and item.leaves and item.leaves[0].has_form("List", None):             # <<<<<<<<<<<<<<
 *             if len(item.leaves) != 1:
 *                 raise BoxConstructError
 */
    goto __pyx_L5;
  }

  /* "mathics/builtin/graphics.py":1815
 *                 self.components = [list(parse_component(leaves))]
 *         else:
 *             raise BoxConstructError             # <<<<<<<<<<<<<<
 * 
 *     def to_svg(self):
 */
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_BoxConstructError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1815, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __PYX_ERR(0, 1815, __pyx_L1_error)
  }
  __pyx_L5:;

  /* "mathics/builtin/graphics.py":1771
 * 
 * class FilledCurveBox(_GraphicsElement):
 *     def init(self, graphics, style, item=None):             # <<<<<<<<<<<<<<
 *         super(FilledCurveBox, self).init(graphics, item, style)
 *         self.edge_color, self.face_color = style.get_style(_Color, face_element=True)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("mathics.builtin.graphics.FilledCurveBox.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_parse_component);
  __Pyx_XDECREF(__pyx_9genexpr27__pyx_v_x);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":1817
 *             raise BoxConstructError
 * 
 *     def to_svg(self):             # <<<<<<<<<<<<<<
 *         l = self.style.get_line_width(face_element=False)
 *         style = create_css(
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_14FilledCurveBox_3to_svg(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_14FilledCurveBox_3to_svg = {"to_svg", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_14FilledCurveBox_3to_svg, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_14FilledCurveBox_3to_svg(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_svg (wrapper)", 0);
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_14FilledCurveBox_2to_svg(__pyx_self, ((PyObject *)__pyx_v_self));

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

/* "mathics/builtin/graphics.py":1823
 *         )
 * 
 *         def components():             # <<<<<<<<<<<<<<
 *             for component in self.components:
 *                 transformed = [(k, [xy.pos() for xy in p]) for k, p in component]
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_14FilledCurveBox_6to_svg_1components(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_14FilledCurveBox_6to_svg_1components = {"components", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_14FilledCurveBox_6to_svg_1components, METH_NOARGS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_14FilledCurveBox_6to_svg_1components(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("components (wrapper)", 0);
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_14FilledCurveBox_6to_svg_components(__pyx_self);

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_14FilledCurveBox_6to_svg_components(PyObject *__pyx_self) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_29_components *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("components", 0);
  __pyx_cur_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_29_components *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_29_components(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_29_components, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_29_components *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1823, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_28_to_svg *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7mathics_7builtin_8graphics_14FilledCurveBox_6to_svg_2generator22, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_components, __pyx_n_s_FilledCurveBox_to_svg_locals_com, __pyx_n_s_mathics_builtin_graphics); if (unlikely(!gen)) __PYX_ERR(0, 1823, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.FilledCurveBox.to_svg.components", __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_7mathics_7builtin_8graphics_14FilledCurveBox_6to_svg_2generator22(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_29_components *__pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_29_components *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *(*__pyx_t_12)(PyObject *);
  Py_ssize_t __pyx_t_13;
  PyObject *(*__pyx_t_14)(PyObject *);
  PyObject *__pyx_t_15 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("components", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L12_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1823, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1824
 * 
 *         def components():
 *             for component in self.components:             # <<<<<<<<<<<<<<
 *                 transformed = [(k, [xy.pos() for xy in p]) for k, p in component]
 *                 yield " ".join(_svg_bezier(*transformed)) + " Z"
 */
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 1824, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self, __pyx_n_s_components); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1824, __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(0, 1824, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1824, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 1824, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1824, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 1824, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1824, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1824, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_component);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_component, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;

    /* "mathics/builtin/graphics.py":1825
 *         def components():
 *             for component in self.components:
 *                 transformed = [(k, [xy.pos() for xy in p]) for k, p in component]             # <<<<<<<<<<<<<<
 *                 yield " ".join(_svg_bezier(*transformed)) + " Z"
 * 
 */
    { /* enter inner scope */
      __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1825, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_component)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_component)) {
        __pyx_t_5 = __pyx_cur_scope->__pyx_v_component; __Pyx_INCREF(__pyx_t_5); __pyx_t_6 = 0;
        __pyx_t_7 = NULL;
      } else {
        __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_component); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1825, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_7 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1825, __pyx_L1_error)
      }
      for (;;) {
        if (likely(!__pyx_t_7)) {
          if (likely(PyList_CheckExact(__pyx_t_5))) {
            if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_5)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_8 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 1825, __pyx_L1_error)
            #else
            __pyx_t_8 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1825, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_8);
            #endif
          } else {
            if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 1825, __pyx_L1_error)
            #else
            __pyx_t_8 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1825, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_8);
            #endif
          }
        } else {
          __pyx_t_8 = __pyx_t_7(__pyx_t_5);
          if (unlikely(!__pyx_t_8)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 1825, __pyx_L1_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_8);
        }
        if ((likely(PyTuple_CheckExact(__pyx_t_8))) || (PyList_CheckExact(__pyx_t_8))) {
          PyObject* sequence = __pyx_t_8;
          Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
          if (unlikely(size != 2)) {
            if (size > 2) __Pyx_RaiseTooManyValuesError(2);
            else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
            __PYX_ERR(0, 1825, __pyx_L1_error)
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          if (likely(PyTuple_CheckExact(sequence))) {
            __pyx_t_9 = PyTuple_GET_ITEM(sequence, 0); 
            __pyx_t_10 = PyTuple_GET_ITEM(sequence, 1); 
          } else {
            __pyx_t_9 = PyList_GET_ITEM(sequence, 0); 
            __pyx_t_10 = PyList_GET_ITEM(sequence, 1); 
          }
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(__pyx_t_10);
          #else
          __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1825, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1825, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          #endif
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        } else {
          Py_ssize_t index = -1;
          __pyx_t_11 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1825, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __pyx_t_12 = Py_TYPE(__pyx_t_11)->tp_iternext;
          index = 0; __pyx_t_9 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_9)) goto __pyx_L8_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_9);
          index = 1; __pyx_t_10 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_10)) goto __pyx_L8_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_10);
          if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 2) < 0) __PYX_ERR(0, 1825, __pyx_L1_error)
          __pyx_t_12 = NULL;
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          goto __pyx_L9_unpacking_done;
          __pyx_L8_unpacking_failed:;
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __pyx_t_12 = NULL;
          if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
          __PYX_ERR(0, 1825, __pyx_L1_error)
          __pyx_L9_unpacking_done:;
        }
        __Pyx_XGOTREF(__pyx_cur_scope->__pyx_9genexpr28__pyx_v_k);
        __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_9genexpr28__pyx_v_k, __pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_9);
        __pyx_t_9 = 0;
        __Pyx_XGOTREF(__pyx_cur_scope->__pyx_9genexpr28__pyx_v_p);
        __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_9genexpr28__pyx_v_p, __pyx_t_10);
        __Pyx_GIVEREF(__pyx_t_10);
        __pyx_t_10 = 0;
        { /* enter inner scope */
          __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1825, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_9genexpr28__pyx_v_p)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_9genexpr28__pyx_v_p)) {
            __pyx_t_10 = __pyx_cur_scope->__pyx_9genexpr28__pyx_v_p; __Pyx_INCREF(__pyx_t_10); __pyx_t_13 = 0;
            __pyx_t_14 = NULL;
          } else {
            __pyx_t_13 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_cur_scope->__pyx_9genexpr28__pyx_v_p); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1825, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_10);
            __pyx_t_14 = Py_TYPE(__pyx_t_10)->tp_iternext; if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1825, __pyx_L1_error)
          }
          for (;;) {
            if (likely(!__pyx_t_14)) {
              if (likely(PyList_CheckExact(__pyx_t_10))) {
                if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_10)) break;
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                __pyx_t_9 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_13); __Pyx_INCREF(__pyx_t_9); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 1825, __pyx_L1_error)
                #else
                __pyx_t_9 = PySequence_ITEM(__pyx_t_10, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1825, __pyx_L1_error)
                __Pyx_GOTREF(__pyx_t_9);
                #endif
              } else {
                if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_10)) break;
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_13); __Pyx_INCREF(__pyx_t_9); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 1825, __pyx_L1_error)
                #else
                __pyx_t_9 = PySequence_ITEM(__pyx_t_10, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1825, __pyx_L1_error)
                __Pyx_GOTREF(__pyx_t_9);
                #endif
              }
            } else {
              __pyx_t_9 = __pyx_t_14(__pyx_t_10);
              if (unlikely(!__pyx_t_9)) {
                PyObject* exc_type = PyErr_Occurred();
                if (exc_type) {
                  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                  else __PYX_ERR(0, 1825, __pyx_L1_error)
                }
                break;
              }
              __Pyx_GOTREF(__pyx_t_9);
            }
            __Pyx_XGOTREF(__pyx_cur_scope->__pyx_9genexpr29__pyx_v_xy);
            __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_9genexpr29__pyx_v_xy, __pyx_t_9);
            __Pyx_GIVEREF(__pyx_t_9);
            __pyx_t_9 = 0;
            __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_9genexpr29__pyx_v_xy, __pyx_n_s_pos); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1825, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_11);
            __pyx_t_15 = NULL;
            if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_11))) {
              __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_11);
              if (likely(__pyx_t_15)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
                __Pyx_INCREF(__pyx_t_15);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_11, function);
              }
            }
            __pyx_t_9 = (__pyx_t_15) ? __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_15) : __Pyx_PyObject_CallNoArg(__pyx_t_11);
            __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
            if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1825, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_9);
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            if (unlikely(__Pyx_ListComp_Append(__pyx_t_8, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 1825, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          }
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        } /* exit inner scope */
        __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1825, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_INCREF(__pyx_cur_scope->__pyx_9genexpr28__pyx_v_k);
        __Pyx_GIVEREF(__pyx_cur_scope->__pyx_9genexpr28__pyx_v_k);
        PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_cur_scope->__pyx_9genexpr28__pyx_v_k);
        __Pyx_GIVEREF(__pyx_t_8);
        PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_8);
        __pyx_t_8 = 0;
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_10))) __PYX_ERR(0, 1825, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } /* exit inner scope */
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_transformed);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_transformed, ((PyObject*)__pyx_t_1));
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;

    /* "mathics/builtin/graphics.py":1826
 *             for component in self.components:
 *                 transformed = [(k, [xy.pos() for xy in p]) for k, p in component]
 *                 yield " ".join(_svg_bezier(*transformed)) + " Z"             # <<<<<<<<<<<<<<
 * 
 *         return '<path d="%s" style="%s" fill-rule="evenodd"/>' % (
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_svg_bezier); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1826, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PySequence_Tuple(__pyx_cur_scope->__pyx_v_transformed); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1826, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1826, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyUnicode_Join(__pyx_kp_u__7, __pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1826, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_10 = __Pyx_PyUnicode_Concat(__pyx_t_5, __pyx_kp_u_Z_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1826, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_10;
    __pyx_t_10 = 0;
    __Pyx_XGIVEREF(__pyx_t_2);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_3;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_4;
    __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_L12_resume_from_yield:;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_2);
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_4 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1826, __pyx_L1_error)

    /* "mathics/builtin/graphics.py":1824
 * 
 *         def components():
 *             for component in self.components:             # <<<<<<<<<<<<<<
 *                 transformed = [(k, [xy.pos() for xy in p]) for k, p in component]
 *                 yield " ".join(_svg_bezier(*transformed)) + " Z"
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "mathics/builtin/graphics.py":1823
 *         )
 * 
 *         def components():             # <<<<<<<<<<<<<<
 *             for component in self.components:
 *                 transformed = [(k, [xy.pos() for xy in p]) for k, p in component]
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  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_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_AddTraceback("components", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":1817
 *             raise BoxConstructError
 * 
 *     def to_svg(self):             # <<<<<<<<<<<<<<
 *         l = self.style.get_line_width(face_element=False)
 *         style = create_css(
 */

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_14FilledCurveBox_2to_svg(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_28_to_svg *__pyx_cur_scope;
  PyObject *__pyx_v_l = NULL;
  PyObject *__pyx_v_style = NULL;
  PyObject *__pyx_v_components = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  Py_UCS4 __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_svg", 0);
  __pyx_cur_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_28_to_svg *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_28_to_svg(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_28_to_svg, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_28_to_svg *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1817, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self);

  /* "mathics/builtin/graphics.py":1818
 * 
 *     def to_svg(self):
 *         l = self.style.get_line_width(face_element=False)             # <<<<<<<<<<<<<<
 *         style = create_css(
 *             edge_color=self.edge_color, face_color=self.face_color, stroke_width=l
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_style); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1818, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_get_line_width); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1818, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1818, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_face_element, Py_False) < 0) __PYX_ERR(0, 1818, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1818, __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_v_l = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":1819
 *     def to_svg(self):
 *         l = self.style.get_line_width(face_element=False)
 *         style = create_css(             # <<<<<<<<<<<<<<
 *             edge_color=self.edge_color, face_color=self.face_color, stroke_width=l
 *         )
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_create_css); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1819, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "mathics/builtin/graphics.py":1820
 *         l = self.style.get_line_width(face_element=False)
 *         style = create_css(
 *             edge_color=self.edge_color, face_color=self.face_color, stroke_width=l             # <<<<<<<<<<<<<<
 *         )
 * 
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1820, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_edge_color); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1820, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_edge_color, __pyx_t_2) < 0) __PYX_ERR(0, 1820, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_face_color); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1820, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_face_color, __pyx_t_2) < 0) __PYX_ERR(0, 1820, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_stroke_width, __pyx_v_l) < 0) __PYX_ERR(0, 1820, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1819
 *     def to_svg(self):
 *         l = self.style.get_line_width(face_element=False)
 *         style = create_css(             # <<<<<<<<<<<<<<
 *             edge_color=self.edge_color, face_color=self.face_color, stroke_width=l
 *         )
 */
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1819, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_style = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":1823
 *         )
 * 
 *         def components():             # <<<<<<<<<<<<<<
 *             for component in self.components:
 *                 transformed = [(k, [xy.pos() for xy in p]) for k, p in component]
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_14FilledCurveBox_6to_svg_1components, 0, __pyx_n_s_FilledCurveBox_to_svg_locals_com, ((PyObject*)__pyx_cur_scope), __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__62)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1823, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_components = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":1828
 *                 yield " ".join(_svg_bezier(*transformed)) + " Z"
 * 
 *         return '<path d="%s" style="%s" fill-rule="evenodd"/>' % (             # <<<<<<<<<<<<<<
 *             " ".join(components()),
 *             style,
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1828, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = 0;
  __pyx_t_5 = 127;
  __Pyx_INCREF(__pyx_kp_u_path_d);
  __pyx_t_4 += 9;
  __Pyx_GIVEREF(__pyx_kp_u_path_d);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u_path_d);

  /* "mathics/builtin/graphics.py":1829
 * 
 *         return '<path d="%s" style="%s" fill-rule="evenodd"/>' % (
 *             " ".join(components()),             # <<<<<<<<<<<<<<
 *             style,
 *         )
 */
  __pyx_t_1 = __pyx_pf_7mathics_7builtin_8graphics_14FilledCurveBox_6to_svg_components(__pyx_v_components); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1829, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyUnicode_Join(__pyx_kp_u__7, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1829, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_5) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_5;
  __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
  __pyx_t_3 = 0;
  __Pyx_INCREF(__pyx_kp_u_style_2);
  __pyx_t_4 += 9;
  __Pyx_GIVEREF(__pyx_kp_u_style_2);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u_style_2);

  /* "mathics/builtin/graphics.py":1830
 *         return '<path d="%s" style="%s" fill-rule="evenodd"/>' % (
 *             " ".join(components()),
 *             style,             # <<<<<<<<<<<<<<
 *         )
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_style), __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1830, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_5) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_5;
  __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
  __pyx_t_3 = 0;
  __Pyx_INCREF(__pyx_kp_u_fill_rule_evenodd);
  __pyx_t_4 += 23;
  __Pyx_GIVEREF(__pyx_kp_u_fill_rule_evenodd);
  PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_kp_u_fill_rule_evenodd);

  /* "mathics/builtin/graphics.py":1828
 *                 yield " ".join(_svg_bezier(*transformed)) + " Z"
 * 
 *         return '<path d="%s" style="%s" fill-rule="evenodd"/>' % (             # <<<<<<<<<<<<<<
 *             " ".join(components()),
 *             style,
 */
  __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_2, 5, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1828, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":1817
 *             raise BoxConstructError
 * 
 *     def to_svg(self):             # <<<<<<<<<<<<<<
 *         l = self.style.get_line_width(face_element=False)
 *         style = create_css(
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("mathics.builtin.graphics.FilledCurveBox.to_svg", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_l);
  __Pyx_XDECREF(__pyx_v_style);
  __Pyx_XDECREF(__pyx_v_components);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":1833
 *         )
 * 
 *     def to_asy(self):             # <<<<<<<<<<<<<<
 *         l = self.style.get_line_width(face_element=False)
 *         pen = create_pens(edge_color=self.edge_color, stroke_width=l)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_14FilledCurveBox_5to_asy(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_14FilledCurveBox_5to_asy = {"to_asy", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_14FilledCurveBox_5to_asy, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_14FilledCurveBox_5to_asy(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_asy (wrapper)", 0);
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_14FilledCurveBox_4to_asy(__pyx_self, ((PyObject *)__pyx_v_self));

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

/* "mathics/builtin/graphics.py":1840
 *             pen = "currentpen"
 * 
 *         def components():             # <<<<<<<<<<<<<<
 *             for component in self.components:
 *                 transformed = [(k, [xy.pos() for xy in p]) for k, p in component]
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_14FilledCurveBox_6to_asy_1components(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_14FilledCurveBox_6to_asy_1components = {"components", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_14FilledCurveBox_6to_asy_1components, METH_NOARGS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_14FilledCurveBox_6to_asy_1components(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("components (wrapper)", 0);
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_14FilledCurveBox_6to_asy_components(__pyx_self);

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_14FilledCurveBox_6to_asy_components(PyObject *__pyx_self) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_31_components *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("components", 0);
  __pyx_cur_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_31_components *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_31_components(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_31_components, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_31_components *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1840, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_30_to_asy *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7mathics_7builtin_8graphics_14FilledCurveBox_6to_asy_2generator23, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_components, __pyx_n_s_FilledCurveBox_to_asy_locals_com, __pyx_n_s_mathics_builtin_graphics); if (unlikely(!gen)) __PYX_ERR(0, 1840, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.FilledCurveBox.to_asy.components", __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_7mathics_7builtin_8graphics_14FilledCurveBox_6to_asy_2generator23(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_31_components *__pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_31_components *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *(*__pyx_t_12)(PyObject *);
  Py_ssize_t __pyx_t_13;
  PyObject *(*__pyx_t_14)(PyObject *);
  PyObject *__pyx_t_15 = NULL;
  Py_UCS4 __pyx_t_16;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("components", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L12_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1840, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1841
 * 
 *         def components():
 *             for component in self.components:             # <<<<<<<<<<<<<<
 *                 transformed = [(k, [xy.pos() for xy in p]) for k, p in component]
 *                 yield "fill(%s--cycle, %s);" % ("".join(_asy_bezier(*transformed)), pen)
 */
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 1841, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self, __pyx_n_s_components); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1841, __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(0, 1841, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1841, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 1841, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1841, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 1841, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1841, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1841, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_component);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_component, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;

    /* "mathics/builtin/graphics.py":1842
 *         def components():
 *             for component in self.components:
 *                 transformed = [(k, [xy.pos() for xy in p]) for k, p in component]             # <<<<<<<<<<<<<<
 *                 yield "fill(%s--cycle, %s);" % ("".join(_asy_bezier(*transformed)), pen)
 * 
 */
    { /* enter inner scope */
      __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1842, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_component)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_component)) {
        __pyx_t_5 = __pyx_cur_scope->__pyx_v_component; __Pyx_INCREF(__pyx_t_5); __pyx_t_6 = 0;
        __pyx_t_7 = NULL;
      } else {
        __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_component); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1842, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_7 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1842, __pyx_L1_error)
      }
      for (;;) {
        if (likely(!__pyx_t_7)) {
          if (likely(PyList_CheckExact(__pyx_t_5))) {
            if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_5)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_8 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 1842, __pyx_L1_error)
            #else
            __pyx_t_8 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1842, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_8);
            #endif
          } else {
            if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 1842, __pyx_L1_error)
            #else
            __pyx_t_8 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1842, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_8);
            #endif
          }
        } else {
          __pyx_t_8 = __pyx_t_7(__pyx_t_5);
          if (unlikely(!__pyx_t_8)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 1842, __pyx_L1_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_8);
        }
        if ((likely(PyTuple_CheckExact(__pyx_t_8))) || (PyList_CheckExact(__pyx_t_8))) {
          PyObject* sequence = __pyx_t_8;
          Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
          if (unlikely(size != 2)) {
            if (size > 2) __Pyx_RaiseTooManyValuesError(2);
            else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
            __PYX_ERR(0, 1842, __pyx_L1_error)
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          if (likely(PyTuple_CheckExact(sequence))) {
            __pyx_t_9 = PyTuple_GET_ITEM(sequence, 0); 
            __pyx_t_10 = PyTuple_GET_ITEM(sequence, 1); 
          } else {
            __pyx_t_9 = PyList_GET_ITEM(sequence, 0); 
            __pyx_t_10 = PyList_GET_ITEM(sequence, 1); 
          }
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(__pyx_t_10);
          #else
          __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1842, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1842, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          #endif
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        } else {
          Py_ssize_t index = -1;
          __pyx_t_11 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1842, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __pyx_t_12 = Py_TYPE(__pyx_t_11)->tp_iternext;
          index = 0; __pyx_t_9 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_9)) goto __pyx_L8_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_9);
          index = 1; __pyx_t_10 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_10)) goto __pyx_L8_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_10);
          if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 2) < 0) __PYX_ERR(0, 1842, __pyx_L1_error)
          __pyx_t_12 = NULL;
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          goto __pyx_L9_unpacking_done;
          __pyx_L8_unpacking_failed:;
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __pyx_t_12 = NULL;
          if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
          __PYX_ERR(0, 1842, __pyx_L1_error)
          __pyx_L9_unpacking_done:;
        }
        __Pyx_XGOTREF(__pyx_cur_scope->__pyx_9genexpr30__pyx_v_k);
        __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_9genexpr30__pyx_v_k, __pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_9);
        __pyx_t_9 = 0;
        __Pyx_XGOTREF(__pyx_cur_scope->__pyx_9genexpr30__pyx_v_p);
        __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_9genexpr30__pyx_v_p, __pyx_t_10);
        __Pyx_GIVEREF(__pyx_t_10);
        __pyx_t_10 = 0;
        { /* enter inner scope */
          __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1842, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_9genexpr30__pyx_v_p)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_9genexpr30__pyx_v_p)) {
            __pyx_t_10 = __pyx_cur_scope->__pyx_9genexpr30__pyx_v_p; __Pyx_INCREF(__pyx_t_10); __pyx_t_13 = 0;
            __pyx_t_14 = NULL;
          } else {
            __pyx_t_13 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_cur_scope->__pyx_9genexpr30__pyx_v_p); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1842, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_10);
            __pyx_t_14 = Py_TYPE(__pyx_t_10)->tp_iternext; if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1842, __pyx_L1_error)
          }
          for (;;) {
            if (likely(!__pyx_t_14)) {
              if (likely(PyList_CheckExact(__pyx_t_10))) {
                if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_10)) break;
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                __pyx_t_9 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_13); __Pyx_INCREF(__pyx_t_9); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 1842, __pyx_L1_error)
                #else
                __pyx_t_9 = PySequence_ITEM(__pyx_t_10, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1842, __pyx_L1_error)
                __Pyx_GOTREF(__pyx_t_9);
                #endif
              } else {
                if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_10)) break;
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_13); __Pyx_INCREF(__pyx_t_9); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 1842, __pyx_L1_error)
                #else
                __pyx_t_9 = PySequence_ITEM(__pyx_t_10, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1842, __pyx_L1_error)
                __Pyx_GOTREF(__pyx_t_9);
                #endif
              }
            } else {
              __pyx_t_9 = __pyx_t_14(__pyx_t_10);
              if (unlikely(!__pyx_t_9)) {
                PyObject* exc_type = PyErr_Occurred();
                if (exc_type) {
                  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                  else __PYX_ERR(0, 1842, __pyx_L1_error)
                }
                break;
              }
              __Pyx_GOTREF(__pyx_t_9);
            }
            __Pyx_XGOTREF(__pyx_cur_scope->__pyx_9genexpr31__pyx_v_xy);
            __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_9genexpr31__pyx_v_xy, __pyx_t_9);
            __Pyx_GIVEREF(__pyx_t_9);
            __pyx_t_9 = 0;
            __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_9genexpr31__pyx_v_xy, __pyx_n_s_pos); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1842, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_11);
            __pyx_t_15 = NULL;
            if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_11))) {
              __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_11);
              if (likely(__pyx_t_15)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
                __Pyx_INCREF(__pyx_t_15);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_11, function);
              }
            }
            __pyx_t_9 = (__pyx_t_15) ? __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_15) : __Pyx_PyObject_CallNoArg(__pyx_t_11);
            __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
            if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1842, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_9);
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            if (unlikely(__Pyx_ListComp_Append(__pyx_t_8, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 1842, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          }
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        } /* exit inner scope */
        __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1842, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_INCREF(__pyx_cur_scope->__pyx_9genexpr30__pyx_v_k);
        __Pyx_GIVEREF(__pyx_cur_scope->__pyx_9genexpr30__pyx_v_k);
        PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_cur_scope->__pyx_9genexpr30__pyx_v_k);
        __Pyx_GIVEREF(__pyx_t_8);
        PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_8);
        __pyx_t_8 = 0;
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_10))) __PYX_ERR(0, 1842, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } /* exit inner scope */
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_transformed);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_transformed, ((PyObject*)__pyx_t_1));
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;

    /* "mathics/builtin/graphics.py":1843
 *             for component in self.components:
 *                 transformed = [(k, [xy.pos() for xy in p]) for k, p in component]
 *                 yield "fill(%s--cycle, %s);" % ("".join(_asy_bezier(*transformed)), pen)             # <<<<<<<<<<<<<<
 * 
 *         return "".join(components())
 */
    __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1843, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = 0;
    __pyx_t_16 = 127;
    __Pyx_INCREF(__pyx_kp_u_fill);
    __pyx_t_6 += 5;
    __Pyx_GIVEREF(__pyx_kp_u_fill);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_fill);
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_asy_bezier); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1843, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_10 = PySequence_Tuple(__pyx_cur_scope->__pyx_v_transformed); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1843, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_10, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1843, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_10 = PyUnicode_Join(__pyx_kp_u__41, __pyx_t_8); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1843, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_16 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) > __pyx_t_16) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) : __pyx_t_16;
    __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10);
    __Pyx_GIVEREF(__pyx_t_10);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_10);
    __pyx_t_10 = 0;
    __Pyx_INCREF(__pyx_kp_u_cycle_3);
    __pyx_t_6 += 9;
    __Pyx_GIVEREF(__pyx_kp_u_cycle_3);
    PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_cycle_3);
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_pen)) { __Pyx_RaiseClosureNameError("pen"); __PYX_ERR(0, 1843, __pyx_L1_error) }
    __pyx_t_10 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_pen), __pyx_empty_unicode); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1843, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_16 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) > __pyx_t_16) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) : __pyx_t_16;
    __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10);
    __Pyx_GIVEREF(__pyx_t_10);
    PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_10);
    __pyx_t_10 = 0;
    __Pyx_INCREF(__pyx_kp_u__33);
    __pyx_t_6 += 2;
    __Pyx_GIVEREF(__pyx_kp_u__33);
    PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u__33);
    __pyx_t_10 = __Pyx_PyUnicode_Join(__pyx_t_1, 5, __pyx_t_6, __pyx_t_16); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1843, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = __pyx_t_10;
    __pyx_t_10 = 0;
    __Pyx_XGIVEREF(__pyx_t_2);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_3;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_4;
    __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_L12_resume_from_yield:;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_2);
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_4 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1843, __pyx_L1_error)

    /* "mathics/builtin/graphics.py":1841
 * 
 *         def components():
 *             for component in self.components:             # <<<<<<<<<<<<<<
 *                 transformed = [(k, [xy.pos() for xy in p]) for k, p in component]
 *                 yield "fill(%s--cycle, %s);" % ("".join(_asy_bezier(*transformed)), pen)
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "mathics/builtin/graphics.py":1840
 *             pen = "currentpen"
 * 
 *         def components():             # <<<<<<<<<<<<<<
 *             for component in self.components:
 *                 transformed = [(k, [xy.pos() for xy in p]) for k, p in component]
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  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_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_AddTraceback("components", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":1833
 *         )
 * 
 *     def to_asy(self):             # <<<<<<<<<<<<<<
 *         l = self.style.get_line_width(face_element=False)
 *         pen = create_pens(edge_color=self.edge_color, stroke_width=l)
 */

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_14FilledCurveBox_4to_asy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_30_to_asy *__pyx_cur_scope;
  PyObject *__pyx_v_l = NULL;
  PyObject *__pyx_v_components = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_asy", 0);
  __pyx_cur_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_30_to_asy *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_30_to_asy(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_30_to_asy, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_30_to_asy *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1833, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self);

  /* "mathics/builtin/graphics.py":1834
 * 
 *     def to_asy(self):
 *         l = self.style.get_line_width(face_element=False)             # <<<<<<<<<<<<<<
 *         pen = create_pens(edge_color=self.edge_color, stroke_width=l)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_style); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1834, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_get_line_width); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1834, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1834, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_face_element, Py_False) < 0) __PYX_ERR(0, 1834, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1834, __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_v_l = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":1835
 *     def to_asy(self):
 *         l = self.style.get_line_width(face_element=False)
 *         pen = create_pens(edge_color=self.edge_color, stroke_width=l)             # <<<<<<<<<<<<<<
 * 
 *         if not pen:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_create_pens); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1835, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1835, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_edge_color); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1835, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_edge_color, __pyx_t_2) < 0) __PYX_ERR(0, 1835, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_stroke_width, __pyx_v_l) < 0) __PYX_ERR(0, 1835, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1835, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_cur_scope->__pyx_v_pen = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":1837
 *         pen = create_pens(edge_color=self.edge_color, stroke_width=l)
 * 
 *         if not pen:             # <<<<<<<<<<<<<<
 *             pen = "currentpen"
 * 
 */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_pen); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1837, __pyx_L1_error)
  __pyx_t_5 = ((!__pyx_t_4) != 0);
  if (__pyx_t_5) {

    /* "mathics/builtin/graphics.py":1838
 * 
 *         if not pen:
 *             pen = "currentpen"             # <<<<<<<<<<<<<<
 * 
 *         def components():
 */
    __Pyx_INCREF(__pyx_n_u_currentpen);
    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_pen);
    __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_pen, __pyx_n_u_currentpen);
    __Pyx_GIVEREF(__pyx_n_u_currentpen);

    /* "mathics/builtin/graphics.py":1837
 *         pen = create_pens(edge_color=self.edge_color, stroke_width=l)
 * 
 *         if not pen:             # <<<<<<<<<<<<<<
 *             pen = "currentpen"
 * 
 */
  }

  /* "mathics/builtin/graphics.py":1840
 *             pen = "currentpen"
 * 
 *         def components():             # <<<<<<<<<<<<<<
 *             for component in self.components:
 *                 transformed = [(k, [xy.pos() for xy in p]) for k, p in component]
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_14FilledCurveBox_6to_asy_1components, 0, __pyx_n_s_FilledCurveBox_to_asy_locals_com, ((PyObject*)__pyx_cur_scope), __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__64)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1840, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_components = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":1845
 *                 yield "fill(%s--cycle, %s);" % ("".join(_asy_bezier(*transformed)), pen)
 * 
 *         return "".join(components())             # <<<<<<<<<<<<<<
 * 
 *     def extent(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_pf_7mathics_7builtin_8graphics_14FilledCurveBox_6to_asy_components(__pyx_v_components); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1845, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyUnicode_Join(__pyx_kp_u__41, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1845, __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;

  /* "mathics/builtin/graphics.py":1833
 *         )
 * 
 *     def to_asy(self):             # <<<<<<<<<<<<<<
 *         l = self.style.get_line_width(face_element=False)
 *         pen = create_pens(edge_color=self.edge_color, stroke_width=l)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("mathics.builtin.graphics.FilledCurveBox.to_asy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_l);
  __Pyx_XDECREF(__pyx_v_components);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":1847
 *         return "".join(components())
 * 
 *     def extent(self):             # <<<<<<<<<<<<<<
 *         l = self.style.get_line_width(face_element=False)
 *         result = []
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_14FilledCurveBox_7extent(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_14FilledCurveBox_7extent = {"extent", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_14FilledCurveBox_7extent, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_14FilledCurveBox_7extent(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("extent (wrapper)", 0);
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_14FilledCurveBox_6extent(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_14FilledCurveBox_6extent(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_l = NULL;
  PyObject *__pyx_v_result = NULL;
  PyObject *__pyx_v_component = NULL;
  CYTHON_UNUSED PyObject *__pyx_v__ = NULL;
  PyObject *__pyx_v_points = NULL;
  PyObject *__pyx_v_p = NULL;
  PyObject *__pyx_v_x = NULL;
  PyObject *__pyx_v_y = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *(*__pyx_t_11)(PyObject *);
  Py_ssize_t __pyx_t_12;
  PyObject *(*__pyx_t_13)(PyObject *);
  PyObject *__pyx_t_14 = NULL;
  int __pyx_t_15;
  int __pyx_t_16;
  int __pyx_t_17;
  int __pyx_t_18;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("extent", 0);

  /* "mathics/builtin/graphics.py":1848
 * 
 *     def extent(self):
 *         l = self.style.get_line_width(face_element=False)             # <<<<<<<<<<<<<<
 *         result = []
 *         for component in self.components:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_style); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1848, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_get_line_width); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1848, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1848, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_face_element, Py_False) < 0) __PYX_ERR(0, 1848, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1848, __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_v_l = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":1849
 *     def extent(self):
 *         l = self.style.get_line_width(face_element=False)
 *         result = []             # <<<<<<<<<<<<<<
 *         for component in self.components:
 *             for _, points in component:
 */
  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1849, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_result = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":1850
 *         l = self.style.get_line_width(face_element=False)
 *         result = []
 *         for component in self.components:             # <<<<<<<<<<<<<<
 *             for _, points in component:
 *                 for p in points:
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_components); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1850, __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_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1850, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1850, __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))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 1850, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1850, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 1850, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1850, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      }
    } else {
      __pyx_t_3 = __pyx_t_5(__pyx_t_1);
      if (unlikely(!__pyx_t_3)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1850, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_XDECREF_SET(__pyx_v_component, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "mathics/builtin/graphics.py":1851
 *         result = []
 *         for component in self.components:
 *             for _, points in component:             # <<<<<<<<<<<<<<
 *                 for p in points:
 *                     x, y = p.pos()
 */
    if (likely(PyList_CheckExact(__pyx_v_component)) || PyTuple_CheckExact(__pyx_v_component)) {
      __pyx_t_3 = __pyx_v_component; __Pyx_INCREF(__pyx_t_3); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_component); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1851, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_7 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1851, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_7)) {
        if (likely(PyList_CheckExact(__pyx_t_3))) {
          if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 1851, __pyx_L1_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1851, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        } else {
          if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 1851, __pyx_L1_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1851, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        }
      } else {
        __pyx_t_2 = __pyx_t_7(__pyx_t_3);
        if (unlikely(!__pyx_t_2)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 1851, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_2);
      }
      if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
        PyObject* sequence = __pyx_t_2;
        Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          __PYX_ERR(0, 1851, __pyx_L1_error)
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_8 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_9 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_9);
        #else
        __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1851, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1851, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        #endif
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_10 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1851, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_11 = Py_TYPE(__pyx_t_10)->tp_iternext;
        index = 0; __pyx_t_8 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_8)) goto __pyx_L7_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_8);
        index = 1; __pyx_t_9 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_9)) goto __pyx_L7_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_9);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < 0) __PYX_ERR(0, 1851, __pyx_L1_error)
        __pyx_t_11 = NULL;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        goto __pyx_L8_unpacking_done;
        __pyx_L7_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_11 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        __PYX_ERR(0, 1851, __pyx_L1_error)
        __pyx_L8_unpacking_done:;
      }
      __Pyx_XDECREF_SET(__pyx_v__, __pyx_t_8);
      __pyx_t_8 = 0;
      __Pyx_XDECREF_SET(__pyx_v_points, __pyx_t_9);
      __pyx_t_9 = 0;

      /* "mathics/builtin/graphics.py":1852
 *         for component in self.components:
 *             for _, points in component:
 *                 for p in points:             # <<<<<<<<<<<<<<
 *                     x, y = p.pos()
 *                     result.extend(
 */
      if (likely(PyList_CheckExact(__pyx_v_points)) || PyTuple_CheckExact(__pyx_v_points)) {
        __pyx_t_2 = __pyx_v_points; __Pyx_INCREF(__pyx_t_2); __pyx_t_12 = 0;
        __pyx_t_13 = NULL;
      } else {
        __pyx_t_12 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_points); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1852, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_13 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1852, __pyx_L1_error)
      }
      for (;;) {
        if (likely(!__pyx_t_13)) {
          if (likely(PyList_CheckExact(__pyx_t_2))) {
            if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_2)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_9 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_12); __Pyx_INCREF(__pyx_t_9); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 1852, __pyx_L1_error)
            #else
            __pyx_t_9 = PySequence_ITEM(__pyx_t_2, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1852, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_9);
            #endif
          } else {
            if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_12); __Pyx_INCREF(__pyx_t_9); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 1852, __pyx_L1_error)
            #else
            __pyx_t_9 = PySequence_ITEM(__pyx_t_2, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1852, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_9);
            #endif
          }
        } else {
          __pyx_t_9 = __pyx_t_13(__pyx_t_2);
          if (unlikely(!__pyx_t_9)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 1852, __pyx_L1_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_9);
        }
        __Pyx_XDECREF_SET(__pyx_v_p, __pyx_t_9);
        __pyx_t_9 = 0;

        /* "mathics/builtin/graphics.py":1853
 *             for _, points in component:
 *                 for p in points:
 *                     x, y = p.pos()             # <<<<<<<<<<<<<<
 *                     result.extend(
 *                         [(x - l, y - l), (x - l, y + l), (x + l, y - l), (x + l, y + l)]
 */
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_p, __pyx_n_s_pos); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1853, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_10 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
          __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_8);
          if (likely(__pyx_t_10)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
            __Pyx_INCREF(__pyx_t_10);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_8, function);
          }
        }
        __pyx_t_9 = (__pyx_t_10) ? __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_10) : __Pyx_PyObject_CallNoArg(__pyx_t_8);
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1853, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        if ((likely(PyTuple_CheckExact(__pyx_t_9))) || (PyList_CheckExact(__pyx_t_9))) {
          PyObject* sequence = __pyx_t_9;
          Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
          if (unlikely(size != 2)) {
            if (size > 2) __Pyx_RaiseTooManyValuesError(2);
            else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
            __PYX_ERR(0, 1853, __pyx_L1_error)
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          if (likely(PyTuple_CheckExact(sequence))) {
            __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); 
            __pyx_t_10 = PyTuple_GET_ITEM(sequence, 1); 
          } else {
            __pyx_t_8 = PyList_GET_ITEM(sequence, 0); 
            __pyx_t_10 = PyList_GET_ITEM(sequence, 1); 
          }
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(__pyx_t_10);
          #else
          __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1853, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_10 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1853, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          #endif
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        } else {
          Py_ssize_t index = -1;
          __pyx_t_14 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1853, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_14);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_11 = Py_TYPE(__pyx_t_14)->tp_iternext;
          index = 0; __pyx_t_8 = __pyx_t_11(__pyx_t_14); if (unlikely(!__pyx_t_8)) goto __pyx_L11_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_8);
          index = 1; __pyx_t_10 = __pyx_t_11(__pyx_t_14); if (unlikely(!__pyx_t_10)) goto __pyx_L11_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_10);
          if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_14), 2) < 0) __PYX_ERR(0, 1853, __pyx_L1_error)
          __pyx_t_11 = 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_11 = NULL;
          if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
          __PYX_ERR(0, 1853, __pyx_L1_error)
          __pyx_L12_unpacking_done:;
        }
        __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_8);
        __pyx_t_8 = 0;
        __Pyx_XDECREF_SET(__pyx_v_y, __pyx_t_10);
        __pyx_t_10 = 0;

        /* "mathics/builtin/graphics.py":1855
 *                     x, y = p.pos()
 *                     result.extend(
 *                         [(x - l, y - l), (x - l, y + l), (x + l, y - l), (x + l, y + l)]             # <<<<<<<<<<<<<<
 *                     )
 *         return result
 */
        __pyx_t_9 = PyNumber_Subtract(__pyx_v_x, __pyx_v_l); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1855, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_10 = PyNumber_Subtract(__pyx_v_y, __pyx_v_l); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1855, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1855, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GIVEREF(__pyx_t_9);
        PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_10);
        PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_10);
        __pyx_t_9 = 0;
        __pyx_t_10 = 0;

        /* "mathics/builtin/graphics.py":1854
 *                 for p in points:
 *                     x, y = p.pos()
 *                     result.extend(             # <<<<<<<<<<<<<<
 *                         [(x - l, y - l), (x - l, y + l), (x + l, y - l), (x + l, y + l)]
 *                     )
 */
        __pyx_t_15 = __Pyx_ListComp_Append(__pyx_v_result, __pyx_t_8); if (unlikely(__pyx_t_15 == ((int)-1))) __PYX_ERR(0, 1854, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

        /* "mathics/builtin/graphics.py":1855
 *                     x, y = p.pos()
 *                     result.extend(
 *                         [(x - l, y - l), (x - l, y + l), (x + l, y - l), (x + l, y + l)]             # <<<<<<<<<<<<<<
 *                     )
 *         return result
 */
        __pyx_t_8 = PyNumber_Subtract(__pyx_v_x, __pyx_v_l); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1855, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_10 = PyNumber_Add(__pyx_v_y, __pyx_v_l); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1855, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1855, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_8);
        PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8);
        __Pyx_GIVEREF(__pyx_t_10);
        PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_10);
        __pyx_t_8 = 0;
        __pyx_t_10 = 0;

        /* "mathics/builtin/graphics.py":1854
 *                 for p in points:
 *                     x, y = p.pos()
 *                     result.extend(             # <<<<<<<<<<<<<<
 *                         [(x - l, y - l), (x - l, y + l), (x + l, y - l), (x + l, y + l)]
 *                     )
 */
        __pyx_t_16 = __Pyx_ListComp_Append(__pyx_v_result, __pyx_t_9); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(0, 1854, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

        /* "mathics/builtin/graphics.py":1855
 *                     x, y = p.pos()
 *                     result.extend(
 *                         [(x - l, y - l), (x - l, y + l), (x + l, y - l), (x + l, y + l)]             # <<<<<<<<<<<<<<
 *                     )
 *         return result
 */
        __pyx_t_9 = PyNumber_Add(__pyx_v_x, __pyx_v_l); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1855, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_10 = PyNumber_Subtract(__pyx_v_y, __pyx_v_l); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1855, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1855, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GIVEREF(__pyx_t_9);
        PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_10);
        PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_10);
        __pyx_t_9 = 0;
        __pyx_t_10 = 0;

        /* "mathics/builtin/graphics.py":1854
 *                 for p in points:
 *                     x, y = p.pos()
 *                     result.extend(             # <<<<<<<<<<<<<<
 *                         [(x - l, y - l), (x - l, y + l), (x + l, y - l), (x + l, y + l)]
 *                     )
 */
        __pyx_t_17 = __Pyx_ListComp_Append(__pyx_v_result, __pyx_t_8); if (unlikely(__pyx_t_17 == ((int)-1))) __PYX_ERR(0, 1854, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

        /* "mathics/builtin/graphics.py":1855
 *                     x, y = p.pos()
 *                     result.extend(
 *                         [(x - l, y - l), (x - l, y + l), (x + l, y - l), (x + l, y + l)]             # <<<<<<<<<<<<<<
 *                     )
 *         return result
 */
        __pyx_t_8 = PyNumber_Add(__pyx_v_x, __pyx_v_l); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1855, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_10 = PyNumber_Add(__pyx_v_y, __pyx_v_l); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1855, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1855, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_8);
        PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8);
        __Pyx_GIVEREF(__pyx_t_10);
        PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_10);
        __pyx_t_8 = 0;
        __pyx_t_10 = 0;

        /* "mathics/builtin/graphics.py":1854
 *                 for p in points:
 *                     x, y = p.pos()
 *                     result.extend(             # <<<<<<<<<<<<<<
 *                         [(x - l, y - l), (x - l, y + l), (x + l, y - l), (x + l, y + l)]
 *                     )
 */
        __pyx_t_18 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_9); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 1854, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        (void)((__pyx_t_15 | (__pyx_t_16 | (__pyx_t_17 | __pyx_t_18))));

        /* "mathics/builtin/graphics.py":1852
 *         for component in self.components:
 *             for _, points in component:
 *                 for p in points:             # <<<<<<<<<<<<<<
 *                     x, y = p.pos()
 *                     result.extend(
 */
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "mathics/builtin/graphics.py":1851
 *         result = []
 *         for component in self.components:
 *             for _, points in component:             # <<<<<<<<<<<<<<
 *                 for p in points:
 *                     x, y = p.pos()
 */
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "mathics/builtin/graphics.py":1850
 *         l = self.style.get_line_width(face_element=False)
 *         result = []
 *         for component in self.components:             # <<<<<<<<<<<<<<
 *             for _, points in component:
 *                 for p in points:
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1857
 *                         [(x - l, y - l), (x - l, y + l), (x + l, y - l), (x + l, y + l)]
 *                     )
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":1847
 *         return "".join(components())
 * 
 *     def extent(self):             # <<<<<<<<<<<<<<
 *         l = self.style.get_line_width(face_element=False)
 *         result = []
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_AddTraceback("mathics.builtin.graphics.FilledCurveBox.extent", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_l);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_component);
  __Pyx_XDECREF(__pyx_v__);
  __Pyx_XDECREF(__pyx_v_points);
  __Pyx_XDECREF(__pyx_v_p);
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XDECREF(__pyx_v_y);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":1880
 * 
 * class PolygonBox(_Polyline):
 *     def init(self, graphics, style, item=None):             # <<<<<<<<<<<<<<
 *         super(PolygonBox, self).init(graphics, item, style)
 *         self.edge_color, self.face_color = style.get_style(_Color, face_element=True)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_10PolygonBox_1init(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_10PolygonBox_1init = {"init", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_10PolygonBox_1init, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_10PolygonBox_1init(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_graphics = 0;
  PyObject *__pyx_v_style = 0;
  PyObject *__pyx_v_item = 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);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_graphics,&__pyx_n_s_style,&__pyx_n_s_item,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = ((PyObject *)((PyObject *)Py_None));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_graphics)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("init", 0, 3, 4, 1); __PYX_ERR(0, 1880, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_style)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("init", 0, 3, 4, 2); __PYX_ERR(0, 1880, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_item);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "init") < 0)) __PYX_ERR(0, 1880, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_graphics = values[1];
    __pyx_v_style = values[2];
    __pyx_v_item = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("init", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1880, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.PolygonBox.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_10PolygonBox_init(__pyx_self, __pyx_v_self, __pyx_v_graphics, __pyx_v_style, __pyx_v_item);

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_10PolygonBox_init(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_graphics, PyObject *__pyx_v_style, PyObject *__pyx_v_item) {
  PyObject *__pyx_v_points = NULL;
  PyObject *__pyx_v_leaf = NULL;
  PyObject *__pyx_v_name = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *(*__pyx_t_6)(PyObject *);
  int __pyx_t_7;
  int __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  PyObject *(*__pyx_t_10)(PyObject *);
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("init", 0);

  /* "mathics/builtin/graphics.py":1881
 * class PolygonBox(_Polyline):
 *     def init(self, graphics, style, item=None):
 *         super(PolygonBox, self).init(graphics, item, style)             # <<<<<<<<<<<<<<
 *         self.edge_color, self.face_color = style.get_style(_Color, face_element=True)
 *         if item is not None:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PolygonBox); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1881, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1881, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_INCREF(__pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1881, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1881, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_v_graphics, __pyx_v_item, __pyx_v_style};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1881, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_v_graphics, __pyx_v_item, __pyx_v_style};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1881, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1881, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_2) {
      __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
    }
    __Pyx_INCREF(__pyx_v_graphics);
    __Pyx_GIVEREF(__pyx_v_graphics);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_graphics);
    __Pyx_INCREF(__pyx_v_item);
    __Pyx_GIVEREF(__pyx_v_item);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_item);
    __Pyx_INCREF(__pyx_v_style);
    __Pyx_GIVEREF(__pyx_v_style);
    PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_style);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1881, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1882
 *     def init(self, graphics, style, item=None):
 *         super(PolygonBox, self).init(graphics, item, style)
 *         self.edge_color, self.face_color = style.get_style(_Color, face_element=True)             # <<<<<<<<<<<<<<
 *         if item is not None:
 *             if len(item.leaves) not in (1, 2):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_style, __pyx_n_s_get_style); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1882, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Color); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1882, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1882, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1882, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_face_element, Py_True) < 0) __PYX_ERR(0, 1882, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1882, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
    PyObject* sequence = __pyx_t_2;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 1882, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_5);
    #else
    __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1882, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1882, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    #endif
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1882, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_6 = Py_TYPE(__pyx_t_1)->tp_iternext;
    index = 0; __pyx_t_3 = __pyx_t_6(__pyx_t_1); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 1; __pyx_t_5 = __pyx_t_6(__pyx_t_1); if (unlikely(!__pyx_t_5)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_1), 2) < 0) __PYX_ERR(0, 1882, __pyx_L1_error)
    __pyx_t_6 = NULL;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_6 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 1882, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_edge_color, __pyx_t_3) < 0) __PYX_ERR(0, 1882, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_face_color, __pyx_t_5) < 0) __PYX_ERR(0, 1882, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":1883
 *         super(PolygonBox, self).init(graphics, item, style)
 *         self.edge_color, self.face_color = style.get_style(_Color, face_element=True)
 *         if item is not None:             # <<<<<<<<<<<<<<
 *             if len(item.leaves) not in (1, 2):
 *                 raise BoxConstructError
 */
  __pyx_t_7 = (__pyx_v_item != Py_None);
  __pyx_t_8 = (__pyx_t_7 != 0);
  if (likely(__pyx_t_8)) {

    /* "mathics/builtin/graphics.py":1884
 *         self.edge_color, self.face_color = style.get_style(_Color, face_element=True)
 *         if item is not None:
 *             if len(item.leaves) not in (1, 2):             # <<<<<<<<<<<<<<
 *                 raise BoxConstructError
 *             points = item.leaves[0]
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_item, __pyx_n_s_leaves); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1884, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_9 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1884, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_7 = ((__pyx_t_9 != 1) != 0);
    if (__pyx_t_7) {
    } else {
      __pyx_t_8 = __pyx_t_7;
      goto __pyx_L7_bool_binop_done;
    }
    __pyx_t_7 = ((__pyx_t_9 != 2) != 0);
    __pyx_t_8 = __pyx_t_7;
    __pyx_L7_bool_binop_done:;
    __pyx_t_7 = (__pyx_t_8 != 0);
    if (unlikely(__pyx_t_7)) {

      /* "mathics/builtin/graphics.py":1885
 *         if item is not None:
 *             if len(item.leaves) not in (1, 2):
 *                 raise BoxConstructError             # <<<<<<<<<<<<<<
 *             points = item.leaves[0]
 *             self.do_init(graphics, points)
 */
      __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_BoxConstructError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1885, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(0, 1885, __pyx_L1_error)

      /* "mathics/builtin/graphics.py":1884
 *         self.edge_color, self.face_color = style.get_style(_Color, face_element=True)
 *         if item is not None:
 *             if len(item.leaves) not in (1, 2):             # <<<<<<<<<<<<<<
 *                 raise BoxConstructError
 *             points = item.leaves[0]
 */
    }

    /* "mathics/builtin/graphics.py":1886
 *             if len(item.leaves) not in (1, 2):
 *                 raise BoxConstructError
 *             points = item.leaves[0]             # <<<<<<<<<<<<<<
 *             self.do_init(graphics, points)
 *             self.vertex_colors = None
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_item, __pyx_n_s_leaves); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1886, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1886, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_points = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "mathics/builtin/graphics.py":1887
 *                 raise BoxConstructError
 *             points = item.leaves[0]
 *             self.do_init(graphics, points)             # <<<<<<<<<<<<<<
 *             self.vertex_colors = None
 *             for leaf in item.leaves[1:]:
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_do_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1887, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    __pyx_t_4 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_4 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_graphics, __pyx_v_points};
      __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1887, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_5);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_graphics, __pyx_v_points};
      __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1887, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_5);
    } else
    #endif
    {
      __pyx_t_1 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1887, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (__pyx_t_3) {
        __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); __pyx_t_3 = NULL;
      }
      __Pyx_INCREF(__pyx_v_graphics);
      __Pyx_GIVEREF(__pyx_v_graphics);
      PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_4, __pyx_v_graphics);
      __Pyx_INCREF(__pyx_v_points);
      __Pyx_GIVEREF(__pyx_v_points);
      PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_4, __pyx_v_points);
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1887, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "mathics/builtin/graphics.py":1888
 *             points = item.leaves[0]
 *             self.do_init(graphics, points)
 *             self.vertex_colors = None             # <<<<<<<<<<<<<<
 *             for leaf in item.leaves[1:]:
 *                 if not leaf.has_form("Rule", 2):
 */
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_vertex_colors, Py_None) < 0) __PYX_ERR(0, 1888, __pyx_L1_error)

    /* "mathics/builtin/graphics.py":1889
 *             self.do_init(graphics, points)
 *             self.vertex_colors = None
 *             for leaf in item.leaves[1:]:             # <<<<<<<<<<<<<<
 *                 if not leaf.has_form("Rule", 2):
 *                     raise BoxConstructError
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_item, __pyx_n_s_leaves); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1889, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_t_5, 1, 0, NULL, NULL, &__pyx_slice__13, 1, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1889, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
      __pyx_t_5 = __pyx_t_2; __Pyx_INCREF(__pyx_t_5); __pyx_t_9 = 0;
      __pyx_t_10 = NULL;
    } else {
      __pyx_t_9 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1889, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_10 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1889, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    for (;;) {
      if (likely(!__pyx_t_10)) {
        if (likely(PyList_CheckExact(__pyx_t_5))) {
          if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_5)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_9); __Pyx_INCREF(__pyx_t_2); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 1889, __pyx_L1_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_5, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1889, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        } else {
          if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_9); __Pyx_INCREF(__pyx_t_2); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 1889, __pyx_L1_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_5, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1889, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        }
      } else {
        __pyx_t_2 = __pyx_t_10(__pyx_t_5);
        if (unlikely(!__pyx_t_2)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 1889, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_XDECREF_SET(__pyx_v_leaf, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "mathics/builtin/graphics.py":1890
 *             self.vertex_colors = None
 *             for leaf in item.leaves[1:]:
 *                 if not leaf.has_form("Rule", 2):             # <<<<<<<<<<<<<<
 *                     raise BoxConstructError
 *                 name = leaf.leaves[0].get_name()
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_leaf, __pyx_n_s_has_form); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1890, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__65, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1890, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 1890, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_8 = ((!__pyx_t_7) != 0);
      if (unlikely(__pyx_t_8)) {

        /* "mathics/builtin/graphics.py":1891
 *             for leaf in item.leaves[1:]:
 *                 if not leaf.has_form("Rule", 2):
 *                     raise BoxConstructError             # <<<<<<<<<<<<<<
 *                 name = leaf.leaves[0].get_name()
 *                 self.process_option(name, leaf.leaves[1])
 */
        __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_BoxConstructError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1891, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_Raise(__pyx_t_1, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __PYX_ERR(0, 1891, __pyx_L1_error)

        /* "mathics/builtin/graphics.py":1890
 *             self.vertex_colors = None
 *             for leaf in item.leaves[1:]:
 *                 if not leaf.has_form("Rule", 2):             # <<<<<<<<<<<<<<
 *                     raise BoxConstructError
 *                 name = leaf.leaves[0].get_name()
 */
      }

      /* "mathics/builtin/graphics.py":1892
 *                 if not leaf.has_form("Rule", 2):
 *                     raise BoxConstructError
 *                 name = leaf.leaves[0].get_name()             # <<<<<<<<<<<<<<
 *                 self.process_option(name, leaf.leaves[1])
 *         else:
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_leaf, __pyx_n_s_leaves); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1892, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1892, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_get_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1892, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1892, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "mathics/builtin/graphics.py":1893
 *                     raise BoxConstructError
 *                 name = leaf.leaves[0].get_name()
 *                 self.process_option(name, leaf.leaves[1])             # <<<<<<<<<<<<<<
 *         else:
 *             raise BoxConstructError
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_process_option); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1893, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_leaf, __pyx_n_s_leaves); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1893, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_11 = __Pyx_GetItemInt(__pyx_t_3, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1893, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = NULL;
      __pyx_t_4 = 0;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
          __pyx_t_4 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_2)) {
        PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_name, __pyx_t_11};
        __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1893, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
        PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_name, __pyx_t_11};
        __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1893, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      } else
      #endif
      {
        __pyx_t_12 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1893, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        if (__pyx_t_3) {
          __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_3); __pyx_t_3 = NULL;
        }
        __Pyx_INCREF(__pyx_v_name);
        __Pyx_GIVEREF(__pyx_v_name);
        PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_4, __pyx_v_name);
        __Pyx_GIVEREF(__pyx_t_11);
        PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_4, __pyx_t_11);
        __pyx_t_11 = 0;
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_12, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1893, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "mathics/builtin/graphics.py":1889
 *             self.do_init(graphics, points)
 *             self.vertex_colors = None
 *             for leaf in item.leaves[1:]:             # <<<<<<<<<<<<<<
 *                 if not leaf.has_form("Rule", 2):
 *                     raise BoxConstructError
 */
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "mathics/builtin/graphics.py":1883
 *         super(PolygonBox, self).init(graphics, item, style)
 *         self.edge_color, self.face_color = style.get_style(_Color, face_element=True)
 *         if item is not None:             # <<<<<<<<<<<<<<
 *             if len(item.leaves) not in (1, 2):
 *                 raise BoxConstructError
 */
    goto __pyx_L5;
  }

  /* "mathics/builtin/graphics.py":1895
 *                 self.process_option(name, leaf.leaves[1])
 *         else:
 *             raise BoxConstructError             # <<<<<<<<<<<<<<
 * 
 *     def process_option(self, name, value):
 */
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_BoxConstructError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1895, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __PYX_ERR(0, 1895, __pyx_L1_error)
  }
  __pyx_L5:;

  /* "mathics/builtin/graphics.py":1880
 * 
 * class PolygonBox(_Polyline):
 *     def init(self, graphics, style, item=None):             # <<<<<<<<<<<<<<
 *         super(PolygonBox, self).init(graphics, item, style)
 *         self.edge_color, self.face_color = style.get_style(_Color, face_element=True)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("mathics.builtin.graphics.PolygonBox.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_points);
  __Pyx_XDECREF(__pyx_v_leaf);
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":1897
 *             raise BoxConstructError
 * 
 *     def process_option(self, name, value):             # <<<<<<<<<<<<<<
 *         if name == "System`VertexColors":
 *             if not value.has_form("List", None):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_10PolygonBox_3process_option(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_10PolygonBox_3process_option = {"process_option", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_10PolygonBox_3process_option, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_10PolygonBox_3process_option(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("process_option (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_name,&__pyx_n_s_value,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("process_option", 1, 3, 3, 1); __PYX_ERR(0, 1897, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("process_option", 1, 3, 3, 2); __PYX_ERR(0, 1897, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "process_option") < 0)) __PYX_ERR(0, 1897, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_self = values[0];
    __pyx_v_name = values[1];
    __pyx_v_value = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("process_option", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1897, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.PolygonBox.process_option", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_10PolygonBox_2process_option(__pyx_self, __pyx_v_self, __pyx_v_name, __pyx_v_value);

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_10PolygonBox_2process_option(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value) {
  PyObject *__pyx_v_black = NULL;
  PyObject *__pyx_v_colors = NULL;
  PyObject *__pyx_v_line_index = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_line = NULL;
  PyObject *__pyx_v_line_colors = NULL;
  PyObject *__pyx_v_index = NULL;
  PyObject *__pyx_v_color = NULL;
  PyObject *__pyx_9genexpr32__pyx_v_line = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  Py_ssize_t __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *(*__pyx_t_11)(PyObject *);
  PyObject *__pyx_t_12 = NULL;
  Py_ssize_t __pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  int __pyx_t_19;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("process_option", 0);

  /* "mathics/builtin/graphics.py":1898
 * 
 *     def process_option(self, name, value):
 *         if name == "System`VertexColors":             # <<<<<<<<<<<<<<
 *             if not value.has_form("List", None):
 *                 raise BoxConstructError
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_name, __pyx_kp_u_System_VertexColors, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1898, __pyx_L1_error)
  if (likely(__pyx_t_1)) {

    /* "mathics/builtin/graphics.py":1899
 *     def process_option(self, name, value):
 *         if name == "System`VertexColors":
 *             if not value.has_form("List", None):             # <<<<<<<<<<<<<<
 *                 raise BoxConstructError
 *             black = RGBColor(components=[0, 0, 0, 1])
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_has_form); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1899, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1899, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1899, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_4 = ((!__pyx_t_1) != 0);
    if (unlikely(__pyx_t_4)) {

      /* "mathics/builtin/graphics.py":1900
 *         if name == "System`VertexColors":
 *             if not value.has_form("List", None):
 *                 raise BoxConstructError             # <<<<<<<<<<<<<<
 *             black = RGBColor(components=[0, 0, 0, 1])
 *             self.vertex_colors = [[black] * len(line) for line in self.lines]
 */
      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_BoxConstructError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1900, __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(0, 1900, __pyx_L1_error)

      /* "mathics/builtin/graphics.py":1899
 *     def process_option(self, name, value):
 *         if name == "System`VertexColors":
 *             if not value.has_form("List", None):             # <<<<<<<<<<<<<<
 *                 raise BoxConstructError
 *             black = RGBColor(components=[0, 0, 0, 1])
 */
    }

    /* "mathics/builtin/graphics.py":1901
 *             if not value.has_form("List", None):
 *                 raise BoxConstructError
 *             black = RGBColor(components=[0, 0, 0, 1])             # <<<<<<<<<<<<<<
 *             self.vertex_colors = [[black] * len(line) for line in self.lines]
 *             colors = value.leaves
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_RGBColor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1901, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1901, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = PyList_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1901, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_int_0);
    __Pyx_GIVEREF(__pyx_int_0);
    PyList_SET_ITEM(__pyx_t_5, 0, __pyx_int_0);
    __Pyx_INCREF(__pyx_int_0);
    __Pyx_GIVEREF(__pyx_int_0);
    PyList_SET_ITEM(__pyx_t_5, 1, __pyx_int_0);
    __Pyx_INCREF(__pyx_int_0);
    __Pyx_GIVEREF(__pyx_int_0);
    PyList_SET_ITEM(__pyx_t_5, 2, __pyx_int_0);
    __Pyx_INCREF(__pyx_int_1);
    __Pyx_GIVEREF(__pyx_int_1);
    PyList_SET_ITEM(__pyx_t_5, 3, __pyx_int_1);
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_components, __pyx_t_5) < 0) __PYX_ERR(0, 1901, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1901, __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_v_black = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "mathics/builtin/graphics.py":1902
 *                 raise BoxConstructError
 *             black = RGBColor(components=[0, 0, 0, 1])
 *             self.vertex_colors = [[black] * len(line) for line in self.lines]             # <<<<<<<<<<<<<<
 *             colors = value.leaves
 *             if not self.multi_parts:
 */
    { /* enter inner scope */
      __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1902, __pyx_L7_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lines); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1902, __pyx_L7_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
        __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_6 = 0;
        __pyx_t_7 = NULL;
      } else {
        __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1902, __pyx_L7_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_7 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1902, __pyx_L7_error)
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      for (;;) {
        if (likely(!__pyx_t_7)) {
          if (likely(PyList_CheckExact(__pyx_t_3))) {
            if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_3)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 1902, __pyx_L7_error)
            #else
            __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1902, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_2);
            #endif
          } else {
            if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 1902, __pyx_L7_error)
            #else
            __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1902, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_2);
            #endif
          }
        } else {
          __pyx_t_2 = __pyx_t_7(__pyx_t_3);
          if (unlikely(!__pyx_t_2)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 1902, __pyx_L7_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_2);
        }
        __Pyx_XDECREF_SET(__pyx_9genexpr32__pyx_v_line, __pyx_t_2);
        __pyx_t_2 = 0;
        __pyx_t_8 = PyObject_Length(__pyx_9genexpr32__pyx_v_line); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1902, __pyx_L7_error)
        __pyx_t_2 = PyList_New(1 * ((__pyx_t_8<0) ? 0:__pyx_t_8)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1902, __pyx_L7_error)
        __Pyx_GOTREF(__pyx_t_2);
        { Py_ssize_t __pyx_temp;
          for (__pyx_temp=0; __pyx_temp < __pyx_t_8; __pyx_temp++) {
            __Pyx_INCREF(__pyx_v_black);
            __Pyx_GIVEREF(__pyx_v_black);
            PyList_SET_ITEM(__pyx_t_2, __pyx_temp, __pyx_v_black);
          }
        }
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 1902, __pyx_L7_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_9genexpr32__pyx_v_line); __pyx_9genexpr32__pyx_v_line = 0;
      goto __pyx_L10_exit_scope;
      __pyx_L7_error:;
      __Pyx_XDECREF(__pyx_9genexpr32__pyx_v_line); __pyx_9genexpr32__pyx_v_line = 0;
      goto __pyx_L1_error;
      __pyx_L10_exit_scope:;
    } /* exit inner scope */
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_vertex_colors, __pyx_t_5) < 0) __PYX_ERR(0, 1902, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "mathics/builtin/graphics.py":1903
 *             black = RGBColor(components=[0, 0, 0, 1])
 *             self.vertex_colors = [[black] * len(line) for line in self.lines]
 *             colors = value.leaves             # <<<<<<<<<<<<<<
 *             if not self.multi_parts:
 *                 colors = [Expression("List", *colors)]
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_leaves); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1903, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_v_colors = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "mathics/builtin/graphics.py":1904
 *             self.vertex_colors = [[black] * len(line) for line in self.lines]
 *             colors = value.leaves
 *             if not self.multi_parts:             # <<<<<<<<<<<<<<
 *                 colors = [Expression("List", *colors)]
 *             for line_index, line in enumerate(self.lines):
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_multi_parts); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1904, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1904, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_1 = ((!__pyx_t_4) != 0);
    if (__pyx_t_1) {

      /* "mathics/builtin/graphics.py":1905
 *             colors = value.leaves
 *             if not self.multi_parts:
 *                 colors = [Expression("List", *colors)]             # <<<<<<<<<<<<<<
 *             for line_index, line in enumerate(self.lines):
 *                 if line_index >= len(colors):
 */
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Expression); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1905, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_v_colors); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1905, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = PyNumber_Add(__pyx_tuple__11, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1905, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1905, __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_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1905, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_3);
      PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_DECREF_SET(__pyx_v_colors, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "mathics/builtin/graphics.py":1904
 *             self.vertex_colors = [[black] * len(line) for line in self.lines]
 *             colors = value.leaves
 *             if not self.multi_parts:             # <<<<<<<<<<<<<<
 *                 colors = [Expression("List", *colors)]
 *             for line_index, line in enumerate(self.lines):
 */
    }

    /* "mathics/builtin/graphics.py":1906
 *             if not self.multi_parts:
 *                 colors = [Expression("List", *colors)]
 *             for line_index, line in enumerate(self.lines):             # <<<<<<<<<<<<<<
 *                 if line_index >= len(colors):
 *                     break
 */
    __Pyx_INCREF(__pyx_int_0);
    __pyx_t_2 = __pyx_int_0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lines); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1906, __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_6 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1906, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_7 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1906, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    for (;;) {
      if (likely(!__pyx_t_7)) {
        if (likely(PyList_CheckExact(__pyx_t_5))) {
          if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_5)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 1906, __pyx_L1_error)
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1906, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        } else {
          if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 1906, __pyx_L1_error)
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1906, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        }
      } else {
        __pyx_t_3 = __pyx_t_7(__pyx_t_5);
        if (unlikely(!__pyx_t_3)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 1906, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_XDECREF_SET(__pyx_v_line, __pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_XDECREF_SET(__pyx_v_line_index, __pyx_t_2);
      __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_t_2, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1906, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2);
      __pyx_t_2 = __pyx_t_3;
      __pyx_t_3 = 0;

      /* "mathics/builtin/graphics.py":1907
 *                 colors = [Expression("List", *colors)]
 *             for line_index, line in enumerate(self.lines):
 *                 if line_index >= len(colors):             # <<<<<<<<<<<<<<
 *                     break
 *                 line_colors = colors[line_index]
 */
      __pyx_t_8 = PyObject_Length(__pyx_v_colors); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1907, __pyx_L1_error)
      __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1907, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_9 = PyObject_RichCompare(__pyx_v_line_index, __pyx_t_3, Py_GE); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1907, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1907, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (__pyx_t_1) {

        /* "mathics/builtin/graphics.py":1908
 *             for line_index, line in enumerate(self.lines):
 *                 if line_index >= len(colors):
 *                     break             # <<<<<<<<<<<<<<
 *                 line_colors = colors[line_index]
 *                 if not line_colors.has_form("List", None):
 */
        goto __pyx_L13_break;

        /* "mathics/builtin/graphics.py":1907
 *                 colors = [Expression("List", *colors)]
 *             for line_index, line in enumerate(self.lines):
 *                 if line_index >= len(colors):             # <<<<<<<<<<<<<<
 *                     break
 *                 line_colors = colors[line_index]
 */
      }

      /* "mathics/builtin/graphics.py":1909
 *                 if line_index >= len(colors):
 *                     break
 *                 line_colors = colors[line_index]             # <<<<<<<<<<<<<<
 *                 if not line_colors.has_form("List", None):
 *                     continue
 */
      __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_v_colors, __pyx_v_line_index); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1909, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_XDECREF_SET(__pyx_v_line_colors, __pyx_t_9);
      __pyx_t_9 = 0;

      /* "mathics/builtin/graphics.py":1910
 *                     break
 *                 line_colors = colors[line_index]
 *                 if not line_colors.has_form("List", None):             # <<<<<<<<<<<<<<
 *                     continue
 *                 for index, color in enumerate(line_colors.leaves):
 */
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_line_colors, __pyx_n_s_has_form); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1910, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1910, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1910, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_4 = ((!__pyx_t_1) != 0);
      if (__pyx_t_4) {

        /* "mathics/builtin/graphics.py":1911
 *                 line_colors = colors[line_index]
 *                 if not line_colors.has_form("List", None):
 *                     continue             # <<<<<<<<<<<<<<
 *                 for index, color in enumerate(line_colors.leaves):
 *                     if index >= len(self.vertex_colors[line_index]):
 */
        goto __pyx_L12_continue;

        /* "mathics/builtin/graphics.py":1910
 *                     break
 *                 line_colors = colors[line_index]
 *                 if not line_colors.has_form("List", None):             # <<<<<<<<<<<<<<
 *                     continue
 *                 for index, color in enumerate(line_colors.leaves):
 */
      }

      /* "mathics/builtin/graphics.py":1912
 *                 if not line_colors.has_form("List", None):
 *                     continue
 *                 for index, color in enumerate(line_colors.leaves):             # <<<<<<<<<<<<<<
 *                     if index >= len(self.vertex_colors[line_index]):
 *                         break
 */
      __Pyx_INCREF(__pyx_int_0);
      __pyx_t_3 = __pyx_int_0;
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_line_colors, __pyx_n_s_leaves); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1912, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      if (likely(PyList_CheckExact(__pyx_t_9)) || PyTuple_CheckExact(__pyx_t_9)) {
        __pyx_t_10 = __pyx_t_9; __Pyx_INCREF(__pyx_t_10); __pyx_t_8 = 0;
        __pyx_t_11 = NULL;
      } else {
        __pyx_t_8 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1912, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_11 = Py_TYPE(__pyx_t_10)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1912, __pyx_L1_error)
      }
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      for (;;) {
        if (likely(!__pyx_t_11)) {
          if (likely(PyList_CheckExact(__pyx_t_10))) {
            if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_10)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_9 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_8); __Pyx_INCREF(__pyx_t_9); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 1912, __pyx_L1_error)
            #else
            __pyx_t_9 = PySequence_ITEM(__pyx_t_10, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1912, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_9);
            #endif
          } else {
            if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_10)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_8); __Pyx_INCREF(__pyx_t_9); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 1912, __pyx_L1_error)
            #else
            __pyx_t_9 = PySequence_ITEM(__pyx_t_10, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1912, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_9);
            #endif
          }
        } else {
          __pyx_t_9 = __pyx_t_11(__pyx_t_10);
          if (unlikely(!__pyx_t_9)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 1912, __pyx_L1_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_9);
        }
        __Pyx_XDECREF_SET(__pyx_v_color, __pyx_t_9);
        __pyx_t_9 = 0;
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_3);
        __pyx_t_9 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1912, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_3);
        __pyx_t_3 = __pyx_t_9;
        __pyx_t_9 = 0;

        /* "mathics/builtin/graphics.py":1913
 *                     continue
 *                 for index, color in enumerate(line_colors.leaves):
 *                     if index >= len(self.vertex_colors[line_index]):             # <<<<<<<<<<<<<<
 *                         break
 *                     try:
 */
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_vertex_colors); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1913, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_12 = __Pyx_PyObject_GetItem(__pyx_t_9, __pyx_v_line_index); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1913, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_13 = PyObject_Length(__pyx_t_12); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1913, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = PyInt_FromSsize_t(__pyx_t_13); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1913, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_9 = PyObject_RichCompare(__pyx_v_index, __pyx_t_12, Py_GE); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1913, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1913, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (__pyx_t_4) {

          /* "mathics/builtin/graphics.py":1914
 *                 for index, color in enumerate(line_colors.leaves):
 *                     if index >= len(self.vertex_colors[line_index]):
 *                         break             # <<<<<<<<<<<<<<
 *                     try:
 *                         self.vertex_colors[line_index][index] = _Color.create(color)
 */
          goto __pyx_L17_break;

          /* "mathics/builtin/graphics.py":1913
 *                     continue
 *                 for index, color in enumerate(line_colors.leaves):
 *                     if index >= len(self.vertex_colors[line_index]):             # <<<<<<<<<<<<<<
 *                         break
 *                     try:
 */
        }

        /* "mathics/builtin/graphics.py":1915
 *                     if index >= len(self.vertex_colors[line_index]):
 *                         break
 *                     try:             # <<<<<<<<<<<<<<
 *                         self.vertex_colors[line_index][index] = _Color.create(color)
 *                     except ColorError:
 */
        {
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __Pyx_ExceptionSave(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_14);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          /*try:*/ {

            /* "mathics/builtin/graphics.py":1916
 *                         break
 *                     try:
 *                         self.vertex_colors[line_index][index] = _Color.create(color)             # <<<<<<<<<<<<<<
 *                     except ColorError:
 *                         continue
 */
            __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_Color); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1916, __pyx_L19_error)
            __Pyx_GOTREF(__pyx_t_12);
            __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_create); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1916, __pyx_L19_error)
            __Pyx_GOTREF(__pyx_t_17);
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            __pyx_t_12 = NULL;
            if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_17))) {
              __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_17);
              if (likely(__pyx_t_12)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17);
                __Pyx_INCREF(__pyx_t_12);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_17, function);
              }
            }
            __pyx_t_9 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_17, __pyx_t_12, __pyx_v_color) : __Pyx_PyObject_CallOneArg(__pyx_t_17, __pyx_v_color);
            __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
            if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1916, __pyx_L19_error)
            __Pyx_GOTREF(__pyx_t_9);
            __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
            __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_vertex_colors); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1916, __pyx_L19_error)
            __Pyx_GOTREF(__pyx_t_17);
            __pyx_t_12 = __Pyx_PyObject_GetItem(__pyx_t_17, __pyx_v_line_index); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1916, __pyx_L19_error)
            __Pyx_GOTREF(__pyx_t_12);
            __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
            if (unlikely(PyObject_SetItem(__pyx_t_12, __pyx_v_index, __pyx_t_9) < 0)) __PYX_ERR(0, 1916, __pyx_L19_error)
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

            /* "mathics/builtin/graphics.py":1915
 *                     if index >= len(self.vertex_colors[line_index]):
 *                         break
 *                     try:             # <<<<<<<<<<<<<<
 *                         self.vertex_colors[line_index][index] = _Color.create(color)
 *                     except ColorError:
 */
          }
          __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
          __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
          goto __pyx_L26_try_end;
          __pyx_L19_error:;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

          /* "mathics/builtin/graphics.py":1917
 *                     try:
 *                         self.vertex_colors[line_index][index] = _Color.create(color)
 *                     except ColorError:             # <<<<<<<<<<<<<<
 *                         continue
 *         else:
 */
          __Pyx_ErrFetch(&__pyx_t_9, &__pyx_t_12, &__pyx_t_17);
          __Pyx_GetModuleGlobalName(__pyx_t_18, __pyx_n_s_ColorError); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1917, __pyx_L21_except_error)
          __Pyx_GOTREF(__pyx_t_18);
          __pyx_t_19 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_9, __pyx_t_18);
          __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
          __Pyx_ErrRestore(__pyx_t_9, __pyx_t_12, __pyx_t_17);
          __pyx_t_9 = 0; __pyx_t_12 = 0; __pyx_t_17 = 0;
          if (__pyx_t_19) {
            __Pyx_AddTraceback("mathics.builtin.graphics.PolygonBox.process_option", __pyx_clineno, __pyx_lineno, __pyx_filename);
            if (__Pyx_GetException(&__pyx_t_17, &__pyx_t_12, &__pyx_t_9) < 0) __PYX_ERR(0, 1917, __pyx_L21_except_error)
            __Pyx_GOTREF(__pyx_t_17);
            __Pyx_GOTREF(__pyx_t_12);
            __Pyx_GOTREF(__pyx_t_9);

            /* "mathics/builtin/graphics.py":1918
 *                         self.vertex_colors[line_index][index] = _Color.create(color)
 *                     except ColorError:
 *                         continue             # <<<<<<<<<<<<<<
 *         else:
 *             raise BoxConstructError
 */
            goto __pyx_L28_except_continue;
            __pyx_L28_except_continue:;
            __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
            goto __pyx_L25_try_continue;
          }
          goto __pyx_L21_except_error;
          __pyx_L21_except_error:;

          /* "mathics/builtin/graphics.py":1915
 *                     if index >= len(self.vertex_colors[line_index]):
 *                         break
 *                     try:             # <<<<<<<<<<<<<<
 *                         self.vertex_colors[line_index][index] = _Color.create(color)
 *                     except ColorError:
 */
          __Pyx_XGIVEREF(__pyx_t_14);
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16);
          goto __pyx_L1_error;
          __pyx_L25_try_continue:;
          __Pyx_XGIVEREF(__pyx_t_14);
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16);
          goto __pyx_L16_continue;
          __pyx_L26_try_end:;
        }

        /* "mathics/builtin/graphics.py":1912
 *                 if not line_colors.has_form("List", None):
 *                     continue
 *                 for index, color in enumerate(line_colors.leaves):             # <<<<<<<<<<<<<<
 *                     if index >= len(self.vertex_colors[line_index]):
 *                         break
 */
        __pyx_L16_continue:;
      }
      __pyx_L17_break:;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "mathics/builtin/graphics.py":1906
 *             if not self.multi_parts:
 *                 colors = [Expression("List", *colors)]
 *             for line_index, line in enumerate(self.lines):             # <<<<<<<<<<<<<<
 *                 if line_index >= len(colors):
 *                     break
 */
      __pyx_L12_continue:;
    }
    __pyx_L13_break:;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "mathics/builtin/graphics.py":1898
 * 
 *     def process_option(self, name, value):
 *         if name == "System`VertexColors":             # <<<<<<<<<<<<<<
 *             if not value.has_form("List", None):
 *                 raise BoxConstructError
 */
    goto __pyx_L3;
  }

  /* "mathics/builtin/graphics.py":1920
 *                         continue
 *         else:
 *             raise BoxConstructError             # <<<<<<<<<<<<<<
 * 
 *     def to_svg(self):
 */
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_BoxConstructError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1920, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 1920, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "mathics/builtin/graphics.py":1897
 *             raise BoxConstructError
 * 
 *     def process_option(self, name, value):             # <<<<<<<<<<<<<<
 *         if name == "System`VertexColors":
 *             if not value.has_form("List", None):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_XDECREF(__pyx_t_18);
  __Pyx_AddTraceback("mathics.builtin.graphics.PolygonBox.process_option", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_black);
  __Pyx_XDECREF(__pyx_v_colors);
  __Pyx_XDECREF(__pyx_v_line_index);
  __Pyx_XDECREF(__pyx_v_line);
  __Pyx_XDECREF(__pyx_v_line_colors);
  __Pyx_XDECREF(__pyx_v_index);
  __Pyx_XDECREF(__pyx_v_color);
  __Pyx_XDECREF(__pyx_9genexpr32__pyx_v_line);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":1922
 *             raise BoxConstructError
 * 
 *     def to_svg(self):             # <<<<<<<<<<<<<<
 *         l = self.style.get_line_width(face_element=True)
 *         if self.vertex_colors is None:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_10PolygonBox_5to_svg(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_10PolygonBox_5to_svg = {"to_svg", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_10PolygonBox_5to_svg, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_10PolygonBox_5to_svg(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_svg (wrapper)", 0);
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_10PolygonBox_4to_svg(__pyx_self, ((PyObject *)__pyx_v_self));

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

/* "mathics/builtin/graphics.py":1943
 *         for line in self.lines:
 *             svg += '<polygon points="%s" style="%s" />' % (
 *                 " ".join("%f,%f" % coords.pos() for coords in line),             # <<<<<<<<<<<<<<
 *                 style,
 *             )
 */

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_10PolygonBox_6to_svg_genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_33_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_33_genexpr *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_33_genexpr(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_33_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_33_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1943, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_32_to_svg *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7mathics_7builtin_8graphics_10PolygonBox_6to_svg_2generator24, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_PolygonBox_to_svg_locals_genexpr, __pyx_n_s_mathics_builtin_graphics); if (unlikely(!gen)) __PYX_ERR(0, 1943, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.PolygonBox.to_svg.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_7mathics_7builtin_8graphics_10PolygonBox_6to_svg_2generator24(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_33_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_33_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1943, __pyx_L1_error)
  __pyx_r = PyList_New(0); if (unlikely(!__pyx_r)) __PYX_ERR(0, 1943, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_line)) { __Pyx_RaiseClosureNameError("line"); __PYX_ERR(0, 1943, __pyx_L1_error) }
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_line)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_line)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_line; __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_outer_scope->__pyx_v_line); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1943, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1943, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 1943, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1943, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 1943, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1943, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1943, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_coords);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_coords, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_coords, __pyx_n_s_pos); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1943, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1943, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_f_f, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1943, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(__Pyx_ListComp_Append(__pyx_r, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 1943, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

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

/* "mathics/builtin/graphics.py":1922
 *             raise BoxConstructError
 * 
 *     def to_svg(self):             # <<<<<<<<<<<<<<
 *         l = self.style.get_line_width(face_element=True)
 *         if self.vertex_colors is None:
 */

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_10PolygonBox_4to_svg(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_32_to_svg *__pyx_cur_scope;
  PyObject *__pyx_v_l = NULL;
  PyObject *__pyx_v_face_color = NULL;
  PyObject *__pyx_v_style = NULL;
  PyObject *__pyx_v_svg = NULL;
  PyObject *__pyx_v_mesh = NULL;
  PyObject *__pyx_v_index = NULL;
  PyObject *__pyx_v_data = NULL;
  PyObject *__pyx_9genexpr33__pyx_v_coords = NULL;
  PyObject *__pyx_9genexpr33__pyx_v_color = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  Py_ssize_t __pyx_t_10;
  PyObject *(*__pyx_t_11)(PyObject *);
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *(*__pyx_t_15)(PyObject *);
  int __pyx_t_16;
  Py_UCS4 __pyx_t_17;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_svg", 0);
  __pyx_cur_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_32_to_svg *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_32_to_svg(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_32_to_svg, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_32_to_svg *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1922, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }

  /* "mathics/builtin/graphics.py":1923
 * 
 *     def to_svg(self):
 *         l = self.style.get_line_width(face_element=True)             # <<<<<<<<<<<<<<
 *         if self.vertex_colors is None:
 *             face_color = self.face_color
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_style); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1923, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_get_line_width); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1923, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1923, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_face_element, Py_True) < 0) __PYX_ERR(0, 1923, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1923, __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_v_l = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":1924
 *     def to_svg(self):
 *         l = self.style.get_line_width(face_element=True)
 *         if self.vertex_colors is None:             # <<<<<<<<<<<<<<
 *             face_color = self.face_color
 *         else:
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_vertex_colors); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1924, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = (__pyx_t_3 == Py_None);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (__pyx_t_5) {

    /* "mathics/builtin/graphics.py":1925
 *         l = self.style.get_line_width(face_element=True)
 *         if self.vertex_colors is None:
 *             face_color = self.face_color             # <<<<<<<<<<<<<<
 *         else:
 *             face_color = None
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_face_color); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1925, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_face_color = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "mathics/builtin/graphics.py":1924
 *     def to_svg(self):
 *         l = self.style.get_line_width(face_element=True)
 *         if self.vertex_colors is None:             # <<<<<<<<<<<<<<
 *             face_color = self.face_color
 *         else:
 */
    goto __pyx_L3;
  }

  /* "mathics/builtin/graphics.py":1927
 *             face_color = self.face_color
 *         else:
 *             face_color = None             # <<<<<<<<<<<<<<
 *         style = create_css(
 *             edge_color=self.edge_color, face_color=face_color, stroke_width=l
 */
  /*else*/ {
    __Pyx_INCREF(Py_None);
    __pyx_v_face_color = Py_None;
  }
  __pyx_L3:;

  /* "mathics/builtin/graphics.py":1928
 *         else:
 *             face_color = None
 *         style = create_css(             # <<<<<<<<<<<<<<
 *             edge_color=self.edge_color, face_color=face_color, stroke_width=l
 *         )
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_create_css); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1928, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "mathics/builtin/graphics.py":1929
 *             face_color = None
 *         style = create_css(
 *             edge_color=self.edge_color, face_color=face_color, stroke_width=l             # <<<<<<<<<<<<<<
 *         )
 *         svg = ""
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1929, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_edge_color); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1929, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_edge_color, __pyx_t_2) < 0) __PYX_ERR(0, 1929, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_face_color, __pyx_v_face_color) < 0) __PYX_ERR(0, 1929, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_stroke_width, __pyx_v_l) < 0) __PYX_ERR(0, 1929, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1928
 *         else:
 *             face_color = None
 *         style = create_css(             # <<<<<<<<<<<<<<
 *             edge_color=self.edge_color, face_color=face_color, stroke_width=l
 *         )
 */
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1928, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_style = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":1931
 *             edge_color=self.edge_color, face_color=face_color, stroke_width=l
 *         )
 *         svg = ""             # <<<<<<<<<<<<<<
 *         if self.vertex_colors is not None:
 *             mesh = []
 */
  __Pyx_INCREF(__pyx_kp_u__41);
  __pyx_v_svg = __pyx_kp_u__41;

  /* "mathics/builtin/graphics.py":1932
 *         )
 *         svg = ""
 *         if self.vertex_colors is not None:             # <<<<<<<<<<<<<<
 *             mesh = []
 *             for index, line in enumerate(self.lines):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_vertex_colors); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1932, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = (__pyx_t_2 != Py_None);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (__pyx_t_5 != 0);
  if (__pyx_t_4) {

    /* "mathics/builtin/graphics.py":1933
 *         svg = ""
 *         if self.vertex_colors is not None:
 *             mesh = []             # <<<<<<<<<<<<<<
 *             for index, line in enumerate(self.lines):
 *                 data = [
 */
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1933, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_mesh = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "mathics/builtin/graphics.py":1934
 *         if self.vertex_colors is not None:
 *             mesh = []
 *             for index, line in enumerate(self.lines):             # <<<<<<<<<<<<<<
 *                 data = [
 *                     [coords.pos(), color.to_js()]
 */
    __Pyx_INCREF(__pyx_int_0);
    __pyx_t_2 = __pyx_int_0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lines); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1934, __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(0, 1934, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_7 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1934, __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))) {
          if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 1934, __pyx_L1_error)
          #else
          __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1934, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          #endif
        } else {
          if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 1934, __pyx_L1_error)
          #else
          __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1934, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          #endif
        }
      } else {
        __pyx_t_1 = __pyx_t_7(__pyx_t_3);
        if (unlikely(!__pyx_t_1)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 1934, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_1);
      }
      __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_line);
      __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_line, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      __pyx_t_1 = 0;
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_2);
      __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_t_2, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1934, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2);
      __pyx_t_2 = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "mathics/builtin/graphics.py":1935
 *             mesh = []
 *             for index, line in enumerate(self.lines):
 *                 data = [             # <<<<<<<<<<<<<<
 *                     [coords.pos(), color.to_js()]
 *                     for coords, color in zip(line, self.vertex_colors[index])
 */
      { /* enter inner scope */
        __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1935, __pyx_L9_error)
        __Pyx_GOTREF(__pyx_t_1);

        /* "mathics/builtin/graphics.py":1937
 *                 data = [
 *                     [coords.pos(), color.to_js()]
 *                     for coords, color in zip(line, self.vertex_colors[index])             # <<<<<<<<<<<<<<
 *                 ]
 *                 mesh.append(data)
 */
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_vertex_colors); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1937, __pyx_L9_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_t_8, __pyx_v_index); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1937, __pyx_L9_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1937, __pyx_L9_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_INCREF(__pyx_cur_scope->__pyx_v_line);
        __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_line);
        PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_cur_scope->__pyx_v_line);
        __Pyx_GIVEREF(__pyx_t_9);
        PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_9);
        __pyx_t_9 = 0;
        __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1937, __pyx_L9_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (likely(PyList_CheckExact(__pyx_t_9)) || PyTuple_CheckExact(__pyx_t_9)) {
          __pyx_t_8 = __pyx_t_9; __Pyx_INCREF(__pyx_t_8); __pyx_t_10 = 0;
          __pyx_t_11 = NULL;
        } else {
          __pyx_t_10 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1937, __pyx_L9_error)
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_11 = Py_TYPE(__pyx_t_8)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1937, __pyx_L9_error)
        }
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        for (;;) {
          if (likely(!__pyx_t_11)) {
            if (likely(PyList_CheckExact(__pyx_t_8))) {
              if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_8)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_9 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_10); __Pyx_INCREF(__pyx_t_9); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 1937, __pyx_L9_error)
              #else
              __pyx_t_9 = PySequence_ITEM(__pyx_t_8, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1937, __pyx_L9_error)
              __Pyx_GOTREF(__pyx_t_9);
              #endif
            } else {
              if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_8)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_10); __Pyx_INCREF(__pyx_t_9); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 1937, __pyx_L9_error)
              #else
              __pyx_t_9 = PySequence_ITEM(__pyx_t_8, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1937, __pyx_L9_error)
              __Pyx_GOTREF(__pyx_t_9);
              #endif
            }
          } else {
            __pyx_t_9 = __pyx_t_11(__pyx_t_8);
            if (unlikely(!__pyx_t_9)) {
              PyObject* exc_type = PyErr_Occurred();
              if (exc_type) {
                if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                else __PYX_ERR(0, 1937, __pyx_L9_error)
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_9);
          }
          if ((likely(PyTuple_CheckExact(__pyx_t_9))) || (PyList_CheckExact(__pyx_t_9))) {
            PyObject* sequence = __pyx_t_9;
            Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
            if (unlikely(size != 2)) {
              if (size > 2) __Pyx_RaiseTooManyValuesError(2);
              else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
              __PYX_ERR(0, 1937, __pyx_L9_error)
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            if (likely(PyTuple_CheckExact(sequence))) {
              __pyx_t_12 = PyTuple_GET_ITEM(sequence, 0); 
              __pyx_t_13 = PyTuple_GET_ITEM(sequence, 1); 
            } else {
              __pyx_t_12 = PyList_GET_ITEM(sequence, 0); 
              __pyx_t_13 = PyList_GET_ITEM(sequence, 1); 
            }
            __Pyx_INCREF(__pyx_t_12);
            __Pyx_INCREF(__pyx_t_13);
            #else
            __pyx_t_12 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1937, __pyx_L9_error)
            __Pyx_GOTREF(__pyx_t_12);
            __pyx_t_13 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1937, __pyx_L9_error)
            __Pyx_GOTREF(__pyx_t_13);
            #endif
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          } else {
            Py_ssize_t index = -1;
            __pyx_t_14 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1937, __pyx_L9_error)
            __Pyx_GOTREF(__pyx_t_14);
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
            __pyx_t_15 = Py_TYPE(__pyx_t_14)->tp_iternext;
            index = 0; __pyx_t_12 = __pyx_t_15(__pyx_t_14); if (unlikely(!__pyx_t_12)) goto __pyx_L12_unpacking_failed;
            __Pyx_GOTREF(__pyx_t_12);
            index = 1; __pyx_t_13 = __pyx_t_15(__pyx_t_14); if (unlikely(!__pyx_t_13)) goto __pyx_L12_unpacking_failed;
            __Pyx_GOTREF(__pyx_t_13);
            if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_14), 2) < 0) __PYX_ERR(0, 1937, __pyx_L9_error)
            __pyx_t_15 = NULL;
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
            goto __pyx_L13_unpacking_done;
            __pyx_L12_unpacking_failed:;
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
            __pyx_t_15 = NULL;
            if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
            __PYX_ERR(0, 1937, __pyx_L9_error)
            __pyx_L13_unpacking_done:;
          }
          __Pyx_XDECREF_SET(__pyx_9genexpr33__pyx_v_coords, __pyx_t_12);
          __pyx_t_12 = 0;
          __Pyx_XDECREF_SET(__pyx_9genexpr33__pyx_v_color, __pyx_t_13);
          __pyx_t_13 = 0;

          /* "mathics/builtin/graphics.py":1936
 *             for index, line in enumerate(self.lines):
 *                 data = [
 *                     [coords.pos(), color.to_js()]             # <<<<<<<<<<<<<<
 *                     for coords, color in zip(line, self.vertex_colors[index])
 *                 ]
 */
          __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr33__pyx_v_coords, __pyx_n_s_pos); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1936, __pyx_L9_error)
          __Pyx_GOTREF(__pyx_t_13);
          __pyx_t_12 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) {
            __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_13);
            if (likely(__pyx_t_12)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
              __Pyx_INCREF(__pyx_t_12);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_13, function);
            }
          }
          __pyx_t_9 = (__pyx_t_12) ? __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_t_12) : __Pyx_PyObject_CallNoArg(__pyx_t_13);
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1936, __pyx_L9_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr33__pyx_v_color, __pyx_n_s_to_js); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1936, __pyx_L9_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_14 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_14)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_14);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          __pyx_t_13 = (__pyx_t_14) ? __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_14) : __Pyx_PyObject_CallNoArg(__pyx_t_12);
          __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
          if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1936, __pyx_L9_error)
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = PyList_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1936, __pyx_L9_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_GIVEREF(__pyx_t_9);
          PyList_SET_ITEM(__pyx_t_12, 0, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_13);
          PyList_SET_ITEM(__pyx_t_12, 1, __pyx_t_13);
          __pyx_t_9 = 0;
          __pyx_t_13 = 0;
          if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_12))) __PYX_ERR(0, 1935, __pyx_L9_error)
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

          /* "mathics/builtin/graphics.py":1937
 *                 data = [
 *                     [coords.pos(), color.to_js()]
 *                     for coords, color in zip(line, self.vertex_colors[index])             # <<<<<<<<<<<<<<
 *                 ]
 *                 mesh.append(data)
 */
        }
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_XDECREF(__pyx_9genexpr33__pyx_v_color); __pyx_9genexpr33__pyx_v_color = 0;
        __Pyx_XDECREF(__pyx_9genexpr33__pyx_v_coords); __pyx_9genexpr33__pyx_v_coords = 0;
        goto __pyx_L14_exit_scope;
        __pyx_L9_error:;
        __Pyx_XDECREF(__pyx_9genexpr33__pyx_v_color); __pyx_9genexpr33__pyx_v_color = 0;
        __Pyx_XDECREF(__pyx_9genexpr33__pyx_v_coords); __pyx_9genexpr33__pyx_v_coords = 0;
        goto __pyx_L1_error;
        __pyx_L14_exit_scope:;
      } /* exit inner scope */
      __Pyx_XDECREF_SET(__pyx_v_data, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "mathics/builtin/graphics.py":1939
 *                     for coords, color in zip(line, self.vertex_colors[index])
 *                 ]
 *                 mesh.append(data)             # <<<<<<<<<<<<<<
 *             svg += '<meshgradient data="%s" />' % json.dumps(mesh)
 *         for line in self.lines:
 */
      __pyx_t_16 = __Pyx_PyList_Append(__pyx_v_mesh, __pyx_v_data); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(0, 1939, __pyx_L1_error)

      /* "mathics/builtin/graphics.py":1934
 *         if self.vertex_colors is not None:
 *             mesh = []
 *             for index, line in enumerate(self.lines):             # <<<<<<<<<<<<<<
 *                 data = [
 *                     [coords.pos(), color.to_js()]
 */
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "mathics/builtin/graphics.py":1940
 *                 ]
 *                 mesh.append(data)
 *             svg += '<meshgradient data="%s" />' % json.dumps(mesh)             # <<<<<<<<<<<<<<
 *         for line in self.lines:
 *             svg += '<polygon points="%s" style="%s" />' % (
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_json); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1940, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_dumps); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1940, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_v_mesh) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_mesh);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1940, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_meshgradient_data_s, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1940, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_v_svg, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1940, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_svg, ((PyObject*)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "mathics/builtin/graphics.py":1932
 *         )
 *         svg = ""
 *         if self.vertex_colors is not None:             # <<<<<<<<<<<<<<
 *             mesh = []
 *             for index, line in enumerate(self.lines):
 */
  }

  /* "mathics/builtin/graphics.py":1941
 *                 mesh.append(data)
 *             svg += '<meshgradient data="%s" />' % json.dumps(mesh)
 *         for line in self.lines:             # <<<<<<<<<<<<<<
 *             svg += '<polygon points="%s" style="%s" />' % (
 *                 " ".join("%f,%f" % coords.pos() for coords in line),
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lines); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1941, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = 0;
    __pyx_t_7 = NULL;
  } else {
    __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1941, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1941, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (likely(!__pyx_t_7)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 1941, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1941, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 1941, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1941, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_7(__pyx_t_1);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1941, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_line);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_line, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_2 = 0;

    /* "mathics/builtin/graphics.py":1942
 *             svg += '<meshgradient data="%s" />' % json.dumps(mesh)
 *         for line in self.lines:
 *             svg += '<polygon points="%s" style="%s" />' % (             # <<<<<<<<<<<<<<
 *                 " ".join("%f,%f" % coords.pos() for coords in line),
 *                 style,
 */
    __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1942, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_10 = 0;
    __pyx_t_17 = 127;
    __Pyx_INCREF(__pyx_kp_u_polygon_points);
    __pyx_t_10 += 17;
    __Pyx_GIVEREF(__pyx_kp_u_polygon_points);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u_polygon_points);

    /* "mathics/builtin/graphics.py":1943
 *         for line in self.lines:
 *             svg += '<polygon points="%s" style="%s" />' % (
 *                 " ".join("%f,%f" % coords.pos() for coords in line),             # <<<<<<<<<<<<<<
 *                 style,
 *             )
 */
    __pyx_t_3 = __pyx_pf_7mathics_7builtin_8graphics_10PolygonBox_6to_svg_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1943, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = __Pyx_Generator_Next(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1943, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyUnicode_Join(__pyx_kp_u__7, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1943, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_17 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_17) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_17;
    __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
    __pyx_t_3 = 0;
    __Pyx_INCREF(__pyx_kp_u_style_2);
    __pyx_t_10 += 9;
    __Pyx_GIVEREF(__pyx_kp_u_style_2);
    PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u_style_2);

    /* "mathics/builtin/graphics.py":1944
 *             svg += '<polygon points="%s" style="%s" />' % (
 *                 " ".join("%f,%f" % coords.pos() for coords in line),
 *                 style,             # <<<<<<<<<<<<<<
 *             )
 *         return svg
 */
    __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_style), __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1944, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_17 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_17) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_17;
    __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
    __pyx_t_3 = 0;
    __Pyx_INCREF(__pyx_kp_u__30);
    __pyx_t_10 += 4;
    __Pyx_GIVEREF(__pyx_kp_u__30);
    PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_kp_u__30);

    /* "mathics/builtin/graphics.py":1942
 *             svg += '<meshgradient data="%s" />' % json.dumps(mesh)
 *         for line in self.lines:
 *             svg += '<polygon points="%s" style="%s" />' % (             # <<<<<<<<<<<<<<
 *                 " ".join("%f,%f" % coords.pos() for coords in line),
 *                 style,
 */
    __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_2, 5, __pyx_t_10, __pyx_t_17); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1942, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_v_svg, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1942, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF_SET(__pyx_v_svg, ((PyObject*)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "mathics/builtin/graphics.py":1941
 *                 mesh.append(data)
 *             svg += '<meshgradient data="%s" />' % json.dumps(mesh)
 *         for line in self.lines:             # <<<<<<<<<<<<<<
 *             svg += '<polygon points="%s" style="%s" />' % (
 *                 " ".join("%f,%f" % coords.pos() for coords in line),
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1946
 *                 style,
 *             )
 *         return svg             # <<<<<<<<<<<<<<
 * 
 *     def to_asy(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_svg);
  __pyx_r = __pyx_v_svg;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":1922
 *             raise BoxConstructError
 * 
 *     def to_svg(self):             # <<<<<<<<<<<<<<
 *         l = self.style.get_line_width(face_element=True)
 *         if self.vertex_colors is None:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_AddTraceback("mathics.builtin.graphics.PolygonBox.to_svg", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_l);
  __Pyx_XDECREF(__pyx_v_face_color);
  __Pyx_XDECREF(__pyx_v_style);
  __Pyx_XDECREF(__pyx_v_svg);
  __Pyx_XDECREF(__pyx_v_mesh);
  __Pyx_XDECREF(__pyx_v_index);
  __Pyx_XDECREF(__pyx_v_data);
  __Pyx_XDECREF(__pyx_9genexpr33__pyx_v_coords);
  __Pyx_XDECREF(__pyx_9genexpr33__pyx_v_color);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":1948
 *         return svg
 * 
 *     def to_asy(self):             # <<<<<<<<<<<<<<
 *         l = self.style.get_line_width(face_element=True)
 *         if self.vertex_colors is None:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_10PolygonBox_7to_asy(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_10PolygonBox_7to_asy = {"to_asy", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_10PolygonBox_7to_asy, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_10PolygonBox_7to_asy(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_asy (wrapper)", 0);
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_10PolygonBox_6to_asy(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_10PolygonBox_6to_asy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_l = NULL;
  PyObject *__pyx_v_face_color = NULL;
  PyObject *__pyx_v_pens = NULL;
  PyObject *__pyx_v_asy = NULL;
  PyObject *__pyx_v_paths = NULL;
  PyObject *__pyx_v_colors = NULL;
  PyObject *__pyx_v_edges = NULL;
  PyObject *__pyx_v_index = NULL;
  PyObject *__pyx_v_line = NULL;
  PyObject *__pyx_v_path = NULL;
  PyObject *__pyx_9genexpr35__pyx_v_coords = NULL;
  PyObject *__pyx_9genexpr36__pyx_v_color = NULL;
  PyObject *__pyx_9genexpr37__pyx_v_coords = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  PyObject *(*__pyx_t_10)(PyObject *);
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  Py_UCS4 __pyx_t_15;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_asy", 0);

  /* "mathics/builtin/graphics.py":1949
 * 
 *     def to_asy(self):
 *         l = self.style.get_line_width(face_element=True)             # <<<<<<<<<<<<<<
 *         if self.vertex_colors is None:
 *             face_color = self.face_color
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_style); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1949, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_get_line_width); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1949, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1949, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_face_element, Py_True) < 0) __PYX_ERR(0, 1949, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1949, __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_v_l = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":1950
 *     def to_asy(self):
 *         l = self.style.get_line_width(face_element=True)
 *         if self.vertex_colors is None:             # <<<<<<<<<<<<<<
 *             face_color = self.face_color
 *         else:
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_vertex_colors); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1950, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = (__pyx_t_3 == Py_None);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (__pyx_t_5) {

    /* "mathics/builtin/graphics.py":1951
 *         l = self.style.get_line_width(face_element=True)
 *         if self.vertex_colors is None:
 *             face_color = self.face_color             # <<<<<<<<<<<<<<
 *         else:
 *             face_color = None
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_face_color); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1951, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_face_color = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "mathics/builtin/graphics.py":1950
 *     def to_asy(self):
 *         l = self.style.get_line_width(face_element=True)
 *         if self.vertex_colors is None:             # <<<<<<<<<<<<<<
 *             face_color = self.face_color
 *         else:
 */
    goto __pyx_L3;
  }

  /* "mathics/builtin/graphics.py":1953
 *             face_color = self.face_color
 *         else:
 *             face_color = None             # <<<<<<<<<<<<<<
 *         pens = create_pens(
 *             edge_color=self.edge_color,
 */
  /*else*/ {
    __Pyx_INCREF(Py_None);
    __pyx_v_face_color = Py_None;
  }
  __pyx_L3:;

  /* "mathics/builtin/graphics.py":1954
 *         else:
 *             face_color = None
 *         pens = create_pens(             # <<<<<<<<<<<<<<
 *             edge_color=self.edge_color,
 *             face_color=face_color,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_create_pens); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1954, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "mathics/builtin/graphics.py":1955
 *             face_color = None
 *         pens = create_pens(
 *             edge_color=self.edge_color,             # <<<<<<<<<<<<<<
 *             face_color=face_color,
 *             stroke_width=l,
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1955, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_edge_color); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1955, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_edge_color, __pyx_t_2) < 0) __PYX_ERR(0, 1955, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":1956
 *         pens = create_pens(
 *             edge_color=self.edge_color,
 *             face_color=face_color,             # <<<<<<<<<<<<<<
 *             stroke_width=l,
 *             is_face_element=True,
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_face_color, __pyx_v_face_color) < 0) __PYX_ERR(0, 1955, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1957
 *             edge_color=self.edge_color,
 *             face_color=face_color,
 *             stroke_width=l,             # <<<<<<<<<<<<<<
 *             is_face_element=True,
 *         )
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_stroke_width, __pyx_v_l) < 0) __PYX_ERR(0, 1955, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1958
 *             face_color=face_color,
 *             stroke_width=l,
 *             is_face_element=True,             # <<<<<<<<<<<<<<
 *         )
 *         asy = ""
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_is_face_element, Py_True) < 0) __PYX_ERR(0, 1955, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1954
 *         else:
 *             face_color = None
 *         pens = create_pens(             # <<<<<<<<<<<<<<
 *             edge_color=self.edge_color,
 *             face_color=face_color,
 */
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1954, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_pens = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":1960
 *             is_face_element=True,
 *         )
 *         asy = ""             # <<<<<<<<<<<<<<
 *         if self.vertex_colors is not None:
 *             paths = []
 */
  __Pyx_INCREF(__pyx_kp_u__41);
  __pyx_v_asy = __pyx_kp_u__41;

  /* "mathics/builtin/graphics.py":1961
 *         )
 *         asy = ""
 *         if self.vertex_colors is not None:             # <<<<<<<<<<<<<<
 *             paths = []
 *             colors = []
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_vertex_colors); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1961, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = (__pyx_t_2 != Py_None);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (__pyx_t_5 != 0);
  if (__pyx_t_4) {

    /* "mathics/builtin/graphics.py":1962
 *         asy = ""
 *         if self.vertex_colors is not None:
 *             paths = []             # <<<<<<<<<<<<<<
 *             colors = []
 *             edges = []
 */
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1962, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_paths = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "mathics/builtin/graphics.py":1963
 *         if self.vertex_colors is not None:
 *             paths = []
 *             colors = []             # <<<<<<<<<<<<<<
 *             edges = []
 *             for index, line in enumerate(self.lines):
 */
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1963, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_colors = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "mathics/builtin/graphics.py":1964
 *             paths = []
 *             colors = []
 *             edges = []             # <<<<<<<<<<<<<<
 *             for index, line in enumerate(self.lines):
 *                 paths.append(
 */
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1964, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_edges = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "mathics/builtin/graphics.py":1965
 *             colors = []
 *             edges = []
 *             for index, line in enumerate(self.lines):             # <<<<<<<<<<<<<<
 *                 paths.append(
 *                     "--".join(["(%.5g,%.5g)" % coords.pos() for coords in line])
 */
    __Pyx_INCREF(__pyx_int_0);
    __pyx_t_2 = __pyx_int_0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lines); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1965, __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(0, 1965, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_7 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1965, __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))) {
          if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 1965, __pyx_L1_error)
          #else
          __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1965, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          #endif
        } else {
          if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 1965, __pyx_L1_error)
          #else
          __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1965, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          #endif
        }
      } else {
        __pyx_t_1 = __pyx_t_7(__pyx_t_3);
        if (unlikely(!__pyx_t_1)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 1965, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_1);
      }
      __Pyx_XDECREF_SET(__pyx_v_line, __pyx_t_1);
      __pyx_t_1 = 0;
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_2);
      __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_t_2, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1965, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2);
      __pyx_t_2 = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "mathics/builtin/graphics.py":1967
 *             for index, line in enumerate(self.lines):
 *                 paths.append(
 *                     "--".join(["(%.5g,%.5g)" % coords.pos() for coords in line])             # <<<<<<<<<<<<<<
 *                     + "--cycle"
 *                 )
 */
      { /* enter inner scope */
        __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1967, __pyx_L9_error)
        __Pyx_GOTREF(__pyx_t_1);
        if (likely(PyList_CheckExact(__pyx_v_line)) || PyTuple_CheckExact(__pyx_v_line)) {
          __pyx_t_8 = __pyx_v_line; __Pyx_INCREF(__pyx_t_8); __pyx_t_9 = 0;
          __pyx_t_10 = NULL;
        } else {
          __pyx_t_9 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_v_line); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1967, __pyx_L9_error)
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_10 = Py_TYPE(__pyx_t_8)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1967, __pyx_L9_error)
        }
        for (;;) {
          if (likely(!__pyx_t_10)) {
            if (likely(PyList_CheckExact(__pyx_t_8))) {
              if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_8)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_11 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_9); __Pyx_INCREF(__pyx_t_11); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 1967, __pyx_L9_error)
              #else
              __pyx_t_11 = PySequence_ITEM(__pyx_t_8, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1967, __pyx_L9_error)
              __Pyx_GOTREF(__pyx_t_11);
              #endif
            } else {
              if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_8)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_11 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_9); __Pyx_INCREF(__pyx_t_11); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 1967, __pyx_L9_error)
              #else
              __pyx_t_11 = PySequence_ITEM(__pyx_t_8, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1967, __pyx_L9_error)
              __Pyx_GOTREF(__pyx_t_11);
              #endif
            }
          } else {
            __pyx_t_11 = __pyx_t_10(__pyx_t_8);
            if (unlikely(!__pyx_t_11)) {
              PyObject* exc_type = PyErr_Occurred();
              if (exc_type) {
                if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                else __PYX_ERR(0, 1967, __pyx_L9_error)
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_11);
          }
          __Pyx_XDECREF_SET(__pyx_9genexpr35__pyx_v_coords, __pyx_t_11);
          __pyx_t_11 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr35__pyx_v_coords, __pyx_n_s_pos); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1967, __pyx_L9_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_13 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_13)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_13);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          __pyx_t_11 = (__pyx_t_13) ? __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_13) : __Pyx_PyObject_CallNoArg(__pyx_t_12);
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1967, __pyx_L9_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_5g_5g_3, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1967, __pyx_L9_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_12))) __PYX_ERR(0, 1967, __pyx_L9_error)
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        }
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_XDECREF(__pyx_9genexpr35__pyx_v_coords); __pyx_9genexpr35__pyx_v_coords = 0;
        goto __pyx_L12_exit_scope;
        __pyx_L9_error:;
        __Pyx_XDECREF(__pyx_9genexpr35__pyx_v_coords); __pyx_9genexpr35__pyx_v_coords = 0;
        goto __pyx_L1_error;
        __pyx_L12_exit_scope:;
      } /* exit inner scope */
      __pyx_t_8 = PyUnicode_Join(__pyx_kp_u__43, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1967, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "mathics/builtin/graphics.py":1968
 *                 paths.append(
 *                     "--".join(["(%.5g,%.5g)" % coords.pos() for coords in line])
 *                     + "--cycle"             # <<<<<<<<<<<<<<
 *                 )
 * 
 */
      __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_t_8, __pyx_kp_u_cycle_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1968, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "mathics/builtin/graphics.py":1966
 *             edges = []
 *             for index, line in enumerate(self.lines):
 *                 paths.append(             # <<<<<<<<<<<<<<
 *                     "--".join(["(%.5g,%.5g)" % coords.pos() for coords in line])
 *                     + "--cycle"
 */
      __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_paths, __pyx_t_1); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 1966, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "mathics/builtin/graphics.py":1973
 *                 # ignore opacity
 *                 colors.append(
 *                     ",".join([color.to_asy()[0] for color in self.vertex_colors[index]])             # <<<<<<<<<<<<<<
 *                 )
 * 
 */
      { /* enter inner scope */
        __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1973, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_vertex_colors); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1973, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_12 = __Pyx_PyObject_GetItem(__pyx_t_8, __pyx_v_index); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1973, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (likely(PyList_CheckExact(__pyx_t_12)) || PyTuple_CheckExact(__pyx_t_12)) {
          __pyx_t_8 = __pyx_t_12; __Pyx_INCREF(__pyx_t_8); __pyx_t_9 = 0;
          __pyx_t_10 = NULL;
        } else {
          __pyx_t_9 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_12); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1973, __pyx_L15_error)
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_10 = Py_TYPE(__pyx_t_8)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1973, __pyx_L15_error)
        }
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        for (;;) {
          if (likely(!__pyx_t_10)) {
            if (likely(PyList_CheckExact(__pyx_t_8))) {
              if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_8)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_12 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_9); __Pyx_INCREF(__pyx_t_12); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 1973, __pyx_L15_error)
              #else
              __pyx_t_12 = PySequence_ITEM(__pyx_t_8, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1973, __pyx_L15_error)
              __Pyx_GOTREF(__pyx_t_12);
              #endif
            } else {
              if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_8)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_12 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_9); __Pyx_INCREF(__pyx_t_12); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 1973, __pyx_L15_error)
              #else
              __pyx_t_12 = PySequence_ITEM(__pyx_t_8, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1973, __pyx_L15_error)
              __Pyx_GOTREF(__pyx_t_12);
              #endif
            }
          } else {
            __pyx_t_12 = __pyx_t_10(__pyx_t_8);
            if (unlikely(!__pyx_t_12)) {
              PyObject* exc_type = PyErr_Occurred();
              if (exc_type) {
                if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                else __PYX_ERR(0, 1973, __pyx_L15_error)
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_12);
          }
          __Pyx_XDECREF_SET(__pyx_9genexpr36__pyx_v_color, __pyx_t_12);
          __pyx_t_12 = 0;
          __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr36__pyx_v_color, __pyx_n_s_to_asy); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1973, __pyx_L15_error)
          __Pyx_GOTREF(__pyx_t_11);
          __pyx_t_13 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_11))) {
            __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_11);
            if (likely(__pyx_t_13)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
              __Pyx_INCREF(__pyx_t_13);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_11, function);
            }
          }
          __pyx_t_12 = (__pyx_t_13) ? __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_13) : __Pyx_PyObject_CallNoArg(__pyx_t_11);
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1973, __pyx_L15_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __pyx_t_11 = __Pyx_GetItemInt(__pyx_t_12, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1973, __pyx_L15_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_11))) __PYX_ERR(0, 1973, __pyx_L15_error)
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        }
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_XDECREF(__pyx_9genexpr36__pyx_v_color); __pyx_9genexpr36__pyx_v_color = 0;
        goto __pyx_L18_exit_scope;
        __pyx_L15_error:;
        __Pyx_XDECREF(__pyx_9genexpr36__pyx_v_color); __pyx_9genexpr36__pyx_v_color = 0;
        goto __pyx_L1_error;
        __pyx_L18_exit_scope:;
      } /* exit inner scope */
      __pyx_t_8 = PyUnicode_Join(__pyx_kp_u__31, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1973, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "mathics/builtin/graphics.py":1972
 * 
 *                 # ignore opacity
 *                 colors.append(             # <<<<<<<<<<<<<<
 *                     ",".join([color.to_asy()[0] for color in self.vertex_colors[index]])
 *                 )
 */
      __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_colors, __pyx_t_8); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 1972, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "mathics/builtin/graphics.py":1977
 * 
 *                 edges.append(
 *                     ",".join(["0"] + ["1"] * (len(self.vertex_colors[index]) - 1))             # <<<<<<<<<<<<<<
 *                 )
 * 
 */
      __pyx_t_8 = PyList_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1977, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_INCREF(__pyx_kp_u_0_2);
      __Pyx_GIVEREF(__pyx_kp_u_0_2);
      PyList_SET_ITEM(__pyx_t_8, 0, __pyx_kp_u_0_2);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_vertex_colors); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1977, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_11 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_index); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1977, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_9 = PyObject_Length(__pyx_t_11); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1977, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_11 = PyList_New(1 * (((__pyx_t_9 - 1)<0) ? 0:(__pyx_t_9 - 1))); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1977, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      { Py_ssize_t __pyx_temp;
        for (__pyx_temp=0; __pyx_temp < (__pyx_t_9 - 1); __pyx_temp++) {
          __Pyx_INCREF(__pyx_kp_u_1);
          __Pyx_GIVEREF(__pyx_kp_u_1);
          PyList_SET_ITEM(__pyx_t_11, __pyx_temp, __pyx_kp_u_1);
        }
      }
      __pyx_t_1 = PyNumber_Add(__pyx_t_8, __pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1977, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_11 = PyUnicode_Join(__pyx_kp_u__31, __pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1977, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "mathics/builtin/graphics.py":1976
 *                 )
 * 
 *                 edges.append(             # <<<<<<<<<<<<<<
 *                     ",".join(["0"] + ["1"] * (len(self.vertex_colors[index]) - 1))
 *                 )
 */
      __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_edges, __pyx_t_11); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 1976, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

      /* "mathics/builtin/graphics.py":1965
 *             colors = []
 *             edges = []
 *             for index, line in enumerate(self.lines):             # <<<<<<<<<<<<<<
 *                 paths.append(
 *                     "--".join(["(%.5g,%.5g)" % coords.pos() for coords in line])
 */
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "mathics/builtin/graphics.py":1980
 *                 )
 * 
 *             asy += "gouraudshade(%s, new pen[] {%s}, new int[] {%s});" % (             # <<<<<<<<<<<<<<
 *                 "^^".join(paths),
 *                 ",".join(colors),
 */
    __pyx_t_2 = PyTuple_New(7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1980, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = 0;
    __pyx_t_15 = 127;
    __Pyx_INCREF(__pyx_kp_u_gouraudshade);
    __pyx_t_6 += 13;
    __Pyx_GIVEREF(__pyx_kp_u_gouraudshade);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u_gouraudshade);

    /* "mathics/builtin/graphics.py":1981
 * 
 *             asy += "gouraudshade(%s, new pen[] {%s}, new int[] {%s});" % (
 *                 "^^".join(paths),             # <<<<<<<<<<<<<<
 *                 ",".join(colors),
 *                 ",".join(edges),
 */
    __pyx_t_3 = PyUnicode_Join(__pyx_kp_u__66, __pyx_v_paths); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1981, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_15 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_15) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_15;
    __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
    __pyx_t_3 = 0;
    __Pyx_INCREF(__pyx_kp_u_new_pen);
    __pyx_t_6 += 13;
    __Pyx_GIVEREF(__pyx_kp_u_new_pen);
    PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u_new_pen);

    /* "mathics/builtin/graphics.py":1982
 *             asy += "gouraudshade(%s, new pen[] {%s}, new int[] {%s});" % (
 *                 "^^".join(paths),
 *                 ",".join(colors),             # <<<<<<<<<<<<<<
 *                 ",".join(edges),
 *             )
 */
    __pyx_t_3 = PyUnicode_Join(__pyx_kp_u__31, __pyx_v_colors); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1982, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_15 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_15) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_15;
    __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
    __pyx_t_3 = 0;
    __Pyx_INCREF(__pyx_kp_u_new_int);
    __pyx_t_6 += 14;
    __Pyx_GIVEREF(__pyx_kp_u_new_int);
    PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_kp_u_new_int);

    /* "mathics/builtin/graphics.py":1983
 *                 "^^".join(paths),
 *                 ",".join(colors),
 *                 ",".join(edges),             # <<<<<<<<<<<<<<
 *             )
 *         if pens and pens != "nullpen":
 */
    __pyx_t_3 = PyUnicode_Join(__pyx_kp_u__31, __pyx_v_edges); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1983, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_15 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_15) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_15;
    __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_2, 5, __pyx_t_3);
    __pyx_t_3 = 0;
    __Pyx_INCREF(__pyx_kp_u__67);
    __pyx_t_6 += 3;
    __Pyx_GIVEREF(__pyx_kp_u__67);
    PyTuple_SET_ITEM(__pyx_t_2, 6, __pyx_kp_u__67);

    /* "mathics/builtin/graphics.py":1980
 *                 )
 * 
 *             asy += "gouraudshade(%s, new pen[] {%s}, new int[] {%s});" % (             # <<<<<<<<<<<<<<
 *                 "^^".join(paths),
 *                 ",".join(colors),
 */
    __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_2, 7, __pyx_t_6, __pyx_t_15); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1980, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_v_asy, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1980, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF_SET(__pyx_v_asy, ((PyObject*)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "mathics/builtin/graphics.py":1961
 *         )
 *         asy = ""
 *         if self.vertex_colors is not None:             # <<<<<<<<<<<<<<
 *             paths = []
 *             colors = []
 */
  }

  /* "mathics/builtin/graphics.py":1985
 *                 ",".join(edges),
 *             )
 *         if pens and pens != "nullpen":             # <<<<<<<<<<<<<<
 *             for line in self.lines:
 *                 path = (
 */
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_pens); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1985, __pyx_L1_error)
  if (__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    goto __pyx_L20_bool_binop_done;
  }
  __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_v_pens, __pyx_n_u_nullpen, Py_NE)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1985, __pyx_L1_error)
  __pyx_t_4 = __pyx_t_5;
  __pyx_L20_bool_binop_done:;
  if (__pyx_t_4) {

    /* "mathics/builtin/graphics.py":1986
 *             )
 *         if pens and pens != "nullpen":
 *             for line in self.lines:             # <<<<<<<<<<<<<<
 *                 path = (
 *                     "--".join(["(%.5g,%.5g)" % coords.pos() for coords in line])
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lines); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1986, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
      __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1986, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_7 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1986, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    for (;;) {
      if (likely(!__pyx_t_7)) {
        if (likely(PyList_CheckExact(__pyx_t_3))) {
          if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 1986, __pyx_L1_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1986, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        } else {
          if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 1986, __pyx_L1_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1986, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        }
      } else {
        __pyx_t_2 = __pyx_t_7(__pyx_t_3);
        if (unlikely(!__pyx_t_2)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 1986, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_XDECREF_SET(__pyx_v_line, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "mathics/builtin/graphics.py":1988
 *             for line in self.lines:
 *                 path = (
 *                     "--".join(["(%.5g,%.5g)" % coords.pos() for coords in line])             # <<<<<<<<<<<<<<
 *                     + "--cycle"
 *                 )
 */
      { /* enter inner scope */
        __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1988, __pyx_L26_error)
        __Pyx_GOTREF(__pyx_t_2);
        if (likely(PyList_CheckExact(__pyx_v_line)) || PyTuple_CheckExact(__pyx_v_line)) {
          __pyx_t_11 = __pyx_v_line; __Pyx_INCREF(__pyx_t_11); __pyx_t_9 = 0;
          __pyx_t_10 = NULL;
        } else {
          __pyx_t_9 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_v_line); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1988, __pyx_L26_error)
          __Pyx_GOTREF(__pyx_t_11);
          __pyx_t_10 = Py_TYPE(__pyx_t_11)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1988, __pyx_L26_error)
        }
        for (;;) {
          if (likely(!__pyx_t_10)) {
            if (likely(PyList_CheckExact(__pyx_t_11))) {
              if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_11)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_1 = PyList_GET_ITEM(__pyx_t_11, __pyx_t_9); __Pyx_INCREF(__pyx_t_1); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 1988, __pyx_L26_error)
              #else
              __pyx_t_1 = PySequence_ITEM(__pyx_t_11, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1988, __pyx_L26_error)
              __Pyx_GOTREF(__pyx_t_1);
              #endif
            } else {
              if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_11)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_11, __pyx_t_9); __Pyx_INCREF(__pyx_t_1); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 1988, __pyx_L26_error)
              #else
              __pyx_t_1 = PySequence_ITEM(__pyx_t_11, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1988, __pyx_L26_error)
              __Pyx_GOTREF(__pyx_t_1);
              #endif
            }
          } else {
            __pyx_t_1 = __pyx_t_10(__pyx_t_11);
            if (unlikely(!__pyx_t_1)) {
              PyObject* exc_type = PyErr_Occurred();
              if (exc_type) {
                if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                else __PYX_ERR(0, 1988, __pyx_L26_error)
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_1);
          }
          __Pyx_XDECREF_SET(__pyx_9genexpr37__pyx_v_coords, __pyx_t_1);
          __pyx_t_1 = 0;
          __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr37__pyx_v_coords, __pyx_n_s_pos); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1988, __pyx_L26_error)
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_12 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
            __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_8);
            if (likely(__pyx_t_12)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
              __Pyx_INCREF(__pyx_t_12);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_8, function);
            }
          }
          __pyx_t_1 = (__pyx_t_12) ? __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_12) : __Pyx_PyObject_CallNoArg(__pyx_t_8);
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1988, __pyx_L26_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __pyx_t_8 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_5g_5g_3, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1988, __pyx_L26_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 1988, __pyx_L26_error)
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        }
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_XDECREF(__pyx_9genexpr37__pyx_v_coords); __pyx_9genexpr37__pyx_v_coords = 0;
        goto __pyx_L29_exit_scope;
        __pyx_L26_error:;
        __Pyx_XDECREF(__pyx_9genexpr37__pyx_v_coords); __pyx_9genexpr37__pyx_v_coords = 0;
        goto __pyx_L1_error;
        __pyx_L29_exit_scope:;
      } /* exit inner scope */
      __pyx_t_11 = PyUnicode_Join(__pyx_kp_u__43, __pyx_t_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1988, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "mathics/builtin/graphics.py":1989
 *                 path = (
 *                     "--".join(["(%.5g,%.5g)" % coords.pos() for coords in line])
 *                     + "--cycle"             # <<<<<<<<<<<<<<
 *                 )
 *                 asy += "filldraw(%s, %s);" % (path, pens)
 */
      __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_t_11, __pyx_kp_u_cycle_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1989, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_XDECREF_SET(__pyx_v_path, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "mathics/builtin/graphics.py":1991
 *                     + "--cycle"
 *                 )
 *                 asy += "filldraw(%s, %s);" % (path, pens)             # <<<<<<<<<<<<<<
 *         return asy
 * 
 */
      __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1991, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_9 = 0;
      __pyx_t_15 = 127;
      __Pyx_INCREF(__pyx_kp_u_filldraw_3);
      __pyx_t_9 += 9;
      __Pyx_GIVEREF(__pyx_kp_u_filldraw_3);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u_filldraw_3);
      __Pyx_INCREF(__pyx_v_path);
      __pyx_t_15 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_path) > __pyx_t_15) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_path) : __pyx_t_15;
      __pyx_t_9 += __Pyx_PyUnicode_GET_LENGTH(__pyx_v_path);
      __Pyx_GIVEREF(__pyx_v_path);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_path);
      __Pyx_INCREF(__pyx_kp_u__4);
      __pyx_t_9 += 2;
      __Pyx_GIVEREF(__pyx_kp_u__4);
      PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u__4);
      __pyx_t_11 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_pens), __pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1991, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_15 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) > __pyx_t_15) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) : __pyx_t_15;
      __pyx_t_9 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11);
      __Pyx_GIVEREF(__pyx_t_11);
      PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_11);
      __pyx_t_11 = 0;
      __Pyx_INCREF(__pyx_kp_u__33);
      __pyx_t_9 += 2;
      __Pyx_GIVEREF(__pyx_kp_u__33);
      PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_kp_u__33);
      __pyx_t_11 = __Pyx_PyUnicode_Join(__pyx_t_2, 5, __pyx_t_9, __pyx_t_15); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1991, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_v_asy, __pyx_t_11); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1991, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF_SET(__pyx_v_asy, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "mathics/builtin/graphics.py":1986
 *             )
 *         if pens and pens != "nullpen":
 *             for line in self.lines:             # <<<<<<<<<<<<<<
 *                 path = (
 *                     "--".join(["(%.5g,%.5g)" % coords.pos() for coords in line])
 */
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "mathics/builtin/graphics.py":1985
 *                 ",".join(edges),
 *             )
 *         if pens and pens != "nullpen":             # <<<<<<<<<<<<<<
 *             for line in self.lines:
 *                 path = (
 */
  }

  /* "mathics/builtin/graphics.py":1992
 *                 )
 *                 asy += "filldraw(%s, %s);" % (path, pens)
 *         return asy             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_asy);
  __pyx_r = __pyx_v_asy;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":1948
 *         return svg
 * 
 *     def to_asy(self):             # <<<<<<<<<<<<<<
 *         l = self.style.get_line_width(face_element=True)
 *         if self.vertex_colors is None:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("mathics.builtin.graphics.PolygonBox.to_asy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_l);
  __Pyx_XDECREF(__pyx_v_face_color);
  __Pyx_XDECREF(__pyx_v_pens);
  __Pyx_XDECREF(__pyx_v_asy);
  __Pyx_XDECREF(__pyx_v_paths);
  __Pyx_XDECREF(__pyx_v_colors);
  __Pyx_XDECREF(__pyx_v_edges);
  __Pyx_XDECREF(__pyx_v_index);
  __Pyx_XDECREF(__pyx_v_line);
  __Pyx_XDECREF(__pyx_v_path);
  __Pyx_XDECREF(__pyx_9genexpr35__pyx_v_coords);
  __Pyx_XDECREF(__pyx_9genexpr36__pyx_v_color);
  __Pyx_XDECREF(__pyx_9genexpr37__pyx_v_coords);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":2017
 * 
 * class RegularPolygonBox(PolygonBox):
 *     def init(self, graphics, style, item):             # <<<<<<<<<<<<<<
 *         if len(item.leaves) in (1, 2, 3) and isinstance(item.leaves[-1], Integer):
 *             r = 1.0
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_17RegularPolygonBox_1init(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_17RegularPolygonBox_1init = {"init", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_17RegularPolygonBox_1init, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_17RegularPolygonBox_1init(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_graphics = 0;
  PyObject *__pyx_v_style = 0;
  PyObject *__pyx_v_item = 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);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_graphics,&__pyx_n_s_style,&__pyx_n_s_item,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_graphics)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("init", 1, 4, 4, 1); __PYX_ERR(0, 2017, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_style)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("init", 1, 4, 4, 2); __PYX_ERR(0, 2017, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_item)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("init", 1, 4, 4, 3); __PYX_ERR(0, 2017, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "init") < 0)) __PYX_ERR(0, 2017, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __pyx_v_self = values[0];
    __pyx_v_graphics = values[1];
    __pyx_v_style = values[2];
    __pyx_v_item = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("init", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2017, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.RegularPolygonBox.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_17RegularPolygonBox_init(__pyx_self, __pyx_v_self, __pyx_v_graphics, __pyx_v_style, __pyx_v_item);

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

/* "mathics/builtin/graphics.py":2053
 *             pi2 = pi * 2.0
 * 
 *             def vertices():             # <<<<<<<<<<<<<<
 *                 for i in range(n):
 *                     phi = phi0 + pi2 * i / float(n)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_17RegularPolygonBox_4init_1vertices(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_17RegularPolygonBox_4init_1vertices = {"vertices", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_17RegularPolygonBox_4init_1vertices, METH_NOARGS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_17RegularPolygonBox_4init_1vertices(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("vertices (wrapper)", 0);
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_17RegularPolygonBox_4init_vertices(__pyx_self);

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_17RegularPolygonBox_4init_vertices(PyObject *__pyx_self) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_36_vertices *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("vertices", 0);
  __pyx_cur_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_36_vertices *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_36_vertices(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_36_vertices, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_36_vertices *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 2053, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_34_init *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7mathics_7builtin_8graphics_17RegularPolygonBox_4init_2generator25, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_vertices, __pyx_n_s_RegularPolygonBox_init_locals_ve, __pyx_n_s_mathics_builtin_graphics); if (unlikely(!gen)) __PYX_ERR(0, 2053, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.RegularPolygonBox.init.vertices", __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_7mathics_7builtin_8graphics_17RegularPolygonBox_4init_2generator25(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_36_vertices *__pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_36_vertices *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("vertices", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2053, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2054
 * 
 *             def vertices():
 *                 for i in range(n):             # <<<<<<<<<<<<<<
 *                     phi = phi0 + pi2 * i / float(n)
 *                     yield Expression(
 */
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_n)) { __Pyx_RaiseClosureNameError("n"); __PYX_ERR(0, 2054, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_n); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2054, __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(0, 2054, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2054, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 2054, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2054, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 2054, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2054, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 2054, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_i);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_i, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;

    /* "mathics/builtin/graphics.py":2055
 *             def vertices():
 *                 for i in range(n):
 *                     phi = phi0 + pi2 * i / float(n)             # <<<<<<<<<<<<<<
 *                     yield Expression(
 *                         "List", Real(x + r * cos(phi)), Real(y + r * sin(phi))
 */
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_phi0)) { __Pyx_RaiseClosureNameError("phi0"); __PYX_ERR(0, 2055, __pyx_L1_error) }
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_pi2)) { __Pyx_RaiseClosureNameError("pi2"); __PYX_ERR(0, 2055, __pyx_L1_error) }
    __pyx_t_1 = PyNumber_Multiply(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_pi2, __pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2055, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_n)) { __Pyx_RaiseClosureNameError("n"); __PYX_ERR(0, 2055, __pyx_L1_error) }
    __pyx_t_5 = __Pyx_PyNumber_Float(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_n); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2055, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2055, __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 = PyNumber_Add(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_phi0, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2055, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_phi);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_phi, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_5 = 0;

    /* "mathics/builtin/graphics.py":2056
 *                 for i in range(n):
 *                     phi = phi0 + pi2 * i / float(n)
 *                     yield Expression(             # <<<<<<<<<<<<<<
 *                         "List", Real(x + r * cos(phi)), Real(y + r * sin(phi))
 *                     )
 */
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_Expression); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2056, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);

    /* "mathics/builtin/graphics.py":2057
 *                     phi = phi0 + pi2 * i / float(n)
 *                     yield Expression(
 *                         "List", Real(x + r * cos(phi)), Real(y + r * sin(phi))             # <<<<<<<<<<<<<<
 *                     )
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Real); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2057, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_x)) { __Pyx_RaiseClosureNameError("x"); __PYX_ERR(0, 2057, __pyx_L1_error) }
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_r)) { __Pyx_RaiseClosureNameError("r"); __PYX_ERR(0, 2057, __pyx_L1_error) }
    __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_cos); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2057, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_10 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
      if (likely(__pyx_t_10)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_9, function);
      }
    }
    __pyx_t_8 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_10, __pyx_cur_scope->__pyx_v_phi) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_cur_scope->__pyx_v_phi);
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2057, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = PyNumber_Multiply(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_r, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2057, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = PyNumber_Add(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_x, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2057, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    __pyx_t_1 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_9, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8);
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2057, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_Real); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2057, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_y)) { __Pyx_RaiseClosureNameError("y"); __PYX_ERR(0, 2057, __pyx_L1_error) }
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_r)) { __Pyx_RaiseClosureNameError("r"); __PYX_ERR(0, 2057, __pyx_L1_error) }
    __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_sin); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2057, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_11 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
      __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10);
      if (likely(__pyx_t_11)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
        __Pyx_INCREF(__pyx_t_11);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_10, function);
      }
    }
    __pyx_t_9 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_11, __pyx_cur_scope->__pyx_v_phi) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_cur_scope->__pyx_v_phi);
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2057, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_10 = PyNumber_Multiply(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_r, __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2057, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = PyNumber_Add(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_y, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2057, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_10 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_8);
      if (likely(__pyx_t_10)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_8, function);
      }
    }
    __pyx_t_7 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_10, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_9);
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2057, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = NULL;
    __pyx_t_12 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_12 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_6)) {
      PyObject *__pyx_temp[4] = {__pyx_t_8, __pyx_n_u_List, __pyx_t_1, __pyx_t_7};
      __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_12, 3+__pyx_t_12); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2056, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
      PyObject *__pyx_temp[4] = {__pyx_t_8, __pyx_n_u_List, __pyx_t_1, __pyx_t_7};
      __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_12, 3+__pyx_t_12); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2056, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    } else
    #endif
    {
      __pyx_t_9 = PyTuple_New(3+__pyx_t_12); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2056, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      if (__pyx_t_8) {
        __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
      }
      __Pyx_INCREF(__pyx_n_u_List);
      __Pyx_GIVEREF(__pyx_n_u_List);
      PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_12, __pyx_n_u_List);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_12, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_12, __pyx_t_7);
      __pyx_t_1 = 0;
      __pyx_t_7 = 0;
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2056, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    __Pyx_XGIVEREF(__pyx_t_2);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_3;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_4;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_2);
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_4 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2056, __pyx_L1_error)

    /* "mathics/builtin/graphics.py":2054
 * 
 *             def vertices():
 *                 for i in range(n):             # <<<<<<<<<<<<<<
 *                     phi = phi0 + pi2 * i / float(n)
 *                     yield Expression(
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "mathics/builtin/graphics.py":2053
 *             pi2 = pi * 2.0
 * 
 *             def vertices():             # <<<<<<<<<<<<<<
 *                 for i in range(n):
 *                     phi = phi0 + pi2 * i / float(n)
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  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_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("vertices", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7mathics_7builtin_8graphics_17RegularPolygonBox_4init_5generator26(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "mathics/builtin/graphics.py":2043
 *             n = item.leaves[-1].get_int_value()
 * 
 *             if any(t is None for t in (x, y, r)) or n < 0:             # <<<<<<<<<<<<<<
 *                 raise BoxConstructError
 * 
 */

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_17RegularPolygonBox_4init_3genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_35_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_35_genexpr *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_35_genexpr(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_35_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_35_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 2043, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_34_init *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7mathics_7builtin_8graphics_17RegularPolygonBox_4init_5generator26, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_RegularPolygonBox_init_locals_ge, __pyx_n_s_mathics_builtin_graphics); if (unlikely(!gen)) __PYX_ERR(0, 2043, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.RegularPolygonBox.init.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_7mathics_7builtin_8graphics_17RegularPolygonBox_4init_5generator26(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_35_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_35_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2043, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_x)) { __Pyx_RaiseClosureNameError("x"); __PYX_ERR(0, 2043, __pyx_L1_error) }
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_y)) { __Pyx_RaiseClosureNameError("y"); __PYX_ERR(0, 2043, __pyx_L1_error) }
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_r)) { __Pyx_RaiseClosureNameError("r"); __PYX_ERR(0, 2043, __pyx_L1_error) }
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2043, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_x);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_x);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_x);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_y);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_y);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_y);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_r);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_r);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_r);
  __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (__pyx_t_3 >= 3) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 2043, __pyx_L1_error)
    #else
    __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2043, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    #endif
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_t);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_t, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_4 = (__pyx_cur_scope->__pyx_v_t == Py_None);
    __pyx_t_5 = (__pyx_t_4 != 0);
    if (__pyx_t_5) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_True);
      __pyx_r = Py_True;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      goto __pyx_L0;
    }
  }
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

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

/* "mathics/builtin/graphics.py":2017
 * 
 * class RegularPolygonBox(PolygonBox):
 *     def init(self, graphics, style, item):             # <<<<<<<<<<<<<<
 *         if len(item.leaves) in (1, 2, 3) and isinstance(item.leaves[-1], Integer):
 *             r = 1.0
 */

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_17RegularPolygonBox_init(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_graphics, PyObject *__pyx_v_style, PyObject *__pyx_v_item) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_34_init *__pyx_cur_scope;
  PyObject *__pyx_v_rspec = NULL;
  PyObject *__pyx_v_pos = NULL;
  PyObject *__pyx_v_vertices = 0;
  PyObject *__pyx_v_new_item = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("init", 0);
  __pyx_cur_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_34_init *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_34_init(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_34_init, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_34_init *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 2017, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }

  /* "mathics/builtin/graphics.py":2018
 * class RegularPolygonBox(PolygonBox):
 *     def init(self, graphics, style, item):
 *         if len(item.leaves) in (1, 2, 3) and isinstance(item.leaves[-1], Integer):             # <<<<<<<<<<<<<<
 *             r = 1.0
 *             phi0 = None
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_item, __pyx_n_s_leaves); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2018, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2018, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_5 = ((__pyx_t_3 == 1) != 0);
  if (!__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_5 = ((__pyx_t_3 == 2) != 0);
  if (!__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_5 = ((__pyx_t_3 == 3) != 0);
  __pyx_t_4 = __pyx_t_5;
  __pyx_L6_bool_binop_done:;
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (__pyx_t_5) {
  } else {
    __pyx_t_1 = __pyx_t_5;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_item, __pyx_n_s_leaves); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2018, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_2, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2018, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Integer); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2018, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = PyObject_IsInstance(__pyx_t_6, __pyx_t_2); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 2018, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (__pyx_t_5 != 0);
  __pyx_t_1 = __pyx_t_4;
  __pyx_L4_bool_binop_done:;
  if (likely(__pyx_t_1)) {

    /* "mathics/builtin/graphics.py":2019
 *     def init(self, graphics, style, item):
 *         if len(item.leaves) in (1, 2, 3) and isinstance(item.leaves[-1], Integer):
 *             r = 1.0             # <<<<<<<<<<<<<<
 *             phi0 = None
 * 
 */
    __Pyx_INCREF(__pyx_float_1_0);
    __Pyx_GIVEREF(__pyx_float_1_0);
    __pyx_cur_scope->__pyx_v_r = __pyx_float_1_0;

    /* "mathics/builtin/graphics.py":2020
 *         if len(item.leaves) in (1, 2, 3) and isinstance(item.leaves[-1], Integer):
 *             r = 1.0
 *             phi0 = None             # <<<<<<<<<<<<<<
 * 
 *             if len(item.leaves) >= 2:
 */
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    __pyx_cur_scope->__pyx_v_phi0 = Py_None;

    /* "mathics/builtin/graphics.py":2022
 *             phi0 = None
 * 
 *             if len(item.leaves) >= 2:             # <<<<<<<<<<<<<<
 *                 rspec = item.leaves[-2]
 *                 if rspec.get_head_name() == "System`List":
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_item, __pyx_n_s_leaves); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2022, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2022, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_1 = ((__pyx_t_3 >= 2) != 0);
    if (__pyx_t_1) {

      /* "mathics/builtin/graphics.py":2023
 * 
 *             if len(item.leaves) >= 2:
 *                 rspec = item.leaves[-2]             # <<<<<<<<<<<<<<
 *                 if rspec.get_head_name() == "System`List":
 *                     if len(rspec.leaves) != 2:
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_item, __pyx_n_s_leaves); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2023, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_2, -2L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2023, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_rspec = __pyx_t_6;
      __pyx_t_6 = 0;

      /* "mathics/builtin/graphics.py":2024
 *             if len(item.leaves) >= 2:
 *                 rspec = item.leaves[-2]
 *                 if rspec.get_head_name() == "System`List":             # <<<<<<<<<<<<<<
 *                     if len(rspec.leaves) != 2:
 *                         raise BoxConstructError
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_rspec, __pyx_n_s_get_head_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2024, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_7 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      __pyx_t_6 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2024, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_t_6, __pyx_kp_u_System_List, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 2024, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (__pyx_t_1) {

        /* "mathics/builtin/graphics.py":2025
 *                 rspec = item.leaves[-2]
 *                 if rspec.get_head_name() == "System`List":
 *                     if len(rspec.leaves) != 2:             # <<<<<<<<<<<<<<
 *                         raise BoxConstructError
 *                     r = rspec.leaves[0].round_to_float()
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_rspec, __pyx_n_s_leaves); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2025, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_3 = PyObject_Length(__pyx_t_6); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2025, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_1 = ((__pyx_t_3 != 2) != 0);
        if (unlikely(__pyx_t_1)) {

          /* "mathics/builtin/graphics.py":2026
 *                 if rspec.get_head_name() == "System`List":
 *                     if len(rspec.leaves) != 2:
 *                         raise BoxConstructError             # <<<<<<<<<<<<<<
 *                     r = rspec.leaves[0].round_to_float()
 *                     phi0 = rspec.leaves[1].round_to_float()
 */
          __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_BoxConstructError); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2026, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_Raise(__pyx_t_6, 0, 0, 0);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __PYX_ERR(0, 2026, __pyx_L1_error)

          /* "mathics/builtin/graphics.py":2025
 *                 rspec = item.leaves[-2]
 *                 if rspec.get_head_name() == "System`List":
 *                     if len(rspec.leaves) != 2:             # <<<<<<<<<<<<<<
 *                         raise BoxConstructError
 *                     r = rspec.leaves[0].round_to_float()
 */
        }

        /* "mathics/builtin/graphics.py":2027
 *                     if len(rspec.leaves) != 2:
 *                         raise BoxConstructError
 *                     r = rspec.leaves[0].round_to_float()             # <<<<<<<<<<<<<<
 *                     phi0 = rspec.leaves[1].round_to_float()
 *                 else:
 */
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_rspec, __pyx_n_s_leaves); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2027, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2027, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_round_to_float); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2027, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_2, function);
          }
        }
        __pyx_t_6 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2027, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_r);
        __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_r, __pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_6);
        __pyx_t_6 = 0;

        /* "mathics/builtin/graphics.py":2028
 *                         raise BoxConstructError
 *                     r = rspec.leaves[0].round_to_float()
 *                     phi0 = rspec.leaves[1].round_to_float()             # <<<<<<<<<<<<<<
 *                 else:
 *                     r = rspec.round_to_float()
 */
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_rspec, __pyx_n_s_leaves); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2028, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2028, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_round_to_float); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2028, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_2, function);
          }
        }
        __pyx_t_6 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2028, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_phi0);
        __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_phi0, __pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_6);
        __pyx_t_6 = 0;

        /* "mathics/builtin/graphics.py":2024
 *             if len(item.leaves) >= 2:
 *                 rspec = item.leaves[-2]
 *                 if rspec.get_head_name() == "System`List":             # <<<<<<<<<<<<<<
 *                     if len(rspec.leaves) != 2:
 *                         raise BoxConstructError
 */
        goto __pyx_L10;
      }

      /* "mathics/builtin/graphics.py":2030
 *                     phi0 = rspec.leaves[1].round_to_float()
 *                 else:
 *                     r = rspec.round_to_float()             # <<<<<<<<<<<<<<
 * 
 *             x = 0.0
 */
      /*else*/ {
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_rspec, __pyx_n_s_round_to_float); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2030, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_2, function);
          }
        }
        __pyx_t_6 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2030, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_r);
        __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_r, __pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_6);
        __pyx_t_6 = 0;
      }
      __pyx_L10:;

      /* "mathics/builtin/graphics.py":2022
 *             phi0 = None
 * 
 *             if len(item.leaves) >= 2:             # <<<<<<<<<<<<<<
 *                 rspec = item.leaves[-2]
 *                 if rspec.get_head_name() == "System`List":
 */
    }

    /* "mathics/builtin/graphics.py":2032
 *                     r = rspec.round_to_float()
 * 
 *             x = 0.0             # <<<<<<<<<<<<<<
 *             y = 0.0
 *             if len(item.leaves) == 3:
 */
    __Pyx_INCREF(__pyx_float_0_0);
    __Pyx_GIVEREF(__pyx_float_0_0);
    __pyx_cur_scope->__pyx_v_x = __pyx_float_0_0;

    /* "mathics/builtin/graphics.py":2033
 * 
 *             x = 0.0
 *             y = 0.0             # <<<<<<<<<<<<<<
 *             if len(item.leaves) == 3:
 *                 pos = item.leaves[0]
 */
    __Pyx_INCREF(__pyx_float_0_0);
    __Pyx_GIVEREF(__pyx_float_0_0);
    __pyx_cur_scope->__pyx_v_y = __pyx_float_0_0;

    /* "mathics/builtin/graphics.py":2034
 *             x = 0.0
 *             y = 0.0
 *             if len(item.leaves) == 3:             # <<<<<<<<<<<<<<
 *                 pos = item.leaves[0]
 *                 if not pos.has_form("List", 2):
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_item, __pyx_n_s_leaves); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2034, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_3 = PyObject_Length(__pyx_t_6); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2034, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_1 = ((__pyx_t_3 == 3) != 0);
    if (__pyx_t_1) {

      /* "mathics/builtin/graphics.py":2035
 *             y = 0.0
 *             if len(item.leaves) == 3:
 *                 pos = item.leaves[0]             # <<<<<<<<<<<<<<
 *                 if not pos.has_form("List", 2):
 *                     raise BoxConstructError
 */
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_item, __pyx_n_s_leaves); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2035, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_6, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2035, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_v_pos = __pyx_t_2;
      __pyx_t_2 = 0;

      /* "mathics/builtin/graphics.py":2036
 *             if len(item.leaves) == 3:
 *                 pos = item.leaves[0]
 *                 if not pos.has_form("List", 2):             # <<<<<<<<<<<<<<
 *                     raise BoxConstructError
 *                 x = pos.leaves[0].round_to_float()
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_pos, __pyx_n_s_has_form); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2036, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2036, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 2036, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_4 = ((!__pyx_t_1) != 0);
      if (unlikely(__pyx_t_4)) {

        /* "mathics/builtin/graphics.py":2037
 *                 pos = item.leaves[0]
 *                 if not pos.has_form("List", 2):
 *                     raise BoxConstructError             # <<<<<<<<<<<<<<
 *                 x = pos.leaves[0].round_to_float()
 *                 y = pos.leaves[1].round_to_float()
 */
        __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_BoxConstructError); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2037, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_Raise(__pyx_t_6, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __PYX_ERR(0, 2037, __pyx_L1_error)

        /* "mathics/builtin/graphics.py":2036
 *             if len(item.leaves) == 3:
 *                 pos = item.leaves[0]
 *                 if not pos.has_form("List", 2):             # <<<<<<<<<<<<<<
 *                     raise BoxConstructError
 *                 x = pos.leaves[0].round_to_float()
 */
      }

      /* "mathics/builtin/graphics.py":2038
 *                 if not pos.has_form("List", 2):
 *                     raise BoxConstructError
 *                 x = pos.leaves[0].round_to_float()             # <<<<<<<<<<<<<<
 *                 y = pos.leaves[1].round_to_float()
 * 
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_pos, __pyx_n_s_leaves); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2038, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2038, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_round_to_float); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2038, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      __pyx_t_6 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2038, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_x);
      __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_x, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_6);
      __pyx_t_6 = 0;

      /* "mathics/builtin/graphics.py":2039
 *                     raise BoxConstructError
 *                 x = pos.leaves[0].round_to_float()
 *                 y = pos.leaves[1].round_to_float()             # <<<<<<<<<<<<<<
 * 
 *             n = item.leaves[-1].get_int_value()
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_pos, __pyx_n_s_leaves); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2039, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2039, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_round_to_float); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2039, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      __pyx_t_6 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2039, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_y);
      __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_y, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_6);
      __pyx_t_6 = 0;

      /* "mathics/builtin/graphics.py":2034
 *             x = 0.0
 *             y = 0.0
 *             if len(item.leaves) == 3:             # <<<<<<<<<<<<<<
 *                 pos = item.leaves[0]
 *                 if not pos.has_form("List", 2):
 */
    }

    /* "mathics/builtin/graphics.py":2041
 *                 y = pos.leaves[1].round_to_float()
 * 
 *             n = item.leaves[-1].get_int_value()             # <<<<<<<<<<<<<<
 * 
 *             if any(t is None for t in (x, y, r)) or n < 0:
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_item, __pyx_n_s_leaves); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2041, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_2, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2041, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_get_int_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2041, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_6 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2041, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GIVEREF(__pyx_t_6);
    __pyx_cur_scope->__pyx_v_n = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "mathics/builtin/graphics.py":2043
 *             n = item.leaves[-1].get_int_value()
 * 
 *             if any(t is None for t in (x, y, r)) or n < 0:             # <<<<<<<<<<<<<<
 *                 raise BoxConstructError
 * 
 */
    __pyx_t_6 = __pyx_pf_7mathics_7builtin_8graphics_17RegularPolygonBox_4init_3genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2043, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_2 = __Pyx_Generator_Next(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2043, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 2043, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!__pyx_t_1) {
    } else {
      __pyx_t_4 = __pyx_t_1;
      goto __pyx_L15_bool_binop_done;
    }
    __pyx_t_2 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_n, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2043, __pyx_L1_error)
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 2043, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_4 = __pyx_t_1;
    __pyx_L15_bool_binop_done:;
    if (unlikely(__pyx_t_4)) {

      /* "mathics/builtin/graphics.py":2044
 * 
 *             if any(t is None for t in (x, y, r)) or n < 0:
 *                 raise BoxConstructError             # <<<<<<<<<<<<<<
 * 
 *             if phi0 is None:
 */
      __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_BoxConstructError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2044, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(0, 2044, __pyx_L1_error)

      /* "mathics/builtin/graphics.py":2043
 *             n = item.leaves[-1].get_int_value()
 * 
 *             if any(t is None for t in (x, y, r)) or n < 0:             # <<<<<<<<<<<<<<
 *                 raise BoxConstructError
 * 
 */
    }

    /* "mathics/builtin/graphics.py":2046
 *                 raise BoxConstructError
 * 
 *             if phi0 is None:             # <<<<<<<<<<<<<<
 *                 phi0 = -pi / 2.0
 *                 if n % 1 == 0 and n > 0:
 */
    __pyx_t_4 = (__pyx_cur_scope->__pyx_v_phi0 == Py_None);
    __pyx_t_1 = (__pyx_t_4 != 0);
    if (__pyx_t_1) {

      /* "mathics/builtin/graphics.py":2047
 * 
 *             if phi0 is None:
 *                 phi0 = -pi / 2.0             # <<<<<<<<<<<<<<
 *                 if n % 1 == 0 and n > 0:
 *                     phi0 += pi / n
 */
      __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_pi); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2047, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_6 = PyNumber_Negative(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2047, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_PyFloat_TrueDivideObjC(__pyx_t_6, __pyx_float_2_0, 2.0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2047, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_phi0);
      __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_phi0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;

      /* "mathics/builtin/graphics.py":2048
 *             if phi0 is None:
 *                 phi0 = -pi / 2.0
 *                 if n % 1 == 0 and n > 0:             # <<<<<<<<<<<<<<
 *                     phi0 += pi / n
 * 
 */
      __pyx_t_2 = __Pyx_PyInt_RemainderObjC(__pyx_cur_scope->__pyx_v_n, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2048, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_6 = __Pyx_PyInt_EqObjC(__pyx_t_2, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2048, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 2048, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (__pyx_t_4) {
      } else {
        __pyx_t_1 = __pyx_t_4;
        goto __pyx_L19_bool_binop_done;
      }
      __pyx_t_6 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_n, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2048, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 2048, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_1 = __pyx_t_4;
      __pyx_L19_bool_binop_done:;
      if (__pyx_t_1) {

        /* "mathics/builtin/graphics.py":2049
 *                 phi0 = -pi / 2.0
 *                 if n % 1 == 0 and n > 0:
 *                     phi0 += pi / n             # <<<<<<<<<<<<<<
 * 
 *             pi2 = pi * 2.0
 */
        __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_pi); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2049, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_6, __pyx_cur_scope->__pyx_v_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2049, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_cur_scope->__pyx_v_phi0, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2049, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_phi0);
        __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_phi0, __pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_6);
        __pyx_t_6 = 0;

        /* "mathics/builtin/graphics.py":2048
 *             if phi0 is None:
 *                 phi0 = -pi / 2.0
 *                 if n % 1 == 0 and n > 0:             # <<<<<<<<<<<<<<
 *                     phi0 += pi / n
 * 
 */
      }

      /* "mathics/builtin/graphics.py":2046
 *                 raise BoxConstructError
 * 
 *             if phi0 is None:             # <<<<<<<<<<<<<<
 *                 phi0 = -pi / 2.0
 *                 if n % 1 == 0 and n > 0:
 */
    }

    /* "mathics/builtin/graphics.py":2051
 *                     phi0 += pi / n
 * 
 *             pi2 = pi * 2.0             # <<<<<<<<<<<<<<
 * 
 *             def vertices():
 */
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_pi); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2051, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_2 = PyNumber_Multiply(__pyx_t_6, __pyx_float_2_0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2051, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_cur_scope->__pyx_v_pi2 = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "mathics/builtin/graphics.py":2053
 *             pi2 = pi * 2.0
 * 
 *             def vertices():             # <<<<<<<<<<<<<<
 *                 for i in range(n):
 *                     phi = phi0 + pi2 * i / float(n)
 */
    __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_17RegularPolygonBox_4init_1vertices, 0, __pyx_n_s_RegularPolygonBox_init_locals_ve, ((PyObject*)__pyx_cur_scope), __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__69)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2053, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_vertices = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "mathics/builtin/graphics.py":2060
 *                     )
 * 
 *             new_item = Expression(             # <<<<<<<<<<<<<<
 *                 "RegularPolygonBox", Expression("List", *list(vertices()))
 *             )
 */
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_Expression); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2060, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);

    /* "mathics/builtin/graphics.py":2061
 * 
 *             new_item = Expression(
 *                 "RegularPolygonBox", Expression("List", *list(vertices()))             # <<<<<<<<<<<<<<
 *             )
 *         else:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Expression); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2061, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __pyx_pf_7mathics_7builtin_8graphics_17RegularPolygonBox_4init_vertices(__pyx_v_vertices); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2061, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = PySequence_List(__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2061, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = PySequence_Tuple(__pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2061, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = PyNumber_Add(__pyx_tuple__11, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2061, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2061, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = NULL;
    __pyx_t_10 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_10 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_6)) {
      PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_n_u_RegularPolygonBox, __pyx_t_8};
      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2060, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
      PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_n_u_RegularPolygonBox, __pyx_t_8};
      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2060, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    } else
    #endif
    {
      __pyx_t_7 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2060, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (__pyx_t_9) {
        __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_9); __pyx_t_9 = NULL;
      }
      __Pyx_INCREF(__pyx_n_u_RegularPolygonBox);
      __Pyx_GIVEREF(__pyx_n_u_RegularPolygonBox);
      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_10, __pyx_n_u_RegularPolygonBox);
      __Pyx_GIVEREF(__pyx_t_8);
      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_10, __pyx_t_8);
      __pyx_t_8 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2060, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_new_item = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "mathics/builtin/graphics.py":2018
 * class RegularPolygonBox(PolygonBox):
 *     def init(self, graphics, style, item):
 *         if len(item.leaves) in (1, 2, 3) and isinstance(item.leaves[-1], Integer):             # <<<<<<<<<<<<<<
 *             r = 1.0
 *             phi0 = None
 */
    goto __pyx_L3;
  }

  /* "mathics/builtin/graphics.py":2064
 *             )
 *         else:
 *             raise BoxConstructError             # <<<<<<<<<<<<<<
 * 
 *         super(RegularPolygonBox, self).init(graphics, style, new_item)
 */
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_BoxConstructError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2064, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 2064, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "mathics/builtin/graphics.py":2066
 *             raise BoxConstructError
 * 
 *         super(RegularPolygonBox, self).init(graphics, style, new_item)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_RegularPolygonBox); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2066, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2066, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6);
  __Pyx_INCREF(__pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_self);
  __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2066, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_init); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2066, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  __pyx_t_10 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
      __pyx_t_10 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_7)) {
    PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_v_graphics, __pyx_v_style, __pyx_v_new_item};
    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_10, 3+__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2066, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
    PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_v_graphics, __pyx_v_style, __pyx_v_new_item};
    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_10, 3+__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2066, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else
  #endif
  {
    __pyx_t_8 = PyTuple_New(3+__pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2066, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    if (__pyx_t_6) {
      __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
    }
    __Pyx_INCREF(__pyx_v_graphics);
    __Pyx_GIVEREF(__pyx_v_graphics);
    PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_10, __pyx_v_graphics);
    __Pyx_INCREF(__pyx_v_style);
    __Pyx_GIVEREF(__pyx_v_style);
    PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_10, __pyx_v_style);
    __Pyx_INCREF(__pyx_v_new_item);
    __Pyx_GIVEREF(__pyx_v_new_item);
    PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_10, __pyx_v_new_item);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2066, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  }
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":2017
 * 
 * class RegularPolygonBox(PolygonBox):
 *     def init(self, graphics, style, item):             # <<<<<<<<<<<<<<
 *         if len(item.leaves) in (1, 2, 3) and isinstance(item.leaves[-1], Integer):
 *             r = 1.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_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("mathics.builtin.graphics.RegularPolygonBox.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_rspec);
  __Pyx_XDECREF(__pyx_v_pos);
  __Pyx_XDECREF(__pyx_v_vertices);
  __Pyx_XDECREF(__pyx_v_new_item);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":2137
 *     }
 * 
 *     def init(self, graphics, item=None):             # <<<<<<<<<<<<<<
 *         super(Arrowheads, self).init(graphics, item)
 *         if len(item.leaves) != 1:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_10Arrowheads_1init(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_10Arrowheads_1init = {"init", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_10Arrowheads_1init, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_10Arrowheads_1init(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_graphics = 0;
  PyObject *__pyx_v_item = 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);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_graphics,&__pyx_n_s_item,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject *)((PyObject *)Py_None));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_graphics)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("init", 0, 2, 3, 1); __PYX_ERR(0, 2137, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_item);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "init") < 0)) __PYX_ERR(0, 2137, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_graphics = values[1];
    __pyx_v_item = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("init", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2137, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.Arrowheads.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_10Arrowheads_init(__pyx_self, __pyx_v_self, __pyx_v_graphics, __pyx_v_item);

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_10Arrowheads_init(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_graphics, PyObject *__pyx_v_item) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  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);

  /* "mathics/builtin/graphics.py":2138
 * 
 *     def init(self, graphics, item=None):
 *         super(Arrowheads, self).init(graphics, item)             # <<<<<<<<<<<<<<
 *         if len(item.leaves) != 1:
 *             raise BoxConstructError
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Arrowheads); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_INCREF(__pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_graphics, __pyx_v_item};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2138, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_graphics, __pyx_v_item};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2138, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2138, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_2) {
      __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
    }
    __Pyx_INCREF(__pyx_v_graphics);
    __Pyx_GIVEREF(__pyx_v_graphics);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_graphics);
    __Pyx_INCREF(__pyx_v_item);
    __Pyx_GIVEREF(__pyx_v_item);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_item);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2138, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":2139
 *     def init(self, graphics, item=None):
 *         super(Arrowheads, self).init(graphics, item)
 *         if len(item.leaves) != 1:             # <<<<<<<<<<<<<<
 *             raise BoxConstructError
 *         self.spec = item.leaves[0]
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_item, __pyx_n_s_leaves); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2139, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2139, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_7 = ((__pyx_t_6 != 1) != 0);
  if (unlikely(__pyx_t_7)) {

    /* "mathics/builtin/graphics.py":2140
 *         super(Arrowheads, self).init(graphics, item)
 *         if len(item.leaves) != 1:
 *             raise BoxConstructError             # <<<<<<<<<<<<<<
 *         self.spec = item.leaves[0]
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_BoxConstructError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2140, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 2140, __pyx_L1_error)

    /* "mathics/builtin/graphics.py":2139
 *     def init(self, graphics, item=None):
 *         super(Arrowheads, self).init(graphics, item)
 *         if len(item.leaves) != 1:             # <<<<<<<<<<<<<<
 *             raise BoxConstructError
 *         self.spec = item.leaves[0]
 */
  }

  /* "mathics/builtin/graphics.py":2141
 *         if len(item.leaves) != 1:
 *             raise BoxConstructError
 *         self.spec = item.leaves[0]             # <<<<<<<<<<<<<<
 * 
 *     def _arrow_size(self, s, extent):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_item, __pyx_n_s_leaves); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2141, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2141, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_spec, __pyx_t_3) < 0) __PYX_ERR(0, 2141, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":2137
 *     }
 * 
 *     def init(self, graphics, item=None):             # <<<<<<<<<<<<<<
 *         super(Arrowheads, self).init(graphics, item)
 *         if len(item.leaves) != 1:
 */

  /* 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("mathics.builtin.graphics.Arrowheads.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":2143
 *         self.spec = item.leaves[0]
 * 
 *     def _arrow_size(self, s, extent):             # <<<<<<<<<<<<<<
 *         if isinstance(s, Symbol):
 *             size = self.symbolic_sizes.get(s.get_name(), 0)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_10Arrowheads_3_arrow_size(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_10Arrowheads_3_arrow_size = {"_arrow_size", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_10Arrowheads_3_arrow_size, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_10Arrowheads_3_arrow_size(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_s = 0;
  PyObject *__pyx_v_extent = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_arrow_size (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_s,&__pyx_n_s_extent,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_s)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_arrow_size", 1, 3, 3, 1); __PYX_ERR(0, 2143, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_extent)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_arrow_size", 1, 3, 3, 2); __PYX_ERR(0, 2143, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_arrow_size") < 0)) __PYX_ERR(0, 2143, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_self = values[0];
    __pyx_v_s = values[1];
    __pyx_v_extent = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_arrow_size", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2143, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.Arrowheads._arrow_size", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_10Arrowheads_2_arrow_size(__pyx_self, __pyx_v_self, __pyx_v_s, __pyx_v_extent);

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_10Arrowheads_2_arrow_size(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_s, PyObject *__pyx_v_extent) {
  PyObject *__pyx_v_size = 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;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_arrow_size", 0);

  /* "mathics/builtin/graphics.py":2144
 * 
 *     def _arrow_size(self, s, extent):
 *         if isinstance(s, Symbol):             # <<<<<<<<<<<<<<
 *             size = self.symbolic_sizes.get(s.get_name(), 0)
 *             return self.graphics.translate_absolute((size, 0))[0]
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Symbol); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2144, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_IsInstance(__pyx_v_s, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 2144, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "mathics/builtin/graphics.py":2145
 *     def _arrow_size(self, s, extent):
 *         if isinstance(s, Symbol):
 *             size = self.symbolic_sizes.get(s.get_name(), 0)             # <<<<<<<<<<<<<<
 *             return self.graphics.translate_absolute((size, 0))[0]
 *         else:
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_symbolic_sizes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2145, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_get); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2145, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_get_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2145, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2145, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    __pyx_t_8 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_8 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_4, __pyx_int_0};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2145, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_4, __pyx_int_0};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2145, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else
    #endif
    {
      __pyx_t_7 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2145, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (__pyx_t_6) {
        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_t_4);
      __Pyx_INCREF(__pyx_int_0);
      __Pyx_GIVEREF(__pyx_int_0);
      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_int_0);
      __pyx_t_4 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2145, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_size = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "mathics/builtin/graphics.py":2146
 *         if isinstance(s, Symbol):
 *             size = self.symbolic_sizes.get(s.get_name(), 0)
 *             return self.graphics.translate_absolute((size, 0))[0]             # <<<<<<<<<<<<<<
 *         else:
 *             return _to_float(s) * extent
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_graphics); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2146, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_translate_absolute); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2146, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2146, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_size);
    __Pyx_GIVEREF(__pyx_v_size);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_size);
    __Pyx_INCREF(__pyx_int_0);
    __Pyx_GIVEREF(__pyx_int_0);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_int_0);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2146, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2146, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = __pyx_t_7;
    __pyx_t_7 = 0;
    goto __pyx_L0;

    /* "mathics/builtin/graphics.py":2144
 * 
 *     def _arrow_size(self, s, extent):
 *         if isinstance(s, Symbol):             # <<<<<<<<<<<<<<
 *             size = self.symbolic_sizes.get(s.get_name(), 0)
 *             return self.graphics.translate_absolute((size, 0))[0]
 */
  }

  /* "mathics/builtin/graphics.py":2148
 *             return self.graphics.translate_absolute((size, 0))[0]
 *         else:
 *             return _to_float(s) * extent             # <<<<<<<<<<<<<<
 * 
 *     def heads(self, extent, default_arrow, custom_arrow):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_to_float); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2148, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_7 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_v_s) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_s);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2148, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyNumber_Multiply(__pyx_t_7, __pyx_v_extent); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2148, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
  }

  /* "mathics/builtin/graphics.py":2143
 *         self.spec = item.leaves[0]
 * 
 *     def _arrow_size(self, s, extent):             # <<<<<<<<<<<<<<
 *         if isinstance(s, Symbol):
 *             size = self.symbolic_sizes.get(s.get_name(), 0)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("mathics.builtin.graphics.Arrowheads._arrow_size", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_size);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7mathics_7builtin_8graphics_10Arrowheads_6generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "mathics/builtin/graphics.py":2150
 *             return _to_float(s) * extent
 * 
 *     def heads(self, extent, default_arrow, custom_arrow):             # <<<<<<<<<<<<<<
 *         # see https://reference.wolfram.com/language/ref/Arrowheads.html
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_10Arrowheads_5heads(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_10Arrowheads_5heads = {"heads", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_10Arrowheads_5heads, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_10Arrowheads_5heads(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_extent = 0;
  PyObject *__pyx_v_default_arrow = 0;
  PyObject *__pyx_v_custom_arrow = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("heads (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_extent,&__pyx_n_s_default_arrow,&__pyx_n_s_custom_arrow,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_extent)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("heads", 1, 4, 4, 1); __PYX_ERR(0, 2150, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_default_arrow)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("heads", 1, 4, 4, 2); __PYX_ERR(0, 2150, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_custom_arrow)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("heads", 1, 4, 4, 3); __PYX_ERR(0, 2150, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "heads") < 0)) __PYX_ERR(0, 2150, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __pyx_v_self = values[0];
    __pyx_v_extent = values[1];
    __pyx_v_default_arrow = values[2];
    __pyx_v_custom_arrow = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("heads", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2150, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.Arrowheads.heads", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_10Arrowheads_4heads(__pyx_self, __pyx_v_self, __pyx_v_extent, __pyx_v_default_arrow, __pyx_v_custom_arrow);

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

/* "mathics/builtin/graphics.py":2155
 *         if self.spec.get_head_name() == "System`List":
 *             leaves = self.spec.leaves
 *             if all(x.get_head_name() == "System`List" for x in leaves):             # <<<<<<<<<<<<<<
 *                 for head in leaves:
 *                     spec = head.leaves
 */

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_10Arrowheads_5heads_genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_38_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_7mathics_7builtin_8graphics___pyx_scope_struct_38_genexpr *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_38_genexpr(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_38_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_38_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 2155, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_37_heads *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7mathics_7builtin_8graphics_10Arrowheads_5heads_2generator27, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_Arrowheads_heads_locals_genexpr, __pyx_n_s_mathics_builtin_graphics); if (unlikely(!gen)) __PYX_ERR(0, 2155, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.Arrowheads.heads.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_7mathics_7builtin_8graphics_10Arrowheads_5heads_2generator27(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_38_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_38_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2155, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_leaves)) { __Pyx_RaiseClosureNameError("leaves"); __PYX_ERR(0, 2155, __pyx_L1_error) }
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_leaves)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_leaves)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_leaves; __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_outer_scope->__pyx_v_leaves); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2155, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2155, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 2155, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2155, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 2155, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2155, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 2155, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_x);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_x, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_x, __pyx_n_s_get_head_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2155, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2155, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_kp_u_System_List, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 2155, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_8 = ((!__pyx_t_7) != 0);
    if (__pyx_t_8) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_False);
      __pyx_r = Py_False;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
  }
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_True);
    __pyx_r = Py_True;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

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

/* "mathics/builtin/graphics.py":2150
 *             return _to_float(s) * extent
 * 
 *     def heads(self, extent, default_arrow, custom_arrow):             # <<<<<<<<<<<<<<
 *         # see https://reference.wolfram.com/language/ref/Arrowheads.html
 * 
 */

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_10Arrowheads_4heads(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_extent, PyObject *__pyx_v_default_arrow, PyObject *__pyx_v_custom_arrow) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_37_heads *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("heads", 0);
  __pyx_cur_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_37_heads *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_37_heads(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_37_heads, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_37_heads *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 2150, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self);
  __pyx_cur_scope->__pyx_v_extent = __pyx_v_extent;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_extent);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_extent);
  __pyx_cur_scope->__pyx_v_default_arrow = __pyx_v_default_arrow;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_default_arrow);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_default_arrow);
  __pyx_cur_scope->__pyx_v_custom_arrow = __pyx_v_custom_arrow;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_custom_arrow);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_custom_arrow);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7mathics_7builtin_8graphics_10Arrowheads_6generator2, __pyx_codeobj__70, (PyObject *) __pyx_cur_scope, __pyx_n_s_heads, __pyx_n_s_Arrowheads_heads, __pyx_n_s_mathics_builtin_graphics); if (unlikely(!gen)) __PYX_ERR(0, 2150, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.Arrowheads.heads", __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_7mathics_7builtin_8graphics_10Arrowheads_6generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_37_heads *__pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_37_heads *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  PyObject *(*__pyx_t_6)(PyObject *);
  Py_ssize_t __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  double __pyx_t_13;
  double __pyx_t_14;
  double __pyx_t_15;
  PyObject *__pyx_t_16 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("heads", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L22_resume_from_yield;
    case 2: goto __pyx_L25_resume_from_yield;
    case 3: goto __pyx_L26_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2150, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2153
 *         # see https://reference.wolfram.com/language/ref/Arrowheads.html
 * 
 *         if self.spec.get_head_name() == "System`List":             # <<<<<<<<<<<<<<
 *             leaves = self.spec.leaves
 *             if all(x.get_head_name() == "System`List" for x in leaves):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_spec); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_get_head_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_System_List, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 2153, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

    /* "mathics/builtin/graphics.py":2154
 * 
 *         if self.spec.get_head_name() == "System`List":
 *             leaves = self.spec.leaves             # <<<<<<<<<<<<<<
 *             if all(x.get_head_name() == "System`List" for x in leaves):
 *                 for head in leaves:
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_spec); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2154, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_leaves); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2154, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_cur_scope->__pyx_v_leaves = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "mathics/builtin/graphics.py":2155
 *         if self.spec.get_head_name() == "System`List":
 *             leaves = self.spec.leaves
 *             if all(x.get_head_name() == "System`List" for x in leaves):             # <<<<<<<<<<<<<<
 *                 for head in leaves:
 *                     spec = head.leaves
 */
    __pyx_t_3 = __pyx_pf_7mathics_7builtin_8graphics_10Arrowheads_5heads_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2155, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_Generator_Next(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2155, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 2155, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_4) {

      /* "mathics/builtin/graphics.py":2156
 *             leaves = self.spec.leaves
 *             if all(x.get_head_name() == "System`List" for x in leaves):
 *                 for head in leaves:             # <<<<<<<<<<<<<<
 *                     spec = head.leaves
 *                     if len(spec) not in (2, 3):
 */
      if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_leaves)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_leaves)) {
        __pyx_t_1 = __pyx_cur_scope->__pyx_v_leaves; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = 0;
        __pyx_t_6 = NULL;
      } else {
        __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_leaves); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2156, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_6 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2156, __pyx_L1_error)
      }
      for (;;) {
        if (likely(!__pyx_t_6)) {
          if (likely(PyList_CheckExact(__pyx_t_1))) {
            if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_1)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 2156, __pyx_L1_error)
            #else
            __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2156, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            #endif
          } else {
            if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 2156, __pyx_L1_error)
            #else
            __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2156, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            #endif
          }
        } else {
          __pyx_t_3 = __pyx_t_6(__pyx_t_1);
          if (unlikely(!__pyx_t_3)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 2156, __pyx_L1_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_3);
        }
        __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_head);
        __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_head, __pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_3);
        __pyx_t_3 = 0;

        /* "mathics/builtin/graphics.py":2157
 *             if all(x.get_head_name() == "System`List" for x in leaves):
 *                 for head in leaves:
 *                     spec = head.leaves             # <<<<<<<<<<<<<<
 *                     if len(spec) not in (2, 3):
 *                         raise BoxConstructError
 */
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_head, __pyx_n_s_leaves); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2157, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_spec);
        __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_spec, __pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_3);
        __pyx_t_3 = 0;

        /* "mathics/builtin/graphics.py":2158
 *                 for head in leaves:
 *                     spec = head.leaves
 *                     if len(spec) not in (2, 3):             # <<<<<<<<<<<<<<
 *                         raise BoxConstructError
 *                     size_spec = spec[0]
 */
        __pyx_t_7 = PyObject_Length(__pyx_cur_scope->__pyx_v_spec); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2158, __pyx_L1_error)
        __pyx_t_8 = ((__pyx_t_7 != 2) != 0);
        if (__pyx_t_8) {
        } else {
          __pyx_t_4 = __pyx_t_8;
          goto __pyx_L9_bool_binop_done;
        }
        __pyx_t_8 = ((__pyx_t_7 != 3) != 0);
        __pyx_t_4 = __pyx_t_8;
        __pyx_L9_bool_binop_done:;
        __pyx_t_8 = (__pyx_t_4 != 0);
        if (unlikely(__pyx_t_8)) {

          /* "mathics/builtin/graphics.py":2159
 *                     spec = head.leaves
 *                     if len(spec) not in (2, 3):
 *                         raise BoxConstructError             # <<<<<<<<<<<<<<
 *                     size_spec = spec[0]
 *                     if (
 */
          __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_BoxConstructError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2159, __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(0, 2159, __pyx_L1_error)

          /* "mathics/builtin/graphics.py":2158
 *                 for head in leaves:
 *                     spec = head.leaves
 *                     if len(spec) not in (2, 3):             # <<<<<<<<<<<<<<
 *                         raise BoxConstructError
 *                     size_spec = spec[0]
 */
        }

        /* "mathics/builtin/graphics.py":2160
 *                     if len(spec) not in (2, 3):
 *                         raise BoxConstructError
 *                     size_spec = spec[0]             # <<<<<<<<<<<<<<
 *                     if (
 *                         isinstance(size_spec, Symbol)
 */
        __pyx_t_3 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_spec, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2160, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_size_spec);
        __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_size_spec, __pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_3);
        __pyx_t_3 = 0;

        /* "mathics/builtin/graphics.py":2162
 *                     size_spec = spec[0]
 *                     if (
 *                         isinstance(size_spec, Symbol)             # <<<<<<<<<<<<<<
 *                         and size_spec.get_name() == "System`Automatic"
 *                     ):
 */
        __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Symbol); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2162, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = PyObject_IsInstance(__pyx_cur_scope->__pyx_v_size_spec, __pyx_t_3); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 2162, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_9 = (__pyx_t_4 != 0);
        if (__pyx_t_9) {
        } else {
          __pyx_t_8 = __pyx_t_9;
          goto __pyx_L12_bool_binop_done;
        }

        /* "mathics/builtin/graphics.py":2163
 *                     if (
 *                         isinstance(size_spec, Symbol)
 *                         and size_spec.get_name() == "System`Automatic"             # <<<<<<<<<<<<<<
 *                     ):
 *                         s = self.default_size * extent
 */
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_size_spec, __pyx_n_s_get_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2163, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_10 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
          __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_2);
          if (likely(__pyx_t_10)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
            __Pyx_INCREF(__pyx_t_10);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_2, function);
          }
        }
        __pyx_t_3 = (__pyx_t_10) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_10) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2163, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_9 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_kp_u_System_Automatic, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 2163, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_8 = __pyx_t_9;
        __pyx_L12_bool_binop_done:;

        /* "mathics/builtin/graphics.py":2161
 *                         raise BoxConstructError
 *                     size_spec = spec[0]
 *                     if (             # <<<<<<<<<<<<<<
 *                         isinstance(size_spec, Symbol)
 *                         and size_spec.get_name() == "System`Automatic"
 */
        if (__pyx_t_8) {

          /* "mathics/builtin/graphics.py":2165
 *                         and size_spec.get_name() == "System`Automatic"
 *                     ):
 *                         s = self.default_size * extent             # <<<<<<<<<<<<<<
 *                     elif size_spec.is_numeric():
 *                         s = self._arrow_size(size_spec, extent)
 */
          __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_default_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2165, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_2 = PyNumber_Multiply(__pyx_t_3, __pyx_cur_scope->__pyx_v_extent); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2165, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_s);
          __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_s, __pyx_t_2);
          __Pyx_GIVEREF(__pyx_t_2);
          __pyx_t_2 = 0;

          /* "mathics/builtin/graphics.py":2161
 *                         raise BoxConstructError
 *                     size_spec = spec[0]
 *                     if (             # <<<<<<<<<<<<<<
 *                         isinstance(size_spec, Symbol)
 *                         and size_spec.get_name() == "System`Automatic"
 */
          goto __pyx_L11;
        }

        /* "mathics/builtin/graphics.py":2166
 *                     ):
 *                         s = self.default_size * extent
 *                     elif size_spec.is_numeric():             # <<<<<<<<<<<<<<
 *                         s = self._arrow_size(size_spec, extent)
 *                     else:
 */
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_size_spec, __pyx_n_s_is_numeric); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2166, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_10 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_10)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_10);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_10) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_10) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2166, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 2166, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (likely(__pyx_t_8)) {

          /* "mathics/builtin/graphics.py":2167
 *                         s = self.default_size * extent
 *                     elif size_spec.is_numeric():
 *                         s = self._arrow_size(size_spec, extent)             # <<<<<<<<<<<<<<
 *                     else:
 *                         raise BoxConstructError
 */
          __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_arrow_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2167, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_10 = NULL;
          __pyx_t_11 = 0;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
            __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_3);
            if (likely(__pyx_t_10)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
              __Pyx_INCREF(__pyx_t_10);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_3, function);
              __pyx_t_11 = 1;
            }
          }
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_3)) {
            PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_cur_scope->__pyx_v_size_spec, __pyx_cur_scope->__pyx_v_extent};
            __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2167, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_2);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
            PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_cur_scope->__pyx_v_size_spec, __pyx_cur_scope->__pyx_v_extent};
            __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2167, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_2);
          } else
          #endif
          {
            __pyx_t_12 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2167, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_12);
            if (__pyx_t_10) {
              __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_10); __pyx_t_10 = NULL;
            }
            __Pyx_INCREF(__pyx_cur_scope->__pyx_v_size_spec);
            __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_size_spec);
            PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_11, __pyx_cur_scope->__pyx_v_size_spec);
            __Pyx_INCREF(__pyx_cur_scope->__pyx_v_extent);
            __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_extent);
            PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_11, __pyx_cur_scope->__pyx_v_extent);
            __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_12, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2167, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          }
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_s);
          __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_s, __pyx_t_2);
          __Pyx_GIVEREF(__pyx_t_2);
          __pyx_t_2 = 0;

          /* "mathics/builtin/graphics.py":2166
 *                     ):
 *                         s = self.default_size * extent
 *                     elif size_spec.is_numeric():             # <<<<<<<<<<<<<<
 *                         s = self._arrow_size(size_spec, extent)
 *                     else:
 */
          goto __pyx_L11;
        }

        /* "mathics/builtin/graphics.py":2169
 *                         s = self._arrow_size(size_spec, extent)
 *                     else:
 *                         raise BoxConstructError             # <<<<<<<<<<<<<<
 * 
 *                     if len(spec) == 3 and custom_arrow:
 */
        /*else*/ {
          __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_BoxConstructError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2169, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_Raise(__pyx_t_2, 0, 0, 0);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __PYX_ERR(0, 2169, __pyx_L1_error)
        }
        __pyx_L11:;

        /* "mathics/builtin/graphics.py":2171
 *                         raise BoxConstructError
 * 
 *                     if len(spec) == 3 and custom_arrow:             # <<<<<<<<<<<<<<
 *                         graphics = spec[2]
 *                         if graphics.get_head_name() != "System`Graphics":
 */
        __pyx_t_7 = PyObject_Length(__pyx_cur_scope->__pyx_v_spec); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2171, __pyx_L1_error)
        __pyx_t_9 = ((__pyx_t_7 == 3) != 0);
        if (__pyx_t_9) {
        } else {
          __pyx_t_8 = __pyx_t_9;
          goto __pyx_L15_bool_binop_done;
        }
        __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_custom_arrow); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 2171, __pyx_L1_error)
        __pyx_t_8 = __pyx_t_9;
        __pyx_L15_bool_binop_done:;
        if (__pyx_t_8) {

          /* "mathics/builtin/graphics.py":2172
 * 
 *                     if len(spec) == 3 and custom_arrow:
 *                         graphics = spec[2]             # <<<<<<<<<<<<<<
 *                         if graphics.get_head_name() != "System`Graphics":
 *                             raise BoxConstructError
 */
          __pyx_t_2 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_spec, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2172, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_graphics);
          __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_graphics, __pyx_t_2);
          __Pyx_GIVEREF(__pyx_t_2);
          __pyx_t_2 = 0;

          /* "mathics/builtin/graphics.py":2173
 *                     if len(spec) == 3 and custom_arrow:
 *                         graphics = spec[2]
 *                         if graphics.get_head_name() != "System`Graphics":             # <<<<<<<<<<<<<<
 *                             raise BoxConstructError
 *                         arrow = custom_arrow(graphics)
 */
          __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_graphics, __pyx_n_s_get_head_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2173, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_12 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
            __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_3);
            if (likely(__pyx_t_12)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
              __Pyx_INCREF(__pyx_t_12);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_3, function);
            }
          }
          __pyx_t_2 = (__pyx_t_12) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_12) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2173, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_kp_u_System_Graphics, Py_NE)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 2173, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (unlikely(__pyx_t_8)) {

            /* "mathics/builtin/graphics.py":2174
 *                         graphics = spec[2]
 *                         if graphics.get_head_name() != "System`Graphics":
 *                             raise BoxConstructError             # <<<<<<<<<<<<<<
 *                         arrow = custom_arrow(graphics)
 *                     else:
 */
            __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_BoxConstructError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2174, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_Raise(__pyx_t_2, 0, 0, 0);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __PYX_ERR(0, 2174, __pyx_L1_error)

            /* "mathics/builtin/graphics.py":2173
 *                     if len(spec) == 3 and custom_arrow:
 *                         graphics = spec[2]
 *                         if graphics.get_head_name() != "System`Graphics":             # <<<<<<<<<<<<<<
 *                             raise BoxConstructError
 *                         arrow = custom_arrow(graphics)
 */
          }

          /* "mathics/builtin/graphics.py":2175
 *                         if graphics.get_head_name() != "System`Graphics":
 *                             raise BoxConstructError
 *                         arrow = custom_arrow(graphics)             # <<<<<<<<<<<<<<
 *                     else:
 *                         arrow = default_arrow
 */
          __Pyx_INCREF(__pyx_cur_scope->__pyx_v_custom_arrow);
          __pyx_t_3 = __pyx_cur_scope->__pyx_v_custom_arrow; __pyx_t_12 = NULL;
          if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
            __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_3);
            if (likely(__pyx_t_12)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
              __Pyx_INCREF(__pyx_t_12);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_3, function);
            }
          }
          __pyx_t_2 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_12, __pyx_cur_scope->__pyx_v_graphics) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_cur_scope->__pyx_v_graphics);
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2175, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_arrow);
          __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_arrow, __pyx_t_2);
          __Pyx_GIVEREF(__pyx_t_2);
          __pyx_t_2 = 0;

          /* "mathics/builtin/graphics.py":2171
 *                         raise BoxConstructError
 * 
 *                     if len(spec) == 3 and custom_arrow:             # <<<<<<<<<<<<<<
 *                         graphics = spec[2]
 *                         if graphics.get_head_name() != "System`Graphics":
 */
          goto __pyx_L14;
        }

        /* "mathics/builtin/graphics.py":2177
 *                         arrow = custom_arrow(graphics)
 *                     else:
 *                         arrow = default_arrow             # <<<<<<<<<<<<<<
 * 
 *                     if not isinstance(spec[1], (Real, Rational, Integer)):
 */
        /*else*/ {
          __Pyx_INCREF(__pyx_cur_scope->__pyx_v_default_arrow);
          __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_arrow);
          __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_arrow, __pyx_cur_scope->__pyx_v_default_arrow);
          __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_default_arrow);
        }
        __pyx_L14:;

        /* "mathics/builtin/graphics.py":2179
 *                         arrow = default_arrow
 * 
 *                     if not isinstance(spec[1], (Real, Rational, Integer)):             # <<<<<<<<<<<<<<
 *                         raise BoxConstructError
 * 
 */
        __pyx_t_2 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_spec, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2179, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Real); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2179, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_Rational); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2179, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_Integer); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2179, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_9 = PyObject_IsInstance(__pyx_t_2, __pyx_t_3); 
        __pyx_t_4 = (__pyx_t_9 != 0);
        if (!__pyx_t_4) {
        } else {
          __pyx_t_8 = __pyx_t_4;
          goto __pyx_L19_bool_binop_done;
        }
        __pyx_t_4 = PyObject_IsInstance(__pyx_t_2, __pyx_t_12); 
        __pyx_t_9 = (__pyx_t_4 != 0);
        if (!__pyx_t_9) {
        } else {
          __pyx_t_8 = __pyx_t_9;
          goto __pyx_L19_bool_binop_done;
        }
        __pyx_t_9 = PyObject_IsInstance(__pyx_t_2, __pyx_t_10); 
        __pyx_t_4 = (__pyx_t_9 != 0);
        __pyx_t_8 = __pyx_t_4;
        __pyx_L19_bool_binop_done:;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_4 = ((!(__pyx_t_8 != 0)) != 0);
        if (unlikely(__pyx_t_4)) {

          /* "mathics/builtin/graphics.py":2180
 * 
 *                     if not isinstance(spec[1], (Real, Rational, Integer)):
 *                         raise BoxConstructError             # <<<<<<<<<<<<<<
 * 
 *                     yield s, _to_float(spec[1]), arrow
 */
          __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_BoxConstructError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2180, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_Raise(__pyx_t_2, 0, 0, 0);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __PYX_ERR(0, 2180, __pyx_L1_error)

          /* "mathics/builtin/graphics.py":2179
 *                         arrow = default_arrow
 * 
 *                     if not isinstance(spec[1], (Real, Rational, Integer)):             # <<<<<<<<<<<<<<
 *                         raise BoxConstructError
 * 
 */
        }

        /* "mathics/builtin/graphics.py":2182
 *                         raise BoxConstructError
 * 
 *                     yield s, _to_float(spec[1]), arrow             # <<<<<<<<<<<<<<
 *             else:
 *                 n = max(1.0, len(leaves) - 1.0)
 */
        __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_to_float); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2182, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_12 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_spec, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2182, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_10 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_10)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_10);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_10, __pyx_t_12) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_12);
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2182, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2182, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_INCREF(__pyx_cur_scope->__pyx_v_s);
        __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_s);
        PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_cur_scope->__pyx_v_s);
        __Pyx_GIVEREF(__pyx_t_2);
        PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
        __Pyx_INCREF(__pyx_cur_scope->__pyx_v_arrow);
        __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_arrow);
        PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_cur_scope->__pyx_v_arrow);
        __pyx_t_2 = 0;
        __pyx_r = __pyx_t_3;
        __pyx_t_3 = 0;
        __Pyx_XGIVEREF(__pyx_t_1);
        __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
        __pyx_cur_scope->__pyx_t_1 = __pyx_t_5;
        __pyx_cur_scope->__pyx_t_2 = __pyx_t_6;
        __Pyx_XGIVEREF(__pyx_r);
        __Pyx_RefNannyFinishContext();
        __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
        /* return from generator, yielding value */
        __pyx_generator->resume_label = 1;
        return __pyx_r;
        __pyx_L22_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_5 = __pyx_cur_scope->__pyx_t_1;
        __pyx_t_6 = __pyx_cur_scope->__pyx_t_2;
        if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2182, __pyx_L1_error)

        /* "mathics/builtin/graphics.py":2156
 *             leaves = self.spec.leaves
 *             if all(x.get_head_name() == "System`List" for x in leaves):
 *                 for head in leaves:             # <<<<<<<<<<<<<<
 *                     spec = head.leaves
 *                     if len(spec) not in (2, 3):
 */
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "mathics/builtin/graphics.py":2155
 *         if self.spec.get_head_name() == "System`List":
 *             leaves = self.spec.leaves
 *             if all(x.get_head_name() == "System`List" for x in leaves):             # <<<<<<<<<<<<<<
 *                 for head in leaves:
 *                     spec = head.leaves
 */
      goto __pyx_L5;
    }

    /* "mathics/builtin/graphics.py":2184
 *                     yield s, _to_float(spec[1]), arrow
 *             else:
 *                 n = max(1.0, len(leaves) - 1.0)             # <<<<<<<<<<<<<<
 *                 for i, head in enumerate(leaves):
 *                     yield self._arrow_size(head, extent), i / n, default_arrow
 */
    /*else*/ {
      __pyx_t_1 = __pyx_cur_scope->__pyx_v_leaves;
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_5 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2184, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_13 = (__pyx_t_5 - 1.0);
      __pyx_t_14 = 1.0;
      if (((__pyx_t_13 > __pyx_t_14) != 0)) {
        __pyx_t_15 = __pyx_t_13;
      } else {
        __pyx_t_15 = __pyx_t_14;
      }
      __pyx_cur_scope->__pyx_v_n = __pyx_t_15;

      /* "mathics/builtin/graphics.py":2185
 *             else:
 *                 n = max(1.0, len(leaves) - 1.0)
 *                 for i, head in enumerate(leaves):             # <<<<<<<<<<<<<<
 *                     yield self._arrow_size(head, extent), i / n, default_arrow
 *         else:
 */
      __Pyx_INCREF(__pyx_int_0);
      __pyx_t_1 = __pyx_int_0;
      if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_leaves)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_leaves)) {
        __pyx_t_3 = __pyx_cur_scope->__pyx_v_leaves; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0;
        __pyx_t_6 = NULL;
      } else {
        __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_leaves); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2185, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2185, __pyx_L1_error)
      }
      for (;;) {
        if (likely(!__pyx_t_6)) {
          if (likely(PyList_CheckExact(__pyx_t_3))) {
            if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_3)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 2185, __pyx_L1_error)
            #else
            __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2185, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            #endif
          } else {
            if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 2185, __pyx_L1_error)
            #else
            __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2185, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            #endif
          }
        } else {
          __pyx_t_2 = __pyx_t_6(__pyx_t_3);
          if (unlikely(!__pyx_t_2)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 2185, __pyx_L1_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_2);
        }
        __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_head);
        __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_head, __pyx_t_2);
        __Pyx_GIVEREF(__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_i);
        __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_i, __pyx_t_1);
        __Pyx_GIVEREF(__pyx_t_1);
        __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2185, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_1);
        __pyx_t_1 = __pyx_t_2;
        __pyx_t_2 = 0;

        /* "mathics/builtin/graphics.py":2186
 *                 n = max(1.0, len(leaves) - 1.0)
 *                 for i, head in enumerate(leaves):
 *                     yield self._arrow_size(head, extent), i / n, default_arrow             # <<<<<<<<<<<<<<
 *         else:
 *             yield self._arrow_size(self.spec, extent), 1, default_arrow
 */
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_arrow_size); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2186, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_10 = NULL;
        __pyx_t_11 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
          __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_12);
          if (likely(__pyx_t_10)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
            __Pyx_INCREF(__pyx_t_10);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_12, function);
            __pyx_t_11 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_12)) {
          PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_cur_scope->__pyx_v_head, __pyx_cur_scope->__pyx_v_extent};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2186, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
          PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_cur_scope->__pyx_v_head, __pyx_cur_scope->__pyx_v_extent};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2186, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_16 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 2186, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_16);
          if (__pyx_t_10) {
            __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_10); __pyx_t_10 = NULL;
          }
          __Pyx_INCREF(__pyx_cur_scope->__pyx_v_head);
          __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_head);
          PyTuple_SET_ITEM(__pyx_t_16, 0+__pyx_t_11, __pyx_cur_scope->__pyx_v_head);
          __Pyx_INCREF(__pyx_cur_scope->__pyx_v_extent);
          __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_extent);
          PyTuple_SET_ITEM(__pyx_t_16, 1+__pyx_t_11, __pyx_cur_scope->__pyx_v_extent);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_16, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2186, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
        }
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_n); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2186, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_16 = __Pyx_PyNumber_Divide(__pyx_cur_scope->__pyx_v_i, __pyx_t_12); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 2186, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_16);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = PyTuple_New(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2186, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_GIVEREF(__pyx_t_2);
        PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_2);
        __Pyx_GIVEREF(__pyx_t_16);
        PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_16);
        __Pyx_INCREF(__pyx_cur_scope->__pyx_v_default_arrow);
        __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_default_arrow);
        PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_cur_scope->__pyx_v_default_arrow);
        __pyx_t_2 = 0;
        __pyx_t_16 = 0;
        __pyx_r = __pyx_t_12;
        __pyx_t_12 = 0;
        __Pyx_XGIVEREF(__pyx_t_1);
        __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
        __Pyx_XGIVEREF(__pyx_t_3);
        __pyx_cur_scope->__pyx_t_3 = __pyx_t_3;
        __pyx_cur_scope->__pyx_t_1 = __pyx_t_5;
        __pyx_cur_scope->__pyx_t_2 = __pyx_t_6;
        __Pyx_XGIVEREF(__pyx_r);
        __Pyx_RefNannyFinishContext();
        __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
        /* return from generator, yielding value */
        __pyx_generator->resume_label = 2;
        return __pyx_r;
        __pyx_L25_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_3 = __pyx_cur_scope->__pyx_t_3;
        __pyx_cur_scope->__pyx_t_3 = 0;
        __Pyx_XGOTREF(__pyx_t_3);
        __pyx_t_5 = __pyx_cur_scope->__pyx_t_1;
        __pyx_t_6 = __pyx_cur_scope->__pyx_t_2;
        if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2186, __pyx_L1_error)

        /* "mathics/builtin/graphics.py":2185
 *             else:
 *                 n = max(1.0, len(leaves) - 1.0)
 *                 for i, head in enumerate(leaves):             # <<<<<<<<<<<<<<
 *                     yield self._arrow_size(head, extent), i / n, default_arrow
 *         else:
 */
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __pyx_L5:;

    /* "mathics/builtin/graphics.py":2153
 *         # see https://reference.wolfram.com/language/ref/Arrowheads.html
 * 
 *         if self.spec.get_head_name() == "System`List":             # <<<<<<<<<<<<<<
 *             leaves = self.spec.leaves
 *             if all(x.get_head_name() == "System`List" for x in leaves):
 */
    goto __pyx_L4;
  }

  /* "mathics/builtin/graphics.py":2188
 *                     yield self._arrow_size(head, extent), i / n, default_arrow
 *         else:
 *             yield self._arrow_size(self.spec, extent), 1, default_arrow             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_arrow_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2188, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_spec); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2188, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_16 = NULL;
    __pyx_t_11 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_16)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_16);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_11 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[3] = {__pyx_t_16, __pyx_t_12, __pyx_cur_scope->__pyx_v_extent};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2188, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[3] = {__pyx_t_16, __pyx_t_12, __pyx_cur_scope->__pyx_v_extent};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2188, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    } else
    #endif
    {
      __pyx_t_2 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2188, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (__pyx_t_16) {
        __Pyx_GIVEREF(__pyx_t_16); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_16); __pyx_t_16 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_12);
      PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_11, __pyx_t_12);
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_extent);
      __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_extent);
      PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_11, __pyx_cur_scope->__pyx_v_extent);
      __pyx_t_12 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2188, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2188, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
    __Pyx_INCREF(__pyx_int_1);
    __Pyx_GIVEREF(__pyx_int_1);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_1);
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_default_arrow);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_default_arrow);
    PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_cur_scope->__pyx_v_default_arrow);
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 3;
    return __pyx_r;
    __pyx_L26_resume_from_yield:;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2188, __pyx_L1_error)
  }
  __pyx_L4:;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "mathics/builtin/graphics.py":2150
 *             return _to_float(s) * extent
 * 
 *     def heads(self, extent, default_arrow, custom_arrow):             # <<<<<<<<<<<<<<
 *         # see https://reference.wolfram.com/language/ref/Arrowheads.html
 * 
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  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_10);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_AddTraceback("heads", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":2191
 * 
 * 
 * def _norm(p, q):             # <<<<<<<<<<<<<<
 *     px, py = p
 *     qx, qy = q
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_37_norm(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_37_norm = {"_norm", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_37_norm, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_37_norm(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_p = 0;
  PyObject *__pyx_v_q = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_norm (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_p,&__pyx_n_s_q,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_p)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_norm", 1, 2, 2, 1); __PYX_ERR(0, 2191, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_norm") < 0)) __PYX_ERR(0, 2191, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_p = values[0];
    __pyx_v_q = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_norm", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2191, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics._norm", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_36_norm(__pyx_self, __pyx_v_p, __pyx_v_q);

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_36_norm(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_p, PyObject *__pyx_v_q) {
  PyObject *__pyx_v_px = NULL;
  PyObject *__pyx_v_py = NULL;
  PyObject *__pyx_v_qx = NULL;
  PyObject *__pyx_v_qy = NULL;
  PyObject *__pyx_v_dx = NULL;
  PyObject *__pyx_v_dy = NULL;
  PyObject *__pyx_v_length = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *(*__pyx_t_4)(PyObject *);
  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("_norm", 0);

  /* "mathics/builtin/graphics.py":2192
 * 
 * def _norm(p, q):
 *     px, py = p             # <<<<<<<<<<<<<<
 *     qx, qy = q
 * 
 */
  if ((likely(PyTuple_CheckExact(__pyx_v_p))) || (PyList_CheckExact(__pyx_v_p))) {
    PyObject* sequence = __pyx_v_p;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 2192, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_2);
    #else
    __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2192, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2192, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
  } else {
    Py_ssize_t index = -1;
    __pyx_t_3 = PyObject_GetIter(__pyx_v_p); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2192, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext;
    index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) __PYX_ERR(0, 2192, __pyx_L1_error)
    __pyx_t_4 = NULL;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 2192, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  __pyx_v_px = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v_py = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":2193
 * def _norm(p, q):
 *     px, py = p
 *     qx, qy = q             # <<<<<<<<<<<<<<
 * 
 *     dx = qx - px
 */
  if ((likely(PyTuple_CheckExact(__pyx_v_q))) || (PyList_CheckExact(__pyx_v_q))) {
    PyObject* sequence = __pyx_v_q;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 2193, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_1);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2193, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2193, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    #endif
  } else {
    Py_ssize_t index = -1;
    __pyx_t_3 = PyObject_GetIter(__pyx_v_q); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2193, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext;
    index = 0; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 1; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) __PYX_ERR(0, 2193, __pyx_L1_error)
    __pyx_t_4 = NULL;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L6_unpacking_done;
    __pyx_L5_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 2193, __pyx_L1_error)
    __pyx_L6_unpacking_done:;
  }
  __pyx_v_qx = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_v_qy = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":2195
 *     qx, qy = q
 * 
 *     dx = qx - px             # <<<<<<<<<<<<<<
 *     dy = qy - py
 * 
 */
  __pyx_t_1 = PyNumber_Subtract(__pyx_v_qx, __pyx_v_px); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2195, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_dx = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":2196
 * 
 *     dx = qx - px
 *     dy = qy - py             # <<<<<<<<<<<<<<
 * 
 *     length = sqrt(dx * dx + dy * dy)
 */
  __pyx_t_1 = PyNumber_Subtract(__pyx_v_qy, __pyx_v_py); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2196, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_dy = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":2198
 *     dy = qy - py
 * 
 *     length = sqrt(dx * dx + dy * dy)             # <<<<<<<<<<<<<<
 *     return dx, dy, length
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2198, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyNumber_Multiply(__pyx_v_dx, __pyx_v_dx); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2198, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = PyNumber_Multiply(__pyx_v_dy, __pyx_v_dy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2198, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyNumber_Add(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2198, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2198, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_length = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":2199
 * 
 *     length = sqrt(dx * dx + dy * dy)
 *     return dx, dy, length             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2199, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_dx);
  __Pyx_GIVEREF(__pyx_v_dx);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_dx);
  __Pyx_INCREF(__pyx_v_dy);
  __Pyx_GIVEREF(__pyx_v_dy);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_dy);
  __Pyx_INCREF(__pyx_v_length);
  __Pyx_GIVEREF(__pyx_v_length);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_length);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":2191
 * 
 * 
 * def _norm(p, q):             # <<<<<<<<<<<<<<
 *     px, py = p
 *     qx, qy = q
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("mathics.builtin.graphics._norm", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_px);
  __Pyx_XDECREF(__pyx_v_py);
  __Pyx_XDECREF(__pyx_v_qx);
  __Pyx_XDECREF(__pyx_v_qy);
  __Pyx_XDECREF(__pyx_v_dx);
  __Pyx_XDECREF(__pyx_v_dy);
  __Pyx_XDECREF(__pyx_v_length);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":2203
 * 
 * class _Line:
 *     def make_draw_svg(self, style):             # <<<<<<<<<<<<<<
 *         def draw(points):
 *             yield '<polyline points="'
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_5_Line_1make_draw_svg(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_5_Line_1make_draw_svg = {"make_draw_svg", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_5_Line_1make_draw_svg, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_5_Line_1make_draw_svg(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_style = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_draw_svg (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_style,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_style)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("make_draw_svg", 1, 2, 2, 1); __PYX_ERR(0, 2203, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "make_draw_svg") < 0)) __PYX_ERR(0, 2203, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_style = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("make_draw_svg", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2203, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics._Line.make_draw_svg", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_5_Line_make_draw_svg(__pyx_self, __pyx_v_self, __pyx_v_style);

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

/* "mathics/builtin/graphics.py":2204
 * class _Line:
 *     def make_draw_svg(self, style):
 *         def draw(points):             # <<<<<<<<<<<<<<
 *             yield '<polyline points="'
 *             yield " ".join("%f,%f" % xy for xy in points)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_5_Line_13make_draw_svg_1draw(PyObject *__pyx_self, PyObject *__pyx_v_points); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_5_Line_13make_draw_svg_1draw = {"draw", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_5_Line_13make_draw_svg_1draw, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_5_Line_13make_draw_svg_1draw(PyObject *__pyx_self, PyObject *__pyx_v_points) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("draw (wrapper)", 0);
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_5_Line_13make_draw_svg_draw(__pyx_self, ((PyObject *)__pyx_v_points));

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

/* "mathics/builtin/graphics.py":2206
 *         def draw(points):
 *             yield '<polyline points="'
 *             yield " ".join("%f,%f" % xy for xy in points)             # <<<<<<<<<<<<<<
 *             yield '" style="%s" />' % style
 * 
 */

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_5_Line_13make_draw_svg_4draw_genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_41_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_41_genexpr *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_41_genexpr(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_41_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_41_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 2206, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_40_draw *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7mathics_7builtin_8graphics_5_Line_13make_draw_svg_4draw_2generator29, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_Line_make_draw_svg_locals_draw, __pyx_n_s_mathics_builtin_graphics); if (unlikely(!gen)) __PYX_ERR(0, 2206, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics._Line.make_draw_svg.draw.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_7mathics_7builtin_8graphics_5_Line_13make_draw_svg_4draw_2generator29(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_41_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_41_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2206, __pyx_L1_error)
  __pyx_r = PyList_New(0); if (unlikely(!__pyx_r)) __PYX_ERR(0, 2206, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_points)) { __Pyx_RaiseClosureNameError("points"); __PYX_ERR(0, 2206, __pyx_L1_error) }
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_points)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_points)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_points; __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_outer_scope->__pyx_v_points); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2206, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2206, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 2206, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2206, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 2206, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2206, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 2206, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_xy);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_xy, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_f_f, __pyx_cur_scope->__pyx_v_xy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2206, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (unlikely(__Pyx_ListComp_Append(__pyx_r, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 2206, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

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

/* "mathics/builtin/graphics.py":2204
 * class _Line:
 *     def make_draw_svg(self, style):
 *         def draw(points):             # <<<<<<<<<<<<<<
 *             yield '<polyline points="'
 *             yield " ".join("%f,%f" % xy for xy in points)
 */

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_5_Line_13make_draw_svg_draw(PyObject *__pyx_self, PyObject *__pyx_v_points) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_40_draw *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("draw", 0);
  __pyx_cur_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_40_draw *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_40_draw(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_40_draw, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_40_draw *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 2204, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_39_make_draw_svg *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  __pyx_cur_scope->__pyx_v_points = __pyx_v_points;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_points);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_points);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7mathics_7builtin_8graphics_5_Line_13make_draw_svg_2generator28, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_draw, __pyx_n_s_Line_make_draw_svg_locals_draw_2, __pyx_n_s_mathics_builtin_graphics); if (unlikely(!gen)) __PYX_ERR(0, 2204, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics._Line.make_draw_svg.draw", __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_7mathics_7builtin_8graphics_5_Line_13make_draw_svg_2generator28(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_40_draw *__pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_40_draw *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("draw", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L4_resume_from_yield;
    case 2: goto __pyx_L5_resume_from_yield;
    case 3: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2204, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2205
 *     def make_draw_svg(self, style):
 *         def draw(points):
 *             yield '<polyline points="'             # <<<<<<<<<<<<<<
 *             yield " ".join("%f,%f" % xy for xy in points)
 *             yield '" style="%s" />' % style
 */
  __Pyx_INCREF(__pyx_kp_u_polyline_points);
  __pyx_r = __pyx_kp_u_polyline_points;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  /* return from generator, yielding value */
  __pyx_generator->resume_label = 1;
  return __pyx_r;
  __pyx_L4_resume_from_yield:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2205, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2206
 *         def draw(points):
 *             yield '<polyline points="'
 *             yield " ".join("%f,%f" % xy for xy in points)             # <<<<<<<<<<<<<<
 *             yield '" style="%s" />' % style
 * 
 */
  __pyx_t_1 = __pyx_pf_7mathics_7builtin_8graphics_5_Line_13make_draw_svg_4draw_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2206, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_Generator_Next(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2206, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyUnicode_Join(__pyx_kp_u__7, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2206, __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;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  /* return from generator, yielding value */
  __pyx_generator->resume_label = 2;
  return __pyx_r;
  __pyx_L5_resume_from_yield:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2206, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2207
 *             yield '<polyline points="'
 *             yield " ".join("%f,%f" % xy for xy in points)
 *             yield '" style="%s" />' % style             # <<<<<<<<<<<<<<
 * 
 *         return draw
 */
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_style)) { __Pyx_RaiseClosureNameError("style"); __PYX_ERR(0, 2207, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_style_s, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_style); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  /* return from generator, yielding value */
  __pyx_generator->resume_label = 3;
  return __pyx_r;
  __pyx_L6_resume_from_yield:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2207, __pyx_L1_error)
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "mathics/builtin/graphics.py":2204
 * class _Line:
 *     def make_draw_svg(self, style):
 *         def draw(points):             # <<<<<<<<<<<<<<
 *             yield '<polyline points="'
 *             yield " ".join("%f,%f" % xy for xy in points)
 */

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

/* "mathics/builtin/graphics.py":2203
 * 
 * class _Line:
 *     def make_draw_svg(self, style):             # <<<<<<<<<<<<<<
 *         def draw(points):
 *             yield '<polyline points="'
 */

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_5_Line_make_draw_svg(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_style) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_39_make_draw_svg *__pyx_cur_scope;
  PyObject *__pyx_v_draw = 0;
  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("make_draw_svg", 0);
  __pyx_cur_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_39_make_draw_svg *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_39_make_draw_svg(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_39_make_draw_svg, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_39_make_draw_svg *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 2203, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_style = __pyx_v_style;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_style);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_style);

  /* "mathics/builtin/graphics.py":2204
 * class _Line:
 *     def make_draw_svg(self, style):
 *         def draw(points):             # <<<<<<<<<<<<<<
 *             yield '<polyline points="'
 *             yield " ".join("%f,%f" % xy for xy in points)
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_5_Line_13make_draw_svg_1draw, 0, __pyx_n_s_Line_make_draw_svg_locals_draw_2, ((PyObject*)__pyx_cur_scope), __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__72)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2204, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_draw = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":2209
 *             yield '" style="%s" />' % style
 * 
 *         return draw             # <<<<<<<<<<<<<<
 * 
 *     def make_draw_asy(self, pen):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_draw);
  __pyx_r = __pyx_v_draw;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":2203
 * 
 * class _Line:
 *     def make_draw_svg(self, style):             # <<<<<<<<<<<<<<
 *         def draw(points):
 *             yield '<polyline points="'
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("mathics.builtin.graphics._Line.make_draw_svg", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_draw);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":2211
 *         return draw
 * 
 *     def make_draw_asy(self, pen):             # <<<<<<<<<<<<<<
 *         def draw(points):
 *             yield "draw("
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_5_Line_3make_draw_asy(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_5_Line_3make_draw_asy = {"make_draw_asy", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_5_Line_3make_draw_asy, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_5_Line_3make_draw_asy(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_pen = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_draw_asy (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_pen,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pen)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("make_draw_asy", 1, 2, 2, 1); __PYX_ERR(0, 2211, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "make_draw_asy") < 0)) __PYX_ERR(0, 2211, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_pen = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("make_draw_asy", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2211, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics._Line.make_draw_asy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_5_Line_2make_draw_asy(__pyx_self, __pyx_v_self, __pyx_v_pen);

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

/* "mathics/builtin/graphics.py":2212
 * 
 *     def make_draw_asy(self, pen):
 *         def draw(points):             # <<<<<<<<<<<<<<
 *             yield "draw("
 *             yield "--".join(["(%.5g,%5g)" % xy for xy in points])
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_5_Line_13make_draw_asy_1draw(PyObject *__pyx_self, PyObject *__pyx_v_points); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_5_Line_13make_draw_asy_1draw = {"draw", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_5_Line_13make_draw_asy_1draw, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_5_Line_13make_draw_asy_1draw(PyObject *__pyx_self, PyObject *__pyx_v_points) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("draw (wrapper)", 0);
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_5_Line_13make_draw_asy_draw(__pyx_self, ((PyObject *)__pyx_v_points));

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_5_Line_13make_draw_asy_draw(PyObject *__pyx_self, PyObject *__pyx_v_points) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_43_draw *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("draw", 0);
  __pyx_cur_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_43_draw *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_43_draw(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_43_draw, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_43_draw *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 2212, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_42_make_draw_asy *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  __pyx_cur_scope->__pyx_v_points = __pyx_v_points;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_points);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_points);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7mathics_7builtin_8graphics_5_Line_13make_draw_asy_2generator30, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_draw, __pyx_n_s_Line_make_draw_asy_locals_draw, __pyx_n_s_mathics_builtin_graphics); if (unlikely(!gen)) __PYX_ERR(0, 2212, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics._Line.make_draw_asy.draw", __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_7mathics_7builtin_8graphics_5_Line_13make_draw_asy_2generator30(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_43_draw *__pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_43_draw *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("draw", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L4_resume_from_yield;
    case 2: goto __pyx_L7_resume_from_yield;
    case 3: goto __pyx_L8_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2212, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2213
 *     def make_draw_asy(self, pen):
 *         def draw(points):
 *             yield "draw("             # <<<<<<<<<<<<<<
 *             yield "--".join(["(%.5g,%5g)" % xy for xy in points])
 *             yield ", % s);" % pen
 */
  __Pyx_INCREF(__pyx_kp_u_draw_2);
  __pyx_r = __pyx_kp_u_draw_2;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  /* return from generator, yielding value */
  __pyx_generator->resume_label = 1;
  return __pyx_r;
  __pyx_L4_resume_from_yield:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2213, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2214
 *         def draw(points):
 *             yield "draw("
 *             yield "--".join(["(%.5g,%5g)" % xy for xy in points])             # <<<<<<<<<<<<<<
 *             yield ", % s);" % pen
 * 
 */
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2214, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_points)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_points)) {
      __pyx_t_2 = __pyx_cur_scope->__pyx_v_points; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
      __pyx_t_4 = NULL;
    } else {
      __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_points); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2214, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2214, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_4)) {
        if (likely(PyList_CheckExact(__pyx_t_2))) {
          if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 2214, __pyx_L1_error)
          #else
          __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2214, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          #endif
        } else {
          if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 2214, __pyx_L1_error)
          #else
          __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2214, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          #endif
        }
      } else {
        __pyx_t_5 = __pyx_t_4(__pyx_t_2);
        if (unlikely(!__pyx_t_5)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 2214, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_5);
      }
      __Pyx_XGOTREF(__pyx_cur_scope->__pyx_9genexpr41__pyx_v_xy);
      __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_9genexpr41__pyx_v_xy, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_5g_5g, __pyx_cur_scope->__pyx_9genexpr41__pyx_v_xy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2214, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 2214, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } /* exit inner scope */
  __pyx_t_2 = PyUnicode_Join(__pyx_kp_u__43, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2214, __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;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  /* return from generator, yielding value */
  __pyx_generator->resume_label = 2;
  return __pyx_r;
  __pyx_L7_resume_from_yield:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2214, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2215
 *             yield "draw("
 *             yield "--".join(["(%.5g,%5g)" % xy for xy in points])
 *             yield ", % s);" % pen             # <<<<<<<<<<<<<<
 * 
 *         return draw
 */
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_pen)) { __Pyx_RaiseClosureNameError("pen"); __PYX_ERR(0, 2215, __pyx_L1_error) }
  __pyx_t_2 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_s_2, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_pen); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2215, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  /* return from generator, yielding value */
  __pyx_generator->resume_label = 3;
  return __pyx_r;
  __pyx_L8_resume_from_yield:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2215, __pyx_L1_error)
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "mathics/builtin/graphics.py":2212
 * 
 *     def make_draw_asy(self, pen):
 *         def draw(points):             # <<<<<<<<<<<<<<
 *             yield "draw("
 *             yield "--".join(["(%.5g,%5g)" % xy for xy in points])
 */

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

/* "mathics/builtin/graphics.py":2211
 *         return draw
 * 
 *     def make_draw_asy(self, pen):             # <<<<<<<<<<<<<<
 *         def draw(points):
 *             yield "draw("
 */

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_5_Line_2make_draw_asy(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_pen) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_42_make_draw_asy *__pyx_cur_scope;
  PyObject *__pyx_v_draw = 0;
  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("make_draw_asy", 0);
  __pyx_cur_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_42_make_draw_asy *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_42_make_draw_asy(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_42_make_draw_asy, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_42_make_draw_asy *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 2211, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_pen = __pyx_v_pen;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_pen);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_pen);

  /* "mathics/builtin/graphics.py":2212
 * 
 *     def make_draw_asy(self, pen):
 *         def draw(points):             # <<<<<<<<<<<<<<
 *             yield "draw("
 *             yield "--".join(["(%.5g,%5g)" % xy for xy in points])
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_5_Line_13make_draw_asy_1draw, 0, __pyx_n_s_Line_make_draw_asy_locals_draw, ((PyObject*)__pyx_cur_scope), __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__74)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2212, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_draw = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":2217
 *             yield ", % s);" % pen
 * 
 *         return draw             # <<<<<<<<<<<<<<
 * 
 *     def arrows(self, points, heads):  # heads has to be sorted by pos
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_draw);
  __pyx_r = __pyx_v_draw;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":2211
 *         return draw
 * 
 *     def make_draw_asy(self, pen):             # <<<<<<<<<<<<<<
 *         def draw(points):
 *             yield "draw("
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("mathics.builtin.graphics._Line.make_draw_asy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_draw);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7mathics_7builtin_8graphics_5_Line_6generator3(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "mathics/builtin/graphics.py":2219
 *         return draw
 * 
 *     def arrows(self, points, heads):  # heads has to be sorted by pos             # <<<<<<<<<<<<<<
 *         def segments(points):
 *             for i in range(len(points) - 1):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_5_Line_5arrows(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_5_Line_5arrows = {"arrows", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_5_Line_5arrows, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_5_Line_5arrows(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_points = 0;
  PyObject *__pyx_v_heads = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("arrows (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_points,&__pyx_n_s_heads,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_points)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("arrows", 1, 3, 3, 1); __PYX_ERR(0, 2219, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_heads)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("arrows", 1, 3, 3, 2); __PYX_ERR(0, 2219, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "arrows") < 0)) __PYX_ERR(0, 2219, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_self = values[0];
    __pyx_v_points = values[1];
    __pyx_v_heads = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("arrows", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2219, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics._Line.arrows", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_5_Line_4arrows(__pyx_self, __pyx_v_self, __pyx_v_points, __pyx_v_heads);

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

/* "mathics/builtin/graphics.py":2235
 *         n = len(seg)
 *         dl, px, py, dx, dy = seg[i]
 *         total = sum(segment[0] for segment in seg)             # <<<<<<<<<<<<<<
 * 
 *         for s, t, draw in ((s, pos * total - t0, draw) for s, pos, draw in heads):
 */

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_5_Line_6arrows_3genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_46_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_46_genexpr *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_46_genexpr(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_46_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_46_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 2235, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_44_arrows *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7mathics_7builtin_8graphics_5_Line_6arrows_5generator32, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_Line_arrows_locals_genexpr, __pyx_n_s_mathics_builtin_graphics); if (unlikely(!gen)) __PYX_ERR(0, 2235, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics._Line.arrows.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_7mathics_7builtin_8graphics_5_Line_6arrows_5generator32(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_46_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_46_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2235, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_seg)) { __Pyx_RaiseClosureNameError("seg"); __PYX_ERR(0, 2235, __pyx_L1_error) }
  if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_seg == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(0, 2235, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_seg; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
  for (;;) {
    if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 2235, __pyx_L1_error)
    #else
    __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2235, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_segment);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_segment, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_segment, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2235, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 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_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;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2235, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

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

/* "mathics/builtin/graphics.py":2237
 *         total = sum(segment[0] for segment in seg)
 * 
 *         for s, t, draw in ((s, pos * total - t0, draw) for s, pos, draw in heads):             # <<<<<<<<<<<<<<
 *             if s == 0.0:  # ignore zero-sized arrows
 *                 continue
 */

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_5_Line_6arrows_6genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_47_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_47_genexpr *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_47_genexpr(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_47_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_47_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 2237, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_44_arrows *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7mathics_7builtin_8graphics_5_Line_6arrows_8generator33, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_Line_arrows_locals_genexpr, __pyx_n_s_mathics_builtin_graphics); if (unlikely(!gen)) __PYX_ERR(0, 2237, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics._Line.arrows.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_7mathics_7builtin_8graphics_5_Line_6arrows_8generator33(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_47_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_47_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  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 *);
  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_L8_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2237, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_heads)) { __Pyx_RaiseClosureNameError("heads"); __PYX_ERR(0, 2237, __pyx_L1_error) }
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_heads)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_heads)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_heads; __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_outer_scope->__pyx_v_heads); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2237, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2237, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 2237, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2237, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 2237, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2237, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 2237, __pyx_L1_error)
        }
        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 != 3)) {
        if (size > 3) __Pyx_RaiseTooManyValuesError(3);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 2237, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); 
        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 2); 
      } else {
        __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_6 = PyList_GET_ITEM(sequence, 1); 
        __pyx_t_7 = PyList_GET_ITEM(sequence, 2); 
      }
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_7);
      #else
      __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2237, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2237, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2237, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      #endif
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_8 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2237, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
      index = 0; __pyx_t_5 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_5)) goto __pyx_L6_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_L6_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_L6_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_7);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 3) < 0) __PYX_ERR(0, 2237, __pyx_L1_error)
      __pyx_t_9 = NULL;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L7_unpacking_done;
      __pyx_L6_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_9 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 2237, __pyx_L1_error)
      __pyx_L7_unpacking_done:;
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_s);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_s, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_pos);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_pos, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    __pyx_t_6 = 0;
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_draw);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_draw, __pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    __pyx_t_7 = 0;
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_total)) { __Pyx_RaiseClosureNameError("total"); __PYX_ERR(0, 2237, __pyx_L1_error) }
    __pyx_t_4 = PyNumber_Multiply(__pyx_cur_scope->__pyx_v_pos, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_total); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2237, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_t0)) { __Pyx_RaiseClosureNameError("t0"); __PYX_ERR(0, 2237, __pyx_L1_error) }
    __pyx_t_7 = PyNumber_Subtract(__pyx_t_4, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_t0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2237, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2237, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_s);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_s);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_cur_scope->__pyx_v_s);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_7);
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_draw);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_draw);
    PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_cur_scope->__pyx_v_draw);
    __pyx_t_7 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    __Pyx_XGIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L8_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2237, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

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

/* "mathics/builtin/graphics.py":2219
 *         return draw
 * 
 *     def arrows(self, points, heads):  # heads has to be sorted by pos             # <<<<<<<<<<<<<<
 *         def segments(points):
 *             for i in range(len(points) - 1):
 */

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_5_Line_4arrows(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_points, PyObject *__pyx_v_heads) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_44_arrows *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arrows", 0);
  __pyx_cur_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_44_arrows *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_44_arrows(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_44_arrows, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_44_arrows *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 2219, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self);
  __pyx_cur_scope->__pyx_v_points = __pyx_v_points;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_points);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_points);
  __pyx_cur_scope->__pyx_v_heads = __pyx_v_heads;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_heads);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_heads);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7mathics_7builtin_8graphics_5_Line_6generator3, __pyx_codeobj__75, (PyObject *) __pyx_cur_scope, __pyx_n_s_arrows, __pyx_n_s_Line_arrows, __pyx_n_s_mathics_builtin_graphics); if (unlikely(!gen)) __PYX_ERR(0, 2219, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics._Line.arrows", __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_7mathics_7builtin_8graphics_5_Line_6arrows_2generator31(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "mathics/builtin/graphics.py":2220
 * 
 *     def arrows(self, points, heads):  # heads has to be sorted by pos
 *         def segments(points):             # <<<<<<<<<<<<<<
 *             for i in range(len(points) - 1):
 *                 px, py = points[i]
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_5_Line_6arrows_1segments(PyObject *__pyx_self, PyObject *__pyx_v_points); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_5_Line_6arrows_1segments = {"segments", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_5_Line_6arrows_1segments, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_5_Line_6arrows_1segments(PyObject *__pyx_self, PyObject *__pyx_v_points) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("segments (wrapper)", 0);
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_5_Line_6arrows_segments(__pyx_self, ((PyObject *)__pyx_v_points));

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_5_Line_6arrows_segments(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_points) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_45_segments *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("segments", 0);
  __pyx_cur_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_45_segments *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_45_segments(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_45_segments, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_45_segments *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 2220, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_points = __pyx_v_points;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_points);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_points);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7mathics_7builtin_8graphics_5_Line_6arrows_2generator31, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_segments, __pyx_n_s_Line_arrows_locals_segments, __pyx_n_s_mathics_builtin_graphics); if (unlikely(!gen)) __PYX_ERR(0, 2220, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics._Line.arrows.segments", __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_7mathics_7builtin_8graphics_5_Line_6arrows_2generator31(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_45_segments *__pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_45_segments *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  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 *);
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("segments", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L10_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2220, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2221
 *     def arrows(self, points, heads):  # heads has to be sorted by pos
 *         def segments(points):
 *             for i in range(len(points) - 1):             # <<<<<<<<<<<<<<
 *                 px, py = points[i]
 *                 dx, dy, dl = _norm((px, py), points[i + 1])
 */
  __pyx_t_1 = PyObject_Length(__pyx_cur_scope->__pyx_v_points); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2221, __pyx_L1_error)
  __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_1 - 1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2221, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2221, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
    __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_1 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_1 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2221, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2221, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(0, 2221, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2221, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      } else {
        if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(0, 2221, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2221, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      }
    } else {
      __pyx_t_3 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_3)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 2221, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_i);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_i, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;

    /* "mathics/builtin/graphics.py":2222
 *         def segments(points):
 *             for i in range(len(points) - 1):
 *                 px, py = points[i]             # <<<<<<<<<<<<<<
 *                 dx, dy, dl = _norm((px, py), points[i + 1])
 *                 yield dl, px, py, dx, dy
 */
    __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_cur_scope->__pyx_v_points, __pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2222, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
      PyObject* sequence = __pyx_t_3;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 2222, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_6 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      #else
      __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2222, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2222, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      #endif
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2222, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
      index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L6_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_L6_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_6);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 2222, __pyx_L1_error)
      __pyx_t_8 = NULL;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L7_unpacking_done;
      __pyx_L6_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 2222, __pyx_L1_error)
      __pyx_L7_unpacking_done:;
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_px);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_px, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_py);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_py, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    __pyx_t_6 = 0;

    /* "mathics/builtin/graphics.py":2223
 *             for i in range(len(points) - 1):
 *                 px, py = points[i]
 *                 dx, dy, dl = _norm((px, py), points[i + 1])             # <<<<<<<<<<<<<<
 *                 yield dl, px, py, dx, dy
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_norm); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2223, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2223, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_px);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_px);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_cur_scope->__pyx_v_px);
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_py);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_py);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_cur_scope->__pyx_v_py);
    __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_cur_scope->__pyx_v_i, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2223, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_cur_scope->__pyx_v_points, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2223, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = NULL;
    __pyx_t_10 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_10 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_6)) {
      PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_5, __pyx_t_9};
      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2223, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
      PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_5, __pyx_t_9};
      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2223, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    } else
    #endif
    {
      __pyx_t_11 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2223, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      if (__pyx_t_7) {
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_7); __pyx_t_7 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_10, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_9);
      PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_10, __pyx_t_9);
      __pyx_t_5 = 0;
      __pyx_t_9 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2223, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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 != 3)) {
        if (size > 3) __Pyx_RaiseTooManyValuesError(3);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 2223, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_11 = PyTuple_GET_ITEM(sequence, 1); 
        __pyx_t_9 = PyTuple_GET_ITEM(sequence, 2); 
      } else {
        __pyx_t_6 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_11 = PyList_GET_ITEM(sequence, 1); 
        __pyx_t_9 = PyList_GET_ITEM(sequence, 2); 
      }
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_11);
      __Pyx_INCREF(__pyx_t_9);
      #else
      __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2223, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_11 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2223, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_9 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2223, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      #endif
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_5 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2223, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_8 = Py_TYPE(__pyx_t_5)->tp_iternext;
      index = 0; __pyx_t_6 = __pyx_t_8(__pyx_t_5); if (unlikely(!__pyx_t_6)) goto __pyx_L8_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_6);
      index = 1; __pyx_t_11 = __pyx_t_8(__pyx_t_5); if (unlikely(!__pyx_t_11)) goto __pyx_L8_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_11);
      index = 2; __pyx_t_9 = __pyx_t_8(__pyx_t_5); if (unlikely(!__pyx_t_9)) goto __pyx_L8_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_9);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_5), 3) < 0) __PYX_ERR(0, 2223, __pyx_L1_error)
      __pyx_t_8 = NULL;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L9_unpacking_done;
      __pyx_L8_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_8 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 2223, __pyx_L1_error)
      __pyx_L9_unpacking_done:;
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_dx);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_dx, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    __pyx_t_6 = 0;
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_dy);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_dy, __pyx_t_11);
    __Pyx_GIVEREF(__pyx_t_11);
    __pyx_t_11 = 0;
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_dl);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_dl, __pyx_t_9);
    __Pyx_GIVEREF(__pyx_t_9);
    __pyx_t_9 = 0;

    /* "mathics/builtin/graphics.py":2224
 *                 px, py = points[i]
 *                 dx, dy, dl = _norm((px, py), points[i + 1])
 *                 yield dl, px, py, dx, dy             # <<<<<<<<<<<<<<
 * 
 *         seg = list(segments(points))
 */
    __pyx_t_3 = PyTuple_New(5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2224, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_dl);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_dl);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_cur_scope->__pyx_v_dl);
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_px);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_px);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_cur_scope->__pyx_v_px);
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_py);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_py);
    PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_cur_scope->__pyx_v_py);
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_dx);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_dx);
    PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_cur_scope->__pyx_v_dx);
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_dy);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_dy);
    PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_cur_scope->__pyx_v_dy);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __Pyx_XGIVEREF(__pyx_t_2);
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_4;
    __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_L10_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = 0;
    __Pyx_XGOTREF(__pyx_t_2);
    __pyx_t_4 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2224, __pyx_L1_error)

    /* "mathics/builtin/graphics.py":2221
 *     def arrows(self, points, heads):  # heads has to be sorted by pos
 *         def segments(points):
 *             for i in range(len(points) - 1):             # <<<<<<<<<<<<<<
 *                 px, py = points[i]
 *                 dx, dy, dl = _norm((px, py), points[i + 1])
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "mathics/builtin/graphics.py":2220
 * 
 *     def arrows(self, points, heads):  # heads has to be sorted by pos
 *         def segments(points):             # <<<<<<<<<<<<<<
 *             for i in range(len(points) - 1):
 *                 px, py = points[i]
 */

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

/* "mathics/builtin/graphics.py":2219
 *         return draw
 * 
 *     def arrows(self, points, heads):  # heads has to be sorted by pos             # <<<<<<<<<<<<<<
 *         def segments(points):
 *             for i in range(len(points) - 1):
 */

static PyObject *__pyx_gb_7mathics_7builtin_8graphics_5_Line_6generator3(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_44_arrows *__pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_44_arrows *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *(*__pyx_t_11)(PyObject *);
  PyObject *(*__pyx_t_12)(PyObject *);
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  PyObject *(*__pyx_t_16)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("arrows", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L20_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2219, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2220
 * 
 *     def arrows(self, points, heads):  # heads has to be sorted by pos
 *         def segments(points):             # <<<<<<<<<<<<<<
 *             for i in range(len(points) - 1):
 *                 px, py = points[i]
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_5_Line_6arrows_1segments, 0, __pyx_n_s_Line_arrows_locals_segments, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__77)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2220, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_segments = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":2226
 *                 yield dl, px, py, dx, dy
 * 
 *         seg = list(segments(points))             # <<<<<<<<<<<<<<
 * 
 *         if not seg:
 */
  __pyx_t_1 = __pyx_pf_7mathics_7builtin_8graphics_5_Line_6arrows_segments(__pyx_cur_scope->__pyx_v_segments, __pyx_cur_scope->__pyx_v_points); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2226, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PySequence_List(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2226, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_cur_scope->__pyx_v_seg = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":2228
 *         seg = list(segments(points))
 * 
 *         if not seg:             # <<<<<<<<<<<<<<
 *             return
 * 
 */
  __pyx_t_3 = (PyList_GET_SIZE(__pyx_cur_scope->__pyx_v_seg) != 0);
  __pyx_t_4 = ((!__pyx_t_3) != 0);
  if (__pyx_t_4) {

    /* "mathics/builtin/graphics.py":2229
 * 
 *         if not seg:
 *             return             # <<<<<<<<<<<<<<
 * 
 *         i = 0
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = NULL;
    goto __pyx_L0;

    /* "mathics/builtin/graphics.py":2228
 *         seg = list(segments(points))
 * 
 *         if not seg:             # <<<<<<<<<<<<<<
 *             return
 * 
 */
  }

  /* "mathics/builtin/graphics.py":2231
 *             return
 * 
 *         i = 0             # <<<<<<<<<<<<<<
 *         t0 = 0.0
 *         n = len(seg)
 */
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  __pyx_cur_scope->__pyx_v_i = __pyx_int_0;

  /* "mathics/builtin/graphics.py":2232
 * 
 *         i = 0
 *         t0 = 0.0             # <<<<<<<<<<<<<<
 *         n = len(seg)
 *         dl, px, py, dx, dy = seg[i]
 */
  __Pyx_INCREF(__pyx_float_0_0);
  __Pyx_GIVEREF(__pyx_float_0_0);
  __pyx_cur_scope->__pyx_v_t0 = __pyx_float_0_0;

  /* "mathics/builtin/graphics.py":2233
 *         i = 0
 *         t0 = 0.0
 *         n = len(seg)             # <<<<<<<<<<<<<<
 *         dl, px, py, dx, dy = seg[i]
 *         total = sum(segment[0] for segment in seg)
 */
  __pyx_t_2 = __pyx_cur_scope->__pyx_v_seg;
  __Pyx_INCREF(__pyx_t_2);
  if (unlikely(__pyx_t_2 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(0, 2233, __pyx_L1_error)
  }
  __pyx_t_5 = PyList_GET_SIZE(__pyx_t_2); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2233, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_cur_scope->__pyx_v_n = __pyx_t_5;

  /* "mathics/builtin/graphics.py":2234
 *         t0 = 0.0
 *         n = len(seg)
 *         dl, px, py, dx, dy = seg[i]             # <<<<<<<<<<<<<<
 *         total = sum(segment[0] for segment in seg)
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_cur_scope->__pyx_v_seg, __pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2234, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
    PyObject* sequence = __pyx_t_2;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 5)) {
      if (size > 5) __Pyx_RaiseTooManyValuesError(5);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 2234, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); 
      __pyx_t_7 = PyTuple_GET_ITEM(sequence, 2); 
      __pyx_t_8 = PyTuple_GET_ITEM(sequence, 3); 
      __pyx_t_9 = PyTuple_GET_ITEM(sequence, 4); 
    } else {
      __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_6 = PyList_GET_ITEM(sequence, 1); 
      __pyx_t_7 = PyList_GET_ITEM(sequence, 2); 
      __pyx_t_8 = PyList_GET_ITEM(sequence, 3); 
      __pyx_t_9 = PyList_GET_ITEM(sequence, 4); 
    }
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_t_7);
    __Pyx_INCREF(__pyx_t_8);
    __Pyx_INCREF(__pyx_t_9);
    #else
    {
      Py_ssize_t i;
      PyObject** temps[5] = {&__pyx_t_1,&__pyx_t_6,&__pyx_t_7,&__pyx_t_8,&__pyx_t_9};
      for (i=0; i < 5; i++) {
        PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 2234, __pyx_L1_error)
        __Pyx_GOTREF(item);
        *(temps[i]) = item;
      }
    }
    #endif
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    Py_ssize_t index = -1;
    PyObject** temps[5] = {&__pyx_t_1,&__pyx_t_6,&__pyx_t_7,&__pyx_t_8,&__pyx_t_9};
    __pyx_t_10 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2234, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_11 = Py_TYPE(__pyx_t_10)->tp_iternext;
    for (index=0; index < 5; index++) {
      PyObject* item = __pyx_t_11(__pyx_t_10); if (unlikely(!item)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(item);
      *(temps[index]) = item;
    }
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 5) < 0) __PYX_ERR(0, 2234, __pyx_L1_error)
    __pyx_t_11 = NULL;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    goto __pyx_L6_unpacking_done;
    __pyx_L5_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_11 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 2234, __pyx_L1_error)
    __pyx_L6_unpacking_done:;
  }
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_dl = __pyx_t_1;
  __pyx_t_1 = 0;
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_cur_scope->__pyx_v_px = __pyx_t_6;
  __pyx_t_6 = 0;
  __Pyx_GIVEREF(__pyx_t_7);
  __pyx_cur_scope->__pyx_v_py = __pyx_t_7;
  __pyx_t_7 = 0;
  __Pyx_GIVEREF(__pyx_t_8);
  __pyx_cur_scope->__pyx_v_dx = __pyx_t_8;
  __pyx_t_8 = 0;
  __Pyx_GIVEREF(__pyx_t_9);
  __pyx_cur_scope->__pyx_v_dy = __pyx_t_9;
  __pyx_t_9 = 0;

  /* "mathics/builtin/graphics.py":2235
 *         n = len(seg)
 *         dl, px, py, dx, dy = seg[i]
 *         total = sum(segment[0] for segment in seg)             # <<<<<<<<<<<<<<
 * 
 *         for s, t, draw in ((s, pos * total - t0, draw) for s, pos, draw in heads):
 */
  __pyx_t_2 = __pyx_pf_7mathics_7builtin_8graphics_5_Line_6arrows_3genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2235, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2235, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GIVEREF(__pyx_t_9);
  __pyx_cur_scope->__pyx_v_total = __pyx_t_9;
  __pyx_t_9 = 0;

  /* "mathics/builtin/graphics.py":2237
 *         total = sum(segment[0] for segment in seg)
 * 
 *         for s, t, draw in ((s, pos * total - t0, draw) for s, pos, draw in heads):             # <<<<<<<<<<<<<<
 *             if s == 0.0:  # ignore zero-sized arrows
 *                 continue
 */
  __pyx_t_9 = __pyx_pf_7mathics_7builtin_8graphics_5_Line_6arrows_6genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2237, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  if (likely(PyList_CheckExact(__pyx_t_9)) || PyTuple_CheckExact(__pyx_t_9)) {
    __pyx_t_2 = __pyx_t_9; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0;
    __pyx_t_12 = NULL;
  } else {
    __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2237, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_12 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2237, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  for (;;) {
    if (likely(!__pyx_t_12)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_9 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_9); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 2237, __pyx_L1_error)
        #else
        __pyx_t_9 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2237, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        #endif
      } else {
        if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_9); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 2237, __pyx_L1_error)
        #else
        __pyx_t_9 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2237, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        #endif
      }
    } else {
      __pyx_t_9 = __pyx_t_12(__pyx_t_2);
      if (unlikely(!__pyx_t_9)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 2237, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_9);
    }
    if ((likely(PyTuple_CheckExact(__pyx_t_9))) || (PyList_CheckExact(__pyx_t_9))) {
      PyObject* sequence = __pyx_t_9;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 3)) {
        if (size > 3) __Pyx_RaiseTooManyValuesError(3);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 2237, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); 
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); 
      } else {
        __pyx_t_8 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_7 = PyList_GET_ITEM(sequence, 1); 
        __pyx_t_6 = PyList_GET_ITEM(sequence, 2); 
      }
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      #else
      __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2237, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2237, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2237, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      #endif
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_1 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2237, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_11 = Py_TYPE(__pyx_t_1)->tp_iternext;
      index = 0; __pyx_t_8 = __pyx_t_11(__pyx_t_1); if (unlikely(!__pyx_t_8)) goto __pyx_L9_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_8);
      index = 1; __pyx_t_7 = __pyx_t_11(__pyx_t_1); if (unlikely(!__pyx_t_7)) goto __pyx_L9_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_7);
      index = 2; __pyx_t_6 = __pyx_t_11(__pyx_t_1); if (unlikely(!__pyx_t_6)) goto __pyx_L9_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_6);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_1), 3) < 0) __PYX_ERR(0, 2237, __pyx_L1_error)
      __pyx_t_11 = NULL;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L10_unpacking_done;
      __pyx_L9_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_11 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 2237, __pyx_L1_error)
      __pyx_L10_unpacking_done:;
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_s);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_s, __pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_8);
    __pyx_t_8 = 0;
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_t);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_t, __pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    __pyx_t_7 = 0;
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_draw);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_draw, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    __pyx_t_6 = 0;

    /* "mathics/builtin/graphics.py":2238
 * 
 *         for s, t, draw in ((s, pos * total - t0, draw) for s, pos, draw in heads):
 *             if s == 0.0:  # ignore zero-sized arrows             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
    __pyx_t_9 = __Pyx_PyFloat_EqObjC(__pyx_cur_scope->__pyx_v_s, __pyx_float_0_0, 0.0, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2238, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 2238, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (__pyx_t_4) {

      /* "mathics/builtin/graphics.py":2239
 *         for s, t, draw in ((s, pos * total - t0, draw) for s, pos, draw in heads):
 *             if s == 0.0:  # ignore zero-sized arrows
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             if i < n:  # not yet past last segment?
 */
      goto __pyx_L7_continue;

      /* "mathics/builtin/graphics.py":2238
 * 
 *         for s, t, draw in ((s, pos * total - t0, draw) for s, pos, draw in heads):
 *             if s == 0.0:  # ignore zero-sized arrows             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
    }

    /* "mathics/builtin/graphics.py":2241
 *                 continue
 * 
 *             if i < n:  # not yet past last segment?             # <<<<<<<<<<<<<<
 *                 while t > dl:  # position past current segment?
 *                     t -= dl
 */
    __pyx_t_9 = PyInt_FromSsize_t(__pyx_cur_scope->__pyx_v_n); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2241, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_6 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_i, __pyx_t_9, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2241, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 2241, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (__pyx_t_4) {

      /* "mathics/builtin/graphics.py":2242
 * 
 *             if i < n:  # not yet past last segment?
 *                 while t > dl:  # position past current segment?             # <<<<<<<<<<<<<<
 *                     t -= dl
 *                     t0 += dl
 */
      while (1) {
        __pyx_t_6 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_t, __pyx_cur_scope->__pyx_v_dl, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2242, __pyx_L1_error)
        __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 2242, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (!__pyx_t_4) break;

        /* "mathics/builtin/graphics.py":2243
 *             if i < n:  # not yet past last segment?
 *                 while t > dl:  # position past current segment?
 *                     t -= dl             # <<<<<<<<<<<<<<
 *                     t0 += dl
 *                     i += 1
 */
        __pyx_t_6 = PyNumber_InPlaceSubtract(__pyx_cur_scope->__pyx_v_t, __pyx_cur_scope->__pyx_v_dl); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2243, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_t);
        __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_t, __pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_6);
        __pyx_t_6 = 0;

        /* "mathics/builtin/graphics.py":2244
 *                 while t > dl:  # position past current segment?
 *                     t -= dl
 *                     t0 += dl             # <<<<<<<<<<<<<<
 *                     i += 1
 *                     if i == n:
 */
        __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_cur_scope->__pyx_v_t0, __pyx_cur_scope->__pyx_v_dl); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2244, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_t0);
        __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_t0, __pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_6);
        __pyx_t_6 = 0;

        /* "mathics/builtin/graphics.py":2245
 *                     t -= dl
 *                     t0 += dl
 *                     i += 1             # <<<<<<<<<<<<<<
 *                     if i == n:
 *                         px += dx  # move to last segment's end
 */
        __pyx_t_6 = __Pyx_PyInt_AddObjC(__pyx_cur_scope->__pyx_v_i, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2245, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_i);
        __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_i, __pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_6);
        __pyx_t_6 = 0;

        /* "mathics/builtin/graphics.py":2246
 *                     t0 += dl
 *                     i += 1
 *                     if i == n:             # <<<<<<<<<<<<<<
 *                         px += dx  # move to last segment's end
 *                         py += dy
 */
        __pyx_t_6 = PyInt_FromSsize_t(__pyx_cur_scope->__pyx_v_n); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2246, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_9 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_i, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2246, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 2246, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (__pyx_t_4) {

          /* "mathics/builtin/graphics.py":2247
 *                     i += 1
 *                     if i == n:
 *                         px += dx  # move to last segment's end             # <<<<<<<<<<<<<<
 *                         py += dy
 *                         break
 */
          __pyx_t_9 = PyNumber_InPlaceAdd(__pyx_cur_scope->__pyx_v_px, __pyx_cur_scope->__pyx_v_dx); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2247, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_px);
          __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_px, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_9);
          __pyx_t_9 = 0;

          /* "mathics/builtin/graphics.py":2248
 *                     if i == n:
 *                         px += dx  # move to last segment's end
 *                         py += dy             # <<<<<<<<<<<<<<
 *                         break
 *                     else:
 */
          __pyx_t_9 = PyNumber_InPlaceAdd(__pyx_cur_scope->__pyx_v_py, __pyx_cur_scope->__pyx_v_dy); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2248, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_py);
          __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_py, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_9);
          __pyx_t_9 = 0;

          /* "mathics/builtin/graphics.py":2249
 *                         px += dx  # move to last segment's end
 *                         py += dy
 *                         break             # <<<<<<<<<<<<<<
 *                     else:
 *                         dl, px, py, dx, dy = seg[i]
 */
          goto __pyx_L14_break;

          /* "mathics/builtin/graphics.py":2246
 *                     t0 += dl
 *                     i += 1
 *                     if i == n:             # <<<<<<<<<<<<<<
 *                         px += dx  # move to last segment's end
 *                         py += dy
 */
        }

        /* "mathics/builtin/graphics.py":2251
 *                         break
 *                     else:
 *                         dl, px, py, dx, dy = seg[i]             # <<<<<<<<<<<<<<
 * 
 *             for shape in draw(px, py, dx / dl, dy / dl, t, s):
 */
        /*else*/ {
          __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_cur_scope->__pyx_v_seg, __pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2251, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          if ((likely(PyTuple_CheckExact(__pyx_t_9))) || (PyList_CheckExact(__pyx_t_9))) {
            PyObject* sequence = __pyx_t_9;
            Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
            if (unlikely(size != 5)) {
              if (size > 5) __Pyx_RaiseTooManyValuesError(5);
              else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
              __PYX_ERR(0, 2251, __pyx_L1_error)
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            if (likely(PyTuple_CheckExact(sequence))) {
              __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); 
              __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); 
              __pyx_t_8 = PyTuple_GET_ITEM(sequence, 2); 
              __pyx_t_1 = PyTuple_GET_ITEM(sequence, 3); 
              __pyx_t_10 = PyTuple_GET_ITEM(sequence, 4); 
            } else {
              __pyx_t_6 = PyList_GET_ITEM(sequence, 0); 
              __pyx_t_7 = PyList_GET_ITEM(sequence, 1); 
              __pyx_t_8 = PyList_GET_ITEM(sequence, 2); 
              __pyx_t_1 = PyList_GET_ITEM(sequence, 3); 
              __pyx_t_10 = PyList_GET_ITEM(sequence, 4); 
            }
            __Pyx_INCREF(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(__pyx_t_8);
            __Pyx_INCREF(__pyx_t_1);
            __Pyx_INCREF(__pyx_t_10);
            #else
            {
              Py_ssize_t i;
              PyObject** temps[5] = {&__pyx_t_6,&__pyx_t_7,&__pyx_t_8,&__pyx_t_1,&__pyx_t_10};
              for (i=0; i < 5; i++) {
                PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 2251, __pyx_L1_error)
                __Pyx_GOTREF(item);
                *(temps[i]) = item;
              }
            }
            #endif
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          } else {
            Py_ssize_t index = -1;
            PyObject** temps[5] = {&__pyx_t_6,&__pyx_t_7,&__pyx_t_8,&__pyx_t_1,&__pyx_t_10};
            __pyx_t_13 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2251, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_13);
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
            __pyx_t_11 = Py_TYPE(__pyx_t_13)->tp_iternext;
            for (index=0; index < 5; index++) {
              PyObject* item = __pyx_t_11(__pyx_t_13); if (unlikely(!item)) goto __pyx_L16_unpacking_failed;
              __Pyx_GOTREF(item);
              *(temps[index]) = item;
            }
            if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_13), 5) < 0) __PYX_ERR(0, 2251, __pyx_L1_error)
            __pyx_t_11 = NULL;
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            goto __pyx_L17_unpacking_done;
            __pyx_L16_unpacking_failed:;
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            __pyx_t_11 = NULL;
            if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
            __PYX_ERR(0, 2251, __pyx_L1_error)
            __pyx_L17_unpacking_done:;
          }
          __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_dl);
          __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_dl, __pyx_t_6);
          __Pyx_GIVEREF(__pyx_t_6);
          __pyx_t_6 = 0;
          __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_px);
          __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_px, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_7);
          __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_py);
          __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_py, __pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_8);
          __pyx_t_8 = 0;
          __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_dx);
          __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_dx, __pyx_t_1);
          __Pyx_GIVEREF(__pyx_t_1);
          __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_dy);
          __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_dy, __pyx_t_10);
          __Pyx_GIVEREF(__pyx_t_10);
          __pyx_t_10 = 0;
        }
      }
      __pyx_L14_break:;

      /* "mathics/builtin/graphics.py":2241
 *                 continue
 * 
 *             if i < n:  # not yet past last segment?             # <<<<<<<<<<<<<<
 *                 while t > dl:  # position past current segment?
 *                     t -= dl
 */
    }

    /* "mathics/builtin/graphics.py":2253
 *                         dl, px, py, dx, dy = seg[i]
 * 
 *             for shape in draw(px, py, dx / dl, dy / dl, t, s):             # <<<<<<<<<<<<<<
 *                 yield shape
 * 
 */
    __pyx_t_10 = __Pyx_PyNumber_Divide(__pyx_cur_scope->__pyx_v_dx, __pyx_cur_scope->__pyx_v_dl); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2253, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_cur_scope->__pyx_v_dy, __pyx_cur_scope->__pyx_v_dl); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2253, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_draw);
    __pyx_t_8 = __pyx_cur_scope->__pyx_v_draw; __pyx_t_7 = NULL;
    __pyx_t_14 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_8, function);
        __pyx_t_14 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_8)) {
      PyObject *__pyx_temp[7] = {__pyx_t_7, __pyx_cur_scope->__pyx_v_px, __pyx_cur_scope->__pyx_v_py, __pyx_t_10, __pyx_t_1, __pyx_cur_scope->__pyx_v_t, __pyx_cur_scope->__pyx_v_s};
      __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_14, 6+__pyx_t_14); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2253, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
      PyObject *__pyx_temp[7] = {__pyx_t_7, __pyx_cur_scope->__pyx_v_px, __pyx_cur_scope->__pyx_v_py, __pyx_t_10, __pyx_t_1, __pyx_cur_scope->__pyx_v_t, __pyx_cur_scope->__pyx_v_s};
      __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_14, 6+__pyx_t_14); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2253, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    } else
    #endif
    {
      __pyx_t_6 = PyTuple_New(6+__pyx_t_14); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2253, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (__pyx_t_7) {
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __pyx_t_7 = NULL;
      }
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_px);
      __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_px);
      PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_14, __pyx_cur_scope->__pyx_v_px);
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_py);
      __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_py);
      PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_14, __pyx_cur_scope->__pyx_v_py);
      __Pyx_GIVEREF(__pyx_t_10);
      PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_14, __pyx_t_10);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_14, __pyx_t_1);
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_t);
      __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_t);
      PyTuple_SET_ITEM(__pyx_t_6, 4+__pyx_t_14, __pyx_cur_scope->__pyx_v_t);
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_s);
      __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_s);
      PyTuple_SET_ITEM(__pyx_t_6, 5+__pyx_t_14, __pyx_cur_scope->__pyx_v_s);
      __pyx_t_10 = 0;
      __pyx_t_1 = 0;
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_6, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2253, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (likely(PyList_CheckExact(__pyx_t_9)) || PyTuple_CheckExact(__pyx_t_9)) {
      __pyx_t_8 = __pyx_t_9; __Pyx_INCREF(__pyx_t_8); __pyx_t_15 = 0;
      __pyx_t_16 = NULL;
    } else {
      __pyx_t_15 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2253, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_16 = Py_TYPE(__pyx_t_8)->tp_iternext; if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 2253, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    for (;;) {
      if (likely(!__pyx_t_16)) {
        if (likely(PyList_CheckExact(__pyx_t_8))) {
          if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_8)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_9 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_15); __Pyx_INCREF(__pyx_t_9); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 2253, __pyx_L1_error)
          #else
          __pyx_t_9 = PySequence_ITEM(__pyx_t_8, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2253, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          #endif
        } else {
          if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_8)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_15); __Pyx_INCREF(__pyx_t_9); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 2253, __pyx_L1_error)
          #else
          __pyx_t_9 = PySequence_ITEM(__pyx_t_8, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2253, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          #endif
        }
      } else {
        __pyx_t_9 = __pyx_t_16(__pyx_t_8);
        if (unlikely(!__pyx_t_9)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 2253, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_9);
      }
      __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_shape);
      __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_shape, __pyx_t_9);
      __Pyx_GIVEREF(__pyx_t_9);
      __pyx_t_9 = 0;

      /* "mathics/builtin/graphics.py":2254
 * 
 *             for shape in draw(px, py, dx / dl, dy / dl, t, s):
 *                 yield shape             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_shape);
      __pyx_r = __pyx_cur_scope->__pyx_v_shape;
      __Pyx_XGIVEREF(__pyx_t_2);
      __pyx_cur_scope->__pyx_t_0 = __pyx_t_2;
      __pyx_cur_scope->__pyx_t_1 = __pyx_t_5;
      __Pyx_XGIVEREF(__pyx_t_8);
      __pyx_cur_scope->__pyx_t_2 = __pyx_t_8;
      __pyx_cur_scope->__pyx_t_3 = __pyx_t_12;
      __pyx_cur_scope->__pyx_t_4 = __pyx_t_15;
      __pyx_cur_scope->__pyx_t_5 = __pyx_t_16;
      __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_L20_resume_from_yield:;
      __pyx_t_2 = __pyx_cur_scope->__pyx_t_0;
      __pyx_cur_scope->__pyx_t_0 = 0;
      __Pyx_XGOTREF(__pyx_t_2);
      __pyx_t_5 = __pyx_cur_scope->__pyx_t_1;
      __pyx_t_8 = __pyx_cur_scope->__pyx_t_2;
      __pyx_cur_scope->__pyx_t_2 = 0;
      __Pyx_XGOTREF(__pyx_t_8);
      __pyx_t_12 = __pyx_cur_scope->__pyx_t_3;
      __pyx_t_15 = __pyx_cur_scope->__pyx_t_4;
      __pyx_t_16 = __pyx_cur_scope->__pyx_t_5;
      if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2254, __pyx_L1_error)

      /* "mathics/builtin/graphics.py":2253
 *                         dl, px, py, dx, dy = seg[i]
 * 
 *             for shape in draw(px, py, dx / dl, dy / dl, t, s):             # <<<<<<<<<<<<<<
 *                 yield shape
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "mathics/builtin/graphics.py":2237
 *         total = sum(segment[0] for segment in seg)
 * 
 *         for s, t, draw in ((s, pos * total - t0, draw) for s, pos, draw in heads):             # <<<<<<<<<<<<<<
 *             if s == 0.0:  # ignore zero-sized arrows
 *                 continue
 */
    __pyx_L7_continue:;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "mathics/builtin/graphics.py":2219
 *         return draw
 * 
 *     def arrows(self, points, heads):  # heads has to be sorted by pos             # <<<<<<<<<<<<<<
 *         def segments(points):
 *             for i in range(len(points) - 1):
 */

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

/* "mathics/builtin/graphics.py":2257
 * 
 * 
 * def _bezier_derivative(p):             # <<<<<<<<<<<<<<
 *     # see http://pomax.github.io/bezierinfo/, Section 12 Derivatives
 *     n = len(p[0]) - 1
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_39_bezier_derivative(PyObject *__pyx_self, PyObject *__pyx_v_p); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_39_bezier_derivative = {"_bezier_derivative", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_39_bezier_derivative, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_39_bezier_derivative(PyObject *__pyx_self, PyObject *__pyx_v_p) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_bezier_derivative (wrapper)", 0);
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_38_bezier_derivative(__pyx_self, ((PyObject *)__pyx_v_p));

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_38_bezier_derivative(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_p) {
  PyObject *__pyx_v_n = NULL;
  PyObject *__pyx_9genexpr44__pyx_v_w = NULL;
  PyObject *__pyx_9genexpr45__pyx_v_x1 = NULL;
  PyObject *__pyx_9genexpr45__pyx_v_x0 = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *(*__pyx_t_13)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_bezier_derivative", 0);

  /* "mathics/builtin/graphics.py":2259
 * def _bezier_derivative(p):
 *     # see http://pomax.github.io/bezierinfo/, Section 12 Derivatives
 *     n = len(p[0]) - 1             # <<<<<<<<<<<<<<
 *     return [[n * (x1 - x0) for x1, x0 in zip(w, w[1:])] for w in p]
 * 
 */
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_p, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2259, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2259, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyInt_FromSsize_t((__pyx_t_2 - 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2259, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_n = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":2260
 *     # see http://pomax.github.io/bezierinfo/, Section 12 Derivatives
 *     n = len(p[0]) - 1
 *     return [[n * (x1 - x0) for x1, x0 in zip(w, w[1:])] for w in p]             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2260, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (likely(PyList_CheckExact(__pyx_v_p)) || PyTuple_CheckExact(__pyx_v_p)) {
      __pyx_t_3 = __pyx_v_p; __Pyx_INCREF(__pyx_t_3); __pyx_t_2 = 0;
      __pyx_t_4 = NULL;
    } else {
      __pyx_t_2 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_p); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2260, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2260, __pyx_L5_error)
    }
    for (;;) {
      if (likely(!__pyx_t_4)) {
        if (likely(PyList_CheckExact(__pyx_t_3))) {
          if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_5 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 2260, __pyx_L5_error)
          #else
          __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2260, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_5);
          #endif
        } else {
          if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 2260, __pyx_L5_error)
          #else
          __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2260, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_5);
          #endif
        }
      } else {
        __pyx_t_5 = __pyx_t_4(__pyx_t_3);
        if (unlikely(!__pyx_t_5)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 2260, __pyx_L5_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_5);
      }
      __Pyx_XDECREF_SET(__pyx_9genexpr44__pyx_v_w, __pyx_t_5);
      __pyx_t_5 = 0;
      { /* enter inner scope */
        __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2260, __pyx_L10_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_6 = __Pyx_PyObject_GetSlice(__pyx_9genexpr44__pyx_v_w, 1, 0, NULL, NULL, &__pyx_slice__13, 1, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2260, __pyx_L10_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2260, __pyx_L10_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_INCREF(__pyx_9genexpr44__pyx_v_w);
        __Pyx_GIVEREF(__pyx_9genexpr44__pyx_v_w);
        PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_9genexpr44__pyx_v_w);
        __Pyx_GIVEREF(__pyx_t_6);
        PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6);
        __pyx_t_6 = 0;
        __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2260, __pyx_L10_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) {
          __pyx_t_7 = __pyx_t_6; __Pyx_INCREF(__pyx_t_7); __pyx_t_8 = 0;
          __pyx_t_9 = NULL;
        } else {
          __pyx_t_8 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2260, __pyx_L10_error)
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_9 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2260, __pyx_L10_error)
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        for (;;) {
          if (likely(!__pyx_t_9)) {
            if (likely(PyList_CheckExact(__pyx_t_7))) {
              if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_7)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_6 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 2260, __pyx_L10_error)
              #else
              __pyx_t_6 = PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2260, __pyx_L10_error)
              __Pyx_GOTREF(__pyx_t_6);
              #endif
            } else {
              if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 2260, __pyx_L10_error)
              #else
              __pyx_t_6 = PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2260, __pyx_L10_error)
              __Pyx_GOTREF(__pyx_t_6);
              #endif
            }
          } else {
            __pyx_t_6 = __pyx_t_9(__pyx_t_7);
            if (unlikely(!__pyx_t_6)) {
              PyObject* exc_type = PyErr_Occurred();
              if (exc_type) {
                if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                else __PYX_ERR(0, 2260, __pyx_L10_error)
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_6);
          }
          if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) {
            PyObject* sequence = __pyx_t_6;
            Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
            if (unlikely(size != 2)) {
              if (size > 2) __Pyx_RaiseTooManyValuesError(2);
              else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
              __PYX_ERR(0, 2260, __pyx_L10_error)
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            if (likely(PyTuple_CheckExact(sequence))) {
              __pyx_t_10 = PyTuple_GET_ITEM(sequence, 0); 
              __pyx_t_11 = PyTuple_GET_ITEM(sequence, 1); 
            } else {
              __pyx_t_10 = PyList_GET_ITEM(sequence, 0); 
              __pyx_t_11 = PyList_GET_ITEM(sequence, 1); 
            }
            __Pyx_INCREF(__pyx_t_10);
            __Pyx_INCREF(__pyx_t_11);
            #else
            __pyx_t_10 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2260, __pyx_L10_error)
            __Pyx_GOTREF(__pyx_t_10);
            __pyx_t_11 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2260, __pyx_L10_error)
            __Pyx_GOTREF(__pyx_t_11);
            #endif
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          } else {
            Py_ssize_t index = -1;
            __pyx_t_12 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2260, __pyx_L10_error)
            __Pyx_GOTREF(__pyx_t_12);
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            __pyx_t_13 = Py_TYPE(__pyx_t_12)->tp_iternext;
            index = 0; __pyx_t_10 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_10)) goto __pyx_L13_unpacking_failed;
            __Pyx_GOTREF(__pyx_t_10);
            index = 1; __pyx_t_11 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_11)) goto __pyx_L13_unpacking_failed;
            __Pyx_GOTREF(__pyx_t_11);
            if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 2) < 0) __PYX_ERR(0, 2260, __pyx_L10_error)
            __pyx_t_13 = NULL;
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            goto __pyx_L14_unpacking_done;
            __pyx_L13_unpacking_failed:;
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            __pyx_t_13 = NULL;
            if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
            __PYX_ERR(0, 2260, __pyx_L10_error)
            __pyx_L14_unpacking_done:;
          }
          __Pyx_XDECREF_SET(__pyx_9genexpr45__pyx_v_x1, __pyx_t_10);
          __pyx_t_10 = 0;
          __Pyx_XDECREF_SET(__pyx_9genexpr45__pyx_v_x0, __pyx_t_11);
          __pyx_t_11 = 0;
          __pyx_t_6 = PyNumber_Subtract(__pyx_9genexpr45__pyx_v_x1, __pyx_9genexpr45__pyx_v_x0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2260, __pyx_L10_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_11 = PyNumber_Multiply(__pyx_v_n, __pyx_t_6); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2260, __pyx_L10_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_11))) __PYX_ERR(0, 2260, __pyx_L10_error)
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        }
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_9genexpr45__pyx_v_x0); __pyx_9genexpr45__pyx_v_x0 = 0;
        __Pyx_XDECREF(__pyx_9genexpr45__pyx_v_x1); __pyx_9genexpr45__pyx_v_x1 = 0;
        goto __pyx_L15_exit_scope;
        __pyx_L10_error:;
        __Pyx_XDECREF(__pyx_9genexpr45__pyx_v_x0); __pyx_9genexpr45__pyx_v_x0 = 0;
        __Pyx_XDECREF(__pyx_9genexpr45__pyx_v_x1); __pyx_9genexpr45__pyx_v_x1 = 0;
        goto __pyx_L5_error;
        __pyx_L15_exit_scope:;
      } /* exit inner scope */
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 2260, __pyx_L5_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_9genexpr44__pyx_v_w); __pyx_9genexpr44__pyx_v_w = 0;
    goto __pyx_L16_exit_scope;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_9genexpr44__pyx_v_w); __pyx_9genexpr44__pyx_v_w = 0;
    goto __pyx_L1_error;
    __pyx_L16_exit_scope:;
  } /* exit inner scope */
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":2257
 * 
 * 
 * def _bezier_derivative(p):             # <<<<<<<<<<<<<<
 *     # see http://pomax.github.io/bezierinfo/, Section 12 Derivatives
 *     n = len(p[0]) - 1
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("mathics.builtin.graphics._bezier_derivative", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_n);
  __Pyx_XDECREF(__pyx_9genexpr44__pyx_v_w);
  __Pyx_XDECREF(__pyx_9genexpr45__pyx_v_x1);
  __Pyx_XDECREF(__pyx_9genexpr45__pyx_v_x0);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":2263
 * 
 * 
 * def _bezier_evaluate(p, t):             # <<<<<<<<<<<<<<
 *     # see http://pomax.github.io/bezierinfo/, Section 4 Controlling Bezier Curvatures
 *     n = len(p[0]) - 1
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_41_bezier_evaluate(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_41_bezier_evaluate = {"_bezier_evaluate", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_41_bezier_evaluate, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_41_bezier_evaluate(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_p = 0;
  PyObject *__pyx_v_t = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_bezier_evaluate (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_p,&__pyx_n_s_t,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_p)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_bezier_evaluate", 1, 2, 2, 1); __PYX_ERR(0, 2263, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_bezier_evaluate") < 0)) __PYX_ERR(0, 2263, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_p = values[0];
    __pyx_v_t = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_bezier_evaluate", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2263, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics._bezier_evaluate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_40_bezier_evaluate(__pyx_self, __pyx_v_p, __pyx_v_t);

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_40_bezier_evaluate(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_p, PyObject *__pyx_v_t) {
  PyObject *__pyx_v_n = NULL;
  PyObject *__pyx_v_t2 = NULL;
  PyObject *__pyx_v_t3 = NULL;
  PyObject *__pyx_v_mt = NULL;
  PyObject *__pyx_v_mt2 = NULL;
  PyObject *__pyx_v_mt3 = NULL;
  PyObject *__pyx_9genexpr46__pyx_v_w = NULL;
  PyObject *__pyx_9genexpr47__pyx_v_w = NULL;
  PyObject *__pyx_9genexpr48__pyx_v_w = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_bezier_evaluate", 0);

  /* "mathics/builtin/graphics.py":2265
 * def _bezier_evaluate(p, t):
 *     # see http://pomax.github.io/bezierinfo/, Section 4 Controlling Bezier Curvatures
 *     n = len(p[0]) - 1             # <<<<<<<<<<<<<<
 *     if n == 3:
 *         t2 = t * t
 */
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_p, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2265, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyInt_FromSsize_t((__pyx_t_2 - 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_n = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":2266
 *     # see http://pomax.github.io/bezierinfo/, Section 4 Controlling Bezier Curvatures
 *     n = len(p[0]) - 1
 *     if n == 3:             # <<<<<<<<<<<<<<
 *         t2 = t * t
 *         t3 = t2 * t
 */
  __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_n, __pyx_int_3, 3, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2266, __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(0, 2266, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {

    /* "mathics/builtin/graphics.py":2267
 *     n = len(p[0]) - 1
 *     if n == 3:
 *         t2 = t * t             # <<<<<<<<<<<<<<
 *         t3 = t2 * t
 *         mt = 1 - t
 */
    __pyx_t_1 = PyNumber_Multiply(__pyx_v_t, __pyx_v_t); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2267, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_t2 = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "mathics/builtin/graphics.py":2268
 *     if n == 3:
 *         t2 = t * t
 *         t3 = t2 * t             # <<<<<<<<<<<<<<
 *         mt = 1 - t
 *         mt2 = mt * mt
 */
    __pyx_t_1 = PyNumber_Multiply(__pyx_v_t2, __pyx_v_t); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2268, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_t3 = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "mathics/builtin/graphics.py":2269
 *         t2 = t * t
 *         t3 = t2 * t
 *         mt = 1 - t             # <<<<<<<<<<<<<<
 *         mt2 = mt * mt
 *         mt3 = mt2 * mt
 */
    __pyx_t_1 = __Pyx_PyInt_SubtractCObj(__pyx_int_1, __pyx_v_t, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2269, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_mt = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "mathics/builtin/graphics.py":2270
 *         t3 = t2 * t
 *         mt = 1 - t
 *         mt2 = mt * mt             # <<<<<<<<<<<<<<
 *         mt3 = mt2 * mt
 *         return [
 */
    __pyx_t_1 = PyNumber_Multiply(__pyx_v_mt, __pyx_v_mt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2270, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_mt2 = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "mathics/builtin/graphics.py":2271
 *         mt = 1 - t
 *         mt2 = mt * mt
 *         mt3 = mt2 * mt             # <<<<<<<<<<<<<<
 *         return [
 *             w[0] * mt3 + 3 * w[1] * mt2 * t + 3 * w[2] * mt * t2 + w[3] * t3 for w in p
 */
    __pyx_t_1 = PyNumber_Multiply(__pyx_v_mt2, __pyx_v_mt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2271, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_mt3 = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "mathics/builtin/graphics.py":2272
 *         mt2 = mt * mt
 *         mt3 = mt2 * mt
 *         return [             # <<<<<<<<<<<<<<
 *             w[0] * mt3 + 3 * w[1] * mt2 * t + 3 * w[2] * mt * t2 + w[3] * t3 for w in p
 *         ]
 */
    __Pyx_XDECREF(__pyx_r);
    { /* enter inner scope */
      __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2272, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_1);

      /* "mathics/builtin/graphics.py":2273
 *         mt3 = mt2 * mt
 *         return [
 *             w[0] * mt3 + 3 * w[1] * mt2 * t + 3 * w[2] * mt * t2 + w[3] * t3 for w in p             # <<<<<<<<<<<<<<
 *         ]
 *     elif n == 2:
 */
      if (likely(PyList_CheckExact(__pyx_v_p)) || PyTuple_CheckExact(__pyx_v_p)) {
        __pyx_t_4 = __pyx_v_p; __Pyx_INCREF(__pyx_t_4); __pyx_t_2 = 0;
        __pyx_t_5 = NULL;
      } else {
        __pyx_t_2 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_p); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2273, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2273, __pyx_L6_error)
      }
      for (;;) {
        if (likely(!__pyx_t_5)) {
          if (likely(PyList_CheckExact(__pyx_t_4))) {
            if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_4)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_6 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_6); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 2273, __pyx_L6_error)
            #else
            __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2273, __pyx_L6_error)
            __Pyx_GOTREF(__pyx_t_6);
            #endif
          } else {
            if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_6); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 2273, __pyx_L6_error)
            #else
            __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2273, __pyx_L6_error)
            __Pyx_GOTREF(__pyx_t_6);
            #endif
          }
        } else {
          __pyx_t_6 = __pyx_t_5(__pyx_t_4);
          if (unlikely(!__pyx_t_6)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 2273, __pyx_L6_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_6);
        }
        __Pyx_XDECREF_SET(__pyx_9genexpr46__pyx_v_w, __pyx_t_6);
        __pyx_t_6 = 0;
        __pyx_t_6 = __Pyx_GetItemInt(__pyx_9genexpr46__pyx_v_w, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2273, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_7 = PyNumber_Multiply(__pyx_t_6, __pyx_v_mt3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2273, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = __Pyx_GetItemInt(__pyx_9genexpr46__pyx_v_w, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2273, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_8 = PyNumber_Multiply(__pyx_int_3, __pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2273, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = PyNumber_Multiply(__pyx_t_8, __pyx_v_mt2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2273, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = PyNumber_Multiply(__pyx_t_6, __pyx_v_t); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2273, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = PyNumber_Add(__pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2273, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = __Pyx_GetItemInt(__pyx_9genexpr46__pyx_v_w, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2273, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_7 = PyNumber_Multiply(__pyx_int_3, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2273, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = PyNumber_Multiply(__pyx_t_7, __pyx_v_mt); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2273, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = PyNumber_Multiply(__pyx_t_8, __pyx_v_t2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2273, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = PyNumber_Add(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2273, __pyx_L6_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_7 = __Pyx_GetItemInt(__pyx_9genexpr46__pyx_v_w, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2273, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = PyNumber_Multiply(__pyx_t_7, __pyx_v_t3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2273, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = PyNumber_Add(__pyx_t_8, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2273, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 2272, __pyx_L6_error)
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_9genexpr46__pyx_v_w); __pyx_9genexpr46__pyx_v_w = 0;
      goto __pyx_L9_exit_scope;
      __pyx_L6_error:;
      __Pyx_XDECREF(__pyx_9genexpr46__pyx_v_w); __pyx_9genexpr46__pyx_v_w = 0;
      goto __pyx_L1_error;
      __pyx_L9_exit_scope:;
    } /* exit inner scope */
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "mathics/builtin/graphics.py":2266
 *     # see http://pomax.github.io/bezierinfo/, Section 4 Controlling Bezier Curvatures
 *     n = len(p[0]) - 1
 *     if n == 3:             # <<<<<<<<<<<<<<
 *         t2 = t * t
 *         t3 = t2 * t
 */
  }

  /* "mathics/builtin/graphics.py":2275
 *             w[0] * mt3 + 3 * w[1] * mt2 * t + 3 * w[2] * mt * t2 + w[3] * t3 for w in p
 *         ]
 *     elif n == 2:             # <<<<<<<<<<<<<<
 *         t2 = t * t
 *         mt = 1 - t
 */
  __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_n, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2275, __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(0, 2275, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {

    /* "mathics/builtin/graphics.py":2276
 *         ]
 *     elif n == 2:
 *         t2 = t * t             # <<<<<<<<<<<<<<
 *         mt = 1 - t
 *         mt2 = mt * mt
 */
    __pyx_t_1 = PyNumber_Multiply(__pyx_v_t, __pyx_v_t); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2276, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_t2 = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "mathics/builtin/graphics.py":2277
 *     elif n == 2:
 *         t2 = t * t
 *         mt = 1 - t             # <<<<<<<<<<<<<<
 *         mt2 = mt * mt
 *         return [w[0] * mt2 + w[1] * 2 * mt * t + w[2] * t2 for w in p]
 */
    __pyx_t_1 = __Pyx_PyInt_SubtractCObj(__pyx_int_1, __pyx_v_t, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2277, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_mt = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "mathics/builtin/graphics.py":2278
 *         t2 = t * t
 *         mt = 1 - t
 *         mt2 = mt * mt             # <<<<<<<<<<<<<<
 *         return [w[0] * mt2 + w[1] * 2 * mt * t + w[2] * t2 for w in p]
 *     elif n == 1:
 */
    __pyx_t_1 = PyNumber_Multiply(__pyx_v_mt, __pyx_v_mt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2278, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_mt2 = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "mathics/builtin/graphics.py":2279
 *         mt = 1 - t
 *         mt2 = mt * mt
 *         return [w[0] * mt2 + w[1] * 2 * mt * t + w[2] * t2 for w in p]             # <<<<<<<<<<<<<<
 *     elif n == 1:
 *         mt = 1 - t
 */
    __Pyx_XDECREF(__pyx_r);
    { /* enter inner scope */
      __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2279, __pyx_L12_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (likely(PyList_CheckExact(__pyx_v_p)) || PyTuple_CheckExact(__pyx_v_p)) {
        __pyx_t_4 = __pyx_v_p; __Pyx_INCREF(__pyx_t_4); __pyx_t_2 = 0;
        __pyx_t_5 = NULL;
      } else {
        __pyx_t_2 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_p); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2279, __pyx_L12_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2279, __pyx_L12_error)
      }
      for (;;) {
        if (likely(!__pyx_t_5)) {
          if (likely(PyList_CheckExact(__pyx_t_4))) {
            if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_4)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_7); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 2279, __pyx_L12_error)
            #else
            __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2279, __pyx_L12_error)
            __Pyx_GOTREF(__pyx_t_7);
            #endif
          } else {
            if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_7); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 2279, __pyx_L12_error)
            #else
            __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2279, __pyx_L12_error)
            __Pyx_GOTREF(__pyx_t_7);
            #endif
          }
        } else {
          __pyx_t_7 = __pyx_t_5(__pyx_t_4);
          if (unlikely(!__pyx_t_7)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 2279, __pyx_L12_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_7);
        }
        __Pyx_XDECREF_SET(__pyx_9genexpr47__pyx_v_w, __pyx_t_7);
        __pyx_t_7 = 0;
        __pyx_t_7 = __Pyx_GetItemInt(__pyx_9genexpr47__pyx_v_w, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2279, __pyx_L12_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = PyNumber_Multiply(__pyx_t_7, __pyx_v_mt2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2279, __pyx_L12_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = __Pyx_GetItemInt(__pyx_9genexpr47__pyx_v_w, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2279, __pyx_L12_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_8 = PyNumber_Multiply(__pyx_t_7, __pyx_int_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2279, __pyx_L12_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = PyNumber_Multiply(__pyx_t_8, __pyx_v_mt); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2279, __pyx_L12_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = PyNumber_Multiply(__pyx_t_7, __pyx_v_t); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2279, __pyx_L12_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = PyNumber_Add(__pyx_t_6, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2279, __pyx_L12_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = __Pyx_GetItemInt(__pyx_9genexpr47__pyx_v_w, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2279, __pyx_L12_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_6 = PyNumber_Multiply(__pyx_t_8, __pyx_v_t2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2279, __pyx_L12_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = PyNumber_Add(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2279, __pyx_L12_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 2279, __pyx_L12_error)
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_9genexpr47__pyx_v_w); __pyx_9genexpr47__pyx_v_w = 0;
      goto __pyx_L15_exit_scope;
      __pyx_L12_error:;
      __Pyx_XDECREF(__pyx_9genexpr47__pyx_v_w); __pyx_9genexpr47__pyx_v_w = 0;
      goto __pyx_L1_error;
      __pyx_L15_exit_scope:;
    } /* exit inner scope */
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "mathics/builtin/graphics.py":2275
 *             w[0] * mt3 + 3 * w[1] * mt2 * t + 3 * w[2] * mt * t2 + w[3] * t3 for w in p
 *         ]
 *     elif n == 2:             # <<<<<<<<<<<<<<
 *         t2 = t * t
 *         mt = 1 - t
 */
  }

  /* "mathics/builtin/graphics.py":2280
 *         mt2 = mt * mt
 *         return [w[0] * mt2 + w[1] * 2 * mt * t + w[2] * t2 for w in p]
 *     elif n == 1:             # <<<<<<<<<<<<<<
 *         mt = 1 - t
 *         return [w[0] * mt + w[1] * t for w in p]
 */
  __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_n, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2280, __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(0, 2280, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (likely(__pyx_t_3)) {

    /* "mathics/builtin/graphics.py":2281
 *         return [w[0] * mt2 + w[1] * 2 * mt * t + w[2] * t2 for w in p]
 *     elif n == 1:
 *         mt = 1 - t             # <<<<<<<<<<<<<<
 *         return [w[0] * mt + w[1] * t for w in p]
 *     else:
 */
    __pyx_t_1 = __Pyx_PyInt_SubtractCObj(__pyx_int_1, __pyx_v_t, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2281, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_mt = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "mathics/builtin/graphics.py":2282
 *     elif n == 1:
 *         mt = 1 - t
 *         return [w[0] * mt + w[1] * t for w in p]             # <<<<<<<<<<<<<<
 *     else:
 *         raise ValueError("cannot compute bezier curve of order %d" % n)
 */
    __Pyx_XDECREF(__pyx_r);
    { /* enter inner scope */
      __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2282, __pyx_L18_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (likely(PyList_CheckExact(__pyx_v_p)) || PyTuple_CheckExact(__pyx_v_p)) {
        __pyx_t_4 = __pyx_v_p; __Pyx_INCREF(__pyx_t_4); __pyx_t_2 = 0;
        __pyx_t_5 = NULL;
      } else {
        __pyx_t_2 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_p); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2282, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2282, __pyx_L18_error)
      }
      for (;;) {
        if (likely(!__pyx_t_5)) {
          if (likely(PyList_CheckExact(__pyx_t_4))) {
            if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_4)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_8 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_8); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 2282, __pyx_L18_error)
            #else
            __pyx_t_8 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2282, __pyx_L18_error)
            __Pyx_GOTREF(__pyx_t_8);
            #endif
          } else {
            if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_8); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 2282, __pyx_L18_error)
            #else
            __pyx_t_8 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2282, __pyx_L18_error)
            __Pyx_GOTREF(__pyx_t_8);
            #endif
          }
        } else {
          __pyx_t_8 = __pyx_t_5(__pyx_t_4);
          if (unlikely(!__pyx_t_8)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 2282, __pyx_L18_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_8);
        }
        __Pyx_XDECREF_SET(__pyx_9genexpr48__pyx_v_w, __pyx_t_8);
        __pyx_t_8 = 0;
        __pyx_t_8 = __Pyx_GetItemInt(__pyx_9genexpr48__pyx_v_w, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2282, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_6 = PyNumber_Multiply(__pyx_t_8, __pyx_v_mt); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2282, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = __Pyx_GetItemInt(__pyx_9genexpr48__pyx_v_w, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2282, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_7 = PyNumber_Multiply(__pyx_t_8, __pyx_v_t); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2282, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = PyNumber_Add(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2282, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 2282, __pyx_L18_error)
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_9genexpr48__pyx_v_w); __pyx_9genexpr48__pyx_v_w = 0;
      goto __pyx_L21_exit_scope;
      __pyx_L18_error:;
      __Pyx_XDECREF(__pyx_9genexpr48__pyx_v_w); __pyx_9genexpr48__pyx_v_w = 0;
      goto __pyx_L1_error;
      __pyx_L21_exit_scope:;
    } /* exit inner scope */
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "mathics/builtin/graphics.py":2280
 *         mt2 = mt * mt
 *         return [w[0] * mt2 + w[1] * 2 * mt * t + w[2] * t2 for w in p]
 *     elif n == 1:             # <<<<<<<<<<<<<<
 *         mt = 1 - t
 *         return [w[0] * mt + w[1] * t for w in p]
 */
  }

  /* "mathics/builtin/graphics.py":2284
 *         return [w[0] * mt + w[1] * t for w in p]
 *     else:
 *         raise ValueError("cannot compute bezier curve of order %d" % n)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __pyx_t_1 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_cannot_compute_bezier_curve_of_o, __pyx_v_n); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2284, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2284, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(0, 2284, __pyx_L1_error)
  }

  /* "mathics/builtin/graphics.py":2263
 * 
 * 
 * def _bezier_evaluate(p, t):             # <<<<<<<<<<<<<<
 *     # see http://pomax.github.io/bezierinfo/, Section 4 Controlling Bezier Curvatures
 *     n = len(p[0]) - 1
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("mathics.builtin.graphics._bezier_evaluate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_n);
  __Pyx_XDECREF(__pyx_v_t2);
  __Pyx_XDECREF(__pyx_v_t3);
  __Pyx_XDECREF(__pyx_v_mt);
  __Pyx_XDECREF(__pyx_v_mt2);
  __Pyx_XDECREF(__pyx_v_mt3);
  __Pyx_XDECREF(__pyx_9genexpr46__pyx_v_w);
  __Pyx_XDECREF(__pyx_9genexpr47__pyx_v_w);
  __Pyx_XDECREF(__pyx_9genexpr48__pyx_v_w);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":2288
 * 
 * class _BezierCurve:
 *     def __init__(self, spline_degree=3):             # <<<<<<<<<<<<<<
 *         self.spline_degree = spline_degree
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_12_BezierCurve_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_12_BezierCurve_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_12_BezierCurve_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_12_BezierCurve_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_spline_degree = 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);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_spline_degree,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)((PyObject *)__pyx_int_3));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_spline_degree);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 2288, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_spline_degree = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2288, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics._BezierCurve.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_12_BezierCurve___init__(__pyx_self, __pyx_v_self, __pyx_v_spline_degree);

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

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

  /* "mathics/builtin/graphics.py":2289
 * class _BezierCurve:
 *     def __init__(self, spline_degree=3):
 *         self.spline_degree = spline_degree             # <<<<<<<<<<<<<<
 * 
 *     def make_draw_svg(self, style):
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_spline_degree, __pyx_v_spline_degree) < 0) __PYX_ERR(0, 2289, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2288
 * 
 * class _BezierCurve:
 *     def __init__(self, spline_degree=3):             # <<<<<<<<<<<<<<
 *         self.spline_degree = spline_degree
 * 
 */

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

/* "mathics/builtin/graphics.py":2291
 *         self.spline_degree = spline_degree
 * 
 *     def make_draw_svg(self, style):             # <<<<<<<<<<<<<<
 *         def draw(points):
 *             s = " ".join(_svg_bezier((self.spline_degree, points)))
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_12_BezierCurve_3make_draw_svg(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_12_BezierCurve_3make_draw_svg = {"make_draw_svg", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_12_BezierCurve_3make_draw_svg, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_12_BezierCurve_3make_draw_svg(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_style = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_draw_svg (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_style,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_style)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("make_draw_svg", 1, 2, 2, 1); __PYX_ERR(0, 2291, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "make_draw_svg") < 0)) __PYX_ERR(0, 2291, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_style = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("make_draw_svg", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2291, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics._BezierCurve.make_draw_svg", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_12_BezierCurve_2make_draw_svg(__pyx_self, __pyx_v_self, __pyx_v_style);

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

/* "mathics/builtin/graphics.py":2292
 * 
 *     def make_draw_svg(self, style):
 *         def draw(points):             # <<<<<<<<<<<<<<
 *             s = " ".join(_svg_bezier((self.spline_degree, points)))
 *             yield '<path d="%s" style="%s"/>' % (s, style)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_12_BezierCurve_13make_draw_svg_1draw(PyObject *__pyx_self, PyObject *__pyx_v_points); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_12_BezierCurve_13make_draw_svg_1draw = {"draw", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_12_BezierCurve_13make_draw_svg_1draw, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_12_BezierCurve_13make_draw_svg_1draw(PyObject *__pyx_self, PyObject *__pyx_v_points) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("draw (wrapper)", 0);
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_12_BezierCurve_13make_draw_svg_draw(__pyx_self, ((PyObject *)__pyx_v_points));

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_12_BezierCurve_13make_draw_svg_draw(PyObject *__pyx_self, PyObject *__pyx_v_points) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_49_draw *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("draw", 0);
  __pyx_cur_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_49_draw *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_49_draw(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_49_draw, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_49_draw *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 2292, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_48_make_draw_svg *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  __pyx_cur_scope->__pyx_v_points = __pyx_v_points;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_points);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_points);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7mathics_7builtin_8graphics_12_BezierCurve_13make_draw_svg_2generator34, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_draw, __pyx_n_s_BezierCurve_make_draw_svg_local, __pyx_n_s_mathics_builtin_graphics); if (unlikely(!gen)) __PYX_ERR(0, 2292, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics._BezierCurve.make_draw_svg.draw", __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_7mathics_7builtin_8graphics_12_BezierCurve_13make_draw_svg_2generator34(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_49_draw *__pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_49_draw *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  Py_UCS4 __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("draw", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L4_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2292, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2293
 *     def make_draw_svg(self, style):
 *         def draw(points):
 *             s = " ".join(_svg_bezier((self.spline_degree, points)))             # <<<<<<<<<<<<<<
 *             yield '<path d="%s" style="%s"/>' % (s, style)
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_svg_bezier); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2293, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 2293, __pyx_L1_error) }
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self, __pyx_n_s_spline_degree); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2293, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2293, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_points);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_points);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_cur_scope->__pyx_v_points);
  __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2293, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyUnicode_Join(__pyx_kp_u__7, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2293, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_cur_scope->__pyx_v_s = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":2294
 *         def draw(points):
 *             s = " ".join(_svg_bezier((self.spline_degree, points)))
 *             yield '<path d="%s" style="%s"/>' % (s, style)             # <<<<<<<<<<<<<<
 * 
 *         return draw
 */
  __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2294, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = 0;
  __pyx_t_6 = 127;
  __Pyx_INCREF(__pyx_kp_u_path_d);
  __pyx_t_5 += 9;
  __Pyx_GIVEREF(__pyx_kp_u_path_d);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u_path_d);
  __pyx_t_1 = __Pyx_PyUnicode_Unicode(__pyx_cur_scope->__pyx_v_s); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2294, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_6;
  __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
  __pyx_t_1 = 0;
  __Pyx_INCREF(__pyx_kp_u_style_2);
  __pyx_t_5 += 9;
  __Pyx_GIVEREF(__pyx_kp_u_style_2);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u_style_2);
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_style)) { __Pyx_RaiseClosureNameError("style"); __PYX_ERR(0, 2294, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_style), __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2294, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_6;
  __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_1);
  __pyx_t_1 = 0;
  __Pyx_INCREF(__pyx_kp_u__57);
  __pyx_t_5 += 3;
  __Pyx_GIVEREF(__pyx_kp_u__57);
  PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_kp_u__57);
  __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_2, 5, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2294, __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;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  /* return from generator, yielding value */
  __pyx_generator->resume_label = 1;
  return __pyx_r;
  __pyx_L4_resume_from_yield:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2294, __pyx_L1_error)
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "mathics/builtin/graphics.py":2292
 * 
 *     def make_draw_svg(self, style):
 *         def draw(points):             # <<<<<<<<<<<<<<
 *             s = " ".join(_svg_bezier((self.spline_degree, points)))
 *             yield '<path d="%s" style="%s"/>' % (s, style)
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  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("draw", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":2291
 *         self.spline_degree = spline_degree
 * 
 *     def make_draw_svg(self, style):             # <<<<<<<<<<<<<<
 *         def draw(points):
 *             s = " ".join(_svg_bezier((self.spline_degree, points)))
 */

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_12_BezierCurve_2make_draw_svg(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_style) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_48_make_draw_svg *__pyx_cur_scope;
  PyObject *__pyx_v_draw = 0;
  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("make_draw_svg", 0);
  __pyx_cur_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_48_make_draw_svg *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_48_make_draw_svg(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_48_make_draw_svg, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_48_make_draw_svg *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 2291, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self);
  __pyx_cur_scope->__pyx_v_style = __pyx_v_style;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_style);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_style);

  /* "mathics/builtin/graphics.py":2292
 * 
 *     def make_draw_svg(self, style):
 *         def draw(points):             # <<<<<<<<<<<<<<
 *             s = " ".join(_svg_bezier((self.spline_degree, points)))
 *             yield '<path d="%s" style="%s"/>' % (s, style)
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_12_BezierCurve_13make_draw_svg_1draw, 0, __pyx_n_s_BezierCurve_make_draw_svg_local, ((PyObject*)__pyx_cur_scope), __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2292, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_draw = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":2296
 *             yield '<path d="%s" style="%s"/>' % (s, style)
 * 
 *         return draw             # <<<<<<<<<<<<<<
 * 
 *     def make_draw_asy(self, pen):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_draw);
  __pyx_r = __pyx_v_draw;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":2291
 *         self.spline_degree = spline_degree
 * 
 *     def make_draw_svg(self, style):             # <<<<<<<<<<<<<<
 *         def draw(points):
 *             s = " ".join(_svg_bezier((self.spline_degree, points)))
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("mathics.builtin.graphics._BezierCurve.make_draw_svg", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_draw);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":2298
 *         return draw
 * 
 *     def make_draw_asy(self, pen):             # <<<<<<<<<<<<<<
 *         def draw(points):
 *             for path in _asy_bezier((self.spline_degree, points)):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_12_BezierCurve_5make_draw_asy(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_12_BezierCurve_5make_draw_asy = {"make_draw_asy", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_12_BezierCurve_5make_draw_asy, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_12_BezierCurve_5make_draw_asy(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_pen = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_draw_asy (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_pen,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pen)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("make_draw_asy", 1, 2, 2, 1); __PYX_ERR(0, 2298, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "make_draw_asy") < 0)) __PYX_ERR(0, 2298, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_pen = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("make_draw_asy", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2298, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics._BezierCurve.make_draw_asy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_12_BezierCurve_4make_draw_asy(__pyx_self, __pyx_v_self, __pyx_v_pen);

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

/* "mathics/builtin/graphics.py":2299
 * 
 *     def make_draw_asy(self, pen):
 *         def draw(points):             # <<<<<<<<<<<<<<
 *             for path in _asy_bezier((self.spline_degree, points)):
 *                 yield "draw(%s, %s);" % (path, pen)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_12_BezierCurve_13make_draw_asy_1draw(PyObject *__pyx_self, PyObject *__pyx_v_points); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_12_BezierCurve_13make_draw_asy_1draw = {"draw", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_12_BezierCurve_13make_draw_asy_1draw, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_12_BezierCurve_13make_draw_asy_1draw(PyObject *__pyx_self, PyObject *__pyx_v_points) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("draw (wrapper)", 0);
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_12_BezierCurve_13make_draw_asy_draw(__pyx_self, ((PyObject *)__pyx_v_points));

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_12_BezierCurve_13make_draw_asy_draw(PyObject *__pyx_self, PyObject *__pyx_v_points) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_51_draw *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("draw", 0);
  __pyx_cur_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_51_draw *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_51_draw(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_51_draw, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_51_draw *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 2299, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_50_make_draw_asy *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  __pyx_cur_scope->__pyx_v_points = __pyx_v_points;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_points);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_points);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7mathics_7builtin_8graphics_12_BezierCurve_13make_draw_asy_2generator35, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_draw, __pyx_n_s_BezierCurve_make_draw_asy_local, __pyx_n_s_mathics_builtin_graphics); if (unlikely(!gen)) __PYX_ERR(0, 2299, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics._BezierCurve.make_draw_asy.draw", __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_7mathics_7builtin_8graphics_12_BezierCurve_13make_draw_asy_2generator35(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_51_draw *__pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_51_draw *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  PyObject *(*__pyx_t_6)(PyObject *);
  Py_ssize_t __pyx_t_7;
  Py_UCS4 __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("draw", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2299, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2300
 *     def make_draw_asy(self, pen):
 *         def draw(points):
 *             for path in _asy_bezier((self.spline_degree, points)):             # <<<<<<<<<<<<<<
 *                 yield "draw(%s, %s);" % (path, pen)
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_asy_bezier); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2300, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 2300, __pyx_L1_error) }
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self, __pyx_n_s_spline_degree); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2300, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2300, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_points);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_points);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_cur_scope->__pyx_v_points);
  __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2300, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0;
    __pyx_t_6 = NULL;
  } else {
    __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2300, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2300, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_6)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 2300, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2300, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 2300, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2300, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_6(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 2300, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_path);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_path, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;

    /* "mathics/builtin/graphics.py":2301
 *         def draw(points):
 *             for path in _asy_bezier((self.spline_degree, points)):
 *                 yield "draw(%s, %s);" % (path, pen)             # <<<<<<<<<<<<<<
 * 
 *         return draw
 */
    __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2301, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = 0;
    __pyx_t_8 = 127;
    __Pyx_INCREF(__pyx_kp_u_draw_2);
    __pyx_t_7 += 5;
    __Pyx_GIVEREF(__pyx_kp_u_draw_2);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_draw_2);
    __pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_cur_scope->__pyx_v_path), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2301, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_8 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_8) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_8;
    __pyx_t_7 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
    __pyx_t_4 = 0;
    __Pyx_INCREF(__pyx_kp_u__4);
    __pyx_t_7 += 2;
    __Pyx_GIVEREF(__pyx_kp_u__4);
    PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u__4);
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_pen)) { __Pyx_RaiseClosureNameError("pen"); __PYX_ERR(0, 2301, __pyx_L1_error) }
    __pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_pen), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2301, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_8 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_8) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_8;
    __pyx_t_7 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_4);
    __pyx_t_4 = 0;
    __Pyx_INCREF(__pyx_kp_u__33);
    __pyx_t_7 += 2;
    __Pyx_GIVEREF(__pyx_kp_u__33);
    PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u__33);
    __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_1, 5, __pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2301, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    __Pyx_XGIVEREF(__pyx_t_2);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_5;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_6;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_2);
    __pyx_t_5 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_6 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2301, __pyx_L1_error)

    /* "mathics/builtin/graphics.py":2300
 *     def make_draw_asy(self, pen):
 *         def draw(points):
 *             for path in _asy_bezier((self.spline_degree, points)):             # <<<<<<<<<<<<<<
 *                 yield "draw(%s, %s);" % (path, pen)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "mathics/builtin/graphics.py":2299
 * 
 *     def make_draw_asy(self, pen):
 *         def draw(points):             # <<<<<<<<<<<<<<
 *             for path in _asy_bezier((self.spline_degree, points)):
 *                 yield "draw(%s, %s);" % (path, pen)
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  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("draw", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":2298
 *         return draw
 * 
 *     def make_draw_asy(self, pen):             # <<<<<<<<<<<<<<
 *         def draw(points):
 *             for path in _asy_bezier((self.spline_degree, points)):
 */

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_12_BezierCurve_4make_draw_asy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_pen) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_50_make_draw_asy *__pyx_cur_scope;
  PyObject *__pyx_v_draw = 0;
  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("make_draw_asy", 0);
  __pyx_cur_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_50_make_draw_asy *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_50_make_draw_asy(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_50_make_draw_asy, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_50_make_draw_asy *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 2298, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self);
  __pyx_cur_scope->__pyx_v_pen = __pyx_v_pen;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_pen);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_pen);

  /* "mathics/builtin/graphics.py":2299
 * 
 *     def make_draw_asy(self, pen):
 *         def draw(points):             # <<<<<<<<<<<<<<
 *             for path in _asy_bezier((self.spline_degree, points)):
 *                 yield "draw(%s, %s);" % (path, pen)
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_12_BezierCurve_13make_draw_asy_1draw, 0, __pyx_n_s_BezierCurve_make_draw_asy_local, ((PyObject*)__pyx_cur_scope), __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__81)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2299, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_draw = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":2303
 *                 yield "draw(%s, %s);" % (path, pen)
 * 
 *         return draw             # <<<<<<<<<<<<<<
 * 
 *     def arrows(self, points, heads):  # heads has to be sorted by pos
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_draw);
  __pyx_r = __pyx_v_draw;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":2298
 *         return draw
 * 
 *     def make_draw_asy(self, pen):             # <<<<<<<<<<<<<<
 *         def draw(points):
 *             for path in _asy_bezier((self.spline_degree, points)):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("mathics.builtin.graphics._BezierCurve.make_draw_asy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_draw);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7mathics_7builtin_8graphics_12_BezierCurve_8generator4(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "mathics/builtin/graphics.py":2305
 *         return draw
 * 
 *     def arrows(self, points, heads):  # heads has to be sorted by pos             # <<<<<<<<<<<<<<
 *         if len(points) < 2:
 *             return
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_12_BezierCurve_7arrows(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_12_BezierCurve_7arrows = {"arrows", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_12_BezierCurve_7arrows, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_12_BezierCurve_7arrows(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_points = 0;
  PyObject *__pyx_v_heads = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("arrows (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_points,&__pyx_n_s_heads,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_points)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("arrows", 1, 3, 3, 1); __PYX_ERR(0, 2305, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_heads)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("arrows", 1, 3, 3, 2); __PYX_ERR(0, 2305, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "arrows") < 0)) __PYX_ERR(0, 2305, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_self = values[0];
    __pyx_v_points = values[1];
    __pyx_v_heads = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("arrows", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2305, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics._BezierCurve.arrows", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_12_BezierCurve_6arrows(__pyx_self, __pyx_v_self, __pyx_v_points, __pyx_v_heads);

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_12_BezierCurve_6arrows(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_points, PyObject *__pyx_v_heads) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_52_arrows *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arrows", 0);
  __pyx_cur_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_52_arrows *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_52_arrows(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_52_arrows, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_52_arrows *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 2305, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self);
  __pyx_cur_scope->__pyx_v_points = __pyx_v_points;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_points);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_points);
  __pyx_cur_scope->__pyx_v_heads = __pyx_v_heads;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_heads);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_heads);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7mathics_7builtin_8graphics_12_BezierCurve_8generator4, __pyx_codeobj__82, (PyObject *) __pyx_cur_scope, __pyx_n_s_arrows, __pyx_n_s_BezierCurve_arrows, __pyx_n_s_mathics_builtin_graphics); if (unlikely(!gen)) __PYX_ERR(0, 2305, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics._BezierCurve.arrows", __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_7mathics_7builtin_8graphics_12_BezierCurve_8generator4(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_52_arrows *__pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_52_arrows *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  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 *);
  int __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  PyObject *(*__pyx_t_13)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("arrows", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L17_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2305, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2306
 * 
 *     def arrows(self, points, heads):  # heads has to be sorted by pos
 *         if len(points) < 2:             # <<<<<<<<<<<<<<
 *             return
 * 
 */
  __pyx_t_1 = PyObject_Length(__pyx_cur_scope->__pyx_v_points); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2306, __pyx_L1_error)
  __pyx_t_2 = ((__pyx_t_1 < 2) != 0);
  if (__pyx_t_2) {

    /* "mathics/builtin/graphics.py":2307
 *     def arrows(self, points, heads):  # heads has to be sorted by pos
 *         if len(points) < 2:
 *             return             # <<<<<<<<<<<<<<
 * 
 *         # FIXME combined curves
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = NULL;
    goto __pyx_L0;

    /* "mathics/builtin/graphics.py":2306
 * 
 *     def arrows(self, points, heads):  # heads has to be sorted by pos
 *         if len(points) < 2:             # <<<<<<<<<<<<<<
 *             return
 * 
 */
  }

  /* "mathics/builtin/graphics.py":2311
 *         # FIXME combined curves
 * 
 *         cp = list(zip(*points))             # <<<<<<<<<<<<<<
 *         if len(points) >= 3:
 *             dcp = _bezier_derivative(cp)
 */
  __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_cur_scope->__pyx_v_points); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2311, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2311, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PySequence_List(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2311, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_cur_scope->__pyx_v_cp = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":2312
 * 
 *         cp = list(zip(*points))
 *         if len(points) >= 3:             # <<<<<<<<<<<<<<
 *             dcp = _bezier_derivative(cp)
 *         else:
 */
  __pyx_t_1 = PyObject_Length(__pyx_cur_scope->__pyx_v_points); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2312, __pyx_L1_error)
  __pyx_t_2 = ((__pyx_t_1 >= 3) != 0);
  if (__pyx_t_2) {

    /* "mathics/builtin/graphics.py":2313
 *         cp = list(zip(*points))
 *         if len(points) >= 3:
 *             dcp = _bezier_derivative(cp)             # <<<<<<<<<<<<<<
 *         else:
 *             dcp = cp
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_bezier_derivative); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2313, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_cur_scope->__pyx_v_cp) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_cur_scope->__pyx_v_cp);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2313, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_cur_scope->__pyx_v_dcp = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "mathics/builtin/graphics.py":2312
 * 
 *         cp = list(zip(*points))
 *         if len(points) >= 3:             # <<<<<<<<<<<<<<
 *             dcp = _bezier_derivative(cp)
 *         else:
 */
    goto __pyx_L5;
  }

  /* "mathics/builtin/graphics.py":2315
 *             dcp = _bezier_derivative(cp)
 *         else:
 *             dcp = cp             # <<<<<<<<<<<<<<
 * 
 *         for s, t, draw in heads:
 */
  /*else*/ {
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_cp);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_cp);
    __pyx_cur_scope->__pyx_v_dcp = __pyx_cur_scope->__pyx_v_cp;
  }
  __pyx_L5:;

  /* "mathics/builtin/graphics.py":2317
 *             dcp = cp
 * 
 *         for s, t, draw in heads:             # <<<<<<<<<<<<<<
 *             if s == 0.0:  # ignore zero-sized arrows
 *                 continue
 */
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_heads)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_heads)) {
    __pyx_t_3 = __pyx_cur_scope->__pyx_v_heads; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0;
    __pyx_t_6 = NULL;
  } else {
    __pyx_t_1 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_heads); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2317, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2317, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_6)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_4); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(0, 2317, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2317, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_4); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(0, 2317, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2317, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_6(__pyx_t_3);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 2317, __pyx_L1_error)
        }
        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 != 3)) {
        if (size > 3) __Pyx_RaiseTooManyValuesError(3);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 2317, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); 
        __pyx_t_8 = PyTuple_GET_ITEM(sequence, 2); 
      } else {
        __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_7 = PyList_GET_ITEM(sequence, 1); 
        __pyx_t_8 = PyList_GET_ITEM(sequence, 2); 
      }
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_8);
      #else
      __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2317, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2317, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2317, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      #endif
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_9 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2317, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext;
      index = 0; __pyx_t_5 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_5);
      index = 1; __pyx_t_7 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_7)) goto __pyx_L8_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_7);
      index = 2; __pyx_t_8 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_8)) goto __pyx_L8_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_8);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 3) < 0) __PYX_ERR(0, 2317, __pyx_L1_error)
      __pyx_t_10 = NULL;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      goto __pyx_L9_unpacking_done;
      __pyx_L8_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_10 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 2317, __pyx_L1_error)
      __pyx_L9_unpacking_done:;
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_s);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_s, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_t);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_t, __pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    __pyx_t_7 = 0;
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_draw);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_draw, __pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_8);
    __pyx_t_8 = 0;

    /* "mathics/builtin/graphics.py":2318
 * 
 *         for s, t, draw in heads:
 *             if s == 0.0:  # ignore zero-sized arrows             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
    __pyx_t_4 = __Pyx_PyFloat_EqObjC(__pyx_cur_scope->__pyx_v_s, __pyx_float_0_0, 0.0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2318, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 2318, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_2) {

      /* "mathics/builtin/graphics.py":2319
 *         for s, t, draw in heads:
 *             if s == 0.0:  # ignore zero-sized arrows
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             px, py = _bezier_evaluate(cp, t)
 */
      goto __pyx_L6_continue;

      /* "mathics/builtin/graphics.py":2318
 * 
 *         for s, t, draw in heads:
 *             if s == 0.0:  # ignore zero-sized arrows             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
    }

    /* "mathics/builtin/graphics.py":2321
 *                 continue
 * 
 *             px, py = _bezier_evaluate(cp, t)             # <<<<<<<<<<<<<<
 * 
 *             tx, ty = _bezier_evaluate(dcp, t)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_bezier_evaluate); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2321, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_7 = NULL;
    __pyx_t_11 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_8, function);
        __pyx_t_11 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_8)) {
      PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_cur_scope->__pyx_v_cp, __pyx_cur_scope->__pyx_v_t};
      __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2321, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_4);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
      PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_cur_scope->__pyx_v_cp, __pyx_cur_scope->__pyx_v_t};
      __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2321, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_4);
    } else
    #endif
    {
      __pyx_t_5 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2321, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (__pyx_t_7) {
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
      }
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_cp);
      __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_cp);
      PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_11, __pyx_cur_scope->__pyx_v_cp);
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_t);
      __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_t);
      PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_11, __pyx_cur_scope->__pyx_v_t);
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2321, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
      PyObject* sequence = __pyx_t_4;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 2321, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_8 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_5);
      #else
      __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2321, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2321, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      #endif
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_7 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2321, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_10 = Py_TYPE(__pyx_t_7)->tp_iternext;
      index = 0; __pyx_t_8 = __pyx_t_10(__pyx_t_7); if (unlikely(!__pyx_t_8)) goto __pyx_L11_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_8);
      index = 1; __pyx_t_5 = __pyx_t_10(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L11_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_5);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_7), 2) < 0) __PYX_ERR(0, 2321, __pyx_L1_error)
      __pyx_t_10 = 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_10 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 2321, __pyx_L1_error)
      __pyx_L12_unpacking_done:;
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_px);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_px, __pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_8);
    __pyx_t_8 = 0;
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_py);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_py, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_5 = 0;

    /* "mathics/builtin/graphics.py":2323
 *             px, py = _bezier_evaluate(cp, t)
 * 
 *             tx, ty = _bezier_evaluate(dcp, t)             # <<<<<<<<<<<<<<
 *             tl = -sqrt(tx * tx + ty * ty)
 *             tx /= tl
 */
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_bezier_evaluate); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2323, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_8 = NULL;
    __pyx_t_11 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_11 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_cur_scope->__pyx_v_dcp, __pyx_cur_scope->__pyx_v_t};
      __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2323, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_GOTREF(__pyx_t_4);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_cur_scope->__pyx_v_dcp, __pyx_cur_scope->__pyx_v_t};
      __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2323, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_GOTREF(__pyx_t_4);
    } else
    #endif
    {
      __pyx_t_7 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2323, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (__pyx_t_8) {
        __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8); __pyx_t_8 = NULL;
      }
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_dcp);
      __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_dcp);
      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_11, __pyx_cur_scope->__pyx_v_dcp);
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_t);
      __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_t);
      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_11, __pyx_cur_scope->__pyx_v_t);
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2323, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
      PyObject* sequence = __pyx_t_4;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 2323, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_7 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_7);
      #else
      __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2323, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2323, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      #endif
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_8 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2323, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_10 = Py_TYPE(__pyx_t_8)->tp_iternext;
      index = 0; __pyx_t_5 = __pyx_t_10(__pyx_t_8); if (unlikely(!__pyx_t_5)) goto __pyx_L13_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_5);
      index = 1; __pyx_t_7 = __pyx_t_10(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L13_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_7);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_8), 2) < 0) __PYX_ERR(0, 2323, __pyx_L1_error)
      __pyx_t_10 = NULL;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L14_unpacking_done;
      __pyx_L13_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_10 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 2323, __pyx_L1_error)
      __pyx_L14_unpacking_done:;
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_tx);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_tx, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_ty);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_ty, __pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    __pyx_t_7 = 0;

    /* "mathics/builtin/graphics.py":2324
 * 
 *             tx, ty = _bezier_evaluate(dcp, t)
 *             tl = -sqrt(tx * tx + ty * ty)             # <<<<<<<<<<<<<<
 *             tx /= tl
 *             ty /= tl
 */
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2324, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_5 = PyNumber_Multiply(__pyx_cur_scope->__pyx_v_tx, __pyx_cur_scope->__pyx_v_tx); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2324, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_8 = PyNumber_Multiply(__pyx_cur_scope->__pyx_v_ty, __pyx_cur_scope->__pyx_v_ty); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2324, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = PyNumber_Add(__pyx_t_5, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2324, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    __pyx_t_4 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_9);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2324, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = PyNumber_Negative(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2324, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_tl);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_tl, __pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    __pyx_t_7 = 0;

    /* "mathics/builtin/graphics.py":2325
 *             tx, ty = _bezier_evaluate(dcp, t)
 *             tl = -sqrt(tx * tx + ty * ty)
 *             tx /= tl             # <<<<<<<<<<<<<<
 *             ty /= tl
 * 
 */
    __pyx_t_7 = __Pyx_PyNumber_InPlaceDivide(__pyx_cur_scope->__pyx_v_tx, __pyx_cur_scope->__pyx_v_tl); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2325, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_tx);
    __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_tx, __pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    __pyx_t_7 = 0;

    /* "mathics/builtin/graphics.py":2326
 *             tl = -sqrt(tx * tx + ty * ty)
 *             tx /= tl
 *             ty /= tl             # <<<<<<<<<<<<<<
 * 
 *             for shape in draw(px, py, tx, ty, 0.0, s):
 */
    __pyx_t_7 = __Pyx_PyNumber_InPlaceDivide(__pyx_cur_scope->__pyx_v_ty, __pyx_cur_scope->__pyx_v_tl); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2326, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_ty);
    __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_ty, __pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    __pyx_t_7 = 0;

    /* "mathics/builtin/graphics.py":2328
 *             ty /= tl
 * 
 *             for shape in draw(px, py, tx, ty, 0.0, s):             # <<<<<<<<<<<<<<
 *                 yield shape
 * 
 */
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_draw);
    __pyx_t_4 = __pyx_cur_scope->__pyx_v_draw; __pyx_t_9 = NULL;
    __pyx_t_11 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_11 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[7] = {__pyx_t_9, __pyx_cur_scope->__pyx_v_px, __pyx_cur_scope->__pyx_v_py, __pyx_cur_scope->__pyx_v_tx, __pyx_cur_scope->__pyx_v_ty, __pyx_float_0_0, __pyx_cur_scope->__pyx_v_s};
      __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_11, 6+__pyx_t_11); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2328, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_GOTREF(__pyx_t_7);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[7] = {__pyx_t_9, __pyx_cur_scope->__pyx_v_px, __pyx_cur_scope->__pyx_v_py, __pyx_cur_scope->__pyx_v_tx, __pyx_cur_scope->__pyx_v_ty, __pyx_float_0_0, __pyx_cur_scope->__pyx_v_s};
      __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_11, 6+__pyx_t_11); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2328, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_GOTREF(__pyx_t_7);
    } else
    #endif
    {
      __pyx_t_8 = PyTuple_New(6+__pyx_t_11); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2328, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (__pyx_t_9) {
        __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_9); __pyx_t_9 = NULL;
      }
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_px);
      __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_px);
      PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_11, __pyx_cur_scope->__pyx_v_px);
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_py);
      __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_py);
      PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_11, __pyx_cur_scope->__pyx_v_py);
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_tx);
      __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_tx);
      PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_11, __pyx_cur_scope->__pyx_v_tx);
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_ty);
      __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_ty);
      PyTuple_SET_ITEM(__pyx_t_8, 3+__pyx_t_11, __pyx_cur_scope->__pyx_v_ty);
      __Pyx_INCREF(__pyx_float_0_0);
      __Pyx_GIVEREF(__pyx_float_0_0);
      PyTuple_SET_ITEM(__pyx_t_8, 4+__pyx_t_11, __pyx_float_0_0);
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_s);
      __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_s);
      PyTuple_SET_ITEM(__pyx_t_8, 5+__pyx_t_11, __pyx_cur_scope->__pyx_v_s);
      __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2328, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (likely(PyList_CheckExact(__pyx_t_7)) || PyTuple_CheckExact(__pyx_t_7)) {
      __pyx_t_4 = __pyx_t_7; __Pyx_INCREF(__pyx_t_4); __pyx_t_12 = 0;
      __pyx_t_13 = NULL;
    } else {
      __pyx_t_12 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2328, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_13 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2328, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    for (;;) {
      if (likely(!__pyx_t_13)) {
        if (likely(PyList_CheckExact(__pyx_t_4))) {
          if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_4)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_12); __Pyx_INCREF(__pyx_t_7); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 2328, __pyx_L1_error)
          #else
          __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2328, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          #endif
        } else {
          if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_12); __Pyx_INCREF(__pyx_t_7); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 2328, __pyx_L1_error)
          #else
          __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2328, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          #endif
        }
      } else {
        __pyx_t_7 = __pyx_t_13(__pyx_t_4);
        if (unlikely(!__pyx_t_7)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 2328, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_7);
      }
      __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_shape);
      __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_shape, __pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_7);
      __pyx_t_7 = 0;

      /* "mathics/builtin/graphics.py":2329
 * 
 *             for shape in draw(px, py, tx, ty, 0.0, s):
 *                 yield shape             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_shape);
      __pyx_r = __pyx_cur_scope->__pyx_v_shape;
      __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
      __Pyx_XGIVEREF(__pyx_t_3);
      __pyx_cur_scope->__pyx_t_1 = __pyx_t_3;
      __Pyx_XGIVEREF(__pyx_t_4);
      __pyx_cur_scope->__pyx_t_2 = __pyx_t_4;
      __pyx_cur_scope->__pyx_t_3 = __pyx_t_6;
      __pyx_cur_scope->__pyx_t_4 = __pyx_t_12;
      __pyx_cur_scope->__pyx_t_5 = __pyx_t_13;
      __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_L17_resume_from_yield:;
      __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
      __pyx_t_3 = __pyx_cur_scope->__pyx_t_1;
      __pyx_cur_scope->__pyx_t_1 = 0;
      __Pyx_XGOTREF(__pyx_t_3);
      __pyx_t_4 = __pyx_cur_scope->__pyx_t_2;
      __pyx_cur_scope->__pyx_t_2 = 0;
      __Pyx_XGOTREF(__pyx_t_4);
      __pyx_t_6 = __pyx_cur_scope->__pyx_t_3;
      __pyx_t_12 = __pyx_cur_scope->__pyx_t_4;
      __pyx_t_13 = __pyx_cur_scope->__pyx_t_5;
      if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2329, __pyx_L1_error)

      /* "mathics/builtin/graphics.py":2328
 *             ty /= tl
 * 
 *             for shape in draw(px, py, tx, ty, 0.0, s):             # <<<<<<<<<<<<<<
 *                 yield shape
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "mathics/builtin/graphics.py":2317
 *             dcp = cp
 * 
 *         for s, t, draw in heads:             # <<<<<<<<<<<<<<
 *             if s == 0.0:  # ignore zero-sized arrows
 *                 continue
 */
    __pyx_L6_continue:;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "mathics/builtin/graphics.py":2305
 *         return draw
 * 
 *     def arrows(self, points, heads):  # heads has to be sorted by pos             # <<<<<<<<<<<<<<
 *         if len(points) < 2:
 *             return
 */

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

/* "mathics/builtin/graphics.py":2333
 * 
 * class ArrowBox(_Polyline):
 *     def init(self, graphics, style, item=None):             # <<<<<<<<<<<<<<
 *         if not item:
 *             raise BoxConstructError
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_8ArrowBox_1init(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_8ArrowBox_1init = {"init", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_8ArrowBox_1init, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_8ArrowBox_1init(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_graphics = 0;
  PyObject *__pyx_v_style = 0;
  PyObject *__pyx_v_item = 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);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_graphics,&__pyx_n_s_style,&__pyx_n_s_item,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = ((PyObject *)((PyObject *)Py_None));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_graphics)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("init", 0, 3, 4, 1); __PYX_ERR(0, 2333, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_style)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("init", 0, 3, 4, 2); __PYX_ERR(0, 2333, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_item);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "init") < 0)) __PYX_ERR(0, 2333, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_graphics = values[1];
    __pyx_v_style = values[2];
    __pyx_v_item = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("init", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2333, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.ArrowBox.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_8ArrowBox_init(__pyx_self, __pyx_v_self, __pyx_v_graphics, __pyx_v_style, __pyx_v_item);

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_8ArrowBox_init(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_graphics, PyObject *__pyx_v_style, PyObject *__pyx_v_item) {
  PyObject *__pyx_v_leaves = NULL;
  PyObject *__pyx_v_setback = NULL;
  PyObject *__pyx_v_curve = NULL;
  PyObject *__pyx_v_curve_head_name = NULL;
  PyObject *__pyx_v_curve_points = NULL;
  CYTHON_UNUSED PyObject *__pyx_v__ = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("init", 0);

  /* "mathics/builtin/graphics.py":2334
 * class ArrowBox(_Polyline):
 *     def init(self, graphics, style, item=None):
 *         if not item:             # <<<<<<<<<<<<<<
 *             raise BoxConstructError
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_item); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 2334, __pyx_L1_error)
  __pyx_t_2 = ((!__pyx_t_1) != 0);
  if (unlikely(__pyx_t_2)) {

    /* "mathics/builtin/graphics.py":2335
 *     def init(self, graphics, style, item=None):
 *         if not item:
 *             raise BoxConstructError             # <<<<<<<<<<<<<<
 * 
 *         super(ArrowBox, self).init(graphics, item, style)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_BoxConstructError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2335, __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(0, 2335, __pyx_L1_error)

    /* "mathics/builtin/graphics.py":2334
 * class ArrowBox(_Polyline):
 *     def init(self, graphics, style, item=None):
 *         if not item:             # <<<<<<<<<<<<<<
 *             raise BoxConstructError
 * 
 */
  }

  /* "mathics/builtin/graphics.py":2337
 *             raise BoxConstructError
 * 
 *         super(ArrowBox, self).init(graphics, item, style)             # <<<<<<<<<<<<<<
 * 
 *         leaves = item.leaves
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ArrowBox); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2337, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2337, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
  __Pyx_INCREF(__pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_self);
  __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2337, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_init); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2337, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
      __pyx_t_6 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_5)) {
    PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_graphics, __pyx_v_item, __pyx_v_style};
    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2337, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_3);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
    PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_graphics, __pyx_v_item, __pyx_v_style};
    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2337, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_3);
  } else
  #endif
  {
    __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2337, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_4) {
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL;
    }
    __Pyx_INCREF(__pyx_v_graphics);
    __Pyx_GIVEREF(__pyx_v_graphics);
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_graphics);
    __Pyx_INCREF(__pyx_v_item);
    __Pyx_GIVEREF(__pyx_v_item);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_item);
    __Pyx_INCREF(__pyx_v_style);
    __Pyx_GIVEREF(__pyx_v_style);
    PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_v_style);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2337, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":2339
 *         super(ArrowBox, self).init(graphics, item, style)
 * 
 *         leaves = item.leaves             # <<<<<<<<<<<<<<
 *         if len(leaves) == 2:
 *             setback = self._setback_spec(leaves[1])
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_item, __pyx_n_s_leaves); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2339, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_leaves = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":2340
 * 
 *         leaves = item.leaves
 *         if len(leaves) == 2:             # <<<<<<<<<<<<<<
 *             setback = self._setback_spec(leaves[1])
 *         elif len(leaves) == 1:
 */
  __pyx_t_8 = PyObject_Length(__pyx_v_leaves); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2340, __pyx_L1_error)
  __pyx_t_2 = ((__pyx_t_8 == 2) != 0);
  if (__pyx_t_2) {

    /* "mathics/builtin/graphics.py":2341
 *         leaves = item.leaves
 *         if len(leaves) == 2:
 *             setback = self._setback_spec(leaves[1])             # <<<<<<<<<<<<<<
 *         elif len(leaves) == 1:
 *             setback = (0, 0)
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_setback_spec); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2341, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_leaves, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2341, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_7);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2341, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_setback = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "mathics/builtin/graphics.py":2340
 * 
 *         leaves = item.leaves
 *         if len(leaves) == 2:             # <<<<<<<<<<<<<<
 *             setback = self._setback_spec(leaves[1])
 *         elif len(leaves) == 1:
 */
    goto __pyx_L4;
  }

  /* "mathics/builtin/graphics.py":2342
 *         if len(leaves) == 2:
 *             setback = self._setback_spec(leaves[1])
 *         elif len(leaves) == 1:             # <<<<<<<<<<<<<<
 *             setback = (0, 0)
 *         else:
 */
  __pyx_t_8 = PyObject_Length(__pyx_v_leaves); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2342, __pyx_L1_error)
  __pyx_t_2 = ((__pyx_t_8 == 1) != 0);
  if (likely(__pyx_t_2)) {

    /* "mathics/builtin/graphics.py":2343
 *             setback = self._setback_spec(leaves[1])
 *         elif len(leaves) == 1:
 *             setback = (0, 0)             # <<<<<<<<<<<<<<
 *         else:
 *             raise BoxConstructError
 */
    __Pyx_INCREF(__pyx_tuple__83);
    __pyx_v_setback = __pyx_tuple__83;

    /* "mathics/builtin/graphics.py":2342
 *         if len(leaves) == 2:
 *             setback = self._setback_spec(leaves[1])
 *         elif len(leaves) == 1:             # <<<<<<<<<<<<<<
 *             setback = (0, 0)
 *         else:
 */
    goto __pyx_L4;
  }

  /* "mathics/builtin/graphics.py":2345
 *             setback = (0, 0)
 *         else:
 *             raise BoxConstructError             # <<<<<<<<<<<<<<
 * 
 *         curve = leaves[0]
 */
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_BoxConstructError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2345, __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(0, 2345, __pyx_L1_error)
  }
  __pyx_L4:;

  /* "mathics/builtin/graphics.py":2347
 *             raise BoxConstructError
 * 
 *         curve = leaves[0]             # <<<<<<<<<<<<<<
 * 
 *         curve_head_name = curve.get_head_name()
 */
  __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_leaves, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2347, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_curve = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":2349
 *         curve = leaves[0]
 * 
 *         curve_head_name = curve.get_head_name()             # <<<<<<<<<<<<<<
 *         if curve_head_name == "System`List":
 *             curve_points = curve
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_curve, __pyx_n_s_get_head_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2349, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2349, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_curve_head_name = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":2350
 * 
 *         curve_head_name = curve.get_head_name()
 *         if curve_head_name == "System`List":             # <<<<<<<<<<<<<<
 *             curve_points = curve
 *             self.curve = _Line()
 */
  __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_curve_head_name, __pyx_kp_u_System_List, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 2350, __pyx_L1_error)
  if (__pyx_t_2) {

    /* "mathics/builtin/graphics.py":2351
 *         curve_head_name = curve.get_head_name()
 *         if curve_head_name == "System`List":
 *             curve_points = curve             # <<<<<<<<<<<<<<
 *             self.curve = _Line()
 *         elif curve_head_name == "System`Line":
 */
    __Pyx_INCREF(__pyx_v_curve);
    __pyx_v_curve_points = __pyx_v_curve;

    /* "mathics/builtin/graphics.py":2352
 *         if curve_head_name == "System`List":
 *             curve_points = curve
 *             self.curve = _Line()             # <<<<<<<<<<<<<<
 *         elif curve_head_name == "System`Line":
 *             if len(curve.leaves) != 1:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Line); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2352, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2352, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_curve, __pyx_t_3) < 0) __PYX_ERR(0, 2352, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "mathics/builtin/graphics.py":2350
 * 
 *         curve_head_name = curve.get_head_name()
 *         if curve_head_name == "System`List":             # <<<<<<<<<<<<<<
 *             curve_points = curve
 *             self.curve = _Line()
 */
    goto __pyx_L5;
  }

  /* "mathics/builtin/graphics.py":2353
 *             curve_points = curve
 *             self.curve = _Line()
 *         elif curve_head_name == "System`Line":             # <<<<<<<<<<<<<<
 *             if len(curve.leaves) != 1:
 *                 raise BoxConstructError
 */
  __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_curve_head_name, __pyx_kp_u_System_Line, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 2353, __pyx_L1_error)
  if (__pyx_t_2) {

    /* "mathics/builtin/graphics.py":2354
 *             self.curve = _Line()
 *         elif curve_head_name == "System`Line":
 *             if len(curve.leaves) != 1:             # <<<<<<<<<<<<<<
 *                 raise BoxConstructError
 *             curve_points = curve.leaves[0]
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_curve, __pyx_n_s_leaves); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2354, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2354, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_2 = ((__pyx_t_8 != 1) != 0);
    if (unlikely(__pyx_t_2)) {

      /* "mathics/builtin/graphics.py":2355
 *         elif curve_head_name == "System`Line":
 *             if len(curve.leaves) != 1:
 *                 raise BoxConstructError             # <<<<<<<<<<<<<<
 *             curve_points = curve.leaves[0]
 *             self.curve = _Line()
 */
      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_BoxConstructError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2355, __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(0, 2355, __pyx_L1_error)

      /* "mathics/builtin/graphics.py":2354
 *             self.curve = _Line()
 *         elif curve_head_name == "System`Line":
 *             if len(curve.leaves) != 1:             # <<<<<<<<<<<<<<
 *                 raise BoxConstructError
 *             curve_points = curve.leaves[0]
 */
    }

    /* "mathics/builtin/graphics.py":2356
 *             if len(curve.leaves) != 1:
 *                 raise BoxConstructError
 *             curve_points = curve.leaves[0]             # <<<<<<<<<<<<<<
 *             self.curve = _Line()
 *         elif curve_head_name == "System`BezierCurve":
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_curve, __pyx_n_s_leaves); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2356, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2356, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_curve_points = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "mathics/builtin/graphics.py":2357
 *                 raise BoxConstructError
 *             curve_points = curve.leaves[0]
 *             self.curve = _Line()             # <<<<<<<<<<<<<<
 *         elif curve_head_name == "System`BezierCurve":
 *             if len(curve.leaves) != 1:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Line); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2357, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2357, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_curve, __pyx_t_5) < 0) __PYX_ERR(0, 2357, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "mathics/builtin/graphics.py":2353
 *             curve_points = curve
 *             self.curve = _Line()
 *         elif curve_head_name == "System`Line":             # <<<<<<<<<<<<<<
 *             if len(curve.leaves) != 1:
 *                 raise BoxConstructError
 */
    goto __pyx_L5;
  }

  /* "mathics/builtin/graphics.py":2358
 *             curve_points = curve.leaves[0]
 *             self.curve = _Line()
 *         elif curve_head_name == "System`BezierCurve":             # <<<<<<<<<<<<<<
 *             if len(curve.leaves) != 1:
 *                 raise BoxConstructError
 */
  __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_curve_head_name, __pyx_kp_u_System_BezierCurve, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 2358, __pyx_L1_error)
  if (likely(__pyx_t_2)) {

    /* "mathics/builtin/graphics.py":2359
 *             self.curve = _Line()
 *         elif curve_head_name == "System`BezierCurve":
 *             if len(curve.leaves) != 1:             # <<<<<<<<<<<<<<
 *                 raise BoxConstructError
 *             curve_points = curve.leaves[0]
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_curve, __pyx_n_s_leaves); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2359, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_8 = PyObject_Length(__pyx_t_5); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2359, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_2 = ((__pyx_t_8 != 1) != 0);
    if (unlikely(__pyx_t_2)) {

      /* "mathics/builtin/graphics.py":2360
 *         elif curve_head_name == "System`BezierCurve":
 *             if len(curve.leaves) != 1:
 *                 raise BoxConstructError             # <<<<<<<<<<<<<<
 *             curve_points = curve.leaves[0]
 *             self.curve = _BezierCurve()
 */
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_BoxConstructError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2360, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_Raise(__pyx_t_5, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __PYX_ERR(0, 2360, __pyx_L1_error)

      /* "mathics/builtin/graphics.py":2359
 *             self.curve = _Line()
 *         elif curve_head_name == "System`BezierCurve":
 *             if len(curve.leaves) != 1:             # <<<<<<<<<<<<<<
 *                 raise BoxConstructError
 *             curve_points = curve.leaves[0]
 */
    }

    /* "mathics/builtin/graphics.py":2361
 *             if len(curve.leaves) != 1:
 *                 raise BoxConstructError
 *             curve_points = curve.leaves[0]             # <<<<<<<<<<<<<<
 *             self.curve = _BezierCurve()
 *         else:
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_curve, __pyx_n_s_leaves); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2361, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_5, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2361, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_curve_points = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "mathics/builtin/graphics.py":2362
 *                 raise BoxConstructError
 *             curve_points = curve.leaves[0]
 *             self.curve = _BezierCurve()             # <<<<<<<<<<<<<<
 *         else:
 *             raise BoxConstructError
 */
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_BezierCurve); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2362, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2362, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_curve, __pyx_t_3) < 0) __PYX_ERR(0, 2362, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "mathics/builtin/graphics.py":2358
 *             curve_points = curve.leaves[0]
 *             self.curve = _Line()
 *         elif curve_head_name == "System`BezierCurve":             # <<<<<<<<<<<<<<
 *             if len(curve.leaves) != 1:
 *                 raise BoxConstructError
 */
    goto __pyx_L5;
  }

  /* "mathics/builtin/graphics.py":2364
 *             self.curve = _BezierCurve()
 *         else:
 *             raise BoxConstructError             # <<<<<<<<<<<<<<
 * 
 *         self.setback = setback
 */
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_BoxConstructError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2364, __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(0, 2364, __pyx_L1_error)
  }
  __pyx_L5:;

  /* "mathics/builtin/graphics.py":2366
 *             raise BoxConstructError
 * 
 *         self.setback = setback             # <<<<<<<<<<<<<<
 *         self.do_init(graphics, curve_points)
 *         self.graphics = graphics
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_setback, __pyx_v_setback) < 0) __PYX_ERR(0, 2366, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2367
 * 
 *         self.setback = setback
 *         self.do_init(graphics, curve_points)             # <<<<<<<<<<<<<<
 *         self.graphics = graphics
 *         self.edge_color, _ = style.get_style(_Color, face_element=False)
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_do_init); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2367, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
      __pyx_t_6 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_5)) {
    PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_graphics, __pyx_v_curve_points};
    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2367, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_GOTREF(__pyx_t_3);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
    PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_graphics, __pyx_v_curve_points};
    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2367, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_GOTREF(__pyx_t_3);
  } else
  #endif
  {
    __pyx_t_4 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2367, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (__pyx_t_7) {
      __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7); __pyx_t_7 = NULL;
    }
    __Pyx_INCREF(__pyx_v_graphics);
    __Pyx_GIVEREF(__pyx_v_graphics);
    PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_6, __pyx_v_graphics);
    __Pyx_INCREF(__pyx_v_curve_points);
    __Pyx_GIVEREF(__pyx_v_curve_points);
    PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_6, __pyx_v_curve_points);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2367, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":2368
 *         self.setback = setback
 *         self.do_init(graphics, curve_points)
 *         self.graphics = graphics             # <<<<<<<<<<<<<<
 *         self.edge_color, _ = style.get_style(_Color, face_element=False)
 *         self.heads, _ = style.get_style(Arrowheads, face_element=False)
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_graphics, __pyx_v_graphics) < 0) __PYX_ERR(0, 2368, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2369
 *         self.do_init(graphics, curve_points)
 *         self.graphics = graphics
 *         self.edge_color, _ = style.get_style(_Color, face_element=False)             # <<<<<<<<<<<<<<
 *         self.heads, _ = style.get_style(Arrowheads, face_element=False)
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_style, __pyx_n_s_get_style); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2369, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Color); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2369, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2369, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
  __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2369, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_face_element, Py_False) < 0) __PYX_ERR(0, 2369, __pyx_L1_error)
  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2369, __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_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  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(0, 2369, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_4 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_4);
    #else
    __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2369, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2369, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    #endif
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_3 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2369, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_9 = Py_TYPE(__pyx_t_3)->tp_iternext;
    index = 0; __pyx_t_5 = __pyx_t_9(__pyx_t_3); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_5);
    index = 1; __pyx_t_4 = __pyx_t_9(__pyx_t_3); if (unlikely(!__pyx_t_4)) goto __pyx_L8_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_3), 2) < 0) __PYX_ERR(0, 2369, __pyx_L1_error)
    __pyx_t_9 = NULL;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L9_unpacking_done;
    __pyx_L8_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_9 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 2369, __pyx_L1_error)
    __pyx_L9_unpacking_done:;
  }
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_edge_color, __pyx_t_5) < 0) __PYX_ERR(0, 2369, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v__ = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":2370
 *         self.graphics = graphics
 *         self.edge_color, _ = style.get_style(_Color, face_element=False)
 *         self.heads, _ = style.get_style(Arrowheads, face_element=False)             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_style, __pyx_n_s_get_style); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Arrowheads); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_face_element, Py_False) < 0) __PYX_ERR(0, 2370, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
    PyObject* sequence = __pyx_t_3;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 2370, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_4 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_5);
    #else
    __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2370, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2370, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    #endif
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2370, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_9 = Py_TYPE(__pyx_t_7)->tp_iternext;
    index = 0; __pyx_t_4 = __pyx_t_9(__pyx_t_7); if (unlikely(!__pyx_t_4)) goto __pyx_L10_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_4);
    index = 1; __pyx_t_5 = __pyx_t_9(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L10_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_7), 2) < 0) __PYX_ERR(0, 2370, __pyx_L1_error)
    __pyx_t_9 = NULL;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    goto __pyx_L11_unpacking_done;
    __pyx_L10_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_9 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 2370, __pyx_L1_error)
    __pyx_L11_unpacking_done:;
  }
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_heads, __pyx_t_4) < 0) __PYX_ERR(0, 2370, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF_SET(__pyx_v__, __pyx_t_5);
  __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":2333
 * 
 * class ArrowBox(_Polyline):
 *     def init(self, graphics, style, item=None):             # <<<<<<<<<<<<<<
 *         if not item:
 *             raise BoxConstructError
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("mathics.builtin.graphics.ArrowBox.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_leaves);
  __Pyx_XDECREF(__pyx_v_setback);
  __Pyx_XDECREF(__pyx_v_curve);
  __Pyx_XDECREF(__pyx_v_curve_head_name);
  __Pyx_XDECREF(__pyx_v_curve_points);
  __Pyx_XDECREF(__pyx_v__);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":2373
 * 
 *     @staticmethod
 *     def _setback_spec(expr):             # <<<<<<<<<<<<<<
 *         if expr.get_head_name() == "System`List":
 *             leaves = expr.leaves
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_8ArrowBox_3_setback_spec(PyObject *__pyx_self, PyObject *__pyx_v_expr); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_8ArrowBox_3_setback_spec = {"_setback_spec", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_8ArrowBox_3_setback_spec, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_8ArrowBox_3_setback_spec(PyObject *__pyx_self, PyObject *__pyx_v_expr) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_setback_spec (wrapper)", 0);
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_8ArrowBox_2_setback_spec(__pyx_self, ((PyObject *)__pyx_v_expr));

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

/* "mathics/builtin/graphics.py":2378
 *             if len(leaves) != 2:
 *                 raise BoxConstructError
 *             return tuple(max(_to_float(l), 0.0) for l in leaves)             # <<<<<<<<<<<<<<
 *         else:
 *             s = max(_to_float(expr), 0.0)
 */

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_8ArrowBox_13_setback_spec_genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_54_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_7mathics_7builtin_8graphics___pyx_scope_struct_54_genexpr *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_54_genexpr(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_54_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_54_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 2378, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_53__setback_spec *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7mathics_7builtin_8graphics_8ArrowBox_13_setback_spec_2generator36, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_ArrowBox__setback_spec_locals_ge, __pyx_n_s_mathics_builtin_graphics); if (unlikely(!gen)) __PYX_ERR(0, 2378, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.ArrowBox._setback_spec.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_7mathics_7builtin_8graphics_8ArrowBox_13_setback_spec_2generator36(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_54_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_54_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;
  double __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2378, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_leaves)) { __Pyx_RaiseClosureNameError("leaves"); __PYX_ERR(0, 2378, __pyx_L1_error) }
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_leaves)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_leaves)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_leaves; __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_outer_scope->__pyx_v_leaves); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2378, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2378, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 2378, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2378, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 2378, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2378, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 2378, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_l);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_l, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_5 = 0.0;
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_to_float); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2378, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_cur_scope->__pyx_v_l) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_cur_scope->__pyx_v_l);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2378, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_7 = PyFloat_FromDouble(__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2378, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = PyObject_RichCompare(__pyx_t_7, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2378, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 2378, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (__pyx_t_9) {
      __pyx_t_8 = PyFloat_FromDouble(__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2378, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_6 = __pyx_t_8;
      __pyx_t_8 = 0;
    } else {
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_6 = __pyx_t_4;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_INCREF(__pyx_t_6);
    __pyx_r = __pyx_t_6;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XGIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2378, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

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

/* "mathics/builtin/graphics.py":2373
 * 
 *     @staticmethod
 *     def _setback_spec(expr):             # <<<<<<<<<<<<<<
 *         if expr.get_head_name() == "System`List":
 *             leaves = expr.leaves
 */

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_8ArrowBox_2_setback_spec(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_expr) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_53__setback_spec *__pyx_cur_scope;
  PyObject *__pyx_v_s = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  double __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_setback_spec", 0);
  __pyx_cur_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_53__setback_spec *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_53__setback_spec(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_53__setback_spec, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_53__setback_spec *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 2373, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }

  /* "mathics/builtin/graphics.py":2374
 *     @staticmethod
 *     def _setback_spec(expr):
 *         if expr.get_head_name() == "System`List":             # <<<<<<<<<<<<<<
 *             leaves = expr.leaves
 *             if len(leaves) != 2:
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_expr, __pyx_n_s_get_head_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2374, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2374, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_System_List, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 2374, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

    /* "mathics/builtin/graphics.py":2375
 *     def _setback_spec(expr):
 *         if expr.get_head_name() == "System`List":
 *             leaves = expr.leaves             # <<<<<<<<<<<<<<
 *             if len(leaves) != 2:
 *                 raise BoxConstructError
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_expr, __pyx_n_s_leaves); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2375, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_v_leaves = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "mathics/builtin/graphics.py":2376
 *         if expr.get_head_name() == "System`List":
 *             leaves = expr.leaves
 *             if len(leaves) != 2:             # <<<<<<<<<<<<<<
 *                 raise BoxConstructError
 *             return tuple(max(_to_float(l), 0.0) for l in leaves)
 */
    __pyx_t_1 = __pyx_cur_scope->__pyx_v_leaves;
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_5 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2376, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = ((__pyx_t_5 != 2) != 0);
    if (unlikely(__pyx_t_4)) {

      /* "mathics/builtin/graphics.py":2377
 *             leaves = expr.leaves
 *             if len(leaves) != 2:
 *                 raise BoxConstructError             # <<<<<<<<<<<<<<
 *             return tuple(max(_to_float(l), 0.0) for l in leaves)
 *         else:
 */
      __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_BoxConstructError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2377, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_ERR(0, 2377, __pyx_L1_error)

      /* "mathics/builtin/graphics.py":2376
 *         if expr.get_head_name() == "System`List":
 *             leaves = expr.leaves
 *             if len(leaves) != 2:             # <<<<<<<<<<<<<<
 *                 raise BoxConstructError
 *             return tuple(max(_to_float(l), 0.0) for l in leaves)
 */
    }

    /* "mathics/builtin/graphics.py":2378
 *             if len(leaves) != 2:
 *                 raise BoxConstructError
 *             return tuple(max(_to_float(l), 0.0) for l in leaves)             # <<<<<<<<<<<<<<
 *         else:
 *             s = max(_to_float(expr), 0.0)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __pyx_pf_7mathics_7builtin_8graphics_8ArrowBox_13_setback_spec_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2378, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2378, __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;

    /* "mathics/builtin/graphics.py":2374
 *     @staticmethod
 *     def _setback_spec(expr):
 *         if expr.get_head_name() == "System`List":             # <<<<<<<<<<<<<<
 *             leaves = expr.leaves
 *             if len(leaves) != 2:
 */
  }

  /* "mathics/builtin/graphics.py":2380
 *             return tuple(max(_to_float(l), 0.0) for l in leaves)
 *         else:
 *             s = max(_to_float(expr), 0.0)             # <<<<<<<<<<<<<<
 *             return s, s
 * 
 */
  /*else*/ {
    __pyx_t_6 = 0.0;
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_to_float); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2380, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_v_expr) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_expr);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2380, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_3 = PyFloat_FromDouble(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2380, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2380, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 2380, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (__pyx_t_4) {
      __pyx_t_7 = PyFloat_FromDouble(__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2380, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_1 = __pyx_t_7;
      __pyx_t_7 = 0;
    } else {
      __Pyx_INCREF(__pyx_t_2);
      __pyx_t_1 = __pyx_t_2;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __pyx_t_1;
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_s = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "mathics/builtin/graphics.py":2381
 *         else:
 *             s = max(_to_float(expr), 0.0)
 *             return s, s             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2381, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_s);
    __Pyx_GIVEREF(__pyx_v_s);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_s);
    __Pyx_INCREF(__pyx_v_s);
    __Pyx_GIVEREF(__pyx_v_s);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_s);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }

  /* "mathics/builtin/graphics.py":2373
 * 
 *     @staticmethod
 *     def _setback_spec(expr):             # <<<<<<<<<<<<<<
 *         if expr.get_head_name() == "System`List":
 *             leaves = expr.leaves
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("mathics.builtin.graphics.ArrowBox._setback_spec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_s);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":2384
 * 
 *     @staticmethod
 *     def _default_arrow(polygon):             # <<<<<<<<<<<<<<
 *         # the default arrow drawn by draw() below looks looks like this:
 *         #
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_8ArrowBox_5_default_arrow(PyObject *__pyx_self, PyObject *__pyx_v_polygon); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_8ArrowBox_5_default_arrow = {"_default_arrow", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_8ArrowBox_5_default_arrow, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_8ArrowBox_5_default_arrow(PyObject *__pyx_self, PyObject *__pyx_v_polygon) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_default_arrow (wrapper)", 0);
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_8ArrowBox_4_default_arrow(__pyx_self, ((PyObject *)__pyx_v_polygon));

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

/* "mathics/builtin/graphics.py":2407
 *         arrow_edge = 1.1
 * 
 *         def draw(px, py, vx, vy, t1, s):             # <<<<<<<<<<<<<<
 *             hx = px + t1 * vx  # compute H
 *             hy = py + t1 * vy
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_8ArrowBox_14_default_arrow_1draw(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_8ArrowBox_14_default_arrow_1draw = {"draw", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_8ArrowBox_14_default_arrow_1draw, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_8ArrowBox_14_default_arrow_1draw(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_px = 0;
  PyObject *__pyx_v_py = 0;
  PyObject *__pyx_v_vx = 0;
  PyObject *__pyx_v_vy = 0;
  PyObject *__pyx_v_t1 = 0;
  PyObject *__pyx_v_s = 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);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_px,&__pyx_n_s_py,&__pyx_n_s_vx,&__pyx_n_s_vy,&__pyx_n_s_t1,&__pyx_n_s_s,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_px)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_py)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("draw", 1, 6, 6, 1); __PYX_ERR(0, 2407, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vx)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("draw", 1, 6, 6, 2); __PYX_ERR(0, 2407, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vy)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("draw", 1, 6, 6, 3); __PYX_ERR(0, 2407, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t1)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("draw", 1, 6, 6, 4); __PYX_ERR(0, 2407, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_s)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("draw", 1, 6, 6, 5); __PYX_ERR(0, 2407, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "draw") < 0)) __PYX_ERR(0, 2407, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
    }
    __pyx_v_px = values[0];
    __pyx_v_py = values[1];
    __pyx_v_vx = values[2];
    __pyx_v_vy = values[3];
    __pyx_v_t1 = values[4];
    __pyx_v_s = values[5];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("draw", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2407, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.ArrowBox._default_arrow.draw", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_8ArrowBox_14_default_arrow_draw(__pyx_self, __pyx_v_px, __pyx_v_py, __pyx_v_vx, __pyx_v_vy, __pyx_v_t1, __pyx_v_s);

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_8ArrowBox_14_default_arrow_draw(PyObject *__pyx_self, PyObject *__pyx_v_px, PyObject *__pyx_v_py, PyObject *__pyx_v_vx, PyObject *__pyx_v_vy, PyObject *__pyx_v_t1, PyObject *__pyx_v_s) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_56_draw *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("draw", 0);
  __pyx_cur_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_56_draw *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_56_draw(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_56_draw, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_56_draw *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 2407, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_55__default_arrow *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  __pyx_cur_scope->__pyx_v_px = __pyx_v_px;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_px);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_px);
  __pyx_cur_scope->__pyx_v_py = __pyx_v_py;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_py);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_py);
  __pyx_cur_scope->__pyx_v_vx = __pyx_v_vx;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_vx);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_vx);
  __pyx_cur_scope->__pyx_v_vy = __pyx_v_vy;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_vy);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_vy);
  __pyx_cur_scope->__pyx_v_t1 = __pyx_v_t1;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_t1);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_t1);
  __pyx_cur_scope->__pyx_v_s = __pyx_v_s;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_s);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_s);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7mathics_7builtin_8graphics_8ArrowBox_14_default_arrow_2generator37, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_draw, __pyx_n_s_ArrowBox__default_arrow_locals_d, __pyx_n_s_mathics_builtin_graphics); if (unlikely(!gen)) __PYX_ERR(0, 2407, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.ArrowBox._default_arrow.draw", __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_7mathics_7builtin_8graphics_8ArrowBox_14_default_arrow_2generator37(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_56_draw *__pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_56_draw *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("draw", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2407, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2408
 * 
 *         def draw(px, py, vx, vy, t1, s):
 *             hx = px + t1 * vx  # compute H             # <<<<<<<<<<<<<<
 *             hy = py + t1 * vy
 * 
 */
  __pyx_t_1 = PyNumber_Multiply(__pyx_cur_scope->__pyx_v_t1, __pyx_cur_scope->__pyx_v_vx); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2408, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Add(__pyx_cur_scope->__pyx_v_px, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2408, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_cur_scope->__pyx_v_hx = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":2409
 *         def draw(px, py, vx, vy, t1, s):
 *             hx = px + t1 * vx  # compute H
 *             hy = py + t1 * vy             # <<<<<<<<<<<<<<
 * 
 *             t0 = t1 - s
 */
  __pyx_t_2 = PyNumber_Multiply(__pyx_cur_scope->__pyx_v_t1, __pyx_cur_scope->__pyx_v_vy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2409, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyNumber_Add(__pyx_cur_scope->__pyx_v_py, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2409, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_hy = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":2411
 *             hy = py + t1 * vy
 * 
 *             t0 = t1 - s             # <<<<<<<<<<<<<<
 *             bx = px + t0 * vx  # compute B
 *             by = py + t0 * vy
 */
  __pyx_t_1 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_t1, __pyx_cur_scope->__pyx_v_s); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2411, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_t0 = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":2412
 * 
 *             t0 = t1 - s
 *             bx = px + t0 * vx  # compute B             # <<<<<<<<<<<<<<
 *             by = py + t0 * vy
 * 
 */
  __pyx_t_1 = PyNumber_Multiply(__pyx_cur_scope->__pyx_v_t0, __pyx_cur_scope->__pyx_v_vx); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2412, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Add(__pyx_cur_scope->__pyx_v_px, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2412, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_cur_scope->__pyx_v_bx = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":2413
 *             t0 = t1 - s
 *             bx = px + t0 * vx  # compute B
 *             by = py + t0 * vy             # <<<<<<<<<<<<<<
 * 
 *             te = t1 - arrow_edge * s
 */
  __pyx_t_2 = PyNumber_Multiply(__pyx_cur_scope->__pyx_v_t0, __pyx_cur_scope->__pyx_v_vy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2413, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyNumber_Add(__pyx_cur_scope->__pyx_v_py, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2413, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_by = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":2415
 *             by = py + t0 * vy
 * 
 *             te = t1 - arrow_edge * s             # <<<<<<<<<<<<<<
 *             ex = px + te * vx  # compute E
 *             ey = py + te * vy
 */
  __pyx_t_1 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_arrow_edge); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2415, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Multiply(__pyx_t_1, __pyx_cur_scope->__pyx_v_s); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2415, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_t1, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2415, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_te = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":2416
 * 
 *             te = t1 - arrow_edge * s
 *             ex = px + te * vx  # compute E             # <<<<<<<<<<<<<<
 *             ey = py + te * vy
 * 
 */
  __pyx_t_1 = PyNumber_Multiply(__pyx_cur_scope->__pyx_v_te, __pyx_cur_scope->__pyx_v_vx); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2416, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Add(__pyx_cur_scope->__pyx_v_px, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2416, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_cur_scope->__pyx_v_ex = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":2417
 *             te = t1 - arrow_edge * s
 *             ex = px + te * vx  # compute E
 *             ey = py + te * vy             # <<<<<<<<<<<<<<
 * 
 *             ts = arrow_spread * s
 */
  __pyx_t_2 = PyNumber_Multiply(__pyx_cur_scope->__pyx_v_te, __pyx_cur_scope->__pyx_v_vy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2417, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyNumber_Add(__pyx_cur_scope->__pyx_v_py, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2417, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_ey = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":2419
 *             ey = py + te * vy
 * 
 *             ts = arrow_spread * s             # <<<<<<<<<<<<<<
 *             sx = -vy * ts
 *             sy = vx * ts
 */
  __pyx_t_1 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_arrow_spread); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2419, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Multiply(__pyx_t_1, __pyx_cur_scope->__pyx_v_s); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2419, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_cur_scope->__pyx_v_ts = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":2420
 * 
 *             ts = arrow_spread * s
 *             sx = -vy * ts             # <<<<<<<<<<<<<<
 *             sy = vx * ts
 * 
 */
  __pyx_t_2 = PyNumber_Negative(__pyx_cur_scope->__pyx_v_vy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyNumber_Multiply(__pyx_t_2, __pyx_cur_scope->__pyx_v_ts); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_sx = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":2421
 *             ts = arrow_spread * s
 *             sx = -vy * ts
 *             sy = vx * ts             # <<<<<<<<<<<<<<
 * 
 *             head_points = ((hx, hy), (ex + sx, ey + sy), (bx, by), (ex - sx, ey - sy))
 */
  __pyx_t_1 = PyNumber_Multiply(__pyx_cur_scope->__pyx_v_vx, __pyx_cur_scope->__pyx_v_ts); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2421, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_sy = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":2423
 *             sy = vx * ts
 * 
 *             head_points = ((hx, hy), (ex + sx, ey + sy), (bx, by), (ex - sx, ey - sy))             # <<<<<<<<<<<<<<
 * 
 *             for shape in polygon(head_points):
 */
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2423, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_hx);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_hx);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_cur_scope->__pyx_v_hx);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_hy);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_hy);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_cur_scope->__pyx_v_hy);
  __pyx_t_2 = PyNumber_Add(__pyx_cur_scope->__pyx_v_ex, __pyx_cur_scope->__pyx_v_sx); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2423, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyNumber_Add(__pyx_cur_scope->__pyx_v_ey, __pyx_cur_scope->__pyx_v_sy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2423, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2423, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2423, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_bx);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_bx);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_cur_scope->__pyx_v_bx);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_by);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_by);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_cur_scope->__pyx_v_by);
  __pyx_t_2 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_ex, __pyx_cur_scope->__pyx_v_sx); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2423, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_ey, __pyx_cur_scope->__pyx_v_sy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2423, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2423, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5);
  __pyx_t_2 = 0;
  __pyx_t_5 = 0;
  __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2423, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_6);
  __pyx_t_1 = 0;
  __pyx_t_4 = 0;
  __pyx_t_3 = 0;
  __pyx_t_6 = 0;
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_cur_scope->__pyx_v_head_points = ((PyObject*)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":2425
 *             head_points = ((hx, hy), (ex + sx, ey + sy), (bx, by), (ex - sx, ey - sy))
 * 
 *             for shape in polygon(head_points):             # <<<<<<<<<<<<<<
 *                 yield shape
 * 
 */
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_polygon)) { __Pyx_RaiseClosureNameError("polygon"); __PYX_ERR(0, 2425, __pyx_L1_error) }
  __Pyx_INCREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_polygon);
  __pyx_t_6 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_polygon; __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  __pyx_t_5 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_3, __pyx_cur_scope->__pyx_v_head_points) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_cur_scope->__pyx_v_head_points);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2425, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
    __pyx_t_6 = __pyx_t_5; __Pyx_INCREF(__pyx_t_6); __pyx_t_7 = 0;
    __pyx_t_8 = NULL;
  } else {
    __pyx_t_7 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2425, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2425, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  for (;;) {
    if (likely(!__pyx_t_8)) {
      if (likely(PyList_CheckExact(__pyx_t_6))) {
        if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_6)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 2425, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2425, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      } else {
        if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 2425, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2425, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      }
    } else {
      __pyx_t_5 = __pyx_t_8(__pyx_t_6);
      if (unlikely(!__pyx_t_5)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 2425, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_shape);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_shape, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_5 = 0;

    /* "mathics/builtin/graphics.py":2426
 * 
 *             for shape in polygon(head_points):
 *                 yield shape             # <<<<<<<<<<<<<<
 * 
 *         return draw
 */
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_shape);
    __pyx_r = __pyx_cur_scope->__pyx_v_shape;
    __Pyx_XGIVEREF(__pyx_t_6);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_6;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_7;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_8;
    __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_6 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_6);
    __pyx_t_7 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_8 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2426, __pyx_L1_error)

    /* "mathics/builtin/graphics.py":2425
 *             head_points = ((hx, hy), (ex + sx, ey + sy), (bx, by), (ex - sx, ey - sy))
 * 
 *             for shape in polygon(head_points):             # <<<<<<<<<<<<<<
 *                 yield shape
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "mathics/builtin/graphics.py":2407
 *         arrow_edge = 1.1
 * 
 *         def draw(px, py, vx, vy, t1, s):             # <<<<<<<<<<<<<<
 *             hx = px + t1 * vx  # compute H
 *             hy = py + t1 * vy
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  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("draw", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":2384
 * 
 *     @staticmethod
 *     def _default_arrow(polygon):             # <<<<<<<<<<<<<<
 *         # the default arrow drawn by draw() below looks looks like this:
 *         #
 */

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_8ArrowBox_4_default_arrow(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_polygon) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_55__default_arrow *__pyx_cur_scope;
  PyObject *__pyx_v_draw = 0;
  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("_default_arrow", 0);
  __pyx_cur_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_55__default_arrow *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_55__default_arrow(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_55__default_arrow, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_55__default_arrow *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 2384, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_polygon = __pyx_v_polygon;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_polygon);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_polygon);

  /* "mathics/builtin/graphics.py":2404
 *         # H-B to H-E) and arrow_spread (which defines the factor to get from H-B to E-S).
 * 
 *         arrow_spread = 0.3             # <<<<<<<<<<<<<<
 *         arrow_edge = 1.1
 * 
 */
  __pyx_cur_scope->__pyx_v_arrow_spread = 0.3;

  /* "mathics/builtin/graphics.py":2405
 * 
 *         arrow_spread = 0.3
 *         arrow_edge = 1.1             # <<<<<<<<<<<<<<
 * 
 *         def draw(px, py, vx, vy, t1, s):
 */
  __pyx_cur_scope->__pyx_v_arrow_edge = 1.1;

  /* "mathics/builtin/graphics.py":2407
 *         arrow_edge = 1.1
 * 
 *         def draw(px, py, vx, vy, t1, s):             # <<<<<<<<<<<<<<
 *             hx = px + t1 * vx  # compute H
 *             hy = py + t1 * vy
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_8ArrowBox_14_default_arrow_1draw, 0, __pyx_n_s_ArrowBox__default_arrow_locals_d, ((PyObject*)__pyx_cur_scope), __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__85)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2407, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_draw = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":2428
 *                 yield shape
 * 
 *         return draw             # <<<<<<<<<<<<<<
 * 
 *     def _draw(self, polyline, default_arrow, custom_arrow, extent):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_draw);
  __pyx_r = __pyx_v_draw;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":2384
 * 
 *     @staticmethod
 *     def _default_arrow(polygon):             # <<<<<<<<<<<<<<
 *         # the default arrow drawn by draw() below looks looks like this:
 *         #
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("mathics.builtin.graphics.ArrowBox._default_arrow", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_draw);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7mathics_7builtin_8graphics_8ArrowBox_8generator5(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "mathics/builtin/graphics.py":2430
 *         return draw
 * 
 *     def _draw(self, polyline, default_arrow, custom_arrow, extent):             # <<<<<<<<<<<<<<
 *         if self.heads:
 *             heads = list(self.heads.heads(extent, default_arrow, custom_arrow))
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_8ArrowBox_7_draw(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_8ArrowBox_7_draw = {"_draw", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_8ArrowBox_7_draw, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_8ArrowBox_7_draw(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_polyline = 0;
  PyObject *__pyx_v_default_arrow = 0;
  PyObject *__pyx_v_custom_arrow = 0;
  PyObject *__pyx_v_extent = 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);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_polyline,&__pyx_n_s_default_arrow,&__pyx_n_s_custom_arrow,&__pyx_n_s_extent,0};
    PyObject* values[5] = {0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_polyline)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_draw", 1, 5, 5, 1); __PYX_ERR(0, 2430, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_default_arrow)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_draw", 1, 5, 5, 2); __PYX_ERR(0, 2430, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_custom_arrow)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_draw", 1, 5, 5, 3); __PYX_ERR(0, 2430, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_extent)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_draw", 1, 5, 5, 4); __PYX_ERR(0, 2430, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_draw") < 0)) __PYX_ERR(0, 2430, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
    }
    __pyx_v_self = values[0];
    __pyx_v_polyline = values[1];
    __pyx_v_default_arrow = values[2];
    __pyx_v_custom_arrow = values[3];
    __pyx_v_extent = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_draw", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2430, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.ArrowBox._draw", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_8ArrowBox_6_draw(__pyx_self, __pyx_v_self, __pyx_v_polyline, __pyx_v_default_arrow, __pyx_v_custom_arrow, __pyx_v_extent);

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

/* "mathics/builtin/graphics.py":2433
 *         if self.heads:
 *             heads = list(self.heads.heads(extent, default_arrow, custom_arrow))
 *             heads = sorted(heads, key=lambda spec: spec[1])  # sort by pos             # <<<<<<<<<<<<<<
 *         else:
 *             heads = ((extent * Arrowheads.default_size, 1, default_arrow),)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_8ArrowBox_5_draw_6lambda27(PyObject *__pyx_self, PyObject *__pyx_v_spec); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_8ArrowBox_5_draw_6lambda27 = {"lambda27", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_8ArrowBox_5_draw_6lambda27, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_8ArrowBox_5_draw_6lambda27(PyObject *__pyx_self, PyObject *__pyx_v_spec) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda27 (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_lambda27(__pyx_self, ((PyObject *)__pyx_v_spec));

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

static PyObject *__pyx_lambda_funcdef_lambda27(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_spec) {
  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("lambda27", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_spec, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2433, __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("mathics.builtin.graphics.ArrowBox._draw.lambda27", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":2430
 *         return draw
 * 
 *     def _draw(self, polyline, default_arrow, custom_arrow, extent):             # <<<<<<<<<<<<<<
 *         if self.heads:
 *             heads = list(self.heads.heads(extent, default_arrow, custom_arrow))
 */

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_8ArrowBox_6_draw(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_polyline, PyObject *__pyx_v_default_arrow, PyObject *__pyx_v_custom_arrow, PyObject *__pyx_v_extent) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_57__draw *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_draw", 0);
  __pyx_cur_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_57__draw *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_57__draw(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_57__draw, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_57__draw *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 2430, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self);
  __pyx_cur_scope->__pyx_v_polyline = __pyx_v_polyline;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_polyline);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_polyline);
  __pyx_cur_scope->__pyx_v_default_arrow = __pyx_v_default_arrow;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_default_arrow);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_default_arrow);
  __pyx_cur_scope->__pyx_v_custom_arrow = __pyx_v_custom_arrow;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_custom_arrow);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_custom_arrow);
  __pyx_cur_scope->__pyx_v_extent = __pyx_v_extent;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_extent);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_extent);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7mathics_7builtin_8graphics_8ArrowBox_8generator5, __pyx_codeobj__86, (PyObject *) __pyx_cur_scope, __pyx_n_s_draw_3, __pyx_n_s_ArrowBox__draw, __pyx_n_s_mathics_builtin_graphics); if (unlikely(!gen)) __PYX_ERR(0, 2430, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.ArrowBox._draw", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":2437
 *             heads = ((extent * Arrowheads.default_size, 1, default_arrow),)
 * 
 *         def setback(p, q, d):             # <<<<<<<<<<<<<<
 *             dx, dy, length = _norm(p, q)
 *             if d >= length:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_8ArrowBox_5_draw_1setback(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_8ArrowBox_5_draw_1setback = {"setback", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_8ArrowBox_5_draw_1setback, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_8ArrowBox_5_draw_1setback(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_p = 0;
  PyObject *__pyx_v_q = 0;
  PyObject *__pyx_v_d = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("setback (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_p,&__pyx_n_s_q,&__pyx_n_s_d,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_p)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("setback", 1, 3, 3, 1); __PYX_ERR(0, 2437, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_d)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("setback", 1, 3, 3, 2); __PYX_ERR(0, 2437, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setback") < 0)) __PYX_ERR(0, 2437, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_p = values[0];
    __pyx_v_q = values[1];
    __pyx_v_d = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setback", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2437, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.ArrowBox._draw.setback", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_8ArrowBox_5_draw_setback(__pyx_self, __pyx_v_p, __pyx_v_q, __pyx_v_d);

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_8ArrowBox_5_draw_setback(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_p, PyObject *__pyx_v_q, PyObject *__pyx_v_d) {
  PyObject *__pyx_v_dx = NULL;
  PyObject *__pyx_v_dy = NULL;
  PyObject *__pyx_v_length = NULL;
  PyObject *__pyx_v_s = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *(*__pyx_t_7)(PyObject *);
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("setback", 0);

  /* "mathics/builtin/graphics.py":2438
 * 
 *         def setback(p, q, d):
 *             dx, dy, length = _norm(p, q)             # <<<<<<<<<<<<<<
 *             if d >= length:
 *                 return None, length
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_norm); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2438, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_p, __pyx_v_q};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2438, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_p, __pyx_v_q};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2438, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2438, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(__pyx_v_p);
    __Pyx_GIVEREF(__pyx_v_p);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_p);
    __Pyx_INCREF(__pyx_v_q);
    __Pyx_GIVEREF(__pyx_v_q);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_q);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2438, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  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(0, 2438, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2); 
    } else {
      __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
      __pyx_t_3 = PyList_GET_ITEM(sequence, 2); 
    }
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_3);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2438, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2438, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2438, __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_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2438, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext;
    index = 0; __pyx_t_2 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 1; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_5);
    index = 2; __pyx_t_3 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) __PYX_ERR(0, 2438, __pyx_L1_error)
    __pyx_t_7 = NULL;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_7 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 2438, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  __pyx_v_dx = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_v_dy = __pyx_t_5;
  __pyx_t_5 = 0;
  __pyx_v_length = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":2439
 *         def setback(p, q, d):
 *             dx, dy, length = _norm(p, q)
 *             if d >= length:             # <<<<<<<<<<<<<<
 *                 return None, length
 *             else:
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_d, __pyx_v_length, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2439, __pyx_L1_error)
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 2439, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_8) {

    /* "mathics/builtin/graphics.py":2440
 *             dx, dy, length = _norm(p, q)
 *             if d >= length:
 *                 return None, length             # <<<<<<<<<<<<<<
 *             else:
 *                 s = d / length
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2440, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    PyTuple_SET_ITEM(__pyx_t_1, 0, Py_None);
    __Pyx_INCREF(__pyx_v_length);
    __Pyx_GIVEREF(__pyx_v_length);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_length);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "mathics/builtin/graphics.py":2439
 *         def setback(p, q, d):
 *             dx, dy, length = _norm(p, q)
 *             if d >= length:             # <<<<<<<<<<<<<<
 *                 return None, length
 *             else:
 */
  }

  /* "mathics/builtin/graphics.py":2442
 *                 return None, length
 *             else:
 *                 s = d / length             # <<<<<<<<<<<<<<
 *                 return (s * dx, s * dy), d
 * 
 */
  /*else*/ {
    __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_v_d, __pyx_v_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2442, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_s = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "mathics/builtin/graphics.py":2443
 *             else:
 *                 s = d / length
 *                 return (s * dx, s * dy), d             # <<<<<<<<<<<<<<
 * 
 *         def shrink_one_end(line, s):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = PyNumber_Multiply(__pyx_v_s, __pyx_v_dx); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2443, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyNumber_Multiply(__pyx_v_s, __pyx_v_dy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2443, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2443, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
    __pyx_t_1 = 0;
    __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2443, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5);
    __Pyx_INCREF(__pyx_v_d);
    __Pyx_GIVEREF(__pyx_v_d);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_d);
    __pyx_t_5 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }

  /* "mathics/builtin/graphics.py":2437
 *             heads = ((extent * Arrowheads.default_size, 1, default_arrow),)
 * 
 *         def setback(p, q, d):             # <<<<<<<<<<<<<<
 *             dx, dy, length = _norm(p, q)
 *             if d >= length:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("mathics.builtin.graphics.ArrowBox._draw.setback", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dx);
  __Pyx_XDECREF(__pyx_v_dy);
  __Pyx_XDECREF(__pyx_v_length);
  __Pyx_XDECREF(__pyx_v_s);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":2445
 *                 return (s * dx, s * dy), d
 * 
 *         def shrink_one_end(line, s):             # <<<<<<<<<<<<<<
 *             while s > 0.0:
 *                 if len(line) < 2:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_8ArrowBox_5_draw_3shrink_one_end(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_8ArrowBox_5_draw_3shrink_one_end = {"shrink_one_end", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_8ArrowBox_5_draw_3shrink_one_end, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_8ArrowBox_5_draw_3shrink_one_end(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_line = 0;
  PyObject *__pyx_v_s = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("shrink_one_end (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_line,&__pyx_n_s_s,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_line)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_s)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("shrink_one_end", 1, 2, 2, 1); __PYX_ERR(0, 2445, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "shrink_one_end") < 0)) __PYX_ERR(0, 2445, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_line = values[0];
    __pyx_v_s = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("shrink_one_end", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2445, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.ArrowBox._draw.shrink_one_end", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_8ArrowBox_5_draw_2shrink_one_end(__pyx_self, __pyx_v_line, __pyx_v_s);

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_8ArrowBox_5_draw_2shrink_one_end(PyObject *__pyx_self, PyObject *__pyx_v_line, PyObject *__pyx_v_s) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_57__draw *__pyx_cur_scope;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_57__draw *__pyx_outer_scope;
  PyObject *__pyx_v_xy = NULL;
  PyObject *__pyx_v_length = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *(*__pyx_t_7)(PyObject *);
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("shrink_one_end", 0);
  __pyx_outer_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_57__draw *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;
  __Pyx_INCREF(__pyx_v_line);
  __Pyx_INCREF(__pyx_v_s);

  /* "mathics/builtin/graphics.py":2446
 * 
 *         def shrink_one_end(line, s):
 *             while s > 0.0:             # <<<<<<<<<<<<<<
 *                 if len(line) < 2:
 *                     return []
 */
  while (1) {
    __pyx_t_1 = PyObject_RichCompare(__pyx_v_s, __pyx_float_0_0, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2446, __pyx_L1_error)
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 2446, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (!__pyx_t_2) break;

    /* "mathics/builtin/graphics.py":2447
 *         def shrink_one_end(line, s):
 *             while s > 0.0:
 *                 if len(line) < 2:             # <<<<<<<<<<<<<<
 *                     return []
 *                 xy, length = setback(line[0].p, line[1].p, s)
 */
    __pyx_t_3 = PyObject_Length(__pyx_v_line); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2447, __pyx_L1_error)
    __pyx_t_2 = ((__pyx_t_3 < 2) != 0);
    if (__pyx_t_2) {

      /* "mathics/builtin/graphics.py":2448
 *             while s > 0.0:
 *                 if len(line) < 2:
 *                     return []             # <<<<<<<<<<<<<<
 *                 xy, length = setback(line[0].p, line[1].p, s)
 *                 if xy is not None:
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2448, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

      /* "mathics/builtin/graphics.py":2447
 *         def shrink_one_end(line, s):
 *             while s > 0.0:
 *                 if len(line) < 2:             # <<<<<<<<<<<<<<
 *                     return []
 *                 xy, length = setback(line[0].p, line[1].p, s)
 */
    }

    /* "mathics/builtin/graphics.py":2449
 *                 if len(line) < 2:
 *                     return []
 *                 xy, length = setback(line[0].p, line[1].p, s)             # <<<<<<<<<<<<<<
 *                 if xy is not None:
 *                     line[0] = line[0].add(*xy)
 */
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_line, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2449, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_p); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2449, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_line, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2449, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_p); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2449, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_cur_scope->__pyx_v_setback)) { __Pyx_RaiseClosureNameError("setback"); __PYX_ERR(0, 2449, __pyx_L1_error) }
    __pyx_t_1 = __pyx_pf_7mathics_7builtin_8graphics_8ArrowBox_5_draw_setback(__pyx_cur_scope->__pyx_v_setback, __pyx_t_4, __pyx_t_5, __pyx_v_s); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2449, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
      PyObject* sequence = __pyx_t_1;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 2449, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_4 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      #else
      __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2449, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2449, __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_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2449, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext;
      index = 0; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L6_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_5);
      index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L6_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_4);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(0, 2449, __pyx_L1_error)
      __pyx_t_7 = NULL;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L7_unpacking_done;
      __pyx_L6_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 2449, __pyx_L1_error)
      __pyx_L7_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_xy, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "mathics/builtin/graphics.py":2450
 *                     return []
 *                 xy, length = setback(line[0].p, line[1].p, s)
 *                 if xy is not None:             # <<<<<<<<<<<<<<
 *                     line[0] = line[0].add(*xy)
 *                 else:
 */
    __pyx_t_2 = (__pyx_v_xy != Py_None);
    __pyx_t_8 = (__pyx_t_2 != 0);
    if (__pyx_t_8) {

      /* "mathics/builtin/graphics.py":2451
 *                 xy, length = setback(line[0].p, line[1].p, s)
 *                 if xy is not None:
 *                     line[0] = line[0].add(*xy)             # <<<<<<<<<<<<<<
 *                 else:
 *                     line = line[1:]
 */
      __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_line, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2451, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_add); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2451, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_xy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2451, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2451, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(__Pyx_SetItemInt(__pyx_v_line, 0, __pyx_t_5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) __PYX_ERR(0, 2451, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "mathics/builtin/graphics.py":2450
 *                     return []
 *                 xy, length = setback(line[0].p, line[1].p, s)
 *                 if xy is not None:             # <<<<<<<<<<<<<<
 *                     line[0] = line[0].add(*xy)
 *                 else:
 */
      goto __pyx_L8;
    }

    /* "mathics/builtin/graphics.py":2453
 *                     line[0] = line[0].add(*xy)
 *                 else:
 *                     line = line[1:]             # <<<<<<<<<<<<<<
 *                 s -= length
 *             return line
 */
    /*else*/ {
      __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_v_line, 1, 0, NULL, NULL, &__pyx_slice__13, 1, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2453, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF_SET(__pyx_v_line, __pyx_t_5);
      __pyx_t_5 = 0;
    }
    __pyx_L8:;

    /* "mathics/builtin/graphics.py":2454
 *                 else:
 *                     line = line[1:]
 *                 s -= length             # <<<<<<<<<<<<<<
 *             return line
 * 
 */
    __pyx_t_5 = PyNumber_InPlaceSubtract(__pyx_v_s, __pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2454, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF_SET(__pyx_v_s, __pyx_t_5);
    __pyx_t_5 = 0;
  }

  /* "mathics/builtin/graphics.py":2455
 *                     line = line[1:]
 *                 s -= length
 *             return line             # <<<<<<<<<<<<<<
 * 
 *         def shrink(line, s1, s2):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_line);
  __pyx_r = __pyx_v_line;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":2445
 *                 return (s * dx, s * dy), d
 * 
 *         def shrink_one_end(line, s):             # <<<<<<<<<<<<<<
 *             while s > 0.0:
 *                 if len(line) < 2:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("mathics.builtin.graphics.ArrowBox._draw.shrink_one_end", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_xy);
  __Pyx_XDECREF(__pyx_v_length);
  __Pyx_XDECREF(__pyx_v_line);
  __Pyx_XDECREF(__pyx_v_s);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":2457
 *             return line
 * 
 *         def shrink(line, s1, s2):             # <<<<<<<<<<<<<<
 *             return list(
 *                 reversed(
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_8ArrowBox_5_draw_5shrink(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_8ArrowBox_5_draw_5shrink = {"shrink", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_8ArrowBox_5_draw_5shrink, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_8ArrowBox_5_draw_5shrink(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_line = 0;
  PyObject *__pyx_v_s1 = 0;
  PyObject *__pyx_v_s2 = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("shrink (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_line,&__pyx_n_s_s1,&__pyx_n_s_s2,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_line)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_s1)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("shrink", 1, 3, 3, 1); __PYX_ERR(0, 2457, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_s2)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("shrink", 1, 3, 3, 2); __PYX_ERR(0, 2457, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "shrink") < 0)) __PYX_ERR(0, 2457, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_line = values[0];
    __pyx_v_s1 = values[1];
    __pyx_v_s2 = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("shrink", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2457, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.ArrowBox._draw.shrink", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_8ArrowBox_5_draw_4shrink(__pyx_self, __pyx_v_line, __pyx_v_s1, __pyx_v_s2);

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_8ArrowBox_5_draw_4shrink(PyObject *__pyx_self, PyObject *__pyx_v_line, PyObject *__pyx_v_s1, PyObject *__pyx_v_s2) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_57__draw *__pyx_cur_scope;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_57__draw *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("shrink", 0);
  __pyx_outer_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_57__draw *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "mathics/builtin/graphics.py":2458
 * 
 *         def shrink(line, s1, s2):
 *             return list(             # <<<<<<<<<<<<<<
 *                 reversed(
 *                     shrink_one_end(list(reversed(shrink_one_end(line[:], s1))), s2)
 */
  __Pyx_XDECREF(__pyx_r);

  /* "mathics/builtin/graphics.py":2460
 *             return list(
 *                 reversed(
 *                     shrink_one_end(list(reversed(shrink_one_end(line[:], s1))), s2)             # <<<<<<<<<<<<<<
 *                 )
 *             )
 */
  __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_line, 0, 0, NULL, NULL, &__pyx_slice__87, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2460, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(!__pyx_cur_scope->__pyx_v_shrink_one_end)) { __Pyx_RaiseClosureNameError("shrink_one_end"); __PYX_ERR(0, 2460, __pyx_L1_error) }
  __pyx_t_2 = __pyx_pf_7mathics_7builtin_8graphics_8ArrowBox_5_draw_2shrink_one_end(__pyx_cur_scope->__pyx_v_shrink_one_end, __pyx_t_1, __pyx_v_s1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2460, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_reversed, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2460, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PySequence_List(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2460, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_cur_scope->__pyx_v_shrink_one_end)) { __Pyx_RaiseClosureNameError("shrink_one_end"); __PYX_ERR(0, 2460, __pyx_L1_error) }
  __pyx_t_1 = __pyx_pf_7mathics_7builtin_8graphics_8ArrowBox_5_draw_2shrink_one_end(__pyx_cur_scope->__pyx_v_shrink_one_end, __pyx_t_2, __pyx_v_s2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2460, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":2459
 *         def shrink(line, s1, s2):
 *             return list(
 *                 reversed(             # <<<<<<<<<<<<<<
 *                     shrink_one_end(list(reversed(shrink_one_end(line[:], s1))), s2)
 *                 )
 */
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_reversed, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2459, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":2458
 * 
 *         def shrink(line, s1, s2):
 *             return list(             # <<<<<<<<<<<<<<
 *                 reversed(
 *                     shrink_one_end(list(reversed(shrink_one_end(line[:], s1))), s2)
 */
  __pyx_t_1 = PySequence_List(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2458, __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;

  /* "mathics/builtin/graphics.py":2457
 *             return line
 * 
 *         def shrink(line, s1, s2):             # <<<<<<<<<<<<<<
 *             return list(
 *                 reversed(
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("mathics.builtin.graphics.ArrowBox._draw.shrink", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":2430
 *         return draw
 * 
 *     def _draw(self, polyline, default_arrow, custom_arrow, extent):             # <<<<<<<<<<<<<<
 *         if self.heads:
 *             heads = list(self.heads.heads(extent, default_arrow, custom_arrow))
 */

static PyObject *__pyx_gb_7mathics_7builtin_8graphics_8ArrowBox_8generator5(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_57__draw *__pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_57__draw *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __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 = NULL;
  PyObject *(*__pyx_t_11)(PyObject *);
  PyObject *__pyx_t_12 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_draw", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L12_resume_from_yield;
    case 2: goto __pyx_L15_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2430, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2431
 * 
 *     def _draw(self, polyline, default_arrow, custom_arrow, extent):
 *         if self.heads:             # <<<<<<<<<<<<<<
 *             heads = list(self.heads.heads(extent, default_arrow, custom_arrow))
 *             heads = sorted(heads, key=lambda spec: spec[1])  # sort by pos
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_heads); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2431, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 2431, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "mathics/builtin/graphics.py":2432
 *     def _draw(self, polyline, default_arrow, custom_arrow, extent):
 *         if self.heads:
 *             heads = list(self.heads.heads(extent, default_arrow, custom_arrow))             # <<<<<<<<<<<<<<
 *             heads = sorted(heads, key=lambda spec: spec[1])  # sort by pos
 *         else:
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_heads); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2432, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_heads); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2432, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    __pyx_t_5 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_5 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_cur_scope->__pyx_v_extent, __pyx_cur_scope->__pyx_v_default_arrow, __pyx_cur_scope->__pyx_v_custom_arrow};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2432, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_cur_scope->__pyx_v_extent, __pyx_cur_scope->__pyx_v_default_arrow, __pyx_cur_scope->__pyx_v_custom_arrow};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2432, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    {
      __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2432, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (__pyx_t_3) {
        __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
      }
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_extent);
      __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_extent);
      PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_cur_scope->__pyx_v_extent);
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_default_arrow);
      __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_default_arrow);
      PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_cur_scope->__pyx_v_default_arrow);
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_custom_arrow);
      __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_custom_arrow);
      PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_cur_scope->__pyx_v_custom_arrow);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2432, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PySequence_List(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2432, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_cur_scope->__pyx_v_heads = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "mathics/builtin/graphics.py":2433
 *         if self.heads:
 *             heads = list(self.heads.heads(extent, default_arrow, custom_arrow))
 *             heads = sorted(heads, key=lambda spec: spec[1])  # sort by pos             # <<<<<<<<<<<<<<
 *         else:
 *             heads = ((extent * Arrowheads.default_size, 1, default_arrow),)
 */
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2433, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_heads);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_heads);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_cur_scope->__pyx_v_heads);
    __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2433, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_8ArrowBox_5_draw_6lambda27, 0, __pyx_n_s_ArrowBox__draw_locals_lambda, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2433, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_key, __pyx_t_6) < 0) __PYX_ERR(0, 2433, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_sorted, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2433, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_heads);
    __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_heads, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    __pyx_t_6 = 0;

    /* "mathics/builtin/graphics.py":2431
 * 
 *     def _draw(self, polyline, default_arrow, custom_arrow, extent):
 *         if self.heads:             # <<<<<<<<<<<<<<
 *             heads = list(self.heads.heads(extent, default_arrow, custom_arrow))
 *             heads = sorted(heads, key=lambda spec: spec[1])  # sort by pos
 */
    goto __pyx_L4;
  }

  /* "mathics/builtin/graphics.py":2435
 *             heads = sorted(heads, key=lambda spec: spec[1])  # sort by pos
 *         else:
 *             heads = ((extent * Arrowheads.default_size, 1, default_arrow),)             # <<<<<<<<<<<<<<
 * 
 *         def setback(p, q, d):
 */
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_Arrowheads); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2435, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_default_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2435, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyNumber_Multiply(__pyx_cur_scope->__pyx_v_extent, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2435, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2435, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6);
    __Pyx_INCREF(__pyx_int_1);
    __Pyx_GIVEREF(__pyx_int_1);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_1);
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_default_arrow);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_default_arrow);
    PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_cur_scope->__pyx_v_default_arrow);
    __pyx_t_6 = 0;
    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2435, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
    __pyx_t_1 = 0;
    __Pyx_GIVEREF(__pyx_t_6);
    __pyx_cur_scope->__pyx_v_heads = __pyx_t_6;
    __pyx_t_6 = 0;
  }
  __pyx_L4:;

  /* "mathics/builtin/graphics.py":2437
 *             heads = ((extent * Arrowheads.default_size, 1, default_arrow),)
 * 
 *         def setback(p, q, d):             # <<<<<<<<<<<<<<
 *             dx, dy, length = _norm(p, q)
 *             if d >= length:
 */
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_8ArrowBox_5_draw_1setback, 0, __pyx_n_s_ArrowBox__draw_locals_setback, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__89)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2437, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_cur_scope->__pyx_v_setback = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "mathics/builtin/graphics.py":2445
 *                 return (s * dx, s * dy), d
 * 
 *         def shrink_one_end(line, s):             # <<<<<<<<<<<<<<
 *             while s > 0.0:
 *                 if len(line) < 2:
 */
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_8ArrowBox_5_draw_3shrink_one_end, 0, __pyx_n_s_ArrowBox__draw_locals_shrink_one, ((PyObject*)__pyx_cur_scope), __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__91)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2445, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_cur_scope->__pyx_v_shrink_one_end = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "mathics/builtin/graphics.py":2457
 *             return line
 * 
 *         def shrink(line, s1, s2):             # <<<<<<<<<<<<<<
 *             return list(
 *                 reversed(
 */
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_8ArrowBox_5_draw_5shrink, 0, __pyx_n_s_ArrowBox__draw_locals_shrink, ((PyObject*)__pyx_cur_scope), __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__93)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2457, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_cur_scope->__pyx_v_shrink = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "mathics/builtin/graphics.py":2464
 *             )
 * 
 *         for line in self.lines:             # <<<<<<<<<<<<<<
 *             if len(line) < 2:
 *                 continue
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_lines); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2464, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) {
    __pyx_t_1 = __pyx_t_6; __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_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2464, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2464, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  for (;;) {
    if (likely(!__pyx_t_8)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_6); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 2464, __pyx_L1_error)
        #else
        __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2464, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        #endif
      } else {
        if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_6); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 2464, __pyx_L1_error)
        #else
        __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2464, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        #endif
      }
    } else {
      __pyx_t_6 = __pyx_t_8(__pyx_t_1);
      if (unlikely(!__pyx_t_6)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 2464, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_6);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_line);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_line, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    __pyx_t_6 = 0;

    /* "mathics/builtin/graphics.py":2465
 * 
 *         for line in self.lines:
 *             if len(line) < 2:             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
    __pyx_t_9 = PyObject_Length(__pyx_cur_scope->__pyx_v_line); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2465, __pyx_L1_error)
    __pyx_t_2 = ((__pyx_t_9 < 2) != 0);
    if (__pyx_t_2) {

      /* "mathics/builtin/graphics.py":2466
 *         for line in self.lines:
 *             if len(line) < 2:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             # note that shrinking needs to happen in the Graphics[] coordinate space, whereas the
 */
      goto __pyx_L5_continue;

      /* "mathics/builtin/graphics.py":2465
 * 
 *         for line in self.lines:
 *             if len(line) < 2:             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
    }

    /* "mathics/builtin/graphics.py":2471
 *             # subsequent position calculation needs to happen in pixel space.
 * 
 *             transformed_points = [xy.pos() for xy in shrink(line, *self.setback)]             # <<<<<<<<<<<<<<
 * 
 *             for s in polyline(transformed_points):
 */
    { /* enter inner scope */
      __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2471, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2471, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_line);
      __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_line);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_cur_scope->__pyx_v_line);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_setback); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2471, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_10 = __Pyx_PySequence_Tuple(__pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2471, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyNumber_Add(__pyx_t_4, __pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2471, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_shrink, __pyx_t_3, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2471, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (likely(PyList_CheckExact(__pyx_t_10)) || PyTuple_CheckExact(__pyx_t_10)) {
        __pyx_t_3 = __pyx_t_10; __Pyx_INCREF(__pyx_t_3); __pyx_t_9 = 0;
        __pyx_t_11 = NULL;
      } else {
        __pyx_t_9 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2471, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_11 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2471, __pyx_L1_error)
      }
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      for (;;) {
        if (likely(!__pyx_t_11)) {
          if (likely(PyList_CheckExact(__pyx_t_3))) {
            if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_3)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_10 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_9); __Pyx_INCREF(__pyx_t_10); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 2471, __pyx_L1_error)
            #else
            __pyx_t_10 = PySequence_ITEM(__pyx_t_3, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2471, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_10);
            #endif
          } else {
            if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_9); __Pyx_INCREF(__pyx_t_10); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 2471, __pyx_L1_error)
            #else
            __pyx_t_10 = PySequence_ITEM(__pyx_t_3, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2471, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_10);
            #endif
          }
        } else {
          __pyx_t_10 = __pyx_t_11(__pyx_t_3);
          if (unlikely(!__pyx_t_10)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 2471, __pyx_L1_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_10);
        }
        __Pyx_XGOTREF(__pyx_cur_scope->__pyx_9genexpr50__pyx_v_xy);
        __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_9genexpr50__pyx_v_xy, __pyx_t_10);
        __Pyx_GIVEREF(__pyx_t_10);
        __pyx_t_10 = 0;
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_9genexpr50__pyx_v_xy, __pyx_n_s_pos); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2471, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_12 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_12)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_12);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
          }
        }
        __pyx_t_10 = (__pyx_t_12) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_12) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2471, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_6, (PyObject*)__pyx_t_10))) __PYX_ERR(0, 2471, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } /* exit inner scope */
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_transformed_points);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_transformed_points, ((PyObject*)__pyx_t_6));
    __Pyx_GIVEREF(__pyx_t_6);
    __pyx_t_6 = 0;

    /* "mathics/builtin/graphics.py":2473
 *             transformed_points = [xy.pos() for xy in shrink(line, *self.setback)]
 * 
 *             for s in polyline(transformed_points):             # <<<<<<<<<<<<<<
 *                 yield s
 * 
 */
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_polyline);
    __pyx_t_3 = __pyx_cur_scope->__pyx_v_polyline; __pyx_t_10 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_10)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_6 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_10, __pyx_cur_scope->__pyx_v_transformed_points) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_cur_scope->__pyx_v_transformed_points);
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2473, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) {
      __pyx_t_3 = __pyx_t_6; __Pyx_INCREF(__pyx_t_3); __pyx_t_9 = 0;
      __pyx_t_11 = NULL;
    } else {
      __pyx_t_9 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2473, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_11 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2473, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    for (;;) {
      if (likely(!__pyx_t_11)) {
        if (likely(PyList_CheckExact(__pyx_t_3))) {
          if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_9); __Pyx_INCREF(__pyx_t_6); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 2473, __pyx_L1_error)
          #else
          __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2473, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          #endif
        } else {
          if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_9); __Pyx_INCREF(__pyx_t_6); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 2473, __pyx_L1_error)
          #else
          __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2473, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          #endif
        }
      } else {
        __pyx_t_6 = __pyx_t_11(__pyx_t_3);
        if (unlikely(!__pyx_t_6)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 2473, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_6);
      }
      __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_s);
      __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_s, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_6);
      __pyx_t_6 = 0;

      /* "mathics/builtin/graphics.py":2474
 * 
 *             for s in polyline(transformed_points):
 *                 yield s             # <<<<<<<<<<<<<<
 * 
 *             for s in self.curve.arrows(transformed_points, heads):
 */
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_s);
      __pyx_r = __pyx_cur_scope->__pyx_v_s;
      __Pyx_XGIVEREF(__pyx_t_1);
      __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
      __Pyx_XGIVEREF(__pyx_t_3);
      __pyx_cur_scope->__pyx_t_1 = __pyx_t_3;
      __pyx_cur_scope->__pyx_t_2 = __pyx_t_7;
      __pyx_cur_scope->__pyx_t_3 = __pyx_t_8;
      __pyx_cur_scope->__pyx_t_4 = __pyx_t_9;
      __pyx_cur_scope->__pyx_t_5 = __pyx_t_11;
      __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_L12_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_3 = __pyx_cur_scope->__pyx_t_1;
      __pyx_cur_scope->__pyx_t_1 = 0;
      __Pyx_XGOTREF(__pyx_t_3);
      __pyx_t_7 = __pyx_cur_scope->__pyx_t_2;
      __pyx_t_8 = __pyx_cur_scope->__pyx_t_3;
      __pyx_t_9 = __pyx_cur_scope->__pyx_t_4;
      __pyx_t_11 = __pyx_cur_scope->__pyx_t_5;
      if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2474, __pyx_L1_error)

      /* "mathics/builtin/graphics.py":2473
 *             transformed_points = [xy.pos() for xy in shrink(line, *self.setback)]
 * 
 *             for s in polyline(transformed_points):             # <<<<<<<<<<<<<<
 *                 yield s
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "mathics/builtin/graphics.py":2476
 *                 yield s
 * 
 *             for s in self.curve.arrows(transformed_points, heads):             # <<<<<<<<<<<<<<
 *                 yield s
 * 
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_curve); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2476, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_arrows); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2476, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    __pyx_t_5 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_10);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_10, function);
        __pyx_t_5 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_10)) {
      PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_cur_scope->__pyx_v_transformed_points, __pyx_cur_scope->__pyx_v_heads};
      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2476, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) {
      PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_cur_scope->__pyx_v_transformed_points, __pyx_cur_scope->__pyx_v_heads};
      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2476, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else
    #endif
    {
      __pyx_t_4 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2476, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (__pyx_t_6) {
        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = NULL;
      }
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_transformed_points);
      __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_transformed_points);
      PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_5, __pyx_cur_scope->__pyx_v_transformed_points);
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_heads);
      __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_heads);
      PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_5, __pyx_cur_scope->__pyx_v_heads);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2476, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
      __pyx_t_10 = __pyx_t_3; __Pyx_INCREF(__pyx_t_10); __pyx_t_9 = 0;
      __pyx_t_11 = NULL;
    } else {
      __pyx_t_9 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2476, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_11 = Py_TYPE(__pyx_t_10)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2476, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    for (;;) {
      if (likely(!__pyx_t_11)) {
        if (likely(PyList_CheckExact(__pyx_t_10))) {
          if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_10)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 2476, __pyx_L1_error)
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_10, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2476, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        } else {
          if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_10)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 2476, __pyx_L1_error)
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_10, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2476, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        }
      } else {
        __pyx_t_3 = __pyx_t_11(__pyx_t_10);
        if (unlikely(!__pyx_t_3)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 2476, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_s);
      __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_s, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_3 = 0;

      /* "mathics/builtin/graphics.py":2477
 * 
 *             for s in self.curve.arrows(transformed_points, heads):
 *                 yield s             # <<<<<<<<<<<<<<
 * 
 *     def _custom_arrow(self, format, format_transform):
 */
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_s);
      __pyx_r = __pyx_cur_scope->__pyx_v_s;
      __Pyx_XGIVEREF(__pyx_t_1);
      __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
      __pyx_cur_scope->__pyx_t_2 = __pyx_t_7;
      __pyx_cur_scope->__pyx_t_3 = __pyx_t_8;
      __pyx_cur_scope->__pyx_t_4 = __pyx_t_9;
      __Pyx_XGIVEREF(__pyx_t_10);
      __pyx_cur_scope->__pyx_t_1 = __pyx_t_10;
      __pyx_cur_scope->__pyx_t_5 = __pyx_t_11;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
      /* return from generator, yielding value */
      __pyx_generator->resume_label = 2;
      return __pyx_r;
      __pyx_L15_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_7 = __pyx_cur_scope->__pyx_t_2;
      __pyx_t_8 = __pyx_cur_scope->__pyx_t_3;
      __pyx_t_9 = __pyx_cur_scope->__pyx_t_4;
      __pyx_t_10 = __pyx_cur_scope->__pyx_t_1;
      __pyx_cur_scope->__pyx_t_1 = 0;
      __Pyx_XGOTREF(__pyx_t_10);
      __pyx_t_11 = __pyx_cur_scope->__pyx_t_5;
      if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2477, __pyx_L1_error)

      /* "mathics/builtin/graphics.py":2476
 *                 yield s
 * 
 *             for s in self.curve.arrows(transformed_points, heads):             # <<<<<<<<<<<<<<
 *                 yield s
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

    /* "mathics/builtin/graphics.py":2464
 *             )
 * 
 *         for line in self.lines:             # <<<<<<<<<<<<<<
 *             if len(line) < 2:
 *                 continue
 */
    __pyx_L5_continue:;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "mathics/builtin/graphics.py":2430
 *         return draw
 * 
 *     def _draw(self, polyline, default_arrow, custom_arrow, extent):             # <<<<<<<<<<<<<<
 *         if self.heads:
 *             heads = list(self.heads.heads(extent, default_arrow, custom_arrow))
 */

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

/* "mathics/builtin/graphics.py":2479
 *                 yield s
 * 
 *     def _custom_arrow(self, format, format_transform):             # <<<<<<<<<<<<<<
 *         def make(graphics):
 *             xmin, xmax, ymin, ymax, ox, oy, ex, ey, code = _extract_graphics(
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_8ArrowBox_10_custom_arrow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_8ArrowBox_10_custom_arrow = {"_custom_arrow", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_8ArrowBox_10_custom_arrow, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_8ArrowBox_10_custom_arrow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_format = 0;
  PyObject *__pyx_v_format_transform = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_custom_arrow (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_format,&__pyx_n_s_format_transform,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_custom_arrow", 1, 3, 3, 1); __PYX_ERR(0, 2479, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format_transform)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_custom_arrow", 1, 3, 3, 2); __PYX_ERR(0, 2479, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_custom_arrow") < 0)) __PYX_ERR(0, 2479, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_self = values[0];
    __pyx_v_format = values[1];
    __pyx_v_format_transform = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_custom_arrow", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2479, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.ArrowBox._custom_arrow", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_8ArrowBox_9_custom_arrow(__pyx_self, __pyx_v_self, __pyx_v_format, __pyx_v_format_transform);

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

/* "mathics/builtin/graphics.py":2480
 * 
 *     def _custom_arrow(self, format, format_transform):
 *         def make(graphics):             # <<<<<<<<<<<<<<
 *             xmin, xmax, ymin, ymax, ox, oy, ex, ey, code = _extract_graphics(
 *                 graphics, format, self.graphics.evaluation
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_8ArrowBox_13_custom_arrow_1make(PyObject *__pyx_self, PyObject *__pyx_v_graphics); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_8ArrowBox_13_custom_arrow_1make = {"make", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_8ArrowBox_13_custom_arrow_1make, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_8ArrowBox_13_custom_arrow_1make(PyObject *__pyx_self, PyObject *__pyx_v_graphics) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make (wrapper)", 0);
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_8ArrowBox_13_custom_arrow_make(__pyx_self, ((PyObject *)__pyx_v_graphics));

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

/* "mathics/builtin/graphics.py":2487
 *             boxh = ymax - ymin
 * 
 *             def draw(px, py, vx, vy, t1, s):             # <<<<<<<<<<<<<<
 *                 t0 = t1
 *                 cx = px + t0 * vx
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_8ArrowBox_13_custom_arrow_4make_1draw(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_8ArrowBox_13_custom_arrow_4make_1draw = {"draw", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_8ArrowBox_13_custom_arrow_4make_1draw, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_8ArrowBox_13_custom_arrow_4make_1draw(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_px = 0;
  PyObject *__pyx_v_py = 0;
  PyObject *__pyx_v_vx = 0;
  PyObject *__pyx_v_vy = 0;
  PyObject *__pyx_v_t1 = 0;
  PyObject *__pyx_v_s = 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);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_px,&__pyx_n_s_py,&__pyx_n_s_vx,&__pyx_n_s_vy,&__pyx_n_s_t1,&__pyx_n_s_s,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_px)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_py)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("draw", 1, 6, 6, 1); __PYX_ERR(0, 2487, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vx)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("draw", 1, 6, 6, 2); __PYX_ERR(0, 2487, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vy)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("draw", 1, 6, 6, 3); __PYX_ERR(0, 2487, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t1)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("draw", 1, 6, 6, 4); __PYX_ERR(0, 2487, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_s)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("draw", 1, 6, 6, 5); __PYX_ERR(0, 2487, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "draw") < 0)) __PYX_ERR(0, 2487, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
    }
    __pyx_v_px = values[0];
    __pyx_v_py = values[1];
    __pyx_v_vx = values[2];
    __pyx_v_vy = values[3];
    __pyx_v_t1 = values[4];
    __pyx_v_s = values[5];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("draw", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2487, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.ArrowBox._custom_arrow.make.draw", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_8ArrowBox_13_custom_arrow_4make_draw(__pyx_self, __pyx_v_px, __pyx_v_py, __pyx_v_vx, __pyx_v_vy, __pyx_v_t1, __pyx_v_s);

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_8ArrowBox_13_custom_arrow_4make_draw(PyObject *__pyx_self, PyObject *__pyx_v_px, PyObject *__pyx_v_py, PyObject *__pyx_v_vx, PyObject *__pyx_v_vy, PyObject *__pyx_v_t1, PyObject *__pyx_v_s) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_60_draw *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("draw", 0);
  __pyx_cur_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_60_draw *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_60_draw(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_60_draw, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_60_draw *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 2487, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_59_make *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  __pyx_cur_scope->__pyx_v_px = __pyx_v_px;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_px);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_px);
  __pyx_cur_scope->__pyx_v_py = __pyx_v_py;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_py);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_py);
  __pyx_cur_scope->__pyx_v_vx = __pyx_v_vx;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_vx);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_vx);
  __pyx_cur_scope->__pyx_v_vy = __pyx_v_vy;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_vy);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_vy);
  __pyx_cur_scope->__pyx_v_t1 = __pyx_v_t1;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_t1);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_t1);
  __pyx_cur_scope->__pyx_v_s = __pyx_v_s;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_s);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_s);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7mathics_7builtin_8graphics_8ArrowBox_13_custom_arrow_4make_2generator38, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_draw, __pyx_n_s_ArrowBox__custom_arrow_locals_ma, __pyx_n_s_mathics_builtin_graphics); if (unlikely(!gen)) __PYX_ERR(0, 2487, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.ArrowBox._custom_arrow.make.draw", __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_7mathics_7builtin_8graphics_8ArrowBox_13_custom_arrow_4make_2generator38(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_60_draw *__pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_60_draw *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("draw", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L4_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2487, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2488
 * 
 *             def draw(px, py, vx, vy, t1, s):
 *                 t0 = t1             # <<<<<<<<<<<<<<
 *                 cx = px + t0 * vx
 *                 cy = py + t0 * vy
 */
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_t1);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_t1);
  __pyx_cur_scope->__pyx_v_t0 = __pyx_cur_scope->__pyx_v_t1;

  /* "mathics/builtin/graphics.py":2489
 *             def draw(px, py, vx, vy, t1, s):
 *                 t0 = t1
 *                 cx = px + t0 * vx             # <<<<<<<<<<<<<<
 *                 cy = py + t0 * vy
 * 
 */
  __pyx_t_1 = PyNumber_Multiply(__pyx_cur_scope->__pyx_v_t0, __pyx_cur_scope->__pyx_v_vx); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2489, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Add(__pyx_cur_scope->__pyx_v_px, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2489, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_cur_scope->__pyx_v_cx = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":2490
 *                 t0 = t1
 *                 cx = px + t0 * vx
 *                 cy = py + t0 * vy             # <<<<<<<<<<<<<<
 * 
 *                 transform = format_transform()
 */
  __pyx_t_2 = PyNumber_Multiply(__pyx_cur_scope->__pyx_v_t0, __pyx_cur_scope->__pyx_v_vy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2490, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyNumber_Add(__pyx_cur_scope->__pyx_v_py, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2490, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_cy = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":2492
 *                 cy = py + t0 * vy
 * 
 *                 transform = format_transform()             # <<<<<<<<<<<<<<
 *                 transform.translate(cx, cy)
 *                 transform.scale(-s / boxw * ex, -s / boxh * ey)
 */
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_format_transform)) { __Pyx_RaiseClosureNameError("format_transform"); __PYX_ERR(0, 2492, __pyx_L1_error) }
  __Pyx_INCREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_format_transform);
  __pyx_t_2 = __pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_format_transform; __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2492, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_transform = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":2493
 * 
 *                 transform = format_transform()
 *                 transform.translate(cx, cy)             # <<<<<<<<<<<<<<
 *                 transform.scale(-s / boxw * ex, -s / boxh * ey)
 *                 transform.rotate(90 + degrees(atan2(vy, vx)))
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_transform, __pyx_n_s_translate); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2493, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_cur_scope->__pyx_v_cx, __pyx_cur_scope->__pyx_v_cy};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2493, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_cur_scope->__pyx_v_cx, __pyx_cur_scope->__pyx_v_cy};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2493, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2493, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_cx);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_cx);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_cur_scope->__pyx_v_cx);
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_cy);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_cy);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_cur_scope->__pyx_v_cy);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2493, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":2494
 *                 transform = format_transform()
 *                 transform.translate(cx, cy)
 *                 transform.scale(-s / boxw * ex, -s / boxh * ey)             # <<<<<<<<<<<<<<
 *                 transform.rotate(90 + degrees(atan2(vy, vx)))
 *                 transform.translate(-ox, -oy)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_transform, __pyx_n_s_scale_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2494, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = PyNumber_Negative(__pyx_cur_scope->__pyx_v_s); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2494, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_boxw)) { __Pyx_RaiseClosureNameError("boxw"); __PYX_ERR(0, 2494, __pyx_L1_error) }
  __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_5, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_boxw); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2494, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_ex)) { __Pyx_RaiseClosureNameError("ex"); __PYX_ERR(0, 2494, __pyx_L1_error) }
  __pyx_t_5 = PyNumber_Multiply(__pyx_t_3, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_ex); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2494, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Negative(__pyx_cur_scope->__pyx_v_s); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2494, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_boxh)) { __Pyx_RaiseClosureNameError("boxh"); __PYX_ERR(0, 2494, __pyx_L1_error) }
  __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_boxh); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2494, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_ey)) { __Pyx_RaiseClosureNameError("ey"); __PYX_ERR(0, 2494, __pyx_L1_error) }
  __pyx_t_3 = PyNumber_Multiply(__pyx_t_6, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_ey); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2494, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_5, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2494, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_5, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2494, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  {
    __pyx_t_7 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2494, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_6) {
      __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_4, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_4, __pyx_t_3);
    __pyx_t_5 = 0;
    __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2494, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":2495
 *                 transform.translate(cx, cy)
 *                 transform.scale(-s / boxw * ex, -s / boxh * ey)
 *                 transform.rotate(90 + degrees(atan2(vy, vx)))             # <<<<<<<<<<<<<<
 *                 transform.translate(-ox, -oy)
 *                 yield transform.apply(code)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_transform, __pyx_n_s_rotate); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2495, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_degrees); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2495, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_atan2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2495, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_8 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_6)) {
    PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_cur_scope->__pyx_v_vy, __pyx_cur_scope->__pyx_v_vx};
    __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2495, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_GOTREF(__pyx_t_5);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
    PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_cur_scope->__pyx_v_vy, __pyx_cur_scope->__pyx_v_vx};
    __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2495, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_GOTREF(__pyx_t_5);
  } else
  #endif
  {
    __pyx_t_9 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2495, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    if (__pyx_t_8) {
      __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
    }
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_vy);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_vy);
    PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_4, __pyx_cur_scope->__pyx_v_vy);
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_vx);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_vx);
    PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_4, __pyx_cur_scope->__pyx_v_vx);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2495, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_7 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2495, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyInt_AddCObj(__pyx_int_90, __pyx_t_7, 90, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2495, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_7, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2495, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":2496
 *                 transform.scale(-s / boxw * ex, -s / boxh * ey)
 *                 transform.rotate(90 + degrees(atan2(vy, vx)))
 *                 transform.translate(-ox, -oy)             # <<<<<<<<<<<<<<
 *                 yield transform.apply(code)
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_transform, __pyx_n_s_translate); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2496, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_ox)) { __Pyx_RaiseClosureNameError("ox"); __PYX_ERR(0, 2496, __pyx_L1_error) }
  __pyx_t_3 = PyNumber_Negative(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_ox); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2496, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_oy)) { __Pyx_RaiseClosureNameError("oy"); __PYX_ERR(0, 2496, __pyx_L1_error) }
  __pyx_t_7 = PyNumber_Negative(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_oy); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2496, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_5 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_3, __pyx_t_7};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2496, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_3, __pyx_t_7};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2496, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  } else
  #endif
  {
    __pyx_t_6 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2496, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_5) {
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_4, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_4, __pyx_t_7);
    __pyx_t_3 = 0;
    __pyx_t_7 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2496, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":2497
 *                 transform.rotate(90 + degrees(atan2(vy, vx)))
 *                 transform.translate(-ox, -oy)
 *                 yield transform.apply(code)             # <<<<<<<<<<<<<<
 * 
 *             return draw
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_transform, __pyx_n_s_apply); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2497, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_code)) { __Pyx_RaiseClosureNameError("code"); __PYX_ERR(0, 2497, __pyx_L1_error) }
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_6, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_code) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_code);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2497, __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;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  /* return from generator, yielding value */
  __pyx_generator->resume_label = 1;
  return __pyx_r;
  __pyx_L4_resume_from_yield:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2497, __pyx_L1_error)
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "mathics/builtin/graphics.py":2487
 *             boxh = ymax - ymin
 * 
 *             def draw(px, py, vx, vy, t1, s):             # <<<<<<<<<<<<<<
 *                 t0 = t1
 *                 cx = px + t0 * vx
 */

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

/* "mathics/builtin/graphics.py":2480
 * 
 *     def _custom_arrow(self, format, format_transform):
 *         def make(graphics):             # <<<<<<<<<<<<<<
 *             xmin, xmax, ymin, ymax, ox, oy, ex, ey, code = _extract_graphics(
 *                 graphics, format, self.graphics.evaluation
 */

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_8ArrowBox_13_custom_arrow_make(PyObject *__pyx_self, PyObject *__pyx_v_graphics) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_59_make *__pyx_cur_scope;
  PyObject *__pyx_v_xmin = NULL;
  PyObject *__pyx_v_xmax = NULL;
  PyObject *__pyx_v_ymin = NULL;
  PyObject *__pyx_v_ymax = NULL;
  PyObject *__pyx_v_draw = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *(*__pyx_t_13)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("make", 0);
  __pyx_cur_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_59_make *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_59_make(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_59_make, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_59_make *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 2480, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_58__custom_arrow *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);

  /* "mathics/builtin/graphics.py":2481
 *     def _custom_arrow(self, format, format_transform):
 *         def make(graphics):
 *             xmin, xmax, ymin, ymax, ox, oy, ex, ey, code = _extract_graphics(             # <<<<<<<<<<<<<<
 *                 graphics, format, self.graphics.evaluation
 *             )
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_extract_graphics); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2481, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "mathics/builtin/graphics.py":2482
 *         def make(graphics):
 *             xmin, xmax, ymin, ymax, ox, oy, ex, ey, code = _extract_graphics(
 *                 graphics, format, self.graphics.evaluation             # <<<<<<<<<<<<<<
 *             )
 *             boxw = xmax - xmin
 */
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_format)) { __Pyx_RaiseClosureNameError("format"); __PYX_ERR(0, 2482, __pyx_L1_error) }
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 2482, __pyx_L1_error) }
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self, __pyx_n_s_graphics); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2482, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_evaluation); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2482, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_5 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_graphics, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_format, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2481, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_graphics, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_format, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2481, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else
  #endif
  {
    __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2481, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(__pyx_v_graphics);
    __Pyx_GIVEREF(__pyx_v_graphics);
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_graphics);
    __Pyx_INCREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_format);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_format);
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_format);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2481, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if ((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 != 9)) {
      if (size > 9) __Pyx_RaiseTooManyValuesError(9);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 2481, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); 
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 3); 
      __pyx_t_7 = PyTuple_GET_ITEM(sequence, 4); 
      __pyx_t_8 = PyTuple_GET_ITEM(sequence, 5); 
      __pyx_t_9 = PyTuple_GET_ITEM(sequence, 6); 
      __pyx_t_10 = PyTuple_GET_ITEM(sequence, 7); 
      __pyx_t_11 = PyTuple_GET_ITEM(sequence, 8); 
    } else {
      __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_6 = PyList_GET_ITEM(sequence, 1); 
      __pyx_t_4 = PyList_GET_ITEM(sequence, 2); 
      __pyx_t_3 = PyList_GET_ITEM(sequence, 3); 
      __pyx_t_7 = PyList_GET_ITEM(sequence, 4); 
      __pyx_t_8 = PyList_GET_ITEM(sequence, 5); 
      __pyx_t_9 = PyList_GET_ITEM(sequence, 6); 
      __pyx_t_10 = PyList_GET_ITEM(sequence, 7); 
      __pyx_t_11 = PyList_GET_ITEM(sequence, 8); 
    }
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_7);
    __Pyx_INCREF(__pyx_t_8);
    __Pyx_INCREF(__pyx_t_9);
    __Pyx_INCREF(__pyx_t_10);
    __Pyx_INCREF(__pyx_t_11);
    #else
    {
      Py_ssize_t i;
      PyObject** temps[9] = {&__pyx_t_2,&__pyx_t_6,&__pyx_t_4,&__pyx_t_3,&__pyx_t_7,&__pyx_t_8,&__pyx_t_9,&__pyx_t_10,&__pyx_t_11};
      for (i=0; i < 9; i++) {
        PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 2481, __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[9] = {&__pyx_t_2,&__pyx_t_6,&__pyx_t_4,&__pyx_t_3,&__pyx_t_7,&__pyx_t_8,&__pyx_t_9,&__pyx_t_10,&__pyx_t_11};
    __pyx_t_12 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2481, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_13 = Py_TYPE(__pyx_t_12)->tp_iternext;
    for (index=0; index < 9; index++) {
      PyObject* item = __pyx_t_13(__pyx_t_12); if (unlikely(!item)) goto __pyx_L3_unpacking_failed;
      __Pyx_GOTREF(item);
      *(temps[index]) = item;
    }
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 9) < 0) __PYX_ERR(0, 2481, __pyx_L1_error)
    __pyx_t_13 = NULL;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_13 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 2481, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }

  /* "mathics/builtin/graphics.py":2481
 *     def _custom_arrow(self, format, format_transform):
 *         def make(graphics):
 *             xmin, xmax, ymin, ymax, ox, oy, ex, ey, code = _extract_graphics(             # <<<<<<<<<<<<<<
 *                 graphics, format, self.graphics.evaluation
 *             )
 */
  __pyx_v_xmin = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_v_xmax = __pyx_t_6;
  __pyx_t_6 = 0;
  __pyx_v_ymin = __pyx_t_4;
  __pyx_t_4 = 0;
  __pyx_v_ymax = __pyx_t_3;
  __pyx_t_3 = 0;
  __Pyx_GIVEREF(__pyx_t_7);
  __pyx_cur_scope->__pyx_v_ox = __pyx_t_7;
  __pyx_t_7 = 0;
  __Pyx_GIVEREF(__pyx_t_8);
  __pyx_cur_scope->__pyx_v_oy = __pyx_t_8;
  __pyx_t_8 = 0;
  __Pyx_GIVEREF(__pyx_t_9);
  __pyx_cur_scope->__pyx_v_ex = __pyx_t_9;
  __pyx_t_9 = 0;
  __Pyx_GIVEREF(__pyx_t_10);
  __pyx_cur_scope->__pyx_v_ey = __pyx_t_10;
  __pyx_t_10 = 0;
  __Pyx_GIVEREF(__pyx_t_11);
  __pyx_cur_scope->__pyx_v_code = __pyx_t_11;
  __pyx_t_11 = 0;

  /* "mathics/builtin/graphics.py":2484
 *                 graphics, format, self.graphics.evaluation
 *             )
 *             boxw = xmax - xmin             # <<<<<<<<<<<<<<
 *             boxh = ymax - ymin
 * 
 */
  __pyx_t_1 = PyNumber_Subtract(__pyx_v_xmax, __pyx_v_xmin); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2484, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_boxw = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":2485
 *             )
 *             boxw = xmax - xmin
 *             boxh = ymax - ymin             # <<<<<<<<<<<<<<
 * 
 *             def draw(px, py, vx, vy, t1, s):
 */
  __pyx_t_1 = PyNumber_Subtract(__pyx_v_ymax, __pyx_v_ymin); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2485, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_boxh = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":2487
 *             boxh = ymax - ymin
 * 
 *             def draw(px, py, vx, vy, t1, s):             # <<<<<<<<<<<<<<
 *                 t0 = t1
 *                 cx = px + t0 * vx
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_8ArrowBox_13_custom_arrow_4make_1draw, 0, __pyx_n_s_ArrowBox__custom_arrow_locals_ma, ((PyObject*)__pyx_cur_scope), __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__95)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2487, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_draw = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":2499
 *                 yield transform.apply(code)
 * 
 *             return draw             # <<<<<<<<<<<<<<
 * 
 *         return make
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_draw);
  __pyx_r = __pyx_v_draw;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":2480
 * 
 *     def _custom_arrow(self, format, format_transform):
 *         def make(graphics):             # <<<<<<<<<<<<<<
 *             xmin, xmax, ymin, ymax, ox, oy, ex, ey, code = _extract_graphics(
 *                 graphics, format, self.graphics.evaluation
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("mathics.builtin.graphics.ArrowBox._custom_arrow.make", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_xmin);
  __Pyx_XDECREF(__pyx_v_xmax);
  __Pyx_XDECREF(__pyx_v_ymin);
  __Pyx_XDECREF(__pyx_v_ymax);
  __Pyx_XDECREF(__pyx_v_draw);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":2479
 *                 yield s
 * 
 *     def _custom_arrow(self, format, format_transform):             # <<<<<<<<<<<<<<
 *         def make(graphics):
 *             xmin, xmax, ymin, ymax, ox, oy, ex, ey, code = _extract_graphics(
 */

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_8ArrowBox_9_custom_arrow(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_format, PyObject *__pyx_v_format_transform) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_58__custom_arrow *__pyx_cur_scope;
  PyObject *__pyx_v_make = 0;
  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("_custom_arrow", 0);
  __pyx_cur_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_58__custom_arrow *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_58__custom_arrow(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_58__custom_arrow, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_58__custom_arrow *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 2479, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self);
  __pyx_cur_scope->__pyx_v_format = __pyx_v_format;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_format);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_format);
  __pyx_cur_scope->__pyx_v_format_transform = __pyx_v_format_transform;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_format_transform);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_format_transform);

  /* "mathics/builtin/graphics.py":2480
 * 
 *     def _custom_arrow(self, format, format_transform):
 *         def make(graphics):             # <<<<<<<<<<<<<<
 *             xmin, xmax, ymin, ymax, ox, oy, ex, ey, code = _extract_graphics(
 *                 graphics, format, self.graphics.evaluation
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_8ArrowBox_13_custom_arrow_1make, 0, __pyx_n_s_ArrowBox__custom_arrow_locals_ma_2, ((PyObject*)__pyx_cur_scope), __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__97)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2480, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_make = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":2501
 *             return draw
 * 
 *         return make             # <<<<<<<<<<<<<<
 * 
 *     def to_svg(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_make);
  __pyx_r = __pyx_v_make;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":2479
 *                 yield s
 * 
 *     def _custom_arrow(self, format, format_transform):             # <<<<<<<<<<<<<<
 *         def make(graphics):
 *             xmin, xmax, ymin, ymax, ox, oy, ex, ey, code = _extract_graphics(
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("mathics.builtin.graphics.ArrowBox._custom_arrow", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_make);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":2503
 *         return make
 * 
 *     def to_svg(self):             # <<<<<<<<<<<<<<
 *         width = self.style.get_line_width(face_element=False)
 *         style = create_css(edge_color=self.edge_color, stroke_width=width)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_8ArrowBox_12to_svg(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_8ArrowBox_12to_svg = {"to_svg", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_8ArrowBox_12to_svg, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_8ArrowBox_12to_svg(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_svg (wrapper)", 0);
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_8ArrowBox_11to_svg(__pyx_self, ((PyObject *)__pyx_v_self));

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

/* "mathics/builtin/graphics.py":2510
 *         arrow_style = create_css(face_color=self.edge_color, stroke_width=width)
 * 
 *         def polygon(points):             # <<<<<<<<<<<<<<
 *             yield '<polygon points="'
 *             yield " ".join("%f,%f" % xy for xy in points)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_8ArrowBox_6to_svg_1polygon(PyObject *__pyx_self, PyObject *__pyx_v_points); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_8ArrowBox_6to_svg_1polygon = {"polygon", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_8ArrowBox_6to_svg_1polygon, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_8ArrowBox_6to_svg_1polygon(PyObject *__pyx_self, PyObject *__pyx_v_points) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("polygon (wrapper)", 0);
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_8ArrowBox_6to_svg_polygon(__pyx_self, ((PyObject *)__pyx_v_points));

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

/* "mathics/builtin/graphics.py":2512
 *         def polygon(points):
 *             yield '<polygon points="'
 *             yield " ".join("%f,%f" % xy for xy in points)             # <<<<<<<<<<<<<<
 *             yield '" style="%s" />' % arrow_style
 * 
 */

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_8ArrowBox_6to_svg_7polygon_genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_63_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_7mathics_7builtin_8graphics___pyx_scope_struct_63_genexpr *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_63_genexpr(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_63_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_63_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 2512, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_62_polygon *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7mathics_7builtin_8graphics_8ArrowBox_6to_svg_7polygon_2generator40, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_ArrowBox_to_svg_locals_polygon_l, __pyx_n_s_mathics_builtin_graphics); if (unlikely(!gen)) __PYX_ERR(0, 2512, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.ArrowBox.to_svg.polygon.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_7mathics_7builtin_8graphics_8ArrowBox_6to_svg_7polygon_2generator40(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_63_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_63_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2512, __pyx_L1_error)
  __pyx_r = PyList_New(0); if (unlikely(!__pyx_r)) __PYX_ERR(0, 2512, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_points)) { __Pyx_RaiseClosureNameError("points"); __PYX_ERR(0, 2512, __pyx_L1_error) }
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_points)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_points)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_points; __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_outer_scope->__pyx_v_points); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2512, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2512, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 2512, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2512, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 2512, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2512, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 2512, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_xy);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_xy, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_f_f, __pyx_cur_scope->__pyx_v_xy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2512, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (unlikely(__Pyx_ListComp_Append(__pyx_r, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 2512, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

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

/* "mathics/builtin/graphics.py":2510
 *         arrow_style = create_css(face_color=self.edge_color, stroke_width=width)
 * 
 *         def polygon(points):             # <<<<<<<<<<<<<<
 *             yield '<polygon points="'
 *             yield " ".join("%f,%f" % xy for xy in points)
 */

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_8ArrowBox_6to_svg_polygon(PyObject *__pyx_self, PyObject *__pyx_v_points) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_62_polygon *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("polygon", 0);
  __pyx_cur_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_62_polygon *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_62_polygon(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_62_polygon, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_62_polygon *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 2510, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_61_to_svg *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  __pyx_cur_scope->__pyx_v_points = __pyx_v_points;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_points);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_points);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7mathics_7builtin_8graphics_8ArrowBox_6to_svg_2generator39, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_polygon, __pyx_n_s_ArrowBox_to_svg_locals_polygon, __pyx_n_s_mathics_builtin_graphics); if (unlikely(!gen)) __PYX_ERR(0, 2510, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.ArrowBox.to_svg.polygon", __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_7mathics_7builtin_8graphics_8ArrowBox_6to_svg_2generator39(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_62_polygon *__pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_62_polygon *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("polygon", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L4_resume_from_yield;
    case 2: goto __pyx_L5_resume_from_yield;
    case 3: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2510, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2511
 * 
 *         def polygon(points):
 *             yield '<polygon points="'             # <<<<<<<<<<<<<<
 *             yield " ".join("%f,%f" % xy for xy in points)
 *             yield '" style="%s" />' % arrow_style
 */
  __Pyx_INCREF(__pyx_kp_u_polygon_points);
  __pyx_r = __pyx_kp_u_polygon_points;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  /* return from generator, yielding value */
  __pyx_generator->resume_label = 1;
  return __pyx_r;
  __pyx_L4_resume_from_yield:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2511, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2512
 *         def polygon(points):
 *             yield '<polygon points="'
 *             yield " ".join("%f,%f" % xy for xy in points)             # <<<<<<<<<<<<<<
 *             yield '" style="%s" />' % arrow_style
 * 
 */
  __pyx_t_1 = __pyx_pf_7mathics_7builtin_8graphics_8ArrowBox_6to_svg_7polygon_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2512, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_Generator_Next(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2512, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyUnicode_Join(__pyx_kp_u__7, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2512, __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;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  /* return from generator, yielding value */
  __pyx_generator->resume_label = 2;
  return __pyx_r;
  __pyx_L5_resume_from_yield:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2512, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2513
 *             yield '<polygon points="'
 *             yield " ".join("%f,%f" % xy for xy in points)
 *             yield '" style="%s" />' % arrow_style             # <<<<<<<<<<<<<<
 * 
 *         extent = self.graphics.view_width or 0
 */
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_arrow_style)) { __Pyx_RaiseClosureNameError("arrow_style"); __PYX_ERR(0, 2513, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_style_s, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_arrow_style); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2513, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  /* return from generator, yielding value */
  __pyx_generator->resume_label = 3;
  return __pyx_r;
  __pyx_L6_resume_from_yield:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2513, __pyx_L1_error)
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "mathics/builtin/graphics.py":2510
 *         arrow_style = create_css(face_color=self.edge_color, stroke_width=width)
 * 
 *         def polygon(points):             # <<<<<<<<<<<<<<
 *             yield '<polygon points="'
 *             yield " ".join("%f,%f" % xy for xy in points)
 */

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

/* "mathics/builtin/graphics.py":2503
 *         return make
 * 
 *     def to_svg(self):             # <<<<<<<<<<<<<<
 *         width = self.style.get_line_width(face_element=False)
 *         style = create_css(edge_color=self.edge_color, stroke_width=width)
 */

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_8ArrowBox_11to_svg(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_61_to_svg *__pyx_cur_scope;
  PyObject *__pyx_v_width = NULL;
  PyObject *__pyx_v_style = NULL;
  PyObject *__pyx_v_polyline = NULL;
  PyObject *__pyx_v_polygon = 0;
  PyObject *__pyx_v_extent = NULL;
  PyObject *__pyx_v_default_arrow = NULL;
  PyObject *__pyx_v_custom_arrow = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_svg", 0);
  __pyx_cur_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_61_to_svg *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_61_to_svg(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_61_to_svg, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_61_to_svg *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 2503, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }

  /* "mathics/builtin/graphics.py":2504
 * 
 *     def to_svg(self):
 *         width = self.style.get_line_width(face_element=False)             # <<<<<<<<<<<<<<
 *         style = create_css(edge_color=self.edge_color, stroke_width=width)
 *         polyline = self.curve.make_draw_svg(style)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_style); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2504, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_get_line_width); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2504, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2504, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_face_element, Py_False) < 0) __PYX_ERR(0, 2504, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2504, __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_v_width = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":2505
 *     def to_svg(self):
 *         width = self.style.get_line_width(face_element=False)
 *         style = create_css(edge_color=self.edge_color, stroke_width=width)             # <<<<<<<<<<<<<<
 *         polyline = self.curve.make_draw_svg(style)
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_create_css); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2505, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2505, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_edge_color); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2505, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_edge_color, __pyx_t_2) < 0) __PYX_ERR(0, 2505, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_stroke_width, __pyx_v_width) < 0) __PYX_ERR(0, 2505, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2505, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_style = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":2506
 *         width = self.style.get_line_width(face_element=False)
 *         style = create_css(edge_color=self.edge_color, stroke_width=width)
 *         polyline = self.curve.make_draw_svg(style)             # <<<<<<<<<<<<<<
 * 
 *         arrow_style = create_css(face_color=self.edge_color, stroke_width=width)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_curve); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2506, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_make_draw_svg); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2506, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_1, __pyx_v_style) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_style);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2506, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_polyline = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":2508
 *         polyline = self.curve.make_draw_svg(style)
 * 
 *         arrow_style = create_css(face_color=self.edge_color, stroke_width=width)             # <<<<<<<<<<<<<<
 * 
 *         def polygon(points):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_create_css); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2508, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2508, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_edge_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2508, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_face_color, __pyx_t_1) < 0) __PYX_ERR(0, 2508, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_stroke_width, __pyx_v_width) < 0) __PYX_ERR(0, 2508, __pyx_L1_error)
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2508, __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_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_arrow_style = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":2510
 *         arrow_style = create_css(face_color=self.edge_color, stroke_width=width)
 * 
 *         def polygon(points):             # <<<<<<<<<<<<<<
 *             yield '<polygon points="'
 *             yield " ".join("%f,%f" % xy for xy in points)
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_8ArrowBox_6to_svg_1polygon, 0, __pyx_n_s_ArrowBox_to_svg_locals_polygon, ((PyObject*)__pyx_cur_scope), __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__99)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2510, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_polygon = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":2515
 *             yield '" style="%s" />' % arrow_style
 * 
 *         extent = self.graphics.view_width or 0             # <<<<<<<<<<<<<<
 *         default_arrow = self._default_arrow(polygon)
 *         custom_arrow = self._custom_arrow("svg", _SVGTransform)
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_graphics); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2515, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_view_width); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2515, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 2515, __pyx_L1_error)
  if (!__pyx_t_4) {
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_1 = __pyx_t_2;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_t_2 = __Pyx_PyInt_From_long(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2515, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_L3_bool_binop_done:;
  __pyx_v_extent = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":2516
 * 
 *         extent = self.graphics.view_width or 0
 *         default_arrow = self._default_arrow(polygon)             # <<<<<<<<<<<<<<
 *         custom_arrow = self._custom_arrow("svg", _SVGTransform)
 *         return "".join(self._draw(polyline, default_arrow, custom_arrow, extent))
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_default_arrow_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2516, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_polygon) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_polygon);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2516, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_default_arrow = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":2517
 *         extent = self.graphics.view_width or 0
 *         default_arrow = self._default_arrow(polygon)
 *         custom_arrow = self._custom_arrow("svg", _SVGTransform)             # <<<<<<<<<<<<<<
 *         return "".join(self._draw(polyline, default_arrow, custom_arrow, extent))
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_custom_arrow_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2517, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SVGTransform); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2517, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_n_u_svg, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2517, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_n_u_svg, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2517, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  {
    __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2517, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_5) {
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
    }
    __Pyx_INCREF(__pyx_n_u_svg);
    __Pyx_GIVEREF(__pyx_n_u_svg);
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_n_u_svg);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2517, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_custom_arrow = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":2518
 *         default_arrow = self._default_arrow(polygon)
 *         custom_arrow = self._custom_arrow("svg", _SVGTransform)
 *         return "".join(self._draw(polyline, default_arrow, custom_arrow, extent))             # <<<<<<<<<<<<<<
 * 
 *     def to_asy(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_draw_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2518, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_7 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[5] = {__pyx_t_7, __pyx_v_polyline, __pyx_v_default_arrow, __pyx_v_custom_arrow, __pyx_v_extent};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 4+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2518, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[5] = {__pyx_t_7, __pyx_v_polyline, __pyx_v_default_arrow, __pyx_v_custom_arrow, __pyx_v_extent};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 4+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2518, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_3 = PyTuple_New(4+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2518, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (__pyx_t_7) {
      __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_7); __pyx_t_7 = NULL;
    }
    __Pyx_INCREF(__pyx_v_polyline);
    __Pyx_GIVEREF(__pyx_v_polyline);
    PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_6, __pyx_v_polyline);
    __Pyx_INCREF(__pyx_v_default_arrow);
    __Pyx_GIVEREF(__pyx_v_default_arrow);
    PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_6, __pyx_v_default_arrow);
    __Pyx_INCREF(__pyx_v_custom_arrow);
    __Pyx_GIVEREF(__pyx_v_custom_arrow);
    PyTuple_SET_ITEM(__pyx_t_3, 2+__pyx_t_6, __pyx_v_custom_arrow);
    __Pyx_INCREF(__pyx_v_extent);
    __Pyx_GIVEREF(__pyx_v_extent);
    PyTuple_SET_ITEM(__pyx_t_3, 3+__pyx_t_6, __pyx_v_extent);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2518, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyUnicode_Join(__pyx_kp_u__41, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2518, __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;

  /* "mathics/builtin/graphics.py":2503
 *         return make
 * 
 *     def to_svg(self):             # <<<<<<<<<<<<<<
 *         width = self.style.get_line_width(face_element=False)
 *         style = create_css(edge_color=self.edge_color, stroke_width=width)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("mathics.builtin.graphics.ArrowBox.to_svg", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_width);
  __Pyx_XDECREF(__pyx_v_style);
  __Pyx_XDECREF(__pyx_v_polyline);
  __Pyx_XDECREF(__pyx_v_polygon);
  __Pyx_XDECREF(__pyx_v_extent);
  __Pyx_XDECREF(__pyx_v_default_arrow);
  __Pyx_XDECREF(__pyx_v_custom_arrow);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":2520
 *         return "".join(self._draw(polyline, default_arrow, custom_arrow, extent))
 * 
 *     def to_asy(self):             # <<<<<<<<<<<<<<
 *         width = self.style.get_line_width(face_element=False)
 *         pen = create_pens(edge_color=self.edge_color, stroke_width=width)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_8ArrowBox_14to_asy(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_8ArrowBox_14to_asy = {"to_asy", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_8ArrowBox_14to_asy, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_8ArrowBox_14to_asy(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_asy (wrapper)", 0);
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_8ArrowBox_13to_asy(__pyx_self, ((PyObject *)__pyx_v_self));

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

/* "mathics/builtin/graphics.py":2527
 *         arrow_pen = create_pens(face_color=self.edge_color, stroke_width=width)
 * 
 *         def polygon(points):             # <<<<<<<<<<<<<<
 *             yield "filldraw("
 *             yield "--".join(["(%.5g,%5g)" % xy for xy in points])
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_8ArrowBox_6to_asy_1polygon(PyObject *__pyx_self, PyObject *__pyx_v_points); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_8ArrowBox_6to_asy_1polygon = {"polygon", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_8ArrowBox_6to_asy_1polygon, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_8ArrowBox_6to_asy_1polygon(PyObject *__pyx_self, PyObject *__pyx_v_points) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("polygon (wrapper)", 0);
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_8ArrowBox_6to_asy_polygon(__pyx_self, ((PyObject *)__pyx_v_points));

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_8ArrowBox_6to_asy_polygon(PyObject *__pyx_self, PyObject *__pyx_v_points) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_65_polygon *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("polygon", 0);
  __pyx_cur_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_65_polygon *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_65_polygon(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_65_polygon, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_65_polygon *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 2527, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_64_to_asy *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  __pyx_cur_scope->__pyx_v_points = __pyx_v_points;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_points);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_points);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7mathics_7builtin_8graphics_8ArrowBox_6to_asy_2generator41, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_polygon, __pyx_n_s_ArrowBox_to_asy_locals_polygon, __pyx_n_s_mathics_builtin_graphics); if (unlikely(!gen)) __PYX_ERR(0, 2527, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.ArrowBox.to_asy.polygon", __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_7mathics_7builtin_8graphics_8ArrowBox_6to_asy_2generator41(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_65_polygon *__pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_65_polygon *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("polygon", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L4_resume_from_yield;
    case 2: goto __pyx_L7_resume_from_yield;
    case 3: goto __pyx_L8_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2527, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2528
 * 
 *         def polygon(points):
 *             yield "filldraw("             # <<<<<<<<<<<<<<
 *             yield "--".join(["(%.5g,%5g)" % xy for xy in points])
 *             yield "--cycle, % s);" % arrow_pen
 */
  __Pyx_INCREF(__pyx_kp_u_filldraw_3);
  __pyx_r = __pyx_kp_u_filldraw_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_L4_resume_from_yield:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2528, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2529
 *         def polygon(points):
 *             yield "filldraw("
 *             yield "--".join(["(%.5g,%5g)" % xy for xy in points])             # <<<<<<<<<<<<<<
 *             yield "--cycle, % s);" % arrow_pen
 * 
 */
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2529, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_points)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_points)) {
      __pyx_t_2 = __pyx_cur_scope->__pyx_v_points; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
      __pyx_t_4 = NULL;
    } else {
      __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_points); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2529, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2529, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_4)) {
        if (likely(PyList_CheckExact(__pyx_t_2))) {
          if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 2529, __pyx_L1_error)
          #else
          __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2529, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          #endif
        } else {
          if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 2529, __pyx_L1_error)
          #else
          __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2529, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          #endif
        }
      } else {
        __pyx_t_5 = __pyx_t_4(__pyx_t_2);
        if (unlikely(!__pyx_t_5)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 2529, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_5);
      }
      __Pyx_XGOTREF(__pyx_cur_scope->__pyx_9genexpr52__pyx_v_xy);
      __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_9genexpr52__pyx_v_xy, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_5g_5g, __pyx_cur_scope->__pyx_9genexpr52__pyx_v_xy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2529, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 2529, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } /* exit inner scope */
  __pyx_t_2 = PyUnicode_Join(__pyx_kp_u__43, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2529, __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;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  /* return from generator, yielding value */
  __pyx_generator->resume_label = 2;
  return __pyx_r;
  __pyx_L7_resume_from_yield:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2529, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2530
 *             yield "filldraw("
 *             yield "--".join(["(%.5g,%5g)" % xy for xy in points])
 *             yield "--cycle, % s);" % arrow_pen             # <<<<<<<<<<<<<<
 * 
 *         extent = self.graphics.view_width or 0
 */
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_arrow_pen)) { __Pyx_RaiseClosureNameError("arrow_pen"); __PYX_ERR(0, 2530, __pyx_L1_error) }
  __pyx_t_2 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_cycle_s, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_arrow_pen); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2530, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  /* return from generator, yielding value */
  __pyx_generator->resume_label = 3;
  return __pyx_r;
  __pyx_L8_resume_from_yield:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2530, __pyx_L1_error)
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "mathics/builtin/graphics.py":2527
 *         arrow_pen = create_pens(face_color=self.edge_color, stroke_width=width)
 * 
 *         def polygon(points):             # <<<<<<<<<<<<<<
 *             yield "filldraw("
 *             yield "--".join(["(%.5g,%5g)" % xy for xy in points])
 */

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

/* "mathics/builtin/graphics.py":2520
 *         return "".join(self._draw(polyline, default_arrow, custom_arrow, extent))
 * 
 *     def to_asy(self):             # <<<<<<<<<<<<<<
 *         width = self.style.get_line_width(face_element=False)
 *         pen = create_pens(edge_color=self.edge_color, stroke_width=width)
 */

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_8ArrowBox_13to_asy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_64_to_asy *__pyx_cur_scope;
  PyObject *__pyx_v_width = NULL;
  PyObject *__pyx_v_pen = NULL;
  PyObject *__pyx_v_polyline = NULL;
  PyObject *__pyx_v_polygon = 0;
  PyObject *__pyx_v_extent = NULL;
  PyObject *__pyx_v_default_arrow = NULL;
  PyObject *__pyx_v_custom_arrow = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_asy", 0);
  __pyx_cur_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_64_to_asy *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_64_to_asy(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_64_to_asy, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_64_to_asy *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 2520, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }

  /* "mathics/builtin/graphics.py":2521
 * 
 *     def to_asy(self):
 *         width = self.style.get_line_width(face_element=False)             # <<<<<<<<<<<<<<
 *         pen = create_pens(edge_color=self.edge_color, stroke_width=width)
 *         polyline = self.curve.make_draw_asy(pen)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_style); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2521, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_get_line_width); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2521, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2521, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_face_element, Py_False) < 0) __PYX_ERR(0, 2521, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2521, __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_v_width = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":2522
 *     def to_asy(self):
 *         width = self.style.get_line_width(face_element=False)
 *         pen = create_pens(edge_color=self.edge_color, stroke_width=width)             # <<<<<<<<<<<<<<
 *         polyline = self.curve.make_draw_asy(pen)
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_create_pens); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2522, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2522, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_edge_color); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2522, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_edge_color, __pyx_t_2) < 0) __PYX_ERR(0, 2522, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_stroke_width, __pyx_v_width) < 0) __PYX_ERR(0, 2522, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2522, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_pen = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":2523
 *         width = self.style.get_line_width(face_element=False)
 *         pen = create_pens(edge_color=self.edge_color, stroke_width=width)
 *         polyline = self.curve.make_draw_asy(pen)             # <<<<<<<<<<<<<<
 * 
 *         arrow_pen = create_pens(face_color=self.edge_color, stroke_width=width)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_curve); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2523, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_make_draw_asy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2523, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_1, __pyx_v_pen) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_pen);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2523, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_polyline = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":2525
 *         polyline = self.curve.make_draw_asy(pen)
 * 
 *         arrow_pen = create_pens(face_color=self.edge_color, stroke_width=width)             # <<<<<<<<<<<<<<
 * 
 *         def polygon(points):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_create_pens); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2525, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2525, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_edge_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2525, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_face_color, __pyx_t_1) < 0) __PYX_ERR(0, 2525, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_stroke_width, __pyx_v_width) < 0) __PYX_ERR(0, 2525, __pyx_L1_error)
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2525, __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_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_arrow_pen = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":2527
 *         arrow_pen = create_pens(face_color=self.edge_color, stroke_width=width)
 * 
 *         def polygon(points):             # <<<<<<<<<<<<<<
 *             yield "filldraw("
 *             yield "--".join(["(%.5g,%5g)" % xy for xy in points])
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_8ArrowBox_6to_asy_1polygon, 0, __pyx_n_s_ArrowBox_to_asy_locals_polygon, ((PyObject*)__pyx_cur_scope), __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__101)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2527, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_polygon = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":2532
 *             yield "--cycle, % s);" % arrow_pen
 * 
 *         extent = self.graphics.view_width or 0             # <<<<<<<<<<<<<<
 *         default_arrow = self._default_arrow(polygon)
 *         custom_arrow = self._custom_arrow("asy", _ASYTransform)
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_graphics); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2532, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_view_width); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2532, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 2532, __pyx_L1_error)
  if (!__pyx_t_4) {
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_1 = __pyx_t_2;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_t_2 = __Pyx_PyInt_From_long(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2532, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_L3_bool_binop_done:;
  __pyx_v_extent = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":2533
 * 
 *         extent = self.graphics.view_width or 0
 *         default_arrow = self._default_arrow(polygon)             # <<<<<<<<<<<<<<
 *         custom_arrow = self._custom_arrow("asy", _ASYTransform)
 *         return "".join(self._draw(polyline, default_arrow, custom_arrow, extent))
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_default_arrow_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2533, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_polygon) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_polygon);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2533, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_default_arrow = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":2534
 *         extent = self.graphics.view_width or 0
 *         default_arrow = self._default_arrow(polygon)
 *         custom_arrow = self._custom_arrow("asy", _ASYTransform)             # <<<<<<<<<<<<<<
 *         return "".join(self._draw(polyline, default_arrow, custom_arrow, extent))
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_custom_arrow_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2534, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ASYTransform); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2534, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_n_u_asy, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2534, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_n_u_asy, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2534, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  {
    __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2534, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_5) {
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
    }
    __Pyx_INCREF(__pyx_n_u_asy);
    __Pyx_GIVEREF(__pyx_n_u_asy);
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_n_u_asy);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2534, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_custom_arrow = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":2535
 *         default_arrow = self._default_arrow(polygon)
 *         custom_arrow = self._custom_arrow("asy", _ASYTransform)
 *         return "".join(self._draw(polyline, default_arrow, custom_arrow, extent))             # <<<<<<<<<<<<<<
 * 
 *     def extent(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_draw_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2535, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_7 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[5] = {__pyx_t_7, __pyx_v_polyline, __pyx_v_default_arrow, __pyx_v_custom_arrow, __pyx_v_extent};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 4+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2535, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[5] = {__pyx_t_7, __pyx_v_polyline, __pyx_v_default_arrow, __pyx_v_custom_arrow, __pyx_v_extent};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 4+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2535, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_3 = PyTuple_New(4+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2535, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (__pyx_t_7) {
      __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_7); __pyx_t_7 = NULL;
    }
    __Pyx_INCREF(__pyx_v_polyline);
    __Pyx_GIVEREF(__pyx_v_polyline);
    PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_6, __pyx_v_polyline);
    __Pyx_INCREF(__pyx_v_default_arrow);
    __Pyx_GIVEREF(__pyx_v_default_arrow);
    PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_6, __pyx_v_default_arrow);
    __Pyx_INCREF(__pyx_v_custom_arrow);
    __Pyx_GIVEREF(__pyx_v_custom_arrow);
    PyTuple_SET_ITEM(__pyx_t_3, 2+__pyx_t_6, __pyx_v_custom_arrow);
    __Pyx_INCREF(__pyx_v_extent);
    __Pyx_GIVEREF(__pyx_v_extent);
    PyTuple_SET_ITEM(__pyx_t_3, 3+__pyx_t_6, __pyx_v_extent);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2535, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyUnicode_Join(__pyx_kp_u__41, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2535, __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;

  /* "mathics/builtin/graphics.py":2520
 *         return "".join(self._draw(polyline, default_arrow, custom_arrow, extent))
 * 
 *     def to_asy(self):             # <<<<<<<<<<<<<<
 *         width = self.style.get_line_width(face_element=False)
 *         pen = create_pens(edge_color=self.edge_color, stroke_width=width)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("mathics.builtin.graphics.ArrowBox.to_asy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_width);
  __Pyx_XDECREF(__pyx_v_pen);
  __Pyx_XDECREF(__pyx_v_polyline);
  __Pyx_XDECREF(__pyx_v_polygon);
  __Pyx_XDECREF(__pyx_v_extent);
  __Pyx_XDECREF(__pyx_v_default_arrow);
  __Pyx_XDECREF(__pyx_v_custom_arrow);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":2537
 *         return "".join(self._draw(polyline, default_arrow, custom_arrow, extent))
 * 
 *     def extent(self):             # <<<<<<<<<<<<<<
 *         width = self.style.get_line_width(face_element=False)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_8ArrowBox_16extent(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_8ArrowBox_16extent = {"extent", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_8ArrowBox_16extent, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_8ArrowBox_16extent(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("extent (wrapper)", 0);
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_8ArrowBox_15extent(__pyx_self, ((PyObject *)__pyx_v_self));

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

/* "mathics/builtin/graphics.py":2540
 *         width = self.style.get_line_width(face_element=False)
 * 
 *         def polyline(points):             # <<<<<<<<<<<<<<
 *             for p in points:
 *                 x, y = p
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_8ArrowBox_6extent_1polyline(PyObject *__pyx_self, PyObject *__pyx_v_points); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_8ArrowBox_6extent_1polyline = {"polyline", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_8ArrowBox_6extent_1polyline, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_8ArrowBox_6extent_1polyline(PyObject *__pyx_self, PyObject *__pyx_v_points) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("polyline (wrapper)", 0);
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_8ArrowBox_6extent_polyline(__pyx_self, ((PyObject *)__pyx_v_points));

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_8ArrowBox_6extent_polyline(PyObject *__pyx_self, PyObject *__pyx_v_points) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_67_polyline *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("polyline", 0);
  __pyx_cur_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_67_polyline *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_67_polyline(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_67_polyline, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_67_polyline *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 2540, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_66_extent *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  __pyx_cur_scope->__pyx_v_points = __pyx_v_points;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_points);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_points);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7mathics_7builtin_8graphics_8ArrowBox_6extent_2generator42, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_polyline, __pyx_n_s_ArrowBox_extent_locals_polyline, __pyx_n_s_mathics_builtin_graphics); if (unlikely(!gen)) __PYX_ERR(0, 2540, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.ArrowBox.extent.polyline", __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_7mathics_7builtin_8graphics_8ArrowBox_6extent_2generator42(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_67_polyline *__pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_67_polyline *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *(*__pyx_t_7)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("polyline", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L8_resume_from_yield;
    case 2: goto __pyx_L9_resume_from_yield;
    case 3: goto __pyx_L10_resume_from_yield;
    case 4: goto __pyx_L11_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2540, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2541
 * 
 *         def polyline(points):
 *             for p in points:             # <<<<<<<<<<<<<<
 *                 x, y = p
 *                 yield x - width, y - width
 */
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_points)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_points)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_v_points; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_points); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2541, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2541, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 2541, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2541, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 2541, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2541, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 2541, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_p);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_p, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;

    /* "mathics/builtin/graphics.py":2542
 *         def polyline(points):
 *             for p in points:
 *                 x, y = p             # <<<<<<<<<<<<<<
 *                 yield x - width, y - width
 *                 yield x - width, y + width
 */
    if ((likely(PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_p))) || (PyList_CheckExact(__pyx_cur_scope->__pyx_v_p))) {
      PyObject* sequence = __pyx_cur_scope->__pyx_v_p;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 2542, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_4 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      #else
      __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2542, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2542, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      #endif
    } else {
      Py_ssize_t index = -1;
      __pyx_t_6 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_p); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2542, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext;
      index = 0; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L6_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_4);
      index = 1; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L6_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_5);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(0, 2542, __pyx_L1_error)
      __pyx_t_7 = NULL;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L7_unpacking_done;
      __pyx_L6_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 2542, __pyx_L1_error)
      __pyx_L7_unpacking_done:;
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_x);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_x, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_y);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_y, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_5 = 0;

    /* "mathics/builtin/graphics.py":2543
 *             for p in points:
 *                 x, y = p
 *                 yield x - width, y - width             # <<<<<<<<<<<<<<
 *                 yield x - width, y + width
 *                 yield x + width, y - width
 */
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_width)) { __Pyx_RaiseClosureNameError("width"); __PYX_ERR(0, 2543, __pyx_L1_error) }
    __pyx_t_5 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_x, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_width); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2543, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_width)) { __Pyx_RaiseClosureNameError("width"); __PYX_ERR(0, 2543, __pyx_L1_error) }
    __pyx_t_4 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_y, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_width); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2543, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2543, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4);
    __pyx_t_5 = 0;
    __pyx_t_4 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    __Pyx_XGIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L8_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2543, __pyx_L1_error)

    /* "mathics/builtin/graphics.py":2544
 *                 x, y = p
 *                 yield x - width, y - width
 *                 yield x - width, y + width             # <<<<<<<<<<<<<<
 *                 yield x + width, y - width
 *                 yield x + width, y + width
 */
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_width)) { __Pyx_RaiseClosureNameError("width"); __PYX_ERR(0, 2544, __pyx_L1_error) }
    __pyx_t_6 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_x, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_width); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2544, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_width)) { __Pyx_RaiseClosureNameError("width"); __PYX_ERR(0, 2544, __pyx_L1_error) }
    __pyx_t_4 = PyNumber_Add(__pyx_cur_scope->__pyx_v_y, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_width); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2544, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2544, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4);
    __pyx_t_6 = 0;
    __pyx_t_4 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    __Pyx_XGIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_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 = 2;
    return __pyx_r;
    __pyx_L9_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2544, __pyx_L1_error)

    /* "mathics/builtin/graphics.py":2545
 *                 yield x - width, y - width
 *                 yield x - width, y + width
 *                 yield x + width, y - width             # <<<<<<<<<<<<<<
 *                 yield x + width, y + width
 * 
 */
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_width)) { __Pyx_RaiseClosureNameError("width"); __PYX_ERR(0, 2545, __pyx_L1_error) }
    __pyx_t_5 = PyNumber_Add(__pyx_cur_scope->__pyx_v_x, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_width); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2545, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_width)) { __Pyx_RaiseClosureNameError("width"); __PYX_ERR(0, 2545, __pyx_L1_error) }
    __pyx_t_4 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_y, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_width); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2545, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2545, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4);
    __pyx_t_5 = 0;
    __pyx_t_4 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    __Pyx_XGIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 3;
    return __pyx_r;
    __pyx_L10_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2545, __pyx_L1_error)

    /* "mathics/builtin/graphics.py":2546
 *                 yield x - width, y + width
 *                 yield x + width, y - width
 *                 yield x + width, y + width             # <<<<<<<<<<<<<<
 * 
 *         def polygon(points):
 */
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_width)) { __Pyx_RaiseClosureNameError("width"); __PYX_ERR(0, 2546, __pyx_L1_error) }
    __pyx_t_6 = PyNumber_Add(__pyx_cur_scope->__pyx_v_x, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_width); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2546, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_width)) { __Pyx_RaiseClosureNameError("width"); __PYX_ERR(0, 2546, __pyx_L1_error) }
    __pyx_t_4 = PyNumber_Add(__pyx_cur_scope->__pyx_v_y, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_width); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2546, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2546, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4);
    __pyx_t_6 = 0;
    __pyx_t_4 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    __Pyx_XGIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_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 = 4;
    return __pyx_r;
    __pyx_L11_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2546, __pyx_L1_error)

    /* "mathics/builtin/graphics.py":2541
 * 
 *         def polyline(points):
 *             for p in points:             # <<<<<<<<<<<<<<
 *                 x, y = p
 *                 yield x - width, y - width
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "mathics/builtin/graphics.py":2540
 *         width = self.style.get_line_width(face_element=False)
 * 
 *         def polyline(points):             # <<<<<<<<<<<<<<
 *             for p in points:
 *                 x, y = p
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  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_AddTraceback("polyline", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7mathics_7builtin_8graphics_8ArrowBox_6extent_5generator43(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "mathics/builtin/graphics.py":2548
 *                 yield x + width, y + width
 * 
 *         def polygon(points):             # <<<<<<<<<<<<<<
 *             for p in points:
 *                 yield p
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_8ArrowBox_6extent_4polygon(PyObject *__pyx_self, PyObject *__pyx_v_points); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_8ArrowBox_6extent_4polygon = {"polygon", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_8ArrowBox_6extent_4polygon, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_8ArrowBox_6extent_4polygon(PyObject *__pyx_self, PyObject *__pyx_v_points) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("polygon (wrapper)", 0);
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_8ArrowBox_6extent_3polygon(__pyx_self, ((PyObject *)__pyx_v_points));

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_8ArrowBox_6extent_3polygon(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_points) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_68_polygon *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("polygon", 0);
  __pyx_cur_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_68_polygon *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_68_polygon(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_68_polygon, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_68_polygon *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 2548, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_points = __pyx_v_points;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_points);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_points);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7mathics_7builtin_8graphics_8ArrowBox_6extent_5generator43, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_polygon, __pyx_n_s_ArrowBox_extent_locals_polygon, __pyx_n_s_mathics_builtin_graphics); if (unlikely(!gen)) __PYX_ERR(0, 2548, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.ArrowBox.extent.polygon", __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_7mathics_7builtin_8graphics_8ArrowBox_6extent_5generator43(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_68_polygon *__pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_68_polygon *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("polygon", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2548, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2549
 * 
 *         def polygon(points):
 *             for p in points:             # <<<<<<<<<<<<<<
 *                 yield p
 * 
 */
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_points)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_points)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_v_points; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_points); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2549, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2549, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 2549, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2549, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 2549, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2549, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 2549, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_p);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_p, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;

    /* "mathics/builtin/graphics.py":2550
 *         def polygon(points):
 *             for p in points:
 *                 yield p             # <<<<<<<<<<<<<<
 * 
 *         def default_arrow(px, py, vx, vy, t1, s):
 */
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_p);
    __pyx_r = __pyx_cur_scope->__pyx_v_p;
    __Pyx_XGIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2550, __pyx_L1_error)

    /* "mathics/builtin/graphics.py":2549
 * 
 *         def polygon(points):
 *             for p in points:             # <<<<<<<<<<<<<<
 *                 yield p
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "mathics/builtin/graphics.py":2548
 *                 yield x + width, y + width
 * 
 *         def polygon(points):             # <<<<<<<<<<<<<<
 *             for p in points:
 *                 yield p
 */

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

/* "mathics/builtin/graphics.py":2552
 *                 yield p
 * 
 *         def default_arrow(px, py, vx, vy, t1, s):             # <<<<<<<<<<<<<<
 *             yield px, py
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_8ArrowBox_6extent_7default_arrow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_8ArrowBox_6extent_7default_arrow = {"default_arrow", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_8ArrowBox_6extent_7default_arrow, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_8ArrowBox_6extent_7default_arrow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_px = 0;
  PyObject *__pyx_v_py = 0;
  CYTHON_UNUSED PyObject *__pyx_v_vx = 0;
  CYTHON_UNUSED PyObject *__pyx_v_vy = 0;
  CYTHON_UNUSED PyObject *__pyx_v_t1 = 0;
  CYTHON_UNUSED PyObject *__pyx_v_s = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("default_arrow (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_px,&__pyx_n_s_py,&__pyx_n_s_vx,&__pyx_n_s_vy,&__pyx_n_s_t1,&__pyx_n_s_s,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_px)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_py)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("default_arrow", 1, 6, 6, 1); __PYX_ERR(0, 2552, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vx)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("default_arrow", 1, 6, 6, 2); __PYX_ERR(0, 2552, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vy)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("default_arrow", 1, 6, 6, 3); __PYX_ERR(0, 2552, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t1)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("default_arrow", 1, 6, 6, 4); __PYX_ERR(0, 2552, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_s)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("default_arrow", 1, 6, 6, 5); __PYX_ERR(0, 2552, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "default_arrow") < 0)) __PYX_ERR(0, 2552, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
    }
    __pyx_v_px = values[0];
    __pyx_v_py = values[1];
    __pyx_v_vx = values[2];
    __pyx_v_vy = values[3];
    __pyx_v_t1 = values[4];
    __pyx_v_s = values[5];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("default_arrow", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2552, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.ArrowBox.extent.default_arrow", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_8ArrowBox_6extent_6default_arrow(__pyx_self, __pyx_v_px, __pyx_v_py, __pyx_v_vx, __pyx_v_vy, __pyx_v_t1, __pyx_v_s);

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_8ArrowBox_6extent_6default_arrow(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_px, PyObject *__pyx_v_py, CYTHON_UNUSED PyObject *__pyx_v_vx, CYTHON_UNUSED PyObject *__pyx_v_vy, CYTHON_UNUSED PyObject *__pyx_v_t1, CYTHON_UNUSED PyObject *__pyx_v_s) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_69_default_arrow *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("default_arrow", 0);
  __pyx_cur_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_69_default_arrow *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_69_default_arrow(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_69_default_arrow, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_69_default_arrow *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 2552, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_px = __pyx_v_px;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_px);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_px);
  __pyx_cur_scope->__pyx_v_py = __pyx_v_py;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_py);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_py);
  __pyx_cur_scope->__pyx_v_vx = __pyx_v_vx;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_vx);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_vx);
  __pyx_cur_scope->__pyx_v_vy = __pyx_v_vy;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_vy);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_vy);
  __pyx_cur_scope->__pyx_v_t1 = __pyx_v_t1;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_t1);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_t1);
  __pyx_cur_scope->__pyx_v_s = __pyx_v_s;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_s);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_s);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7mathics_7builtin_8graphics_8ArrowBox_6extent_8generator44, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_default_arrow, __pyx_n_s_ArrowBox_extent_locals_default_a, __pyx_n_s_mathics_builtin_graphics); if (unlikely(!gen)) __PYX_ERR(0, 2552, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.ArrowBox.extent.default_arrow", __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_7mathics_7builtin_8graphics_8ArrowBox_6extent_8generator44(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_69_default_arrow *__pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_69_default_arrow *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("default_arrow", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L4_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2552, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2553
 * 
 *         def default_arrow(px, py, vx, vy, t1, s):
 *             yield px, py             # <<<<<<<<<<<<<<
 * 
 *         return list(self._draw(polyline, default_arrow, None, 0))
 */
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2553, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_px);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_px);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_cur_scope->__pyx_v_px);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_py);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_py);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_cur_scope->__pyx_v_py);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  /* return from generator, yielding value */
  __pyx_generator->resume_label = 1;
  return __pyx_r;
  __pyx_L4_resume_from_yield:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2553, __pyx_L1_error)
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "mathics/builtin/graphics.py":2552
 *                 yield p
 * 
 *         def default_arrow(px, py, vx, vy, t1, s):             # <<<<<<<<<<<<<<
 *             yield px, py
 * 
 */

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

/* "mathics/builtin/graphics.py":2537
 *         return "".join(self._draw(polyline, default_arrow, custom_arrow, extent))
 * 
 *     def extent(self):             # <<<<<<<<<<<<<<
 *         width = self.style.get_line_width(face_element=False)
 * 
 */

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_8ArrowBox_15extent(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_66_extent *__pyx_cur_scope;
  PyObject *__pyx_v_polyline = 0;
  CYTHON_UNUSED PyObject *__pyx_v_polygon = 0;
  PyObject *__pyx_v_default_arrow = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("extent", 0);
  __pyx_cur_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_66_extent *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_66_extent(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_66_extent, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_66_extent *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 2537, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }

  /* "mathics/builtin/graphics.py":2538
 * 
 *     def extent(self):
 *         width = self.style.get_line_width(face_element=False)             # <<<<<<<<<<<<<<
 * 
 *         def polyline(points):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_style); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2538, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_get_line_width); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2538, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2538, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_face_element, Py_False) < 0) __PYX_ERR(0, 2538, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2538, __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_GIVEREF(__pyx_t_3);
  __pyx_cur_scope->__pyx_v_width = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":2540
 *         width = self.style.get_line_width(face_element=False)
 * 
 *         def polyline(points):             # <<<<<<<<<<<<<<
 *             for p in points:
 *                 x, y = p
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_8ArrowBox_6extent_1polyline, 0, __pyx_n_s_ArrowBox_extent_locals_polyline, ((PyObject*)__pyx_cur_scope), __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__103)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2540, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_polyline = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":2548
 *                 yield x + width, y + width
 * 
 *         def polygon(points):             # <<<<<<<<<<<<<<
 *             for p in points:
 *                 yield p
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_8ArrowBox_6extent_4polygon, 0, __pyx_n_s_ArrowBox_extent_locals_polygon, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__105)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2548, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_polygon = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":2552
 *                 yield p
 * 
 *         def default_arrow(px, py, vx, vy, t1, s):             # <<<<<<<<<<<<<<
 *             yield px, py
 * 
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_8ArrowBox_6extent_7default_arrow, 0, __pyx_n_s_ArrowBox_extent_locals_default_a, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__107)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2552, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_default_arrow = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":2555
 *             yield px, py
 * 
 *         return list(self._draw(polyline, default_arrow, None, 0))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_draw_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2555, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_1)) {
    PyObject *__pyx_temp[5] = {__pyx_t_2, __pyx_v_polyline, __pyx_v_default_arrow, Py_None, __pyx_int_0};
    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2555, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_3);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
    PyObject *__pyx_temp[5] = {__pyx_t_2, __pyx_v_polyline, __pyx_v_default_arrow, Py_None, __pyx_int_0};
    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2555, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_3);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(4+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2555, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_2) {
      __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
    }
    __Pyx_INCREF(__pyx_v_polyline);
    __Pyx_GIVEREF(__pyx_v_polyline);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_polyline);
    __Pyx_INCREF(__pyx_v_default_arrow);
    __Pyx_GIVEREF(__pyx_v_default_arrow);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_default_arrow);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, Py_None);
    __Pyx_INCREF(__pyx_int_0);
    __Pyx_GIVEREF(__pyx_int_0);
    PyTuple_SET_ITEM(__pyx_t_5, 3+__pyx_t_4, __pyx_int_0);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2555, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PySequence_List(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2555, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":2537
 *         return "".join(self._draw(polyline, default_arrow, custom_arrow, extent))
 * 
 *     def extent(self):             # <<<<<<<<<<<<<<
 *         width = self.style.get_line_width(face_element=False)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("mathics.builtin.graphics.ArrowBox.extent", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_polyline);
  __Pyx_XDECREF(__pyx_v_polygon);
  __Pyx_XDECREF(__pyx_v_default_arrow);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":2559
 * 
 * class InsetBox(_GraphicsElement):
 *     def init(self, graphics, style, item=None, content=None, pos=None, opos=(0, 0)):             # <<<<<<<<<<<<<<
 *         super(InsetBox, self).init(graphics, item, style)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_8InsetBox_1init(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_8InsetBox_1init = {"init", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_8InsetBox_1init, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_8InsetBox_1init(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_graphics = 0;
  PyObject *__pyx_v_style = 0;
  PyObject *__pyx_v_item = 0;
  PyObject *__pyx_v_content = 0;
  PyObject *__pyx_v_pos = 0;
  PyObject *__pyx_v_opos = 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);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_graphics,&__pyx_n_s_style,&__pyx_n_s_item,&__pyx_n_s_content,&__pyx_n_s_pos,&__pyx_n_s_opos,0};
    PyObject* values[7] = {0,0,0,0,0,0,0};
    values[3] = ((PyObject *)((PyObject *)Py_None));
    values[4] = ((PyObject *)((PyObject *)Py_None));
    values[5] = ((PyObject *)((PyObject *)Py_None));
    values[6] = ((PyObject *)((PyObject*)__pyx_tuple__83));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_graphics)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("init", 0, 3, 7, 1); __PYX_ERR(0, 2559, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_style)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("init", 0, 3, 7, 2); __PYX_ERR(0, 2559, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_item);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_content);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pos);
          if (value) { values[5] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_opos);
          if (value) { values[6] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "init") < 0)) __PYX_ERR(0, 2559, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_graphics = values[1];
    __pyx_v_style = values[2];
    __pyx_v_item = values[3];
    __pyx_v_content = values[4];
    __pyx_v_pos = values[5];
    __pyx_v_opos = values[6];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("init", 0, 3, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2559, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.InsetBox.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_8InsetBox_init(__pyx_self, __pyx_v_self, __pyx_v_graphics, __pyx_v_style, __pyx_v_item, __pyx_v_content, __pyx_v_pos, __pyx_v_opos);

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_8InsetBox_init(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_graphics, PyObject *__pyx_v_style, PyObject *__pyx_v_item, PyObject *__pyx_v_content, PyObject *__pyx_v_pos, PyObject *__pyx_v_opos) {
  CYTHON_UNUSED PyObject *__pyx_v__ = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  Py_ssize_t __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("init", 0);
  __Pyx_INCREF(__pyx_v_content);

  /* "mathics/builtin/graphics.py":2560
 * class InsetBox(_GraphicsElement):
 *     def init(self, graphics, style, item=None, content=None, pos=None, opos=(0, 0)):
 *         super(InsetBox, self).init(graphics, item, style)             # <<<<<<<<<<<<<<
 * 
 *         self.color = self.style.get_option("System`FontColor")
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_InsetBox); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2560, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2560, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_INCREF(__pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2560, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2560, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_v_graphics, __pyx_v_item, __pyx_v_style};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2560, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_v_graphics, __pyx_v_item, __pyx_v_style};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2560, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2560, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_2) {
      __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
    }
    __Pyx_INCREF(__pyx_v_graphics);
    __Pyx_GIVEREF(__pyx_v_graphics);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_graphics);
    __Pyx_INCREF(__pyx_v_item);
    __Pyx_GIVEREF(__pyx_v_item);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_item);
    __Pyx_INCREF(__pyx_v_style);
    __Pyx_GIVEREF(__pyx_v_style);
    PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_style);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2560, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":2562
 *         super(InsetBox, self).init(graphics, item, style)
 * 
 *         self.color = self.style.get_option("System`FontColor")             # <<<<<<<<<<<<<<
 *         if self.color is None:
 *             self.color, _ = style.get_style(_Color, face_element=False)
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_style); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2562, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_get_option); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2562, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_3, __pyx_kp_u_System_FontColor) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_kp_u_System_FontColor);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2562, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_color, __pyx_t_1) < 0) __PYX_ERR(0, 2562, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":2563
 * 
 *         self.color = self.style.get_option("System`FontColor")
 *         if self.color is None:             # <<<<<<<<<<<<<<
 *             self.color, _ = style.get_style(_Color, face_element=False)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2563, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = (__pyx_t_1 == Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "mathics/builtin/graphics.py":2564
 *         self.color = self.style.get_option("System`FontColor")
 *         if self.color is None:
 *             self.color, _ = style.get_style(_Color, face_element=False)             # <<<<<<<<<<<<<<
 * 
 *         if item is not None:
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_style, __pyx_n_s_get_style); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2564, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Color); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2564, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2564, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2564, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_face_element, Py_False) < 0) __PYX_ERR(0, 2564, __pyx_L1_error)
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2564, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
      PyObject* sequence = __pyx_t_2;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 2564, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_3);
      #else
      __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2564, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2564, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      #endif
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2564, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_8 = Py_TYPE(__pyx_t_1)->tp_iternext;
      index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_1); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_5);
      index = 1; __pyx_t_3 = __pyx_t_8(__pyx_t_1); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_3);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_1), 2) < 0) __PYX_ERR(0, 2564, __pyx_L1_error)
      __pyx_t_8 = NULL;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L5_unpacking_done;
      __pyx_L4_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_8 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 2564, __pyx_L1_error)
      __pyx_L5_unpacking_done:;
    }
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_color, __pyx_t_5) < 0) __PYX_ERR(0, 2564, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v__ = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "mathics/builtin/graphics.py":2563
 * 
 *         self.color = self.style.get_option("System`FontColor")
 *         if self.color is None:             # <<<<<<<<<<<<<<
 *             self.color, _ = style.get_style(_Color, face_element=False)
 * 
 */
  }

  /* "mathics/builtin/graphics.py":2566
 *             self.color, _ = style.get_style(_Color, face_element=False)
 * 
 *         if item is not None:             # <<<<<<<<<<<<<<
 *             if len(item.leaves) not in (1, 2, 3):
 *                 raise BoxConstructError
 */
  __pyx_t_7 = (__pyx_v_item != Py_None);
  __pyx_t_6 = (__pyx_t_7 != 0);
  if (__pyx_t_6) {

    /* "mathics/builtin/graphics.py":2567
 * 
 *         if item is not None:
 *             if len(item.leaves) not in (1, 2, 3):             # <<<<<<<<<<<<<<
 *                 raise BoxConstructError
 *             content = item.leaves[0]
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_item, __pyx_n_s_leaves); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2567, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_9 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2567, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_7 = ((__pyx_t_9 != 1) != 0);
    if (__pyx_t_7) {
    } else {
      __pyx_t_6 = __pyx_t_7;
      goto __pyx_L8_bool_binop_done;
    }
    __pyx_t_7 = ((__pyx_t_9 != 2) != 0);
    if (__pyx_t_7) {
    } else {
      __pyx_t_6 = __pyx_t_7;
      goto __pyx_L8_bool_binop_done;
    }
    __pyx_t_7 = ((__pyx_t_9 != 3) != 0);
    __pyx_t_6 = __pyx_t_7;
    __pyx_L8_bool_binop_done:;
    __pyx_t_7 = (__pyx_t_6 != 0);
    if (unlikely(__pyx_t_7)) {

      /* "mathics/builtin/graphics.py":2568
 *         if item is not None:
 *             if len(item.leaves) not in (1, 2, 3):
 *                 raise BoxConstructError             # <<<<<<<<<<<<<<
 *             content = item.leaves[0]
 *             self.content = content.format(graphics.evaluation, "TraditionalForm")
 */
      __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_BoxConstructError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2568, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(0, 2568, __pyx_L1_error)

      /* "mathics/builtin/graphics.py":2567
 * 
 *         if item is not None:
 *             if len(item.leaves) not in (1, 2, 3):             # <<<<<<<<<<<<<<
 *                 raise BoxConstructError
 *             content = item.leaves[0]
 */
    }

    /* "mathics/builtin/graphics.py":2569
 *             if len(item.leaves) not in (1, 2, 3):
 *                 raise BoxConstructError
 *             content = item.leaves[0]             # <<<<<<<<<<<<<<
 *             self.content = content.format(graphics.evaluation, "TraditionalForm")
 *             if len(item.leaves) > 1:
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_item, __pyx_n_s_leaves); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2569, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2569, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF_SET(__pyx_v_content, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "mathics/builtin/graphics.py":2570
 *                 raise BoxConstructError
 *             content = item.leaves[0]
 *             self.content = content.format(graphics.evaluation, "TraditionalForm")             # <<<<<<<<<<<<<<
 *             if len(item.leaves) > 1:
 *                 self.pos = Coords(graphics, item.leaves[1])
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_content, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2570, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_graphics, __pyx_n_s_evaluation); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2570, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = NULL;
    __pyx_t_4 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_4 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_t_5, __pyx_n_u_TraditionalForm};
      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2570, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_t_5, __pyx_n_u_TraditionalForm};
      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2570, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else
    #endif
    {
      __pyx_t_10 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2570, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      if (__pyx_t_1) {
        __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1); __pyx_t_1 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_4, __pyx_t_5);
      __Pyx_INCREF(__pyx_n_u_TraditionalForm);
      __Pyx_GIVEREF(__pyx_n_u_TraditionalForm);
      PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_4, __pyx_n_u_TraditionalForm);
      __pyx_t_5 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2570, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_content, __pyx_t_3) < 0) __PYX_ERR(0, 2570, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "mathics/builtin/graphics.py":2571
 *             content = item.leaves[0]
 *             self.content = content.format(graphics.evaluation, "TraditionalForm")
 *             if len(item.leaves) > 1:             # <<<<<<<<<<<<<<
 *                 self.pos = Coords(graphics, item.leaves[1])
 *             else:
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_item, __pyx_n_s_leaves); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2571, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_9 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2571, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_7 = ((__pyx_t_9 > 1) != 0);
    if (__pyx_t_7) {

      /* "mathics/builtin/graphics.py":2572
 *             self.content = content.format(graphics.evaluation, "TraditionalForm")
 *             if len(item.leaves) > 1:
 *                 self.pos = Coords(graphics, item.leaves[1])             # <<<<<<<<<<<<<<
 *             else:
 *                 self.pos = Coords(graphics, pos=(0, 0))
 */
      __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Coords); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2572, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_item, __pyx_n_s_leaves); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2572, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_10, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2572, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = NULL;
      __pyx_t_4 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_10)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
          __pyx_t_4 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_2)) {
        PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_v_graphics, __pyx_t_5};
        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2572, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
        PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_v_graphics, __pyx_t_5};
        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2572, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      } else
      #endif
      {
        __pyx_t_1 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2572, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        if (__pyx_t_10) {
          __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_10); __pyx_t_10 = NULL;
        }
        __Pyx_INCREF(__pyx_v_graphics);
        __Pyx_GIVEREF(__pyx_v_graphics);
        PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_4, __pyx_v_graphics);
        __Pyx_GIVEREF(__pyx_t_5);
        PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_4, __pyx_t_5);
        __pyx_t_5 = 0;
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2572, __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_n_s_pos, __pyx_t_3) < 0) __PYX_ERR(0, 2572, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "mathics/builtin/graphics.py":2571
 *             content = item.leaves[0]
 *             self.content = content.format(graphics.evaluation, "TraditionalForm")
 *             if len(item.leaves) > 1:             # <<<<<<<<<<<<<<
 *                 self.pos = Coords(graphics, item.leaves[1])
 *             else:
 */
      goto __pyx_L11;
    }

    /* "mathics/builtin/graphics.py":2574
 *                 self.pos = Coords(graphics, item.leaves[1])
 *             else:
 *                 self.pos = Coords(graphics, pos=(0, 0))             # <<<<<<<<<<<<<<
 *             if len(item.leaves) > 2:
 *                 self.opos = coords(item.leaves[2])
 */
    /*else*/ {
      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Coords); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2574, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2574, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_graphics);
      __Pyx_GIVEREF(__pyx_v_graphics);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_graphics);
      __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2574, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_pos, __pyx_tuple__83) < 0) __PYX_ERR(0, 2574, __pyx_L1_error)
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2574, __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_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_pos, __pyx_t_5) < 0) __PYX_ERR(0, 2574, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __pyx_L11:;

    /* "mathics/builtin/graphics.py":2575
 *             else:
 *                 self.pos = Coords(graphics, pos=(0, 0))
 *             if len(item.leaves) > 2:             # <<<<<<<<<<<<<<
 *                 self.opos = coords(item.leaves[2])
 *             else:
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_item, __pyx_n_s_leaves); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2575, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_9 = PyObject_Length(__pyx_t_5); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2575, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_7 = ((__pyx_t_9 > 2) != 0);
    if (__pyx_t_7) {

      /* "mathics/builtin/graphics.py":2576
 *                 self.pos = Coords(graphics, pos=(0, 0))
 *             if len(item.leaves) > 2:
 *                 self.opos = coords(item.leaves[2])             # <<<<<<<<<<<<<<
 *             else:
 *                 self.opos = (0, 0)
 */
      __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_coords); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2576, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_item, __pyx_n_s_leaves); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2576, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2576, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      __pyx_t_5 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2576, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_opos, __pyx_t_5) < 0) __PYX_ERR(0, 2576, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "mathics/builtin/graphics.py":2575
 *             else:
 *                 self.pos = Coords(graphics, pos=(0, 0))
 *             if len(item.leaves) > 2:             # <<<<<<<<<<<<<<
 *                 self.opos = coords(item.leaves[2])
 *             else:
 */
      goto __pyx_L12;
    }

    /* "mathics/builtin/graphics.py":2578
 *                 self.opos = coords(item.leaves[2])
 *             else:
 *                 self.opos = (0, 0)             # <<<<<<<<<<<<<<
 *         else:
 *             self.content = content
 */
    /*else*/ {
      if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_opos, __pyx_tuple__83) < 0) __PYX_ERR(0, 2578, __pyx_L1_error)
    }
    __pyx_L12:;

    /* "mathics/builtin/graphics.py":2566
 *             self.color, _ = style.get_style(_Color, face_element=False)
 * 
 *         if item is not None:             # <<<<<<<<<<<<<<
 *             if len(item.leaves) not in (1, 2, 3):
 *                 raise BoxConstructError
 */
    goto __pyx_L6;
  }

  /* "mathics/builtin/graphics.py":2580
 *                 self.opos = (0, 0)
 *         else:
 *             self.content = content             # <<<<<<<<<<<<<<
 *             self.pos = pos
 *             self.opos = opos
 */
  /*else*/ {
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_content, __pyx_v_content) < 0) __PYX_ERR(0, 2580, __pyx_L1_error)

    /* "mathics/builtin/graphics.py":2581
 *         else:
 *             self.content = content
 *             self.pos = pos             # <<<<<<<<<<<<<<
 *             self.opos = opos
 *         self.content_text = self.content.boxes_to_text(
 */
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_pos, __pyx_v_pos) < 0) __PYX_ERR(0, 2581, __pyx_L1_error)

    /* "mathics/builtin/graphics.py":2582
 *             self.content = content
 *             self.pos = pos
 *             self.opos = opos             # <<<<<<<<<<<<<<
 *         self.content_text = self.content.boxes_to_text(
 *             evaluation=self.graphics.evaluation
 */
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_opos, __pyx_v_opos) < 0) __PYX_ERR(0, 2582, __pyx_L1_error)
  }
  __pyx_L6:;

  /* "mathics/builtin/graphics.py":2583
 *             self.pos = pos
 *             self.opos = opos
 *         self.content_text = self.content.boxes_to_text(             # <<<<<<<<<<<<<<
 *             evaluation=self.graphics.evaluation
 *         )
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_content); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2583, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_boxes_to_text); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2583, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":2584
 *             self.opos = opos
 *         self.content_text = self.content.boxes_to_text(
 *             evaluation=self.graphics.evaluation             # <<<<<<<<<<<<<<
 *         )
 * 
 */
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2584, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_graphics); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2584, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_evaluation); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2584, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_evaluation, __pyx_t_2) < 0) __PYX_ERR(0, 2584, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":2583
 *             self.pos = pos
 *             self.opos = opos
 *         self.content_text = self.content.boxes_to_text(             # <<<<<<<<<<<<<<
 *             evaluation=self.graphics.evaluation
 *         )
 */
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2583, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_content_text, __pyx_t_2) < 0) __PYX_ERR(0, 2583, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":2559
 * 
 * class InsetBox(_GraphicsElement):
 *     def init(self, graphics, style, item=None, content=None, pos=None, opos=(0, 0)):             # <<<<<<<<<<<<<<
 *         super(InsetBox, self).init(graphics, item, style)
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("mathics.builtin.graphics.InsetBox.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v__);
  __Pyx_XDECREF(__pyx_v_content);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":2587
 *         )
 * 
 *     def extent(self):             # <<<<<<<<<<<<<<
 *         p = self.pos.pos()
 *         h = 25
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_8InsetBox_3extent(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_8InsetBox_3extent = {"extent", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_8InsetBox_3extent, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_8InsetBox_3extent(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("extent (wrapper)", 0);
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_8InsetBox_2extent(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_8InsetBox_2extent(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_p = NULL;
  PyObject *__pyx_v_h = NULL;
  PyObject *__pyx_v_w = NULL;
  PyObject *__pyx_v_opos = NULL;
  PyObject *__pyx_v_x = NULL;
  PyObject *__pyx_v_y = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("extent", 0);

  /* "mathics/builtin/graphics.py":2588
 * 
 *     def extent(self):
 *         p = self.pos.pos()             # <<<<<<<<<<<<<<
 *         h = 25
 *         w = len(self.content_text) * 7  # rough approximation by numbers of characters
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_pos); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2588, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pos); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2588, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2588, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_p = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":2589
 *     def extent(self):
 *         p = self.pos.pos()
 *         h = 25             # <<<<<<<<<<<<<<
 *         w = len(self.content_text) * 7  # rough approximation by numbers of characters
 *         opos = self.opos
 */
  __Pyx_INCREF(__pyx_int_25);
  __pyx_v_h = __pyx_int_25;

  /* "mathics/builtin/graphics.py":2590
 *         p = self.pos.pos()
 *         h = 25
 *         w = len(self.content_text) * 7  # rough approximation by numbers of characters             # <<<<<<<<<<<<<<
 *         opos = self.opos
 *         x = p[0] - w / 2.0 - opos[0] * w / 2.0
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_content_text); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2590, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2590, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyInt_FromSsize_t((__pyx_t_4 * 7)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2590, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_w = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":2591
 *         h = 25
 *         w = len(self.content_text) * 7  # rough approximation by numbers of characters
 *         opos = self.opos             # <<<<<<<<<<<<<<
 *         x = p[0] - w / 2.0 - opos[0] * w / 2.0
 *         y = p[1] - h / 2.0 + opos[1] * h / 2.0
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_opos); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2591, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_opos = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":2592
 *         w = len(self.content_text) * 7  # rough approximation by numbers of characters
 *         opos = self.opos
 *         x = p[0] - w / 2.0 - opos[0] * w / 2.0             # <<<<<<<<<<<<<<
 *         y = p[1] - h / 2.0 + opos[1] * h / 2.0
 *         return [(x, y), (x + w, y + h)]
 */
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_p, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2592, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyFloat_TrueDivideObjC(__pyx_v_w, __pyx_float_2_0, 2.0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2592, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyNumber_Subtract(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2592, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_opos, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2592, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyNumber_Multiply(__pyx_t_3, __pyx_v_w); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2592, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyFloat_TrueDivideObjC(__pyx_t_1, __pyx_float_2_0, 2.0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2592, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_Subtract(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2592, __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_v_x = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":2593
 *         opos = self.opos
 *         x = p[0] - w / 2.0 - opos[0] * w / 2.0
 *         y = p[1] - h / 2.0 + opos[1] * h / 2.0             # <<<<<<<<<<<<<<
 *         return [(x, y), (x + w, y + h)]
 * 
 */
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_p, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2593, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyFloat_TrueDivideObjC(__pyx_v_h, __pyx_float_2_0, 2.0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2593, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyNumber_Subtract(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2593, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_opos, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2593, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyNumber_Multiply(__pyx_t_3, __pyx_v_h); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2593, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyFloat_TrueDivideObjC(__pyx_t_1, __pyx_float_2_0, 2.0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2593, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2593, __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_v_y = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":2594
 *         x = p[0] - w / 2.0 - opos[0] * w / 2.0
 *         y = p[1] - h / 2.0 + opos[1] * h / 2.0
 *         return [(x, y), (x + w, y + h)]             # <<<<<<<<<<<<<<
 * 
 *     def to_svg(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2594, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_x);
  __Pyx_GIVEREF(__pyx_v_x);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_x);
  __Pyx_INCREF(__pyx_v_y);
  __Pyx_GIVEREF(__pyx_v_y);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_y);
  __pyx_t_3 = PyNumber_Add(__pyx_v_x, __pyx_v_w); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2594, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyNumber_Add(__pyx_v_y, __pyx_v_h); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2594, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2594, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
  __pyx_t_3 = 0;
  __pyx_t_2 = 0;
  __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2594, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_5);
  PyList_SET_ITEM(__pyx_t_2, 1, __pyx_t_5);
  __pyx_t_1 = 0;
  __pyx_t_5 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":2587
 *         )
 * 
 *     def extent(self):             # <<<<<<<<<<<<<<
 *         p = self.pos.pos()
 *         h = 25
 */

  /* 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("mathics.builtin.graphics.InsetBox.extent", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_p);
  __Pyx_XDECREF(__pyx_v_h);
  __Pyx_XDECREF(__pyx_v_w);
  __Pyx_XDECREF(__pyx_v_opos);
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XDECREF(__pyx_v_y);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":2596
 *         return [(x, y), (x + w, y + h)]
 * 
 *     def to_svg(self):             # <<<<<<<<<<<<<<
 *         x, y = self.pos.pos()
 *         content = self.content.boxes_to_xml(evaluation=self.graphics.evaluation)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_8InsetBox_5to_svg(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_8InsetBox_5to_svg = {"to_svg", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_8InsetBox_5to_svg, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_8InsetBox_5to_svg(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_svg (wrapper)", 0);
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_8InsetBox_4to_svg(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_8InsetBox_4to_svg(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_x = NULL;
  PyObject *__pyx_v_y = NULL;
  PyObject *__pyx_v_content = NULL;
  PyObject *__pyx_v_style = NULL;
  PyObject *__pyx_v_svg = 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 *);
  Py_ssize_t __pyx_t_6;
  Py_UCS4 __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_svg", 0);

  /* "mathics/builtin/graphics.py":2597
 * 
 *     def to_svg(self):
 *         x, y = self.pos.pos()             # <<<<<<<<<<<<<<
 *         content = self.content.boxes_to_xml(evaluation=self.graphics.evaluation)
 *         style = create_css(font_color=self.color)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_pos); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2597, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pos); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2597, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2597, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
    PyObject* sequence = __pyx_t_1;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 2597, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    #else
    __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2597, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2597, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2597, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 1; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) __PYX_ERR(0, 2597, __pyx_L1_error)
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 2597, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  __pyx_v_x = __pyx_t_3;
  __pyx_t_3 = 0;
  __pyx_v_y = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":2598
 *     def to_svg(self):
 *         x, y = self.pos.pos()
 *         content = self.content.boxes_to_xml(evaluation=self.graphics.evaluation)             # <<<<<<<<<<<<<<
 *         style = create_css(font_color=self.color)
 *         svg = (
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_content); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2598, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_boxes_to_xml); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2598, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2598, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_graphics); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2598, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_evaluation); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2598, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_evaluation, __pyx_t_4) < 0) __PYX_ERR(0, 2598, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2598, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_content = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":2599
 *         x, y = self.pos.pos()
 *         content = self.content.boxes_to_xml(evaluation=self.graphics.evaluation)
 *         style = create_css(font_color=self.color)             # <<<<<<<<<<<<<<
 *         svg = (
 *             '<foreignObject x="%f" y="%f" ox="%f" oy="%f" style="%s">'
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_create_css); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2599, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2599, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_color); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2599, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_font_color, __pyx_t_2) < 0) __PYX_ERR(0, 2599, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2599, __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_style = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":2601
 *         style = create_css(font_color=self.color)
 *         svg = (
 *             '<foreignObject x="%f" y="%f" ox="%f" oy="%f" style="%s">'             # <<<<<<<<<<<<<<
 *             "<math>%s</math></foreignObject>"
 *         ) % (x, y, self.opos[0], self.opos[1], style, content)
 */
  __pyx_t_2 = PyTuple_New(13); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2601, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = 0;
  __pyx_t_7 = 127;
  __Pyx_INCREF(__pyx_kp_u_foreignObject_x);
  __pyx_t_6 += 18;
  __Pyx_GIVEREF(__pyx_kp_u_foreignObject_x);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u_foreignObject_x);

  /* "mathics/builtin/graphics.py":2603
 *             '<foreignObject x="%f" y="%f" ox="%f" oy="%f" style="%s">'
 *             "<math>%s</math></foreignObject>"
 *         ) % (x, y, self.opos[0], self.opos[1], style, content)             # <<<<<<<<<<<<<<
 *         return svg
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_Format(__pyx_v_x, __pyx_n_u_f); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2603, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_7;
  __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
  __pyx_t_1 = 0;
  __Pyx_INCREF(__pyx_kp_u_y_2);
  __pyx_t_6 += 5;
  __Pyx_GIVEREF(__pyx_kp_u_y_2);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u_y_2);
  __pyx_t_1 = __Pyx_PyObject_Format(__pyx_v_y, __pyx_n_u_f); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2603, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_7;
  __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_1);
  __pyx_t_1 = 0;
  __Pyx_INCREF(__pyx_kp_u_ox_2);
  __pyx_t_6 += 6;
  __Pyx_GIVEREF(__pyx_kp_u_ox_2);
  PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_kp_u_ox_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_opos); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2603, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2603, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Format(__pyx_t_4, __pyx_n_u_f); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2603, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_7;
  __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 5, __pyx_t_1);
  __pyx_t_1 = 0;
  __Pyx_INCREF(__pyx_kp_u_oy_2);
  __pyx_t_6 += 6;
  __Pyx_GIVEREF(__pyx_kp_u_oy_2);
  PyTuple_SET_ITEM(__pyx_t_2, 6, __pyx_kp_u_oy_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_opos); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2603, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2603, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Format(__pyx_t_4, __pyx_n_u_f); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2603, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_7;
  __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 7, __pyx_t_1);
  __pyx_t_1 = 0;
  __Pyx_INCREF(__pyx_kp_u_style_2);
  __pyx_t_6 += 9;
  __Pyx_GIVEREF(__pyx_kp_u_style_2);
  PyTuple_SET_ITEM(__pyx_t_2, 8, __pyx_kp_u_style_2);
  __pyx_t_1 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_style), __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2603, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_7;
  __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 9, __pyx_t_1);
  __pyx_t_1 = 0;
  __Pyx_INCREF(__pyx_kp_u_math);
  __pyx_t_6 += 8;
  __Pyx_GIVEREF(__pyx_kp_u_math);
  PyTuple_SET_ITEM(__pyx_t_2, 10, __pyx_kp_u_math);
  __pyx_t_1 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_content), __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2603, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_7;
  __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 11, __pyx_t_1);
  __pyx_t_1 = 0;
  __Pyx_INCREF(__pyx_kp_u_math_foreignObject);
  __pyx_t_6 += 23;
  __Pyx_GIVEREF(__pyx_kp_u_math_foreignObject);
  PyTuple_SET_ITEM(__pyx_t_2, 12, __pyx_kp_u_math_foreignObject);

  /* "mathics/builtin/graphics.py":2601
 *         style = create_css(font_color=self.color)
 *         svg = (
 *             '<foreignObject x="%f" y="%f" ox="%f" oy="%f" style="%s">'             # <<<<<<<<<<<<<<
 *             "<math>%s</math></foreignObject>"
 *         ) % (x, y, self.opos[0], self.opos[1], style, content)
 */
  __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_2, 13, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2601, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_svg = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":2604
 *             "<math>%s</math></foreignObject>"
 *         ) % (x, y, self.opos[0], self.opos[1], style, content)
 *         return svg             # <<<<<<<<<<<<<<
 * 
 *     def to_asy(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_svg);
  __pyx_r = __pyx_v_svg;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":2596
 *         return [(x, y), (x + w, y + h)]
 * 
 *     def to_svg(self):             # <<<<<<<<<<<<<<
 *         x, y = self.pos.pos()
 *         content = self.content.boxes_to_xml(evaluation=self.graphics.evaluation)
 */

  /* 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("mathics.builtin.graphics.InsetBox.to_svg", __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_content);
  __Pyx_XDECREF(__pyx_v_style);
  __Pyx_XDECREF(__pyx_v_svg);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":2606
 *         return svg
 * 
 *     def to_asy(self):             # <<<<<<<<<<<<<<
 *         x, y = self.pos.pos()
 *         content = self.content.boxes_to_tex(evaluation=self.graphics.evaluation)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_8InsetBox_7to_asy(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_8InsetBox_7to_asy = {"to_asy", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_8InsetBox_7to_asy, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_8InsetBox_7to_asy(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_asy (wrapper)", 0);
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_8InsetBox_6to_asy(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_8InsetBox_6to_asy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_x = NULL;
  PyObject *__pyx_v_y = NULL;
  PyObject *__pyx_v_content = NULL;
  PyObject *__pyx_v_pen = NULL;
  PyObject *__pyx_v_asy = 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 *);
  Py_ssize_t __pyx_t_6;
  Py_UCS4 __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_asy", 0);

  /* "mathics/builtin/graphics.py":2607
 * 
 *     def to_asy(self):
 *         x, y = self.pos.pos()             # <<<<<<<<<<<<<<
 *         content = self.content.boxes_to_tex(evaluation=self.graphics.evaluation)
 *         pen = create_pens(edge_color=self.color)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_pos); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2607, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pos); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2607, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2607, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
    PyObject* sequence = __pyx_t_1;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 2607, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    #else
    __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2607, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2607, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2607, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 1; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) __PYX_ERR(0, 2607, __pyx_L1_error)
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 2607, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  __pyx_v_x = __pyx_t_3;
  __pyx_t_3 = 0;
  __pyx_v_y = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":2608
 *     def to_asy(self):
 *         x, y = self.pos.pos()
 *         content = self.content.boxes_to_tex(evaluation=self.graphics.evaluation)             # <<<<<<<<<<<<<<
 *         pen = create_pens(edge_color=self.color)
 *         asy = 'label("$%s$", (%s,%s), (%s,%s), %s);' % (
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_content); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2608, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_boxes_to_tex); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2608, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2608, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_graphics); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2608, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_evaluation); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2608, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_evaluation, __pyx_t_4) < 0) __PYX_ERR(0, 2608, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2608, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_content = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":2609
 *         x, y = self.pos.pos()
 *         content = self.content.boxes_to_tex(evaluation=self.graphics.evaluation)
 *         pen = create_pens(edge_color=self.color)             # <<<<<<<<<<<<<<
 *         asy = 'label("$%s$", (%s,%s), (%s,%s), %s);' % (
 *             content,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_create_pens); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2609, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2609, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_color); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2609, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_edge_color, __pyx_t_2) < 0) __PYX_ERR(0, 2609, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2609, __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_pen = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":2610
 *         content = self.content.boxes_to_tex(evaluation=self.graphics.evaluation)
 *         pen = create_pens(edge_color=self.color)
 *         asy = 'label("$%s$", (%s,%s), (%s,%s), %s);' % (             # <<<<<<<<<<<<<<
 *             content,
 *             x,
 */
  __pyx_t_2 = PyTuple_New(13); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2610, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = 0;
  __pyx_t_7 = 127;
  __Pyx_INCREF(__pyx_kp_u_label);
  __pyx_t_6 += 8;
  __Pyx_GIVEREF(__pyx_kp_u_label);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u_label);

  /* "mathics/builtin/graphics.py":2611
 *         pen = create_pens(edge_color=self.color)
 *         asy = 'label("$%s$", (%s,%s), (%s,%s), %s);' % (
 *             content,             # <<<<<<<<<<<<<<
 *             x,
 *             y,
 */
  __pyx_t_1 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_content), __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2611, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_7;
  __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
  __pyx_t_1 = 0;
  __Pyx_INCREF(__pyx_kp_u__108);
  __pyx_t_6 += 5;
  __Pyx_GIVEREF(__pyx_kp_u__108);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u__108);

  /* "mathics/builtin/graphics.py":2612
 *         asy = 'label("$%s$", (%s,%s), (%s,%s), %s);' % (
 *             content,
 *             x,             # <<<<<<<<<<<<<<
 *             y,
 *             -self.opos[0],
 */
  __pyx_t_1 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_x), __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2612, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_7;
  __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_1);
  __pyx_t_1 = 0;
  __Pyx_INCREF(__pyx_kp_u__31);
  __pyx_t_6 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__31);
  PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_kp_u__31);

  /* "mathics/builtin/graphics.py":2613
 *             content,
 *             x,
 *             y,             # <<<<<<<<<<<<<<
 *             -self.opos[0],
 *             -self.opos[1],
 */
  __pyx_t_1 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_y), __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2613, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_7;
  __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 5, __pyx_t_1);
  __pyx_t_1 = 0;
  __Pyx_INCREF(__pyx_kp_u__109);
  __pyx_t_6 += 4;
  __Pyx_GIVEREF(__pyx_kp_u__109);
  PyTuple_SET_ITEM(__pyx_t_2, 6, __pyx_kp_u__109);

  /* "mathics/builtin/graphics.py":2614
 *             x,
 *             y,
 *             -self.opos[0],             # <<<<<<<<<<<<<<
 *             -self.opos[1],
 *             pen,
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_opos); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2614, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2614, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_Negative(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2614, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_1), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2614, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_7;
  __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_2, 7, __pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_kp_u__31);
  __pyx_t_6 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__31);
  PyTuple_SET_ITEM(__pyx_t_2, 8, __pyx_kp_u__31);

  /* "mathics/builtin/graphics.py":2615
 *             y,
 *             -self.opos[0],
 *             -self.opos[1],             # <<<<<<<<<<<<<<
 *             pen,
 *         )
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_opos); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2615, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_4, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2615, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyNumber_Negative(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2615, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_4), __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2615, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_7;
  __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 9, __pyx_t_1);
  __pyx_t_1 = 0;
  __Pyx_INCREF(__pyx_kp_u__35);
  __pyx_t_6 += 3;
  __Pyx_GIVEREF(__pyx_kp_u__35);
  PyTuple_SET_ITEM(__pyx_t_2, 10, __pyx_kp_u__35);

  /* "mathics/builtin/graphics.py":2616
 *             -self.opos[0],
 *             -self.opos[1],
 *             pen,             # <<<<<<<<<<<<<<
 *         )
 *         return asy
 */
  __pyx_t_1 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_pen), __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2616, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_7;
  __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 11, __pyx_t_1);
  __pyx_t_1 = 0;
  __Pyx_INCREF(__pyx_kp_u__33);
  __pyx_t_6 += 2;
  __Pyx_GIVEREF(__pyx_kp_u__33);
  PyTuple_SET_ITEM(__pyx_t_2, 12, __pyx_kp_u__33);

  /* "mathics/builtin/graphics.py":2610
 *         content = self.content.boxes_to_tex(evaluation=self.graphics.evaluation)
 *         pen = create_pens(edge_color=self.color)
 *         asy = 'label("$%s$", (%s,%s), (%s,%s), %s);' % (             # <<<<<<<<<<<<<<
 *             content,
 *             x,
 */
  __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_2, 13, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2610, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_asy = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":2618
 *             pen,
 *         )
 *         return asy             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_asy);
  __pyx_r = __pyx_v_asy;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":2606
 *         return svg
 * 
 *     def to_asy(self):             # <<<<<<<<<<<<<<
 *         x, y = self.pos.pos()
 *         content = self.content.boxes_to_tex(evaluation=self.graphics.evaluation)
 */

  /* 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("mathics.builtin.graphics.InsetBox.to_asy", __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_content);
  __Pyx_XDECREF(__pyx_v_pen);
  __Pyx_XDECREF(__pyx_v_asy);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":2621
 * 
 * 
 * def total_extent(extents):             # <<<<<<<<<<<<<<
 *     xmin = xmax = ymin = ymax = None
 *     for extent in extents:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_43total_extent(PyObject *__pyx_self, PyObject *__pyx_v_extents); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_43total_extent = {"total_extent", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_43total_extent, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_43total_extent(PyObject *__pyx_self, PyObject *__pyx_v_extents) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("total_extent (wrapper)", 0);
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_42total_extent(__pyx_self, ((PyObject *)__pyx_v_extents));

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_42total_extent(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_extents) {
  PyObject *__pyx_v_xmin = NULL;
  PyObject *__pyx_v_xmax = NULL;
  PyObject *__pyx_v_ymin = NULL;
  PyObject *__pyx_v_ymax = NULL;
  PyObject *__pyx_v_extent = NULL;
  PyObject *__pyx_v_x = NULL;
  PyObject *__pyx_v_y = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  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;
  PyObject *(*__pyx_t_11)(PyObject *);
  int __pyx_t_12;
  int __pyx_t_13;
  int __pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("total_extent", 0);

  /* "mathics/builtin/graphics.py":2622
 * 
 * def total_extent(extents):
 *     xmin = xmax = ymin = ymax = None             # <<<<<<<<<<<<<<
 *     for extent in extents:
 *         for x, y in extent:
 */
  __Pyx_INCREF(Py_None);
  __pyx_v_xmin = Py_None;
  __Pyx_INCREF(Py_None);
  __pyx_v_xmax = Py_None;
  __Pyx_INCREF(Py_None);
  __pyx_v_ymin = Py_None;
  __Pyx_INCREF(Py_None);
  __pyx_v_ymax = Py_None;

  /* "mathics/builtin/graphics.py":2623
 * def total_extent(extents):
 *     xmin = xmax = ymin = ymax = None
 *     for extent in extents:             # <<<<<<<<<<<<<<
 *         for x, y in extent:
 *             if xmin is None or x < xmin:
 */
  if (likely(PyList_CheckExact(__pyx_v_extents)) || PyTuple_CheckExact(__pyx_v_extents)) {
    __pyx_t_1 = __pyx_v_extents; __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_extents); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2623, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2623, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 2623, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2623, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 2623, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2623, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 2623, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_extent, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "mathics/builtin/graphics.py":2624
 *     xmin = xmax = ymin = ymax = None
 *     for extent in extents:
 *         for x, y in extent:             # <<<<<<<<<<<<<<
 *             if xmin is None or x < xmin:
 *                 xmin = x
 */
    if (likely(PyList_CheckExact(__pyx_v_extent)) || PyTuple_CheckExact(__pyx_v_extent)) {
      __pyx_t_4 = __pyx_v_extent; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
      __pyx_t_6 = NULL;
    } else {
      __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_extent); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2624, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2624, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_6)) {
        if (likely(PyList_CheckExact(__pyx_t_4))) {
          if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 2624, __pyx_L1_error)
          #else
          __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2624, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          #endif
        } else {
          if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 2624, __pyx_L1_error)
          #else
          __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2624, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          #endif
        }
      } else {
        __pyx_t_7 = __pyx_t_6(__pyx_t_4);
        if (unlikely(!__pyx_t_7)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 2624, __pyx_L1_error)
          }
          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(0, 2624, __pyx_L1_error)
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_8 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_9 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_9);
        #else
        __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2624, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2624, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        #endif
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_10 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2624, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_11 = Py_TYPE(__pyx_t_10)->tp_iternext;
        index = 0; __pyx_t_8 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_8)) goto __pyx_L7_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_8);
        index = 1; __pyx_t_9 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_9)) goto __pyx_L7_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_9);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < 0) __PYX_ERR(0, 2624, __pyx_L1_error)
        __pyx_t_11 = NULL;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        goto __pyx_L8_unpacking_done;
        __pyx_L7_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_11 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        __PYX_ERR(0, 2624, __pyx_L1_error)
        __pyx_L8_unpacking_done:;
      }
      __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_8);
      __pyx_t_8 = 0;
      __Pyx_XDECREF_SET(__pyx_v_y, __pyx_t_9);
      __pyx_t_9 = 0;

      /* "mathics/builtin/graphics.py":2625
 *     for extent in extents:
 *         for x, y in extent:
 *             if xmin is None or x < xmin:             # <<<<<<<<<<<<<<
 *                 xmin = x
 *             if xmax is None or x > xmax:
 */
      __pyx_t_13 = (__pyx_v_xmin == Py_None);
      __pyx_t_14 = (__pyx_t_13 != 0);
      if (!__pyx_t_14) {
      } else {
        __pyx_t_12 = __pyx_t_14;
        goto __pyx_L10_bool_binop_done;
      }
      __pyx_t_7 = PyObject_RichCompare(__pyx_v_x, __pyx_v_xmin, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2625, __pyx_L1_error)
      __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 2625, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_12 = __pyx_t_14;
      __pyx_L10_bool_binop_done:;
      if (__pyx_t_12) {

        /* "mathics/builtin/graphics.py":2626
 *         for x, y in extent:
 *             if xmin is None or x < xmin:
 *                 xmin = x             # <<<<<<<<<<<<<<
 *             if xmax is None or x > xmax:
 *                 xmax = x
 */
        __Pyx_INCREF(__pyx_v_x);
        __Pyx_DECREF_SET(__pyx_v_xmin, __pyx_v_x);

        /* "mathics/builtin/graphics.py":2625
 *     for extent in extents:
 *         for x, y in extent:
 *             if xmin is None or x < xmin:             # <<<<<<<<<<<<<<
 *                 xmin = x
 *             if xmax is None or x > xmax:
 */
      }

      /* "mathics/builtin/graphics.py":2627
 *             if xmin is None or x < xmin:
 *                 xmin = x
 *             if xmax is None or x > xmax:             # <<<<<<<<<<<<<<
 *                 xmax = x
 *             if ymin is None or y < ymin:
 */
      __pyx_t_14 = (__pyx_v_xmax == Py_None);
      __pyx_t_13 = (__pyx_t_14 != 0);
      if (!__pyx_t_13) {
      } else {
        __pyx_t_12 = __pyx_t_13;
        goto __pyx_L13_bool_binop_done;
      }
      __pyx_t_7 = PyObject_RichCompare(__pyx_v_x, __pyx_v_xmax, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2627, __pyx_L1_error)
      __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 2627, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_12 = __pyx_t_13;
      __pyx_L13_bool_binop_done:;
      if (__pyx_t_12) {

        /* "mathics/builtin/graphics.py":2628
 *                 xmin = x
 *             if xmax is None or x > xmax:
 *                 xmax = x             # <<<<<<<<<<<<<<
 *             if ymin is None or y < ymin:
 *                 ymin = y
 */
        __Pyx_INCREF(__pyx_v_x);
        __Pyx_DECREF_SET(__pyx_v_xmax, __pyx_v_x);

        /* "mathics/builtin/graphics.py":2627
 *             if xmin is None or x < xmin:
 *                 xmin = x
 *             if xmax is None or x > xmax:             # <<<<<<<<<<<<<<
 *                 xmax = x
 *             if ymin is None or y < ymin:
 */
      }

      /* "mathics/builtin/graphics.py":2629
 *             if xmax is None or x > xmax:
 *                 xmax = x
 *             if ymin is None or y < ymin:             # <<<<<<<<<<<<<<
 *                 ymin = y
 *             if ymax is None or y > ymax:
 */
      __pyx_t_13 = (__pyx_v_ymin == Py_None);
      __pyx_t_14 = (__pyx_t_13 != 0);
      if (!__pyx_t_14) {
      } else {
        __pyx_t_12 = __pyx_t_14;
        goto __pyx_L16_bool_binop_done;
      }
      __pyx_t_7 = PyObject_RichCompare(__pyx_v_y, __pyx_v_ymin, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2629, __pyx_L1_error)
      __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 2629, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_12 = __pyx_t_14;
      __pyx_L16_bool_binop_done:;
      if (__pyx_t_12) {

        /* "mathics/builtin/graphics.py":2630
 *                 xmax = x
 *             if ymin is None or y < ymin:
 *                 ymin = y             # <<<<<<<<<<<<<<
 *             if ymax is None or y > ymax:
 *                 ymax = y
 */
        __Pyx_INCREF(__pyx_v_y);
        __Pyx_DECREF_SET(__pyx_v_ymin, __pyx_v_y);

        /* "mathics/builtin/graphics.py":2629
 *             if xmax is None or x > xmax:
 *                 xmax = x
 *             if ymin is None or y < ymin:             # <<<<<<<<<<<<<<
 *                 ymin = y
 *             if ymax is None or y > ymax:
 */
      }

      /* "mathics/builtin/graphics.py":2631
 *             if ymin is None or y < ymin:
 *                 ymin = y
 *             if ymax is None or y > ymax:             # <<<<<<<<<<<<<<
 *                 ymax = y
 *     return xmin, xmax, ymin, ymax
 */
      __pyx_t_14 = (__pyx_v_ymax == Py_None);
      __pyx_t_13 = (__pyx_t_14 != 0);
      if (!__pyx_t_13) {
      } else {
        __pyx_t_12 = __pyx_t_13;
        goto __pyx_L19_bool_binop_done;
      }
      __pyx_t_7 = PyObject_RichCompare(__pyx_v_y, __pyx_v_ymax, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2631, __pyx_L1_error)
      __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 2631, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_12 = __pyx_t_13;
      __pyx_L19_bool_binop_done:;
      if (__pyx_t_12) {

        /* "mathics/builtin/graphics.py":2632
 *                 ymin = y
 *             if ymax is None or y > ymax:
 *                 ymax = y             # <<<<<<<<<<<<<<
 *     return xmin, xmax, ymin, ymax
 * 
 */
        __Pyx_INCREF(__pyx_v_y);
        __Pyx_DECREF_SET(__pyx_v_ymax, __pyx_v_y);

        /* "mathics/builtin/graphics.py":2631
 *             if ymin is None or y < ymin:
 *                 ymin = y
 *             if ymax is None or y > ymax:             # <<<<<<<<<<<<<<
 *                 ymax = y
 *     return xmin, xmax, ymin, ymax
 */
      }

      /* "mathics/builtin/graphics.py":2624
 *     xmin = xmax = ymin = ymax = None
 *     for extent in extents:
 *         for x, y in extent:             # <<<<<<<<<<<<<<
 *             if xmin is None or x < xmin:
 *                 xmin = x
 */
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "mathics/builtin/graphics.py":2623
 * def total_extent(extents):
 *     xmin = xmax = ymin = ymax = None
 *     for extent in extents:             # <<<<<<<<<<<<<<
 *         for x, y in extent:
 *             if xmin is None or x < xmin:
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":2633
 *             if ymax is None or y > ymax:
 *                 ymax = y
 *     return xmin, xmax, ymin, ymax             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2633, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_xmin);
  __Pyx_GIVEREF(__pyx_v_xmin);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_xmin);
  __Pyx_INCREF(__pyx_v_xmax);
  __Pyx_GIVEREF(__pyx_v_xmax);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_xmax);
  __Pyx_INCREF(__pyx_v_ymin);
  __Pyx_GIVEREF(__pyx_v_ymin);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_ymin);
  __Pyx_INCREF(__pyx_v_ymax);
  __Pyx_GIVEREF(__pyx_v_ymax);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_ymax);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":2621
 * 
 * 
 * def total_extent(extents):             # <<<<<<<<<<<<<<
 *     xmin = xmax = ymin = ymax = None
 *     for extent in extents:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("mathics.builtin.graphics.total_extent", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_xmin);
  __Pyx_XDECREF(__pyx_v_xmax);
  __Pyx_XDECREF(__pyx_v_ymin);
  __Pyx_XDECREF(__pyx_v_ymax);
  __Pyx_XDECREF(__pyx_v_extent);
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XDECREF(__pyx_v_y);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":2652
 * 
 * 
 * def _style(graphics, item):             # <<<<<<<<<<<<<<
 *     head = item.get_head_name()
 *     if head in style_heads:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_45_style(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_45_style = {"_style", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_45_style, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_45_style(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_graphics = 0;
  PyObject *__pyx_v_item = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_style (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_graphics,&__pyx_n_s_item,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_graphics)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_item)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_style", 1, 2, 2, 1); __PYX_ERR(0, 2652, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_style") < 0)) __PYX_ERR(0, 2652, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_graphics = values[0];
    __pyx_v_item = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_style", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2652, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics._style", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_44_style(__pyx_self, __pyx_v_graphics, __pyx_v_item);

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_44_style(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_graphics, PyObject *__pyx_v_item) {
  PyObject *__pyx_v_head = NULL;
  PyObject *__pyx_v_klass = NULL;
  PyObject *__pyx_v_style = NULL;
  PyObject *__pyx_v_dir = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_style", 0);

  /* "mathics/builtin/graphics.py":2653
 * 
 * def _style(graphics, item):
 *     head = item.get_head_name()             # <<<<<<<<<<<<<<
 *     if head in style_heads:
 *         klass = get_class(head)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_item, __pyx_n_s_get_head_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2653, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2653, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_head = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":2654
 * def _style(graphics, item):
 *     head = item.get_head_name()
 *     if head in style_heads:             # <<<<<<<<<<<<<<
 *         klass = get_class(head)
 *         style = klass.create_as_style(klass, graphics, item)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_style_heads); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2654, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_v_head, __pyx_t_1, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 2654, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (__pyx_t_5) {

    /* "mathics/builtin/graphics.py":2655
 *     head = item.get_head_name()
 *     if head in style_heads:
 *         klass = get_class(head)             # <<<<<<<<<<<<<<
 *         style = klass.create_as_style(klass, graphics, item)
 *     elif head in ("System`EdgeForm", "System`FaceForm"):
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_get_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2655, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_head) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_head);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2655, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_klass = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "mathics/builtin/graphics.py":2656
 *     if head in style_heads:
 *         klass = get_class(head)
 *         style = klass.create_as_style(klass, graphics, item)             # <<<<<<<<<<<<<<
 *     elif head in ("System`EdgeForm", "System`FaceForm"):
 *         style = graphics.get_style_class()(
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_klass, __pyx_n_s_create_as_style); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2656, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    __pyx_t_6 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_6 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_klass, __pyx_v_graphics, __pyx_v_item};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2656, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_klass, __pyx_v_graphics, __pyx_v_item};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2656, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    {
      __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2656, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (__pyx_t_3) {
        __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __pyx_t_3 = NULL;
      }
      __Pyx_INCREF(__pyx_v_klass);
      __Pyx_GIVEREF(__pyx_v_klass);
      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_klass);
      __Pyx_INCREF(__pyx_v_graphics);
      __Pyx_GIVEREF(__pyx_v_graphics);
      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_graphics);
      __Pyx_INCREF(__pyx_v_item);
      __Pyx_GIVEREF(__pyx_v_item);
      PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_v_item);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2656, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_style = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "mathics/builtin/graphics.py":2654
 * def _style(graphics, item):
 *     head = item.get_head_name()
 *     if head in style_heads:             # <<<<<<<<<<<<<<
 *         klass = get_class(head)
 *         style = klass.create_as_style(klass, graphics, item)
 */
    goto __pyx_L3;
  }

  /* "mathics/builtin/graphics.py":2657
 *         klass = get_class(head)
 *         style = klass.create_as_style(klass, graphics, item)
 *     elif head in ("System`EdgeForm", "System`FaceForm"):             # <<<<<<<<<<<<<<
 *         style = graphics.get_style_class()(
 *             graphics, edge=head == "System`EdgeForm", face=head == "System`FaceForm"
 */
  __Pyx_INCREF(__pyx_v_head);
  __pyx_t_1 = __pyx_v_head;
  __pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_System_EdgeForm, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 2657, __pyx_L1_error)
  if (!__pyx_t_4) {
  } else {
    __pyx_t_5 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_System_FaceForm, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 2657, __pyx_L1_error)
  __pyx_t_5 = __pyx_t_4;
  __pyx_L4_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = (__pyx_t_5 != 0);
  if (likely(__pyx_t_4)) {

    /* "mathics/builtin/graphics.py":2658
 *         style = klass.create_as_style(klass, graphics, item)
 *     elif head in ("System`EdgeForm", "System`FaceForm"):
 *         style = graphics.get_style_class()(             # <<<<<<<<<<<<<<
 *             graphics, edge=head == "System`EdgeForm", face=head == "System`FaceForm"
 *         )
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_graphics, __pyx_n_s_get_style_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2658, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2658, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "mathics/builtin/graphics.py":2659
 *     elif head in ("System`EdgeForm", "System`FaceForm"):
 *         style = graphics.get_style_class()(
 *             graphics, edge=head == "System`EdgeForm", face=head == "System`FaceForm"             # <<<<<<<<<<<<<<
 *         )
 *         if len(item.leaves) > 1:
 */
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2658, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_graphics);
    __Pyx_GIVEREF(__pyx_v_graphics);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_graphics);
    __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2659, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_3 = PyObject_RichCompare(__pyx_v_head, __pyx_kp_u_System_EdgeForm, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2659, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_edge, __pyx_t_3) < 0) __PYX_ERR(0, 2659, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_RichCompare(__pyx_v_head, __pyx_kp_u_System_FaceForm, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2659, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_face, __pyx_t_3) < 0) __PYX_ERR(0, 2659, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "mathics/builtin/graphics.py":2658
 *         style = klass.create_as_style(klass, graphics, item)
 *     elif head in ("System`EdgeForm", "System`FaceForm"):
 *         style = graphics.get_style_class()(             # <<<<<<<<<<<<<<
 *             graphics, edge=head == "System`EdgeForm", face=head == "System`FaceForm"
 *         )
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2658, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_v_style = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "mathics/builtin/graphics.py":2661
 *             graphics, edge=head == "System`EdgeForm", face=head == "System`FaceForm"
 *         )
 *         if len(item.leaves) > 1:             # <<<<<<<<<<<<<<
 *             raise BoxConstructError
 *         if item.leaves:
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_item, __pyx_n_s_leaves); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2661, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2661, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_4 = ((__pyx_t_8 > 1) != 0);
    if (unlikely(__pyx_t_4)) {

      /* "mathics/builtin/graphics.py":2662
 *         )
 *         if len(item.leaves) > 1:
 *             raise BoxConstructError             # <<<<<<<<<<<<<<
 *         if item.leaves:
 *             if item.leaves[0].has_form("List", None):
 */
      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_BoxConstructError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2662, __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(0, 2662, __pyx_L1_error)

      /* "mathics/builtin/graphics.py":2661
 *             graphics, edge=head == "System`EdgeForm", face=head == "System`FaceForm"
 *         )
 *         if len(item.leaves) > 1:             # <<<<<<<<<<<<<<
 *             raise BoxConstructError
 *         if item.leaves:
 */
    }

    /* "mathics/builtin/graphics.py":2663
 *         if len(item.leaves) > 1:
 *             raise BoxConstructError
 *         if item.leaves:             # <<<<<<<<<<<<<<
 *             if item.leaves[0].has_form("List", None):
 *                 for dir in item.leaves[0].leaves:
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_item, __pyx_n_s_leaves); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2663, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 2663, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_4) {

      /* "mathics/builtin/graphics.py":2664
 *             raise BoxConstructError
 *         if item.leaves:
 *             if item.leaves[0].has_form("List", None):             # <<<<<<<<<<<<<<
 *                 for dir in item.leaves[0].leaves:
 *                     style.append(dir, allow_forms=False)
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_item, __pyx_n_s_leaves); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2664, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2664, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_has_form); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2664, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2664, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 2664, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (__pyx_t_4) {

        /* "mathics/builtin/graphics.py":2665
 *         if item.leaves:
 *             if item.leaves[0].has_form("List", None):
 *                 for dir in item.leaves[0].leaves:             # <<<<<<<<<<<<<<
 *                     style.append(dir, allow_forms=False)
 *             else:
 */
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_item, __pyx_n_s_leaves); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2665, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_7, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2665, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_leaves); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2665, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (likely(PyList_CheckExact(__pyx_t_7)) || PyTuple_CheckExact(__pyx_t_7)) {
          __pyx_t_3 = __pyx_t_7; __Pyx_INCREF(__pyx_t_3); __pyx_t_8 = 0;
          __pyx_t_9 = NULL;
        } else {
          __pyx_t_8 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2665, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_9 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2665, __pyx_L1_error)
        }
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        for (;;) {
          if (likely(!__pyx_t_9)) {
            if (likely(PyList_CheckExact(__pyx_t_3))) {
              if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_3)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_7 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_8); __Pyx_INCREF(__pyx_t_7); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 2665, __pyx_L1_error)
              #else
              __pyx_t_7 = PySequence_ITEM(__pyx_t_3, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2665, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_7);
              #endif
            } else {
              if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_8); __Pyx_INCREF(__pyx_t_7); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 2665, __pyx_L1_error)
              #else
              __pyx_t_7 = PySequence_ITEM(__pyx_t_3, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2665, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_7);
              #endif
            }
          } else {
            __pyx_t_7 = __pyx_t_9(__pyx_t_3);
            if (unlikely(!__pyx_t_7)) {
              PyObject* exc_type = PyErr_Occurred();
              if (exc_type) {
                if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                else __PYX_ERR(0, 2665, __pyx_L1_error)
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_7);
          }
          __Pyx_XDECREF_SET(__pyx_v_dir, __pyx_t_7);
          __pyx_t_7 = 0;

          /* "mathics/builtin/graphics.py":2666
 *             if item.leaves[0].has_form("List", None):
 *                 for dir in item.leaves[0].leaves:
 *                     style.append(dir, allow_forms=False)             # <<<<<<<<<<<<<<
 *             else:
 *                 style.append(item.leaves[0], allow_forms=False)
 */
          __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_style, __pyx_n_s_append); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2666, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2666, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_INCREF(__pyx_v_dir);
          __Pyx_GIVEREF(__pyx_v_dir);
          PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_dir);
          __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2666, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_allow_forms, Py_False) < 0) __PYX_ERR(0, 2666, __pyx_L1_error)
          __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2666, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

          /* "mathics/builtin/graphics.py":2665
 *         if item.leaves:
 *             if item.leaves[0].has_form("List", None):
 *                 for dir in item.leaves[0].leaves:             # <<<<<<<<<<<<<<
 *                     style.append(dir, allow_forms=False)
 *             else:
 */
        }
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

        /* "mathics/builtin/graphics.py":2664
 *             raise BoxConstructError
 *         if item.leaves:
 *             if item.leaves[0].has_form("List", None):             # <<<<<<<<<<<<<<
 *                 for dir in item.leaves[0].leaves:
 *                     style.append(dir, allow_forms=False)
 */
        goto __pyx_L8;
      }

      /* "mathics/builtin/graphics.py":2668
 *                     style.append(dir, allow_forms=False)
 *             else:
 *                 style.append(item.leaves[0], allow_forms=False)             # <<<<<<<<<<<<<<
 *     else:
 *         raise BoxConstructError
 */
      /*else*/ {
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_style, __pyx_n_s_append); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2668, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_item, __pyx_n_s_leaves); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2668, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_10, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2668, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2668, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_GIVEREF(__pyx_t_1);
        PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1);
        __pyx_t_1 = 0;
        __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2668, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_allow_forms, Py_False) < 0) __PYX_ERR(0, 2668, __pyx_L1_error)
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_10, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2668, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      }
      __pyx_L8:;

      /* "mathics/builtin/graphics.py":2663
 *         if len(item.leaves) > 1:
 *             raise BoxConstructError
 *         if item.leaves:             # <<<<<<<<<<<<<<
 *             if item.leaves[0].has_form("List", None):
 *                 for dir in item.leaves[0].leaves:
 */
    }

    /* "mathics/builtin/graphics.py":2657
 *         klass = get_class(head)
 *         style = klass.create_as_style(klass, graphics, item)
 *     elif head in ("System`EdgeForm", "System`FaceForm"):             # <<<<<<<<<<<<<<
 *         style = graphics.get_style_class()(
 *             graphics, edge=head == "System`EdgeForm", face=head == "System`FaceForm"
 */
    goto __pyx_L3;
  }

  /* "mathics/builtin/graphics.py":2670
 *                 style.append(item.leaves[0], allow_forms=False)
 *     else:
 *         raise BoxConstructError             # <<<<<<<<<<<<<<
 *     return style
 * 
 */
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_BoxConstructError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2670, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 2670, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "mathics/builtin/graphics.py":2671
 *     else:
 *         raise BoxConstructError
 *     return style             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_style);
  __pyx_r = __pyx_v_style;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":2652
 * 
 * 
 * def _style(graphics, item):             # <<<<<<<<<<<<<<
 *     head = item.get_head_name()
 *     if head in style_heads:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("mathics.builtin.graphics._style", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_head);
  __Pyx_XDECREF(__pyx_v_klass);
  __Pyx_XDECREF(__pyx_v_style);
  __Pyx_XDECREF(__pyx_v_dir);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":2675
 * 
 * class Style(object):
 *     def __init__(self, graphics, edge=False, face=False):             # <<<<<<<<<<<<<<
 *         self.styles = []
 *         self.options = {}
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_5Style_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_5Style_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_5Style_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_5Style_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_graphics = 0;
  PyObject *__pyx_v_edge = 0;
  PyObject *__pyx_v_face = 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);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_graphics,&__pyx_n_s_edge,&__pyx_n_s_face,0};
    PyObject* values[4] = {0,0,0,0};
    values[2] = ((PyObject *)((PyObject *)Py_False));
    values[3] = ((PyObject *)((PyObject *)Py_False));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_graphics)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, 1); __PYX_ERR(0, 2675, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edge);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_face);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 2675, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_graphics = values[1];
    __pyx_v_edge = values[2];
    __pyx_v_face = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2675, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.Style.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_5Style___init__(__pyx_self, __pyx_v_self, __pyx_v_graphics, __pyx_v_edge, __pyx_v_face);

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_5Style___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_graphics, PyObject *__pyx_v_edge, PyObject *__pyx_v_face) {
  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("__init__", 0);

  /* "mathics/builtin/graphics.py":2676
 * class Style(object):
 *     def __init__(self, graphics, edge=False, face=False):
 *         self.styles = []             # <<<<<<<<<<<<<<
 *         self.options = {}
 *         self.graphics = graphics
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2676, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_styles, __pyx_t_1) < 0) __PYX_ERR(0, 2676, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":2677
 *     def __init__(self, graphics, edge=False, face=False):
 *         self.styles = []
 *         self.options = {}             # <<<<<<<<<<<<<<
 *         self.graphics = graphics
 *         self.edge = edge
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2677, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_options, __pyx_t_1) < 0) __PYX_ERR(0, 2677, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":2678
 *         self.styles = []
 *         self.options = {}
 *         self.graphics = graphics             # <<<<<<<<<<<<<<
 *         self.edge = edge
 *         self.face = face
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_graphics, __pyx_v_graphics) < 0) __PYX_ERR(0, 2678, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2679
 *         self.options = {}
 *         self.graphics = graphics
 *         self.edge = edge             # <<<<<<<<<<<<<<
 *         self.face = face
 *         self.klass = graphics.get_style_class()
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_edge, __pyx_v_edge) < 0) __PYX_ERR(0, 2679, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2680
 *         self.graphics = graphics
 *         self.edge = edge
 *         self.face = face             # <<<<<<<<<<<<<<
 *         self.klass = graphics.get_style_class()
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_face, __pyx_v_face) < 0) __PYX_ERR(0, 2680, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2681
 *         self.edge = edge
 *         self.face = face
 *         self.klass = graphics.get_style_class()             # <<<<<<<<<<<<<<
 * 
 *     def append(self, item, allow_forms=True):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_graphics, __pyx_n_s_get_style_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2681, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2681, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_klass, __pyx_t_1) < 0) __PYX_ERR(0, 2681, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":2675
 * 
 * class Style(object):
 *     def __init__(self, graphics, edge=False, face=False):             # <<<<<<<<<<<<<<
 *         self.styles = []
 *         self.options = {}
 */

  /* 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("mathics.builtin.graphics.Style.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":2683
 *         self.klass = graphics.get_style_class()
 * 
 *     def append(self, item, allow_forms=True):             # <<<<<<<<<<<<<<
 *         self.styles.append(_style(self.graphics, item))
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_5Style_3append(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_5Style_3append = {"append", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_5Style_3append, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_5Style_3append(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_item = 0;
  CYTHON_UNUSED PyObject *__pyx_v_allow_forms = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("append (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_item,&__pyx_n_s_allow_forms,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject *)((PyObject *)Py_True));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_item)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("append", 0, 2, 3, 1); __PYX_ERR(0, 2683, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allow_forms);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "append") < 0)) __PYX_ERR(0, 2683, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_item = values[1];
    __pyx_v_allow_forms = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("append", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2683, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.Style.append", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_5Style_2append(__pyx_self, __pyx_v_self, __pyx_v_item, __pyx_v_allow_forms);

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_5Style_2append(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_item, CYTHON_UNUSED PyObject *__pyx_v_allow_forms) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("append", 0);

  /* "mathics/builtin/graphics.py":2684
 * 
 *     def append(self, item, allow_forms=True):
 *         self.styles.append(_style(self.graphics, item))             # <<<<<<<<<<<<<<
 * 
 *     def set_option(self, name, value):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_styles); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2684, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_style_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2684, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_graphics); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2684, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_6 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_4, __pyx_v_item};
    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2684, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_4, __pyx_v_item};
    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2684, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else
  #endif
  {
    __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2684, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_5) {
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_4);
    __Pyx_INCREF(__pyx_v_item);
    __Pyx_GIVEREF(__pyx_v_item);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_item);
    __pyx_t_4 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2684, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_2); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 2684, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":2683
 *         self.klass = graphics.get_style_class()
 * 
 *     def append(self, item, allow_forms=True):             # <<<<<<<<<<<<<<
 *         self.styles.append(_style(self.graphics, item))
 * 
 */

  /* 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_7);
  __Pyx_AddTraceback("mathics.builtin.graphics.Style.append", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":2686
 *         self.styles.append(_style(self.graphics, item))
 * 
 *     def set_option(self, name, value):             # <<<<<<<<<<<<<<
 *         self.options[name] = value
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_5Style_5set_option(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_5Style_5set_option = {"set_option", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_5Style_5set_option, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_5Style_5set_option(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_option (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_name,&__pyx_n_s_value,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_option", 1, 3, 3, 1); __PYX_ERR(0, 2686, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_option", 1, 3, 3, 2); __PYX_ERR(0, 2686, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_option") < 0)) __PYX_ERR(0, 2686, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_self = values[0];
    __pyx_v_name = values[1];
    __pyx_v_value = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_option", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2686, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.Style.set_option", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_5Style_4set_option(__pyx_self, __pyx_v_self, __pyx_v_name, __pyx_v_value);

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_5Style_4set_option(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_option", 0);

  /* "mathics/builtin/graphics.py":2687
 * 
 *     def set_option(self, name, value):
 *         self.options[name] = value             # <<<<<<<<<<<<<<
 * 
 *     def extend(self, style, pre=True):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_options); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2687, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_name, __pyx_v_value) < 0)) __PYX_ERR(0, 2687, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":2686
 *         self.styles.append(_style(self.graphics, item))
 * 
 *     def set_option(self, name, value):             # <<<<<<<<<<<<<<
 *         self.options[name] = value
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("mathics.builtin.graphics.Style.set_option", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":2689
 *         self.options[name] = value
 * 
 *     def extend(self, style, pre=True):             # <<<<<<<<<<<<<<
 *         if pre:
 *             self.styles = style.styles + self.styles
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_5Style_7extend(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_5Style_7extend = {"extend", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_5Style_7extend, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_5Style_7extend(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_style = 0;
  PyObject *__pyx_v_pre = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("extend (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_style,&__pyx_n_s_pre,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject *)((PyObject *)Py_True));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_style)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("extend", 0, 2, 3, 1); __PYX_ERR(0, 2689, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pre);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "extend") < 0)) __PYX_ERR(0, 2689, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_style = values[1];
    __pyx_v_pre = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("extend", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2689, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.Style.extend", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_5Style_6extend(__pyx_self, __pyx_v_self, __pyx_v_style, __pyx_v_pre);

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_5Style_6extend(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_style, PyObject *__pyx_v_pre) {
  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("extend", 0);

  /* "mathics/builtin/graphics.py":2690
 * 
 *     def extend(self, style, pre=True):
 *         if pre:             # <<<<<<<<<<<<<<
 *             self.styles = style.styles + self.styles
 *         else:
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_pre); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 2690, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "mathics/builtin/graphics.py":2691
 *     def extend(self, style, pre=True):
 *         if pre:
 *             self.styles = style.styles + self.styles             # <<<<<<<<<<<<<<
 *         else:
 *             self.styles.extend(style.styles)
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_style, __pyx_n_s_styles); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2691, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_styles); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2691, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyNumber_Add(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2691, __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;
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_styles, __pyx_t_4) < 0) __PYX_ERR(0, 2691, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "mathics/builtin/graphics.py":2690
 * 
 *     def extend(self, style, pre=True):
 *         if pre:             # <<<<<<<<<<<<<<
 *             self.styles = style.styles + self.styles
 *         else:
 */
    goto __pyx_L3;
  }

  /* "mathics/builtin/graphics.py":2693
 *             self.styles = style.styles + self.styles
 *         else:
 *             self.styles.extend(style.styles)             # <<<<<<<<<<<<<<
 * 
 *     def clone(self):
 */
  /*else*/ {
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_styles); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2693, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_extend); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2693, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_style, __pyx_n_s_styles); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2693, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2693, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __pyx_L3:;

  /* "mathics/builtin/graphics.py":2689
 *         self.options[name] = value
 * 
 *     def extend(self, style, pre=True):             # <<<<<<<<<<<<<<
 *         if pre:
 *             self.styles = style.styles + self.styles
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("mathics.builtin.graphics.Style.extend", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":2695
 *             self.styles.extend(style.styles)
 * 
 *     def clone(self):             # <<<<<<<<<<<<<<
 *         result = self.klass(self.graphics, edge=self.edge, face=self.face)
 *         result.styles = self.styles[:]
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_5Style_9clone(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_5Style_9clone = {"clone", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_5Style_9clone, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_5Style_9clone(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("clone (wrapper)", 0);
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_5Style_8clone(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_5Style_8clone(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("clone", 0);

  /* "mathics/builtin/graphics.py":2696
 * 
 *     def clone(self):
 *         result = self.klass(self.graphics, edge=self.edge, face=self.face)             # <<<<<<<<<<<<<<
 *         result.styles = self.styles[:]
 *         result.options = self.options.copy()
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_klass); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2696, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_graphics); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2696, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2696, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2696, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_edge); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2696, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_edge, __pyx_t_4) < 0) __PYX_ERR(0, 2696, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_face); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2696, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_face, __pyx_t_4) < 0) __PYX_ERR(0, 2696, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2696, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_result = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":2697
 *     def clone(self):
 *         result = self.klass(self.graphics, edge=self.edge, face=self.face)
 *         result.styles = self.styles[:]             # <<<<<<<<<<<<<<
 *         result.options = self.options.copy()
 *         return result
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_styles); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2697, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_t_4, 0, 0, NULL, NULL, &__pyx_slice__87, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2697, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_result, __pyx_n_s_styles, __pyx_t_2) < 0) __PYX_ERR(0, 2697, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":2698
 *         result = self.klass(self.graphics, edge=self.edge, face=self.face)
 *         result.styles = self.styles[:]
 *         result.options = self.options.copy()             # <<<<<<<<<<<<<<
 *         return result
 * 
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_options); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2698, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2698, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2698, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_result, __pyx_n_s_options, __pyx_t_2) < 0) __PYX_ERR(0, 2698, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":2699
 *         result.styles = self.styles[:]
 *         result.options = self.options.copy()
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     def get_default_face_color(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":2695
 *             self.styles.extend(style.styles)
 * 
 *     def clone(self):             # <<<<<<<<<<<<<<
 *         result = self.klass(self.graphics, edge=self.edge, face=self.face)
 *         result.styles = self.styles[:]
 */

  /* 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("mathics.builtin.graphics.Style.clone", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":2701
 *         return result
 * 
 *     def get_default_face_color(self):             # <<<<<<<<<<<<<<
 *         return RGBColor(components=(0, 0, 0, 1))
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_5Style_11get_default_face_color(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_5Style_11get_default_face_color = {"get_default_face_color", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_5Style_11get_default_face_color, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_5Style_11get_default_face_color(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_default_face_color (wrapper)", 0);
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_5Style_10get_default_face_color(__pyx_self, ((PyObject *)__pyx_v_self));

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

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

  /* "mathics/builtin/graphics.py":2702
 * 
 *     def get_default_face_color(self):
 *         return RGBColor(components=(0, 0, 0, 1))             # <<<<<<<<<<<<<<
 * 
 *     def get_default_edge_color(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_RGBColor); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2702, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2702, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_components, __pyx_tuple__110) < 0) __PYX_ERR(0, 2702, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2702, __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;

  /* "mathics/builtin/graphics.py":2701
 *         return result
 * 
 *     def get_default_face_color(self):             # <<<<<<<<<<<<<<
 *         return RGBColor(components=(0, 0, 0, 1))
 * 
 */

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

/* "mathics/builtin/graphics.py":2704
 *         return RGBColor(components=(0, 0, 0, 1))
 * 
 *     def get_default_edge_color(self):             # <<<<<<<<<<<<<<
 *         return RGBColor(components=(0, 0, 0, 1))
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_5Style_13get_default_edge_color(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_5Style_13get_default_edge_color = {"get_default_edge_color", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_5Style_13get_default_edge_color, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_5Style_13get_default_edge_color(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_default_edge_color (wrapper)", 0);
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_5Style_12get_default_edge_color(__pyx_self, ((PyObject *)__pyx_v_self));

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

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

  /* "mathics/builtin/graphics.py":2705
 * 
 *     def get_default_edge_color(self):
 *         return RGBColor(components=(0, 0, 0, 1))             # <<<<<<<<<<<<<<
 * 
 *     def get_style(
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_RGBColor); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2705, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2705, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_components, __pyx_tuple__110) < 0) __PYX_ERR(0, 2705, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2705, __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;

  /* "mathics/builtin/graphics.py":2704
 *         return RGBColor(components=(0, 0, 0, 1))
 * 
 *     def get_default_edge_color(self):             # <<<<<<<<<<<<<<
 *         return RGBColor(components=(0, 0, 0, 1))
 * 
 */

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

/* "mathics/builtin/graphics.py":2707
 *         return RGBColor(components=(0, 0, 0, 1))
 * 
 *     def get_style(             # <<<<<<<<<<<<<<
 *         self, style_class, face_element=None, default_to_faces=True, consider_forms=True
 *     ):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_5Style_15get_style(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_5Style_15get_style = {"get_style", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_5Style_15get_style, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_5Style_15get_style(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_style_class = 0;
  PyObject *__pyx_v_face_element = 0;
  PyObject *__pyx_v_default_to_faces = 0;
  PyObject *__pyx_v_consider_forms = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_style (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_style_class,&__pyx_n_s_face_element,&__pyx_n_s_default_to_faces,&__pyx_n_s_consider_forms,0};
    PyObject* values[5] = {0,0,0,0,0};

    /* "mathics/builtin/graphics.py":2708
 * 
 *     def get_style(
 *         self, style_class, face_element=None, default_to_faces=True, consider_forms=True             # <<<<<<<<<<<<<<
 *     ):
 *         if face_element is not None:
 */
    values[2] = ((PyObject *)((PyObject *)Py_None));
    values[3] = ((PyObject *)((PyObject *)Py_True));
    values[4] = ((PyObject *)((PyObject *)Py_True));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_style_class)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("get_style", 0, 2, 5, 1); __PYX_ERR(0, 2707, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_face_element);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_default_to_faces);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_consider_forms);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_style") < 0)) __PYX_ERR(0, 2707, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_style_class = values[1];
    __pyx_v_face_element = values[2];
    __pyx_v_default_to_faces = values[3];
    __pyx_v_consider_forms = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_style", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2707, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.Style.get_style", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_5Style_14get_style(__pyx_self, __pyx_v_self, __pyx_v_style_class, __pyx_v_face_element, __pyx_v_default_to_faces, __pyx_v_consider_forms);

  /* "mathics/builtin/graphics.py":2707
 *         return RGBColor(components=(0, 0, 0, 1))
 * 
 *     def get_style(             # <<<<<<<<<<<<<<
 *         self, style_class, face_element=None, default_to_faces=True, consider_forms=True
 *     ):
 */

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_5Style_14get_style(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_style_class, PyObject *__pyx_v_face_element, PyObject *__pyx_v_default_to_faces, PyObject *__pyx_v_consider_forms) {
  PyObject *__pyx_v_edge_style = NULL;
  PyObject *__pyx_v_face_style = NULL;
  PyObject *__pyx_v_item = NULL;
  CYTHON_UNUSED PyObject *__pyx_v__ = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  PyObject *__pyx_t_9 = NULL;
  PyObject *(*__pyx_t_10)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_style", 0);
  __Pyx_INCREF(__pyx_v_default_to_faces);
  __Pyx_INCREF(__pyx_v_consider_forms);

  /* "mathics/builtin/graphics.py":2710
 *         self, style_class, face_element=None, default_to_faces=True, consider_forms=True
 *     ):
 *         if face_element is not None:             # <<<<<<<<<<<<<<
 *             default_to_faces = consider_forms = face_element
 *         edge_style = face_style = None
 */
  __pyx_t_1 = (__pyx_v_face_element != Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "mathics/builtin/graphics.py":2711
 *     ):
 *         if face_element is not None:
 *             default_to_faces = consider_forms = face_element             # <<<<<<<<<<<<<<
 *         edge_style = face_style = None
 *         if style_class == _Color:
 */
    __Pyx_INCREF(__pyx_v_face_element);
    __Pyx_DECREF_SET(__pyx_v_default_to_faces, __pyx_v_face_element);
    __Pyx_INCREF(__pyx_v_face_element);
    __Pyx_DECREF_SET(__pyx_v_consider_forms, __pyx_v_face_element);

    /* "mathics/builtin/graphics.py":2710
 *         self, style_class, face_element=None, default_to_faces=True, consider_forms=True
 *     ):
 *         if face_element is not None:             # <<<<<<<<<<<<<<
 *             default_to_faces = consider_forms = face_element
 *         edge_style = face_style = None
 */
  }

  /* "mathics/builtin/graphics.py":2712
 *         if face_element is not None:
 *             default_to_faces = consider_forms = face_element
 *         edge_style = face_style = None             # <<<<<<<<<<<<<<
 *         if style_class == _Color:
 *             if default_to_faces:
 */
  __Pyx_INCREF(Py_None);
  __pyx_v_edge_style = Py_None;
  __Pyx_INCREF(Py_None);
  __pyx_v_face_style = Py_None;

  /* "mathics/builtin/graphics.py":2713
 *             default_to_faces = consider_forms = face_element
 *         edge_style = face_style = None
 *         if style_class == _Color:             # <<<<<<<<<<<<<<
 *             if default_to_faces:
 *                 face_style = self.get_default_face_color()
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Color); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2713, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyObject_RichCompare(__pyx_v_style_class, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2713, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 2713, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_2) {

    /* "mathics/builtin/graphics.py":2714
 *         edge_style = face_style = None
 *         if style_class == _Color:
 *             if default_to_faces:             # <<<<<<<<<<<<<<
 *                 face_style = self.get_default_face_color()
 *             else:
 */
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_default_to_faces); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 2714, __pyx_L1_error)
    if (__pyx_t_2) {

      /* "mathics/builtin/graphics.py":2715
 *         if style_class == _Color:
 *             if default_to_faces:
 *                 face_style = self.get_default_face_color()             # <<<<<<<<<<<<<<
 *             else:
 *                 edge_style = self.get_default_edge_color()
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_get_default_face_color); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2715, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2715, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF_SET(__pyx_v_face_style, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "mathics/builtin/graphics.py":2714
 *         edge_style = face_style = None
 *         if style_class == _Color:
 *             if default_to_faces:             # <<<<<<<<<<<<<<
 *                 face_style = self.get_default_face_color()
 *             else:
 */
      goto __pyx_L5;
    }

    /* "mathics/builtin/graphics.py":2717
 *                 face_style = self.get_default_face_color()
 *             else:
 *                 edge_style = self.get_default_edge_color()             # <<<<<<<<<<<<<<
 *         elif style_class == _Thickness:
 *             if not default_to_faces:
 */
    /*else*/ {
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_get_default_edge_color); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2717, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2717, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF_SET(__pyx_v_edge_style, __pyx_t_4);
      __pyx_t_4 = 0;
    }
    __pyx_L5:;

    /* "mathics/builtin/graphics.py":2713
 *             default_to_faces = consider_forms = face_element
 *         edge_style = face_style = None
 *         if style_class == _Color:             # <<<<<<<<<<<<<<
 *             if default_to_faces:
 *                 face_style = self.get_default_face_color()
 */
    goto __pyx_L4;
  }

  /* "mathics/builtin/graphics.py":2718
 *             else:
 *                 edge_style = self.get_default_edge_color()
 *         elif style_class == _Thickness:             # <<<<<<<<<<<<<<
 *             if not default_to_faces:
 *                 edge_style = AbsoluteThickness(self.graphics, value=0.5)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Thickness); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2718, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyObject_RichCompare(__pyx_v_style_class, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2718, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 2718, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_2) {

    /* "mathics/builtin/graphics.py":2719
 *                 edge_style = self.get_default_edge_color()
 *         elif style_class == _Thickness:
 *             if not default_to_faces:             # <<<<<<<<<<<<<<
 *                 edge_style = AbsoluteThickness(self.graphics, value=0.5)
 *         for item in self.styles:
 */
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_default_to_faces); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 2719, __pyx_L1_error)
    __pyx_t_1 = ((!__pyx_t_2) != 0);
    if (__pyx_t_1) {

      /* "mathics/builtin/graphics.py":2720
 *         elif style_class == _Thickness:
 *             if not default_to_faces:
 *                 edge_style = AbsoluteThickness(self.graphics, value=0.5)             # <<<<<<<<<<<<<<
 *         for item in self.styles:
 *             if isinstance(item, style_class):
 */
      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_AbsoluteThickness); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2720, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_graphics); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2720, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2720, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2720, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_value, __pyx_float_0_5) < 0) __PYX_ERR(0, 2720, __pyx_L1_error)
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2720, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF_SET(__pyx_v_edge_style, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "mathics/builtin/graphics.py":2719
 *                 edge_style = self.get_default_edge_color()
 *         elif style_class == _Thickness:
 *             if not default_to_faces:             # <<<<<<<<<<<<<<
 *                 edge_style = AbsoluteThickness(self.graphics, value=0.5)
 *         for item in self.styles:
 */
    }

    /* "mathics/builtin/graphics.py":2718
 *             else:
 *                 edge_style = self.get_default_edge_color()
 *         elif style_class == _Thickness:             # <<<<<<<<<<<<<<
 *             if not default_to_faces:
 *                 edge_style = AbsoluteThickness(self.graphics, value=0.5)
 */
  }
  __pyx_L4:;

  /* "mathics/builtin/graphics.py":2721
 *             if not default_to_faces:
 *                 edge_style = AbsoluteThickness(self.graphics, value=0.5)
 *         for item in self.styles:             # <<<<<<<<<<<<<<
 *             if isinstance(item, style_class):
 *                 if default_to_faces:
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_styles); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2721, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) {
    __pyx_t_4 = __pyx_t_6; __Pyx_INCREF(__pyx_t_4); __pyx_t_7 = 0;
    __pyx_t_8 = NULL;
  } else {
    __pyx_t_7 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2721, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_8 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2721, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  for (;;) {
    if (likely(!__pyx_t_8)) {
      if (likely(PyList_CheckExact(__pyx_t_4))) {
        if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_6 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_6); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 2721, __pyx_L1_error)
        #else
        __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2721, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        #endif
      } else {
        if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_6); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 2721, __pyx_L1_error)
        #else
        __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2721, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        #endif
      }
    } else {
      __pyx_t_6 = __pyx_t_8(__pyx_t_4);
      if (unlikely(!__pyx_t_6)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 2721, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_6);
    }
    __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "mathics/builtin/graphics.py":2722
 *                 edge_style = AbsoluteThickness(self.graphics, value=0.5)
 *         for item in self.styles:
 *             if isinstance(item, style_class):             # <<<<<<<<<<<<<<
 *                 if default_to_faces:
 *                     face_style = item
 */
    __pyx_t_1 = PyObject_IsInstance(__pyx_v_item, __pyx_v_style_class); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2722, __pyx_L1_error)
    __pyx_t_2 = (__pyx_t_1 != 0);
    if (__pyx_t_2) {

      /* "mathics/builtin/graphics.py":2723
 *         for item in self.styles:
 *             if isinstance(item, style_class):
 *                 if default_to_faces:             # <<<<<<<<<<<<<<
 *                     face_style = item
 *                 else:
 */
      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_default_to_faces); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 2723, __pyx_L1_error)
      if (__pyx_t_2) {

        /* "mathics/builtin/graphics.py":2724
 *             if isinstance(item, style_class):
 *                 if default_to_faces:
 *                     face_style = item             # <<<<<<<<<<<<<<
 *                 else:
 *                     edge_style = item
 */
        __Pyx_INCREF(__pyx_v_item);
        __Pyx_DECREF_SET(__pyx_v_face_style, __pyx_v_item);

        /* "mathics/builtin/graphics.py":2723
 *         for item in self.styles:
 *             if isinstance(item, style_class):
 *                 if default_to_faces:             # <<<<<<<<<<<<<<
 *                     face_style = item
 *                 else:
 */
        goto __pyx_L10;
      }

      /* "mathics/builtin/graphics.py":2726
 *                     face_style = item
 *                 else:
 *                     edge_style = item             # <<<<<<<<<<<<<<
 *             elif isinstance(item, Style):
 *                 if consider_forms:
 */
      /*else*/ {
        __Pyx_INCREF(__pyx_v_item);
        __Pyx_DECREF_SET(__pyx_v_edge_style, __pyx_v_item);
      }
      __pyx_L10:;

      /* "mathics/builtin/graphics.py":2722
 *                 edge_style = AbsoluteThickness(self.graphics, value=0.5)
 *         for item in self.styles:
 *             if isinstance(item, style_class):             # <<<<<<<<<<<<<<
 *                 if default_to_faces:
 *                     face_style = item
 */
      goto __pyx_L9;
    }

    /* "mathics/builtin/graphics.py":2727
 *                 else:
 *                     edge_style = item
 *             elif isinstance(item, Style):             # <<<<<<<<<<<<<<
 *                 if consider_forms:
 *                     if item.edge:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_Style); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2727, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_2 = PyObject_IsInstance(__pyx_v_item, __pyx_t_6); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 2727, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_1 = (__pyx_t_2 != 0);
    if (__pyx_t_1) {

      /* "mathics/builtin/graphics.py":2728
 *                     edge_style = item
 *             elif isinstance(item, Style):
 *                 if consider_forms:             # <<<<<<<<<<<<<<
 *                     if item.edge:
 *                         edge_style, _ = item.get_style(
 */
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_consider_forms); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 2728, __pyx_L1_error)
      if (__pyx_t_1) {

        /* "mathics/builtin/graphics.py":2729
 *             elif isinstance(item, Style):
 *                 if consider_forms:
 *                     if item.edge:             # <<<<<<<<<<<<<<
 *                         edge_style, _ = item.get_style(
 *                             style_class, default_to_faces=False, consider_forms=False
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_item, __pyx_n_s_edge); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2729, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 2729, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (__pyx_t_1) {

          /* "mathics/builtin/graphics.py":2730
 *                 if consider_forms:
 *                     if item.edge:
 *                         edge_style, _ = item.get_style(             # <<<<<<<<<<<<<<
 *                             style_class, default_to_faces=False, consider_forms=False
 *                         )
 */
          __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_item, __pyx_n_s_get_style); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2730, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);

          /* "mathics/builtin/graphics.py":2731
 *                     if item.edge:
 *                         edge_style, _ = item.get_style(
 *                             style_class, default_to_faces=False, consider_forms=False             # <<<<<<<<<<<<<<
 *                         )
 *                     elif item.face:
 */
          __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2730, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_INCREF(__pyx_v_style_class);
          __Pyx_GIVEREF(__pyx_v_style_class);
          PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_style_class);
          __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2731, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_default_to_faces, Py_False) < 0) __PYX_ERR(0, 2731, __pyx_L1_error)
          if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_consider_forms, Py_False) < 0) __PYX_ERR(0, 2731, __pyx_L1_error)

          /* "mathics/builtin/graphics.py":2730
 *                 if consider_forms:
 *                     if item.edge:
 *                         edge_style, _ = item.get_style(             # <<<<<<<<<<<<<<
 *                             style_class, default_to_faces=False, consider_forms=False
 *                         )
 */
          __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2730, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          if ((likely(PyTuple_CheckExact(__pyx_t_9))) || (PyList_CheckExact(__pyx_t_9))) {
            PyObject* sequence = __pyx_t_9;
            Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
            if (unlikely(size != 2)) {
              if (size > 2) __Pyx_RaiseTooManyValuesError(2);
              else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
              __PYX_ERR(0, 2730, __pyx_L1_error)
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            if (likely(PyTuple_CheckExact(sequence))) {
              __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
              __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
            } else {
              __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
              __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
            }
            __Pyx_INCREF(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_5);
            #else
            __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2730, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2730, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_5);
            #endif
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          } else {
            Py_ssize_t index = -1;
            __pyx_t_6 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2730, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_6);
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
            __pyx_t_10 = Py_TYPE(__pyx_t_6)->tp_iternext;
            index = 0; __pyx_t_3 = __pyx_t_10(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L13_unpacking_failed;
            __Pyx_GOTREF(__pyx_t_3);
            index = 1; __pyx_t_5 = __pyx_t_10(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L13_unpacking_failed;
            __Pyx_GOTREF(__pyx_t_5);
            if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_6), 2) < 0) __PYX_ERR(0, 2730, __pyx_L1_error)
            __pyx_t_10 = NULL;
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            goto __pyx_L14_unpacking_done;
            __pyx_L13_unpacking_failed:;
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            __pyx_t_10 = NULL;
            if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
            __PYX_ERR(0, 2730, __pyx_L1_error)
            __pyx_L14_unpacking_done:;
          }
          __Pyx_DECREF_SET(__pyx_v_edge_style, __pyx_t_3);
          __pyx_t_3 = 0;
          __Pyx_XDECREF_SET(__pyx_v__, __pyx_t_5);
          __pyx_t_5 = 0;

          /* "mathics/builtin/graphics.py":2729
 *             elif isinstance(item, Style):
 *                 if consider_forms:
 *                     if item.edge:             # <<<<<<<<<<<<<<
 *                         edge_style, _ = item.get_style(
 *                             style_class, default_to_faces=False, consider_forms=False
 */
          goto __pyx_L12;
        }

        /* "mathics/builtin/graphics.py":2733
 *                             style_class, default_to_faces=False, consider_forms=False
 *                         )
 *                     elif item.face:             # <<<<<<<<<<<<<<
 *                         _, face_style = item.get_style(
 *                             style_class, default_to_faces=True, consider_forms=False
 */
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_item, __pyx_n_s_face); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2733, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 2733, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (__pyx_t_1) {

          /* "mathics/builtin/graphics.py":2734
 *                         )
 *                     elif item.face:
 *                         _, face_style = item.get_style(             # <<<<<<<<<<<<<<
 *                             style_class, default_to_faces=True, consider_forms=False
 *                         )
 */
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_item, __pyx_n_s_get_style); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2734, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);

          /* "mathics/builtin/graphics.py":2735
 *                     elif item.face:
 *                         _, face_style = item.get_style(
 *                             style_class, default_to_faces=True, consider_forms=False             # <<<<<<<<<<<<<<
 *                         )
 * 
 */
          __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2734, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_INCREF(__pyx_v_style_class);
          __Pyx_GIVEREF(__pyx_v_style_class);
          PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_style_class);
          __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2735, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_default_to_faces, Py_True) < 0) __PYX_ERR(0, 2735, __pyx_L1_error)
          if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_consider_forms, Py_False) < 0) __PYX_ERR(0, 2735, __pyx_L1_error)

          /* "mathics/builtin/graphics.py":2734
 *                         )
 *                     elif item.face:
 *                         _, face_style = item.get_style(             # <<<<<<<<<<<<<<
 *                             style_class, default_to_faces=True, consider_forms=False
 *                         )
 */
          __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2734, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) {
            PyObject* sequence = __pyx_t_6;
            Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
            if (unlikely(size != 2)) {
              if (size > 2) __Pyx_RaiseTooManyValuesError(2);
              else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
              __PYX_ERR(0, 2734, __pyx_L1_error)
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            if (likely(PyTuple_CheckExact(sequence))) {
              __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
              __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
            } else {
              __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
              __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
            }
            __Pyx_INCREF(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_5);
            #else
            __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2734, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2734, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_5);
            #endif
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          } else {
            Py_ssize_t index = -1;
            __pyx_t_9 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2734, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_9);
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            __pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext;
            index = 0; __pyx_t_3 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_3)) goto __pyx_L15_unpacking_failed;
            __Pyx_GOTREF(__pyx_t_3);
            index = 1; __pyx_t_5 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_5)) goto __pyx_L15_unpacking_failed;
            __Pyx_GOTREF(__pyx_t_5);
            if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 2734, __pyx_L1_error)
            __pyx_t_10 = NULL;
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
            goto __pyx_L16_unpacking_done;
            __pyx_L15_unpacking_failed:;
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
            __pyx_t_10 = NULL;
            if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
            __PYX_ERR(0, 2734, __pyx_L1_error)
            __pyx_L16_unpacking_done:;
          }
          __Pyx_XDECREF_SET(__pyx_v__, __pyx_t_3);
          __pyx_t_3 = 0;
          __Pyx_DECREF_SET(__pyx_v_face_style, __pyx_t_5);
          __pyx_t_5 = 0;

          /* "mathics/builtin/graphics.py":2733
 *                             style_class, default_to_faces=False, consider_forms=False
 *                         )
 *                     elif item.face:             # <<<<<<<<<<<<<<
 *                         _, face_style = item.get_style(
 *                             style_class, default_to_faces=True, consider_forms=False
 */
        }
        __pyx_L12:;

        /* "mathics/builtin/graphics.py":2728
 *                     edge_style = item
 *             elif isinstance(item, Style):
 *                 if consider_forms:             # <<<<<<<<<<<<<<
 *                     if item.edge:
 *                         edge_style, _ = item.get_style(
 */
      }

      /* "mathics/builtin/graphics.py":2727
 *                 else:
 *                     edge_style = item
 *             elif isinstance(item, Style):             # <<<<<<<<<<<<<<
 *                 if consider_forms:
 *                     if item.edge:
 */
    }
    __pyx_L9:;

    /* "mathics/builtin/graphics.py":2721
 *             if not default_to_faces:
 *                 edge_style = AbsoluteThickness(self.graphics, value=0.5)
 *         for item in self.styles:             # <<<<<<<<<<<<<<
 *             if isinstance(item, style_class):
 *                 if default_to_faces:
 */
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":2738
 *                         )
 * 
 *         return edge_style, face_style             # <<<<<<<<<<<<<<
 * 
 *     def get_option(self, name):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2738, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_edge_style);
  __Pyx_GIVEREF(__pyx_v_edge_style);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_edge_style);
  __Pyx_INCREF(__pyx_v_face_style);
  __Pyx_GIVEREF(__pyx_v_face_style);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_face_style);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":2707
 *         return RGBColor(components=(0, 0, 0, 1))
 * 
 *     def get_style(             # <<<<<<<<<<<<<<
 *         self, style_class, face_element=None, default_to_faces=True, consider_forms=True
 *     ):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("mathics.builtin.graphics.Style.get_style", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_edge_style);
  __Pyx_XDECREF(__pyx_v_face_style);
  __Pyx_XDECREF(__pyx_v_item);
  __Pyx_XDECREF(__pyx_v__);
  __Pyx_XDECREF(__pyx_v_default_to_faces);
  __Pyx_XDECREF(__pyx_v_consider_forms);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":2740
 *         return edge_style, face_style
 * 
 *     def get_option(self, name):             # <<<<<<<<<<<<<<
 *         return self.options.get(name, None)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_5Style_17get_option(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_5Style_17get_option = {"get_option", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_5Style_17get_option, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_5Style_17get_option(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_name = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_option (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_name,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("get_option", 1, 2, 2, 1); __PYX_ERR(0, 2740, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_option") < 0)) __PYX_ERR(0, 2740, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_name = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_option", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2740, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.Style.get_option", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_5Style_16get_option(__pyx_self, __pyx_v_self, __pyx_v_name);

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

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

  /* "mathics/builtin/graphics.py":2741
 * 
 *     def get_option(self, name):
 *         return self.options.get(name, None)             # <<<<<<<<<<<<<<
 * 
 *     def get_line_width(self, face_element=True):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_options); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2741, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_get); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2741, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_name, Py_None};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2741, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_name, Py_None};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2741, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2741, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_2) {
      __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
    }
    __Pyx_INCREF(__pyx_v_name);
    __Pyx_GIVEREF(__pyx_v_name);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_name);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, Py_None);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2741, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":2740
 *         return edge_style, face_style
 * 
 *     def get_option(self, name):             # <<<<<<<<<<<<<<
 *         return self.options.get(name, None)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("mathics.builtin.graphics.Style.get_option", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":2743
 *         return self.options.get(name, None)
 * 
 *     def get_line_width(self, face_element=True):             # <<<<<<<<<<<<<<
 *         if self.graphics.pixel_width is None:
 *             return 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_5Style_19get_line_width(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_5Style_19get_line_width = {"get_line_width", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_5Style_19get_line_width, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_5Style_19get_line_width(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_face_element = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_line_width (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_face_element,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)((PyObject *)Py_True));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_face_element);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_line_width") < 0)) __PYX_ERR(0, 2743, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_face_element = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_line_width", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2743, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.Style.get_line_width", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_5Style_18get_line_width(__pyx_self, __pyx_v_self, __pyx_v_face_element);

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_5Style_18get_line_width(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_face_element) {
  PyObject *__pyx_v_edge_style = NULL;
  CYTHON_UNUSED PyObject *__pyx_v__ = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *(*__pyx_t_7)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_line_width", 0);

  /* "mathics/builtin/graphics.py":2744
 * 
 *     def get_line_width(self, face_element=True):
 *         if self.graphics.pixel_width is None:             # <<<<<<<<<<<<<<
 *             return 0
 *         edge_style, _ = self.get_style(
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_graphics); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2744, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_pixel_width); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2744, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 == Py_None);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "mathics/builtin/graphics.py":2745
 *     def get_line_width(self, face_element=True):
 *         if self.graphics.pixel_width is None:
 *             return 0             # <<<<<<<<<<<<<<
 *         edge_style, _ = self.get_style(
 *             _Thickness, default_to_faces=face_element, consider_forms=face_element
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_int_0);
    __pyx_r = __pyx_int_0;
    goto __pyx_L0;

    /* "mathics/builtin/graphics.py":2744
 * 
 *     def get_line_width(self, face_element=True):
 *         if self.graphics.pixel_width is None:             # <<<<<<<<<<<<<<
 *             return 0
 *         edge_style, _ = self.get_style(
 */
  }

  /* "mathics/builtin/graphics.py":2746
 *         if self.graphics.pixel_width is None:
 *             return 0
 *         edge_style, _ = self.get_style(             # <<<<<<<<<<<<<<
 *             _Thickness, default_to_faces=face_element, consider_forms=face_element
 *         )
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_get_style); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2746, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "mathics/builtin/graphics.py":2747
 *             return 0
 *         edge_style, _ = self.get_style(
 *             _Thickness, default_to_faces=face_element, consider_forms=face_element             # <<<<<<<<<<<<<<
 *         )
 *         if edge_style is None:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Thickness); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2747, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "mathics/builtin/graphics.py":2746
 *         if self.graphics.pixel_width is None:
 *             return 0
 *         edge_style, _ = self.get_style(             # <<<<<<<<<<<<<<
 *             _Thickness, default_to_faces=face_element, consider_forms=face_element
 *         )
 */
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2746, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":2747
 *             return 0
 *         edge_style, _ = self.get_style(
 *             _Thickness, default_to_faces=face_element, consider_forms=face_element             # <<<<<<<<<<<<<<
 *         )
 *         if edge_style is None:
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2747, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_default_to_faces, __pyx_v_face_element) < 0) __PYX_ERR(0, 2747, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_consider_forms, __pyx_v_face_element) < 0) __PYX_ERR(0, 2747, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2746
 *         if self.graphics.pixel_width is None:
 *             return 0
 *         edge_style, _ = self.get_style(             # <<<<<<<<<<<<<<
 *             _Thickness, default_to_faces=face_element, consider_forms=face_element
 *         )
 */
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2746, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) {
    PyObject* sequence = __pyx_t_6;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 2746, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_5);
    #else
    __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2746, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2746, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    #endif
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_2 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2746, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext;
    index = 0; __pyx_t_1 = __pyx_t_7(__pyx_t_2); if (unlikely(!__pyx_t_1)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    index = 1; __pyx_t_5 = __pyx_t_7(__pyx_t_2); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_2), 2) < 0) __PYX_ERR(0, 2746, __pyx_L1_error)
    __pyx_t_7 = NULL;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_7 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 2746, __pyx_L1_error)
    __pyx_L5_unpacking_done:;
  }
  __pyx_v_edge_style = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v__ = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":2749
 *             _Thickness, default_to_faces=face_element, consider_forms=face_element
 *         )
 *         if edge_style is None:             # <<<<<<<<<<<<<<
 *             return 0
 *         return edge_style.get_thickness()
 */
  __pyx_t_4 = (__pyx_v_edge_style == Py_None);
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "mathics/builtin/graphics.py":2750
 *         )
 *         if edge_style is None:
 *             return 0             # <<<<<<<<<<<<<<
 *         return edge_style.get_thickness()
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_int_0);
    __pyx_r = __pyx_int_0;
    goto __pyx_L0;

    /* "mathics/builtin/graphics.py":2749
 *             _Thickness, default_to_faces=face_element, consider_forms=face_element
 *         )
 *         if edge_style is None:             # <<<<<<<<<<<<<<
 *             return 0
 *         return edge_style.get_thickness()
 */
  }

  /* "mathics/builtin/graphics.py":2751
 *         if edge_style is None:
 *             return 0
 *         return edge_style.get_thickness()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_edge_style, __pyx_n_s_get_thickness); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2751, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_6 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2751, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 0;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":2743
 *         return self.options.get(name, None)
 * 
 *     def get_line_width(self, face_element=True):             # <<<<<<<<<<<<<<
 *         if self.graphics.pixel_width is None:
 *             return 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("mathics.builtin.graphics.Style.get_line_width", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_edge_style);
  __Pyx_XDECREF(__pyx_v__);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7mathics_7builtin_8graphics_48generator6(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "mathics/builtin/graphics.py":2754
 * 
 * 
 * def _flatten(leaves):             # <<<<<<<<<<<<<<
 *     for leaf in leaves:
 *         if leaf.get_head_name() == "System`List":
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_47_flatten(PyObject *__pyx_self, PyObject *__pyx_v_leaves); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_47_flatten = {"_flatten", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_47_flatten, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_47_flatten(PyObject *__pyx_self, PyObject *__pyx_v_leaves) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_flatten (wrapper)", 0);
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_46_flatten(__pyx_self, ((PyObject *)__pyx_v_leaves));

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_46_flatten(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_leaves) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_70__flatten *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_flatten", 0);
  __pyx_cur_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_70__flatten *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_70__flatten(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_70__flatten, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_70__flatten *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 2754, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_leaves = __pyx_v_leaves;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_leaves);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_leaves);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7mathics_7builtin_8graphics_48generator6, __pyx_codeobj__111, (PyObject *) __pyx_cur_scope, __pyx_n_s_flatten, __pyx_n_s_flatten, __pyx_n_s_mathics_builtin_graphics); if (unlikely(!gen)) __PYX_ERR(0, 2754, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics._flatten", __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_7mathics_7builtin_8graphics_48generator6(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_70__flatten *__pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_70__flatten *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  Py_ssize_t __pyx_t_10;
  PyObject *(*__pyx_t_11)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_flatten", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L10_resume_from_yield;
    case 2: goto __pyx_L11_resume_from_yield;
    case 3: goto __pyx_L12_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2754, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2755
 * 
 * def _flatten(leaves):
 *     for leaf in leaves:             # <<<<<<<<<<<<<<
 *         if leaf.get_head_name() == "System`List":
 *             flattened = leaf.flatten(Symbol("List"))
 */
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_leaves)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_leaves)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_v_leaves; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_leaves); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2755, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2755, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 2755, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2755, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 2755, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2755, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 2755, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_leaf);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_leaf, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;

    /* "mathics/builtin/graphics.py":2756
 * def _flatten(leaves):
 *     for leaf in leaves:
 *         if leaf.get_head_name() == "System`List":             # <<<<<<<<<<<<<<
 *             flattened = leaf.flatten(Symbol("List"))
 *             if flattened.get_head_name() == "System`List":
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_leaf, __pyx_n_s_get_head_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2756, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2756, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_kp_u_System_List, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 2756, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_7) {

      /* "mathics/builtin/graphics.py":2757
 *     for leaf in leaves:
 *         if leaf.get_head_name() == "System`List":
 *             flattened = leaf.flatten(Symbol("List"))             # <<<<<<<<<<<<<<
 *             if flattened.get_head_name() == "System`List":
 *                 for x in flattened.leaves:
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_leaf, __pyx_n_s_flatten_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2757, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_Symbol); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2757, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
        if (likely(__pyx_t_9)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_8, function);
        }
      }
      __pyx_t_6 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_9, __pyx_n_u_List) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_n_u_List);
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2757, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_4 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6);
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2757, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_flattened);
      __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_flattened, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      __pyx_t_4 = 0;

      /* "mathics/builtin/graphics.py":2758
 *         if leaf.get_head_name() == "System`List":
 *             flattened = leaf.flatten(Symbol("List"))
 *             if flattened.get_head_name() == "System`List":             # <<<<<<<<<<<<<<
 *                 for x in flattened.leaves:
 *                     yield x
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_flattened, __pyx_n_s_get_head_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2758, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2758, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_kp_u_System_List, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 2758, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_7) {

        /* "mathics/builtin/graphics.py":2759
 *             flattened = leaf.flatten(Symbol("List"))
 *             if flattened.get_head_name() == "System`List":
 *                 for x in flattened.leaves:             # <<<<<<<<<<<<<<
 *                     yield x
 *             else:
 */
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_flattened, __pyx_n_s_leaves); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2759, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
          __pyx_t_5 = __pyx_t_4; __Pyx_INCREF(__pyx_t_5); __pyx_t_10 = 0;
          __pyx_t_11 = NULL;
        } else {
          __pyx_t_10 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2759, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_11 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2759, __pyx_L1_error)
        }
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        for (;;) {
          if (likely(!__pyx_t_11)) {
            if (likely(PyList_CheckExact(__pyx_t_5))) {
              if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_5)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_10); __Pyx_INCREF(__pyx_t_4); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 2759, __pyx_L1_error)
              #else
              __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2759, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_4);
              #endif
            } else {
              if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_10); __Pyx_INCREF(__pyx_t_4); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 2759, __pyx_L1_error)
              #else
              __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2759, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_4);
              #endif
            }
          } else {
            __pyx_t_4 = __pyx_t_11(__pyx_t_5);
            if (unlikely(!__pyx_t_4)) {
              PyObject* exc_type = PyErr_Occurred();
              if (exc_type) {
                if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                else __PYX_ERR(0, 2759, __pyx_L1_error)
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_4);
          }
          __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_x);
          __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_x, __pyx_t_4);
          __Pyx_GIVEREF(__pyx_t_4);
          __pyx_t_4 = 0;

          /* "mathics/builtin/graphics.py":2760
 *             if flattened.get_head_name() == "System`List":
 *                 for x in flattened.leaves:
 *                     yield x             # <<<<<<<<<<<<<<
 *             else:
 *                 yield flattened
 */
          __Pyx_INCREF(__pyx_cur_scope->__pyx_v_x);
          __pyx_r = __pyx_cur_scope->__pyx_v_x;
          __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_t_5);
          __pyx_cur_scope->__pyx_t_3 = __pyx_t_5;
          __pyx_cur_scope->__pyx_t_4 = __pyx_t_10;
          __pyx_cur_scope->__pyx_t_5 = __pyx_t_11;
          __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_L10_resume_from_yield:;
          __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
          __pyx_cur_scope->__pyx_t_0 = 0;
          __Pyx_XGOTREF(__pyx_t_1);
          __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
          __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
          __pyx_t_5 = __pyx_cur_scope->__pyx_t_3;
          __pyx_cur_scope->__pyx_t_3 = 0;
          __Pyx_XGOTREF(__pyx_t_5);
          __pyx_t_10 = __pyx_cur_scope->__pyx_t_4;
          __pyx_t_11 = __pyx_cur_scope->__pyx_t_5;
          if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2760, __pyx_L1_error)

          /* "mathics/builtin/graphics.py":2759
 *             flattened = leaf.flatten(Symbol("List"))
 *             if flattened.get_head_name() == "System`List":
 *                 for x in flattened.leaves:             # <<<<<<<<<<<<<<
 *                     yield x
 *             else:
 */
        }
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "mathics/builtin/graphics.py":2758
 *         if leaf.get_head_name() == "System`List":
 *             flattened = leaf.flatten(Symbol("List"))
 *             if flattened.get_head_name() == "System`List":             # <<<<<<<<<<<<<<
 *                 for x in flattened.leaves:
 *                     yield x
 */
        goto __pyx_L7;
      }

      /* "mathics/builtin/graphics.py":2762
 *                     yield x
 *             else:
 *                 yield flattened             # <<<<<<<<<<<<<<
 *         else:
 *             yield leaf
 */
      /*else*/ {
        __Pyx_INCREF(__pyx_cur_scope->__pyx_v_flattened);
        __pyx_r = __pyx_cur_scope->__pyx_v_flattened;
        __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 = 2;
        return __pyx_r;
        __pyx_L11_resume_from_yield:;
        __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
        __pyx_cur_scope->__pyx_t_0 = 0;
        __Pyx_XGOTREF(__pyx_t_1);
        __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
        __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
        if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2762, __pyx_L1_error)
      }
      __pyx_L7:;

      /* "mathics/builtin/graphics.py":2756
 * def _flatten(leaves):
 *     for leaf in leaves:
 *         if leaf.get_head_name() == "System`List":             # <<<<<<<<<<<<<<
 *             flattened = leaf.flatten(Symbol("List"))
 *             if flattened.get_head_name() == "System`List":
 */
      goto __pyx_L6;
    }

    /* "mathics/builtin/graphics.py":2764
 *                 yield flattened
 *         else:
 *             yield leaf             # <<<<<<<<<<<<<<
 * 
 * 
 */
    /*else*/ {
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_leaf);
      __pyx_r = __pyx_cur_scope->__pyx_v_leaf;
      __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 = 3;
      return __pyx_r;
      __pyx_L12_resume_from_yield:;
      __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
      __pyx_cur_scope->__pyx_t_0 = 0;
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
      __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
      if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2764, __pyx_L1_error)
    }
    __pyx_L6:;

    /* "mathics/builtin/graphics.py":2755
 * 
 * def _flatten(leaves):
 *     for leaf in leaves:             # <<<<<<<<<<<<<<
 *         if leaf.get_head_name() == "System`List":
 *             flattened = leaf.flatten(Symbol("List"))
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "mathics/builtin/graphics.py":2754
 * 
 * 
 * def _flatten(leaves):             # <<<<<<<<<<<<<<
 *     for leaf in leaves:
 *         if leaf.get_head_name() == "System`List":
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  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_AddTraceback("_flatten", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":2768
 * 
 * class _GraphicsElements(object):
 *     def __init__(self, content, evaluation):             # <<<<<<<<<<<<<<
 *         self.evaluation = evaluation
 *         self.elements = []
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_17_GraphicsElements_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_17_GraphicsElements_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_17_GraphicsElements_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_17_GraphicsElements_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_content = 0;
  PyObject *__pyx_v_evaluation = 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);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_content,&__pyx_n_s_evaluation,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_content)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); __PYX_ERR(0, 2768, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_evaluation)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); __PYX_ERR(0, 2768, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 2768, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_self = values[0];
    __pyx_v_content = values[1];
    __pyx_v_evaluation = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2768, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics._GraphicsElements.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_17_GraphicsElements___init__(__pyx_self, __pyx_v_self, __pyx_v_content, __pyx_v_evaluation);

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

/* "mathics/builtin/graphics.py":2774
 *         builtins = evaluation.definitions.builtin
 * 
 *         def get_options(name):             # <<<<<<<<<<<<<<
 *             builtin = builtins.get(name)
 *             if builtin is None:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_17_GraphicsElements_8__init___1get_options(PyObject *__pyx_self, PyObject *__pyx_v_name); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_17_GraphicsElements_8__init___1get_options = {"get_options", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_17_GraphicsElements_8__init___1get_options, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_17_GraphicsElements_8__init___1get_options(PyObject *__pyx_self, PyObject *__pyx_v_name) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_options (wrapper)", 0);
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_17_GraphicsElements_8__init___get_options(__pyx_self, ((PyObject *)__pyx_v_name));

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_17_GraphicsElements_8__init___get_options(PyObject *__pyx_self, PyObject *__pyx_v_name) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_71___init__ *__pyx_cur_scope;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_71___init__ *__pyx_outer_scope;
  PyObject *__pyx_v_builtin = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_options", 0);
  __pyx_outer_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_71___init__ *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "mathics/builtin/graphics.py":2775
 * 
 *         def get_options(name):
 *             builtin = builtins.get(name)             # <<<<<<<<<<<<<<
 *             if builtin is None:
 *                 return None
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_builtins)) { __Pyx_RaiseClosureNameError("builtins"); __PYX_ERR(0, 2775, __pyx_L1_error) }
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_builtins, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2775, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_name);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2775, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_builtin = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":2776
 *         def get_options(name):
 *             builtin = builtins.get(name)
 *             if builtin is None:             # <<<<<<<<<<<<<<
 *                 return None
 *             return builtin.options
 */
  __pyx_t_4 = (__pyx_v_builtin == Py_None);
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (__pyx_t_5) {

    /* "mathics/builtin/graphics.py":2777
 *             builtin = builtins.get(name)
 *             if builtin is None:
 *                 return None             # <<<<<<<<<<<<<<
 *             return builtin.options
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "mathics/builtin/graphics.py":2776
 *         def get_options(name):
 *             builtin = builtins.get(name)
 *             if builtin is None:             # <<<<<<<<<<<<<<
 *                 return None
 *             return builtin.options
 */
  }

  /* "mathics/builtin/graphics.py":2778
 *             if builtin is None:
 *                 return None
 *             return builtin.options             # <<<<<<<<<<<<<<
 * 
 *         def stylebox_style(style, specs):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_builtin, __pyx_n_s_options); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2778, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":2774
 *         builtins = evaluation.definitions.builtin
 * 
 *         def get_options(name):             # <<<<<<<<<<<<<<
 *             builtin = builtins.get(name)
 *             if builtin is None:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("mathics.builtin.graphics._GraphicsElements.__init__.get_options", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_builtin);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":2780
 *             return builtin.options
 * 
 *         def stylebox_style(style, specs):             # <<<<<<<<<<<<<<
 *             new_style = style.clone()
 *             for spec in _flatten(specs):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_17_GraphicsElements_8__init___3stylebox_style(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_17_GraphicsElements_8__init___3stylebox_style = {"stylebox_style", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_17_GraphicsElements_8__init___3stylebox_style, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_17_GraphicsElements_8__init___3stylebox_style(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_style = 0;
  PyObject *__pyx_v_specs = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("stylebox_style (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_style,&__pyx_n_s_specs,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_style)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_specs)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("stylebox_style", 1, 2, 2, 1); __PYX_ERR(0, 2780, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stylebox_style") < 0)) __PYX_ERR(0, 2780, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_style = values[0];
    __pyx_v_specs = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("stylebox_style", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2780, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics._GraphicsElements.__init__.stylebox_style", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_17_GraphicsElements_8__init___2stylebox_style(__pyx_self, __pyx_v_style, __pyx_v_specs);

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_17_GraphicsElements_8__init___2stylebox_style(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_style, PyObject *__pyx_v_specs) {
  PyObject *__pyx_v_new_style = NULL;
  PyObject *__pyx_v_spec = NULL;
  PyObject *__pyx_v_head_name = NULL;
  PyObject *__pyx_v_option = NULL;
  PyObject *__pyx_v_expr = NULL;
  PyObject *__pyx_v_name = NULL;
  PyObject *__pyx_v_create = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *(*__pyx_t_12)(PyObject *);
  int __pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("stylebox_style", 0);

  /* "mathics/builtin/graphics.py":2781
 * 
 *         def stylebox_style(style, specs):
 *             new_style = style.clone()             # <<<<<<<<<<<<<<
 *             for spec in _flatten(specs):
 *                 head_name = spec.get_head_name()
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_style, __pyx_n_s_clone); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2781, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2781, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_new_style = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":2782
 *         def stylebox_style(style, specs):
 *             new_style = style.clone()
 *             for spec in _flatten(specs):             # <<<<<<<<<<<<<<
 *                 head_name = spec.get_head_name()
 *                 if head_name in style_and_form_heads:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_flatten); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2782, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_specs) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_specs);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2782, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_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(0, 2782, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2782, __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))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 2782, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2782, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 2782, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2782, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_5(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 2782, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_spec, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "mathics/builtin/graphics.py":2783
 *             new_style = style.clone()
 *             for spec in _flatten(specs):
 *                 head_name = spec.get_head_name()             # <<<<<<<<<<<<<<
 *                 if head_name in style_and_form_heads:
 *                     new_style.append(spec)
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_spec, __pyx_n_s_get_head_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2783, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2783, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF_SET(__pyx_v_head_name, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "mathics/builtin/graphics.py":2784
 *             for spec in _flatten(specs):
 *                 head_name = spec.get_head_name()
 *                 if head_name in style_and_form_heads:             # <<<<<<<<<<<<<<
 *                     new_style.append(spec)
 *                 elif head_name == "System`Rule" and len(spec.leaves) == 2:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_style_and_form_heads); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2784, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = (__Pyx_PySequence_ContainsTF(__pyx_v_head_name, __pyx_t_1, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 2784, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_8 = (__pyx_t_7 != 0);
    if (__pyx_t_8) {

      /* "mathics/builtin/graphics.py":2785
 *                 head_name = spec.get_head_name()
 *                 if head_name in style_and_form_heads:
 *                     new_style.append(spec)             # <<<<<<<<<<<<<<
 *                 elif head_name == "System`Rule" and len(spec.leaves) == 2:
 *                     option, expr = spec.leaves
 */
      __pyx_t_9 = __Pyx_PyObject_Append(__pyx_v_new_style, __pyx_v_spec); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 2785, __pyx_L1_error)

      /* "mathics/builtin/graphics.py":2784
 *             for spec in _flatten(specs):
 *                 head_name = spec.get_head_name()
 *                 if head_name in style_and_form_heads:             # <<<<<<<<<<<<<<
 *                     new_style.append(spec)
 *                 elif head_name == "System`Rule" and len(spec.leaves) == 2:
 */
      goto __pyx_L5;
    }

    /* "mathics/builtin/graphics.py":2786
 *                 if head_name in style_and_form_heads:
 *                     new_style.append(spec)
 *                 elif head_name == "System`Rule" and len(spec.leaves) == 2:             # <<<<<<<<<<<<<<
 *                     option, expr = spec.leaves
 *                     if not isinstance(option, Symbol):
 */
    __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_head_name, __pyx_kp_u_System_Rule, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 2786, __pyx_L1_error)
    if (__pyx_t_7) {
    } else {
      __pyx_t_8 = __pyx_t_7;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_spec, __pyx_n_s_leaves); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2786, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_10 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2786, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_7 = ((__pyx_t_10 == 2) != 0);
    __pyx_t_8 = __pyx_t_7;
    __pyx_L6_bool_binop_done:;
    if (likely(__pyx_t_8)) {

      /* "mathics/builtin/graphics.py":2787
 *                     new_style.append(spec)
 *                 elif head_name == "System`Rule" and len(spec.leaves) == 2:
 *                     option, expr = spec.leaves             # <<<<<<<<<<<<<<
 *                     if not isinstance(option, Symbol):
 *                         raise BoxConstructError
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_spec, __pyx_n_s_leaves); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2787, __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(0, 2787, __pyx_L1_error)
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_6 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_6);
        #else
        __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2787, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2787, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        #endif
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_11 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2787, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_12 = Py_TYPE(__pyx_t_11)->tp_iternext;
        index = 0; __pyx_t_3 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_3)) goto __pyx_L8_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_3);
        index = 1; __pyx_t_6 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_6)) goto __pyx_L8_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_6);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 2) < 0) __PYX_ERR(0, 2787, __pyx_L1_error)
        __pyx_t_12 = NULL;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        goto __pyx_L9_unpacking_done;
        __pyx_L8_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_12 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        __PYX_ERR(0, 2787, __pyx_L1_error)
        __pyx_L9_unpacking_done:;
      }
      __Pyx_XDECREF_SET(__pyx_v_option, __pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_XDECREF_SET(__pyx_v_expr, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "mathics/builtin/graphics.py":2788
 *                 elif head_name == "System`Rule" and len(spec.leaves) == 2:
 *                     option, expr = spec.leaves
 *                     if not isinstance(option, Symbol):             # <<<<<<<<<<<<<<
 *                         raise BoxConstructError
 * 
 */
      __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Symbol); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2788, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_8 = PyObject_IsInstance(__pyx_v_option, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 2788, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_7 = ((!(__pyx_t_8 != 0)) != 0);
      if (unlikely(__pyx_t_7)) {

        /* "mathics/builtin/graphics.py":2789
 *                     option, expr = spec.leaves
 *                     if not isinstance(option, Symbol):
 *                         raise BoxConstructError             # <<<<<<<<<<<<<<
 * 
 *                     name = option.get_name()
 */
        __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_BoxConstructError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2789, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_Raise(__pyx_t_1, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __PYX_ERR(0, 2789, __pyx_L1_error)

        /* "mathics/builtin/graphics.py":2788
 *                 elif head_name == "System`Rule" and len(spec.leaves) == 2:
 *                     option, expr = spec.leaves
 *                     if not isinstance(option, Symbol):             # <<<<<<<<<<<<<<
 *                         raise BoxConstructError
 * 
 */
      }

      /* "mathics/builtin/graphics.py":2791
 *                         raise BoxConstructError
 * 
 *                     name = option.get_name()             # <<<<<<<<<<<<<<
 *                     create = style_options.get(name, None)
 *                     if create is None:
 */
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_option, __pyx_n_s_get_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2791, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_3 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
        }
      }
      __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2791, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "mathics/builtin/graphics.py":2792
 * 
 *                     name = option.get_name()
 *                     create = style_options.get(name, None)             # <<<<<<<<<<<<<<
 *                     if create is None:
 *                         raise BoxConstructError
 */
      __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_style_options); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2792, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_get); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2792, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      __pyx_t_13 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_13 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_name, Py_None};
        __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2792, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_name, Py_None};
        __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2792, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else
      #endif
      {
        __pyx_t_11 = PyTuple_New(2+__pyx_t_13); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2792, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (__pyx_t_6) {
          __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_6); __pyx_t_6 = NULL;
        }
        __Pyx_INCREF(__pyx_v_name);
        __Pyx_GIVEREF(__pyx_v_name);
        PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_13, __pyx_v_name);
        __Pyx_INCREF(Py_None);
        __Pyx_GIVEREF(Py_None);
        PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_13, Py_None);
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2792, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF_SET(__pyx_v_create, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "mathics/builtin/graphics.py":2793
 *                     name = option.get_name()
 *                     create = style_options.get(name, None)
 *                     if create is None:             # <<<<<<<<<<<<<<
 *                         raise BoxConstructError
 * 
 */
      __pyx_t_7 = (__pyx_v_create == Py_None);
      __pyx_t_8 = (__pyx_t_7 != 0);
      if (unlikely(__pyx_t_8)) {

        /* "mathics/builtin/graphics.py":2794
 *                     create = style_options.get(name, None)
 *                     if create is None:
 *                         raise BoxConstructError             # <<<<<<<<<<<<<<
 * 
 *                     new_style.set_option(name, create(style.graphics, expr))
 */
        __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_BoxConstructError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2794, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_Raise(__pyx_t_1, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __PYX_ERR(0, 2794, __pyx_L1_error)

        /* "mathics/builtin/graphics.py":2793
 *                     name = option.get_name()
 *                     create = style_options.get(name, None)
 *                     if create is None:             # <<<<<<<<<<<<<<
 *                         raise BoxConstructError
 * 
 */
      }

      /* "mathics/builtin/graphics.py":2796
 *                         raise BoxConstructError
 * 
 *                     new_style.set_option(name, create(style.graphics, expr))             # <<<<<<<<<<<<<<
 *                 else:
 *                     raise BoxConstructError
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_new_style, __pyx_n_s_set_option); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2796, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_style, __pyx_n_s_graphics); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2796, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_v_create);
      __pyx_t_14 = __pyx_v_create; __pyx_t_15 = NULL;
      __pyx_t_13 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_14))) {
        __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_14);
        if (likely(__pyx_t_15)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
          __Pyx_INCREF(__pyx_t_15);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_14, function);
          __pyx_t_13 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_14)) {
        PyObject *__pyx_temp[3] = {__pyx_t_15, __pyx_t_6, __pyx_v_expr};
        __pyx_t_11 = __Pyx_PyFunction_FastCall(__pyx_t_14, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2796, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_14)) {
        PyObject *__pyx_temp[3] = {__pyx_t_15, __pyx_t_6, __pyx_v_expr};
        __pyx_t_11 = __Pyx_PyCFunction_FastCall(__pyx_t_14, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2796, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else
      #endif
      {
        __pyx_t_16 = PyTuple_New(2+__pyx_t_13); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 2796, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_16);
        if (__pyx_t_15) {
          __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_15); __pyx_t_15 = NULL;
        }
        __Pyx_GIVEREF(__pyx_t_6);
        PyTuple_SET_ITEM(__pyx_t_16, 0+__pyx_t_13, __pyx_t_6);
        __Pyx_INCREF(__pyx_v_expr);
        __Pyx_GIVEREF(__pyx_v_expr);
        PyTuple_SET_ITEM(__pyx_t_16, 1+__pyx_t_13, __pyx_v_expr);
        __pyx_t_6 = 0;
        __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_16, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2796, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
      }
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_14 = NULL;
      __pyx_t_13 = 0;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_14)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_14);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_13 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_14, __pyx_v_name, __pyx_t_11};
        __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2796, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_14, __pyx_v_name, __pyx_t_11};
        __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2796, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      } else
      #endif
      {
        __pyx_t_16 = PyTuple_New(2+__pyx_t_13); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 2796, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_16);
        if (__pyx_t_14) {
          __Pyx_GIVEREF(__pyx_t_14); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_14); __pyx_t_14 = NULL;
        }
        __Pyx_INCREF(__pyx_v_name);
        __Pyx_GIVEREF(__pyx_v_name);
        PyTuple_SET_ITEM(__pyx_t_16, 0+__pyx_t_13, __pyx_v_name);
        __Pyx_GIVEREF(__pyx_t_11);
        PyTuple_SET_ITEM(__pyx_t_16, 1+__pyx_t_13, __pyx_t_11);
        __pyx_t_11 = 0;
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_16, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2796, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "mathics/builtin/graphics.py":2786
 *                 if head_name in style_and_form_heads:
 *                     new_style.append(spec)
 *                 elif head_name == "System`Rule" and len(spec.leaves) == 2:             # <<<<<<<<<<<<<<
 *                     option, expr = spec.leaves
 *                     if not isinstance(option, Symbol):
 */
      goto __pyx_L5;
    }

    /* "mathics/builtin/graphics.py":2798
 *                     new_style.set_option(name, create(style.graphics, expr))
 *                 else:
 *                     raise BoxConstructError             # <<<<<<<<<<<<<<
 *             return new_style
 * 
 */
    /*else*/ {
      __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_BoxConstructError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2798, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_ERR(0, 2798, __pyx_L1_error)
    }
    __pyx_L5:;

    /* "mathics/builtin/graphics.py":2782
 *         def stylebox_style(style, specs):
 *             new_style = style.clone()
 *             for spec in _flatten(specs):             # <<<<<<<<<<<<<<
 *                 head_name = spec.get_head_name()
 *                 if head_name in style_and_form_heads:
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":2799
 *                 else:
 *                     raise BoxConstructError
 *             return new_style             # <<<<<<<<<<<<<<
 * 
 *         def convert(content, style):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_new_style);
  __pyx_r = __pyx_v_new_style;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":2780
 *             return builtin.options
 * 
 *         def stylebox_style(style, specs):             # <<<<<<<<<<<<<<
 *             new_style = style.clone()
 *             for spec in _flatten(specs):
 */

  /* 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_11);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_AddTraceback("mathics.builtin.graphics._GraphicsElements.__init__.stylebox_style", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_new_style);
  __Pyx_XDECREF(__pyx_v_spec);
  __Pyx_XDECREF(__pyx_v_head_name);
  __Pyx_XDECREF(__pyx_v_option);
  __Pyx_XDECREF(__pyx_v_expr);
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XDECREF(__pyx_v_create);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7mathics_7builtin_8graphics_17_GraphicsElements_8__init___6generator45(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "mathics/builtin/graphics.py":2801
 *             return new_style
 * 
 *         def convert(content, style):             # <<<<<<<<<<<<<<
 *             if content.has_form("List", None):
 *                 items = content.leaves
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_17_GraphicsElements_8__init___5convert(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_17_GraphicsElements_8__init___5convert = {"convert", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_17_GraphicsElements_8__init___5convert, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_17_GraphicsElements_8__init___5convert(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_content = 0;
  PyObject *__pyx_v_style = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("convert (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_content,&__pyx_n_s_style,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_content)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_style)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("convert", 1, 2, 2, 1); __PYX_ERR(0, 2801, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "convert") < 0)) __PYX_ERR(0, 2801, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_content = values[0];
    __pyx_v_style = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("convert", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2801, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics._GraphicsElements.__init__.convert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_17_GraphicsElements_8__init___4convert(__pyx_self, __pyx_v_content, __pyx_v_style);

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_17_GraphicsElements_8__init___4convert(PyObject *__pyx_self, PyObject *__pyx_v_content, PyObject *__pyx_v_style) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_72_convert *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("convert", 0);
  __pyx_cur_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_72_convert *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_72_convert(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_72_convert, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_72_convert *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 2801, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_71___init__ *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  __pyx_cur_scope->__pyx_v_content = __pyx_v_content;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_content);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_content);
  __pyx_cur_scope->__pyx_v_style = __pyx_v_style;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_style);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_style);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7mathics_7builtin_8graphics_17_GraphicsElements_8__init___6generator45, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_convert, __pyx_n_s_GraphicsElements___init___local, __pyx_n_s_mathics_builtin_graphics); if (unlikely(!gen)) __PYX_ERR(0, 2801, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics._GraphicsElements.__init__.convert", __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_7mathics_7builtin_8graphics_17_GraphicsElements_8__init___6generator45(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_72_convert *__pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_72_convert *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  PyObject *(*__pyx_t_6)(PyObject *);
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  PyObject *(*__pyx_t_11)(PyObject *);
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  PyObject *(*__pyx_t_15)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("convert", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L12_resume_from_yield;
    case 2: goto __pyx_L17_resume_from_yield;
    case 3: goto __pyx_L20_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2801, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2802
 * 
 *         def convert(content, style):
 *             if content.has_form("List", None):             # <<<<<<<<<<<<<<
 *                 items = content.leaves
 *             else:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_content, __pyx_n_s_has_form); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2802, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2802, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 2802, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "mathics/builtin/graphics.py":2803
 *         def convert(content, style):
 *             if content.has_form("List", None):
 *                 items = content.leaves             # <<<<<<<<<<<<<<
 *             else:
 *                 items = [content]
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_content, __pyx_n_s_leaves); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2803, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_cur_scope->__pyx_v_items = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "mathics/builtin/graphics.py":2802
 * 
 *         def convert(content, style):
 *             if content.has_form("List", None):             # <<<<<<<<<<<<<<
 *                 items = content.leaves
 *             else:
 */
    goto __pyx_L4;
  }

  /* "mathics/builtin/graphics.py":2805
 *                 items = content.leaves
 *             else:
 *                 items = [content]             # <<<<<<<<<<<<<<
 *             style = style.clone()
 *             for item in items:
 */
  /*else*/ {
    __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2805, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_content);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_content);
    PyList_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_content);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_cur_scope->__pyx_v_items = __pyx_t_2;
    __pyx_t_2 = 0;
  }
  __pyx_L4:;

  /* "mathics/builtin/graphics.py":2806
 *             else:
 *                 items = [content]
 *             style = style.clone()             # <<<<<<<<<<<<<<
 *             for item in items:
 *                 if item.get_name() == "System`Null":
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_style, __pyx_n_s_clone); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2806, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2806, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_style);
  __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_style, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":2807
 *                 items = [content]
 *             style = style.clone()
 *             for item in items:             # <<<<<<<<<<<<<<
 *                 if item.get_name() == "System`Null":
 *                     continue
 */
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_items)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_items)) {
    __pyx_t_2 = __pyx_cur_scope->__pyx_v_items; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0;
    __pyx_t_6 = NULL;
  } else {
    __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_items); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2807, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2807, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_6)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 2807, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2807, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 2807, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2807, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_6(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 2807, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_item);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_item, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;

    /* "mathics/builtin/graphics.py":2808
 *             style = style.clone()
 *             for item in items:
 *                 if item.get_name() == "System`Null":             # <<<<<<<<<<<<<<
 *                     continue
 *                 head = item.get_head_name()
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_item, __pyx_n_s_get_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2808, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2808, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_System_Null, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 2808, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_3) {

      /* "mathics/builtin/graphics.py":2809
 *             for item in items:
 *                 if item.get_name() == "System`Null":
 *                     continue             # <<<<<<<<<<<<<<
 *                 head = item.get_head_name()
 *                 if head in style_and_form_heads:
 */
      goto __pyx_L5_continue;

      /* "mathics/builtin/graphics.py":2808
 *             style = style.clone()
 *             for item in items:
 *                 if item.get_name() == "System`Null":             # <<<<<<<<<<<<<<
 *                     continue
 *                 head = item.get_head_name()
 */
    }

    /* "mathics/builtin/graphics.py":2810
 *                 if item.get_name() == "System`Null":
 *                     continue
 *                 head = item.get_head_name()             # <<<<<<<<<<<<<<
 *                 if head in style_and_form_heads:
 *                     style.append(item)
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_item, __pyx_n_s_get_head_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2810, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2810, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_head);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_head, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;

    /* "mathics/builtin/graphics.py":2811
 *                     continue
 *                 head = item.get_head_name()
 *                 if head in style_and_form_heads:             # <<<<<<<<<<<<<<
 *                     style.append(item)
 *                 elif head == "System`StyleBox":
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_style_and_form_heads); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2811, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_cur_scope->__pyx_v_head, __pyx_t_1, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 2811, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_8 = (__pyx_t_3 != 0);
    if (__pyx_t_8) {

      /* "mathics/builtin/graphics.py":2812
 *                 head = item.get_head_name()
 *                 if head in style_and_form_heads:
 *                     style.append(item)             # <<<<<<<<<<<<<<
 *                 elif head == "System`StyleBox":
 *                     if len(item.leaves) < 1:
 */
      __pyx_t_9 = __Pyx_PyObject_Append(__pyx_cur_scope->__pyx_v_style, __pyx_cur_scope->__pyx_v_item); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 2812, __pyx_L1_error)

      /* "mathics/builtin/graphics.py":2811
 *                     continue
 *                 head = item.get_head_name()
 *                 if head in style_and_form_heads:             # <<<<<<<<<<<<<<
 *                     style.append(item)
 *                 elif head == "System`StyleBox":
 */
      goto __pyx_L8;
    }

    /* "mathics/builtin/graphics.py":2813
 *                 if head in style_and_form_heads:
 *                     style.append(item)
 *                 elif head == "System`StyleBox":             # <<<<<<<<<<<<<<
 *                     if len(item.leaves) < 1:
 *                         raise BoxConstructError
 */
    __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_cur_scope->__pyx_v_head, __pyx_kp_u_System_StyleBox, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 2813, __pyx_L1_error)
    if (__pyx_t_8) {

      /* "mathics/builtin/graphics.py":2814
 *                     style.append(item)
 *                 elif head == "System`StyleBox":
 *                     if len(item.leaves) < 1:             # <<<<<<<<<<<<<<
 *                         raise BoxConstructError
 *                     for element in convert(
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_item, __pyx_n_s_leaves); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2814, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_10 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2814, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_8 = ((__pyx_t_10 < 1) != 0);
      if (unlikely(__pyx_t_8)) {

        /* "mathics/builtin/graphics.py":2815
 *                 elif head == "System`StyleBox":
 *                     if len(item.leaves) < 1:
 *                         raise BoxConstructError             # <<<<<<<<<<<<<<
 *                     for element in convert(
 *                         item.leaves[0], stylebox_style(style, item.leaves[1:])
 */
        __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_BoxConstructError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2815, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_Raise(__pyx_t_1, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __PYX_ERR(0, 2815, __pyx_L1_error)

        /* "mathics/builtin/graphics.py":2814
 *                     style.append(item)
 *                 elif head == "System`StyleBox":
 *                     if len(item.leaves) < 1:             # <<<<<<<<<<<<<<
 *                         raise BoxConstructError
 *                     for element in convert(
 */
      }

      /* "mathics/builtin/graphics.py":2817
 *                         raise BoxConstructError
 *                     for element in convert(
 *                         item.leaves[0], stylebox_style(style, item.leaves[1:])             # <<<<<<<<<<<<<<
 *                     ):
 *                         yield element
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_item, __pyx_n_s_leaves); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2817, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2817, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_item, __pyx_n_s_leaves); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2817, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_7 = __Pyx_PyObject_GetSlice(__pyx_t_1, 1, 0, NULL, NULL, &__pyx_slice__13, 1, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2817, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_stylebox_style)) { __Pyx_RaiseClosureNameError("stylebox_style"); __PYX_ERR(0, 2817, __pyx_L1_error) }
      __pyx_t_1 = __pyx_pf_7mathics_7builtin_8graphics_17_GraphicsElements_8__init___2stylebox_style(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_stylebox_style, __pyx_cur_scope->__pyx_v_style, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2817, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "mathics/builtin/graphics.py":2816
 *                     if len(item.leaves) < 1:
 *                         raise BoxConstructError
 *                     for element in convert(             # <<<<<<<<<<<<<<
 *                         item.leaves[0], stylebox_style(style, item.leaves[1:])
 *                     ):
 */
      if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_convert)) { __Pyx_RaiseClosureNameError("convert"); __PYX_ERR(0, 2816, __pyx_L1_error) }
      __pyx_t_7 = __pyx_pf_7mathics_7builtin_8graphics_17_GraphicsElements_8__init___4convert(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_convert, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2816, __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;
      if (likely(PyList_CheckExact(__pyx_t_7)) || PyTuple_CheckExact(__pyx_t_7)) {
        __pyx_t_1 = __pyx_t_7; __Pyx_INCREF(__pyx_t_1); __pyx_t_10 = 0;
        __pyx_t_11 = NULL;
      } else {
        __pyx_t_10 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2816, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_11 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2816, __pyx_L1_error)
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      for (;;) {
        if (likely(!__pyx_t_11)) {
          if (likely(PyList_CheckExact(__pyx_t_1))) {
            if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_1)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_7 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_10); __Pyx_INCREF(__pyx_t_7); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 2816, __pyx_L1_error)
            #else
            __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2816, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_7);
            #endif
          } else {
            if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_10); __Pyx_INCREF(__pyx_t_7); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 2816, __pyx_L1_error)
            #else
            __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2816, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_7);
            #endif
          }
        } else {
          __pyx_t_7 = __pyx_t_11(__pyx_t_1);
          if (unlikely(!__pyx_t_7)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 2816, __pyx_L1_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_7);
        }
        __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_element);
        __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_element, __pyx_t_7);
        __Pyx_GIVEREF(__pyx_t_7);
        __pyx_t_7 = 0;

        /* "mathics/builtin/graphics.py":2819
 *                         item.leaves[0], stylebox_style(style, item.leaves[1:])
 *                     ):
 *                         yield element             # <<<<<<<<<<<<<<
 *                 elif head[-3:] == "Box":  # and head[:-3] in element_heads:
 *                     element_class = get_class(head)
 */
        __Pyx_INCREF(__pyx_cur_scope->__pyx_v_element);
        __pyx_r = __pyx_cur_scope->__pyx_v_element;
        __Pyx_XGIVEREF(__pyx_t_1);
        __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
        __Pyx_XGIVEREF(__pyx_t_2);
        __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
        __pyx_cur_scope->__pyx_t_2 = __pyx_t_5;
        __pyx_cur_scope->__pyx_t_3 = __pyx_t_6;
        __pyx_cur_scope->__pyx_t_4 = __pyx_t_10;
        __pyx_cur_scope->__pyx_t_5 = __pyx_t_11;
        __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_L12_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_cur_scope->__pyx_t_1 = 0;
        __Pyx_XGOTREF(__pyx_t_2);
        __pyx_t_5 = __pyx_cur_scope->__pyx_t_2;
        __pyx_t_6 = __pyx_cur_scope->__pyx_t_3;
        __pyx_t_10 = __pyx_cur_scope->__pyx_t_4;
        __pyx_t_11 = __pyx_cur_scope->__pyx_t_5;
        if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2819, __pyx_L1_error)

        /* "mathics/builtin/graphics.py":2816
 *                     if len(item.leaves) < 1:
 *                         raise BoxConstructError
 *                     for element in convert(             # <<<<<<<<<<<<<<
 *                         item.leaves[0], stylebox_style(style, item.leaves[1:])
 *                     ):
 */
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "mathics/builtin/graphics.py":2813
 *                 if head in style_and_form_heads:
 *                     style.append(item)
 *                 elif head == "System`StyleBox":             # <<<<<<<<<<<<<<
 *                     if len(item.leaves) < 1:
 *                         raise BoxConstructError
 */
      goto __pyx_L8;
    }

    /* "mathics/builtin/graphics.py":2820
 *                     ):
 *                         yield element
 *                 elif head[-3:] == "Box":  # and head[:-3] in element_heads:             # <<<<<<<<<<<<<<
 *                     element_class = get_class(head)
 *                     if element_class is not None:
 */
    __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_cur_scope->__pyx_v_head, -3L, 0, NULL, NULL, &__pyx_slice__112, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2820, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_Box, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 2820, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_8) {

      /* "mathics/builtin/graphics.py":2821
 *                         yield element
 *                 elif head[-3:] == "Box":  # and head[:-3] in element_heads:
 *                     element_class = get_class(head)             # <<<<<<<<<<<<<<
 *                     if element_class is not None:
 *                         options = get_options(head[:-3])
 */
      __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_get_class); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2821, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_4, __pyx_cur_scope->__pyx_v_head) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_cur_scope->__pyx_v_head);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2821, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_element_class);
      __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_element_class, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      __pyx_t_1 = 0;

      /* "mathics/builtin/graphics.py":2822
 *                 elif head[-3:] == "Box":  # and head[:-3] in element_heads:
 *                     element_class = get_class(head)
 *                     if element_class is not None:             # <<<<<<<<<<<<<<
 *                         options = get_options(head[:-3])
 *                         if options:
 */
      __pyx_t_8 = (__pyx_cur_scope->__pyx_v_element_class != Py_None);
      __pyx_t_3 = (__pyx_t_8 != 0);
      if (likely(__pyx_t_3)) {

        /* "mathics/builtin/graphics.py":2823
 *                     element_class = get_class(head)
 *                     if element_class is not None:
 *                         options = get_options(head[:-3])             # <<<<<<<<<<<<<<
 *                         if options:
 *                             data, options = _data_and_options(item.leaves, options)
 */
        __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_cur_scope->__pyx_v_head, 0, -3L, NULL, NULL, &__pyx_slice__113, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2823, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_get_options)) { __Pyx_RaiseClosureNameError("get_options"); __PYX_ERR(0, 2823, __pyx_L1_error) }
        __pyx_t_7 = __pyx_pf_7mathics_7builtin_8graphics_17_GraphicsElements_8__init___get_options(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_get_options, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2823, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_options);
        __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_options, __pyx_t_7);
        __Pyx_GIVEREF(__pyx_t_7);
        __pyx_t_7 = 0;

        /* "mathics/builtin/graphics.py":2824
 *                     if element_class is not None:
 *                         options = get_options(head[:-3])
 *                         if options:             # <<<<<<<<<<<<<<
 *                             data, options = _data_and_options(item.leaves, options)
 *                             new_item = Expression(head, *data)
 */
        __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_options); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 2824, __pyx_L1_error)
        if (__pyx_t_3) {

          /* "mathics/builtin/graphics.py":2825
 *                         options = get_options(head[:-3])
 *                         if options:
 *                             data, options = _data_and_options(item.leaves, options)             # <<<<<<<<<<<<<<
 *                             new_item = Expression(head, *data)
 *                             element = get_class(head)(self, style, new_item, options)
 */
          __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_data_and_options); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2825, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_item, __pyx_n_s_leaves); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2825, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_12 = NULL;
          __pyx_t_13 = 0;
          if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
            __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_1);
            if (likely(__pyx_t_12)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
              __Pyx_INCREF(__pyx_t_12);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_1, function);
              __pyx_t_13 = 1;
            }
          }
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_1)) {
            PyObject *__pyx_temp[3] = {__pyx_t_12, __pyx_t_4, __pyx_cur_scope->__pyx_v_options};
            __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2825, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
            __Pyx_GOTREF(__pyx_t_7);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
            PyObject *__pyx_temp[3] = {__pyx_t_12, __pyx_t_4, __pyx_cur_scope->__pyx_v_options};
            __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2825, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
            __Pyx_GOTREF(__pyx_t_7);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          } else
          #endif
          {
            __pyx_t_14 = PyTuple_New(2+__pyx_t_13); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2825, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_14);
            if (__pyx_t_12) {
              __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_12); __pyx_t_12 = NULL;
            }
            __Pyx_GIVEREF(__pyx_t_4);
            PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_13, __pyx_t_4);
            __Pyx_INCREF(__pyx_cur_scope->__pyx_v_options);
            __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_options);
            PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_13, __pyx_cur_scope->__pyx_v_options);
            __pyx_t_4 = 0;
            __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_14, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2825, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_7);
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          }
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          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(0, 2825, __pyx_L1_error)
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            if (likely(PyTuple_CheckExact(sequence))) {
              __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
              __pyx_t_14 = PyTuple_GET_ITEM(sequence, 1); 
            } else {
              __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
              __pyx_t_14 = PyList_GET_ITEM(sequence, 1); 
            }
            __Pyx_INCREF(__pyx_t_1);
            __Pyx_INCREF(__pyx_t_14);
            #else
            __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2825, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_14 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2825, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_14);
            #endif
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          } else {
            Py_ssize_t index = -1;
            __pyx_t_4 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2825, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            __pyx_t_15 = Py_TYPE(__pyx_t_4)->tp_iternext;
            index = 0; __pyx_t_1 = __pyx_t_15(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L15_unpacking_failed;
            __Pyx_GOTREF(__pyx_t_1);
            index = 1; __pyx_t_14 = __pyx_t_15(__pyx_t_4); if (unlikely(!__pyx_t_14)) goto __pyx_L15_unpacking_failed;
            __Pyx_GOTREF(__pyx_t_14);
            if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_4), 2) < 0) __PYX_ERR(0, 2825, __pyx_L1_error)
            __pyx_t_15 = NULL;
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            goto __pyx_L16_unpacking_done;
            __pyx_L15_unpacking_failed:;
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __pyx_t_15 = NULL;
            if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
            __PYX_ERR(0, 2825, __pyx_L1_error)
            __pyx_L16_unpacking_done:;
          }
          __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_data);
          __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_data, __pyx_t_1);
          __Pyx_GIVEREF(__pyx_t_1);
          __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_options);
          __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_options, __pyx_t_14);
          __Pyx_GIVEREF(__pyx_t_14);
          __pyx_t_14 = 0;

          /* "mathics/builtin/graphics.py":2826
 *                         if options:
 *                             data, options = _data_and_options(item.leaves, options)
 *                             new_item = Expression(head, *data)             # <<<<<<<<<<<<<<
 *                             element = get_class(head)(self, style, new_item, options)
 *                         else:
 */
          __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Expression); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2826, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2826, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_14);
          __Pyx_INCREF(__pyx_cur_scope->__pyx_v_head);
          __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_head);
          PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_cur_scope->__pyx_v_head);
          __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_cur_scope->__pyx_v_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2826, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_4 = PyNumber_Add(__pyx_t_14, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2826, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2826, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_new_item);
          __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_new_item, __pyx_t_1);
          __Pyx_GIVEREF(__pyx_t_1);
          __pyx_t_1 = 0;

          /* "mathics/builtin/graphics.py":2827
 *                             data, options = _data_and_options(item.leaves, options)
 *                             new_item = Expression(head, *data)
 *                             element = get_class(head)(self, style, new_item, options)             # <<<<<<<<<<<<<<
 *                         else:
 *                             element = get_class(head)(self, style, item)
 */
          __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_get_class); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2827, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_14 = NULL;
          if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
            __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_7);
            if (likely(__pyx_t_14)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
              __Pyx_INCREF(__pyx_t_14);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_7, function);
            }
          }
          __pyx_t_4 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_14, __pyx_cur_scope->__pyx_v_head) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_cur_scope->__pyx_v_head);
          __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
          if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2827, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 2827, __pyx_L1_error) }
          __pyx_t_7 = NULL;
          __pyx_t_13 = 0;
          if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
            __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
            if (likely(__pyx_t_7)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
              __Pyx_INCREF(__pyx_t_7);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_4, function);
              __pyx_t_13 = 1;
            }
          }
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_4)) {
            PyObject *__pyx_temp[5] = {__pyx_t_7, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_style, __pyx_cur_scope->__pyx_v_new_item, __pyx_cur_scope->__pyx_v_options};
            __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_13, 4+__pyx_t_13); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2827, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_1);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
            PyObject *__pyx_temp[5] = {__pyx_t_7, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_style, __pyx_cur_scope->__pyx_v_new_item, __pyx_cur_scope->__pyx_v_options};
            __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_13, 4+__pyx_t_13); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2827, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_1);
          } else
          #endif
          {
            __pyx_t_14 = PyTuple_New(4+__pyx_t_13); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2827, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_14);
            if (__pyx_t_7) {
              __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_7); __pyx_t_7 = NULL;
            }
            __Pyx_INCREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self);
            __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self);
            PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_13, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_self);
            __Pyx_INCREF(__pyx_cur_scope->__pyx_v_style);
            __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_style);
            PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_13, __pyx_cur_scope->__pyx_v_style);
            __Pyx_INCREF(__pyx_cur_scope->__pyx_v_new_item);
            __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_new_item);
            PyTuple_SET_ITEM(__pyx_t_14, 2+__pyx_t_13, __pyx_cur_scope->__pyx_v_new_item);
            __Pyx_INCREF(__pyx_cur_scope->__pyx_v_options);
            __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_options);
            PyTuple_SET_ITEM(__pyx_t_14, 3+__pyx_t_13, __pyx_cur_scope->__pyx_v_options);
            __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_14, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2827, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          }
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_element);
          __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_element, __pyx_t_1);
          __Pyx_GIVEREF(__pyx_t_1);
          __pyx_t_1 = 0;

          /* "mathics/builtin/graphics.py":2824
 *                     if element_class is not None:
 *                         options = get_options(head[:-3])
 *                         if options:             # <<<<<<<<<<<<<<
 *                             data, options = _data_and_options(item.leaves, options)
 *                             new_item = Expression(head, *data)
 */
          goto __pyx_L14;
        }

        /* "mathics/builtin/graphics.py":2829
 *                             element = get_class(head)(self, style, new_item, options)
 *                         else:
 *                             element = get_class(head)(self, style, item)             # <<<<<<<<<<<<<<
 *                         yield element
 *                     else:
 */
        /*else*/ {
          __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_get_class); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2829, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_14);
          __pyx_t_7 = NULL;
          if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_14))) {
            __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_14);
            if (likely(__pyx_t_7)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
              __Pyx_INCREF(__pyx_t_7);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_14, function);
            }
          }
          __pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_14, __pyx_t_7, __pyx_cur_scope->__pyx_v_head) : __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_cur_scope->__pyx_v_head);
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2829, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 2829, __pyx_L1_error) }
          __pyx_t_14 = NULL;
          __pyx_t_13 = 0;
          if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
            __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_4);
            if (likely(__pyx_t_14)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
              __Pyx_INCREF(__pyx_t_14);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_4, function);
              __pyx_t_13 = 1;
            }
          }
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_4)) {
            PyObject *__pyx_temp[4] = {__pyx_t_14, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_style, __pyx_cur_scope->__pyx_v_item};
            __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_13, 3+__pyx_t_13); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2829, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
            __Pyx_GOTREF(__pyx_t_1);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
            PyObject *__pyx_temp[4] = {__pyx_t_14, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_style, __pyx_cur_scope->__pyx_v_item};
            __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_13, 3+__pyx_t_13); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2829, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
            __Pyx_GOTREF(__pyx_t_1);
          } else
          #endif
          {
            __pyx_t_7 = PyTuple_New(3+__pyx_t_13); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2829, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_7);
            if (__pyx_t_14) {
              __Pyx_GIVEREF(__pyx_t_14); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_14); __pyx_t_14 = NULL;
            }
            __Pyx_INCREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self);
            __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self);
            PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_13, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_self);
            __Pyx_INCREF(__pyx_cur_scope->__pyx_v_style);
            __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_style);
            PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_13, __pyx_cur_scope->__pyx_v_style);
            __Pyx_INCREF(__pyx_cur_scope->__pyx_v_item);
            __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_item);
            PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_13, __pyx_cur_scope->__pyx_v_item);
            __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2829, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          }
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_element);
          __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_element, __pyx_t_1);
          __Pyx_GIVEREF(__pyx_t_1);
          __pyx_t_1 = 0;
        }
        __pyx_L14:;

        /* "mathics/builtin/graphics.py":2830
 *                         else:
 *                             element = get_class(head)(self, style, item)
 *                         yield element             # <<<<<<<<<<<<<<
 *                     else:
 *                         raise BoxConstructError
 */
        __Pyx_INCREF(__pyx_cur_scope->__pyx_v_element);
        __pyx_r = __pyx_cur_scope->__pyx_v_element;
        __Pyx_XGIVEREF(__pyx_t_2);
        __pyx_cur_scope->__pyx_t_0 = __pyx_t_2;
        __pyx_cur_scope->__pyx_t_2 = __pyx_t_5;
        __pyx_cur_scope->__pyx_t_3 = __pyx_t_6;
        __Pyx_XGIVEREF(__pyx_r);
        __Pyx_RefNannyFinishContext();
        __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
        /* return from generator, yielding value */
        __pyx_generator->resume_label = 2;
        return __pyx_r;
        __pyx_L17_resume_from_yield:;
        __pyx_t_2 = __pyx_cur_scope->__pyx_t_0;
        __pyx_cur_scope->__pyx_t_0 = 0;
        __Pyx_XGOTREF(__pyx_t_2);
        __pyx_t_5 = __pyx_cur_scope->__pyx_t_2;
        __pyx_t_6 = __pyx_cur_scope->__pyx_t_3;
        if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2830, __pyx_L1_error)

        /* "mathics/builtin/graphics.py":2822
 *                 elif head[-3:] == "Box":  # and head[:-3] in element_heads:
 *                     element_class = get_class(head)
 *                     if element_class is not None:             # <<<<<<<<<<<<<<
 *                         options = get_options(head[:-3])
 *                         if options:
 */
        goto __pyx_L13;
      }

      /* "mathics/builtin/graphics.py":2832
 *                         yield element
 *                     else:
 *                         raise BoxConstructError             # <<<<<<<<<<<<<<
 *                 elif head == "System`List":
 *                     for element in convert(item, style):
 */
      /*else*/ {
        __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_BoxConstructError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2832, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_Raise(__pyx_t_1, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __PYX_ERR(0, 2832, __pyx_L1_error)
      }
      __pyx_L13:;

      /* "mathics/builtin/graphics.py":2820
 *                     ):
 *                         yield element
 *                 elif head[-3:] == "Box":  # and head[:-3] in element_heads:             # <<<<<<<<<<<<<<
 *                     element_class = get_class(head)
 *                     if element_class is not None:
 */
      goto __pyx_L8;
    }

    /* "mathics/builtin/graphics.py":2833
 *                     else:
 *                         raise BoxConstructError
 *                 elif head == "System`List":             # <<<<<<<<<<<<<<
 *                     for element in convert(item, style):
 *                         yield element
 */
    __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_cur_scope->__pyx_v_head, __pyx_kp_u_System_List, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 2833, __pyx_L1_error)
    if (likely(__pyx_t_3)) {

      /* "mathics/builtin/graphics.py":2834
 *                         raise BoxConstructError
 *                 elif head == "System`List":
 *                     for element in convert(item, style):             # <<<<<<<<<<<<<<
 *                         yield element
 *                 else:
 */
      if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_convert)) { __Pyx_RaiseClosureNameError("convert"); __PYX_ERR(0, 2834, __pyx_L1_error) }
      __pyx_t_1 = __pyx_pf_7mathics_7builtin_8graphics_17_GraphicsElements_8__init___4convert(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_convert, __pyx_cur_scope->__pyx_v_item, __pyx_cur_scope->__pyx_v_style); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2834, __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_10 = 0;
        __pyx_t_11 = NULL;
      } else {
        __pyx_t_10 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2834, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_11 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2834, __pyx_L1_error)
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      for (;;) {
        if (likely(!__pyx_t_11)) {
          if (likely(PyList_CheckExact(__pyx_t_4))) {
            if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_4)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_10); __Pyx_INCREF(__pyx_t_1); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 2834, __pyx_L1_error)
            #else
            __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2834, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_1);
            #endif
          } else {
            if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_10); __Pyx_INCREF(__pyx_t_1); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 2834, __pyx_L1_error)
            #else
            __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2834, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_1);
            #endif
          }
        } else {
          __pyx_t_1 = __pyx_t_11(__pyx_t_4);
          if (unlikely(!__pyx_t_1)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 2834, __pyx_L1_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_1);
        }
        __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_element);
        __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_element, __pyx_t_1);
        __Pyx_GIVEREF(__pyx_t_1);
        __pyx_t_1 = 0;

        /* "mathics/builtin/graphics.py":2835
 *                 elif head == "System`List":
 *                     for element in convert(item, style):
 *                         yield element             # <<<<<<<<<<<<<<
 *                 else:
 *                     raise BoxConstructError
 */
        __Pyx_INCREF(__pyx_cur_scope->__pyx_v_element);
        __pyx_r = __pyx_cur_scope->__pyx_v_element;
        __Pyx_XGIVEREF(__pyx_t_2);
        __pyx_cur_scope->__pyx_t_0 = __pyx_t_2;
        __Pyx_XGIVEREF(__pyx_t_4);
        __pyx_cur_scope->__pyx_t_1 = __pyx_t_4;
        __pyx_cur_scope->__pyx_t_2 = __pyx_t_5;
        __pyx_cur_scope->__pyx_t_3 = __pyx_t_6;
        __pyx_cur_scope->__pyx_t_4 = __pyx_t_10;
        __pyx_cur_scope->__pyx_t_5 = __pyx_t_11;
        __Pyx_XGIVEREF(__pyx_r);
        __Pyx_RefNannyFinishContext();
        __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
        /* return from generator, yielding value */
        __pyx_generator->resume_label = 3;
        return __pyx_r;
        __pyx_L20_resume_from_yield:;
        __pyx_t_2 = __pyx_cur_scope->__pyx_t_0;
        __pyx_cur_scope->__pyx_t_0 = 0;
        __Pyx_XGOTREF(__pyx_t_2);
        __pyx_t_4 = __pyx_cur_scope->__pyx_t_1;
        __pyx_cur_scope->__pyx_t_1 = 0;
        __Pyx_XGOTREF(__pyx_t_4);
        __pyx_t_5 = __pyx_cur_scope->__pyx_t_2;
        __pyx_t_6 = __pyx_cur_scope->__pyx_t_3;
        __pyx_t_10 = __pyx_cur_scope->__pyx_t_4;
        __pyx_t_11 = __pyx_cur_scope->__pyx_t_5;
        if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2835, __pyx_L1_error)

        /* "mathics/builtin/graphics.py":2834
 *                         raise BoxConstructError
 *                 elif head == "System`List":
 *                     for element in convert(item, style):             # <<<<<<<<<<<<<<
 *                         yield element
 *                 else:
 */
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "mathics/builtin/graphics.py":2833
 *                     else:
 *                         raise BoxConstructError
 *                 elif head == "System`List":             # <<<<<<<<<<<<<<
 *                     for element in convert(item, style):
 *                         yield element
 */
      goto __pyx_L8;
    }

    /* "mathics/builtin/graphics.py":2837
 *                         yield element
 *                 else:
 *                     raise BoxConstructError             # <<<<<<<<<<<<<<
 * 
 *         self.elements = list(convert(content, self.get_style_class()(self)))
 */
    /*else*/ {
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_BoxConstructError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2837, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __PYX_ERR(0, 2837, __pyx_L1_error)
    }
    __pyx_L8:;

    /* "mathics/builtin/graphics.py":2807
 *                 items = [content]
 *             style = style.clone()
 *             for item in items:             # <<<<<<<<<<<<<<
 *                 if item.get_name() == "System`Null":
 *                     continue
 */
    __pyx_L5_continue:;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "mathics/builtin/graphics.py":2801
 *             return new_style
 * 
 *         def convert(content, style):             # <<<<<<<<<<<<<<
 *             if content.has_form("List", None):
 *                 items = content.leaves
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  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_12);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_AddTraceback("convert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":2768
 * 
 * class _GraphicsElements(object):
 *     def __init__(self, content, evaluation):             # <<<<<<<<<<<<<<
 *         self.evaluation = evaluation
 *         self.elements = []
 */

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_17_GraphicsElements___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_content, PyObject *__pyx_v_evaluation) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_71___init__ *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);
  __pyx_cur_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_71___init__ *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_71___init__(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_71___init__, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_71___init__ *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 2768, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self);

  /* "mathics/builtin/graphics.py":2769
 * class _GraphicsElements(object):
 *     def __init__(self, content, evaluation):
 *         self.evaluation = evaluation             # <<<<<<<<<<<<<<
 *         self.elements = []
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_evaluation, __pyx_v_evaluation) < 0) __PYX_ERR(0, 2769, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2770
 *     def __init__(self, content, evaluation):
 *         self.evaluation = evaluation
 *         self.elements = []             # <<<<<<<<<<<<<<
 * 
 *         builtins = evaluation.definitions.builtin
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2770, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_elements, __pyx_t_1) < 0) __PYX_ERR(0, 2770, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":2772
 *         self.elements = []
 * 
 *         builtins = evaluation.definitions.builtin             # <<<<<<<<<<<<<<
 * 
 *         def get_options(name):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_evaluation, __pyx_n_s_definitions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2772, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_builtin); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2772, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_cur_scope->__pyx_v_builtins = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":2774
 *         builtins = evaluation.definitions.builtin
 * 
 *         def get_options(name):             # <<<<<<<<<<<<<<
 *             builtin = builtins.get(name)
 *             if builtin is None:
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_17_GraphicsElements_8__init___1get_options, 0, __pyx_n_s_GraphicsElements___init___local_2, ((PyObject*)__pyx_cur_scope), __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__115)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2774, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_cur_scope->__pyx_v_get_options = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":2780
 *             return builtin.options
 * 
 *         def stylebox_style(style, specs):             # <<<<<<<<<<<<<<
 *             new_style = style.clone()
 *             for spec in _flatten(specs):
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_17_GraphicsElements_8__init___3stylebox_style, 0, __pyx_n_s_GraphicsElements___init___local_3, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__117)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2780, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_cur_scope->__pyx_v_stylebox_style = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":2801
 *             return new_style
 * 
 *         def convert(content, style):             # <<<<<<<<<<<<<<
 *             if content.has_form("List", None):
 *                 items = content.leaves
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_17_GraphicsElements_8__init___5convert, 0, __pyx_n_s_GraphicsElements___init___local, ((PyObject*)__pyx_cur_scope), __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__119)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2801, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_cur_scope->__pyx_v_convert = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":2839
 *                     raise BoxConstructError
 * 
 *         self.elements = list(convert(content, self.get_style_class()(self)))             # <<<<<<<<<<<<<<
 * 
 *     def create_style(self, expr):
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_get_style_class); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2839, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2839, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_cur_scope->__pyx_v_self) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_cur_scope->__pyx_v_self);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2839, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __pyx_pf_7mathics_7builtin_8graphics_17_GraphicsElements_8__init___4convert(__pyx_cur_scope->__pyx_v_convert, __pyx_v_content, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2839, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PySequence_List(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2839, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_elements, __pyx_t_2) < 0) __PYX_ERR(0, 2839, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":2768
 * 
 * class _GraphicsElements(object):
 *     def __init__(self, content, evaluation):             # <<<<<<<<<<<<<<
 *         self.evaluation = evaluation
 *         self.elements = []
 */

  /* 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("mathics.builtin.graphics._GraphicsElements.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":2841
 *         self.elements = list(convert(content, self.get_style_class()(self)))
 * 
 *     def create_style(self, expr):             # <<<<<<<<<<<<<<
 *         style = self.get_style_class()(self)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_17_GraphicsElements_3create_style(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_17_GraphicsElements_3create_style = {"create_style", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_17_GraphicsElements_3create_style, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_17_GraphicsElements_3create_style(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_expr = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("create_style (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_expr,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_expr)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("create_style", 1, 2, 2, 1); __PYX_ERR(0, 2841, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "create_style") < 0)) __PYX_ERR(0, 2841, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_expr = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("create_style", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2841, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics._GraphicsElements.create_style", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_17_GraphicsElements_2create_style(__pyx_self, __pyx_v_self, __pyx_v_expr);

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

/* "mathics/builtin/graphics.py":2844
 *         style = self.get_style_class()(self)
 * 
 *         def convert(expr):             # <<<<<<<<<<<<<<
 *             if expr.has_form(("List", "Directive"), None):
 *                 for item in expr.leaves:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_17_GraphicsElements_12create_style_1convert(PyObject *__pyx_self, PyObject *__pyx_v_expr); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_17_GraphicsElements_12create_style_1convert = {"convert", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_17_GraphicsElements_12create_style_1convert, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_17_GraphicsElements_12create_style_1convert(PyObject *__pyx_self, PyObject *__pyx_v_expr) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("convert (wrapper)", 0);
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_17_GraphicsElements_12create_style_convert(__pyx_self, ((PyObject *)__pyx_v_expr));

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_17_GraphicsElements_12create_style_convert(PyObject *__pyx_self, PyObject *__pyx_v_expr) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_73_create_style *__pyx_cur_scope;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_73_create_style *__pyx_outer_scope;
  PyObject *__pyx_v_item = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("convert", 0);
  __pyx_outer_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_73_create_style *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "mathics/builtin/graphics.py":2845
 * 
 *         def convert(expr):
 *             if expr.has_form(("List", "Directive"), None):             # <<<<<<<<<<<<<<
 *                 for item in expr.leaves:
 *                     convert(item)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_expr, __pyx_n_s_has_form); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2845, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__121, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2845, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 2845, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "mathics/builtin/graphics.py":2846
 *         def convert(expr):
 *             if expr.has_form(("List", "Directive"), None):
 *                 for item in expr.leaves:             # <<<<<<<<<<<<<<
 *                     convert(item)
 *             else:
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_expr, __pyx_n_s_leaves); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2846, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
      __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0;
      __pyx_t_5 = NULL;
    } else {
      __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2846, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2846, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    for (;;) {
      if (likely(!__pyx_t_5)) {
        if (likely(PyList_CheckExact(__pyx_t_1))) {
          if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 2846, __pyx_L1_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2846, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        } else {
          if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 2846, __pyx_L1_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2846, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        }
      } else {
        __pyx_t_2 = __pyx_t_5(__pyx_t_1);
        if (unlikely(!__pyx_t_2)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 2846, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "mathics/builtin/graphics.py":2847
 *             if expr.has_form(("List", "Directive"), None):
 *                 for item in expr.leaves:
 *                     convert(item)             # <<<<<<<<<<<<<<
 *             else:
 *                 style.append(expr)
 */
      if (unlikely(!__pyx_cur_scope->__pyx_v_convert)) { __Pyx_RaiseClosureNameError("convert"); __PYX_ERR(0, 2847, __pyx_L1_error) }
      __pyx_t_2 = __pyx_pf_7mathics_7builtin_8graphics_17_GraphicsElements_12create_style_convert(__pyx_cur_scope->__pyx_v_convert, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2847, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "mathics/builtin/graphics.py":2846
 *         def convert(expr):
 *             if expr.has_form(("List", "Directive"), None):
 *                 for item in expr.leaves:             # <<<<<<<<<<<<<<
 *                     convert(item)
 *             else:
 */
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "mathics/builtin/graphics.py":2845
 * 
 *         def convert(expr):
 *             if expr.has_form(("List", "Directive"), None):             # <<<<<<<<<<<<<<
 *                 for item in expr.leaves:
 *                     convert(item)
 */
    goto __pyx_L3;
  }

  /* "mathics/builtin/graphics.py":2849
 *                     convert(item)
 *             else:
 *                 style.append(expr)             # <<<<<<<<<<<<<<
 * 
 *         convert(expr)
 */
  /*else*/ {
    if (unlikely(!__pyx_cur_scope->__pyx_v_style)) { __Pyx_RaiseClosureNameError("style"); __PYX_ERR(0, 2849, __pyx_L1_error) }
    __pyx_t_6 = __Pyx_PyObject_Append(__pyx_cur_scope->__pyx_v_style, __pyx_v_expr); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 2849, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "mathics/builtin/graphics.py":2844
 *         style = self.get_style_class()(self)
 * 
 *         def convert(expr):             # <<<<<<<<<<<<<<
 *             if expr.has_form(("List", "Directive"), None):
 *                 for item in expr.leaves:
 */

  /* 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("mathics.builtin.graphics._GraphicsElements.create_style.convert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_item);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":2841
 *         self.elements = list(convert(content, self.get_style_class()(self)))
 * 
 *     def create_style(self, expr):             # <<<<<<<<<<<<<<
 *         style = self.get_style_class()(self)
 * 
 */

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_17_GraphicsElements_2create_style(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_expr) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_73_create_style *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("create_style", 0);
  __pyx_cur_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_73_create_style *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_73_create_style(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_73_create_style, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_73_create_style *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 2841, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }

  /* "mathics/builtin/graphics.py":2842
 * 
 *     def create_style(self, expr):
 *         style = self.get_style_class()(self)             # <<<<<<<<<<<<<<
 * 
 *         def convert(expr):
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_get_style_class); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2842, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2842, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_self) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_self);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2842, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_style = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":2844
 *         style = self.get_style_class()(self)
 * 
 *         def convert(expr):             # <<<<<<<<<<<<<<
 *             if expr.has_form(("List", "Directive"), None):
 *                 for item in expr.leaves:
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_17_GraphicsElements_12create_style_1convert, 0, __pyx_n_s_GraphicsElements_create_style_l, ((PyObject*)__pyx_cur_scope), __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__123)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2844, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_convert = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":2851
 *                 style.append(expr)
 * 
 *         convert(expr)             # <<<<<<<<<<<<<<
 *         return style
 * 
 */
  __pyx_t_1 = __pyx_pf_7mathics_7builtin_8graphics_17_GraphicsElements_12create_style_convert(__pyx_cur_scope->__pyx_v_convert, __pyx_v_expr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2851, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":2852
 * 
 *         convert(expr)
 *         return style             # <<<<<<<<<<<<<<
 * 
 *     def get_style_class(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_style);
  __pyx_r = __pyx_cur_scope->__pyx_v_style;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":2841
 *         self.elements = list(convert(content, self.get_style_class()(self)))
 * 
 *     def create_style(self, expr):             # <<<<<<<<<<<<<<
 *         style = self.get_style_class()(self)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("mathics.builtin.graphics._GraphicsElements.create_style", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":2854
 *         return style
 * 
 *     def get_style_class(self):             # <<<<<<<<<<<<<<
 *         return Style
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_17_GraphicsElements_5get_style_class(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_17_GraphicsElements_5get_style_class = {"get_style_class", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_17_GraphicsElements_5get_style_class, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_17_GraphicsElements_5get_style_class(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_style_class (wrapper)", 0);
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_17_GraphicsElements_4get_style_class(__pyx_self, ((PyObject *)__pyx_v_self));

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

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

  /* "mathics/builtin/graphics.py":2855
 * 
 *     def get_style_class(self):
 *         return Style             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Style); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2855, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":2854
 *         return style
 * 
 *     def get_style_class(self):             # <<<<<<<<<<<<<<
 *         return Style
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("mathics.builtin.graphics._GraphicsElements.get_style_class", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":2861
 *     coords = Coords
 * 
 *     def __init__(self, content, evaluation, neg_y=False):             # <<<<<<<<<<<<<<
 *         super(GraphicsElements, self).__init__(content, evaluation)
 *         self.neg_y = neg_y
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_16GraphicsElements_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_16GraphicsElements_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_16GraphicsElements_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_16GraphicsElements_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_content = 0;
  PyObject *__pyx_v_evaluation = 0;
  PyObject *__pyx_v_neg_y = 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);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_content,&__pyx_n_s_evaluation,&__pyx_n_s_neg_y,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = ((PyObject *)((PyObject *)Py_False));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_content)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, 1); __PYX_ERR(0, 2861, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_evaluation)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, 2); __PYX_ERR(0, 2861, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_neg_y);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 2861, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_content = values[1];
    __pyx_v_evaluation = values[2];
    __pyx_v_neg_y = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2861, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.GraphicsElements.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_16GraphicsElements___init__(__pyx_self, __pyx_v_self, __pyx_v_content, __pyx_v_evaluation, __pyx_v_neg_y);

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

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

  /* "mathics/builtin/graphics.py":2862
 * 
 *     def __init__(self, content, evaluation, neg_y=False):
 *         super(GraphicsElements, self).__init__(content, evaluation)             # <<<<<<<<<<<<<<
 *         self.neg_y = neg_y
 *         self.xmin = self.ymin = self.pixel_width = None
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_GraphicsElements); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2862, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2862, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_INCREF(__pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2862, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2862, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_content, __pyx_v_evaluation};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2862, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_content, __pyx_v_evaluation};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2862, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2862, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_2) {
      __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
    }
    __Pyx_INCREF(__pyx_v_content);
    __Pyx_GIVEREF(__pyx_v_content);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_content);
    __Pyx_INCREF(__pyx_v_evaluation);
    __Pyx_GIVEREF(__pyx_v_evaluation);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_evaluation);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2862, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":2863
 *     def __init__(self, content, evaluation, neg_y=False):
 *         super(GraphicsElements, self).__init__(content, evaluation)
 *         self.neg_y = neg_y             # <<<<<<<<<<<<<<
 *         self.xmin = self.ymin = self.pixel_width = None
 *         self.pixel_height = self.extent_width = self.extent_height = None
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_neg_y, __pyx_v_neg_y) < 0) __PYX_ERR(0, 2863, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2864
 *         super(GraphicsElements, self).__init__(content, evaluation)
 *         self.neg_y = neg_y
 *         self.xmin = self.ymin = self.pixel_width = None             # <<<<<<<<<<<<<<
 *         self.pixel_height = self.extent_width = self.extent_height = None
 *         self.view_width = None
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_xmin, Py_None) < 0) __PYX_ERR(0, 2864, __pyx_L1_error)
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_ymin, Py_None) < 0) __PYX_ERR(0, 2864, __pyx_L1_error)
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_pixel_width, Py_None) < 0) __PYX_ERR(0, 2864, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2865
 *         self.neg_y = neg_y
 *         self.xmin = self.ymin = self.pixel_width = None
 *         self.pixel_height = self.extent_width = self.extent_height = None             # <<<<<<<<<<<<<<
 *         self.view_width = None
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_pixel_height, Py_None) < 0) __PYX_ERR(0, 2865, __pyx_L1_error)
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_extent_width, Py_None) < 0) __PYX_ERR(0, 2865, __pyx_L1_error)
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_extent_height, Py_None) < 0) __PYX_ERR(0, 2865, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2866
 *         self.xmin = self.ymin = self.pixel_width = None
 *         self.pixel_height = self.extent_width = self.extent_height = None
 *         self.view_width = None             # <<<<<<<<<<<<<<
 * 
 *     def translate(self, coords):
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_view_width, Py_None) < 0) __PYX_ERR(0, 2866, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2861
 *     coords = Coords
 * 
 *     def __init__(self, content, evaluation, neg_y=False):             # <<<<<<<<<<<<<<
 *         super(GraphicsElements, self).__init__(content, evaluation)
 *         self.neg_y = neg_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_5);
  __Pyx_AddTraceback("mathics.builtin.graphics.GraphicsElements.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":2868
 *         self.view_width = None
 * 
 *     def translate(self, coords):             # <<<<<<<<<<<<<<
 *         if self.pixel_width is not None:
 *             w = self.extent_width if self.extent_width > 0 else 1
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_16GraphicsElements_3translate(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_16GraphicsElements_3translate = {"translate", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_16GraphicsElements_3translate, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_16GraphicsElements_3translate(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_coords = 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);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_coords,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_coords)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("translate", 1, 2, 2, 1); __PYX_ERR(0, 2868, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "translate") < 0)) __PYX_ERR(0, 2868, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_coords = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("translate", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2868, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.GraphicsElements.translate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_16GraphicsElements_2translate(__pyx_self, __pyx_v_self, __pyx_v_coords);

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_16GraphicsElements_2translate(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_coords) {
  PyObject *__pyx_v_w = NULL;
  PyObject *__pyx_v_h = NULL;
  PyObject *__pyx_v_result = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("translate", 0);

  /* "mathics/builtin/graphics.py":2869
 * 
 *     def translate(self, coords):
 *         if self.pixel_width is not None:             # <<<<<<<<<<<<<<
 *             w = self.extent_width if self.extent_width > 0 else 1
 *             h = self.extent_height if self.extent_height > 0 else 1
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_pixel_width); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2869, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "mathics/builtin/graphics.py":2870
 *     def translate(self, coords):
 *         if self.pixel_width is not None:
 *             w = self.extent_width if self.extent_width > 0 else 1             # <<<<<<<<<<<<<<
 *             h = self.extent_height if self.extent_height > 0 else 1
 *             result = [
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_extent_width); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2870, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2870, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 2870, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_3) {
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_extent_width); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2870, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_1 = __pyx_t_5;
      __pyx_t_5 = 0;
    } else {
      __Pyx_INCREF(__pyx_int_1);
      __pyx_t_1 = __pyx_int_1;
    }
    __pyx_v_w = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "mathics/builtin/graphics.py":2871
 *         if self.pixel_width is not None:
 *             w = self.extent_width if self.extent_width > 0 else 1
 *             h = self.extent_height if self.extent_height > 0 else 1             # <<<<<<<<<<<<<<
 *             result = [
 *                 (coords[0] - self.xmin) * self.pixel_width / w,
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_extent_height); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2871, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2871, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 2871, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_3) {
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_extent_height); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2871, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __pyx_t_4;
      __pyx_t_4 = 0;
    } else {
      __Pyx_INCREF(__pyx_int_1);
      __pyx_t_1 = __pyx_int_1;
    }
    __pyx_v_h = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "mathics/builtin/graphics.py":2873
 *             h = self.extent_height if self.extent_height > 0 else 1
 *             result = [
 *                 (coords[0] - self.xmin) * self.pixel_width / w,             # <<<<<<<<<<<<<<
 *                 (coords[1] - self.ymin) * self.pixel_height / h,
 *             ]
 */
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_coords, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2873, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_xmin); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2873, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyNumber_Subtract(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2873, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_pixel_width); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2873, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyNumber_Multiply(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2873, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_v_w); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2873, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "mathics/builtin/graphics.py":2874
 *             result = [
 *                 (coords[0] - self.xmin) * self.pixel_width / w,
 *                 (coords[1] - self.ymin) * self.pixel_height / h,             # <<<<<<<<<<<<<<
 *             ]
 *             if self.neg_y:
 */
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_coords, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2874, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ymin); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2874, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyNumber_Subtract(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2874, __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_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_pixel_height); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2874, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyNumber_Multiply(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2874, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_v_h); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2874, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "mathics/builtin/graphics.py":2872
 *             w = self.extent_width if self.extent_width > 0 else 1
 *             h = self.extent_height if self.extent_height > 0 else 1
 *             result = [             # <<<<<<<<<<<<<<
 *                 (coords[0] - self.xmin) * self.pixel_width / w,
 *                 (coords[1] - self.ymin) * self.pixel_height / h,
 */
    __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2872, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_4);
    PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyList_SET_ITEM(__pyx_t_1, 1, __pyx_t_5);
    __pyx_t_4 = 0;
    __pyx_t_5 = 0;
    __pyx_v_result = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "mathics/builtin/graphics.py":2876
 *                 (coords[1] - self.ymin) * self.pixel_height / h,
 *             ]
 *             if self.neg_y:             # <<<<<<<<<<<<<<
 *                 result[1] = self.pixel_height - result[1]
 *             return tuple(result)
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_neg_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2876, __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(0, 2876, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_3) {

      /* "mathics/builtin/graphics.py":2877
 *             ]
 *             if self.neg_y:
 *                 result[1] = self.pixel_height - result[1]             # <<<<<<<<<<<<<<
 *             return tuple(result)
 *         else:
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_pixel_height); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2877, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_result, 1, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2877, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = PyNumber_Subtract(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2877, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(__Pyx_SetItemInt(__pyx_v_result, 1, __pyx_t_4, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 2877, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "mathics/builtin/graphics.py":2876
 *                 (coords[1] - self.ymin) * self.pixel_height / h,
 *             ]
 *             if self.neg_y:             # <<<<<<<<<<<<<<
 *                 result[1] = self.pixel_height - result[1]
 *             return tuple(result)
 */
    }

    /* "mathics/builtin/graphics.py":2878
 *             if self.neg_y:
 *                 result[1] = self.pixel_height - result[1]
 *             return tuple(result)             # <<<<<<<<<<<<<<
 *         else:
 *             return (coords[0], coords[1])
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2878, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "mathics/builtin/graphics.py":2869
 * 
 *     def translate(self, coords):
 *         if self.pixel_width is not None:             # <<<<<<<<<<<<<<
 *             w = self.extent_width if self.extent_width > 0 else 1
 *             h = self.extent_height if self.extent_height > 0 else 1
 */
  }

  /* "mathics/builtin/graphics.py":2880
 *             return tuple(result)
 *         else:
 *             return (coords[0], coords[1])             # <<<<<<<<<<<<<<
 * 
 *     def translate_absolute(self, d):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_coords, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2880, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_coords, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2880, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2880, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5);
    __pyx_t_4 = 0;
    __pyx_t_5 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
  }

  /* "mathics/builtin/graphics.py":2868
 *         self.view_width = None
 * 
 *     def translate(self, coords):             # <<<<<<<<<<<<<<
 *         if self.pixel_width is not None:
 *             w = self.extent_width if self.extent_width > 0 else 1
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("mathics.builtin.graphics.GraphicsElements.translate", __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_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":2882
 *             return (coords[0], coords[1])
 * 
 *     def translate_absolute(self, d):             # <<<<<<<<<<<<<<
 *         if self.pixel_width is None:
 *             return (0, 0)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_16GraphicsElements_5translate_absolute(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_16GraphicsElements_5translate_absolute = {"translate_absolute", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_16GraphicsElements_5translate_absolute, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_16GraphicsElements_5translate_absolute(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_d = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("translate_absolute (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_d,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_d)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("translate_absolute", 1, 2, 2, 1); __PYX_ERR(0, 2882, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "translate_absolute") < 0)) __PYX_ERR(0, 2882, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_d = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("translate_absolute", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2882, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.GraphicsElements.translate_absolute", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_16GraphicsElements_4translate_absolute(__pyx_self, __pyx_v_self, __pyx_v_d);

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_16GraphicsElements_4translate_absolute(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_d) {
  double __pyx_v_l;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("translate_absolute", 0);

  /* "mathics/builtin/graphics.py":2883
 * 
 *     def translate_absolute(self, d):
 *         if self.pixel_width is None:             # <<<<<<<<<<<<<<
 *             return (0, 0)
 *         else:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_pixel_width); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2883, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__pyx_t_1 == Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "mathics/builtin/graphics.py":2884
 *     def translate_absolute(self, d):
 *         if self.pixel_width is None:
 *             return (0, 0)             # <<<<<<<<<<<<<<
 *         else:
 *             l = 96.0 / 72
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_tuple__83);
    __pyx_r = __pyx_tuple__83;
    goto __pyx_L0;

    /* "mathics/builtin/graphics.py":2883
 * 
 *     def translate_absolute(self, d):
 *         if self.pixel_width is None:             # <<<<<<<<<<<<<<
 *             return (0, 0)
 *         else:
 */
  }

  /* "mathics/builtin/graphics.py":2886
 *             return (0, 0)
 *         else:
 *             l = 96.0 / 72             # <<<<<<<<<<<<<<
 *             return (d[0] * l, (-1 if self.neg_y else 1) * d[1] * l)
 * 
 */
  /*else*/ {
    __pyx_v_l = (96.0 / 72.0);

    /* "mathics/builtin/graphics.py":2887
 *         else:
 *             l = 96.0 / 72
 *             return (d[0] * l, (-1 if self.neg_y else 1) * d[1] * l)             # <<<<<<<<<<<<<<
 * 
 *     def translate_relative(self, x):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_d, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2887, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyFloat_FromDouble(__pyx_v_l); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2887, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyNumber_Multiply(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2887, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_neg_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2887, __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(0, 2887, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_3) {
      __Pyx_INCREF(__pyx_int_neg_1);
      __pyx_t_4 = __pyx_int_neg_1;
    } else {
      __Pyx_INCREF(__pyx_int_1);
      __pyx_t_4 = __pyx_int_1;
    }
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_d, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2887, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = PyNumber_Multiply(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2887, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyFloat_FromDouble(__pyx_v_l); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2887, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyNumber_Multiply(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2887, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2887, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
    __pyx_t_5 = 0;
    __pyx_t_4 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
  }

  /* "mathics/builtin/graphics.py":2882
 *             return (coords[0], coords[1])
 * 
 *     def translate_absolute(self, d):             # <<<<<<<<<<<<<<
 *         if self.pixel_width is None:
 *             return (0, 0)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("mathics.builtin.graphics.GraphicsElements.translate_absolute", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":2889
 *             return (d[0] * l, (-1 if self.neg_y else 1) * d[1] * l)
 * 
 *     def translate_relative(self, x):             # <<<<<<<<<<<<<<
 *         if self.pixel_width is None:
 *             return 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_16GraphicsElements_7translate_relative(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_16GraphicsElements_7translate_relative = {"translate_relative", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_16GraphicsElements_7translate_relative, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_16GraphicsElements_7translate_relative(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_x = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("translate_relative (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_x,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("translate_relative", 1, 2, 2, 1); __PYX_ERR(0, 2889, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "translate_relative") < 0)) __PYX_ERR(0, 2889, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_x = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("translate_relative", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2889, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.GraphicsElements.translate_relative", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_16GraphicsElements_6translate_relative(__pyx_self, __pyx_v_self, __pyx_v_x);

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

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

  /* "mathics/builtin/graphics.py":2890
 * 
 *     def translate_relative(self, x):
 *         if self.pixel_width is None:             # <<<<<<<<<<<<<<
 *             return 0
 *         else:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_pixel_width); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2890, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__pyx_t_1 == Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "mathics/builtin/graphics.py":2891
 *     def translate_relative(self, x):
 *         if self.pixel_width is None:
 *             return 0             # <<<<<<<<<<<<<<
 *         else:
 *             return x * self.pixel_width
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_int_0);
    __pyx_r = __pyx_int_0;
    goto __pyx_L0;

    /* "mathics/builtin/graphics.py":2890
 * 
 *     def translate_relative(self, x):
 *         if self.pixel_width is None:             # <<<<<<<<<<<<<<
 *             return 0
 *         else:
 */
  }

  /* "mathics/builtin/graphics.py":2893
 *             return 0
 *         else:
 *             return x * self.pixel_width             # <<<<<<<<<<<<<<
 * 
 *     def extent(self, completely_visible_only=False):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_pixel_width); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2893, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyNumber_Multiply(__pyx_v_x, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2893, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }

  /* "mathics/builtin/graphics.py":2889
 *             return (d[0] * l, (-1 if self.neg_y else 1) * d[1] * l)
 * 
 *     def translate_relative(self, x):             # <<<<<<<<<<<<<<
 *         if self.pixel_width is None:
 *             return 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("mathics.builtin.graphics.GraphicsElements.translate_relative", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":2895
 *             return x * self.pixel_width
 * 
 *     def extent(self, completely_visible_only=False):             # <<<<<<<<<<<<<<
 *         if completely_visible_only:
 *             ext = total_extent(
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_16GraphicsElements_9extent(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_16GraphicsElements_9extent = {"extent", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_16GraphicsElements_9extent, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_16GraphicsElements_9extent(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_completely_visible_only = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("extent (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_completely_visible_only,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)((PyObject *)Py_False));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_completely_visible_only);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "extent") < 0)) __PYX_ERR(0, 2895, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_completely_visible_only = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("extent", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2895, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.GraphicsElements.extent", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_16GraphicsElements_8extent(__pyx_self, __pyx_v_self, __pyx_v_completely_visible_only);

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_16GraphicsElements_8extent(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_completely_visible_only) {
  PyObject *__pyx_v_ext = NULL;
  PyObject *__pyx_v_xmin = NULL;
  PyObject *__pyx_v_xmax = NULL;
  PyObject *__pyx_v_ymin = NULL;
  PyObject *__pyx_v_ymax = NULL;
  PyObject *__pyx_9genexpr53__pyx_v_element = NULL;
  PyObject *__pyx_9genexpr54__pyx_v_element = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *(*__pyx_t_11)(PyObject *);
  int __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("extent", 0);

  /* "mathics/builtin/graphics.py":2896
 * 
 *     def extent(self, completely_visible_only=False):
 *         if completely_visible_only:             # <<<<<<<<<<<<<<
 *             ext = total_extent(
 *                 [
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_completely_visible_only); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 2896, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "mathics/builtin/graphics.py":2897
 *     def extent(self, completely_visible_only=False):
 *         if completely_visible_only:
 *             ext = total_extent(             # <<<<<<<<<<<<<<
 *                 [
 *                     element.extent()
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_total_extent); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2897, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    { /* enter inner scope */

      /* "mathics/builtin/graphics.py":2898
 *         if completely_visible_only:
 *             ext = total_extent(
 *                 [             # <<<<<<<<<<<<<<
 *                     element.extent()
 *                     for element in self.elements
 */
      __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2898, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_4);

      /* "mathics/builtin/graphics.py":2900
 *                 [
 *                     element.extent()
 *                     for element in self.elements             # <<<<<<<<<<<<<<
 *                     if element.is_completely_visible
 *                 ]
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_elements); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2900, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
        __pyx_t_6 = __pyx_t_5; __Pyx_INCREF(__pyx_t_6); __pyx_t_7 = 0;
        __pyx_t_8 = NULL;
      } else {
        __pyx_t_7 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2900, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_8 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2900, __pyx_L6_error)
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      for (;;) {
        if (likely(!__pyx_t_8)) {
          if (likely(PyList_CheckExact(__pyx_t_6))) {
            if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_6)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_5 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 2900, __pyx_L6_error)
            #else
            __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2900, __pyx_L6_error)
            __Pyx_GOTREF(__pyx_t_5);
            #endif
          } else {
            if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 2900, __pyx_L6_error)
            #else
            __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2900, __pyx_L6_error)
            __Pyx_GOTREF(__pyx_t_5);
            #endif
          }
        } else {
          __pyx_t_5 = __pyx_t_8(__pyx_t_6);
          if (unlikely(!__pyx_t_5)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 2900, __pyx_L6_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_5);
        }
        __Pyx_XDECREF_SET(__pyx_9genexpr53__pyx_v_element, __pyx_t_5);
        __pyx_t_5 = 0;

        /* "mathics/builtin/graphics.py":2901
 *                     element.extent()
 *                     for element in self.elements
 *                     if element.is_completely_visible             # <<<<<<<<<<<<<<
 *                 ]
 *             )
 */
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr53__pyx_v_element, __pyx_n_s_is_completely_visible); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2901, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 2901, __pyx_L6_error)
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (__pyx_t_1) {

          /* "mathics/builtin/graphics.py":2899
 *             ext = total_extent(
 *                 [
 *                     element.extent()             # <<<<<<<<<<<<<<
 *                     for element in self.elements
 *                     if element.is_completely_visible
 */
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr53__pyx_v_element, __pyx_n_s_extent); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2899, __pyx_L6_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_10)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_10);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          __pyx_t_5 = (__pyx_t_10) ? __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10) : __Pyx_PyObject_CallNoArg(__pyx_t_9);
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2899, __pyx_L6_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 2898, __pyx_L6_error)
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

          /* "mathics/builtin/graphics.py":2901
 *                     element.extent()
 *                     for element in self.elements
 *                     if element.is_completely_visible             # <<<<<<<<<<<<<<
 *                 ]
 *             )
 */
        }

        /* "mathics/builtin/graphics.py":2900
 *                 [
 *                     element.extent()
 *                     for element in self.elements             # <<<<<<<<<<<<<<
 *                     if element.is_completely_visible
 *                 ]
 */
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_9genexpr53__pyx_v_element); __pyx_9genexpr53__pyx_v_element = 0;
      goto __pyx_L10_exit_scope;
      __pyx_L6_error:;
      __Pyx_XDECREF(__pyx_9genexpr53__pyx_v_element); __pyx_9genexpr53__pyx_v_element = 0;
      goto __pyx_L1_error;
      __pyx_L10_exit_scope:;
    } /* exit inner scope */
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_6, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2897, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_ext = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "mathics/builtin/graphics.py":2896
 * 
 *     def extent(self, completely_visible_only=False):
 *         if completely_visible_only:             # <<<<<<<<<<<<<<
 *             ext = total_extent(
 *                 [
 */
    goto __pyx_L3;
  }

  /* "mathics/builtin/graphics.py":2905
 *             )
 *         else:
 *             ext = total_extent([element.extent() for element in self.elements])             # <<<<<<<<<<<<<<
 *         xmin, xmax, ymin, ymax = ext
 *         if xmin == xmax:
 */
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_total_extent); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2905, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    { /* enter inner scope */
      __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2905, __pyx_L13_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_elements); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2905, __pyx_L13_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) {
        __pyx_t_5 = __pyx_t_6; __Pyx_INCREF(__pyx_t_5); __pyx_t_7 = 0;
        __pyx_t_8 = NULL;
      } else {
        __pyx_t_7 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2905, __pyx_L13_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_8 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2905, __pyx_L13_error)
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      for (;;) {
        if (likely(!__pyx_t_8)) {
          if (likely(PyList_CheckExact(__pyx_t_5))) {
            if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_5)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_6 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_6); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 2905, __pyx_L13_error)
            #else
            __pyx_t_6 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2905, __pyx_L13_error)
            __Pyx_GOTREF(__pyx_t_6);
            #endif
          } else {
            if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_6); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 2905, __pyx_L13_error)
            #else
            __pyx_t_6 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2905, __pyx_L13_error)
            __Pyx_GOTREF(__pyx_t_6);
            #endif
          }
        } else {
          __pyx_t_6 = __pyx_t_8(__pyx_t_5);
          if (unlikely(!__pyx_t_6)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 2905, __pyx_L13_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_6);
        }
        __Pyx_XDECREF_SET(__pyx_9genexpr54__pyx_v_element, __pyx_t_6);
        __pyx_t_6 = 0;
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr54__pyx_v_element, __pyx_n_s_extent); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2905, __pyx_L13_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_10 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
          __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
          if (likely(__pyx_t_10)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
            __Pyx_INCREF(__pyx_t_10);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_9, function);
          }
        }
        __pyx_t_6 = (__pyx_t_10) ? __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10) : __Pyx_PyObject_CallNoArg(__pyx_t_9);
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2905, __pyx_L13_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 2905, __pyx_L13_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_9genexpr54__pyx_v_element); __pyx_9genexpr54__pyx_v_element = 0;
      goto __pyx_L16_exit_scope;
      __pyx_L13_error:;
      __Pyx_XDECREF(__pyx_9genexpr54__pyx_v_element); __pyx_9genexpr54__pyx_v_element = 0;
      goto __pyx_L1_error;
      __pyx_L16_exit_scope:;
    } /* exit inner scope */
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2905, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_ext = __pyx_t_2;
    __pyx_t_2 = 0;
  }
  __pyx_L3:;

  /* "mathics/builtin/graphics.py":2906
 *         else:
 *             ext = total_extent([element.extent() for element in self.elements])
 *         xmin, xmax, ymin, ymax = ext             # <<<<<<<<<<<<<<
 *         if xmin == xmax:
 *             if xmin is None:
 */
  if ((likely(PyTuple_CheckExact(__pyx_v_ext))) || (PyList_CheckExact(__pyx_v_ext))) {
    PyObject* sequence = __pyx_v_ext;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 4)) {
      if (size > 4) __Pyx_RaiseTooManyValuesError(4);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 2906, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); 
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 3); 
    } else {
      __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
      __pyx_t_4 = PyList_GET_ITEM(sequence, 2); 
      __pyx_t_5 = PyList_GET_ITEM(sequence, 3); 
    }
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_5);
    #else
    {
      Py_ssize_t i;
      PyObject** temps[4] = {&__pyx_t_2,&__pyx_t_3,&__pyx_t_4,&__pyx_t_5};
      for (i=0; i < 4; i++) {
        PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 2906, __pyx_L1_error)
        __Pyx_GOTREF(item);
        *(temps[i]) = item;
      }
    }
    #endif
  } else {
    Py_ssize_t index = -1;
    PyObject** temps[4] = {&__pyx_t_2,&__pyx_t_3,&__pyx_t_4,&__pyx_t_5};
    __pyx_t_6 = PyObject_GetIter(__pyx_v_ext); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2906, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_11 = Py_TYPE(__pyx_t_6)->tp_iternext;
    for (index=0; index < 4; index++) {
      PyObject* item = __pyx_t_11(__pyx_t_6); if (unlikely(!item)) goto __pyx_L17_unpacking_failed;
      __Pyx_GOTREF(item);
      *(temps[index]) = item;
    }
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_6), 4) < 0) __PYX_ERR(0, 2906, __pyx_L1_error)
    __pyx_t_11 = NULL;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    goto __pyx_L18_unpacking_done;
    __pyx_L17_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_11 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 2906, __pyx_L1_error)
    __pyx_L18_unpacking_done:;
  }
  __pyx_v_xmin = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_v_xmax = __pyx_t_3;
  __pyx_t_3 = 0;
  __pyx_v_ymin = __pyx_t_4;
  __pyx_t_4 = 0;
  __pyx_v_ymax = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":2907
 *             ext = total_extent([element.extent() for element in self.elements])
 *         xmin, xmax, ymin, ymax = ext
 *         if xmin == xmax:             # <<<<<<<<<<<<<<
 *             if xmin is None:
 *                 return 0, 0, 0, 0
 */
  __pyx_t_5 = PyObject_RichCompare(__pyx_v_xmin, __pyx_v_xmax, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2907, __pyx_L1_error)
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 2907, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_1) {

    /* "mathics/builtin/graphics.py":2908
 *         xmin, xmax, ymin, ymax = ext
 *         if xmin == xmax:
 *             if xmin is None:             # <<<<<<<<<<<<<<
 *                 return 0, 0, 0, 0
 *             xmin = 0
 */
    __pyx_t_1 = (__pyx_v_xmin == Py_None);
    __pyx_t_12 = (__pyx_t_1 != 0);
    if (__pyx_t_12) {

      /* "mathics/builtin/graphics.py":2909
 *         if xmin == xmax:
 *             if xmin is None:
 *                 return 0, 0, 0, 0             # <<<<<<<<<<<<<<
 *             xmin = 0
 *             xmax *= 2
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_tuple__124);
      __pyx_r = __pyx_tuple__124;
      goto __pyx_L0;

      /* "mathics/builtin/graphics.py":2908
 *         xmin, xmax, ymin, ymax = ext
 *         if xmin == xmax:
 *             if xmin is None:             # <<<<<<<<<<<<<<
 *                 return 0, 0, 0, 0
 *             xmin = 0
 */
    }

    /* "mathics/builtin/graphics.py":2910
 *             if xmin is None:
 *                 return 0, 0, 0, 0
 *             xmin = 0             # <<<<<<<<<<<<<<
 *             xmax *= 2
 *         if ymin == ymax:
 */
    __Pyx_INCREF(__pyx_int_0);
    __Pyx_DECREF_SET(__pyx_v_xmin, __pyx_int_0);

    /* "mathics/builtin/graphics.py":2911
 *                 return 0, 0, 0, 0
 *             xmin = 0
 *             xmax *= 2             # <<<<<<<<<<<<<<
 *         if ymin == ymax:
 *             if ymin is None:
 */
    __pyx_t_5 = PyNumber_InPlaceMultiply(__pyx_v_xmax, __pyx_int_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2911, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF_SET(__pyx_v_xmax, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "mathics/builtin/graphics.py":2907
 *             ext = total_extent([element.extent() for element in self.elements])
 *         xmin, xmax, ymin, ymax = ext
 *         if xmin == xmax:             # <<<<<<<<<<<<<<
 *             if xmin is None:
 *                 return 0, 0, 0, 0
 */
  }

  /* "mathics/builtin/graphics.py":2912
 *             xmin = 0
 *             xmax *= 2
 *         if ymin == ymax:             # <<<<<<<<<<<<<<
 *             if ymin is None:
 *                 return 0, 0, 0, 0
 */
  __pyx_t_5 = PyObject_RichCompare(__pyx_v_ymin, __pyx_v_ymax, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2912, __pyx_L1_error)
  __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 2912, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_12) {

    /* "mathics/builtin/graphics.py":2913
 *             xmax *= 2
 *         if ymin == ymax:
 *             if ymin is None:             # <<<<<<<<<<<<<<
 *                 return 0, 0, 0, 0
 *             ymin = 0
 */
    __pyx_t_12 = (__pyx_v_ymin == Py_None);
    __pyx_t_1 = (__pyx_t_12 != 0);
    if (__pyx_t_1) {

      /* "mathics/builtin/graphics.py":2914
 *         if ymin == ymax:
 *             if ymin is None:
 *                 return 0, 0, 0, 0             # <<<<<<<<<<<<<<
 *             ymin = 0
 *             ymax *= 2
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_tuple__124);
      __pyx_r = __pyx_tuple__124;
      goto __pyx_L0;

      /* "mathics/builtin/graphics.py":2913
 *             xmax *= 2
 *         if ymin == ymax:
 *             if ymin is None:             # <<<<<<<<<<<<<<
 *                 return 0, 0, 0, 0
 *             ymin = 0
 */
    }

    /* "mathics/builtin/graphics.py":2915
 *             if ymin is None:
 *                 return 0, 0, 0, 0
 *             ymin = 0             # <<<<<<<<<<<<<<
 *             ymax *= 2
 *         return xmin, xmax, ymin, ymax
 */
    __Pyx_INCREF(__pyx_int_0);
    __Pyx_DECREF_SET(__pyx_v_ymin, __pyx_int_0);

    /* "mathics/builtin/graphics.py":2916
 *                 return 0, 0, 0, 0
 *             ymin = 0
 *             ymax *= 2             # <<<<<<<<<<<<<<
 *         return xmin, xmax, ymin, ymax
 * 
 */
    __pyx_t_5 = PyNumber_InPlaceMultiply(__pyx_v_ymax, __pyx_int_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2916, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF_SET(__pyx_v_ymax, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "mathics/builtin/graphics.py":2912
 *             xmin = 0
 *             xmax *= 2
 *         if ymin == ymax:             # <<<<<<<<<<<<<<
 *             if ymin is None:
 *                 return 0, 0, 0, 0
 */
  }

  /* "mathics/builtin/graphics.py":2917
 *             ymin = 0
 *             ymax *= 2
 *         return xmin, xmax, ymin, ymax             # <<<<<<<<<<<<<<
 * 
 *     def to_svg(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2917, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_v_xmin);
  __Pyx_GIVEREF(__pyx_v_xmin);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_xmin);
  __Pyx_INCREF(__pyx_v_xmax);
  __Pyx_GIVEREF(__pyx_v_xmax);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_xmax);
  __Pyx_INCREF(__pyx_v_ymin);
  __Pyx_GIVEREF(__pyx_v_ymin);
  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_ymin);
  __Pyx_INCREF(__pyx_v_ymax);
  __Pyx_GIVEREF(__pyx_v_ymax);
  PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_v_ymax);
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":2895
 *             return x * self.pixel_width
 * 
 *     def extent(self, completely_visible_only=False):             # <<<<<<<<<<<<<<
 *         if completely_visible_only:
 *             ext = total_extent(
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("mathics.builtin.graphics.GraphicsElements.extent", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ext);
  __Pyx_XDECREF(__pyx_v_xmin);
  __Pyx_XDECREF(__pyx_v_xmax);
  __Pyx_XDECREF(__pyx_v_ymin);
  __Pyx_XDECREF(__pyx_v_ymax);
  __Pyx_XDECREF(__pyx_9genexpr53__pyx_v_element);
  __Pyx_XDECREF(__pyx_9genexpr54__pyx_v_element);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":2919
 *         return xmin, xmax, ymin, ymax
 * 
 *     def to_svg(self):             # <<<<<<<<<<<<<<
 *         return "\n".join(element.to_svg() for element in self.elements)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_16GraphicsElements_11to_svg(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_16GraphicsElements_11to_svg = {"to_svg", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_16GraphicsElements_11to_svg, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_16GraphicsElements_11to_svg(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_svg (wrapper)", 0);
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_16GraphicsElements_10to_svg(__pyx_self, ((PyObject *)__pyx_v_self));

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

/* "mathics/builtin/graphics.py":2920
 * 
 *     def to_svg(self):
 *         return "\n".join(element.to_svg() for element in self.elements)             # <<<<<<<<<<<<<<
 * 
 *     def to_asy(self):
 */

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_16GraphicsElements_6to_svg_genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_75_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_7mathics_7builtin_8graphics___pyx_scope_struct_75_genexpr *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_75_genexpr(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_75_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_75_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 2920, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_74_to_svg *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7mathics_7builtin_8graphics_16GraphicsElements_6to_svg_2generator46, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_GraphicsElements_to_svg_locals_g, __pyx_n_s_mathics_builtin_graphics); if (unlikely(!gen)) __PYX_ERR(0, 2920, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.GraphicsElements.to_svg.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_7mathics_7builtin_8graphics_16GraphicsElements_6to_svg_2generator46(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_75_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_75_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2920, __pyx_L1_error)
  __pyx_r = PyList_New(0); if (unlikely(!__pyx_r)) __PYX_ERR(0, 2920, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 2920, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self, __pyx_n_s_elements); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2920, __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(0, 2920, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2920, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 2920, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2920, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 2920, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2920, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 2920, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_element);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_element, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_element, __pyx_n_s_to_svg); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2920, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2920, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(__Pyx_ListComp_Append(__pyx_r, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 2920, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

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

/* "mathics/builtin/graphics.py":2919
 *         return xmin, xmax, ymin, ymax
 * 
 *     def to_svg(self):             # <<<<<<<<<<<<<<
 *         return "\n".join(element.to_svg() for element in self.elements)
 * 
 */

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_16GraphicsElements_10to_svg(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_74_to_svg *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_svg", 0);
  __pyx_cur_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_74_to_svg *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_74_to_svg(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_74_to_svg, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_74_to_svg *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 2919, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self);

  /* "mathics/builtin/graphics.py":2920
 * 
 *     def to_svg(self):
 *         return "\n".join(element.to_svg() for element in self.elements)             # <<<<<<<<<<<<<<
 * 
 *     def to_asy(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_pf_7mathics_7builtin_8graphics_16GraphicsElements_6to_svg_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2920, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_Generator_Next(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2920, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyUnicode_Join(__pyx_kp_u__5, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2920, __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;

  /* "mathics/builtin/graphics.py":2919
 *         return xmin, xmax, ymin, ymax
 * 
 *     def to_svg(self):             # <<<<<<<<<<<<<<
 *         return "\n".join(element.to_svg() for element in self.elements)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("mathics.builtin.graphics.GraphicsElements.to_svg", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":2922
 *         return "\n".join(element.to_svg() for element in self.elements)
 * 
 *     def to_asy(self):             # <<<<<<<<<<<<<<
 *         return "\n".join(element.to_asy() for element in self.elements)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_16GraphicsElements_13to_asy(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_16GraphicsElements_13to_asy = {"to_asy", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_16GraphicsElements_13to_asy, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_16GraphicsElements_13to_asy(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_asy (wrapper)", 0);
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_16GraphicsElements_12to_asy(__pyx_self, ((PyObject *)__pyx_v_self));

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

/* "mathics/builtin/graphics.py":2923
 * 
 *     def to_asy(self):
 *         return "\n".join(element.to_asy() for element in self.elements)             # <<<<<<<<<<<<<<
 * 
 *     def set_size(
 */

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_16GraphicsElements_6to_asy_genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_77_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_7mathics_7builtin_8graphics___pyx_scope_struct_77_genexpr *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_77_genexpr(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_77_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_77_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 2923, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_76_to_asy *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7mathics_7builtin_8graphics_16GraphicsElements_6to_asy_2generator47, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_GraphicsElements_to_asy_locals_g, __pyx_n_s_mathics_builtin_graphics); if (unlikely(!gen)) __PYX_ERR(0, 2923, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.GraphicsElements.to_asy.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_7mathics_7builtin_8graphics_16GraphicsElements_6to_asy_2generator47(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_77_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_77_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2923, __pyx_L1_error)
  __pyx_r = PyList_New(0); if (unlikely(!__pyx_r)) __PYX_ERR(0, 2923, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 2923, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self, __pyx_n_s_elements); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2923, __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(0, 2923, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2923, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 2923, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2923, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 2923, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2923, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 2923, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_element);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_element, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_element, __pyx_n_s_to_asy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2923, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2923, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(__Pyx_ListComp_Append(__pyx_r, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 2923, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

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

/* "mathics/builtin/graphics.py":2922
 *         return "\n".join(element.to_svg() for element in self.elements)
 * 
 *     def to_asy(self):             # <<<<<<<<<<<<<<
 *         return "\n".join(element.to_asy() for element in self.elements)
 * 
 */

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_16GraphicsElements_12to_asy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_76_to_asy *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_asy", 0);
  __pyx_cur_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_76_to_asy *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_76_to_asy(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_76_to_asy, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_76_to_asy *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 2922, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self);

  /* "mathics/builtin/graphics.py":2923
 * 
 *     def to_asy(self):
 *         return "\n".join(element.to_asy() for element in self.elements)             # <<<<<<<<<<<<<<
 * 
 *     def set_size(
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_pf_7mathics_7builtin_8graphics_16GraphicsElements_6to_asy_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2923, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_Generator_Next(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2923, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyUnicode_Join(__pyx_kp_u__5, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2923, __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;

  /* "mathics/builtin/graphics.py":2922
 *         return "\n".join(element.to_svg() for element in self.elements)
 * 
 *     def to_asy(self):             # <<<<<<<<<<<<<<
 *         return "\n".join(element.to_asy() for element in self.elements)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("mathics.builtin.graphics.GraphicsElements.to_asy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":2925
 *         return "\n".join(element.to_asy() for element in self.elements)
 * 
 *     def set_size(             # <<<<<<<<<<<<<<
 *         self, xmin, ymin, extent_width, extent_height, pixel_width, pixel_height
 *     ):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_16GraphicsElements_15set_size(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_16GraphicsElements_15set_size = {"set_size", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_16GraphicsElements_15set_size, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_16GraphicsElements_15set_size(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_xmin = 0;
  PyObject *__pyx_v_ymin = 0;
  PyObject *__pyx_v_extent_width = 0;
  PyObject *__pyx_v_extent_height = 0;
  PyObject *__pyx_v_pixel_width = 0;
  PyObject *__pyx_v_pixel_height = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_size (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_xmin,&__pyx_n_s_ymin,&__pyx_n_s_extent_width,&__pyx_n_s_extent_height,&__pyx_n_s_pixel_width,&__pyx_n_s_pixel_height,0};
    PyObject* values[7] = {0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xmin)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_size", 1, 7, 7, 1); __PYX_ERR(0, 2925, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ymin)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_size", 1, 7, 7, 2); __PYX_ERR(0, 2925, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_extent_width)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_size", 1, 7, 7, 3); __PYX_ERR(0, 2925, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_extent_height)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_size", 1, 7, 7, 4); __PYX_ERR(0, 2925, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pixel_width)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_size", 1, 7, 7, 5); __PYX_ERR(0, 2925, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pixel_height)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_size", 1, 7, 7, 6); __PYX_ERR(0, 2925, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_size") < 0)) __PYX_ERR(0, 2925, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 7) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
    }
    __pyx_v_self = values[0];
    __pyx_v_xmin = values[1];
    __pyx_v_ymin = values[2];
    __pyx_v_extent_width = values[3];
    __pyx_v_extent_height = values[4];
    __pyx_v_pixel_width = values[5];
    __pyx_v_pixel_height = values[6];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_size", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2925, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.GraphicsElements.set_size", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_16GraphicsElements_14set_size(__pyx_self, __pyx_v_self, __pyx_v_xmin, __pyx_v_ymin, __pyx_v_extent_width, __pyx_v_extent_height, __pyx_v_pixel_width, __pyx_v_pixel_height);

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_16GraphicsElements_14set_size(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_xmin, PyObject *__pyx_v_ymin, PyObject *__pyx_v_extent_width, PyObject *__pyx_v_extent_height, PyObject *__pyx_v_pixel_width, PyObject *__pyx_v_pixel_height) {
  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("set_size", 0);

  /* "mathics/builtin/graphics.py":2929
 *     ):
 * 
 *         self.xmin, self.ymin = xmin, ymin             # <<<<<<<<<<<<<<
 *         self.extent_width, self.extent_height = extent_width, extent_height
 *         self.pixel_width, self.pixel_height = pixel_width, pixel_height
 */
  __pyx_t_1 = __pyx_v_xmin;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = __pyx_v_ymin;
  __Pyx_INCREF(__pyx_t_2);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_xmin, __pyx_t_1) < 0) __PYX_ERR(0, 2929, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_ymin, __pyx_t_2) < 0) __PYX_ERR(0, 2929, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":2930
 * 
 *         self.xmin, self.ymin = xmin, ymin
 *         self.extent_width, self.extent_height = extent_width, extent_height             # <<<<<<<<<<<<<<
 *         self.pixel_width, self.pixel_height = pixel_width, pixel_height
 * 
 */
  __pyx_t_2 = __pyx_v_extent_width;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_1 = __pyx_v_extent_height;
  __Pyx_INCREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_extent_width, __pyx_t_2) < 0) __PYX_ERR(0, 2930, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_extent_height, __pyx_t_1) < 0) __PYX_ERR(0, 2930, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":2931
 *         self.xmin, self.ymin = xmin, ymin
 *         self.extent_width, self.extent_height = extent_width, extent_height
 *         self.pixel_width, self.pixel_height = pixel_width, pixel_height             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __pyx_v_pixel_width;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = __pyx_v_pixel_height;
  __Pyx_INCREF(__pyx_t_2);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_pixel_width, __pyx_t_1) < 0) __PYX_ERR(0, 2931, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_pixel_height, __pyx_t_2) < 0) __PYX_ERR(0, 2931, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":2925
 *         return "\n".join(element.to_asy() for element in self.elements)
 * 
 *     def set_size(             # <<<<<<<<<<<<<<
 *         self, xmin, ymin, extent_width, extent_height, pixel_width, pixel_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_AddTraceback("mathics.builtin.graphics.GraphicsElements.set_size", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":2939
 *     attributes = ("HoldAll", "ReadProtected")
 * 
 *     def boxes_to_text(self, leaves, **options):             # <<<<<<<<<<<<<<
 *         self._prepare_elements(leaves, options)  # to test for Box errors
 *         return "-Graphics-"
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_11GraphicsBox_1boxes_to_text(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_11GraphicsBox_1boxes_to_text = {"boxes_to_text", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_11GraphicsBox_1boxes_to_text, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_11GraphicsBox_1boxes_to_text(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_leaves = 0;
  PyObject *__pyx_v_options = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("boxes_to_text (wrapper)", 0);
  __pyx_v_options = PyDict_New(); if (unlikely(!__pyx_v_options)) return NULL;
  __Pyx_GOTREF(__pyx_v_options);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_leaves,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_leaves)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("boxes_to_text", 1, 2, 2, 1); __PYX_ERR(0, 2939, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_options, values, pos_args, "boxes_to_text") < 0)) __PYX_ERR(0, 2939, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_leaves = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("boxes_to_text", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2939, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_options); __pyx_v_options = 0;
  __Pyx_AddTraceback("mathics.builtin.graphics.GraphicsBox.boxes_to_text", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_11GraphicsBox_boxes_to_text(__pyx_self, __pyx_v_self, __pyx_v_leaves, __pyx_v_options);

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

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

  /* "mathics/builtin/graphics.py":2940
 * 
 *     def boxes_to_text(self, leaves, **options):
 *         self._prepare_elements(leaves, options)  # to test for Box errors             # <<<<<<<<<<<<<<
 *         return "-Graphics-"
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_prepare_elements); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2940, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_leaves, __pyx_v_options};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2940, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_leaves, __pyx_v_options};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2940, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2940, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(__pyx_v_leaves);
    __Pyx_GIVEREF(__pyx_v_leaves);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_leaves);
    __Pyx_INCREF(__pyx_v_options);
    __Pyx_GIVEREF(__pyx_v_options);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_options);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2940, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":2941
 *     def boxes_to_text(self, leaves, **options):
 *         self._prepare_elements(leaves, options)  # to test for Box errors
 *         return "-Graphics-"             # <<<<<<<<<<<<<<
 * 
 *     def _get_image_size(self, options, graphics_options, max_width):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_kp_u_Graphics_2);
  __pyx_r = __pyx_kp_u_Graphics_2;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":2939
 *     attributes = ("HoldAll", "ReadProtected")
 * 
 *     def boxes_to_text(self, leaves, **options):             # <<<<<<<<<<<<<<
 *         self._prepare_elements(leaves, options)  # to test for Box errors
 *         return "-Graphics-"
 */

  /* 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("mathics.builtin.graphics.GraphicsBox.boxes_to_text", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":2943
 *         return "-Graphics-"
 * 
 *     def _get_image_size(self, options, graphics_options, max_width):             # <<<<<<<<<<<<<<
 *         inside_row = options.pop("inside_row", False)
 *         inside_list = options.pop("inside_list", False)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_11GraphicsBox_3_get_image_size(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_11GraphicsBox_3_get_image_size = {"_get_image_size", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_11GraphicsBox_3_get_image_size, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_11GraphicsBox_3_get_image_size(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_options = 0;
  PyObject *__pyx_v_graphics_options = 0;
  PyObject *__pyx_v_max_width = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_image_size (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_options,&__pyx_n_s_graphics_options,&__pyx_n_s_max_width,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_options)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_get_image_size", 1, 4, 4, 1); __PYX_ERR(0, 2943, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_graphics_options)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_get_image_size", 1, 4, 4, 2); __PYX_ERR(0, 2943, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_width)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_get_image_size", 1, 4, 4, 3); __PYX_ERR(0, 2943, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_get_image_size") < 0)) __PYX_ERR(0, 2943, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __pyx_v_self = values[0];
    __pyx_v_options = values[1];
    __pyx_v_graphics_options = values[2];
    __pyx_v_max_width = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_get_image_size", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2943, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.GraphicsBox._get_image_size", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_11GraphicsBox_2_get_image_size(__pyx_self, __pyx_v_self, __pyx_v_options, __pyx_v_graphics_options, __pyx_v_max_width);

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_11GraphicsBox_2_get_image_size(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_options, PyObject *__pyx_v_graphics_options, PyObject *__pyx_v_max_width) {
  PyObject *__pyx_v_inside_row = NULL;
  PyObject *__pyx_v_inside_list = NULL;
  PyObject *__pyx_v_image_size_multipliers = NULL;
  PyObject *__pyx_v_aspect_ratio = NULL;
  PyObject *__pyx_v_aspect = NULL;
  PyObject *__pyx_v_image_size = NULL;
  PyObject *__pyx_v_base_width = NULL;
  PyObject *__pyx_v_base_height = NULL;
  PyObject *__pyx_v_multi = NULL;
  PyObject *__pyx_9genexpr57__pyx_v_x = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  PyObject *(*__pyx_t_11)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_image_size", 0);

  /* "mathics/builtin/graphics.py":2944
 * 
 *     def _get_image_size(self, options, graphics_options, max_width):
 *         inside_row = options.pop("inside_row", False)             # <<<<<<<<<<<<<<
 *         inside_list = options.pop("inside_list", False)
 *         image_size_multipliers = options.pop("image_size_multipliers", None)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_options, __pyx_n_s_pop); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2944, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__125, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2944, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_inside_row = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":2945
 *     def _get_image_size(self, options, graphics_options, max_width):
 *         inside_row = options.pop("inside_row", False)
 *         inside_list = options.pop("inside_list", False)             # <<<<<<<<<<<<<<
 *         image_size_multipliers = options.pop("image_size_multipliers", None)
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_options, __pyx_n_s_pop); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2945, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__126, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2945, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_inside_list = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":2946
 *         inside_row = options.pop("inside_row", False)
 *         inside_list = options.pop("inside_list", False)
 *         image_size_multipliers = options.pop("image_size_multipliers", None)             # <<<<<<<<<<<<<<
 * 
 *         aspect_ratio = graphics_options["System`AspectRatio"]
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_options, __pyx_n_s_pop); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2946, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__127, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2946, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_image_size_multipliers = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":2948
 *         image_size_multipliers = options.pop("image_size_multipliers", None)
 * 
 *         aspect_ratio = graphics_options["System`AspectRatio"]             # <<<<<<<<<<<<<<
 * 
 *         if image_size_multipliers is None:
 */
  __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_v_graphics_options, __pyx_kp_u_System_AspectRatio); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2948, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_aspect_ratio = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":2950
 *         aspect_ratio = graphics_options["System`AspectRatio"]
 * 
 *         if image_size_multipliers is None:             # <<<<<<<<<<<<<<
 *             image_size_multipliers = (0.5, 0.25)
 * 
 */
  __pyx_t_3 = (__pyx_v_image_size_multipliers == Py_None);
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "mathics/builtin/graphics.py":2951
 * 
 *         if image_size_multipliers is None:
 *             image_size_multipliers = (0.5, 0.25)             # <<<<<<<<<<<<<<
 * 
 *         if aspect_ratio == Symbol("Automatic"):
 */
    __Pyx_INCREF(__pyx_tuple__128);
    __Pyx_DECREF_SET(__pyx_v_image_size_multipliers, __pyx_tuple__128);

    /* "mathics/builtin/graphics.py":2950
 *         aspect_ratio = graphics_options["System`AspectRatio"]
 * 
 *         if image_size_multipliers is None:             # <<<<<<<<<<<<<<
 *             image_size_multipliers = (0.5, 0.25)
 * 
 */
  }

  /* "mathics/builtin/graphics.py":2953
 *             image_size_multipliers = (0.5, 0.25)
 * 
 *         if aspect_ratio == Symbol("Automatic"):             # <<<<<<<<<<<<<<
 *             aspect = None
 *         else:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Symbol); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2953, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_n_u_Automatic) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_n_u_Automatic);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2953, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_aspect_ratio, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2953, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 2953, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

    /* "mathics/builtin/graphics.py":2954
 * 
 *         if aspect_ratio == Symbol("Automatic"):
 *             aspect = None             # <<<<<<<<<<<<<<
 *         else:
 *             aspect = aspect_ratio.round_to_float()
 */
    __Pyx_INCREF(Py_None);
    __pyx_v_aspect = Py_None;

    /* "mathics/builtin/graphics.py":2953
 *             image_size_multipliers = (0.5, 0.25)
 * 
 *         if aspect_ratio == Symbol("Automatic"):             # <<<<<<<<<<<<<<
 *             aspect = None
 *         else:
 */
    goto __pyx_L4;
  }

  /* "mathics/builtin/graphics.py":2956
 *             aspect = None
 *         else:
 *             aspect = aspect_ratio.round_to_float()             # <<<<<<<<<<<<<<
 * 
 *         image_size = graphics_options["System`ImageSize"]
 */
  /*else*/ {
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_aspect_ratio, __pyx_n_s_round_to_float); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2956, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2956, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_aspect = __pyx_t_1;
    __pyx_t_1 = 0;
  }
  __pyx_L4:;

  /* "mathics/builtin/graphics.py":2958
 *             aspect = aspect_ratio.round_to_float()
 * 
 *         image_size = graphics_options["System`ImageSize"]             # <<<<<<<<<<<<<<
 *         if isinstance(image_size, Integer):
 *             base_width = image_size.get_int_value()
 */
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_graphics_options, __pyx_kp_u_System_ImageSize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2958, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_image_size = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":2959
 * 
 *         image_size = graphics_options["System`ImageSize"]
 *         if isinstance(image_size, Integer):             # <<<<<<<<<<<<<<
 *             base_width = image_size.get_int_value()
 *             base_height = None  # will be computed later in calc_dimensions
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Integer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2959, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyObject_IsInstance(__pyx_v_image_size, __pyx_t_1); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 2959, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "mathics/builtin/graphics.py":2960
 *         image_size = graphics_options["System`ImageSize"]
 *         if isinstance(image_size, Integer):
 *             base_width = image_size.get_int_value()             # <<<<<<<<<<<<<<
 *             base_height = None  # will be computed later in calc_dimensions
 *         elif image_size.has_form("System`List", 2):
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_image_size, __pyx_n_s_get_int_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2960, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2960, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_base_width = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "mathics/builtin/graphics.py":2961
 *         if isinstance(image_size, Integer):
 *             base_width = image_size.get_int_value()
 *             base_height = None  # will be computed later in calc_dimensions             # <<<<<<<<<<<<<<
 *         elif image_size.has_form("System`List", 2):
 *             base_width, base_height = (
 */
    __Pyx_INCREF(Py_None);
    __pyx_v_base_height = Py_None;

    /* "mathics/builtin/graphics.py":2959
 * 
 *         image_size = graphics_options["System`ImageSize"]
 *         if isinstance(image_size, Integer):             # <<<<<<<<<<<<<<
 *             base_width = image_size.get_int_value()
 *             base_height = None  # will be computed later in calc_dimensions
 */
    goto __pyx_L5;
  }

  /* "mathics/builtin/graphics.py":2962
 *             base_width = image_size.get_int_value()
 *             base_height = None  # will be computed later in calc_dimensions
 *         elif image_size.has_form("System`List", 2):             # <<<<<<<<<<<<<<
 *             base_width, base_height = (
 *                 [x.round_to_float() for x in image_size.leaves] + [0, 0]
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_image_size, __pyx_n_s_has_form); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2962, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__129, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2962, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 2962, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "mathics/builtin/graphics.py":2965
 *             base_width, base_height = (
 *                 [x.round_to_float() for x in image_size.leaves] + [0, 0]
 *             )[:2]             # <<<<<<<<<<<<<<
 *             if base_width is None or base_height is None:
 *                 raise BoxConstructError
 */
    { /* enter inner scope */

      /* "mathics/builtin/graphics.py":2964
 *         elif image_size.has_form("System`List", 2):
 *             base_width, base_height = (
 *                 [x.round_to_float() for x in image_size.leaves] + [0, 0]             # <<<<<<<<<<<<<<
 *             )[:2]
 *             if base_width is None or base_height is None:
 */
      __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2964, __pyx_L8_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_image_size, __pyx_n_s_leaves); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2964, __pyx_L8_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(0, 2964, __pyx_L8_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_7 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2964, __pyx_L8_error)
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      for (;;) {
        if (likely(!__pyx_t_7)) {
          if (likely(PyList_CheckExact(__pyx_t_5))) {
            if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_5)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_1 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 2964, __pyx_L8_error)
            #else
            __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2964, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_1);
            #endif
          } else {
            if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 2964, __pyx_L8_error)
            #else
            __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2964, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_1);
            #endif
          }
        } else {
          __pyx_t_1 = __pyx_t_7(__pyx_t_5);
          if (unlikely(!__pyx_t_1)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 2964, __pyx_L8_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_1);
        }
        __Pyx_XDECREF_SET(__pyx_9genexpr57__pyx_v_x, __pyx_t_1);
        __pyx_t_1 = 0;
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr57__pyx_v_x, __pyx_n_s_round_to_float); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2964, __pyx_L8_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_9 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
          __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
          if (likely(__pyx_t_9)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
            __Pyx_INCREF(__pyx_t_9);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_8, function);
          }
        }
        __pyx_t_1 = (__pyx_t_9) ? __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_9) : __Pyx_PyObject_CallNoArg(__pyx_t_8);
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2964, __pyx_L8_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 2964, __pyx_L8_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_9genexpr57__pyx_v_x); __pyx_9genexpr57__pyx_v_x = 0;
      goto __pyx_L11_exit_scope;
      __pyx_L8_error:;
      __Pyx_XDECREF(__pyx_9genexpr57__pyx_v_x); __pyx_9genexpr57__pyx_v_x = 0;
      goto __pyx_L1_error;
      __pyx_L11_exit_scope:;
    } /* exit inner scope */
    __pyx_t_5 = PyList_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2964, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_int_0);
    __Pyx_GIVEREF(__pyx_int_0);
    PyList_SET_ITEM(__pyx_t_5, 0, __pyx_int_0);
    __Pyx_INCREF(__pyx_int_0);
    __Pyx_GIVEREF(__pyx_int_0);
    PyList_SET_ITEM(__pyx_t_5, 1, __pyx_int_0);
    __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2964, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "mathics/builtin/graphics.py":2965
 *             base_width, base_height = (
 *                 [x.round_to_float() for x in image_size.leaves] + [0, 0]
 *             )[:2]             # <<<<<<<<<<<<<<
 *             if base_width is None or base_height is None:
 *                 raise BoxConstructError
 */
    __pyx_t_5 = __Pyx_PyList_GetSlice(__pyx_t_1, 0, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2965, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (1) {
      PyObject* sequence = __pyx_t_5;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 2963, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_2);
      #else
      __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2963, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2963, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      #endif
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }

    /* "mathics/builtin/graphics.py":2963
 *             base_height = None  # will be computed later in calc_dimensions
 *         elif image_size.has_form("System`List", 2):
 *             base_width, base_height = (             # <<<<<<<<<<<<<<
 *                 [x.round_to_float() for x in image_size.leaves] + [0, 0]
 *             )[:2]
 */
    __pyx_v_base_width = __pyx_t_1;
    __pyx_t_1 = 0;
    __pyx_v_base_height = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "mathics/builtin/graphics.py":2966
 *                 [x.round_to_float() for x in image_size.leaves] + [0, 0]
 *             )[:2]
 *             if base_width is None or base_height is None:             # <<<<<<<<<<<<<<
 *                 raise BoxConstructError
 *             aspect = base_height / base_width
 */
    __pyx_t_4 = (__pyx_v_base_width == Py_None);
    __pyx_t_10 = (__pyx_t_4 != 0);
    if (!__pyx_t_10) {
    } else {
      __pyx_t_3 = __pyx_t_10;
      goto __pyx_L13_bool_binop_done;
    }
    __pyx_t_10 = (__pyx_v_base_height == Py_None);
    __pyx_t_4 = (__pyx_t_10 != 0);
    __pyx_t_3 = __pyx_t_4;
    __pyx_L13_bool_binop_done:;
    if (unlikely(__pyx_t_3)) {

      /* "mathics/builtin/graphics.py":2967
 *             )[:2]
 *             if base_width is None or base_height is None:
 *                 raise BoxConstructError             # <<<<<<<<<<<<<<
 *             aspect = base_height / base_width
 *         else:
 */
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_BoxConstructError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2967, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_Raise(__pyx_t_5, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __PYX_ERR(0, 2967, __pyx_L1_error)

      /* "mathics/builtin/graphics.py":2966
 *                 [x.round_to_float() for x in image_size.leaves] + [0, 0]
 *             )[:2]
 *             if base_width is None or base_height is None:             # <<<<<<<<<<<<<<
 *                 raise BoxConstructError
 *             aspect = base_height / base_width
 */
    }

    /* "mathics/builtin/graphics.py":2968
 *             if base_width is None or base_height is None:
 *                 raise BoxConstructError
 *             aspect = base_height / base_width             # <<<<<<<<<<<<<<
 *         else:
 *             image_size = image_size.get_name()
 */
    __pyx_t_5 = __Pyx_PyNumber_Divide(__pyx_v_base_height, __pyx_v_base_width); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2968, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF_SET(__pyx_v_aspect, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "mathics/builtin/graphics.py":2962
 *             base_width = image_size.get_int_value()
 *             base_height = None  # will be computed later in calc_dimensions
 *         elif image_size.has_form("System`List", 2):             # <<<<<<<<<<<<<<
 *             base_width, base_height = (
 *                 [x.round_to_float() for x in image_size.leaves] + [0, 0]
 */
    goto __pyx_L5;
  }

  /* "mathics/builtin/graphics.py":2970
 *             aspect = base_height / base_width
 *         else:
 *             image_size = image_size.get_name()             # <<<<<<<<<<<<<<
 *             base_width, base_height = {
 *                 "System`Automatic": (400, 350),
 */
  /*else*/ {
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_image_size, __pyx_n_s_get_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2970, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_5 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2970, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF_SET(__pyx_v_image_size, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "mathics/builtin/graphics.py":2972
 *             image_size = image_size.get_name()
 *             base_width, base_height = {
 *                 "System`Automatic": (400, 350),             # <<<<<<<<<<<<<<
 *                 "System`Tiny": (100, 100),
 *                 "System`Small": (200, 200),
 */
    __pyx_t_5 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2972, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (PyDict_SetItem(__pyx_t_5, __pyx_kp_u_System_Automatic, __pyx_tuple__130) < 0) __PYX_ERR(0, 2972, __pyx_L1_error)

    /* "mathics/builtin/graphics.py":2973
 *             base_width, base_height = {
 *                 "System`Automatic": (400, 350),
 *                 "System`Tiny": (100, 100),             # <<<<<<<<<<<<<<
 *                 "System`Small": (200, 200),
 *                 "System`Medium": (400, 350),
 */
    if (PyDict_SetItem(__pyx_t_5, __pyx_kp_u_System_Tiny, __pyx_tuple__131) < 0) __PYX_ERR(0, 2972, __pyx_L1_error)

    /* "mathics/builtin/graphics.py":2974
 *                 "System`Automatic": (400, 350),
 *                 "System`Tiny": (100, 100),
 *                 "System`Small": (200, 200),             # <<<<<<<<<<<<<<
 *                 "System`Medium": (400, 350),
 *                 "System`Large": (600, 500),
 */
    if (PyDict_SetItem(__pyx_t_5, __pyx_kp_u_System_Small, __pyx_tuple__132) < 0) __PYX_ERR(0, 2972, __pyx_L1_error)

    /* "mathics/builtin/graphics.py":2975
 *                 "System`Tiny": (100, 100),
 *                 "System`Small": (200, 200),
 *                 "System`Medium": (400, 350),             # <<<<<<<<<<<<<<
 *                 "System`Large": (600, 500),
 *             }.get(image_size, (None, None))
 */
    if (PyDict_SetItem(__pyx_t_5, __pyx_kp_u_System_Medium, __pyx_tuple__130) < 0) __PYX_ERR(0, 2972, __pyx_L1_error)

    /* "mathics/builtin/graphics.py":2976
 *                 "System`Small": (200, 200),
 *                 "System`Medium": (400, 350),
 *                 "System`Large": (600, 500),             # <<<<<<<<<<<<<<
 *             }.get(image_size, (None, None))
 *         if base_width is None:
 */
    if (PyDict_SetItem(__pyx_t_5, __pyx_kp_u_System_Large, __pyx_tuple__133) < 0) __PYX_ERR(0, 2972, __pyx_L1_error)

    /* "mathics/builtin/graphics.py":2977
 *                 "System`Medium": (400, 350),
 *                 "System`Large": (600, 500),
 *             }.get(image_size, (None, None))             # <<<<<<<<<<<<<<
 *         if base_width is None:
 *             raise BoxConstructError
 */
    __pyx_t_2 = __Pyx_PyDict_GetItemDefault(__pyx_t_5, __pyx_v_image_size, __pyx_tuple__134); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2977, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
      PyObject* sequence = __pyx_t_2;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 2971, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_1 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_1);
      #else
      __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2971, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2971, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      #endif
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_8 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2971, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_11 = Py_TYPE(__pyx_t_8)->tp_iternext;
      index = 0; __pyx_t_5 = __pyx_t_11(__pyx_t_8); if (unlikely(!__pyx_t_5)) goto __pyx_L15_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_5);
      index = 1; __pyx_t_1 = __pyx_t_11(__pyx_t_8); if (unlikely(!__pyx_t_1)) goto __pyx_L15_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_1);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_8), 2) < 0) __PYX_ERR(0, 2971, __pyx_L1_error)
      __pyx_t_11 = NULL;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L16_unpacking_done;
      __pyx_L15_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_11 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 2971, __pyx_L1_error)
      __pyx_L16_unpacking_done:;
    }

    /* "mathics/builtin/graphics.py":2971
 *         else:
 *             image_size = image_size.get_name()
 *             base_width, base_height = {             # <<<<<<<<<<<<<<
 *                 "System`Automatic": (400, 350),
 *                 "System`Tiny": (100, 100),
 */
    __pyx_v_base_width = __pyx_t_5;
    __pyx_t_5 = 0;
    __pyx_v_base_height = __pyx_t_1;
    __pyx_t_1 = 0;
  }
  __pyx_L5:;

  /* "mathics/builtin/graphics.py":2978
 *                 "System`Large": (600, 500),
 *             }.get(image_size, (None, None))
 *         if base_width is None:             # <<<<<<<<<<<<<<
 *             raise BoxConstructError
 *         if max_width is not None and base_width > max_width:
 */
  __pyx_t_3 = (__pyx_v_base_width == Py_None);
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (unlikely(__pyx_t_4)) {

    /* "mathics/builtin/graphics.py":2979
 *             }.get(image_size, (None, None))
 *         if base_width is None:
 *             raise BoxConstructError             # <<<<<<<<<<<<<<
 *         if max_width is not None and base_width > max_width:
 *             base_width = max_width
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_BoxConstructError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2979, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 2979, __pyx_L1_error)

    /* "mathics/builtin/graphics.py":2978
 *                 "System`Large": (600, 500),
 *             }.get(image_size, (None, None))
 *         if base_width is None:             # <<<<<<<<<<<<<<
 *             raise BoxConstructError
 *         if max_width is not None and base_width > max_width:
 */
  }

  /* "mathics/builtin/graphics.py":2980
 *         if base_width is None:
 *             raise BoxConstructError
 *         if max_width is not None and base_width > max_width:             # <<<<<<<<<<<<<<
 *             base_width = max_width
 * 
 */
  __pyx_t_3 = (__pyx_v_max_width != Py_None);
  __pyx_t_10 = (__pyx_t_3 != 0);
  if (__pyx_t_10) {
  } else {
    __pyx_t_4 = __pyx_t_10;
    goto __pyx_L19_bool_binop_done;
  }
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_base_width, __pyx_v_max_width, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2980, __pyx_L1_error)
  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 2980, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __pyx_t_10;
  __pyx_L19_bool_binop_done:;
  if (__pyx_t_4) {

    /* "mathics/builtin/graphics.py":2981
 *             raise BoxConstructError
 *         if max_width is not None and base_width > max_width:
 *             base_width = max_width             # <<<<<<<<<<<<<<
 * 
 *         if inside_row:
 */
    __Pyx_INCREF(__pyx_v_max_width);
    __Pyx_DECREF_SET(__pyx_v_base_width, __pyx_v_max_width);

    /* "mathics/builtin/graphics.py":2980
 *         if base_width is None:
 *             raise BoxConstructError
 *         if max_width is not None and base_width > max_width:             # <<<<<<<<<<<<<<
 *             base_width = max_width
 * 
 */
  }

  /* "mathics/builtin/graphics.py":2983
 *             base_width = max_width
 * 
 *         if inside_row:             # <<<<<<<<<<<<<<
 *             multi = image_size_multipliers[1]
 *         elif inside_list:
 */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_inside_row); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 2983, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "mathics/builtin/graphics.py":2984
 * 
 *         if inside_row:
 *             multi = image_size_multipliers[1]             # <<<<<<<<<<<<<<
 *         elif inside_list:
 *             multi = image_size_multipliers[0]
 */
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_image_size_multipliers, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2984, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_multi = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "mathics/builtin/graphics.py":2983
 *             base_width = max_width
 * 
 *         if inside_row:             # <<<<<<<<<<<<<<
 *             multi = image_size_multipliers[1]
 *         elif inside_list:
 */
    goto __pyx_L21;
  }

  /* "mathics/builtin/graphics.py":2985
 *         if inside_row:
 *             multi = image_size_multipliers[1]
 *         elif inside_list:             # <<<<<<<<<<<<<<
 *             multi = image_size_multipliers[0]
 *         else:
 */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_inside_list); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 2985, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "mathics/builtin/graphics.py":2986
 *             multi = image_size_multipliers[1]
 *         elif inside_list:
 *             multi = image_size_multipliers[0]             # <<<<<<<<<<<<<<
 *         else:
 *             multi = 1
 */
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_image_size_multipliers, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2986, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_multi = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "mathics/builtin/graphics.py":2985
 *         if inside_row:
 *             multi = image_size_multipliers[1]
 *         elif inside_list:             # <<<<<<<<<<<<<<
 *             multi = image_size_multipliers[0]
 *         else:
 */
    goto __pyx_L21;
  }

  /* "mathics/builtin/graphics.py":2988
 *             multi = image_size_multipliers[0]
 *         else:
 *             multi = 1             # <<<<<<<<<<<<<<
 * 
 *         return base_width, base_height, multi, aspect
 */
  /*else*/ {
    __Pyx_INCREF(__pyx_int_1);
    __pyx_v_multi = __pyx_int_1;
  }
  __pyx_L21:;

  /* "mathics/builtin/graphics.py":2990
 *             multi = 1
 * 
 *         return base_width, base_height, multi, aspect             # <<<<<<<<<<<<<<
 * 
 *     def _prepare_elements(self, leaves, options, neg_y=False, max_width=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2990, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_base_width);
  __Pyx_GIVEREF(__pyx_v_base_width);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_base_width);
  __Pyx_INCREF(__pyx_v_base_height);
  __Pyx_GIVEREF(__pyx_v_base_height);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_base_height);
  __Pyx_INCREF(__pyx_v_multi);
  __Pyx_GIVEREF(__pyx_v_multi);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_multi);
  __Pyx_INCREF(__pyx_v_aspect);
  __Pyx_GIVEREF(__pyx_v_aspect);
  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_aspect);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":2943
 *         return "-Graphics-"
 * 
 *     def _get_image_size(self, options, graphics_options, max_width):             # <<<<<<<<<<<<<<
 *         inside_row = options.pop("inside_row", False)
 *         inside_list = options.pop("inside_list", False)
 */

  /* 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_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("mathics.builtin.graphics.GraphicsBox._get_image_size", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_inside_row);
  __Pyx_XDECREF(__pyx_v_inside_list);
  __Pyx_XDECREF(__pyx_v_image_size_multipliers);
  __Pyx_XDECREF(__pyx_v_aspect_ratio);
  __Pyx_XDECREF(__pyx_v_aspect);
  __Pyx_XDECREF(__pyx_v_image_size);
  __Pyx_XDECREF(__pyx_v_base_width);
  __Pyx_XDECREF(__pyx_v_base_height);
  __Pyx_XDECREF(__pyx_v_multi);
  __Pyx_XDECREF(__pyx_9genexpr57__pyx_v_x);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":2992
 *         return base_width, base_height, multi, aspect
 * 
 *     def _prepare_elements(self, leaves, options, neg_y=False, max_width=None):             # <<<<<<<<<<<<<<
 *         if not leaves:
 *             raise BoxConstructError
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_11GraphicsBox_5_prepare_elements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_11GraphicsBox_5_prepare_elements = {"_prepare_elements", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_11GraphicsBox_5_prepare_elements, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_11GraphicsBox_5_prepare_elements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_leaves = 0;
  PyObject *__pyx_v_options = 0;
  PyObject *__pyx_v_neg_y = 0;
  PyObject *__pyx_v_max_width = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_prepare_elements (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_leaves,&__pyx_n_s_options,&__pyx_n_s_neg_y,&__pyx_n_s_max_width,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[3] = ((PyObject *)((PyObject *)Py_False));
    values[4] = ((PyObject *)((PyObject *)Py_None));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_leaves)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_prepare_elements", 0, 3, 5, 1); __PYX_ERR(0, 2992, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_options)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_prepare_elements", 0, 3, 5, 2); __PYX_ERR(0, 2992, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_neg_y);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_width);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_prepare_elements") < 0)) __PYX_ERR(0, 2992, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_leaves = values[1];
    __pyx_v_options = values[2];
    __pyx_v_neg_y = values[3];
    __pyx_v_max_width = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_prepare_elements", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2992, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.GraphicsBox._prepare_elements", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_11GraphicsBox_4_prepare_elements(__pyx_self, __pyx_v_self, __pyx_v_leaves, __pyx_v_options, __pyx_v_neg_y, __pyx_v_max_width);

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

/* "mathics/builtin/graphics.py":3021
 *         axes = []  # to be filled further down
 * 
 *         def calc_dimensions(final_pass=True):             # <<<<<<<<<<<<<<
 *             """
 *             calc_dimensions gets called twice: In the first run
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_11GraphicsBox_17_prepare_elements_1calc_dimensions(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7mathics_7builtin_8graphics_11GraphicsBox_17_prepare_elements_calc_dimensions[] = "\n            calc_dimensions gets called twice: In the first run\n            (final_pass = False, called inside _prepare_elements), the extent\n            of all user-defined graphics is determined.\n            Axes are created accordingly.\n            In the second run (final_pass = True, called from outside),\n            the dimensions of these axes are taken into account as well.\n            This is also important to size absolutely sized objects correctly\n            (e.g. values using AbsoluteThickness).\n            ";
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_11GraphicsBox_17_prepare_elements_1calc_dimensions = {"calc_dimensions", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_11GraphicsBox_17_prepare_elements_1calc_dimensions, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7mathics_7builtin_8graphics_11GraphicsBox_17_prepare_elements_calc_dimensions};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_11GraphicsBox_17_prepare_elements_1calc_dimensions(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_final_pass = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("calc_dimensions (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_final_pass,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)((PyObject *)Py_True));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_final_pass);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "calc_dimensions") < 0)) __PYX_ERR(0, 3021, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_final_pass = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("calc_dimensions", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3021, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.GraphicsBox._prepare_elements.calc_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_11GraphicsBox_17_prepare_elements_calc_dimensions(__pyx_self, __pyx_v_final_pass);

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

/* "mathics/builtin/graphics.py":3053
 *                 exmin = exmax = eymin = eymax = None
 * 
 *             def get_range(min, max):             # <<<<<<<<<<<<<<
 *                 if max < min:
 *                     min, max = max, min
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_11GraphicsBox_17_prepare_elements_15calc_dimensions_1get_range(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_11GraphicsBox_17_prepare_elements_15calc_dimensions_1get_range = {"get_range", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_11GraphicsBox_17_prepare_elements_15calc_dimensions_1get_range, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_11GraphicsBox_17_prepare_elements_15calc_dimensions_1get_range(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_min = 0;
  PyObject *__pyx_v_max = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_range (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_min,&__pyx_n_s_max,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_min)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("get_range", 1, 2, 2, 1); __PYX_ERR(0, 3053, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_range") < 0)) __PYX_ERR(0, 3053, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_min = values[0];
    __pyx_v_max = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_range", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3053, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.GraphicsBox._prepare_elements.calc_dimensions.get_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_11GraphicsBox_17_prepare_elements_15calc_dimensions_get_range(__pyx_self, __pyx_v_min, __pyx_v_max);

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_11GraphicsBox_17_prepare_elements_15calc_dimensions_get_range(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_min, PyObject *__pyx_v_max) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_range", 0);
  __Pyx_INCREF(__pyx_v_min);
  __Pyx_INCREF(__pyx_v_max);

  /* "mathics/builtin/graphics.py":3054
 * 
 *             def get_range(min, max):
 *                 if max < min:             # <<<<<<<<<<<<<<
 *                     min, max = max, min
 *                 elif min == max:
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_max, __pyx_v_min, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3054, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 3054, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "mathics/builtin/graphics.py":3055
 *             def get_range(min, max):
 *                 if max < min:
 *                     min, max = max, min             # <<<<<<<<<<<<<<
 *                 elif min == max:
 *                     if min < 0:
 */
    __pyx_t_3 = __pyx_v_max;
    __pyx_t_4 = __pyx_v_min;
    __pyx_v_min = __pyx_t_3;
    __pyx_t_3 = 0;
    __pyx_v_max = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "mathics/builtin/graphics.py":3054
 * 
 *             def get_range(min, max):
 *                 if max < min:             # <<<<<<<<<<<<<<
 *                     min, max = max, min
 *                 elif min == max:
 */
    goto __pyx_L3;
  }

  /* "mathics/builtin/graphics.py":3056
 *                 if max < min:
 *                     min, max = max, min
 *                 elif min == max:             # <<<<<<<<<<<<<<
 *                     if min < 0:
 *                         min, max = 2 * min, 0
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_min, __pyx_v_max, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3056, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 3056, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "mathics/builtin/graphics.py":3057
 *                     min, max = max, min
 *                 elif min == max:
 *                     if min < 0:             # <<<<<<<<<<<<<<
 *                         min, max = 2 * min, 0
 *                     elif min > 0:
 */
    __pyx_t_1 = PyObject_RichCompare(__pyx_v_min, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3057, __pyx_L1_error)
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 3057, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_2) {

      /* "mathics/builtin/graphics.py":3058
 *                 elif min == max:
 *                     if min < 0:
 *                         min, max = 2 * min, 0             # <<<<<<<<<<<<<<
 *                     elif min > 0:
 *                         min, max = 0, 2 * min
 */
      __pyx_t_1 = PyNumber_Multiply(__pyx_int_2, __pyx_v_min); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3058, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __pyx_int_0;
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_DECREF_SET(__pyx_v_min, __pyx_t_1);
      __pyx_t_1 = 0;
      __Pyx_DECREF_SET(__pyx_v_max, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "mathics/builtin/graphics.py":3057
 *                     min, max = max, min
 *                 elif min == max:
 *                     if min < 0:             # <<<<<<<<<<<<<<
 *                         min, max = 2 * min, 0
 *                     elif min > 0:
 */
      goto __pyx_L4;
    }

    /* "mathics/builtin/graphics.py":3059
 *                     if min < 0:
 *                         min, max = 2 * min, 0
 *                     elif min > 0:             # <<<<<<<<<<<<<<
 *                         min, max = 0, 2 * min
 *                     else:
 */
    __pyx_t_5 = PyObject_RichCompare(__pyx_v_min, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3059, __pyx_L1_error)
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 3059, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_2) {

      /* "mathics/builtin/graphics.py":3060
 *                         min, max = 2 * min, 0
 *                     elif min > 0:
 *                         min, max = 0, 2 * min             # <<<<<<<<<<<<<<
 *                     else:
 *                         min, max = -1, 1
 */
      __pyx_t_5 = __pyx_int_0;
      __Pyx_INCREF(__pyx_t_5);
      __pyx_t_1 = PyNumber_Multiply(__pyx_int_2, __pyx_v_min); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3060, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF_SET(__pyx_v_min, __pyx_t_5);
      __pyx_t_5 = 0;
      __Pyx_DECREF_SET(__pyx_v_max, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "mathics/builtin/graphics.py":3059
 *                     if min < 0:
 *                         min, max = 2 * min, 0
 *                     elif min > 0:             # <<<<<<<<<<<<<<
 *                         min, max = 0, 2 * min
 *                     else:
 */
      goto __pyx_L4;
    }

    /* "mathics/builtin/graphics.py":3062
 *                         min, max = 0, 2 * min
 *                     else:
 *                         min, max = -1, 1             # <<<<<<<<<<<<<<
 *                 return min, max
 * 
 */
    /*else*/ {
      __pyx_t_1 = __pyx_int_neg_1;
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_5 = __pyx_int_1;
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_DECREF_SET(__pyx_v_min, __pyx_t_1);
      __pyx_t_1 = 0;
      __Pyx_DECREF_SET(__pyx_v_max, __pyx_t_5);
      __pyx_t_5 = 0;
    }
    __pyx_L4:;

    /* "mathics/builtin/graphics.py":3056
 *                 if max < min:
 *                     min, max = max, min
 *                 elif min == max:             # <<<<<<<<<<<<<<
 *                     if min < 0:
 *                         min, max = 2 * min, 0
 */
  }
  __pyx_L3:;

  /* "mathics/builtin/graphics.py":3063
 *                     else:
 *                         min, max = -1, 1
 *                 return min, max             # <<<<<<<<<<<<<<
 * 
 *             try:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3063, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_v_min);
  __Pyx_GIVEREF(__pyx_v_min);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_min);
  __Pyx_INCREF(__pyx_v_max);
  __Pyx_GIVEREF(__pyx_v_max);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_max);
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":3053
 *                 exmin = exmax = eymin = eymax = None
 * 
 *             def get_range(min, max):             # <<<<<<<<<<<<<<
 *                 if max < min:
 *                     min, max = max, min
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("mathics.builtin.graphics.GraphicsBox._prepare_elements.calc_dimensions.get_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_min);
  __Pyx_XDECREF(__pyx_v_max);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7mathics_7builtin_8graphics_11GraphicsBox_17_prepare_elements_15calc_dimensions_4generator48(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "mathics/builtin/graphics.py":3041
 *             if (
 *                 final_pass
 *                 and any(x for x in axes)             # <<<<<<<<<<<<<<
 *                 and plot_range != ["System`Automatic", "System`Automatic"]
 *             ):
 */

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_11GraphicsBox_17_prepare_elements_15calc_dimensions_2genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_79_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_7mathics_7builtin_8graphics___pyx_scope_struct_79_genexpr *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_79_genexpr(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_79_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_79_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 3041, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_78__prepare_elements *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7mathics_7builtin_8graphics_11GraphicsBox_17_prepare_elements_15calc_dimensions_4generator48, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_GraphicsBox__prepare_elements_lo, __pyx_n_s_mathics_builtin_graphics); if (unlikely(!gen)) __PYX_ERR(0, 3041, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.GraphicsBox._prepare_elements.calc_dimensions.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_7mathics_7builtin_8graphics_11GraphicsBox_17_prepare_elements_15calc_dimensions_4generator48(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_79_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_79_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 3041, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_axes)) { __Pyx_RaiseClosureNameError("axes"); __PYX_ERR(0, 3041, __pyx_L1_error) }
  if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_axes == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(0, 3041, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_axes; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
  for (;;) {
    if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 3041, __pyx_L1_error)
    #else
    __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3041, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_x);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_x, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_x); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 3041, __pyx_L1_error)
    if (__pyx_t_4) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_True);
      __pyx_r = Py_True;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
  }
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __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;
}

/* "mathics/builtin/graphics.py":3021
 *         axes = []  # to be filled further down
 * 
 *         def calc_dimensions(final_pass=True):             # <<<<<<<<<<<<<<
 *             """
 *             calc_dimensions gets called twice: In the first run
 */

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_11GraphicsBox_17_prepare_elements_calc_dimensions(PyObject *__pyx_self, PyObject *__pyx_v_final_pass) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_78__prepare_elements *__pyx_cur_scope;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_78__prepare_elements *__pyx_outer_scope;
  PyObject *__pyx_v_xmin = NULL;
  PyObject *__pyx_v_xmax = NULL;
  PyObject *__pyx_v_ymin = NULL;
  PyObject *__pyx_v_ymax = NULL;
  PyObject *__pyx_v_exmin = NULL;
  PyObject *__pyx_v_exmax = NULL;
  PyObject *__pyx_v_eymin = NULL;
  PyObject *__pyx_v_eymax = NULL;
  PyObject *__pyx_v_get_range = 0;
  PyObject *__pyx_v_w = NULL;
  PyObject *__pyx_v_h = NULL;
  PyObject *__pyx_v_aspect = NULL;
  PyObject *__pyx_v_height = NULL;
  PyObject *__pyx_v_width = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *(*__pyx_t_10)(PyObject *);
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  Py_ssize_t __pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  int __pyx_t_17;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("calc_dimensions", 0);
  __pyx_outer_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_78__prepare_elements *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "mathics/builtin/graphics.py":3034
 * 
 *             # always need to compute extent if size aspect is automatic
 *             if "System`Automatic" in plot_range or size_aspect is None:             # <<<<<<<<<<<<<<
 *                 xmin, xmax, ymin, ymax = elements.extent()
 *             else:
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_plot_range)) { __Pyx_RaiseClosureNameError("plot_range"); __PYX_ERR(0, 3034, __pyx_L1_error) }
  __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_kp_u_System_Automatic, __pyx_cur_scope->__pyx_v_plot_range, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 3034, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  if (unlikely(!__pyx_cur_scope->__pyx_v_size_aspect)) { __Pyx_RaiseClosureNameError("size_aspect"); __PYX_ERR(0, 3034, __pyx_L1_error) }
  __pyx_t_3 = (__pyx_cur_scope->__pyx_v_size_aspect == Py_None);
  __pyx_t_2 = (__pyx_t_3 != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "mathics/builtin/graphics.py":3035
 *             # always need to compute extent if size aspect is automatic
 *             if "System`Automatic" in plot_range or size_aspect is None:
 *                 xmin, xmax, ymin, ymax = elements.extent()             # <<<<<<<<<<<<<<
 *             else:
 *                 xmin = xmax = ymin = ymax = None
 */
    if (unlikely(!__pyx_cur_scope->__pyx_v_elements)) { __Pyx_RaiseClosureNameError("elements"); __PYX_ERR(0, 3035, __pyx_L1_error) }
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_elements, __pyx_n_s_extent); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3035, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3035, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
      PyObject* sequence = __pyx_t_4;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 4)) {
        if (size > 4) __Pyx_RaiseTooManyValuesError(4);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 3035, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); 
        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 2); 
        __pyx_t_8 = PyTuple_GET_ITEM(sequence, 3); 
      } else {
        __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_6 = PyList_GET_ITEM(sequence, 1); 
        __pyx_t_7 = PyList_GET_ITEM(sequence, 2); 
        __pyx_t_8 = PyList_GET_ITEM(sequence, 3); 
      }
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_8);
      #else
      {
        Py_ssize_t i;
        PyObject** temps[4] = {&__pyx_t_5,&__pyx_t_6,&__pyx_t_7,&__pyx_t_8};
        for (i=0; i < 4; i++) {
          PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 3035, __pyx_L1_error)
          __Pyx_GOTREF(item);
          *(temps[i]) = item;
        }
      }
      #endif
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else {
      Py_ssize_t index = -1;
      PyObject** temps[4] = {&__pyx_t_5,&__pyx_t_6,&__pyx_t_7,&__pyx_t_8};
      __pyx_t_9 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3035, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext;
      for (index=0; index < 4; index++) {
        PyObject* item = __pyx_t_10(__pyx_t_9); if (unlikely(!item)) goto __pyx_L6_unpacking_failed;
        __Pyx_GOTREF(item);
        *(temps[index]) = item;
      }
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 4) < 0) __PYX_ERR(0, 3035, __pyx_L1_error)
      __pyx_t_10 = NULL;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      goto __pyx_L7_unpacking_done;
      __pyx_L6_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_10 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 3035, __pyx_L1_error)
      __pyx_L7_unpacking_done:;
    }
    __pyx_v_xmin = __pyx_t_5;
    __pyx_t_5 = 0;
    __pyx_v_xmax = __pyx_t_6;
    __pyx_t_6 = 0;
    __pyx_v_ymin = __pyx_t_7;
    __pyx_t_7 = 0;
    __pyx_v_ymax = __pyx_t_8;
    __pyx_t_8 = 0;

    /* "mathics/builtin/graphics.py":3034
 * 
 *             # always need to compute extent if size aspect is automatic
 *             if "System`Automatic" in plot_range or size_aspect is None:             # <<<<<<<<<<<<<<
 *                 xmin, xmax, ymin, ymax = elements.extent()
 *             else:
 */
    goto __pyx_L3;
  }

  /* "mathics/builtin/graphics.py":3037
 *                 xmin, xmax, ymin, ymax = elements.extent()
 *             else:
 *                 xmin = xmax = ymin = ymax = None             # <<<<<<<<<<<<<<
 * 
 *             if (
 */
  /*else*/ {
    __Pyx_INCREF(Py_None);
    __pyx_v_xmin = Py_None;
    __Pyx_INCREF(Py_None);
    __pyx_v_xmax = Py_None;
    __Pyx_INCREF(Py_None);
    __pyx_v_ymin = Py_None;
    __Pyx_INCREF(Py_None);
    __pyx_v_ymax = Py_None;
  }
  __pyx_L3:;

  /* "mathics/builtin/graphics.py":3040
 * 
 *             if (
 *                 final_pass             # <<<<<<<<<<<<<<
 *                 and any(x for x in axes)
 *                 and plot_range != ["System`Automatic", "System`Automatic"]
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_final_pass); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 3040, __pyx_L1_error)
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L9_bool_binop_done;
  }

  /* "mathics/builtin/graphics.py":3041
 *             if (
 *                 final_pass
 *                 and any(x for x in axes)             # <<<<<<<<<<<<<<
 *                 and plot_range != ["System`Automatic", "System`Automatic"]
 *             ):
 */
  __pyx_t_4 = __pyx_pf_7mathics_7builtin_8graphics_11GraphicsBox_17_prepare_elements_15calc_dimensions_2genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3041, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_8 = __Pyx_Generator_Next(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3041, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 3041, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L9_bool_binop_done;
  }

  /* "mathics/builtin/graphics.py":3042
 *                 final_pass
 *                 and any(x for x in axes)
 *                 and plot_range != ["System`Automatic", "System`Automatic"]             # <<<<<<<<<<<<<<
 *             ):
 *                 # Take into account the dimensions of axes and axes labels
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_plot_range)) { __Pyx_RaiseClosureNameError("plot_range"); __PYX_ERR(0, 3042, __pyx_L1_error) }
  __pyx_t_8 = PyList_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3042, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_INCREF(__pyx_kp_u_System_Automatic);
  __Pyx_GIVEREF(__pyx_kp_u_System_Automatic);
  PyList_SET_ITEM(__pyx_t_8, 0, __pyx_kp_u_System_Automatic);
  __Pyx_INCREF(__pyx_kp_u_System_Automatic);
  __Pyx_GIVEREF(__pyx_kp_u_System_Automatic);
  PyList_SET_ITEM(__pyx_t_8, 1, __pyx_kp_u_System_Automatic);
  __pyx_t_4 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_plot_range, __pyx_t_8, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3042, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 3042, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_1 = __pyx_t_2;
  __pyx_L9_bool_binop_done:;

  /* "mathics/builtin/graphics.py":3039
 *                 xmin = xmax = ymin = ymax = None
 * 
 *             if (             # <<<<<<<<<<<<<<
 *                 final_pass
 *                 and any(x for x in axes)
 */
  if (__pyx_t_1) {

    /* "mathics/builtin/graphics.py":3047
 *                 # (they should be displayed completely even when a specific
 *                 # PlotRange is given).
 *                 exmin, exmax, eymin, eymax = elements.extent(             # <<<<<<<<<<<<<<
 *                     completely_visible_only=True
 *                 )
 */
    if (unlikely(!__pyx_cur_scope->__pyx_v_elements)) { __Pyx_RaiseClosureNameError("elements"); __PYX_ERR(0, 3047, __pyx_L1_error) }
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_elements, __pyx_n_s_extent); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3047, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);

    /* "mathics/builtin/graphics.py":3048
 *                 # PlotRange is given).
 *                 exmin, exmax, eymin, eymax = elements.extent(
 *                     completely_visible_only=True             # <<<<<<<<<<<<<<
 *                 )
 *             else:
 */
    __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3048, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_completely_visible_only, Py_True) < 0) __PYX_ERR(0, 3048, __pyx_L1_error)

    /* "mathics/builtin/graphics.py":3047
 *                 # (they should be displayed completely even when a specific
 *                 # PlotRange is given).
 *                 exmin, exmax, eymin, eymax = elements.extent(             # <<<<<<<<<<<<<<
 *                     completely_visible_only=True
 *                 )
 */
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3047, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    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 != 4)) {
        if (size > 4) __Pyx_RaiseTooManyValuesError(4);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 3047, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); 
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 3); 
      } else {
        __pyx_t_8 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_4 = PyList_GET_ITEM(sequence, 1); 
        __pyx_t_6 = PyList_GET_ITEM(sequence, 2); 
        __pyx_t_5 = PyList_GET_ITEM(sequence, 3); 
      }
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_5);
      #else
      {
        Py_ssize_t i;
        PyObject** temps[4] = {&__pyx_t_8,&__pyx_t_4,&__pyx_t_6,&__pyx_t_5};
        for (i=0; i < 4; i++) {
          PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 3047, __pyx_L1_error)
          __Pyx_GOTREF(item);
          *(temps[i]) = item;
        }
      }
      #endif
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    } else {
      Py_ssize_t index = -1;
      PyObject** temps[4] = {&__pyx_t_8,&__pyx_t_4,&__pyx_t_6,&__pyx_t_5};
      __pyx_t_9 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3047, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext;
      for (index=0; index < 4; index++) {
        PyObject* item = __pyx_t_10(__pyx_t_9); if (unlikely(!item)) goto __pyx_L12_unpacking_failed;
        __Pyx_GOTREF(item);
        *(temps[index]) = item;
      }
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 4) < 0) __PYX_ERR(0, 3047, __pyx_L1_error)
      __pyx_t_10 = NULL;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      goto __pyx_L13_unpacking_done;
      __pyx_L12_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_10 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 3047, __pyx_L1_error)
      __pyx_L13_unpacking_done:;
    }
    __pyx_v_exmin = __pyx_t_8;
    __pyx_t_8 = 0;
    __pyx_v_exmax = __pyx_t_4;
    __pyx_t_4 = 0;
    __pyx_v_eymin = __pyx_t_6;
    __pyx_t_6 = 0;
    __pyx_v_eymax = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "mathics/builtin/graphics.py":3039
 *                 xmin = xmax = ymin = ymax = None
 * 
 *             if (             # <<<<<<<<<<<<<<
 *                 final_pass
 *                 and any(x for x in axes)
 */
    goto __pyx_L8;
  }

  /* "mathics/builtin/graphics.py":3051
 *                 )
 *             else:
 *                 exmin = exmax = eymin = eymax = None             # <<<<<<<<<<<<<<
 * 
 *             def get_range(min, max):
 */
  /*else*/ {
    __Pyx_INCREF(Py_None);
    __pyx_v_exmin = Py_None;
    __Pyx_INCREF(Py_None);
    __pyx_v_exmax = Py_None;
    __Pyx_INCREF(Py_None);
    __pyx_v_eymin = Py_None;
    __Pyx_INCREF(Py_None);
    __pyx_v_eymax = Py_None;
  }
  __pyx_L8:;

  /* "mathics/builtin/graphics.py":3053
 *                 exmin = exmax = eymin = eymax = None
 * 
 *             def get_range(min, max):             # <<<<<<<<<<<<<<
 *                 if max < min:
 *                     min, max = max, min
 */
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_11GraphicsBox_17_prepare_elements_15calc_dimensions_1get_range, 0, __pyx_n_s_GraphicsBox__prepare_elements_lo_2, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__136)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3053, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_v_get_range = __pyx_t_7;
  __pyx_t_7 = 0;

  /* "mathics/builtin/graphics.py":3065
 *                 return min, max
 * 
 *             try:             # <<<<<<<<<<<<<<
 *                 if plot_range[0] == "System`Automatic":
 *                     if xmin is None and xmax is None:
 */
  {
    __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:*/ {

      /* "mathics/builtin/graphics.py":3066
 * 
 *             try:
 *                 if plot_range[0] == "System`Automatic":             # <<<<<<<<<<<<<<
 *                     if xmin is None and xmax is None:
 *                         xmin = 0
 */
      if (unlikely(!__pyx_cur_scope->__pyx_v_plot_range)) { __Pyx_RaiseClosureNameError("plot_range"); __PYX_ERR(0, 3066, __pyx_L14_error) }
      __pyx_t_7 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_plot_range, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3066, __pyx_L14_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_t_7, __pyx_kp_u_System_Automatic, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 3066, __pyx_L14_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (__pyx_t_1) {

        /* "mathics/builtin/graphics.py":3067
 *             try:
 *                 if plot_range[0] == "System`Automatic":
 *                     if xmin is None and xmax is None:             # <<<<<<<<<<<<<<
 *                         xmin = 0
 *                         xmax = 1
 */
        __pyx_t_2 = (__pyx_v_xmin == Py_None);
        __pyx_t_3 = (__pyx_t_2 != 0);
        if (__pyx_t_3) {
        } else {
          __pyx_t_1 = __pyx_t_3;
          goto __pyx_L22_bool_binop_done;
        }
        __pyx_t_3 = (__pyx_v_xmax == Py_None);
        __pyx_t_2 = (__pyx_t_3 != 0);
        __pyx_t_1 = __pyx_t_2;
        __pyx_L22_bool_binop_done:;
        if (__pyx_t_1) {

          /* "mathics/builtin/graphics.py":3068
 *                 if plot_range[0] == "System`Automatic":
 *                     if xmin is None and xmax is None:
 *                         xmin = 0             # <<<<<<<<<<<<<<
 *                         xmax = 1
 *                     elif xmin == xmax:
 */
          __Pyx_INCREF(__pyx_int_0);
          __Pyx_DECREF_SET(__pyx_v_xmin, __pyx_int_0);

          /* "mathics/builtin/graphics.py":3069
 *                     if xmin is None and xmax is None:
 *                         xmin = 0
 *                         xmax = 1             # <<<<<<<<<<<<<<
 *                     elif xmin == xmax:
 *                         xmin -= 1
 */
          __Pyx_INCREF(__pyx_int_1);
          __Pyx_DECREF_SET(__pyx_v_xmax, __pyx_int_1);

          /* "mathics/builtin/graphics.py":3067
 *             try:
 *                 if plot_range[0] == "System`Automatic":
 *                     if xmin is None and xmax is None:             # <<<<<<<<<<<<<<
 *                         xmin = 0
 *                         xmax = 1
 */
          goto __pyx_L21;
        }

        /* "mathics/builtin/graphics.py":3070
 *                         xmin = 0
 *                         xmax = 1
 *                     elif xmin == xmax:             # <<<<<<<<<<<<<<
 *                         xmin -= 1
 *                         xmax += 1
 */
        __pyx_t_7 = PyObject_RichCompare(__pyx_v_xmin, __pyx_v_xmax, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3070, __pyx_L14_error)
        __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 3070, __pyx_L14_error)
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (__pyx_t_1) {

          /* "mathics/builtin/graphics.py":3071
 *                         xmax = 1
 *                     elif xmin == xmax:
 *                         xmin -= 1             # <<<<<<<<<<<<<<
 *                         xmax += 1
 *                 elif isinstance(plot_range[0], list) and len(plot_range[0]) == 2:
 */
          __pyx_t_7 = __Pyx_PyInt_SubtractObjC(__pyx_v_xmin, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3071, __pyx_L14_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF_SET(__pyx_v_xmin, __pyx_t_7);
          __pyx_t_7 = 0;

          /* "mathics/builtin/graphics.py":3072
 *                     elif xmin == xmax:
 *                         xmin -= 1
 *                         xmax += 1             # <<<<<<<<<<<<<<
 *                 elif isinstance(plot_range[0], list) and len(plot_range[0]) == 2:
 *                     xmin, xmax = list(map(float, plot_range[0]))
 */
          __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_v_xmax, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3072, __pyx_L14_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF_SET(__pyx_v_xmax, __pyx_t_7);
          __pyx_t_7 = 0;

          /* "mathics/builtin/graphics.py":3070
 *                         xmin = 0
 *                         xmax = 1
 *                     elif xmin == xmax:             # <<<<<<<<<<<<<<
 *                         xmin -= 1
 *                         xmax += 1
 */
        }
        __pyx_L21:;

        /* "mathics/builtin/graphics.py":3066
 * 
 *             try:
 *                 if plot_range[0] == "System`Automatic":             # <<<<<<<<<<<<<<
 *                     if xmin is None and xmax is None:
 *                         xmin = 0
 */
        goto __pyx_L20;
      }

      /* "mathics/builtin/graphics.py":3073
 *                         xmin -= 1
 *                         xmax += 1
 *                 elif isinstance(plot_range[0], list) and len(plot_range[0]) == 2:             # <<<<<<<<<<<<<<
 *                     xmin, xmax = list(map(float, plot_range[0]))
 *                     xmin, xmax = get_range(xmin, xmax)
 */
      if (unlikely(!__pyx_cur_scope->__pyx_v_plot_range)) { __Pyx_RaiseClosureNameError("plot_range"); __PYX_ERR(0, 3073, __pyx_L14_error) }
      __pyx_t_7 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_plot_range, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3073, __pyx_L14_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_2 = PyList_Check(__pyx_t_7); 
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_3 = (__pyx_t_2 != 0);
      if (__pyx_t_3) {
      } else {
        __pyx_t_1 = __pyx_t_3;
        goto __pyx_L24_bool_binop_done;
      }
      if (unlikely(!__pyx_cur_scope->__pyx_v_plot_range)) { __Pyx_RaiseClosureNameError("plot_range"); __PYX_ERR(0, 3073, __pyx_L14_error) }
      __pyx_t_7 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_plot_range, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3073, __pyx_L14_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_14 = PyObject_Length(__pyx_t_7); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1))) __PYX_ERR(0, 3073, __pyx_L14_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_3 = ((__pyx_t_14 == 2) != 0);
      __pyx_t_1 = __pyx_t_3;
      __pyx_L24_bool_binop_done:;
      if (likely(__pyx_t_1)) {

        /* "mathics/builtin/graphics.py":3074
 *                         xmax += 1
 *                 elif isinstance(plot_range[0], list) and len(plot_range[0]) == 2:
 *                     xmin, xmax = list(map(float, plot_range[0]))             # <<<<<<<<<<<<<<
 *                     xmin, xmax = get_range(xmin, xmax)
 *                     xmin = elements.translate((xmin, 0))[0]
 */
        if (unlikely(!__pyx_cur_scope->__pyx_v_plot_range)) { __Pyx_RaiseClosureNameError("plot_range"); __PYX_ERR(0, 3074, __pyx_L14_error) }
        __pyx_t_7 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_plot_range, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3074, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3074, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_INCREF(((PyObject *)(&PyFloat_Type)));
        __Pyx_GIVEREF(((PyObject *)(&PyFloat_Type)));
        PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)(&PyFloat_Type)));
        __Pyx_GIVEREF(__pyx_t_7);
        PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_7);
        __pyx_t_7 = 0;
        __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_5, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3074, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = PySequence_List(__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3074, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (1) {
          PyObject* sequence = __pyx_t_5;
          Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
          if (unlikely(size != 2)) {
            if (size > 2) __Pyx_RaiseTooManyValuesError(2);
            else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
            __PYX_ERR(0, 3074, __pyx_L14_error)
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_7 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_6 = PyList_GET_ITEM(sequence, 1); 
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          #else
          __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3074, __pyx_L14_error)
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3074, __pyx_L14_error)
          __Pyx_GOTREF(__pyx_t_6);
          #endif
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
        __Pyx_DECREF_SET(__pyx_v_xmin, __pyx_t_7);
        __pyx_t_7 = 0;
        __Pyx_DECREF_SET(__pyx_v_xmax, __pyx_t_6);
        __pyx_t_6 = 0;

        /* "mathics/builtin/graphics.py":3075
 *                 elif isinstance(plot_range[0], list) and len(plot_range[0]) == 2:
 *                     xmin, xmax = list(map(float, plot_range[0]))
 *                     xmin, xmax = get_range(xmin, xmax)             # <<<<<<<<<<<<<<
 *                     xmin = elements.translate((xmin, 0))[0]
 *                     xmax = elements.translate((xmax, 0))[0]
 */
        __pyx_t_5 = __pyx_pf_7mathics_7builtin_8graphics_11GraphicsBox_17_prepare_elements_15calc_dimensions_get_range(__pyx_v_get_range, __pyx_v_xmin, __pyx_v_xmax); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3075, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_5);
        if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
          PyObject* sequence = __pyx_t_5;
          Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
          if (unlikely(size != 2)) {
            if (size > 2) __Pyx_RaiseTooManyValuesError(2);
            else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
            __PYX_ERR(0, 3075, __pyx_L14_error)
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          if (likely(PyTuple_CheckExact(sequence))) {
            __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); 
            __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); 
          } else {
            __pyx_t_6 = PyList_GET_ITEM(sequence, 0); 
            __pyx_t_7 = PyList_GET_ITEM(sequence, 1); 
          }
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_7);
          #else
          __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3075, __pyx_L14_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3075, __pyx_L14_error)
          __Pyx_GOTREF(__pyx_t_7);
          #endif
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        } else {
          Py_ssize_t index = -1;
          __pyx_t_4 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3075, __pyx_L14_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_t_10 = Py_TYPE(__pyx_t_4)->tp_iternext;
          index = 0; __pyx_t_6 = __pyx_t_10(__pyx_t_4); if (unlikely(!__pyx_t_6)) goto __pyx_L26_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_6);
          index = 1; __pyx_t_7 = __pyx_t_10(__pyx_t_4); if (unlikely(!__pyx_t_7)) goto __pyx_L26_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_7);
          if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_4), 2) < 0) __PYX_ERR(0, 3075, __pyx_L14_error)
          __pyx_t_10 = NULL;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          goto __pyx_L27_unpacking_done;
          __pyx_L26_unpacking_failed:;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_t_10 = NULL;
          if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
          __PYX_ERR(0, 3075, __pyx_L14_error)
          __pyx_L27_unpacking_done:;
        }
        __Pyx_DECREF_SET(__pyx_v_xmin, __pyx_t_6);
        __pyx_t_6 = 0;
        __Pyx_DECREF_SET(__pyx_v_xmax, __pyx_t_7);
        __pyx_t_7 = 0;

        /* "mathics/builtin/graphics.py":3076
 *                     xmin, xmax = list(map(float, plot_range[0]))
 *                     xmin, xmax = get_range(xmin, xmax)
 *                     xmin = elements.translate((xmin, 0))[0]             # <<<<<<<<<<<<<<
 *                     xmax = elements.translate((xmax, 0))[0]
 *                     if exmin is not None and exmin < xmin:
 */
        if (unlikely(!__pyx_cur_scope->__pyx_v_elements)) { __Pyx_RaiseClosureNameError("elements"); __PYX_ERR(0, 3076, __pyx_L14_error) }
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_elements, __pyx_n_s_translate); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3076, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3076, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_INCREF(__pyx_v_xmin);
        __Pyx_GIVEREF(__pyx_v_xmin);
        PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_xmin);
        __Pyx_INCREF(__pyx_int_0);
        __Pyx_GIVEREF(__pyx_int_0);
        PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_int_0);
        __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_7, function);
          }
        }
        __pyx_t_5 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_4, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3076, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_5, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3076, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF_SET(__pyx_v_xmin, __pyx_t_7);
        __pyx_t_7 = 0;

        /* "mathics/builtin/graphics.py":3077
 *                     xmin, xmax = get_range(xmin, xmax)
 *                     xmin = elements.translate((xmin, 0))[0]
 *                     xmax = elements.translate((xmax, 0))[0]             # <<<<<<<<<<<<<<
 *                     if exmin is not None and exmin < xmin:
 *                         xmin = exmin
 */
        if (unlikely(!__pyx_cur_scope->__pyx_v_elements)) { __Pyx_RaiseClosureNameError("elements"); __PYX_ERR(0, 3077, __pyx_L14_error) }
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_elements, __pyx_n_s_translate); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3077, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3077, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_INCREF(__pyx_v_xmax);
        __Pyx_GIVEREF(__pyx_v_xmax);
        PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_xmax);
        __Pyx_INCREF(__pyx_int_0);
        __Pyx_GIVEREF(__pyx_int_0);
        PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_int_0);
        __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_5, function);
          }
        }
        __pyx_t_7 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3077, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_7, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3077, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF_SET(__pyx_v_xmax, __pyx_t_5);
        __pyx_t_5 = 0;

        /* "mathics/builtin/graphics.py":3078
 *                     xmin = elements.translate((xmin, 0))[0]
 *                     xmax = elements.translate((xmax, 0))[0]
 *                     if exmin is not None and exmin < xmin:             # <<<<<<<<<<<<<<
 *                         xmin = exmin
 *                     if exmax is not None and exmax > xmax:
 */
        __pyx_t_3 = (__pyx_v_exmin != Py_None);
        __pyx_t_2 = (__pyx_t_3 != 0);
        if (__pyx_t_2) {
        } else {
          __pyx_t_1 = __pyx_t_2;
          goto __pyx_L29_bool_binop_done;
        }
        __pyx_t_5 = PyObject_RichCompare(__pyx_v_exmin, __pyx_v_xmin, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3078, __pyx_L14_error)
        __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 3078, __pyx_L14_error)
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_1 = __pyx_t_2;
        __pyx_L29_bool_binop_done:;
        if (__pyx_t_1) {

          /* "mathics/builtin/graphics.py":3079
 *                     xmax = elements.translate((xmax, 0))[0]
 *                     if exmin is not None and exmin < xmin:
 *                         xmin = exmin             # <<<<<<<<<<<<<<
 *                     if exmax is not None and exmax > xmax:
 *                         xmax = exmax
 */
          __Pyx_INCREF(__pyx_v_exmin);
          __Pyx_DECREF_SET(__pyx_v_xmin, __pyx_v_exmin);

          /* "mathics/builtin/graphics.py":3078
 *                     xmin = elements.translate((xmin, 0))[0]
 *                     xmax = elements.translate((xmax, 0))[0]
 *                     if exmin is not None and exmin < xmin:             # <<<<<<<<<<<<<<
 *                         xmin = exmin
 *                     if exmax is not None and exmax > xmax:
 */
        }

        /* "mathics/builtin/graphics.py":3080
 *                     if exmin is not None and exmin < xmin:
 *                         xmin = exmin
 *                     if exmax is not None and exmax > xmax:             # <<<<<<<<<<<<<<
 *                         xmax = exmax
 *                 else:
 */
        __pyx_t_2 = (__pyx_v_exmax != Py_None);
        __pyx_t_3 = (__pyx_t_2 != 0);
        if (__pyx_t_3) {
        } else {
          __pyx_t_1 = __pyx_t_3;
          goto __pyx_L32_bool_binop_done;
        }
        __pyx_t_5 = PyObject_RichCompare(__pyx_v_exmax, __pyx_v_xmax, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3080, __pyx_L14_error)
        __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 3080, __pyx_L14_error)
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_1 = __pyx_t_3;
        __pyx_L32_bool_binop_done:;
        if (__pyx_t_1) {

          /* "mathics/builtin/graphics.py":3081
 *                         xmin = exmin
 *                     if exmax is not None and exmax > xmax:
 *                         xmax = exmax             # <<<<<<<<<<<<<<
 *                 else:
 *                     raise BoxConstructError
 */
          __Pyx_INCREF(__pyx_v_exmax);
          __Pyx_DECREF_SET(__pyx_v_xmax, __pyx_v_exmax);

          /* "mathics/builtin/graphics.py":3080
 *                     if exmin is not None and exmin < xmin:
 *                         xmin = exmin
 *                     if exmax is not None and exmax > xmax:             # <<<<<<<<<<<<<<
 *                         xmax = exmax
 *                 else:
 */
        }

        /* "mathics/builtin/graphics.py":3073
 *                         xmin -= 1
 *                         xmax += 1
 *                 elif isinstance(plot_range[0], list) and len(plot_range[0]) == 2:             # <<<<<<<<<<<<<<
 *                     xmin, xmax = list(map(float, plot_range[0]))
 *                     xmin, xmax = get_range(xmin, xmax)
 */
        goto __pyx_L20;
      }

      /* "mathics/builtin/graphics.py":3083
 *                         xmax = exmax
 *                 else:
 *                     raise BoxConstructError             # <<<<<<<<<<<<<<
 * 
 *                 if plot_range[1] == "System`Automatic":
 */
      /*else*/ {
        __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_BoxConstructError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3083, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_Raise(__pyx_t_5, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __PYX_ERR(0, 3083, __pyx_L14_error)
      }
      __pyx_L20:;

      /* "mathics/builtin/graphics.py":3085
 *                     raise BoxConstructError
 * 
 *                 if plot_range[1] == "System`Automatic":             # <<<<<<<<<<<<<<
 *                     if ymin is None and ymax is None:
 *                         ymin = 0
 */
      if (unlikely(!__pyx_cur_scope->__pyx_v_plot_range)) { __Pyx_RaiseClosureNameError("plot_range"); __PYX_ERR(0, 3085, __pyx_L14_error) }
      __pyx_t_5 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_plot_range, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3085, __pyx_L14_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_t_5, __pyx_kp_u_System_Automatic, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 3085, __pyx_L14_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_1) {

        /* "mathics/builtin/graphics.py":3086
 * 
 *                 if plot_range[1] == "System`Automatic":
 *                     if ymin is None and ymax is None:             # <<<<<<<<<<<<<<
 *                         ymin = 0
 *                         ymax = 1
 */
        __pyx_t_3 = (__pyx_v_ymin == Py_None);
        __pyx_t_2 = (__pyx_t_3 != 0);
        if (__pyx_t_2) {
        } else {
          __pyx_t_1 = __pyx_t_2;
          goto __pyx_L36_bool_binop_done;
        }
        __pyx_t_2 = (__pyx_v_ymax == Py_None);
        __pyx_t_3 = (__pyx_t_2 != 0);
        __pyx_t_1 = __pyx_t_3;
        __pyx_L36_bool_binop_done:;
        if (__pyx_t_1) {

          /* "mathics/builtin/graphics.py":3087
 *                 if plot_range[1] == "System`Automatic":
 *                     if ymin is None and ymax is None:
 *                         ymin = 0             # <<<<<<<<<<<<<<
 *                         ymax = 1
 *                     elif ymin == ymax:
 */
          __Pyx_INCREF(__pyx_int_0);
          __Pyx_DECREF_SET(__pyx_v_ymin, __pyx_int_0);

          /* "mathics/builtin/graphics.py":3088
 *                     if ymin is None and ymax is None:
 *                         ymin = 0
 *                         ymax = 1             # <<<<<<<<<<<<<<
 *                     elif ymin == ymax:
 *                         ymin -= 1
 */
          __Pyx_INCREF(__pyx_int_1);
          __Pyx_DECREF_SET(__pyx_v_ymax, __pyx_int_1);

          /* "mathics/builtin/graphics.py":3086
 * 
 *                 if plot_range[1] == "System`Automatic":
 *                     if ymin is None and ymax is None:             # <<<<<<<<<<<<<<
 *                         ymin = 0
 *                         ymax = 1
 */
          goto __pyx_L35;
        }

        /* "mathics/builtin/graphics.py":3089
 *                         ymin = 0
 *                         ymax = 1
 *                     elif ymin == ymax:             # <<<<<<<<<<<<<<
 *                         ymin -= 1
 *                         ymax += 1
 */
        __pyx_t_5 = PyObject_RichCompare(__pyx_v_ymin, __pyx_v_ymax, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3089, __pyx_L14_error)
        __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 3089, __pyx_L14_error)
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (__pyx_t_1) {

          /* "mathics/builtin/graphics.py":3090
 *                         ymax = 1
 *                     elif ymin == ymax:
 *                         ymin -= 1             # <<<<<<<<<<<<<<
 *                         ymax += 1
 *                 elif isinstance(plot_range[1], list) and len(plot_range[1]) == 2:
 */
          __pyx_t_5 = __Pyx_PyInt_SubtractObjC(__pyx_v_ymin, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3090, __pyx_L14_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF_SET(__pyx_v_ymin, __pyx_t_5);
          __pyx_t_5 = 0;

          /* "mathics/builtin/graphics.py":3091
 *                     elif ymin == ymax:
 *                         ymin -= 1
 *                         ymax += 1             # <<<<<<<<<<<<<<
 *                 elif isinstance(plot_range[1], list) and len(plot_range[1]) == 2:
 *                     ymin, ymax = list(map(float, plot_range[1]))
 */
          __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_v_ymax, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3091, __pyx_L14_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF_SET(__pyx_v_ymax, __pyx_t_5);
          __pyx_t_5 = 0;

          /* "mathics/builtin/graphics.py":3089
 *                         ymin = 0
 *                         ymax = 1
 *                     elif ymin == ymax:             # <<<<<<<<<<<<<<
 *                         ymin -= 1
 *                         ymax += 1
 */
        }
        __pyx_L35:;

        /* "mathics/builtin/graphics.py":3085
 *                     raise BoxConstructError
 * 
 *                 if plot_range[1] == "System`Automatic":             # <<<<<<<<<<<<<<
 *                     if ymin is None and ymax is None:
 *                         ymin = 0
 */
        goto __pyx_L34;
      }

      /* "mathics/builtin/graphics.py":3092
 *                         ymin -= 1
 *                         ymax += 1
 *                 elif isinstance(plot_range[1], list) and len(plot_range[1]) == 2:             # <<<<<<<<<<<<<<
 *                     ymin, ymax = list(map(float, plot_range[1]))
 *                     ymin, ymax = get_range(ymin, ymax)
 */
      if (unlikely(!__pyx_cur_scope->__pyx_v_plot_range)) { __Pyx_RaiseClosureNameError("plot_range"); __PYX_ERR(0, 3092, __pyx_L14_error) }
      __pyx_t_5 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_plot_range, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3092, __pyx_L14_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = PyList_Check(__pyx_t_5); 
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_2 = (__pyx_t_3 != 0);
      if (__pyx_t_2) {
      } else {
        __pyx_t_1 = __pyx_t_2;
        goto __pyx_L38_bool_binop_done;
      }
      if (unlikely(!__pyx_cur_scope->__pyx_v_plot_range)) { __Pyx_RaiseClosureNameError("plot_range"); __PYX_ERR(0, 3092, __pyx_L14_error) }
      __pyx_t_5 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_plot_range, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3092, __pyx_L14_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_14 = PyObject_Length(__pyx_t_5); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1))) __PYX_ERR(0, 3092, __pyx_L14_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_2 = ((__pyx_t_14 == 2) != 0);
      __pyx_t_1 = __pyx_t_2;
      __pyx_L38_bool_binop_done:;
      if (likely(__pyx_t_1)) {

        /* "mathics/builtin/graphics.py":3093
 *                         ymax += 1
 *                 elif isinstance(plot_range[1], list) and len(plot_range[1]) == 2:
 *                     ymin, ymax = list(map(float, plot_range[1]))             # <<<<<<<<<<<<<<
 *                     ymin, ymax = get_range(ymin, ymax)
 *                     ymin = elements.translate((0, ymin))[1]
 */
        if (unlikely(!__pyx_cur_scope->__pyx_v_plot_range)) { __Pyx_RaiseClosureNameError("plot_range"); __PYX_ERR(0, 3093, __pyx_L14_error) }
        __pyx_t_5 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_plot_range, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3093, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3093, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_INCREF(((PyObject *)(&PyFloat_Type)));
        __Pyx_GIVEREF(((PyObject *)(&PyFloat_Type)));
        PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)(&PyFloat_Type)));
        __Pyx_GIVEREF(__pyx_t_5);
        PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_5);
        __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3093, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = PySequence_List(__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3093, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (1) {
          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(0, 3093, __pyx_L14_error)
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_6 = PyList_GET_ITEM(sequence, 1); 
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          #else
          __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3093, __pyx_L14_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3093, __pyx_L14_error)
          __Pyx_GOTREF(__pyx_t_6);
          #endif
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        }
        __Pyx_DECREF_SET(__pyx_v_ymin, __pyx_t_5);
        __pyx_t_5 = 0;
        __Pyx_DECREF_SET(__pyx_v_ymax, __pyx_t_6);
        __pyx_t_6 = 0;

        /* "mathics/builtin/graphics.py":3094
 *                 elif isinstance(plot_range[1], list) and len(plot_range[1]) == 2:
 *                     ymin, ymax = list(map(float, plot_range[1]))
 *                     ymin, ymax = get_range(ymin, ymax)             # <<<<<<<<<<<<<<
 *                     ymin = elements.translate((0, ymin))[1]
 *                     ymax = elements.translate((0, ymax))[1]
 */
        __pyx_t_7 = __pyx_pf_7mathics_7builtin_8graphics_11GraphicsBox_17_prepare_elements_15calc_dimensions_get_range(__pyx_v_get_range, __pyx_v_ymin, __pyx_v_ymax); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3094, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_7);
        if ((likely(PyTuple_CheckExact(__pyx_t_7))) || (PyList_CheckExact(__pyx_t_7))) {
          PyObject* sequence = __pyx_t_7;
          Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
          if (unlikely(size != 2)) {
            if (size > 2) __Pyx_RaiseTooManyValuesError(2);
            else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
            __PYX_ERR(0, 3094, __pyx_L14_error)
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          if (likely(PyTuple_CheckExact(sequence))) {
            __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); 
            __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
          } else {
            __pyx_t_6 = PyList_GET_ITEM(sequence, 0); 
            __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
          }
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          #else
          __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3094, __pyx_L14_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3094, __pyx_L14_error)
          __Pyx_GOTREF(__pyx_t_5);
          #endif
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        } else {
          Py_ssize_t index = -1;
          __pyx_t_4 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3094, __pyx_L14_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __pyx_t_10 = Py_TYPE(__pyx_t_4)->tp_iternext;
          index = 0; __pyx_t_6 = __pyx_t_10(__pyx_t_4); if (unlikely(!__pyx_t_6)) goto __pyx_L40_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_6);
          index = 1; __pyx_t_5 = __pyx_t_10(__pyx_t_4); if (unlikely(!__pyx_t_5)) goto __pyx_L40_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_5);
          if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_4), 2) < 0) __PYX_ERR(0, 3094, __pyx_L14_error)
          __pyx_t_10 = NULL;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          goto __pyx_L41_unpacking_done;
          __pyx_L40_unpacking_failed:;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_t_10 = NULL;
          if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
          __PYX_ERR(0, 3094, __pyx_L14_error)
          __pyx_L41_unpacking_done:;
        }
        __Pyx_DECREF_SET(__pyx_v_ymin, __pyx_t_6);
        __pyx_t_6 = 0;
        __Pyx_DECREF_SET(__pyx_v_ymax, __pyx_t_5);
        __pyx_t_5 = 0;

        /* "mathics/builtin/graphics.py":3095
 *                     ymin, ymax = list(map(float, plot_range[1]))
 *                     ymin, ymax = get_range(ymin, ymax)
 *                     ymin = elements.translate((0, ymin))[1]             # <<<<<<<<<<<<<<
 *                     ymax = elements.translate((0, ymax))[1]
 *                     if ymin > ymax:
 */
        if (unlikely(!__pyx_cur_scope->__pyx_v_elements)) { __Pyx_RaiseClosureNameError("elements"); __PYX_ERR(0, 3095, __pyx_L14_error) }
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_elements, __pyx_n_s_translate); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3095, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3095, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_INCREF(__pyx_int_0);
        __Pyx_GIVEREF(__pyx_int_0);
        PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_int_0);
        __Pyx_INCREF(__pyx_v_ymin);
        __Pyx_GIVEREF(__pyx_v_ymin);
        PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_ymin);
        __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_5, function);
          }
        }
        __pyx_t_7 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3095, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_7, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3095, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF_SET(__pyx_v_ymin, __pyx_t_5);
        __pyx_t_5 = 0;

        /* "mathics/builtin/graphics.py":3096
 *                     ymin, ymax = get_range(ymin, ymax)
 *                     ymin = elements.translate((0, ymin))[1]
 *                     ymax = elements.translate((0, ymax))[1]             # <<<<<<<<<<<<<<
 *                     if ymin > ymax:
 *                         ymin, ymax = ymax, ymin
 */
        if (unlikely(!__pyx_cur_scope->__pyx_v_elements)) { __Pyx_RaiseClosureNameError("elements"); __PYX_ERR(0, 3096, __pyx_L14_error) }
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_elements, __pyx_n_s_translate); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3096, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3096, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_INCREF(__pyx_int_0);
        __Pyx_GIVEREF(__pyx_int_0);
        PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_int_0);
        __Pyx_INCREF(__pyx_v_ymax);
        __Pyx_GIVEREF(__pyx_v_ymax);
        PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_ymax);
        __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_7, function);
          }
        }
        __pyx_t_5 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_4, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3096, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_5, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3096, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF_SET(__pyx_v_ymax, __pyx_t_7);
        __pyx_t_7 = 0;

        /* "mathics/builtin/graphics.py":3097
 *                     ymin = elements.translate((0, ymin))[1]
 *                     ymax = elements.translate((0, ymax))[1]
 *                     if ymin > ymax:             # <<<<<<<<<<<<<<
 *                         ymin, ymax = ymax, ymin
 *                     if eymin is not None and eymin < ymin:
 */
        __pyx_t_7 = PyObject_RichCompare(__pyx_v_ymin, __pyx_v_ymax, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3097, __pyx_L14_error)
        __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 3097, __pyx_L14_error)
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (__pyx_t_1) {

          /* "mathics/builtin/graphics.py":3098
 *                     ymax = elements.translate((0, ymax))[1]
 *                     if ymin > ymax:
 *                         ymin, ymax = ymax, ymin             # <<<<<<<<<<<<<<
 *                     if eymin is not None and eymin < ymin:
 *                         ymin = eymin
 */
          __pyx_t_15 = __pyx_v_ymax;
          __pyx_t_16 = __pyx_v_ymin;
          __pyx_v_ymin = __pyx_t_15;
          __pyx_t_15 = 0;
          __pyx_v_ymax = __pyx_t_16;
          __pyx_t_16 = 0;

          /* "mathics/builtin/graphics.py":3097
 *                     ymin = elements.translate((0, ymin))[1]
 *                     ymax = elements.translate((0, ymax))[1]
 *                     if ymin > ymax:             # <<<<<<<<<<<<<<
 *                         ymin, ymax = ymax, ymin
 *                     if eymin is not None and eymin < ymin:
 */
        }

        /* "mathics/builtin/graphics.py":3099
 *                     if ymin > ymax:
 *                         ymin, ymax = ymax, ymin
 *                     if eymin is not None and eymin < ymin:             # <<<<<<<<<<<<<<
 *                         ymin = eymin
 *                     if eymax is not None and eymax > ymax:
 */
        __pyx_t_2 = (__pyx_v_eymin != Py_None);
        __pyx_t_3 = (__pyx_t_2 != 0);
        if (__pyx_t_3) {
        } else {
          __pyx_t_1 = __pyx_t_3;
          goto __pyx_L44_bool_binop_done;
        }
        __pyx_t_7 = PyObject_RichCompare(__pyx_v_eymin, __pyx_v_ymin, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3099, __pyx_L14_error)
        __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 3099, __pyx_L14_error)
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_1 = __pyx_t_3;
        __pyx_L44_bool_binop_done:;
        if (__pyx_t_1) {

          /* "mathics/builtin/graphics.py":3100
 *                         ymin, ymax = ymax, ymin
 *                     if eymin is not None and eymin < ymin:
 *                         ymin = eymin             # <<<<<<<<<<<<<<
 *                     if eymax is not None and eymax > ymax:
 *                         ymax = eymax
 */
          __Pyx_INCREF(__pyx_v_eymin);
          __Pyx_DECREF_SET(__pyx_v_ymin, __pyx_v_eymin);

          /* "mathics/builtin/graphics.py":3099
 *                     if ymin > ymax:
 *                         ymin, ymax = ymax, ymin
 *                     if eymin is not None and eymin < ymin:             # <<<<<<<<<<<<<<
 *                         ymin = eymin
 *                     if eymax is not None and eymax > ymax:
 */
        }

        /* "mathics/builtin/graphics.py":3101
 *                     if eymin is not None and eymin < ymin:
 *                         ymin = eymin
 *                     if eymax is not None and eymax > ymax:             # <<<<<<<<<<<<<<
 *                         ymax = eymax
 *                 else:
 */
        __pyx_t_3 = (__pyx_v_eymax != Py_None);
        __pyx_t_2 = (__pyx_t_3 != 0);
        if (__pyx_t_2) {
        } else {
          __pyx_t_1 = __pyx_t_2;
          goto __pyx_L47_bool_binop_done;
        }
        __pyx_t_7 = PyObject_RichCompare(__pyx_v_eymax, __pyx_v_ymax, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3101, __pyx_L14_error)
        __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 3101, __pyx_L14_error)
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_1 = __pyx_t_2;
        __pyx_L47_bool_binop_done:;
        if (__pyx_t_1) {

          /* "mathics/builtin/graphics.py":3102
 *                         ymin = eymin
 *                     if eymax is not None and eymax > ymax:
 *                         ymax = eymax             # <<<<<<<<<<<<<<
 *                 else:
 *                     raise BoxConstructError
 */
          __Pyx_INCREF(__pyx_v_eymax);
          __Pyx_DECREF_SET(__pyx_v_ymax, __pyx_v_eymax);

          /* "mathics/builtin/graphics.py":3101
 *                     if eymin is not None and eymin < ymin:
 *                         ymin = eymin
 *                     if eymax is not None and eymax > ymax:             # <<<<<<<<<<<<<<
 *                         ymax = eymax
 *                 else:
 */
        }

        /* "mathics/builtin/graphics.py":3092
 *                         ymin -= 1
 *                         ymax += 1
 *                 elif isinstance(plot_range[1], list) and len(plot_range[1]) == 2:             # <<<<<<<<<<<<<<
 *                     ymin, ymax = list(map(float, plot_range[1]))
 *                     ymin, ymax = get_range(ymin, ymax)
 */
        goto __pyx_L34;
      }

      /* "mathics/builtin/graphics.py":3104
 *                         ymax = eymax
 *                 else:
 *                     raise BoxConstructError             # <<<<<<<<<<<<<<
 *             except (ValueError, TypeError):
 *                 raise BoxConstructError
 */
      /*else*/ {
        __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_BoxConstructError); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3104, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_Raise(__pyx_t_7, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __PYX_ERR(0, 3104, __pyx_L14_error)
      }
      __pyx_L34:;

      /* "mathics/builtin/graphics.py":3065
 *                 return min, max
 * 
 *             try:             # <<<<<<<<<<<<<<
 *                 if plot_range[0] == "System`Automatic":
 *                     if xmin is None and xmax is None:
 */
    }
    __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_L19_try_end;
    __pyx_L14_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;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "mathics/builtin/graphics.py":3105
 *                 else:
 *                     raise BoxConstructError
 *             except (ValueError, TypeError):             # <<<<<<<<<<<<<<
 *                 raise BoxConstructError
 * 
 */
    __pyx_t_17 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
    if (__pyx_t_17) {
      __Pyx_AddTraceback("mathics.builtin.graphics.GraphicsBox._prepare_elements.calc_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_5, &__pyx_t_6) < 0) __PYX_ERR(0, 3105, __pyx_L16_except_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);

      /* "mathics/builtin/graphics.py":3106
 *                     raise BoxConstructError
 *             except (ValueError, TypeError):
 *                 raise BoxConstructError             # <<<<<<<<<<<<<<
 * 
 *             w = 0 if (xmin is None or xmax is None) else xmax - xmin
 */
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_BoxConstructError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3106, __pyx_L16_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __PYX_ERR(0, 3106, __pyx_L16_except_error)
    }
    goto __pyx_L16_except_error;
    __pyx_L16_except_error:;

    /* "mathics/builtin/graphics.py":3065
 *                 return min, max
 * 
 *             try:             # <<<<<<<<<<<<<<
 *                 if plot_range[0] == "System`Automatic":
 *                     if xmin is None and xmax is None:
 */
    __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_L19_try_end:;
  }

  /* "mathics/builtin/graphics.py":3108
 *                 raise BoxConstructError
 * 
 *             w = 0 if (xmin is None or xmax is None) else xmax - xmin             # <<<<<<<<<<<<<<
 *             h = 0 if (ymin is None or ymax is None) else ymax - ymin
 * 
 */
  __pyx_t_2 = (__pyx_v_xmin == Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L51_bool_binop_done;
  }
  __pyx_t_3 = (__pyx_v_xmax == Py_None);
  __pyx_t_2 = (__pyx_t_3 != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L51_bool_binop_done:;
  if (__pyx_t_1) {
    __Pyx_INCREF(__pyx_int_0);
    __pyx_t_6 = __pyx_int_0;
  } else {
    __pyx_t_5 = PyNumber_Subtract(__pyx_v_xmax, __pyx_v_xmin); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3108, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __pyx_t_5;
    __pyx_t_5 = 0;
  }
  __pyx_v_w = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "mathics/builtin/graphics.py":3109
 * 
 *             w = 0 if (xmin is None or xmax is None) else xmax - xmin
 *             h = 0 if (ymin is None or ymax is None) else ymax - ymin             # <<<<<<<<<<<<<<
 * 
 *             if size_aspect is None:
 */
  __pyx_t_2 = (__pyx_v_ymin == Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L53_bool_binop_done;
  }
  __pyx_t_3 = (__pyx_v_ymax == Py_None);
  __pyx_t_2 = (__pyx_t_3 != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L53_bool_binop_done:;
  if (__pyx_t_1) {
    __Pyx_INCREF(__pyx_int_0);
    __pyx_t_6 = __pyx_int_0;
  } else {
    __pyx_t_5 = PyNumber_Subtract(__pyx_v_ymax, __pyx_v_ymin); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3109, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __pyx_t_5;
    __pyx_t_5 = 0;
  }
  __pyx_v_h = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "mathics/builtin/graphics.py":3111
 *             h = 0 if (ymin is None or ymax is None) else ymax - ymin
 * 
 *             if size_aspect is None:             # <<<<<<<<<<<<<<
 *                 aspect = h / w
 *             else:
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_size_aspect)) { __Pyx_RaiseClosureNameError("size_aspect"); __PYX_ERR(0, 3111, __pyx_L1_error) }
  __pyx_t_1 = (__pyx_cur_scope->__pyx_v_size_aspect == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "mathics/builtin/graphics.py":3112
 * 
 *             if size_aspect is None:
 *                 aspect = h / w             # <<<<<<<<<<<<<<
 *             else:
 *                 aspect = size_aspect
 */
    __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_v_h, __pyx_v_w); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3112, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_v_aspect = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "mathics/builtin/graphics.py":3111
 *             h = 0 if (ymin is None or ymax is None) else ymax - ymin
 * 
 *             if size_aspect is None:             # <<<<<<<<<<<<<<
 *                 aspect = h / w
 *             else:
 */
    goto __pyx_L55;
  }

  /* "mathics/builtin/graphics.py":3114
 *                 aspect = h / w
 *             else:
 *                 aspect = size_aspect             # <<<<<<<<<<<<<<
 * 
 *             height = base_height
 */
  /*else*/ {
    if (unlikely(!__pyx_cur_scope->__pyx_v_size_aspect)) { __Pyx_RaiseClosureNameError("size_aspect"); __PYX_ERR(0, 3114, __pyx_L1_error) }
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_size_aspect);
    __pyx_v_aspect = __pyx_cur_scope->__pyx_v_size_aspect;
  }
  __pyx_L55:;

  /* "mathics/builtin/graphics.py":3116
 *                 aspect = size_aspect
 * 
 *             height = base_height             # <<<<<<<<<<<<<<
 *             if height is None:
 *                 height = base_width * aspect
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_base_height)) { __Pyx_RaiseClosureNameError("base_height"); __PYX_ERR(0, 3116, __pyx_L1_error) }
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_base_height);
  __pyx_v_height = __pyx_cur_scope->__pyx_v_base_height;

  /* "mathics/builtin/graphics.py":3117
 * 
 *             height = base_height
 *             if height is None:             # <<<<<<<<<<<<<<
 *                 height = base_width * aspect
 *             width = height / aspect
 */
  __pyx_t_2 = (__pyx_v_height == Py_None);
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "mathics/builtin/graphics.py":3118
 *             height = base_height
 *             if height is None:
 *                 height = base_width * aspect             # <<<<<<<<<<<<<<
 *             width = height / aspect
 *             if width > base_width:
 */
    if (unlikely(!__pyx_cur_scope->__pyx_v_base_width)) { __Pyx_RaiseClosureNameError("base_width"); __PYX_ERR(0, 3118, __pyx_L1_error) }
    __pyx_t_6 = PyNumber_Multiply(__pyx_cur_scope->__pyx_v_base_width, __pyx_v_aspect); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3118, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF_SET(__pyx_v_height, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "mathics/builtin/graphics.py":3117
 * 
 *             height = base_height
 *             if height is None:             # <<<<<<<<<<<<<<
 *                 height = base_width * aspect
 *             width = height / aspect
 */
  }

  /* "mathics/builtin/graphics.py":3119
 *             if height is None:
 *                 height = base_width * aspect
 *             width = height / aspect             # <<<<<<<<<<<<<<
 *             if width > base_width:
 *                 width = base_width
 */
  __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_v_height, __pyx_v_aspect); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3119, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_v_width = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "mathics/builtin/graphics.py":3120
 *                 height = base_width * aspect
 *             width = height / aspect
 *             if width > base_width:             # <<<<<<<<<<<<<<
 *                 width = base_width
 *                 height = width * aspect
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_base_width)) { __Pyx_RaiseClosureNameError("base_width"); __PYX_ERR(0, 3120, __pyx_L1_error) }
  __pyx_t_6 = PyObject_RichCompare(__pyx_v_width, __pyx_cur_scope->__pyx_v_base_width, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3120, __pyx_L1_error)
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 3120, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__pyx_t_1) {

    /* "mathics/builtin/graphics.py":3121
 *             width = height / aspect
 *             if width > base_width:
 *                 width = base_width             # <<<<<<<<<<<<<<
 *                 height = width * aspect
 *             height = height
 */
    if (unlikely(!__pyx_cur_scope->__pyx_v_base_width)) { __Pyx_RaiseClosureNameError("base_width"); __PYX_ERR(0, 3121, __pyx_L1_error) }
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_base_width);
    __Pyx_DECREF_SET(__pyx_v_width, __pyx_cur_scope->__pyx_v_base_width);

    /* "mathics/builtin/graphics.py":3122
 *             if width > base_width:
 *                 width = base_width
 *                 height = width * aspect             # <<<<<<<<<<<<<<
 *             height = height
 * 
 */
    __pyx_t_6 = PyNumber_Multiply(__pyx_v_width, __pyx_v_aspect); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3122, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF_SET(__pyx_v_height, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "mathics/builtin/graphics.py":3120
 *                 height = base_width * aspect
 *             width = height / aspect
 *             if width > base_width:             # <<<<<<<<<<<<<<
 *                 width = base_width
 *                 height = width * aspect
 */
  }

  /* "mathics/builtin/graphics.py":3123
 *                 width = base_width
 *                 height = width * aspect
 *             height = height             # <<<<<<<<<<<<<<
 * 
 *             width *= size_multiplier
 */
  __Pyx_INCREF(__pyx_v_height);
  __Pyx_DECREF_SET(__pyx_v_height, __pyx_v_height);

  /* "mathics/builtin/graphics.py":3125
 *             height = height
 * 
 *             width *= size_multiplier             # <<<<<<<<<<<<<<
 *             height *= size_multiplier
 * 
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_size_multiplier)) { __Pyx_RaiseClosureNameError("size_multiplier"); __PYX_ERR(0, 3125, __pyx_L1_error) }
  __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_width, __pyx_cur_scope->__pyx_v_size_multiplier); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3125, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF_SET(__pyx_v_width, __pyx_t_6);
  __pyx_t_6 = 0;

  /* "mathics/builtin/graphics.py":3126
 * 
 *             width *= size_multiplier
 *             height *= size_multiplier             # <<<<<<<<<<<<<<
 * 
 *             return xmin, xmax, ymin, ymax, w, h, width, height
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_size_multiplier)) { __Pyx_RaiseClosureNameError("size_multiplier"); __PYX_ERR(0, 3126, __pyx_L1_error) }
  __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_height, __pyx_cur_scope->__pyx_v_size_multiplier); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3126, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF_SET(__pyx_v_height, __pyx_t_6);
  __pyx_t_6 = 0;

  /* "mathics/builtin/graphics.py":3128
 *             height *= size_multiplier
 * 
 *             return xmin, xmax, ymin, ymax, w, h, width, height             # <<<<<<<<<<<<<<
 * 
 *         xmin, xmax, ymin, ymax, w, h, width, height = calc_dimensions(final_pass=False)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_6 = PyTuple_New(8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3128, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_INCREF(__pyx_v_xmin);
  __Pyx_GIVEREF(__pyx_v_xmin);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_xmin);
  __Pyx_INCREF(__pyx_v_xmax);
  __Pyx_GIVEREF(__pyx_v_xmax);
  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_xmax);
  __Pyx_INCREF(__pyx_v_ymin);
  __Pyx_GIVEREF(__pyx_v_ymin);
  PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_ymin);
  __Pyx_INCREF(__pyx_v_ymax);
  __Pyx_GIVEREF(__pyx_v_ymax);
  PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_v_ymax);
  __Pyx_INCREF(__pyx_v_w);
  __Pyx_GIVEREF(__pyx_v_w);
  PyTuple_SET_ITEM(__pyx_t_6, 4, __pyx_v_w);
  __Pyx_INCREF(__pyx_v_h);
  __Pyx_GIVEREF(__pyx_v_h);
  PyTuple_SET_ITEM(__pyx_t_6, 5, __pyx_v_h);
  __Pyx_INCREF(__pyx_v_width);
  __Pyx_GIVEREF(__pyx_v_width);
  PyTuple_SET_ITEM(__pyx_t_6, 6, __pyx_v_width);
  __Pyx_INCREF(__pyx_v_height);
  __Pyx_GIVEREF(__pyx_v_height);
  PyTuple_SET_ITEM(__pyx_t_6, 7, __pyx_v_height);
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 0;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":3021
 *         axes = []  # to be filled further down
 * 
 *         def calc_dimensions(final_pass=True):             # <<<<<<<<<<<<<<
 *             """
 *             calc_dimensions gets called twice: In the first run
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("mathics.builtin.graphics.GraphicsBox._prepare_elements.calc_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_xmin);
  __Pyx_XDECREF(__pyx_v_xmax);
  __Pyx_XDECREF(__pyx_v_ymin);
  __Pyx_XDECREF(__pyx_v_ymax);
  __Pyx_XDECREF(__pyx_v_exmin);
  __Pyx_XDECREF(__pyx_v_exmax);
  __Pyx_XDECREF(__pyx_v_eymin);
  __Pyx_XDECREF(__pyx_v_eymax);
  __Pyx_XDECREF(__pyx_v_get_range);
  __Pyx_XDECREF(__pyx_v_w);
  __Pyx_XDECREF(__pyx_v_h);
  __Pyx_XDECREF(__pyx_v_aspect);
  __Pyx_XDECREF(__pyx_v_height);
  __Pyx_XDECREF(__pyx_v_width);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":2992
 *         return base_width, base_height, multi, aspect
 * 
 *     def _prepare_elements(self, leaves, options, neg_y=False, max_width=None):             # <<<<<<<<<<<<<<
 *         if not leaves:
 *             raise BoxConstructError
 */

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_11GraphicsBox_4_prepare_elements(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_leaves, PyObject *__pyx_v_options, PyObject *__pyx_v_neg_y, PyObject *__pyx_v_max_width) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_78__prepare_elements *__pyx_cur_scope;
  PyObject *__pyx_v_graphics_options = NULL;
  PyObject *__pyx_v_background = NULL;
  PyObject *__pyx_v_calc_dimensions = 0;
  PyObject *__pyx_v_xmin = NULL;
  PyObject *__pyx_v_xmax = NULL;
  PyObject *__pyx_v_ymin = NULL;
  PyObject *__pyx_v_ymax = NULL;
  PyObject *__pyx_v_w = NULL;
  PyObject *__pyx_v_h = NULL;
  PyObject *__pyx_v_width = NULL;
  PyObject *__pyx_v_height = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *(*__pyx_t_11)(PyObject *);
  Py_ssize_t __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  int __pyx_t_17;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_prepare_elements", 0);
  __pyx_cur_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_78__prepare_elements *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_78__prepare_elements(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_78__prepare_elements, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_78__prepare_elements *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 2992, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }

  /* "mathics/builtin/graphics.py":2993
 * 
 *     def _prepare_elements(self, leaves, options, neg_y=False, max_width=None):
 *         if not leaves:             # <<<<<<<<<<<<<<
 *             raise BoxConstructError
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_leaves); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 2993, __pyx_L1_error)
  __pyx_t_2 = ((!__pyx_t_1) != 0);
  if (unlikely(__pyx_t_2)) {

    /* "mathics/builtin/graphics.py":2994
 *     def _prepare_elements(self, leaves, options, neg_y=False, max_width=None):
 *         if not leaves:
 *             raise BoxConstructError             # <<<<<<<<<<<<<<
 * 
 *         graphics_options = self.get_option_values(leaves[1:], **options)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_BoxConstructError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2994, __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(0, 2994, __pyx_L1_error)

    /* "mathics/builtin/graphics.py":2993
 * 
 *     def _prepare_elements(self, leaves, options, neg_y=False, max_width=None):
 *         if not leaves:             # <<<<<<<<<<<<<<
 *             raise BoxConstructError
 * 
 */
  }

  /* "mathics/builtin/graphics.py":2996
 *             raise BoxConstructError
 * 
 *         graphics_options = self.get_option_values(leaves[1:], **options)             # <<<<<<<<<<<<<<
 * 
 *         background = graphics_options["System`Background"]
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_get_option_values); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2996, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_v_leaves, 1, 0, NULL, NULL, &__pyx_slice__13, 1, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2996, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2996, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
  __pyx_t_4 = 0;
  if (unlikely(__pyx_v_options == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
    __PYX_ERR(0, 2996, __pyx_L1_error)
  }
  if (likely(PyDict_CheckExact(__pyx_v_options))) {
    __pyx_t_4 = PyDict_Copy(__pyx_v_options); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2996, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  } else {
    __pyx_t_4 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_options, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2996, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2996, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_graphics_options = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "mathics/builtin/graphics.py":2998
 *         graphics_options = self.get_option_values(leaves[1:], **options)
 * 
 *         background = graphics_options["System`Background"]             # <<<<<<<<<<<<<<
 *         if (
 *             isinstance(background, Symbol)
 */
  __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_graphics_options, __pyx_kp_u_System_Background); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2998, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_v_background = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "mathics/builtin/graphics.py":3000
 *         background = graphics_options["System`Background"]
 *         if (
 *             isinstance(background, Symbol)             # <<<<<<<<<<<<<<
 *             and background.get_name() == "System`Automatic"
 *         ):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_Symbol); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3000, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = PyObject_IsInstance(__pyx_v_background, __pyx_t_6); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 3000, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_7 = (__pyx_t_1 != 0);
  if (__pyx_t_7) {
  } else {
    __pyx_t_2 = __pyx_t_7;
    goto __pyx_L5_bool_binop_done;
  }

  /* "mathics/builtin/graphics.py":3001
 *         if (
 *             isinstance(background, Symbol)
 *             and background.get_name() == "System`Automatic"             # <<<<<<<<<<<<<<
 *         ):
 *             self.background_color = None
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_background, __pyx_n_s_get_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3001, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_6 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3001, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_t_6, __pyx_kp_u_System_Automatic, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 3001, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_2 = __pyx_t_7;
  __pyx_L5_bool_binop_done:;

  /* "mathics/builtin/graphics.py":2999
 * 
 *         background = graphics_options["System`Background"]
 *         if (             # <<<<<<<<<<<<<<
 *             isinstance(background, Symbol)
 *             and background.get_name() == "System`Automatic"
 */
  if (__pyx_t_2) {

    /* "mathics/builtin/graphics.py":3003
 *             and background.get_name() == "System`Automatic"
 *         ):
 *             self.background_color = None             # <<<<<<<<<<<<<<
 *         else:
 *             self.background_color = _Color.create(background)
 */
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_background_color, Py_None) < 0) __PYX_ERR(0, 3003, __pyx_L1_error)

    /* "mathics/builtin/graphics.py":2999
 * 
 *         background = graphics_options["System`Background"]
 *         if (             # <<<<<<<<<<<<<<
 *             isinstance(background, Symbol)
 *             and background.get_name() == "System`Automatic"
 */
    goto __pyx_L4;
  }

  /* "mathics/builtin/graphics.py":3005
 *             self.background_color = None
 *         else:
 *             self.background_color = _Color.create(background)             # <<<<<<<<<<<<<<
 * 
 *         base_width, base_height, size_multiplier, size_aspect = self._get_image_size(
 */
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Color); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3005, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_create); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3005, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_6 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_v_background) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_background);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3005, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_background_color, __pyx_t_6) < 0) __PYX_ERR(0, 3005, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __pyx_L4:;

  /* "mathics/builtin/graphics.py":3007
 *             self.background_color = _Color.create(background)
 * 
 *         base_width, base_height, size_multiplier, size_aspect = self._get_image_size(             # <<<<<<<<<<<<<<
 *             options, graphics_options, max_width
 *         )
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_get_image_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3007, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "mathics/builtin/graphics.py":3008
 * 
 *         base_width, base_height, size_multiplier, size_aspect = self._get_image_size(
 *             options, graphics_options, max_width             # <<<<<<<<<<<<<<
 *         )
 * 
 */
  __pyx_t_4 = NULL;
  __pyx_t_8 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
      __pyx_t_8 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_5)) {
    PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_options, __pyx_v_graphics_options, __pyx_v_max_width};
    __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3007, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_6);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
    PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_options, __pyx_v_graphics_options, __pyx_v_max_width};
    __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3007, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_6);
  } else
  #endif
  {
    __pyx_t_3 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3007, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (__pyx_t_4) {
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = NULL;
    }
    __Pyx_INCREF(__pyx_v_options);
    __Pyx_GIVEREF(__pyx_v_options);
    PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_8, __pyx_v_options);
    __Pyx_INCREF(__pyx_v_graphics_options);
    __Pyx_GIVEREF(__pyx_v_graphics_options);
    PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_8, __pyx_v_graphics_options);
    __Pyx_INCREF(__pyx_v_max_width);
    __Pyx_GIVEREF(__pyx_v_max_width);
    PyTuple_SET_ITEM(__pyx_t_3, 2+__pyx_t_8, __pyx_v_max_width);
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3007, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  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 != 4)) {
      if (size > 4) __Pyx_RaiseTooManyValuesError(4);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 3007, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); 
      __pyx_t_9 = PyTuple_GET_ITEM(sequence, 3); 
    } else {
      __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
      __pyx_t_4 = PyList_GET_ITEM(sequence, 2); 
      __pyx_t_9 = PyList_GET_ITEM(sequence, 3); 
    }
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_9);
    #else
    {
      Py_ssize_t i;
      PyObject** temps[4] = {&__pyx_t_5,&__pyx_t_3,&__pyx_t_4,&__pyx_t_9};
      for (i=0; i < 4; i++) {
        PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 3007, __pyx_L1_error)
        __Pyx_GOTREF(item);
        *(temps[i]) = item;
      }
    }
    #endif
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else {
    Py_ssize_t index = -1;
    PyObject** temps[4] = {&__pyx_t_5,&__pyx_t_3,&__pyx_t_4,&__pyx_t_9};
    __pyx_t_10 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3007, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_11 = Py_TYPE(__pyx_t_10)->tp_iternext;
    for (index=0; index < 4; index++) {
      PyObject* item = __pyx_t_11(__pyx_t_10); if (unlikely(!item)) goto __pyx_L7_unpacking_failed;
      __Pyx_GOTREF(item);
      *(temps[index]) = item;
    }
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 4) < 0) __PYX_ERR(0, 3007, __pyx_L1_error)
    __pyx_t_11 = NULL;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    goto __pyx_L8_unpacking_done;
    __pyx_L7_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_11 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 3007, __pyx_L1_error)
    __pyx_L8_unpacking_done:;
  }

  /* "mathics/builtin/graphics.py":3007
 *             self.background_color = _Color.create(background)
 * 
 *         base_width, base_height, size_multiplier, size_aspect = self._get_image_size(             # <<<<<<<<<<<<<<
 *             options, graphics_options, max_width
 *         )
 */
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_cur_scope->__pyx_v_base_width = __pyx_t_5;
  __pyx_t_5 = 0;
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_cur_scope->__pyx_v_base_height = __pyx_t_3;
  __pyx_t_3 = 0;
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_cur_scope->__pyx_v_size_multiplier = __pyx_t_4;
  __pyx_t_4 = 0;
  __Pyx_GIVEREF(__pyx_t_9);
  __pyx_cur_scope->__pyx_v_size_aspect = __pyx_t_9;
  __pyx_t_9 = 0;

  /* "mathics/builtin/graphics.py":3011
 *         )
 * 
 *         plot_range = graphics_options["System`PlotRange"].to_python()             # <<<<<<<<<<<<<<
 *         if plot_range == "System`Automatic":
 *             plot_range = ["System`Automatic", "System`Automatic"]
 */
  __pyx_t_9 = __Pyx_PyObject_Dict_GetItem(__pyx_v_graphics_options, __pyx_kp_u_System_PlotRange); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3011, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_to_python); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3011, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_9)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_6 = (__pyx_t_9) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_9) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3011, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_cur_scope->__pyx_v_plot_range = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "mathics/builtin/graphics.py":3012
 * 
 *         plot_range = graphics_options["System`PlotRange"].to_python()
 *         if plot_range == "System`Automatic":             # <<<<<<<<<<<<<<
 *             plot_range = ["System`Automatic", "System`Automatic"]
 * 
 */
  __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_cur_scope->__pyx_v_plot_range, __pyx_kp_u_System_Automatic, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 3012, __pyx_L1_error)
  if (__pyx_t_2) {

    /* "mathics/builtin/graphics.py":3013
 *         plot_range = graphics_options["System`PlotRange"].to_python()
 *         if plot_range == "System`Automatic":
 *             plot_range = ["System`Automatic", "System`Automatic"]             # <<<<<<<<<<<<<<
 * 
 *         if not isinstance(plot_range, list) or len(plot_range) != 2:
 */
    __pyx_t_6 = PyList_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3013, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_kp_u_System_Automatic);
    __Pyx_GIVEREF(__pyx_kp_u_System_Automatic);
    PyList_SET_ITEM(__pyx_t_6, 0, __pyx_kp_u_System_Automatic);
    __Pyx_INCREF(__pyx_kp_u_System_Automatic);
    __Pyx_GIVEREF(__pyx_kp_u_System_Automatic);
    PyList_SET_ITEM(__pyx_t_6, 1, __pyx_kp_u_System_Automatic);
    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_plot_range);
    __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_plot_range, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    __pyx_t_6 = 0;

    /* "mathics/builtin/graphics.py":3012
 * 
 *         plot_range = graphics_options["System`PlotRange"].to_python()
 *         if plot_range == "System`Automatic":             # <<<<<<<<<<<<<<
 *             plot_range = ["System`Automatic", "System`Automatic"]
 * 
 */
  }

  /* "mathics/builtin/graphics.py":3015
 *             plot_range = ["System`Automatic", "System`Automatic"]
 * 
 *         if not isinstance(plot_range, list) or len(plot_range) != 2:             # <<<<<<<<<<<<<<
 *             raise BoxConstructError
 * 
 */
  __pyx_t_6 = __pyx_cur_scope->__pyx_v_plot_range;
  __Pyx_INCREF(__pyx_t_6);
  __pyx_t_7 = PyList_Check(__pyx_t_6); 
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_1 = ((!(__pyx_t_7 != 0)) != 0);
  if (!__pyx_t_1) {
  } else {
    __pyx_t_2 = __pyx_t_1;
    goto __pyx_L11_bool_binop_done;
  }
  __pyx_t_6 = __pyx_cur_scope->__pyx_v_plot_range;
  __Pyx_INCREF(__pyx_t_6);
  __pyx_t_12 = PyObject_Length(__pyx_t_6); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(0, 3015, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_1 = ((__pyx_t_12 != 2) != 0);
  __pyx_t_2 = __pyx_t_1;
  __pyx_L11_bool_binop_done:;
  if (unlikely(__pyx_t_2)) {

    /* "mathics/builtin/graphics.py":3016
 * 
 *         if not isinstance(plot_range, list) or len(plot_range) != 2:
 *             raise BoxConstructError             # <<<<<<<<<<<<<<
 * 
 *         elements = GraphicsElements(leaves[0], options["evaluation"], neg_y)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_BoxConstructError); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3016, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_Raise(__pyx_t_6, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __PYX_ERR(0, 3016, __pyx_L1_error)

    /* "mathics/builtin/graphics.py":3015
 *             plot_range = ["System`Automatic", "System`Automatic"]
 * 
 *         if not isinstance(plot_range, list) or len(plot_range) != 2:             # <<<<<<<<<<<<<<
 *             raise BoxConstructError
 * 
 */
  }

  /* "mathics/builtin/graphics.py":3018
 *             raise BoxConstructError
 * 
 *         elements = GraphicsElements(leaves[0], options["evaluation"], neg_y)             # <<<<<<<<<<<<<<
 *         axes = []  # to be filled further down
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_GraphicsElements); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3018, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_leaves, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3018, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_v_options, __pyx_n_u_evaluation); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3018, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = NULL;
  __pyx_t_8 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_8 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_t_9, __pyx_t_3, __pyx_v_neg_y};
    __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3018, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_t_9, __pyx_t_3, __pyx_v_neg_y};
    __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3018, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  {
    __pyx_t_10 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3018, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    if (__pyx_t_5) {
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5); __pyx_t_5 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_9);
    PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_8, __pyx_t_9);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_8, __pyx_t_3);
    __Pyx_INCREF(__pyx_v_neg_y);
    __Pyx_GIVEREF(__pyx_v_neg_y);
    PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_8, __pyx_v_neg_y);
    __pyx_t_9 = 0;
    __pyx_t_3 = 0;
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_10, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3018, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_cur_scope->__pyx_v_elements = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "mathics/builtin/graphics.py":3019
 * 
 *         elements = GraphicsElements(leaves[0], options["evaluation"], neg_y)
 *         axes = []  # to be filled further down             # <<<<<<<<<<<<<<
 * 
 *         def calc_dimensions(final_pass=True):
 */
  __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3019, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_cur_scope->__pyx_v_axes = ((PyObject*)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "mathics/builtin/graphics.py":3021
 *         axes = []  # to be filled further down
 * 
 *         def calc_dimensions(final_pass=True):             # <<<<<<<<<<<<<<
 *             """
 *             calc_dimensions gets called twice: In the first run
 */
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_11GraphicsBox_17_prepare_elements_1calc_dimensions, 0, __pyx_n_s_GraphicsBox__prepare_elements_lo_3, ((PyObject*)__pyx_cur_scope), __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__138)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3021, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_tuple__139);
  __pyx_v_calc_dimensions = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "mathics/builtin/graphics.py":3130
 *             return xmin, xmax, ymin, ymax, w, h, width, height
 * 
 *         xmin, xmax, ymin, ymax, w, h, width, height = calc_dimensions(final_pass=False)             # <<<<<<<<<<<<<<
 * 
 *         elements.set_size(xmin, ymin, w, h, width, height)
 */
  __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3130, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_final_pass, Py_False) < 0) __PYX_ERR(0, 3130, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_v_calc_dimensions, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3130, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
    PyObject* sequence = __pyx_t_4;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 8)) {
      if (size > 8) __Pyx_RaiseTooManyValuesError(8);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 3130, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_10 = PyTuple_GET_ITEM(sequence, 1); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2); 
      __pyx_t_9 = PyTuple_GET_ITEM(sequence, 3); 
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 4); 
      __pyx_t_13 = PyTuple_GET_ITEM(sequence, 5); 
      __pyx_t_14 = PyTuple_GET_ITEM(sequence, 6); 
      __pyx_t_15 = PyTuple_GET_ITEM(sequence, 7); 
    } else {
      __pyx_t_6 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_10 = PyList_GET_ITEM(sequence, 1); 
      __pyx_t_3 = PyList_GET_ITEM(sequence, 2); 
      __pyx_t_9 = PyList_GET_ITEM(sequence, 3); 
      __pyx_t_5 = PyList_GET_ITEM(sequence, 4); 
      __pyx_t_13 = PyList_GET_ITEM(sequence, 5); 
      __pyx_t_14 = PyList_GET_ITEM(sequence, 6); 
      __pyx_t_15 = PyList_GET_ITEM(sequence, 7); 
    }
    __Pyx_INCREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_t_10);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_9);
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_13);
    __Pyx_INCREF(__pyx_t_14);
    __Pyx_INCREF(__pyx_t_15);
    #else
    {
      Py_ssize_t i;
      PyObject** temps[8] = {&__pyx_t_6,&__pyx_t_10,&__pyx_t_3,&__pyx_t_9,&__pyx_t_5,&__pyx_t_13,&__pyx_t_14,&__pyx_t_15};
      for (i=0; i < 8; i++) {
        PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 3130, __pyx_L1_error)
        __Pyx_GOTREF(item);
        *(temps[i]) = item;
      }
    }
    #endif
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else {
    Py_ssize_t index = -1;
    PyObject** temps[8] = {&__pyx_t_6,&__pyx_t_10,&__pyx_t_3,&__pyx_t_9,&__pyx_t_5,&__pyx_t_13,&__pyx_t_14,&__pyx_t_15};
    __pyx_t_16 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 3130, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_16);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_11 = Py_TYPE(__pyx_t_16)->tp_iternext;
    for (index=0; index < 8; index++) {
      PyObject* item = __pyx_t_11(__pyx_t_16); if (unlikely(!item)) goto __pyx_L13_unpacking_failed;
      __Pyx_GOTREF(item);
      *(temps[index]) = item;
    }
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_16), 8) < 0) __PYX_ERR(0, 3130, __pyx_L1_error)
    __pyx_t_11 = NULL;
    __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
    goto __pyx_L14_unpacking_done;
    __pyx_L13_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
    __pyx_t_11 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 3130, __pyx_L1_error)
    __pyx_L14_unpacking_done:;
  }
  __pyx_v_xmin = __pyx_t_6;
  __pyx_t_6 = 0;
  __pyx_v_xmax = __pyx_t_10;
  __pyx_t_10 = 0;
  __pyx_v_ymin = __pyx_t_3;
  __pyx_t_3 = 0;
  __pyx_v_ymax = __pyx_t_9;
  __pyx_t_9 = 0;
  __pyx_v_w = __pyx_t_5;
  __pyx_t_5 = 0;
  __pyx_v_h = __pyx_t_13;
  __pyx_t_13 = 0;
  __pyx_v_width = __pyx_t_14;
  __pyx_t_14 = 0;
  __pyx_v_height = __pyx_t_15;
  __pyx_t_15 = 0;

  /* "mathics/builtin/graphics.py":3132
 *         xmin, xmax, ymin, ymax, w, h, width, height = calc_dimensions(final_pass=False)
 * 
 *         elements.set_size(xmin, ymin, w, h, width, height)             # <<<<<<<<<<<<<<
 * 
 *         xmin -= w * 0.02
 */
  __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_elements, __pyx_n_s_set_size); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 3132, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __pyx_t_14 = NULL;
  __pyx_t_8 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_15))) {
    __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_15);
    if (likely(__pyx_t_14)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15);
      __Pyx_INCREF(__pyx_t_14);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_15, function);
      __pyx_t_8 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_15)) {
    PyObject *__pyx_temp[7] = {__pyx_t_14, __pyx_v_xmin, __pyx_v_ymin, __pyx_v_w, __pyx_v_h, __pyx_v_width, __pyx_v_height};
    __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_15, __pyx_temp+1-__pyx_t_8, 6+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3132, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
    __Pyx_GOTREF(__pyx_t_4);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_15)) {
    PyObject *__pyx_temp[7] = {__pyx_t_14, __pyx_v_xmin, __pyx_v_ymin, __pyx_v_w, __pyx_v_h, __pyx_v_width, __pyx_v_height};
    __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_15, __pyx_temp+1-__pyx_t_8, 6+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3132, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
    __Pyx_GOTREF(__pyx_t_4);
  } else
  #endif
  {
    __pyx_t_13 = PyTuple_New(6+__pyx_t_8); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3132, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    if (__pyx_t_14) {
      __Pyx_GIVEREF(__pyx_t_14); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_14); __pyx_t_14 = NULL;
    }
    __Pyx_INCREF(__pyx_v_xmin);
    __Pyx_GIVEREF(__pyx_v_xmin);
    PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_8, __pyx_v_xmin);
    __Pyx_INCREF(__pyx_v_ymin);
    __Pyx_GIVEREF(__pyx_v_ymin);
    PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_8, __pyx_v_ymin);
    __Pyx_INCREF(__pyx_v_w);
    __Pyx_GIVEREF(__pyx_v_w);
    PyTuple_SET_ITEM(__pyx_t_13, 2+__pyx_t_8, __pyx_v_w);
    __Pyx_INCREF(__pyx_v_h);
    __Pyx_GIVEREF(__pyx_v_h);
    PyTuple_SET_ITEM(__pyx_t_13, 3+__pyx_t_8, __pyx_v_h);
    __Pyx_INCREF(__pyx_v_width);
    __Pyx_GIVEREF(__pyx_v_width);
    PyTuple_SET_ITEM(__pyx_t_13, 4+__pyx_t_8, __pyx_v_width);
    __Pyx_INCREF(__pyx_v_height);
    __Pyx_GIVEREF(__pyx_v_height);
    PyTuple_SET_ITEM(__pyx_t_13, 5+__pyx_t_8, __pyx_v_height);
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_13, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3132, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  }
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":3134
 *         elements.set_size(xmin, ymin, w, h, width, height)
 * 
 *         xmin -= w * 0.02             # <<<<<<<<<<<<<<
 *         xmax += w * 0.02
 *         ymin -= h * 0.02
 */
  __pyx_t_4 = PyNumber_Multiply(__pyx_v_w, __pyx_float_0_02); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3134, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_15 = PyNumber_InPlaceSubtract(__pyx_v_xmin, __pyx_t_4); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 3134, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF_SET(__pyx_v_xmin, __pyx_t_15);
  __pyx_t_15 = 0;

  /* "mathics/builtin/graphics.py":3135
 * 
 *         xmin -= w * 0.02
 *         xmax += w * 0.02             # <<<<<<<<<<<<<<
 *         ymin -= h * 0.02
 *         ymax += h * 0.02
 */
  __pyx_t_15 = PyNumber_Multiply(__pyx_v_w, __pyx_float_0_02); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 3135, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_xmax, __pyx_t_15); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3135, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  __Pyx_DECREF_SET(__pyx_v_xmax, __pyx_t_4);
  __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":3136
 *         xmin -= w * 0.02
 *         xmax += w * 0.02
 *         ymin -= h * 0.02             # <<<<<<<<<<<<<<
 *         ymax += h * 0.02
 * 
 */
  __pyx_t_4 = PyNumber_Multiply(__pyx_v_h, __pyx_float_0_02); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3136, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_15 = PyNumber_InPlaceSubtract(__pyx_v_ymin, __pyx_t_4); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 3136, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF_SET(__pyx_v_ymin, __pyx_t_15);
  __pyx_t_15 = 0;

  /* "mathics/builtin/graphics.py":3137
 *         xmax += w * 0.02
 *         ymin -= h * 0.02
 *         ymax += h * 0.02             # <<<<<<<<<<<<<<
 * 
 *         axes.extend(
 */
  __pyx_t_15 = PyNumber_Multiply(__pyx_v_h, __pyx_float_0_02); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 3137, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_ymax, __pyx_t_15); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3137, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  __Pyx_DECREF_SET(__pyx_v_ymax, __pyx_t_4);
  __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":3140
 * 
 *         axes.extend(
 *             self.create_axes(elements, graphics_options, xmin, xmax, ymin, ymax)             # <<<<<<<<<<<<<<
 *         )
 * 
 */
  __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_create_axes); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 3140, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __pyx_t_13 = NULL;
  __pyx_t_8 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_15))) {
    __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_15);
    if (likely(__pyx_t_13)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15);
      __Pyx_INCREF(__pyx_t_13);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_15, function);
      __pyx_t_8 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_15)) {
    PyObject *__pyx_temp[7] = {__pyx_t_13, __pyx_cur_scope->__pyx_v_elements, __pyx_v_graphics_options, __pyx_v_xmin, __pyx_v_xmax, __pyx_v_ymin, __pyx_v_ymax};
    __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_15, __pyx_temp+1-__pyx_t_8, 6+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3140, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_GOTREF(__pyx_t_4);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_15)) {
    PyObject *__pyx_temp[7] = {__pyx_t_13, __pyx_cur_scope->__pyx_v_elements, __pyx_v_graphics_options, __pyx_v_xmin, __pyx_v_xmax, __pyx_v_ymin, __pyx_v_ymax};
    __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_15, __pyx_temp+1-__pyx_t_8, 6+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3140, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_GOTREF(__pyx_t_4);
  } else
  #endif
  {
    __pyx_t_14 = PyTuple_New(6+__pyx_t_8); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 3140, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    if (__pyx_t_13) {
      __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_13); __pyx_t_13 = NULL;
    }
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_elements);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_elements);
    PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_8, __pyx_cur_scope->__pyx_v_elements);
    __Pyx_INCREF(__pyx_v_graphics_options);
    __Pyx_GIVEREF(__pyx_v_graphics_options);
    PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_8, __pyx_v_graphics_options);
    __Pyx_INCREF(__pyx_v_xmin);
    __Pyx_GIVEREF(__pyx_v_xmin);
    PyTuple_SET_ITEM(__pyx_t_14, 2+__pyx_t_8, __pyx_v_xmin);
    __Pyx_INCREF(__pyx_v_xmax);
    __Pyx_GIVEREF(__pyx_v_xmax);
    PyTuple_SET_ITEM(__pyx_t_14, 3+__pyx_t_8, __pyx_v_xmax);
    __Pyx_INCREF(__pyx_v_ymin);
    __Pyx_GIVEREF(__pyx_v_ymin);
    PyTuple_SET_ITEM(__pyx_t_14, 4+__pyx_t_8, __pyx_v_ymin);
    __Pyx_INCREF(__pyx_v_ymax);
    __Pyx_GIVEREF(__pyx_v_ymax);
    PyTuple_SET_ITEM(__pyx_t_14, 5+__pyx_t_8, __pyx_v_ymax);
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_14, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3140, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  }
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

  /* "mathics/builtin/graphics.py":3139
 *         ymax += h * 0.02
 * 
 *         axes.extend(             # <<<<<<<<<<<<<<
 *             self.create_axes(elements, graphics_options, xmin, xmax, ymin, ymax)
 *         )
 */
  __pyx_t_17 = __Pyx_PyList_Extend(__pyx_cur_scope->__pyx_v_axes, __pyx_t_4); if (unlikely(__pyx_t_17 == ((int)-1))) __PYX_ERR(0, 3139, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":3143
 *         )
 * 
 *         return elements, calc_dimensions             # <<<<<<<<<<<<<<
 * 
 *     def boxes_to_tex(self, leaves, **options):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_elements);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_elements);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_cur_scope->__pyx_v_elements);
  __Pyx_INCREF(__pyx_v_calc_dimensions);
  __Pyx_GIVEREF(__pyx_v_calc_dimensions);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_calc_dimensions);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":2992
 *         return base_width, base_height, multi, aspect
 * 
 *     def _prepare_elements(self, leaves, options, neg_y=False, max_width=None):             # <<<<<<<<<<<<<<
 *         if not leaves:
 *             raise BoxConstructError
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_AddTraceback("mathics.builtin.graphics.GraphicsBox._prepare_elements", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_graphics_options);
  __Pyx_XDECREF(__pyx_v_background);
  __Pyx_XDECREF(__pyx_v_calc_dimensions);
  __Pyx_XDECREF(__pyx_v_xmin);
  __Pyx_XDECREF(__pyx_v_xmax);
  __Pyx_XDECREF(__pyx_v_ymin);
  __Pyx_XDECREF(__pyx_v_ymax);
  __Pyx_XDECREF(__pyx_v_w);
  __Pyx_XDECREF(__pyx_v_h);
  __Pyx_XDECREF(__pyx_v_width);
  __Pyx_XDECREF(__pyx_v_height);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":3145
 *         return elements, calc_dimensions
 * 
 *     def boxes_to_tex(self, leaves, **options):             # <<<<<<<<<<<<<<
 *         elements, calc_dimensions = self._prepare_elements(
 *             leaves, options, max_width=450
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_11GraphicsBox_7boxes_to_tex(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_11GraphicsBox_7boxes_to_tex = {"boxes_to_tex", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_11GraphicsBox_7boxes_to_tex, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_11GraphicsBox_7boxes_to_tex(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_leaves = 0;
  PyObject *__pyx_v_options = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("boxes_to_tex (wrapper)", 0);
  __pyx_v_options = PyDict_New(); if (unlikely(!__pyx_v_options)) return NULL;
  __Pyx_GOTREF(__pyx_v_options);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_leaves,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_leaves)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("boxes_to_tex", 1, 2, 2, 1); __PYX_ERR(0, 3145, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_options, values, pos_args, "boxes_to_tex") < 0)) __PYX_ERR(0, 3145, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_leaves = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("boxes_to_tex", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3145, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_options); __pyx_v_options = 0;
  __Pyx_AddTraceback("mathics.builtin.graphics.GraphicsBox.boxes_to_tex", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_11GraphicsBox_6boxes_to_tex(__pyx_self, __pyx_v_self, __pyx_v_leaves, __pyx_v_options);

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

/* "mathics/builtin/graphics.py":3154
 * 
 *         asy_completely_visible = "\n".join(
 *             element.to_asy()             # <<<<<<<<<<<<<<
 *             for element in elements.elements
 *             if element.is_completely_visible
 */

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_11GraphicsBox_12boxes_to_tex_genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_81_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_7mathics_7builtin_8graphics___pyx_scope_struct_81_genexpr *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_81_genexpr(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_81_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_81_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 3154, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_80_boxes_to_tex *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7mathics_7builtin_8graphics_11GraphicsBox_12boxes_to_tex_2generator49, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_GraphicsBox_boxes_to_tex_locals, __pyx_n_s_mathics_builtin_graphics); if (unlikely(!gen)) __PYX_ERR(0, 3154, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.GraphicsBox.boxes_to_tex.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_7mathics_7builtin_8graphics_11GraphicsBox_12boxes_to_tex_2generator49(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_81_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_81_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 3154, __pyx_L1_error)
  __pyx_r = PyList_New(0); if (unlikely(!__pyx_r)) __PYX_ERR(0, 3154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_r);

  /* "mathics/builtin/graphics.py":3155
 *         asy_completely_visible = "\n".join(
 *             element.to_asy()
 *             for element in elements.elements             # <<<<<<<<<<<<<<
 *             if element.is_completely_visible
 *         )
 */
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_elements)) { __Pyx_RaiseClosureNameError("elements"); __PYX_ERR(0, 3155, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_elements, __pyx_n_s_elements); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3155, __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(0, 3155, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3155, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 3155, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3155, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 3155, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3155, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 3155, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_element);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_element, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;

    /* "mathics/builtin/graphics.py":3156
 *             element.to_asy()
 *             for element in elements.elements
 *             if element.is_completely_visible             # <<<<<<<<<<<<<<
 *         )
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_element, __pyx_n_s_is_completely_visible); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3156, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 3156, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_5) {

      /* "mathics/builtin/graphics.py":3154
 * 
 *         asy_completely_visible = "\n".join(
 *             element.to_asy()             # <<<<<<<<<<<<<<
 *             for element in elements.elements
 *             if element.is_completely_visible
 */
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_element, __pyx_n_s_to_asy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3154, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
        }
      }
      __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3154, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_r, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 3154, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "mathics/builtin/graphics.py":3156
 *             element.to_asy()
 *             for element in elements.elements
 *             if element.is_completely_visible             # <<<<<<<<<<<<<<
 *         )
 * 
 */
    }

    /* "mathics/builtin/graphics.py":3155
 *         asy_completely_visible = "\n".join(
 *             element.to_asy()
 *             for element in elements.elements             # <<<<<<<<<<<<<<
 *             if element.is_completely_visible
 *         )
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "mathics/builtin/graphics.py":3154
 * 
 *         asy_completely_visible = "\n".join(
 *             element.to_asy()             # <<<<<<<<<<<<<<
 *             for element in elements.elements
 *             if element.is_completely_visible
 */

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

/* "mathics/builtin/graphics.py":3160
 * 
 *         asy_regular = "\n".join(
 *             element.to_asy()             # <<<<<<<<<<<<<<
 *             for element in elements.elements
 *             if not element.is_completely_visible
 */

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_11GraphicsBox_12boxes_to_tex_3genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_82_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_7mathics_7builtin_8graphics___pyx_scope_struct_82_genexpr *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_82_genexpr(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_82_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_82_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 3160, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_80_boxes_to_tex *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7mathics_7builtin_8graphics_11GraphicsBox_12boxes_to_tex_5generator50, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_GraphicsBox_boxes_to_tex_locals, __pyx_n_s_mathics_builtin_graphics); if (unlikely(!gen)) __PYX_ERR(0, 3160, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.GraphicsBox.boxes_to_tex.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_7mathics_7builtin_8graphics_11GraphicsBox_12boxes_to_tex_5generator50(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_82_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_82_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 3160, __pyx_L1_error)
  __pyx_r = PyList_New(0); if (unlikely(!__pyx_r)) __PYX_ERR(0, 3160, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_r);

  /* "mathics/builtin/graphics.py":3161
 *         asy_regular = "\n".join(
 *             element.to_asy()
 *             for element in elements.elements             # <<<<<<<<<<<<<<
 *             if not element.is_completely_visible
 *         )
 */
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_elements)) { __Pyx_RaiseClosureNameError("elements"); __PYX_ERR(0, 3161, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_elements, __pyx_n_s_elements); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3161, __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(0, 3161, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3161, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 3161, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3161, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 3161, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3161, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 3161, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_element);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_element, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;

    /* "mathics/builtin/graphics.py":3162
 *             element.to_asy()
 *             for element in elements.elements
 *             if not element.is_completely_visible             # <<<<<<<<<<<<<<
 *         )
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_element, __pyx_n_s_is_completely_visible); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3162, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 3162, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_6 = ((!__pyx_t_5) != 0);
    if (__pyx_t_6) {

      /* "mathics/builtin/graphics.py":3160
 * 
 *         asy_regular = "\n".join(
 *             element.to_asy()             # <<<<<<<<<<<<<<
 *             for element in elements.elements
 *             if not element.is_completely_visible
 */
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_element, __pyx_n_s_to_asy); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3160, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3160, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_r, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 3160, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "mathics/builtin/graphics.py":3162
 *             element.to_asy()
 *             for element in elements.elements
 *             if not element.is_completely_visible             # <<<<<<<<<<<<<<
 *         )
 * 
 */
    }

    /* "mathics/builtin/graphics.py":3161
 *         asy_regular = "\n".join(
 *             element.to_asy()
 *             for element in elements.elements             # <<<<<<<<<<<<<<
 *             if not element.is_completely_visible
 *         )
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "mathics/builtin/graphics.py":3160
 * 
 *         asy_regular = "\n".join(
 *             element.to_asy()             # <<<<<<<<<<<<<<
 *             for element in elements.elements
 *             if not element.is_completely_visible
 */

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

/* "mathics/builtin/graphics.py":3145
 *         return elements, calc_dimensions
 * 
 *     def boxes_to_tex(self, leaves, **options):             # <<<<<<<<<<<<<<
 *         elements, calc_dimensions = self._prepare_elements(
 *             leaves, options, max_width=450
 */

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_11GraphicsBox_6boxes_to_tex(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_leaves, PyObject *__pyx_v_options) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_80_boxes_to_tex *__pyx_cur_scope;
  PyObject *__pyx_v_calc_dimensions = NULL;
  PyObject *__pyx_v_xmin = NULL;
  PyObject *__pyx_v_xmax = NULL;
  PyObject *__pyx_v_ymin = NULL;
  PyObject *__pyx_v_ymax = NULL;
  PyObject *__pyx_v_w = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_h = NULL;
  PyObject *__pyx_v_width = NULL;
  PyObject *__pyx_v_height = NULL;
  PyObject *__pyx_v_asy_completely_visible = NULL;
  PyObject *__pyx_v_asy_regular = NULL;
  PyObject *__pyx_v_asy_box = NULL;
  PyObject *__pyx_v_color = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_opacity = NULL;
  PyObject *__pyx_v_asy_background = NULL;
  PyObject *__pyx_v_tex = 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 *);
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  Py_ssize_t __pyx_t_12;
  Py_UCS4 __pyx_t_13;
  int __pyx_t_14;
  int __pyx_t_15;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("boxes_to_tex", 0);
  __pyx_cur_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_80_boxes_to_tex *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_80_boxes_to_tex(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_80_boxes_to_tex, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_80_boxes_to_tex *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 3145, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }

  /* "mathics/builtin/graphics.py":3146
 * 
 *     def boxes_to_tex(self, leaves, **options):
 *         elements, calc_dimensions = self._prepare_elements(             # <<<<<<<<<<<<<<
 *             leaves, options, max_width=450
 *         )
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_prepare_elements); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3146, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "mathics/builtin/graphics.py":3147
 *     def boxes_to_tex(self, leaves, **options):
 *         elements, calc_dimensions = self._prepare_elements(
 *             leaves, options, max_width=450             # <<<<<<<<<<<<<<
 *         )
 * 
 */
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3146, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_leaves);
  __Pyx_GIVEREF(__pyx_v_leaves);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_leaves);
  __Pyx_INCREF(__pyx_v_options);
  __Pyx_GIVEREF(__pyx_v_options);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_options);
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_max_width, __pyx_int_450) < 0) __PYX_ERR(0, 3147, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":3146
 * 
 *     def boxes_to_tex(self, leaves, **options):
 *         elements, calc_dimensions = self._prepare_elements(             # <<<<<<<<<<<<<<
 *             leaves, options, max_width=450
 *         )
 */
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3146, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
    PyObject* sequence = __pyx_t_4;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 3146, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    #else
    __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3146, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3146, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_1 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3146, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext;
    index = 0; __pyx_t_3 = __pyx_t_5(__pyx_t_1); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 1; __pyx_t_2 = __pyx_t_5(__pyx_t_1); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_1), 2) < 0) __PYX_ERR(0, 3146, __pyx_L1_error)
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 3146, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_cur_scope->__pyx_v_elements = __pyx_t_3;
  __pyx_t_3 = 0;
  __pyx_v_calc_dimensions = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":3150
 *         )
 * 
 *         xmin, xmax, ymin, ymax, w, h, width, height = calc_dimensions()             # <<<<<<<<<<<<<<
 *         elements.view_width = w
 * 
 */
  __Pyx_INCREF(__pyx_v_calc_dimensions);
  __pyx_t_2 = __pyx_v_calc_dimensions; __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_4 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
    PyObject* sequence = __pyx_t_4;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 8)) {
      if (size > 8) __Pyx_RaiseTooManyValuesError(8);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 3150, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 2); 
      __pyx_t_6 = PyTuple_GET_ITEM(sequence, 3); 
      __pyx_t_7 = PyTuple_GET_ITEM(sequence, 4); 
      __pyx_t_8 = PyTuple_GET_ITEM(sequence, 5); 
      __pyx_t_9 = PyTuple_GET_ITEM(sequence, 6); 
      __pyx_t_10 = PyTuple_GET_ITEM(sequence, 7); 
    } else {
      __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
      __pyx_t_1 = PyList_GET_ITEM(sequence, 2); 
      __pyx_t_6 = PyList_GET_ITEM(sequence, 3); 
      __pyx_t_7 = PyList_GET_ITEM(sequence, 4); 
      __pyx_t_8 = PyList_GET_ITEM(sequence, 5); 
      __pyx_t_9 = PyList_GET_ITEM(sequence, 6); 
      __pyx_t_10 = PyList_GET_ITEM(sequence, 7); 
    }
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_t_7);
    __Pyx_INCREF(__pyx_t_8);
    __Pyx_INCREF(__pyx_t_9);
    __Pyx_INCREF(__pyx_t_10);
    #else
    {
      Py_ssize_t i;
      PyObject** temps[8] = {&__pyx_t_2,&__pyx_t_3,&__pyx_t_1,&__pyx_t_6,&__pyx_t_7,&__pyx_t_8,&__pyx_t_9,&__pyx_t_10};
      for (i=0; i < 8; i++) {
        PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 3150, __pyx_L1_error)
        __Pyx_GOTREF(item);
        *(temps[i]) = item;
      }
    }
    #endif
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else {
    Py_ssize_t index = -1;
    PyObject** temps[8] = {&__pyx_t_2,&__pyx_t_3,&__pyx_t_1,&__pyx_t_6,&__pyx_t_7,&__pyx_t_8,&__pyx_t_9,&__pyx_t_10};
    __pyx_t_11 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3150, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = Py_TYPE(__pyx_t_11)->tp_iternext;
    for (index=0; index < 8; index++) {
      PyObject* item = __pyx_t_5(__pyx_t_11); if (unlikely(!item)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(item);
      *(temps[index]) = item;
    }
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_11), 8) < 0) __PYX_ERR(0, 3150, __pyx_L1_error)
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    goto __pyx_L6_unpacking_done;
    __pyx_L5_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 3150, __pyx_L1_error)
    __pyx_L6_unpacking_done:;
  }
  __pyx_v_xmin = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_v_xmax = __pyx_t_3;
  __pyx_t_3 = 0;
  __pyx_v_ymin = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v_ymax = __pyx_t_6;
  __pyx_t_6 = 0;
  __pyx_v_w = __pyx_t_7;
  __pyx_t_7 = 0;
  __pyx_v_h = __pyx_t_8;
  __pyx_t_8 = 0;
  __pyx_v_width = __pyx_t_9;
  __pyx_t_9 = 0;
  __pyx_v_height = __pyx_t_10;
  __pyx_t_10 = 0;

  /* "mathics/builtin/graphics.py":3151
 * 
 *         xmin, xmax, ymin, ymax, w, h, width, height = calc_dimensions()
 *         elements.view_width = w             # <<<<<<<<<<<<<<
 * 
 *         asy_completely_visible = "\n".join(
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_elements, __pyx_n_s_view_width, __pyx_v_w) < 0) __PYX_ERR(0, 3151, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":3154
 * 
 *         asy_completely_visible = "\n".join(
 *             element.to_asy()             # <<<<<<<<<<<<<<
 *             for element in elements.elements
 *             if element.is_completely_visible
 */
  __pyx_t_4 = __pyx_pf_7mathics_7builtin_8graphics_11GraphicsBox_12boxes_to_tex_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "mathics/builtin/graphics.py":3153
 *         elements.view_width = w
 * 
 *         asy_completely_visible = "\n".join(             # <<<<<<<<<<<<<<
 *             element.to_asy()
 *             for element in elements.elements
 */
  __pyx_t_10 = __Pyx_Generator_Next(__pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyUnicode_Join(__pyx_kp_u__5, __pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_v_asy_completely_visible = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":3160
 * 
 *         asy_regular = "\n".join(
 *             element.to_asy()             # <<<<<<<<<<<<<<
 *             for element in elements.elements
 *             if not element.is_completely_visible
 */
  __pyx_t_4 = __pyx_pf_7mathics_7builtin_8graphics_11GraphicsBox_12boxes_to_tex_3genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3160, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "mathics/builtin/graphics.py":3159
 *         )
 * 
 *         asy_regular = "\n".join(             # <<<<<<<<<<<<<<
 *             element.to_asy()
 *             for element in elements.elements
 */
  __pyx_t_10 = __Pyx_Generator_Next(__pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3159, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyUnicode_Join(__pyx_kp_u__5, __pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3159, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_v_asy_regular = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":3165
 *         )
 * 
 *         asy_box = "box((%s,%s), (%s,%s))" % (             # <<<<<<<<<<<<<<
 *             asy_number(xmin),
 *             asy_number(ymin),
 */
  __pyx_t_4 = PyTuple_New(9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3165, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_12 = 0;
  __pyx_t_13 = 127;
  __Pyx_INCREF(__pyx_kp_u_box);
  __pyx_t_12 += 5;
  __Pyx_GIVEREF(__pyx_kp_u_box);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_u_box);

  /* "mathics/builtin/graphics.py":3166
 * 
 *         asy_box = "box((%s,%s), (%s,%s))" % (
 *             asy_number(xmin),             # <<<<<<<<<<<<<<
 *             asy_number(ymin),
 *             asy_number(xmax),
 */
  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_asy_number); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3166, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_8 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_9);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_9, function);
    }
  }
  __pyx_t_10 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_8, __pyx_v_xmin) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_xmin);
  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3166, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_10), __pyx_empty_unicode); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3166, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_13 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9) > __pyx_t_13) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9) : __pyx_t_13;
  __pyx_t_12 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9);
  __Pyx_GIVEREF(__pyx_t_9);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_9);
  __pyx_t_9 = 0;
  __Pyx_INCREF(__pyx_kp_u__31);
  __pyx_t_12 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__31);
  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_kp_u__31);

  /* "mathics/builtin/graphics.py":3167
 *         asy_box = "box((%s,%s), (%s,%s))" % (
 *             asy_number(xmin),
 *             asy_number(ymin),             # <<<<<<<<<<<<<<
 *             asy_number(xmax),
 *             asy_number(ymax),
 */
  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_asy_number); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3167, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_8 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_10);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_10, function);
    }
  }
  __pyx_t_9 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_8, __pyx_v_ymin) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_v_ymin);
  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3167, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_9), __pyx_empty_unicode); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3167, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_13 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) > __pyx_t_13) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) : __pyx_t_13;
  __pyx_t_12 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_10);
  PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_10);
  __pyx_t_10 = 0;
  __Pyx_INCREF(__pyx_kp_u__109);
  __pyx_t_12 += 4;
  __Pyx_GIVEREF(__pyx_kp_u__109);
  PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_kp_u__109);

  /* "mathics/builtin/graphics.py":3168
 *             asy_number(xmin),
 *             asy_number(ymin),
 *             asy_number(xmax),             # <<<<<<<<<<<<<<
 *             asy_number(ymax),
 *         )
 */
  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_asy_number); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3168, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_8 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_9);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_9, function);
    }
  }
  __pyx_t_10 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_8, __pyx_v_xmax) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_xmax);
  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3168, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_10), __pyx_empty_unicode); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3168, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_13 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9) > __pyx_t_13) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9) : __pyx_t_13;
  __pyx_t_12 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9);
  __Pyx_GIVEREF(__pyx_t_9);
  PyTuple_SET_ITEM(__pyx_t_4, 5, __pyx_t_9);
  __pyx_t_9 = 0;
  __Pyx_INCREF(__pyx_kp_u__31);
  __pyx_t_12 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__31);
  PyTuple_SET_ITEM(__pyx_t_4, 6, __pyx_kp_u__31);

  /* "mathics/builtin/graphics.py":3169
 *             asy_number(ymin),
 *             asy_number(xmax),
 *             asy_number(ymax),             # <<<<<<<<<<<<<<
 *         )
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_asy_number); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3169, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_8 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_10);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_10, function);
    }
  }
  __pyx_t_9 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_8, __pyx_v_ymax) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_v_ymax);
  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3169, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_9), __pyx_empty_unicode); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3169, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_13 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) > __pyx_t_13) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) : __pyx_t_13;
  __pyx_t_12 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_10);
  PyTuple_SET_ITEM(__pyx_t_4, 7, __pyx_t_10);
  __pyx_t_10 = 0;
  __Pyx_INCREF(__pyx_kp_u__140);
  __pyx_t_12 += 2;
  __Pyx_GIVEREF(__pyx_kp_u__140);
  PyTuple_SET_ITEM(__pyx_t_4, 8, __pyx_kp_u__140);

  /* "mathics/builtin/graphics.py":3165
 *         )
 * 
 *         asy_box = "box((%s,%s), (%s,%s))" % (             # <<<<<<<<<<<<<<
 *             asy_number(xmin),
 *             asy_number(ymin),
 */
  __pyx_t_10 = __Pyx_PyUnicode_Join(__pyx_t_4, 9, __pyx_t_12, __pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3165, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_asy_box = ((PyObject*)__pyx_t_10);
  __pyx_t_10 = 0;

  /* "mathics/builtin/graphics.py":3172
 *         )
 * 
 *         if self.background_color is not None:             # <<<<<<<<<<<<<<
 *             color, opacity = self.background_color.to_asy()
 *             asy_background = "filldraw(%s, %s);" % (asy_box, color)
 */
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_background_color); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3172, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_14 = (__pyx_t_10 != Py_None);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_15 = (__pyx_t_14 != 0);
  if (__pyx_t_15) {

    /* "mathics/builtin/graphics.py":3173
 * 
 *         if self.background_color is not None:
 *             color, opacity = self.background_color.to_asy()             # <<<<<<<<<<<<<<
 *             asy_background = "filldraw(%s, %s);" % (asy_box, color)
 *         else:
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_background_color); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3173, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_to_asy); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3173, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_9);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_9, function);
      }
    }
    __pyx_t_10 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_9);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3173, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if ((likely(PyTuple_CheckExact(__pyx_t_10))) || (PyList_CheckExact(__pyx_t_10))) {
      PyObject* sequence = __pyx_t_10;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 3173, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_9 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_9 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_4 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_4);
      #else
      __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3173, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3173, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      #endif
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_8 = PyObject_GetIter(__pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3173, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_5 = Py_TYPE(__pyx_t_8)->tp_iternext;
      index = 0; __pyx_t_9 = __pyx_t_5(__pyx_t_8); if (unlikely(!__pyx_t_9)) goto __pyx_L8_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_9);
      index = 1; __pyx_t_4 = __pyx_t_5(__pyx_t_8); if (unlikely(!__pyx_t_4)) goto __pyx_L8_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_4);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_8), 2) < 0) __PYX_ERR(0, 3173, __pyx_L1_error)
      __pyx_t_5 = NULL;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L9_unpacking_done;
      __pyx_L8_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_5 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 3173, __pyx_L1_error)
      __pyx_L9_unpacking_done:;
    }
    __pyx_v_color = __pyx_t_9;
    __pyx_t_9 = 0;
    __pyx_v_opacity = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "mathics/builtin/graphics.py":3174
 *         if self.background_color is not None:
 *             color, opacity = self.background_color.to_asy()
 *             asy_background = "filldraw(%s, %s);" % (asy_box, color)             # <<<<<<<<<<<<<<
 *         else:
 *             asy_background = ""
 */
    __pyx_t_10 = PyTuple_New(5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3174, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_12 = 0;
    __pyx_t_13 = 127;
    __Pyx_INCREF(__pyx_kp_u_filldraw_3);
    __pyx_t_12 += 9;
    __Pyx_GIVEREF(__pyx_kp_u_filldraw_3);
    PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_kp_u_filldraw_3);
    __Pyx_INCREF(__pyx_v_asy_box);
    __pyx_t_13 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_asy_box) > __pyx_t_13) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_asy_box) : __pyx_t_13;
    __pyx_t_12 += __Pyx_PyUnicode_GET_LENGTH(__pyx_v_asy_box);
    __Pyx_GIVEREF(__pyx_v_asy_box);
    PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_v_asy_box);
    __Pyx_INCREF(__pyx_kp_u__4);
    __pyx_t_12 += 2;
    __Pyx_GIVEREF(__pyx_kp_u__4);
    PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_kp_u__4);
    __pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_color), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3174, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_13 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_13) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_13;
    __pyx_t_12 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_t_4);
    __pyx_t_4 = 0;
    __Pyx_INCREF(__pyx_kp_u__33);
    __pyx_t_12 += 2;
    __Pyx_GIVEREF(__pyx_kp_u__33);
    PyTuple_SET_ITEM(__pyx_t_10, 4, __pyx_kp_u__33);
    __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_10, 5, __pyx_t_12, __pyx_t_13); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3174, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_v_asy_background = ((PyObject*)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "mathics/builtin/graphics.py":3172
 *         )
 * 
 *         if self.background_color is not None:             # <<<<<<<<<<<<<<
 *             color, opacity = self.background_color.to_asy()
 *             asy_background = "filldraw(%s, %s);" % (asy_box, color)
 */
    goto __pyx_L7;
  }

  /* "mathics/builtin/graphics.py":3176
 *             asy_background = "filldraw(%s, %s);" % (asy_box, color)
 *         else:
 *             asy_background = ""             # <<<<<<<<<<<<<<
 * 
 *         tex = r"""
 */
  /*else*/ {
    __Pyx_INCREF(__pyx_kp_u__41);
    __pyx_v_asy_background = __pyx_kp_u__41;
  }
  __pyx_L7:;

  /* "mathics/builtin/graphics.py":3178
 *             asy_background = ""
 * 
 *         tex = r"""             # <<<<<<<<<<<<<<
 * \begin{asy}
 * usepackage("amsmath");
 */
  __pyx_t_4 = PyTuple_New(13); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3178, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_12 = 0;
  __pyx_t_13 = 127;
  __Pyx_INCREF(__pyx_kp_u_begin_asy_usepackage_amsmath_si);
  __pyx_t_12 += 41;
  __Pyx_GIVEREF(__pyx_kp_u_begin_asy_usepackage_amsmath_si);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_u_begin_asy_usepackage_amsmath_si);

  /* "mathics/builtin/graphics.py":3188
 * \end{asy}
 * """ % (
 *             asy_number(width / 60),             # <<<<<<<<<<<<<<
 *             asy_number(height / 60),
 *             asy_background,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_asy_number); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3188, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_8 = __Pyx_PyInt_TrueDivideObjC(__pyx_v_width, __pyx_int_60, 60, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3188, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_7 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_9);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_9, function);
    }
  }
  __pyx_t_10 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_7, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_8);
  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3188, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_10), __pyx_empty_unicode); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3188, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_13 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9) > __pyx_t_13) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9) : __pyx_t_13;
  __pyx_t_12 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9);
  __Pyx_GIVEREF(__pyx_t_9);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_9);
  __pyx_t_9 = 0;
  __Pyx_INCREF(__pyx_kp_u_cm);
  __pyx_t_12 += 4;
  __Pyx_GIVEREF(__pyx_kp_u_cm);
  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_kp_u_cm);

  /* "mathics/builtin/graphics.py":3189
 * """ % (
 *             asy_number(width / 60),
 *             asy_number(height / 60),             # <<<<<<<<<<<<<<
 *             asy_background,
 *             asy_regular,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_asy_number); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3189, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_8 = __Pyx_PyInt_TrueDivideObjC(__pyx_v_height, __pyx_int_60, 60, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3189, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_7 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_10);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_10, function);
    }
  }
  __pyx_t_9 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_7, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_8);
  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3189, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_9), __pyx_empty_unicode); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3189, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_13 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) > __pyx_t_13) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) : __pyx_t_13;
  __pyx_t_12 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_10);
  PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_10);
  __pyx_t_10 = 0;
  __Pyx_INCREF(__pyx_kp_u_cm_2);
  __pyx_t_12 += 5;
  __Pyx_GIVEREF(__pyx_kp_u_cm_2);
  PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_kp_u_cm_2);

  /* "mathics/builtin/graphics.py":3190
 *             asy_number(width / 60),
 *             asy_number(height / 60),
 *             asy_background,             # <<<<<<<<<<<<<<
 *             asy_regular,
 *             asy_box,
 */
  __Pyx_INCREF(__pyx_v_asy_background);
  __pyx_t_13 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_asy_background) > __pyx_t_13) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_asy_background) : __pyx_t_13;
  __pyx_t_12 += __Pyx_PyUnicode_GET_LENGTH(__pyx_v_asy_background);
  __Pyx_GIVEREF(__pyx_v_asy_background);
  PyTuple_SET_ITEM(__pyx_t_4, 5, __pyx_v_asy_background);
  __Pyx_INCREF(__pyx_kp_u__5);
  __pyx_t_12 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__5);
  PyTuple_SET_ITEM(__pyx_t_4, 6, __pyx_kp_u__5);

  /* "mathics/builtin/graphics.py":3191
 *             asy_number(height / 60),
 *             asy_background,
 *             asy_regular,             # <<<<<<<<<<<<<<
 *             asy_box,
 *             asy_completely_visible,
 */
  __pyx_t_10 = __Pyx_PyUnicode_Unicode(__pyx_v_asy_regular); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3191, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_13 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) > __pyx_t_13) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) : __pyx_t_13;
  __pyx_t_12 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_10);
  PyTuple_SET_ITEM(__pyx_t_4, 7, __pyx_t_10);
  __pyx_t_10 = 0;
  __Pyx_INCREF(__pyx_kp_u_clip);
  __pyx_t_12 += 6;
  __Pyx_GIVEREF(__pyx_kp_u_clip);
  PyTuple_SET_ITEM(__pyx_t_4, 8, __pyx_kp_u_clip);

  /* "mathics/builtin/graphics.py":3192
 *             asy_background,
 *             asy_regular,
 *             asy_box,             # <<<<<<<<<<<<<<
 *             asy_completely_visible,
 *         )
 */
  __Pyx_INCREF(__pyx_v_asy_box);
  __pyx_t_13 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_asy_box) > __pyx_t_13) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_asy_box) : __pyx_t_13;
  __pyx_t_12 += __Pyx_PyUnicode_GET_LENGTH(__pyx_v_asy_box);
  __Pyx_GIVEREF(__pyx_v_asy_box);
  PyTuple_SET_ITEM(__pyx_t_4, 9, __pyx_v_asy_box);
  __Pyx_INCREF(__pyx_kp_u__141);
  __pyx_t_12 += 3;
  __Pyx_GIVEREF(__pyx_kp_u__141);
  PyTuple_SET_ITEM(__pyx_t_4, 10, __pyx_kp_u__141);

  /* "mathics/builtin/graphics.py":3193
 *             asy_regular,
 *             asy_box,
 *             asy_completely_visible,             # <<<<<<<<<<<<<<
 *         )
 * 
 */
  __pyx_t_10 = __Pyx_PyUnicode_Unicode(__pyx_v_asy_completely_visible); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3193, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_13 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) > __pyx_t_13) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) : __pyx_t_13;
  __pyx_t_12 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_10);
  PyTuple_SET_ITEM(__pyx_t_4, 11, __pyx_t_10);
  __pyx_t_10 = 0;
  __Pyx_INCREF(__pyx_kp_u_end_asy);
  __pyx_t_12 += 11;
  __Pyx_GIVEREF(__pyx_kp_u_end_asy);
  PyTuple_SET_ITEM(__pyx_t_4, 12, __pyx_kp_u_end_asy);

  /* "mathics/builtin/graphics.py":3178
 *             asy_background = ""
 * 
 *         tex = r"""             # <<<<<<<<<<<<<<
 * \begin{asy}
 * usepackage("amsmath");
 */
  __pyx_t_10 = __Pyx_PyUnicode_Join(__pyx_t_4, 13, __pyx_t_12, __pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3178, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_tex = ((PyObject*)__pyx_t_10);
  __pyx_t_10 = 0;

  /* "mathics/builtin/graphics.py":3196
 *         )
 * 
 *         return tex             # <<<<<<<<<<<<<<
 * 
 *     def boxes_to_xml(self, leaves, **options):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_tex);
  __pyx_r = __pyx_v_tex;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":3145
 *         return elements, calc_dimensions
 * 
 *     def boxes_to_tex(self, leaves, **options):             # <<<<<<<<<<<<<<
 *         elements, calc_dimensions = self._prepare_elements(
 *             leaves, options, max_width=450
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("mathics.builtin.graphics.GraphicsBox.boxes_to_tex", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_calc_dimensions);
  __Pyx_XDECREF(__pyx_v_xmin);
  __Pyx_XDECREF(__pyx_v_xmax);
  __Pyx_XDECREF(__pyx_v_ymin);
  __Pyx_XDECREF(__pyx_v_ymax);
  __Pyx_XDECREF(__pyx_v_w);
  __Pyx_XDECREF(__pyx_v_h);
  __Pyx_XDECREF(__pyx_v_width);
  __Pyx_XDECREF(__pyx_v_height);
  __Pyx_XDECREF(__pyx_v_asy_completely_visible);
  __Pyx_XDECREF(__pyx_v_asy_regular);
  __Pyx_XDECREF(__pyx_v_asy_box);
  __Pyx_XDECREF(__pyx_v_color);
  __Pyx_XDECREF(__pyx_v_opacity);
  __Pyx_XDECREF(__pyx_v_asy_background);
  __Pyx_XDECREF(__pyx_v_tex);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":3198
 *         return tex
 * 
 *     def boxes_to_xml(self, leaves, **options):             # <<<<<<<<<<<<<<
 *         elements, calc_dimensions = self._prepare_elements(leaves, options, neg_y=True)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_11GraphicsBox_9boxes_to_xml(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_11GraphicsBox_9boxes_to_xml = {"boxes_to_xml", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_11GraphicsBox_9boxes_to_xml, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_11GraphicsBox_9boxes_to_xml(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_leaves = 0;
  PyObject *__pyx_v_options = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("boxes_to_xml (wrapper)", 0);
  __pyx_v_options = PyDict_New(); if (unlikely(!__pyx_v_options)) return NULL;
  __Pyx_GOTREF(__pyx_v_options);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_leaves,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_leaves)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("boxes_to_xml", 1, 2, 2, 1); __PYX_ERR(0, 3198, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_options, values, pos_args, "boxes_to_xml") < 0)) __PYX_ERR(0, 3198, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_leaves = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("boxes_to_xml", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3198, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_options); __pyx_v_options = 0;
  __Pyx_AddTraceback("mathics.builtin.graphics.GraphicsBox.boxes_to_xml", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_11GraphicsBox_8boxes_to_xml(__pyx_self, __pyx_v_self, __pyx_v_leaves, __pyx_v_options);

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

/* "mathics/builtin/graphics.py":3229
 *             </svg>
 *         """ % (
 *             " ".join("%f" % t for t in (xmin, ymin, w, h)),             # <<<<<<<<<<<<<<
 *             svg,
 *         )
 */

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_11GraphicsBox_12boxes_to_xml_genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_84_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_7mathics_7builtin_8graphics___pyx_scope_struct_84_genexpr *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_84_genexpr(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_84_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_84_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 3229, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_83_boxes_to_xml *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7mathics_7builtin_8graphics_11GraphicsBox_12boxes_to_xml_2generator51, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_GraphicsBox_boxes_to_xml_locals, __pyx_n_s_mathics_builtin_graphics); if (unlikely(!gen)) __PYX_ERR(0, 3229, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.GraphicsBox.boxes_to_xml.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_7mathics_7builtin_8graphics_11GraphicsBox_12boxes_to_xml_2generator51(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_84_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_84_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 3229, __pyx_L1_error)
  __pyx_r = PyList_New(0); if (unlikely(!__pyx_r)) __PYX_ERR(0, 3229, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_xmin)) { __Pyx_RaiseClosureNameError("xmin"); __PYX_ERR(0, 3229, __pyx_L1_error) }
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_ymin)) { __Pyx_RaiseClosureNameError("ymin"); __PYX_ERR(0, 3229, __pyx_L1_error) }
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_w)) { __Pyx_RaiseClosureNameError("w"); __PYX_ERR(0, 3229, __pyx_L1_error) }
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_h)) { __Pyx_RaiseClosureNameError("h"); __PYX_ERR(0, 3229, __pyx_L1_error) }
  __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3229, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_xmin);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_xmin);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_xmin);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_ymin);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_ymin);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_ymin);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_w);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_w);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_w);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_h);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_h);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_h);
  __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (__pyx_t_3 >= 4) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 3229, __pyx_L1_error)
    #else
    __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3229, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    #endif
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_t);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_t, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_f_2, __pyx_cur_scope->__pyx_v_t); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3229, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (unlikely(__Pyx_ListComp_Append(__pyx_r, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 3229, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

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

/* "mathics/builtin/graphics.py":3198
 *         return tex
 * 
 *     def boxes_to_xml(self, leaves, **options):             # <<<<<<<<<<<<<<
 *         elements, calc_dimensions = self._prepare_elements(leaves, options, neg_y=True)
 * 
 */

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_11GraphicsBox_8boxes_to_xml(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_leaves, PyObject *__pyx_v_options) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_83_boxes_to_xml *__pyx_cur_scope;
  PyObject *__pyx_v_elements = NULL;
  PyObject *__pyx_v_calc_dimensions = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_xmax = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_ymax = NULL;
  PyObject *__pyx_v_width = NULL;
  PyObject *__pyx_v_height = NULL;
  PyObject *__pyx_v_svg = NULL;
  PyObject *__pyx_v_svg_xml = 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 *);
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  int __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  Py_UCS4 __pyx_t_15;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("boxes_to_xml", 0);
  __pyx_cur_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_83_boxes_to_xml *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_83_boxes_to_xml(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_83_boxes_to_xml, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_83_boxes_to_xml *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 3198, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }

  /* "mathics/builtin/graphics.py":3199
 * 
 *     def boxes_to_xml(self, leaves, **options):
 *         elements, calc_dimensions = self._prepare_elements(leaves, options, neg_y=True)             # <<<<<<<<<<<<<<
 * 
 *         xmin, xmax, ymin, ymax, w, h, width, height = calc_dimensions()
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_prepare_elements); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3199, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3199, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_leaves);
  __Pyx_GIVEREF(__pyx_v_leaves);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_leaves);
  __Pyx_INCREF(__pyx_v_options);
  __Pyx_GIVEREF(__pyx_v_options);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_options);
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3199, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_neg_y, Py_True) < 0) __PYX_ERR(0, 3199, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3199, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
    PyObject* sequence = __pyx_t_4;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 3199, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    #else
    __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3199, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3199, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_1 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3199, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext;
    index = 0; __pyx_t_3 = __pyx_t_5(__pyx_t_1); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 1; __pyx_t_2 = __pyx_t_5(__pyx_t_1); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_1), 2) < 0) __PYX_ERR(0, 3199, __pyx_L1_error)
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 3199, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  __pyx_v_elements = __pyx_t_3;
  __pyx_t_3 = 0;
  __pyx_v_calc_dimensions = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":3201
 *         elements, calc_dimensions = self._prepare_elements(leaves, options, neg_y=True)
 * 
 *         xmin, xmax, ymin, ymax, w, h, width, height = calc_dimensions()             # <<<<<<<<<<<<<<
 *         elements.view_width = w
 * 
 */
  __Pyx_INCREF(__pyx_v_calc_dimensions);
  __pyx_t_2 = __pyx_v_calc_dimensions; __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_4 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3201, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
    PyObject* sequence = __pyx_t_4;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 8)) {
      if (size > 8) __Pyx_RaiseTooManyValuesError(8);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 3201, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 2); 
      __pyx_t_6 = PyTuple_GET_ITEM(sequence, 3); 
      __pyx_t_7 = PyTuple_GET_ITEM(sequence, 4); 
      __pyx_t_8 = PyTuple_GET_ITEM(sequence, 5); 
      __pyx_t_9 = PyTuple_GET_ITEM(sequence, 6); 
      __pyx_t_10 = PyTuple_GET_ITEM(sequence, 7); 
    } else {
      __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
      __pyx_t_1 = PyList_GET_ITEM(sequence, 2); 
      __pyx_t_6 = PyList_GET_ITEM(sequence, 3); 
      __pyx_t_7 = PyList_GET_ITEM(sequence, 4); 
      __pyx_t_8 = PyList_GET_ITEM(sequence, 5); 
      __pyx_t_9 = PyList_GET_ITEM(sequence, 6); 
      __pyx_t_10 = PyList_GET_ITEM(sequence, 7); 
    }
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_t_7);
    __Pyx_INCREF(__pyx_t_8);
    __Pyx_INCREF(__pyx_t_9);
    __Pyx_INCREF(__pyx_t_10);
    #else
    {
      Py_ssize_t i;
      PyObject** temps[8] = {&__pyx_t_2,&__pyx_t_3,&__pyx_t_1,&__pyx_t_6,&__pyx_t_7,&__pyx_t_8,&__pyx_t_9,&__pyx_t_10};
      for (i=0; i < 8; i++) {
        PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 3201, __pyx_L1_error)
        __Pyx_GOTREF(item);
        *(temps[i]) = item;
      }
    }
    #endif
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else {
    Py_ssize_t index = -1;
    PyObject** temps[8] = {&__pyx_t_2,&__pyx_t_3,&__pyx_t_1,&__pyx_t_6,&__pyx_t_7,&__pyx_t_8,&__pyx_t_9,&__pyx_t_10};
    __pyx_t_11 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3201, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = Py_TYPE(__pyx_t_11)->tp_iternext;
    for (index=0; index < 8; index++) {
      PyObject* item = __pyx_t_5(__pyx_t_11); if (unlikely(!item)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(item);
      *(temps[index]) = item;
    }
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_11), 8) < 0) __PYX_ERR(0, 3201, __pyx_L1_error)
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    goto __pyx_L6_unpacking_done;
    __pyx_L5_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 3201, __pyx_L1_error)
    __pyx_L6_unpacking_done:;
  }
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_cur_scope->__pyx_v_xmin = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_v_xmax = __pyx_t_3;
  __pyx_t_3 = 0;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_ymin = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v_ymax = __pyx_t_6;
  __pyx_t_6 = 0;
  __Pyx_GIVEREF(__pyx_t_7);
  __pyx_cur_scope->__pyx_v_w = __pyx_t_7;
  __pyx_t_7 = 0;
  __Pyx_GIVEREF(__pyx_t_8);
  __pyx_cur_scope->__pyx_v_h = __pyx_t_8;
  __pyx_t_8 = 0;
  __pyx_v_width = __pyx_t_9;
  __pyx_t_9 = 0;
  __pyx_v_height = __pyx_t_10;
  __pyx_t_10 = 0;

  /* "mathics/builtin/graphics.py":3202
 * 
 *         xmin, xmax, ymin, ymax, w, h, width, height = calc_dimensions()
 *         elements.view_width = w             # <<<<<<<<<<<<<<
 * 
 *         svg = elements.to_svg()
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_elements, __pyx_n_s_view_width, __pyx_cur_scope->__pyx_v_w) < 0) __PYX_ERR(0, 3202, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":3204
 *         elements.view_width = w
 * 
 *         svg = elements.to_svg()             # <<<<<<<<<<<<<<
 * 
 *         if self.background_color is not None:
 */
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_elements, __pyx_n_s_to_svg); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3204, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_9 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
    __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_10);
    if (likely(__pyx_t_9)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_10, function);
    }
  }
  __pyx_t_4 = (__pyx_t_9) ? __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_9) : __Pyx_PyObject_CallNoArg(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3204, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_v_svg = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":3206
 *         svg = elements.to_svg()
 * 
 *         if self.background_color is not None:             # <<<<<<<<<<<<<<
 *             svg = '<rect x="%f" y="%f" width="%f" height="%f" style="fill:%s"/>%s' % (
 *                 xmin,
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_background_color); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3206, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_12 = (__pyx_t_4 != Py_None);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_13 = (__pyx_t_12 != 0);
  if (__pyx_t_13) {

    /* "mathics/builtin/graphics.py":3207
 * 
 *         if self.background_color is not None:
 *             svg = '<rect x="%f" y="%f" width="%f" height="%f" style="fill:%s"/>%s' % (             # <<<<<<<<<<<<<<
 *                 xmin,
 *                 ymin,
 */
    __pyx_t_4 = PyTuple_New(12); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3207, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_14 = 0;
    __pyx_t_15 = 127;
    __Pyx_INCREF(__pyx_kp_u_rect_x);
    __pyx_t_14 += 9;
    __Pyx_GIVEREF(__pyx_kp_u_rect_x);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_u_rect_x);

    /* "mathics/builtin/graphics.py":3208
 *         if self.background_color is not None:
 *             svg = '<rect x="%f" y="%f" width="%f" height="%f" style="fill:%s"/>%s' % (
 *                 xmin,             # <<<<<<<<<<<<<<
 *                 ymin,
 *                 w,
 */
    __pyx_t_10 = __Pyx_PyObject_Format(__pyx_cur_scope->__pyx_v_xmin, __pyx_n_u_f); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3208, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_15 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) > __pyx_t_15) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) : __pyx_t_15;
    __pyx_t_14 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10);
    __Pyx_GIVEREF(__pyx_t_10);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_10);
    __pyx_t_10 = 0;
    __Pyx_INCREF(__pyx_kp_u_y_2);
    __pyx_t_14 += 5;
    __Pyx_GIVEREF(__pyx_kp_u_y_2);
    PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_kp_u_y_2);

    /* "mathics/builtin/graphics.py":3209
 *             svg = '<rect x="%f" y="%f" width="%f" height="%f" style="fill:%s"/>%s' % (
 *                 xmin,
 *                 ymin,             # <<<<<<<<<<<<<<
 *                 w,
 *                 h,
 */
    __pyx_t_10 = __Pyx_PyObject_Format(__pyx_cur_scope->__pyx_v_ymin, __pyx_n_u_f); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3209, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_15 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) > __pyx_t_15) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) : __pyx_t_15;
    __pyx_t_14 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10);
    __Pyx_GIVEREF(__pyx_t_10);
    PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_10);
    __pyx_t_10 = 0;
    __Pyx_INCREF(__pyx_kp_u_width);
    __pyx_t_14 += 9;
    __Pyx_GIVEREF(__pyx_kp_u_width);
    PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_kp_u_width);

    /* "mathics/builtin/graphics.py":3210
 *                 xmin,
 *                 ymin,
 *                 w,             # <<<<<<<<<<<<<<
 *                 h,
 *                 self.background_color.to_css()[0],
 */
    __pyx_t_10 = __Pyx_PyObject_Format(__pyx_cur_scope->__pyx_v_w, __pyx_n_u_f); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3210, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_15 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) > __pyx_t_15) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) : __pyx_t_15;
    __pyx_t_14 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10);
    __Pyx_GIVEREF(__pyx_t_10);
    PyTuple_SET_ITEM(__pyx_t_4, 5, __pyx_t_10);
    __pyx_t_10 = 0;
    __Pyx_INCREF(__pyx_kp_u_height);
    __pyx_t_14 += 10;
    __Pyx_GIVEREF(__pyx_kp_u_height);
    PyTuple_SET_ITEM(__pyx_t_4, 6, __pyx_kp_u_height);

    /* "mathics/builtin/graphics.py":3211
 *                 ymin,
 *                 w,
 *                 h,             # <<<<<<<<<<<<<<
 *                 self.background_color.to_css()[0],
 *                 svg,
 */
    __pyx_t_10 = __Pyx_PyObject_Format(__pyx_cur_scope->__pyx_v_h, __pyx_n_u_f); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3211, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_15 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) > __pyx_t_15) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) : __pyx_t_15;
    __pyx_t_14 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10);
    __Pyx_GIVEREF(__pyx_t_10);
    PyTuple_SET_ITEM(__pyx_t_4, 7, __pyx_t_10);
    __pyx_t_10 = 0;
    __Pyx_INCREF(__pyx_kp_u_style_fill);
    __pyx_t_14 += 14;
    __Pyx_GIVEREF(__pyx_kp_u_style_fill);
    PyTuple_SET_ITEM(__pyx_t_4, 8, __pyx_kp_u_style_fill);

    /* "mathics/builtin/graphics.py":3212
 *                 w,
 *                 h,
 *                 self.background_color.to_css()[0],             # <<<<<<<<<<<<<<
 *                 svg,
 *             )
 */
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_background_color); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3212, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_to_css); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3212, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_8, function);
      }
    }
    __pyx_t_10 = (__pyx_t_9) ? __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_9) : __Pyx_PyObject_CallNoArg(__pyx_t_8);
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3212, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_10, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3212, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_10 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_8), __pyx_empty_unicode); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3212, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_15 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) > __pyx_t_15) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) : __pyx_t_15;
    __pyx_t_14 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10);
    __Pyx_GIVEREF(__pyx_t_10);
    PyTuple_SET_ITEM(__pyx_t_4, 9, __pyx_t_10);
    __pyx_t_10 = 0;
    __Pyx_INCREF(__pyx_kp_u__57);
    __pyx_t_14 += 3;
    __Pyx_GIVEREF(__pyx_kp_u__57);
    PyTuple_SET_ITEM(__pyx_t_4, 10, __pyx_kp_u__57);

    /* "mathics/builtin/graphics.py":3213
 *                 h,
 *                 self.background_color.to_css()[0],
 *                 svg,             # <<<<<<<<<<<<<<
 *             )
 * 
 */
    __pyx_t_10 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_svg), __pyx_empty_unicode); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3213, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_15 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) > __pyx_t_15) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) : __pyx_t_15;
    __pyx_t_14 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10);
    __Pyx_GIVEREF(__pyx_t_10);
    PyTuple_SET_ITEM(__pyx_t_4, 11, __pyx_t_10);
    __pyx_t_10 = 0;

    /* "mathics/builtin/graphics.py":3207
 * 
 *         if self.background_color is not None:
 *             svg = '<rect x="%f" y="%f" width="%f" height="%f" style="fill:%s"/>%s' % (             # <<<<<<<<<<<<<<
 *                 xmin,
 *                 ymin,
 */
    __pyx_t_10 = __Pyx_PyUnicode_Join(__pyx_t_4, 12, __pyx_t_14, __pyx_t_15); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3207, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_svg, __pyx_t_10);
    __pyx_t_10 = 0;

    /* "mathics/builtin/graphics.py":3206
 *         svg = elements.to_svg()
 * 
 *         if self.background_color is not None:             # <<<<<<<<<<<<<<
 *             svg = '<rect x="%f" y="%f" width="%f" height="%f" style="fill:%s"/>%s' % (
 *                 xmin,
 */
  }

  /* "mathics/builtin/graphics.py":3216
 *             )
 * 
 *         xmin -= 1             # <<<<<<<<<<<<<<
 *         ymin -= 1
 *         w += 2
 */
  __pyx_t_10 = __Pyx_PyInt_SubtractObjC(__pyx_cur_scope->__pyx_v_xmin, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3216, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_xmin);
  __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_xmin, __pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_10);
  __pyx_t_10 = 0;

  /* "mathics/builtin/graphics.py":3217
 * 
 *         xmin -= 1
 *         ymin -= 1             # <<<<<<<<<<<<<<
 *         w += 2
 *         h += 2
 */
  __pyx_t_10 = __Pyx_PyInt_SubtractObjC(__pyx_cur_scope->__pyx_v_ymin, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_ymin);
  __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_ymin, __pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_10);
  __pyx_t_10 = 0;

  /* "mathics/builtin/graphics.py":3218
 *         xmin -= 1
 *         ymin -= 1
 *         w += 2             # <<<<<<<<<<<<<<
 *         h += 2
 * 
 */
  __pyx_t_10 = __Pyx_PyInt_AddObjC(__pyx_cur_scope->__pyx_v_w, __pyx_int_2, 2, 1, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_w);
  __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_w, __pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_10);
  __pyx_t_10 = 0;

  /* "mathics/builtin/graphics.py":3219
 *         ymin -= 1
 *         w += 2
 *         h += 2             # <<<<<<<<<<<<<<
 * 
 *         svg_xml = """
 */
  __pyx_t_10 = __Pyx_PyInt_AddObjC(__pyx_cur_scope->__pyx_v_h, __pyx_int_2, 2, 1, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3219, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_h);
  __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_h, __pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_10);
  __pyx_t_10 = 0;

  /* "mathics/builtin/graphics.py":3221
 *         h += 2
 * 
 *         svg_xml = """             # <<<<<<<<<<<<<<
 *             <svg xmlns:svg="http://www.w3.org/2000/svg"
 *                 xmlns="http://www.w3.org/2000/svg"
 */
  __pyx_t_10 = PyTuple_New(5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3221, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_14 = 0;
  __pyx_t_15 = 127;
  __Pyx_INCREF(__pyx_kp_u_svg_xmlns_svg_http_www_w3_org_2);
  __pyx_t_14 += 163;
  __Pyx_GIVEREF(__pyx_kp_u_svg_xmlns_svg_http_www_w3_org_2);
  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_kp_u_svg_xmlns_svg_http_www_w3_org_2);

  /* "mathics/builtin/graphics.py":3229
 *             </svg>
 *         """ % (
 *             " ".join("%f" % t for t in (xmin, ymin, w, h)),             # <<<<<<<<<<<<<<
 *             svg,
 *         )
 */
  __pyx_t_4 = __pyx_pf_7mathics_7builtin_8graphics_11GraphicsBox_12boxes_to_xml_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3229, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_8 = __Pyx_Generator_Next(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3229, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyUnicode_Join(__pyx_kp_u__7, __pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3229, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_15 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_15) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_15;
  __pyx_t_14 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_kp_u__142);
  __pyx_t_14 += 19;
  __Pyx_GIVEREF(__pyx_kp_u__142);
  PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_kp_u__142);

  /* "mathics/builtin/graphics.py":3230
 *         """ % (
 *             " ".join("%f" % t for t in (xmin, ymin, w, h)),
 *             svg,             # <<<<<<<<<<<<<<
 *         )
 * 
 */
  __pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_svg), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_15 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_15) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_15;
  __pyx_t_14 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_kp_u_svg_2);
  __pyx_t_14 += 28;
  __Pyx_GIVEREF(__pyx_kp_u_svg_2);
  PyTuple_SET_ITEM(__pyx_t_10, 4, __pyx_kp_u_svg_2);

  /* "mathics/builtin/graphics.py":3221
 *         h += 2
 * 
 *         svg_xml = """             # <<<<<<<<<<<<<<
 *             <svg xmlns:svg="http://www.w3.org/2000/svg"
 *                 xmlns="http://www.w3.org/2000/svg"
 */
  __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_10, 5, __pyx_t_14, __pyx_t_15); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3221, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_v_svg_xml = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":3233
 *         )
 * 
 *         return (             # <<<<<<<<<<<<<<
 *             '<mglyph width="%dpx" height="%dpx" src="data:image/svg+xml;base64,%s"/>'
 *             % (
 */
  __Pyx_XDECREF(__pyx_r);

  /* "mathics/builtin/graphics.py":3234
 * 
 *         return (
 *             '<mglyph width="%dpx" height="%dpx" src="data:image/svg+xml;base64,%s"/>'             # <<<<<<<<<<<<<<
 *             % (
 *                 int(width),
 */
  __pyx_t_4 = PyTuple_New(7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3234, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_14 = 0;
  __pyx_t_15 = 127;
  __Pyx_INCREF(__pyx_kp_u_mglyph_width);
  __pyx_t_14 += 15;
  __Pyx_GIVEREF(__pyx_kp_u_mglyph_width);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_u_mglyph_width);

  /* "mathics/builtin/graphics.py":3236
 *             '<mglyph width="%dpx" height="%dpx" src="data:image/svg+xml;base64,%s"/>'
 *             % (
 *                 int(width),             # <<<<<<<<<<<<<<
 *                 int(height),
 *                 base64.b64encode(svg_xml.encode("utf8")).decode("utf8"),
 */
  __pyx_t_10 = __Pyx_PyNumber_Int(__pyx_v_width); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3236, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_8 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_IntOrLong(__pyx_t_10), __pyx_n_u_d); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3236, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_15 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) > __pyx_t_15) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) : __pyx_t_15;
  __pyx_t_14 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_8);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_8);
  __pyx_t_8 = 0;
  __Pyx_INCREF(__pyx_kp_u_px_height);
  __pyx_t_14 += 12;
  __Pyx_GIVEREF(__pyx_kp_u_px_height);
  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_kp_u_px_height);

  /* "mathics/builtin/graphics.py":3237
 *             % (
 *                 int(width),
 *                 int(height),             # <<<<<<<<<<<<<<
 *                 base64.b64encode(svg_xml.encode("utf8")).decode("utf8"),
 *             )
 */
  __pyx_t_8 = __Pyx_PyNumber_Int(__pyx_v_height); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3237, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_10 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_IntOrLong(__pyx_t_8), __pyx_n_u_d); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3237, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_15 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) > __pyx_t_15) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) : __pyx_t_15;
  __pyx_t_14 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_10);
  PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_10);
  __pyx_t_10 = 0;
  __Pyx_INCREF(__pyx_kp_u_px_src_data_image_svg_xml_base64);
  __pyx_t_14 += 35;
  __Pyx_GIVEREF(__pyx_kp_u_px_src_data_image_svg_xml_base64);
  PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_kp_u_px_src_data_image_svg_xml_base64);

  /* "mathics/builtin/graphics.py":3238
 *                 int(width),
 *                 int(height),
 *                 base64.b64encode(svg_xml.encode("utf8")).decode("utf8"),             # <<<<<<<<<<<<<<
 *             )
 *         )
 */
  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_base64); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_b64encode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = PyUnicode_AsUTF8String(__pyx_v_svg_xml); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
    }
  }
  __pyx_t_8 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_6, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_9);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_decode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
    }
  }
  __pyx_t_10 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_n_u_utf8) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_n_u_utf8);
  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_10), __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_15 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_15) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_15;
  __pyx_t_14 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_4, 5, __pyx_t_7);
  __pyx_t_7 = 0;
  __Pyx_INCREF(__pyx_kp_u__57);
  __pyx_t_14 += 3;
  __Pyx_GIVEREF(__pyx_kp_u__57);
  PyTuple_SET_ITEM(__pyx_t_4, 6, __pyx_kp_u__57);

  /* "mathics/builtin/graphics.py":3234
 * 
 *         return (
 *             '<mglyph width="%dpx" height="%dpx" src="data:image/svg+xml;base64,%s"/>'             # <<<<<<<<<<<<<<
 *             % (
 *                 int(width),
 */
  __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_4, 7, __pyx_t_14, __pyx_t_15); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3234, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":3198
 *         return tex
 * 
 *     def boxes_to_xml(self, leaves, **options):             # <<<<<<<<<<<<<<
 *         elements, calc_dimensions = self._prepare_elements(leaves, options, neg_y=True)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("mathics.builtin.graphics.GraphicsBox.boxes_to_xml", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_elements);
  __Pyx_XDECREF(__pyx_v_calc_dimensions);
  __Pyx_XDECREF(__pyx_v_xmax);
  __Pyx_XDECREF(__pyx_v_ymax);
  __Pyx_XDECREF(__pyx_v_width);
  __Pyx_XDECREF(__pyx_v_height);
  __Pyx_XDECREF(__pyx_v_svg);
  __Pyx_XDECREF(__pyx_v_svg_xml);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":3242
 *         )
 * 
 *     def axis_ticks(self, xmin, xmax):             # <<<<<<<<<<<<<<
 *         def round_to_zero(value):
 *             if value == 0:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_11GraphicsBox_11axis_ticks(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_11GraphicsBox_11axis_ticks = {"axis_ticks", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_11GraphicsBox_11axis_ticks, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_11GraphicsBox_11axis_ticks(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_xmin = 0;
  PyObject *__pyx_v_xmax = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("axis_ticks (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_xmin,&__pyx_n_s_xmax,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xmin)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("axis_ticks", 1, 3, 3, 1); __PYX_ERR(0, 3242, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xmax)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("axis_ticks", 1, 3, 3, 2); __PYX_ERR(0, 3242, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "axis_ticks") < 0)) __PYX_ERR(0, 3242, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_self = values[0];
    __pyx_v_xmin = values[1];
    __pyx_v_xmax = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("axis_ticks", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3242, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.GraphicsBox.axis_ticks", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_11GraphicsBox_10axis_ticks(__pyx_self, __pyx_v_self, __pyx_v_xmin, __pyx_v_xmax);

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

/* "mathics/builtin/graphics.py":3243
 * 
 *     def axis_ticks(self, xmin, xmax):
 *         def round_to_zero(value):             # <<<<<<<<<<<<<<
 *             if value == 0:
 *                 return 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_11GraphicsBox_10axis_ticks_1round_to_zero(PyObject *__pyx_self, PyObject *__pyx_v_value); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_11GraphicsBox_10axis_ticks_1round_to_zero = {"round_to_zero", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_11GraphicsBox_10axis_ticks_1round_to_zero, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_11GraphicsBox_10axis_ticks_1round_to_zero(PyObject *__pyx_self, PyObject *__pyx_v_value) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("round_to_zero (wrapper)", 0);
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_11GraphicsBox_10axis_ticks_round_to_zero(__pyx_self, ((PyObject *)__pyx_v_value));

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_11GraphicsBox_10axis_ticks_round_to_zero(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_value) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("round_to_zero", 0);

  /* "mathics/builtin/graphics.py":3244
 *     def axis_ticks(self, xmin, xmax):
 *         def round_to_zero(value):
 *             if value == 0:             # <<<<<<<<<<<<<<
 *                 return 0
 *             elif value < 0:
 */
  __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_value, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3244, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 3244, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "mathics/builtin/graphics.py":3245
 *         def round_to_zero(value):
 *             if value == 0:
 *                 return 0             # <<<<<<<<<<<<<<
 *             elif value < 0:
 *                 return ceil(value)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_int_0);
    __pyx_r = __pyx_int_0;
    goto __pyx_L0;

    /* "mathics/builtin/graphics.py":3244
 *     def axis_ticks(self, xmin, xmax):
 *         def round_to_zero(value):
 *             if value == 0:             # <<<<<<<<<<<<<<
 *                 return 0
 *             elif value < 0:
 */
  }

  /* "mathics/builtin/graphics.py":3246
 *             if value == 0:
 *                 return 0
 *             elif value < 0:             # <<<<<<<<<<<<<<
 *                 return ceil(value)
 *             else:
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_value, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3246, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 3246, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "mathics/builtin/graphics.py":3247
 *                 return 0
 *             elif value < 0:
 *                 return ceil(value)             # <<<<<<<<<<<<<<
 *             else:
 *                 return floor(value)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ceil); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3247, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_value);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3247, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "mathics/builtin/graphics.py":3246
 *             if value == 0:
 *                 return 0
 *             elif value < 0:             # <<<<<<<<<<<<<<
 *                 return ceil(value)
 *             else:
 */
  }

  /* "mathics/builtin/graphics.py":3249
 *                 return ceil(value)
 *             else:
 *                 return floor(value)             # <<<<<<<<<<<<<<
 * 
 *         def round_step(value):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_floor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3249, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_value);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3249, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
  }

  /* "mathics/builtin/graphics.py":3243
 * 
 *     def axis_ticks(self, xmin, xmax):
 *         def round_to_zero(value):             # <<<<<<<<<<<<<<
 *             if value == 0:
 *                 return 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("mathics.builtin.graphics.GraphicsBox.axis_ticks.round_to_zero", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":3251
 *                 return floor(value)
 * 
 *         def round_step(value):             # <<<<<<<<<<<<<<
 *             if not value:
 *                 return 1, 1
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_11GraphicsBox_10axis_ticks_3round_step(PyObject *__pyx_self, PyObject *__pyx_v_value); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_11GraphicsBox_10axis_ticks_3round_step = {"round_step", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_11GraphicsBox_10axis_ticks_3round_step, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_11GraphicsBox_10axis_ticks_3round_step(PyObject *__pyx_self, PyObject *__pyx_v_value) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("round_step (wrapper)", 0);
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_11GraphicsBox_10axis_ticks_2round_step(__pyx_self, ((PyObject *)__pyx_v_value));

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_11GraphicsBox_10axis_ticks_2round_step(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_value) {
  long __pyx_v_sub_steps;
  PyObject *__pyx_v_shift = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("round_step", 0);
  __Pyx_INCREF(__pyx_v_value);

  /* "mathics/builtin/graphics.py":3252
 * 
 *         def round_step(value):
 *             if not value:             # <<<<<<<<<<<<<<
 *                 return 1, 1
 *             sub_steps = 5
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 3252, __pyx_L1_error)
  __pyx_t_2 = ((!__pyx_t_1) != 0);
  if (__pyx_t_2) {

    /* "mathics/builtin/graphics.py":3253
 *         def round_step(value):
 *             if not value:
 *                 return 1, 1             # <<<<<<<<<<<<<<
 *             sub_steps = 5
 *             try:
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_tuple__29);
    __pyx_r = __pyx_tuple__29;
    goto __pyx_L0;

    /* "mathics/builtin/graphics.py":3252
 * 
 *         def round_step(value):
 *             if not value:             # <<<<<<<<<<<<<<
 *                 return 1, 1
 *             sub_steps = 5
 */
  }

  /* "mathics/builtin/graphics.py":3254
 *             if not value:
 *                 return 1, 1
 *             sub_steps = 5             # <<<<<<<<<<<<<<
 *             try:
 *                 shift = 10.0 ** floor(log10(value))
 */
  __pyx_v_sub_steps = 5;

  /* "mathics/builtin/graphics.py":3255
 *                 return 1, 1
 *             sub_steps = 5
 *             try:             # <<<<<<<<<<<<<<
 *                 shift = 10.0 ** floor(log10(value))
 *             except ValueError:
 */
  {
    __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:*/ {

      /* "mathics/builtin/graphics.py":3256
 *             sub_steps = 5
 *             try:
 *                 shift = 10.0 ** floor(log10(value))             # <<<<<<<<<<<<<<
 *             except ValueError:
 *                 return 1, 1
 */
      __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_floor); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3256, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_log10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3256, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
        if (likely(__pyx_t_10)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_9, function);
        }
      }
      __pyx_t_8 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_10, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_value);
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3256, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_9 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_9)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      __pyx_t_6 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_9, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8);
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3256, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyNumber_Power(__pyx_float_10_0, __pyx_t_6, Py_None); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3256, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_v_shift = __pyx_t_7;
      __pyx_t_7 = 0;

      /* "mathics/builtin/graphics.py":3255
 *                 return 1, 1
 *             sub_steps = 5
 *             try:             # <<<<<<<<<<<<<<
 *                 shift = 10.0 ** floor(log10(value))
 *             except ValueError:
 */
    }
    __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_10); __pyx_t_10 = 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;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "mathics/builtin/graphics.py":3257
 *             try:
 *                 shift = 10.0 ** floor(log10(value))
 *             except ValueError:             # <<<<<<<<<<<<<<
 *                 return 1, 1
 *             value = value / shift
 */
    __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError);
    if (__pyx_t_11) {
      __Pyx_AddTraceback("mathics.builtin.graphics.GraphicsBox.axis_ticks.round_step", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_6, &__pyx_t_8) < 0) __PYX_ERR(0, 3257, __pyx_L6_except_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_8);

      /* "mathics/builtin/graphics.py":3258
 *                 shift = 10.0 ** floor(log10(value))
 *             except ValueError:
 *                 return 1, 1             # <<<<<<<<<<<<<<
 *             value = value / shift
 *             if value < 1.5:
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_tuple__29);
      __pyx_r = __pyx_tuple__29;
      __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;
      goto __pyx_L7_except_return;
    }
    goto __pyx_L6_except_error;
    __pyx_L6_except_error:;

    /* "mathics/builtin/graphics.py":3255
 *                 return 1, 1
 *             sub_steps = 5
 *             try:             # <<<<<<<<<<<<<<
 *                 shift = 10.0 ** floor(log10(value))
 *             except ValueError:
 */
    __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:;
  }

  /* "mathics/builtin/graphics.py":3259
 *             except ValueError:
 *                 return 1, 1
 *             value = value / shift             # <<<<<<<<<<<<<<
 *             if value < 1.5:
 *                 value = 1
 */
  __pyx_t_8 = __Pyx_PyNumber_Divide(__pyx_v_value, __pyx_v_shift); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3259, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
  __pyx_t_8 = 0;

  /* "mathics/builtin/graphics.py":3260
 *                 return 1, 1
 *             value = value / shift
 *             if value < 1.5:             # <<<<<<<<<<<<<<
 *                 value = 1
 *             elif value < 3:
 */
  __pyx_t_8 = PyObject_RichCompare(__pyx_v_value, __pyx_float_1_5, Py_LT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3260, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 3260, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (__pyx_t_2) {

    /* "mathics/builtin/graphics.py":3261
 *             value = value / shift
 *             if value < 1.5:
 *                 value = 1             # <<<<<<<<<<<<<<
 *             elif value < 3:
 *                 value = 2
 */
    __Pyx_INCREF(__pyx_int_1);
    __Pyx_DECREF_SET(__pyx_v_value, __pyx_int_1);

    /* "mathics/builtin/graphics.py":3260
 *                 return 1, 1
 *             value = value / shift
 *             if value < 1.5:             # <<<<<<<<<<<<<<
 *                 value = 1
 *             elif value < 3:
 */
    goto __pyx_L12;
  }

  /* "mathics/builtin/graphics.py":3262
 *             if value < 1.5:
 *                 value = 1
 *             elif value < 3:             # <<<<<<<<<<<<<<
 *                 value = 2
 *                 sub_steps = 4
 */
  __pyx_t_8 = PyObject_RichCompare(__pyx_v_value, __pyx_int_3, Py_LT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3262, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 3262, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (__pyx_t_2) {

    /* "mathics/builtin/graphics.py":3263
 *                 value = 1
 *             elif value < 3:
 *                 value = 2             # <<<<<<<<<<<<<<
 *                 sub_steps = 4
 *             elif value < 8:
 */
    __Pyx_INCREF(__pyx_int_2);
    __Pyx_DECREF_SET(__pyx_v_value, __pyx_int_2);

    /* "mathics/builtin/graphics.py":3264
 *             elif value < 3:
 *                 value = 2
 *                 sub_steps = 4             # <<<<<<<<<<<<<<
 *             elif value < 8:
 *                 value = 5
 */
    __pyx_v_sub_steps = 4;

    /* "mathics/builtin/graphics.py":3262
 *             if value < 1.5:
 *                 value = 1
 *             elif value < 3:             # <<<<<<<<<<<<<<
 *                 value = 2
 *                 sub_steps = 4
 */
    goto __pyx_L12;
  }

  /* "mathics/builtin/graphics.py":3265
 *                 value = 2
 *                 sub_steps = 4
 *             elif value < 8:             # <<<<<<<<<<<<<<
 *                 value = 5
 *             else:
 */
  __pyx_t_8 = PyObject_RichCompare(__pyx_v_value, __pyx_int_8, Py_LT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3265, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 3265, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (__pyx_t_2) {

    /* "mathics/builtin/graphics.py":3266
 *                 sub_steps = 4
 *             elif value < 8:
 *                 value = 5             # <<<<<<<<<<<<<<
 *             else:
 *                 value = 10
 */
    __Pyx_INCREF(__pyx_int_5);
    __Pyx_DECREF_SET(__pyx_v_value, __pyx_int_5);

    /* "mathics/builtin/graphics.py":3265
 *                 value = 2
 *                 sub_steps = 4
 *             elif value < 8:             # <<<<<<<<<<<<<<
 *                 value = 5
 *             else:
 */
    goto __pyx_L12;
  }

  /* "mathics/builtin/graphics.py":3268
 *                 value = 5
 *             else:
 *                 value = 10             # <<<<<<<<<<<<<<
 *             return value * shift, sub_steps
 * 
 */
  /*else*/ {
    __Pyx_INCREF(__pyx_int_10);
    __Pyx_DECREF_SET(__pyx_v_value, __pyx_int_10);
  }
  __pyx_L12:;

  /* "mathics/builtin/graphics.py":3269
 *             else:
 *                 value = 10
 *             return value * shift, sub_steps             # <<<<<<<<<<<<<<
 * 
 *         step_x, sub_x = round_step((xmax - xmin) / 5.0)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_8 = PyNumber_Multiply(__pyx_v_value, __pyx_v_shift); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3269, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_6 = __Pyx_PyInt_From_long(__pyx_v_sub_steps); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3269, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3269, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_8);
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6);
  __pyx_t_8 = 0;
  __pyx_t_6 = 0;
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":3251
 *                 return floor(value)
 * 
 *         def round_step(value):             # <<<<<<<<<<<<<<
 *             if not value:
 *                 return 1, 1
 */

  /* 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_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("mathics.builtin.graphics.GraphicsBox.axis_ticks.round_step", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_shift);
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":3242
 *         )
 * 
 *     def axis_ticks(self, xmin, xmax):             # <<<<<<<<<<<<<<
 *         def round_to_zero(value):
 *             if value == 0:
 */

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_11GraphicsBox_10axis_ticks(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_xmin, PyObject *__pyx_v_xmax) {
  CYTHON_UNUSED PyObject *__pyx_v_round_to_zero = 0;
  PyObject *__pyx_v_round_step = 0;
  PyObject *__pyx_v_step_x = NULL;
  PyObject *__pyx_v_sub_x = NULL;
  PyObject *__pyx_v_step_x_small = NULL;
  PyObject *__pyx_v_steps_x = NULL;
  PyObject *__pyx_v_steps_x_small = NULL;
  PyObject *__pyx_v_start_k_x = NULL;
  PyObject *__pyx_v_start_k_x_small = NULL;
  PyObject *__pyx_v_origin_k_x = NULL;
  PyObject *__pyx_v_origin_x = NULL;
  PyObject *__pyx_v_ticks = NULL;
  PyObject *__pyx_v_ticks_small = NULL;
  PyObject *__pyx_v_k = NULL;
  PyObject *__pyx_v_x = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *(*__pyx_t_5)(PyObject *);
  int __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  int __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("axis_ticks", 0);

  /* "mathics/builtin/graphics.py":3243
 * 
 *     def axis_ticks(self, xmin, xmax):
 *         def round_to_zero(value):             # <<<<<<<<<<<<<<
 *             if value == 0:
 *                 return 0
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_11GraphicsBox_10axis_ticks_1round_to_zero, 0, __pyx_n_s_GraphicsBox_axis_ticks_locals_ro, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__144)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3243, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_round_to_zero = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":3251
 *                 return floor(value)
 * 
 *         def round_step(value):             # <<<<<<<<<<<<<<
 *             if not value:
 *                 return 1, 1
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_11GraphicsBox_10axis_ticks_3round_step, 0, __pyx_n_s_GraphicsBox_axis_ticks_locals_ro_2, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__146)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3251, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_round_step = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":3271
 *             return value * shift, sub_steps
 * 
 *         step_x, sub_x = round_step((xmax - xmin) / 5.0)             # <<<<<<<<<<<<<<
 *         step_x_small = step_x / sub_x
 *         steps_x = int(floor((xmax - xmin) / step_x))
 */
  __pyx_t_1 = PyNumber_Subtract(__pyx_v_xmax, __pyx_v_xmin); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3271, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyFloat_TrueDivideObjC(__pyx_t_1, __pyx_float_5_0, 5.0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3271, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __pyx_pf_7mathics_7builtin_8graphics_11GraphicsBox_10axis_ticks_2round_step(__pyx_v_round_step, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3271, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
    PyObject* sequence = __pyx_t_1;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 3271, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_3);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3271, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3271, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3271, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) __PYX_ERR(0, 3271, __pyx_L1_error)
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 3271, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  __pyx_v_step_x = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_v_sub_x = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":3272
 * 
 *         step_x, sub_x = round_step((xmax - xmin) / 5.0)
 *         step_x_small = step_x / sub_x             # <<<<<<<<<<<<<<
 *         steps_x = int(floor((xmax - xmin) / step_x))
 *         steps_x_small = int(floor((xmax - xmin) / step_x_small))
 */
  __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_v_step_x, __pyx_v_sub_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3272, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_step_x_small = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":3273
 *         step_x, sub_x = round_step((xmax - xmin) / 5.0)
 *         step_x_small = step_x / sub_x
 *         steps_x = int(floor((xmax - xmin) / step_x))             # <<<<<<<<<<<<<<
 *         steps_x_small = int(floor((xmax - xmin) / step_x_small))
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_floor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3273, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyNumber_Subtract(__pyx_v_xmax, __pyx_v_xmin); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3273, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyNumber_Divide(__pyx_t_2, __pyx_v_step_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3273, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3273, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3273, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_steps_x = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":3274
 *         step_x_small = step_x / sub_x
 *         steps_x = int(floor((xmax - xmin) / step_x))
 *         steps_x_small = int(floor((xmax - xmin) / step_x_small))             # <<<<<<<<<<<<<<
 * 
 *         start_k_x = int(ceil(xmin / step_x))
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_floor); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3274, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyNumber_Subtract(__pyx_v_xmax, __pyx_v_xmin); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3274, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_4, __pyx_v_step_x_small); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3274, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3274, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyNumber_Int(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3274, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_steps_x_small = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":3276
 *         steps_x_small = int(floor((xmax - xmin) / step_x_small))
 * 
 *         start_k_x = int(ceil(xmin / step_x))             # <<<<<<<<<<<<<<
 *         start_k_x_small = int(ceil(xmin / step_x_small))
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ceil); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3276, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_v_xmin, __pyx_v_step_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3276, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3276, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3276, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_start_k_x = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":3277
 * 
 *         start_k_x = int(ceil(xmin / step_x))
 *         start_k_x_small = int(ceil(xmin / step_x_small))             # <<<<<<<<<<<<<<
 * 
 *         if xmin <= 0 <= xmax:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ceil); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3277, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_v_xmin, __pyx_v_step_x_small); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3277, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3277, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyNumber_Int(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3277, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_start_k_x_small = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":3279
 *         start_k_x_small = int(ceil(xmin / step_x_small))
 * 
 *         if xmin <= 0 <= xmax:             # <<<<<<<<<<<<<<
 *             origin_k_x = 0
 *         else:
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_xmin, __pyx_int_0, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3279, __pyx_L1_error)
  if (__Pyx_PyObject_IsTrue(__pyx_t_1)) {
    __Pyx_DECREF(__pyx_t_1);
    __pyx_t_1 = PyObject_RichCompare(__pyx_int_0, __pyx_v_xmax, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3279, __pyx_L1_error)
  }
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 3279, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_6) {

    /* "mathics/builtin/graphics.py":3280
 * 
 *         if xmin <= 0 <= xmax:
 *             origin_k_x = 0             # <<<<<<<<<<<<<<
 *         else:
 *             origin_k_x = start_k_x
 */
    __Pyx_INCREF(__pyx_int_0);
    __pyx_v_origin_k_x = __pyx_int_0;

    /* "mathics/builtin/graphics.py":3279
 *         start_k_x_small = int(ceil(xmin / step_x_small))
 * 
 *         if xmin <= 0 <= xmax:             # <<<<<<<<<<<<<<
 *             origin_k_x = 0
 *         else:
 */
    goto __pyx_L5;
  }

  /* "mathics/builtin/graphics.py":3282
 *             origin_k_x = 0
 *         else:
 *             origin_k_x = start_k_x             # <<<<<<<<<<<<<<
 *         origin_x = origin_k_x * step_x
 * 
 */
  /*else*/ {
    __Pyx_INCREF(__pyx_v_start_k_x);
    __pyx_v_origin_k_x = __pyx_v_start_k_x;
  }
  __pyx_L5:;

  /* "mathics/builtin/graphics.py":3283
 *         else:
 *             origin_k_x = start_k_x
 *         origin_x = origin_k_x * step_x             # <<<<<<<<<<<<<<
 * 
 *         ticks = []
 */
  __pyx_t_1 = PyNumber_Multiply(__pyx_v_origin_k_x, __pyx_v_step_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3283, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_origin_x = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":3285
 *         origin_x = origin_k_x * step_x
 * 
 *         ticks = []             # <<<<<<<<<<<<<<
 *         ticks_small = []
 *         for k in range(start_k_x, start_k_x + steps_x + 1):
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3285, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_ticks = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":3286
 * 
 *         ticks = []
 *         ticks_small = []             # <<<<<<<<<<<<<<
 *         for k in range(start_k_x, start_k_x + steps_x + 1):
 *             if k != origin_k_x:
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3286, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_ticks_small = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":3287
 *         ticks = []
 *         ticks_small = []
 *         for k in range(start_k_x, start_k_x + steps_x + 1):             # <<<<<<<<<<<<<<
 *             if k != origin_k_x:
 *                 x = k * step_x
 */
  __pyx_t_1 = PyNumber_Add(__pyx_v_start_k_x, __pyx_v_steps_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3287, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3287, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3287, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_start_k_x);
  __Pyx_GIVEREF(__pyx_v_start_k_x);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_start_k_x);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3287, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
    __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); __pyx_t_7 = 0;
    __pyx_t_8 = NULL;
  } else {
    __pyx_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3287, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3287, __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))) {
        if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 3287, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3287, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      } else {
        if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 3287, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3287, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      }
    } else {
      __pyx_t_3 = __pyx_t_8(__pyx_t_1);
      if (unlikely(!__pyx_t_3)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 3287, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "mathics/builtin/graphics.py":3288
 *         ticks_small = []
 *         for k in range(start_k_x, start_k_x + steps_x + 1):
 *             if k != origin_k_x:             # <<<<<<<<<<<<<<
 *                 x = k * step_x
 *                 if x > xmax:
 */
    __pyx_t_3 = PyObject_RichCompare(__pyx_v_k, __pyx_v_origin_k_x, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3288, __pyx_L1_error)
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 3288, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_6) {

      /* "mathics/builtin/graphics.py":3289
 *         for k in range(start_k_x, start_k_x + steps_x + 1):
 *             if k != origin_k_x:
 *                 x = k * step_x             # <<<<<<<<<<<<<<
 *                 if x > xmax:
 *                     break
 */
      __pyx_t_3 = PyNumber_Multiply(__pyx_v_k, __pyx_v_step_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3289, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "mathics/builtin/graphics.py":3290
 *             if k != origin_k_x:
 *                 x = k * step_x
 *                 if x > xmax:             # <<<<<<<<<<<<<<
 *                     break
 *                 ticks.append(x)
 */
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_x, __pyx_v_xmax, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3290, __pyx_L1_error)
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 3290, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {

        /* "mathics/builtin/graphics.py":3291
 *                 x = k * step_x
 *                 if x > xmax:
 *                     break             # <<<<<<<<<<<<<<
 *                 ticks.append(x)
 *         for k in range(start_k_x_small, start_k_x_small + steps_x_small + 1):
 */
        goto __pyx_L7_break;

        /* "mathics/builtin/graphics.py":3290
 *             if k != origin_k_x:
 *                 x = k * step_x
 *                 if x > xmax:             # <<<<<<<<<<<<<<
 *                     break
 *                 ticks.append(x)
 */
      }

      /* "mathics/builtin/graphics.py":3292
 *                 if x > xmax:
 *                     break
 *                 ticks.append(x)             # <<<<<<<<<<<<<<
 *         for k in range(start_k_x_small, start_k_x_small + steps_x_small + 1):
 *             if k % sub_x != 0:
 */
      __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_ticks, __pyx_v_x); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 3292, __pyx_L1_error)

      /* "mathics/builtin/graphics.py":3288
 *         ticks_small = []
 *         for k in range(start_k_x, start_k_x + steps_x + 1):
 *             if k != origin_k_x:             # <<<<<<<<<<<<<<
 *                 x = k * step_x
 *                 if x > xmax:
 */
    }

    /* "mathics/builtin/graphics.py":3287
 *         ticks = []
 *         ticks_small = []
 *         for k in range(start_k_x, start_k_x + steps_x + 1):             # <<<<<<<<<<<<<<
 *             if k != origin_k_x:
 *                 x = k * step_x
 */
  }
  __pyx_L7_break:;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":3293
 *                     break
 *                 ticks.append(x)
 *         for k in range(start_k_x_small, start_k_x_small + steps_x_small + 1):             # <<<<<<<<<<<<<<
 *             if k % sub_x != 0:
 *                 x = k * step_x_small
 */
  __pyx_t_1 = PyNumber_Add(__pyx_v_start_k_x_small, __pyx_v_steps_x_small); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3293, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3293, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3293, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_start_k_x_small);
  __Pyx_GIVEREF(__pyx_v_start_k_x_small);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_start_k_x_small);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3293, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
    __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); __pyx_t_7 = 0;
    __pyx_t_8 = NULL;
  } else {
    __pyx_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3293, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3293, __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))) {
        if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 3293, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3293, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      } else {
        if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 3293, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3293, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      }
    } else {
      __pyx_t_3 = __pyx_t_8(__pyx_t_1);
      if (unlikely(!__pyx_t_3)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 3293, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "mathics/builtin/graphics.py":3294
 *                 ticks.append(x)
 *         for k in range(start_k_x_small, start_k_x_small + steps_x_small + 1):
 *             if k % sub_x != 0:             # <<<<<<<<<<<<<<
 *                 x = k * step_x_small
 *                 if x > xmax:
 */
    __pyx_t_3 = PyNumber_Remainder(__pyx_v_k, __pyx_v_sub_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3294, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyInt_NeObjC(__pyx_t_3, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3294, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 3294, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_6) {

      /* "mathics/builtin/graphics.py":3295
 *         for k in range(start_k_x_small, start_k_x_small + steps_x_small + 1):
 *             if k % sub_x != 0:
 *                 x = k * step_x_small             # <<<<<<<<<<<<<<
 *                 if x > xmax:
 *                     break
 */
      __pyx_t_2 = PyNumber_Multiply(__pyx_v_k, __pyx_v_step_x_small); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3295, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "mathics/builtin/graphics.py":3296
 *             if k % sub_x != 0:
 *                 x = k * step_x_small
 *                 if x > xmax:             # <<<<<<<<<<<<<<
 *                     break
 *                 ticks_small.append(x)
 */
      __pyx_t_2 = PyObject_RichCompare(__pyx_v_x, __pyx_v_xmax, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3296, __pyx_L1_error)
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 3296, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (__pyx_t_6) {

        /* "mathics/builtin/graphics.py":3297
 *                 x = k * step_x_small
 *                 if x > xmax:
 *                     break             # <<<<<<<<<<<<<<
 *                 ticks_small.append(x)
 * 
 */
        goto __pyx_L11_break;

        /* "mathics/builtin/graphics.py":3296
 *             if k % sub_x != 0:
 *                 x = k * step_x_small
 *                 if x > xmax:             # <<<<<<<<<<<<<<
 *                     break
 *                 ticks_small.append(x)
 */
      }

      /* "mathics/builtin/graphics.py":3298
 *                 if x > xmax:
 *                     break
 *                 ticks_small.append(x)             # <<<<<<<<<<<<<<
 * 
 *         return ticks, ticks_small, origin_x
 */
      __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_ticks_small, __pyx_v_x); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 3298, __pyx_L1_error)

      /* "mathics/builtin/graphics.py":3294
 *                 ticks.append(x)
 *         for k in range(start_k_x_small, start_k_x_small + steps_x_small + 1):
 *             if k % sub_x != 0:             # <<<<<<<<<<<<<<
 *                 x = k * step_x_small
 *                 if x > xmax:
 */
    }

    /* "mathics/builtin/graphics.py":3293
 *                     break
 *                 ticks.append(x)
 *         for k in range(start_k_x_small, start_k_x_small + steps_x_small + 1):             # <<<<<<<<<<<<<<
 *             if k % sub_x != 0:
 *                 x = k * step_x_small
 */
  }
  __pyx_L11_break:;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":3300
 *                 ticks_small.append(x)
 * 
 *         return ticks, ticks_small, origin_x             # <<<<<<<<<<<<<<
 * 
 *     def create_axes(self, elements, graphics_options, xmin, xmax, ymin, ymax):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3300, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_ticks);
  __Pyx_GIVEREF(__pyx_v_ticks);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_ticks);
  __Pyx_INCREF(__pyx_v_ticks_small);
  __Pyx_GIVEREF(__pyx_v_ticks_small);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_ticks_small);
  __Pyx_INCREF(__pyx_v_origin_x);
  __Pyx_GIVEREF(__pyx_v_origin_x);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_origin_x);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":3242
 *         )
 * 
 *     def axis_ticks(self, xmin, xmax):             # <<<<<<<<<<<<<<
 *         def round_to_zero(value):
 *             if value == 0:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("mathics.builtin.graphics.GraphicsBox.axis_ticks", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_round_to_zero);
  __Pyx_XDECREF(__pyx_v_round_step);
  __Pyx_XDECREF(__pyx_v_step_x);
  __Pyx_XDECREF(__pyx_v_sub_x);
  __Pyx_XDECREF(__pyx_v_step_x_small);
  __Pyx_XDECREF(__pyx_v_steps_x);
  __Pyx_XDECREF(__pyx_v_steps_x_small);
  __Pyx_XDECREF(__pyx_v_start_k_x);
  __Pyx_XDECREF(__pyx_v_start_k_x_small);
  __Pyx_XDECREF(__pyx_v_origin_k_x);
  __Pyx_XDECREF(__pyx_v_origin_x);
  __Pyx_XDECREF(__pyx_v_ticks);
  __Pyx_XDECREF(__pyx_v_ticks_small);
  __Pyx_XDECREF(__pyx_v_k);
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":3302
 *         return ticks, ticks_small, origin_x
 * 
 *     def create_axes(self, elements, graphics_options, xmin, xmax, ymin, ymax):             # <<<<<<<<<<<<<<
 *         axes = graphics_options.get("System`Axes")
 *         if axes.is_true():
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_11GraphicsBox_13create_axes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_11GraphicsBox_13create_axes = {"create_axes", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_11GraphicsBox_13create_axes, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_11GraphicsBox_13create_axes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_elements = 0;
  PyObject *__pyx_v_graphics_options = 0;
  PyObject *__pyx_v_xmin = 0;
  PyObject *__pyx_v_xmax = 0;
  PyObject *__pyx_v_ymin = 0;
  PyObject *__pyx_v_ymax = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("create_axes (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_elements,&__pyx_n_s_graphics_options,&__pyx_n_s_xmin,&__pyx_n_s_xmax,&__pyx_n_s_ymin,&__pyx_n_s_ymax,0};
    PyObject* values[7] = {0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elements)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("create_axes", 1, 7, 7, 1); __PYX_ERR(0, 3302, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_graphics_options)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("create_axes", 1, 7, 7, 2); __PYX_ERR(0, 3302, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xmin)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("create_axes", 1, 7, 7, 3); __PYX_ERR(0, 3302, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xmax)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("create_axes", 1, 7, 7, 4); __PYX_ERR(0, 3302, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ymin)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("create_axes", 1, 7, 7, 5); __PYX_ERR(0, 3302, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ymax)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("create_axes", 1, 7, 7, 6); __PYX_ERR(0, 3302, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "create_axes") < 0)) __PYX_ERR(0, 3302, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 7) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
    }
    __pyx_v_self = values[0];
    __pyx_v_elements = values[1];
    __pyx_v_graphics_options = values[2];
    __pyx_v_xmin = values[3];
    __pyx_v_xmax = values[4];
    __pyx_v_ymin = values[5];
    __pyx_v_ymax = values[6];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("create_axes", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3302, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.GraphicsBox.create_axes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_11GraphicsBox_12create_axes(__pyx_self, __pyx_v_self, __pyx_v_elements, __pyx_v_graphics_options, __pyx_v_xmin, __pyx_v_xmax, __pyx_v_ymin, __pyx_v_ymax);

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

/* "mathics/builtin/graphics.py":3328
 *         ticks_style[1].extend(axes_style[1])
 * 
 *         def add_element(element):             # <<<<<<<<<<<<<<
 *             element.is_completely_visible = True
 *             elements.elements.append(element)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_11GraphicsBox_11create_axes_1add_element(PyObject *__pyx_self, PyObject *__pyx_v_element); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_11GraphicsBox_11create_axes_1add_element = {"add_element", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_11GraphicsBox_11create_axes_1add_element, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_11GraphicsBox_11create_axes_1add_element(PyObject *__pyx_self, PyObject *__pyx_v_element) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add_element (wrapper)", 0);
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_11GraphicsBox_11create_axes_add_element(__pyx_self, ((PyObject *)__pyx_v_element));

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_11GraphicsBox_11create_axes_add_element(PyObject *__pyx_self, PyObject *__pyx_v_element) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_85_create_axes *__pyx_cur_scope;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_85_create_axes *__pyx_outer_scope;
  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_element", 0);
  __pyx_outer_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_85_create_axes *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "mathics/builtin/graphics.py":3329
 * 
 *         def add_element(element):
 *             element.is_completely_visible = True             # <<<<<<<<<<<<<<
 *             elements.elements.append(element)
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_element, __pyx_n_s_is_completely_visible, Py_True) < 0) __PYX_ERR(0, 3329, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":3330
 *         def add_element(element):
 *             element.is_completely_visible = True
 *             elements.elements.append(element)             # <<<<<<<<<<<<<<
 * 
 *         ticks_x, ticks_x_small, origin_x = self.axis_ticks(xmin, xmax)
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_elements)) { __Pyx_RaiseClosureNameError("elements"); __PYX_ERR(0, 3330, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_elements, __pyx_n_s_elements); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3330, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_v_element); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 3330, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":3328
 *         ticks_style[1].extend(axes_style[1])
 * 
 *         def add_element(element):             # <<<<<<<<<<<<<<
 *             element.is_completely_visible = True
 *             elements.elements.append(element)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("mathics.builtin.graphics.GraphicsBox.create_axes.add_element", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7mathics_7builtin_8graphics_11GraphicsBox_11create_axes_4generator52(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "mathics/builtin/graphics.py":3340
 *         tick_label_d = 2
 * 
 *         ticks_x_int = all(floor(x) == x for x in ticks_x)             # <<<<<<<<<<<<<<
 *         ticks_y_int = all(floor(x) == x for x in ticks_y)
 * 
 */

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_11GraphicsBox_11create_axes_2genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_86_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_7mathics_7builtin_8graphics___pyx_scope_struct_86_genexpr *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_86_genexpr(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_86_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_86_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 3340, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_85_create_axes *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7mathics_7builtin_8graphics_11GraphicsBox_11create_axes_4generator52, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_GraphicsBox_create_axes_locals_g, __pyx_n_s_mathics_builtin_graphics); if (unlikely(!gen)) __PYX_ERR(0, 3340, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.GraphicsBox.create_axes.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_7mathics_7builtin_8graphics_11GraphicsBox_11create_axes_4generator52(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_86_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_86_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 3340, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_ticks_x)) { __Pyx_RaiseClosureNameError("ticks_x"); __PYX_ERR(0, 3340, __pyx_L1_error) }
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_ticks_x)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_ticks_x)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_ticks_x; __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_outer_scope->__pyx_v_ticks_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3340, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3340, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 3340, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3340, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 3340, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3340, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 3340, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_x);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_x, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_floor); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3340, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_cur_scope->__pyx_v_x) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_cur_scope->__pyx_v_x);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3340, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_cur_scope->__pyx_v_x, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3340, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 3340, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_8 = ((!__pyx_t_7) != 0);
    if (__pyx_t_8) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_False);
      __pyx_r = Py_False;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
  }
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_True);
    __pyx_r = Py_True;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7mathics_7builtin_8graphics_11GraphicsBox_11create_axes_7generator53(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "mathics/builtin/graphics.py":3341
 * 
 *         ticks_x_int = all(floor(x) == x for x in ticks_x)
 *         ticks_y_int = all(floor(x) == x for x in ticks_y)             # <<<<<<<<<<<<<<
 * 
 *         for index, (
 */

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_11GraphicsBox_11create_axes_5genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_87_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_7mathics_7builtin_8graphics___pyx_scope_struct_87_genexpr *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_87_genexpr(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_87_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_87_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 3341, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_85_create_axes *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7mathics_7builtin_8graphics_11GraphicsBox_11create_axes_7generator53, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_GraphicsBox_create_axes_locals_g, __pyx_n_s_mathics_builtin_graphics); if (unlikely(!gen)) __PYX_ERR(0, 3341, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.GraphicsBox.create_axes.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_7mathics_7builtin_8graphics_11GraphicsBox_11create_axes_7generator53(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_87_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_87_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 3341, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_ticks_y)) { __Pyx_RaiseClosureNameError("ticks_y"); __PYX_ERR(0, 3341, __pyx_L1_error) }
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_ticks_y)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_ticks_y)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_ticks_y; __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_outer_scope->__pyx_v_ticks_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3341, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3341, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 3341, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3341, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 3341, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3341, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 3341, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_x);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_x, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_floor); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3341, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_cur_scope->__pyx_v_x) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_cur_scope->__pyx_v_x);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3341, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_cur_scope->__pyx_v_x, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3341, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 3341, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_8 = ((!__pyx_t_7) != 0);
    if (__pyx_t_8) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_False);
      __pyx_r = Py_False;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
  }
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_True);
    __pyx_r = Py_True;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

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

/* "mathics/builtin/graphics.py":3357
 *                     xmin,
 *                     xmax,
 *                     lambda y: (0, y),             # <<<<<<<<<<<<<<
 *                     lambda x: (x, 0),
 *                     lambda x: (x, origin_y),
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_11GraphicsBox_11create_axes_8lambda37(PyObject *__pyx_self, PyObject *__pyx_v_y); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_11GraphicsBox_11create_axes_8lambda37 = {"lambda37", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_11GraphicsBox_11create_axes_8lambda37, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_11GraphicsBox_11create_axes_8lambda37(PyObject *__pyx_self, PyObject *__pyx_v_y) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda37 (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_lambda37(__pyx_self, ((PyObject *)__pyx_v_y));

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

static PyObject *__pyx_lambda_funcdef_lambda37(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_y) {
  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("lambda37", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3357, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_int_0);
  __Pyx_INCREF(__pyx_v_y);
  __Pyx_GIVEREF(__pyx_v_y);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_y);
  __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("mathics.builtin.graphics.GraphicsBox.create_axes.lambda37", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":3358
 *                     xmax,
 *                     lambda y: (0, y),
 *                     lambda x: (x, 0),             # <<<<<<<<<<<<<<
 *                     lambda x: (x, origin_y),
 *                     ticks_x,
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_11GraphicsBox_11create_axes_9lambda38(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_11GraphicsBox_11create_axes_9lambda38 = {"lambda38", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_11GraphicsBox_11create_axes_9lambda38, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_11GraphicsBox_11create_axes_9lambda38(PyObject *__pyx_self, PyObject *__pyx_v_x) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda38 (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_lambda38(__pyx_self, ((PyObject *)__pyx_v_x));

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

static PyObject *__pyx_lambda_funcdef_lambda38(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x) {
  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("lambda38", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3358, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_x);
  __Pyx_GIVEREF(__pyx_v_x);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_x);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_0);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("mathics.builtin.graphics.GraphicsBox.create_axes.lambda38", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":3359
 *                     lambda y: (0, y),
 *                     lambda x: (x, 0),
 *                     lambda x: (x, origin_y),             # <<<<<<<<<<<<<<
 *                     ticks_x,
 *                     ticks_x_small,
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_11GraphicsBox_11create_axes_10lambda39(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_11GraphicsBox_11create_axes_10lambda39 = {"lambda39", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_11GraphicsBox_11create_axes_10lambda39, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_11GraphicsBox_11create_axes_10lambda39(PyObject *__pyx_self, PyObject *__pyx_v_x) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda39 (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_lambda39(__pyx_self, ((PyObject *)__pyx_v_x));

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

static PyObject *__pyx_lambda_funcdef_lambda39(PyObject *__pyx_self, PyObject *__pyx_v_x) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_85_create_axes *__pyx_cur_scope;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_85_create_axes *__pyx_outer_scope;
  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("lambda39", 0);
  __pyx_outer_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_85_create_axes *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_origin_y)) { __Pyx_RaiseClosureNameError("origin_y"); __PYX_ERR(0, 3359, __pyx_L1_error) }
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3359, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_x);
  __Pyx_GIVEREF(__pyx_v_x);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_x);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_origin_y);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_origin_y);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_cur_scope->__pyx_v_origin_y);
  __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("mathics.builtin.graphics.GraphicsBox.create_axes.lambda39", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":3367
 *                     ymin,
 *                     ymax,
 *                     lambda x: (x, 0),             # <<<<<<<<<<<<<<
 *                     lambda y: (0, y),
 *                     lambda y: (origin_x, y),
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_11GraphicsBox_11create_axes_11lambda40(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_11GraphicsBox_11create_axes_11lambda40 = {"lambda40", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_11GraphicsBox_11create_axes_11lambda40, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_11GraphicsBox_11create_axes_11lambda40(PyObject *__pyx_self, PyObject *__pyx_v_x) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda40 (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_lambda40(__pyx_self, ((PyObject *)__pyx_v_x));

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

static PyObject *__pyx_lambda_funcdef_lambda40(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x) {
  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("lambda40", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3367, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_x);
  __Pyx_GIVEREF(__pyx_v_x);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_x);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_0);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("mathics.builtin.graphics.GraphicsBox.create_axes.lambda40", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":3368
 *                     ymax,
 *                     lambda x: (x, 0),
 *                     lambda y: (0, y),             # <<<<<<<<<<<<<<
 *                     lambda y: (origin_x, y),
 *                     ticks_y,
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_11GraphicsBox_11create_axes_12lambda41(PyObject *__pyx_self, PyObject *__pyx_v_y); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_11GraphicsBox_11create_axes_12lambda41 = {"lambda41", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_11GraphicsBox_11create_axes_12lambda41, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_11GraphicsBox_11create_axes_12lambda41(PyObject *__pyx_self, PyObject *__pyx_v_y) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda41 (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_lambda41(__pyx_self, ((PyObject *)__pyx_v_y));

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

static PyObject *__pyx_lambda_funcdef_lambda41(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_y) {
  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("lambda41", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3368, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_int_0);
  __Pyx_INCREF(__pyx_v_y);
  __Pyx_GIVEREF(__pyx_v_y);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_y);
  __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("mathics.builtin.graphics.GraphicsBox.create_axes.lambda41", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":3369
 *                     lambda x: (x, 0),
 *                     lambda y: (0, y),
 *                     lambda y: (origin_x, y),             # <<<<<<<<<<<<<<
 *                     ticks_y,
 *                     ticks_y_small,
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_11GraphicsBox_11create_axes_13lambda42(PyObject *__pyx_self, PyObject *__pyx_v_y); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_11GraphicsBox_11create_axes_13lambda42 = {"lambda42", (PyCFunction)__pyx_pw_7mathics_7builtin_8graphics_11GraphicsBox_11create_axes_13lambda42, METH_O, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_11GraphicsBox_11create_axes_13lambda42(PyObject *__pyx_self, PyObject *__pyx_v_y) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda42 (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_lambda42(__pyx_self, ((PyObject *)__pyx_v_y));

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

static PyObject *__pyx_lambda_funcdef_lambda42(PyObject *__pyx_self, PyObject *__pyx_v_y) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_85_create_axes *__pyx_cur_scope;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_85_create_axes *__pyx_outer_scope;
  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("lambda42", 0);
  __pyx_outer_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_85_create_axes *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_origin_x)) { __Pyx_RaiseClosureNameError("origin_x"); __PYX_ERR(0, 3369, __pyx_L1_error) }
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3369, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_origin_x);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_origin_x);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_cur_scope->__pyx_v_origin_x);
  __Pyx_INCREF(__pyx_v_y);
  __Pyx_GIVEREF(__pyx_v_y);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_y);
  __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("mathics.builtin.graphics.GraphicsBox.create_axes.lambda42", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":3302
 *         return ticks, ticks_small, origin_x
 * 
 *     def create_axes(self, elements, graphics_options, xmin, xmax, ymin, ymax):             # <<<<<<<<<<<<<<
 *         axes = graphics_options.get("System`Axes")
 *         if axes.is_true():
 */

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_11GraphicsBox_12create_axes(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_elements, PyObject *__pyx_v_graphics_options, PyObject *__pyx_v_xmin, PyObject *__pyx_v_xmax, PyObject *__pyx_v_ymin, PyObject *__pyx_v_ymax) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_85_create_axes *__pyx_cur_scope;
  PyObject *__pyx_v_axes = NULL;
  PyObject *__pyx_v_ticks_style = NULL;
  PyObject *__pyx_v_axes_style = NULL;
  PyObject *__pyx_v_label_style = NULL;
  PyObject *__pyx_v_add_element = 0;
  PyObject *__pyx_v_ticks_x_small = NULL;
  PyObject *__pyx_v_ticks_y_small = NULL;
  PyObject *__pyx_v_axes_extra = NULL;
  long __pyx_v_tick_small_size;
  long __pyx_v_tick_large_size;
  PyObject *__pyx_v_tick_label_d = NULL;
  PyObject *__pyx_v_ticks_x_int = NULL;
  PyObject *__pyx_v_ticks_y_int = NULL;
  PyObject *__pyx_v_index = NULL;
  PyObject *__pyx_v_min = NULL;
  PyObject *__pyx_v_max = NULL;
  PyObject *__pyx_v_p_self0 = NULL;
  PyObject *__pyx_v_p_other0 = NULL;
  PyObject *__pyx_v_p_origin = NULL;
  PyObject *__pyx_v_ticks = NULL;
  PyObject *__pyx_v_ticks_small = NULL;
  PyObject *__pyx_v_ticks_int = NULL;
  PyObject *__pyx_v_ticks_lines = NULL;
  PyObject *__pyx_v_tick_label_style = NULL;
  PyObject *__pyx_v_x = NULL;
  PyObject *__pyx_v_content = NULL;
  PyObject *__pyx_v_pos = NULL;
  PyObject *__pyx_9genexpr62__pyx_v_s = NULL;
  PyObject *__pyx_9genexpr63__pyx_v_s = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyObject *(*__pyx_t_10)(PyObject *);
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  Py_ssize_t __pyx_t_18;
  int __pyx_t_19;
  PyObject *__pyx_t_20 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("create_axes", 0);
  __pyx_cur_scope = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_85_create_axes *)__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_85_create_axes(__pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_85_create_axes, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_85_create_axes *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 3302, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_elements = __pyx_v_elements;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_elements);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_elements);

  /* "mathics/builtin/graphics.py":3303
 * 
 *     def create_axes(self, elements, graphics_options, xmin, xmax, ymin, ymax):
 *         axes = graphics_options.get("System`Axes")             # <<<<<<<<<<<<<<
 *         if axes.is_true():
 *             axes = (True, True)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_graphics_options, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3303, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_kp_u_System_Axes) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_u_System_Axes);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3303, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_axes = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":3304
 *     def create_axes(self, elements, graphics_options, xmin, xmax, ymin, ymax):
 *         axes = graphics_options.get("System`Axes")
 *         if axes.is_true():             # <<<<<<<<<<<<<<
 *             axes = (True, True)
 *         elif axes.has_form("List", 2):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_axes, __pyx_n_s_is_true); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3304, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3304, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 3304, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

    /* "mathics/builtin/graphics.py":3305
 *         axes = graphics_options.get("System`Axes")
 *         if axes.is_true():
 *             axes = (True, True)             # <<<<<<<<<<<<<<
 *         elif axes.has_form("List", 2):
 *             axes = (axes.leaves[0].is_true(), axes.leaves[1].is_true())
 */
    __Pyx_INCREF(__pyx_tuple__147);
    __Pyx_DECREF_SET(__pyx_v_axes, __pyx_tuple__147);

    /* "mathics/builtin/graphics.py":3304
 *     def create_axes(self, elements, graphics_options, xmin, xmax, ymin, ymax):
 *         axes = graphics_options.get("System`Axes")
 *         if axes.is_true():             # <<<<<<<<<<<<<<
 *             axes = (True, True)
 *         elif axes.has_form("List", 2):
 */
    goto __pyx_L3;
  }

  /* "mathics/builtin/graphics.py":3306
 *         if axes.is_true():
 *             axes = (True, True)
 *         elif axes.has_form("List", 2):             # <<<<<<<<<<<<<<
 *             axes = (axes.leaves[0].is_true(), axes.leaves[1].is_true())
 *         else:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_axes, __pyx_n_s_has_form); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3306, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3306, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 3306, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_4) {

    /* "mathics/builtin/graphics.py":3307
 *             axes = (True, True)
 *         elif axes.has_form("List", 2):
 *             axes = (axes.leaves[0].is_true(), axes.leaves[1].is_true())             # <<<<<<<<<<<<<<
 *         else:
 *             axes = (False, False)
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_axes, __pyx_n_s_leaves); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3307, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3307, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_is_true); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3307, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3307, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_axes, __pyx_n_s_leaves); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3307, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_3, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3307, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_is_true); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3307, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3307, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3307, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
    __pyx_t_2 = 0;
    __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_axes, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "mathics/builtin/graphics.py":3306
 *         if axes.is_true():
 *             axes = (True, True)
 *         elif axes.has_form("List", 2):             # <<<<<<<<<<<<<<
 *             axes = (axes.leaves[0].is_true(), axes.leaves[1].is_true())
 *         else:
 */
    goto __pyx_L3;
  }

  /* "mathics/builtin/graphics.py":3309
 *             axes = (axes.leaves[0].is_true(), axes.leaves[1].is_true())
 *         else:
 *             axes = (False, False)             # <<<<<<<<<<<<<<
 *         ticks_style = graphics_options.get("System`TicksStyle")
 *         axes_style = graphics_options.get("System`AxesStyle")
 */
  /*else*/ {
    __Pyx_INCREF(__pyx_tuple__148);
    __Pyx_DECREF_SET(__pyx_v_axes, __pyx_tuple__148);
  }
  __pyx_L3:;

  /* "mathics/builtin/graphics.py":3310
 *         else:
 *             axes = (False, False)
 *         ticks_style = graphics_options.get("System`TicksStyle")             # <<<<<<<<<<<<<<
 *         axes_style = graphics_options.get("System`AxesStyle")
 *         label_style = graphics_options.get("System`LabelStyle")
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_graphics_options, __pyx_n_s_get); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3310, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_2, __pyx_kp_u_System_TicksStyle) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_kp_u_System_TicksStyle);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3310, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_ticks_style = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":3311
 *             axes = (False, False)
 *         ticks_style = graphics_options.get("System`TicksStyle")
 *         axes_style = graphics_options.get("System`AxesStyle")             # <<<<<<<<<<<<<<
 *         label_style = graphics_options.get("System`LabelStyle")
 *         if ticks_style.has_form("List", 2):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_graphics_options, __pyx_n_s_get); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3311, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_2, __pyx_kp_u_System_AxesStyle) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_kp_u_System_AxesStyle);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3311, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_axes_style = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":3312
 *         ticks_style = graphics_options.get("System`TicksStyle")
 *         axes_style = graphics_options.get("System`AxesStyle")
 *         label_style = graphics_options.get("System`LabelStyle")             # <<<<<<<<<<<<<<
 *         if ticks_style.has_form("List", 2):
 *             ticks_style = ticks_style.leaves
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_graphics_options, __pyx_n_s_get); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3312, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_2, __pyx_kp_u_System_LabelStyle) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_kp_u_System_LabelStyle);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3312, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_label_style = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":3313
 *         axes_style = graphics_options.get("System`AxesStyle")
 *         label_style = graphics_options.get("System`LabelStyle")
 *         if ticks_style.has_form("List", 2):             # <<<<<<<<<<<<<<
 *             ticks_style = ticks_style.leaves
 *         else:
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_ticks_style, __pyx_n_s_has_form); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3313, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3313, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 3313, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

    /* "mathics/builtin/graphics.py":3314
 *         label_style = graphics_options.get("System`LabelStyle")
 *         if ticks_style.has_form("List", 2):
 *             ticks_style = ticks_style.leaves             # <<<<<<<<<<<<<<
 *         else:
 *             ticks_style = [ticks_style] * 2
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_ticks_style, __pyx_n_s_leaves); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3314, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v_ticks_style, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "mathics/builtin/graphics.py":3313
 *         axes_style = graphics_options.get("System`AxesStyle")
 *         label_style = graphics_options.get("System`LabelStyle")
 *         if ticks_style.has_form("List", 2):             # <<<<<<<<<<<<<<
 *             ticks_style = ticks_style.leaves
 *         else:
 */
    goto __pyx_L4;
  }

  /* "mathics/builtin/graphics.py":3316
 *             ticks_style = ticks_style.leaves
 *         else:
 *             ticks_style = [ticks_style] * 2             # <<<<<<<<<<<<<<
 *         if axes_style.has_form("List", 2):
 *             axes_style = axes_style.leaves
 */
  /*else*/ {
    __pyx_t_1 = PyList_New(1 * 2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3316, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    { Py_ssize_t __pyx_temp;
      for (__pyx_temp=0; __pyx_temp < 2; __pyx_temp++) {
        __Pyx_INCREF(__pyx_v_ticks_style);
        __Pyx_GIVEREF(__pyx_v_ticks_style);
        PyList_SET_ITEM(__pyx_t_1, __pyx_temp, __pyx_v_ticks_style);
      }
    }
    __Pyx_DECREF_SET(__pyx_v_ticks_style, __pyx_t_1);
    __pyx_t_1 = 0;
  }
  __pyx_L4:;

  /* "mathics/builtin/graphics.py":3317
 *         else:
 *             ticks_style = [ticks_style] * 2
 *         if axes_style.has_form("List", 2):             # <<<<<<<<<<<<<<
 *             axes_style = axes_style.leaves
 *         else:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_axes_style, __pyx_n_s_has_form); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3317, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3317, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 3317, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_4) {

    /* "mathics/builtin/graphics.py":3318
 *             ticks_style = [ticks_style] * 2
 *         if axes_style.has_form("List", 2):
 *             axes_style = axes_style.leaves             # <<<<<<<<<<<<<<
 *         else:
 *             axes_style = [axes_style] * 2
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_axes_style, __pyx_n_s_leaves); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3318, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_axes_style, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "mathics/builtin/graphics.py":3317
 *         else:
 *             ticks_style = [ticks_style] * 2
 *         if axes_style.has_form("List", 2):             # <<<<<<<<<<<<<<
 *             axes_style = axes_style.leaves
 *         else:
 */
    goto __pyx_L5;
  }

  /* "mathics/builtin/graphics.py":3320
 *             axes_style = axes_style.leaves
 *         else:
 *             axes_style = [axes_style] * 2             # <<<<<<<<<<<<<<
 * 
 *         ticks_style = [elements.create_style(s) for s in ticks_style]
 */
  /*else*/ {
    __pyx_t_3 = PyList_New(1 * 2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3320, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    { Py_ssize_t __pyx_temp;
      for (__pyx_temp=0; __pyx_temp < 2; __pyx_temp++) {
        __Pyx_INCREF(__pyx_v_axes_style);
        __Pyx_GIVEREF(__pyx_v_axes_style);
        PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_v_axes_style);
      }
    }
    __Pyx_DECREF_SET(__pyx_v_axes_style, __pyx_t_3);
    __pyx_t_3 = 0;
  }
  __pyx_L5:;

  /* "mathics/builtin/graphics.py":3322
 *             axes_style = [axes_style] * 2
 * 
 *         ticks_style = [elements.create_style(s) for s in ticks_style]             # <<<<<<<<<<<<<<
 *         axes_style = [elements.create_style(s) for s in axes_style]
 *         label_style = elements.create_style(label_style)
 */
  { /* enter inner scope */
    __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3322, __pyx_L8_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (likely(PyList_CheckExact(__pyx_v_ticks_style)) || PyTuple_CheckExact(__pyx_v_ticks_style)) {
      __pyx_t_1 = __pyx_v_ticks_style; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_ticks_style); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3322, __pyx_L8_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_7 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3322, __pyx_L8_error)
    }
    for (;;) {
      if (likely(!__pyx_t_7)) {
        if (likely(PyList_CheckExact(__pyx_t_1))) {
          if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 3322, __pyx_L8_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3322, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        } else {
          if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 3322, __pyx_L8_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3322, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        }
      } else {
        __pyx_t_2 = __pyx_t_7(__pyx_t_1);
        if (unlikely(!__pyx_t_2)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 3322, __pyx_L8_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_XDECREF_SET(__pyx_9genexpr62__pyx_v_s, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_elements, __pyx_n_s_create_style); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3322, __pyx_L8_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_8 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_2 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_8, __pyx_9genexpr62__pyx_v_s) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_9genexpr62__pyx_v_s);
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3322, __pyx_L8_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 3322, __pyx_L8_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_9genexpr62__pyx_v_s); __pyx_9genexpr62__pyx_v_s = 0;
    goto __pyx_L11_exit_scope;
    __pyx_L8_error:;
    __Pyx_XDECREF(__pyx_9genexpr62__pyx_v_s); __pyx_9genexpr62__pyx_v_s = 0;
    goto __pyx_L1_error;
    __pyx_L11_exit_scope:;
  } /* exit inner scope */
  __Pyx_DECREF_SET(__pyx_v_ticks_style, __pyx_t_3);
  __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":3323
 * 
 *         ticks_style = [elements.create_style(s) for s in ticks_style]
 *         axes_style = [elements.create_style(s) for s in axes_style]             # <<<<<<<<<<<<<<
 *         label_style = elements.create_style(label_style)
 *         ticks_style[0].extend(axes_style[0])
 */
  { /* enter inner scope */
    __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3323, __pyx_L14_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (likely(PyList_CheckExact(__pyx_v_axes_style)) || PyTuple_CheckExact(__pyx_v_axes_style)) {
      __pyx_t_1 = __pyx_v_axes_style; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_axes_style); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3323, __pyx_L14_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_7 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3323, __pyx_L14_error)
    }
    for (;;) {
      if (likely(!__pyx_t_7)) {
        if (likely(PyList_CheckExact(__pyx_t_1))) {
          if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 3323, __pyx_L14_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3323, __pyx_L14_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        } else {
          if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 3323, __pyx_L14_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3323, __pyx_L14_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        }
      } else {
        __pyx_t_2 = __pyx_t_7(__pyx_t_1);
        if (unlikely(!__pyx_t_2)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 3323, __pyx_L14_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_XDECREF_SET(__pyx_9genexpr63__pyx_v_s, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_elements, __pyx_n_s_create_style); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3323, __pyx_L14_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_8 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_2 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_8, __pyx_9genexpr63__pyx_v_s) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_9genexpr63__pyx_v_s);
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3323, __pyx_L14_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 3323, __pyx_L14_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_9genexpr63__pyx_v_s); __pyx_9genexpr63__pyx_v_s = 0;
    goto __pyx_L17_exit_scope;
    __pyx_L14_error:;
    __Pyx_XDECREF(__pyx_9genexpr63__pyx_v_s); __pyx_9genexpr63__pyx_v_s = 0;
    goto __pyx_L1_error;
    __pyx_L17_exit_scope:;
  } /* exit inner scope */
  __Pyx_DECREF_SET(__pyx_v_axes_style, __pyx_t_3);
  __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":3324
 *         ticks_style = [elements.create_style(s) for s in ticks_style]
 *         axes_style = [elements.create_style(s) for s in axes_style]
 *         label_style = elements.create_style(label_style)             # <<<<<<<<<<<<<<
 *         ticks_style[0].extend(axes_style[0])
 *         ticks_style[1].extend(axes_style[1])
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_elements, __pyx_n_s_create_style); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3324, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_2, __pyx_v_label_style) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_label_style);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3324, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF_SET(__pyx_v_label_style, __pyx_t_3);
  __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":3325
 *         axes_style = [elements.create_style(s) for s in axes_style]
 *         label_style = elements.create_style(label_style)
 *         ticks_style[0].extend(axes_style[0])             # <<<<<<<<<<<<<<
 *         ticks_style[1].extend(axes_style[1])
 * 
 */
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_ticks_style, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3325, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_extend); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3325, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_axes_style, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3325, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3325, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":3326
 *         label_style = elements.create_style(label_style)
 *         ticks_style[0].extend(axes_style[0])
 *         ticks_style[1].extend(axes_style[1])             # <<<<<<<<<<<<<<
 * 
 *         def add_element(element):
 */
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_ticks_style, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3326, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_extend); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3326, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_axes_style, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3326, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3326, __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;

  /* "mathics/builtin/graphics.py":3328
 *         ticks_style[1].extend(axes_style[1])
 * 
 *         def add_element(element):             # <<<<<<<<<<<<<<
 *             element.is_completely_visible = True
 *             elements.elements.append(element)
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_11GraphicsBox_11create_axes_1add_element, 0, __pyx_n_s_GraphicsBox_create_axes_locals_a, ((PyObject*)__pyx_cur_scope), __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__150)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3328, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_add_element = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":3332
 *             elements.elements.append(element)
 * 
 *         ticks_x, ticks_x_small, origin_x = self.axis_ticks(xmin, xmax)             # <<<<<<<<<<<<<<
 *         ticks_y, ticks_y_small, origin_y = self.axis_ticks(ymin, ymax)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_axis_ticks); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3332, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = NULL;
  __pyx_t_9 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
      __pyx_t_9 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_1)) {
    PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_xmin, __pyx_v_xmax};
    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3332, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_3);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
    PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_xmin, __pyx_v_xmax};
    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3332, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_3);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3332, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_2) {
      __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
    }
    __Pyx_INCREF(__pyx_v_xmin);
    __Pyx_GIVEREF(__pyx_v_xmin);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_9, __pyx_v_xmin);
    __Pyx_INCREF(__pyx_v_xmax);
    __Pyx_GIVEREF(__pyx_v_xmax);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_9, __pyx_v_xmax);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3332, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
    PyObject* sequence = __pyx_t_3;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 3)) {
      if (size > 3) __Pyx_RaiseTooManyValuesError(3);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 3332, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 2); 
    } else {
      __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 2); 
    }
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_2);
    #else
    __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3332, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3332, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3332, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_8 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3332, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_10 = Py_TYPE(__pyx_t_8)->tp_iternext;
    index = 0; __pyx_t_1 = __pyx_t_10(__pyx_t_8); if (unlikely(!__pyx_t_1)) goto __pyx_L18_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    index = 1; __pyx_t_5 = __pyx_t_10(__pyx_t_8); if (unlikely(!__pyx_t_5)) goto __pyx_L18_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_5);
    index = 2; __pyx_t_2 = __pyx_t_10(__pyx_t_8); if (unlikely(!__pyx_t_2)) goto __pyx_L18_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_8), 3) < 0) __PYX_ERR(0, 3332, __pyx_L1_error)
    __pyx_t_10 = NULL;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    goto __pyx_L19_unpacking_done;
    __pyx_L18_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_10 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 3332, __pyx_L1_error)
    __pyx_L19_unpacking_done:;
  }
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_ticks_x = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v_ticks_x_small = __pyx_t_5;
  __pyx_t_5 = 0;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_cur_scope->__pyx_v_origin_x = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":3333
 * 
 *         ticks_x, ticks_x_small, origin_x = self.axis_ticks(xmin, xmax)
 *         ticks_y, ticks_y_small, origin_y = self.axis_ticks(ymin, ymax)             # <<<<<<<<<<<<<<
 * 
 *         axes_extra = 6
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_axis_ticks); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3333, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = NULL;
  __pyx_t_9 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_9 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_ymin, __pyx_v_ymax};
    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3333, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_3);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_ymin, __pyx_v_ymax};
    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3333, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_3);
  } else
  #endif
  {
    __pyx_t_1 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3333, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (__pyx_t_5) {
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); __pyx_t_5 = NULL;
    }
    __Pyx_INCREF(__pyx_v_ymin);
    __Pyx_GIVEREF(__pyx_v_ymin);
    PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_9, __pyx_v_ymin);
    __Pyx_INCREF(__pyx_v_ymax);
    __Pyx_GIVEREF(__pyx_v_ymax);
    PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_9, __pyx_v_ymax);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3333, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
    PyObject* sequence = __pyx_t_3;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 3)) {
      if (size > 3) __Pyx_RaiseTooManyValuesError(3);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 3333, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); 
    } else {
      __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyList_GET_ITEM(sequence, 1); 
      __pyx_t_5 = PyList_GET_ITEM(sequence, 2); 
    }
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_5);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3333, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3333, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3333, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    #endif
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_8 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3333, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_10 = Py_TYPE(__pyx_t_8)->tp_iternext;
    index = 0; __pyx_t_2 = __pyx_t_10(__pyx_t_8); if (unlikely(!__pyx_t_2)) goto __pyx_L20_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 1; __pyx_t_1 = __pyx_t_10(__pyx_t_8); if (unlikely(!__pyx_t_1)) goto __pyx_L20_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    index = 2; __pyx_t_5 = __pyx_t_10(__pyx_t_8); if (unlikely(!__pyx_t_5)) goto __pyx_L20_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_8), 3) < 0) __PYX_ERR(0, 3333, __pyx_L1_error)
    __pyx_t_10 = NULL;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    goto __pyx_L21_unpacking_done;
    __pyx_L20_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_10 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 3333, __pyx_L1_error)
    __pyx_L21_unpacking_done:;
  }
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_cur_scope->__pyx_v_ticks_y = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_v_ticks_y_small = __pyx_t_1;
  __pyx_t_1 = 0;
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_cur_scope->__pyx_v_origin_y = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":3335
 *         ticks_y, ticks_y_small, origin_y = self.axis_ticks(ymin, ymax)
 * 
 *         axes_extra = 6             # <<<<<<<<<<<<<<
 *         tick_small_size = 3
 *         tick_large_size = 5
 */
  __Pyx_INCREF(__pyx_int_6);
  __pyx_v_axes_extra = __pyx_int_6;

  /* "mathics/builtin/graphics.py":3336
 * 
 *         axes_extra = 6
 *         tick_small_size = 3             # <<<<<<<<<<<<<<
 *         tick_large_size = 5
 *         tick_label_d = 2
 */
  __pyx_v_tick_small_size = 3;

  /* "mathics/builtin/graphics.py":3337
 *         axes_extra = 6
 *         tick_small_size = 3
 *         tick_large_size = 5             # <<<<<<<<<<<<<<
 *         tick_label_d = 2
 * 
 */
  __pyx_v_tick_large_size = 5;

  /* "mathics/builtin/graphics.py":3338
 *         tick_small_size = 3
 *         tick_large_size = 5
 *         tick_label_d = 2             # <<<<<<<<<<<<<<
 * 
 *         ticks_x_int = all(floor(x) == x for x in ticks_x)
 */
  __Pyx_INCREF(__pyx_int_2);
  __pyx_v_tick_label_d = __pyx_int_2;

  /* "mathics/builtin/graphics.py":3340
 *         tick_label_d = 2
 * 
 *         ticks_x_int = all(floor(x) == x for x in ticks_x)             # <<<<<<<<<<<<<<
 *         ticks_y_int = all(floor(x) == x for x in ticks_y)
 * 
 */
  __pyx_t_3 = __pyx_pf_7mathics_7builtin_8graphics_11GraphicsBox_11create_axes_2genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3340, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_Generator_Next(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3340, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_ticks_x_int = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":3341
 * 
 *         ticks_x_int = all(floor(x) == x for x in ticks_x)
 *         ticks_y_int = all(floor(x) == x for x in ticks_y)             # <<<<<<<<<<<<<<
 * 
 *         for index, (
 */
  __pyx_t_5 = __pyx_pf_7mathics_7builtin_8graphics_11GraphicsBox_11create_axes_5genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3341, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = __Pyx_Generator_Next(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3341, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_ticks_y_int = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":3343
 *         ticks_y_int = all(floor(x) == x for x in ticks_y)
 * 
 *         for index, (             # <<<<<<<<<<<<<<
 *             min,
 *             max,
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_t_3 = __pyx_int_0;

  /* "mathics/builtin/graphics.py":3357
 *                     xmin,
 *                     xmax,
 *                     lambda y: (0, y),             # <<<<<<<<<<<<<<
 *                     lambda x: (x, 0),
 *                     lambda x: (x, origin_y),
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_11GraphicsBox_11create_axes_8lambda37, 0, __pyx_n_s_GraphicsBox_create_axes_locals_l, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3357, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "mathics/builtin/graphics.py":3358
 *                     xmax,
 *                     lambda y: (0, y),
 *                     lambda x: (x, 0),             # <<<<<<<<<<<<<<
 *                     lambda x: (x, origin_y),
 *                     ticks_x,
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_11GraphicsBox_11create_axes_9lambda38, 0, __pyx_n_s_GraphicsBox_create_axes_locals_l, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3358, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "mathics/builtin/graphics.py":3359
 *                     lambda y: (0, y),
 *                     lambda x: (x, 0),
 *                     lambda x: (x, origin_y),             # <<<<<<<<<<<<<<
 *                     ticks_x,
 *                     ticks_x_small,
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_11GraphicsBox_11create_axes_10lambda39, 0, __pyx_n_s_GraphicsBox_create_axes_locals_l, ((PyObject*)__pyx_cur_scope), __pyx_n_s_mathics_builtin_graphics, __pyx_d, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3359, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "mathics/builtin/graphics.py":3355
 *             [
 *                 (
 *                     xmin,             # <<<<<<<<<<<<<<
 *                     xmax,
 *                     lambda y: (0, y),
 */
  __pyx_t_8 = PyTuple_New(8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3355, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_INCREF(__pyx_v_xmin);
  __Pyx_GIVEREF(__pyx_v_xmin);
  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_xmin);
  __Pyx_INCREF(__pyx_v_xmax);
  __Pyx_GIVEREF(__pyx_v_xmax);
  PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_xmax);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_8, 4, __pyx_t_2);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_ticks_x);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_ticks_x);
  PyTuple_SET_ITEM(__pyx_t_8, 5, __pyx_cur_scope->__pyx_v_ticks_x);
  __Pyx_INCREF(__pyx_v_ticks_x_small);
  __Pyx_GIVEREF(__pyx_v_ticks_x_small);
  PyTuple_SET_ITEM(__pyx_t_8, 6, __pyx_v_ticks_x_small);
  __Pyx_INCREF(__pyx_v_ticks_x_int);
  __Pyx_GIVEREF(__pyx_v_ticks_x_int);
  PyTuple_SET_ITEM(__pyx_t_8, 7, __pyx_v_ticks_x_int);
  __pyx_t_5 = 0;
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":3367
 *                     ymin,
 *                     ymax,
 *                     lambda x: (x, 0),             # <<<<<<<<<<<<<<
 *                     lambda y: (0, y),
 *                     lambda y: (origin_x, y),
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_11GraphicsBox_11create_axes_11lambda40, 0, __pyx_n_s_GraphicsBox_create_axes_locals_l, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3367, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "mathics/builtin/graphics.py":3368
 *                     ymax,
 *                     lambda x: (x, 0),
 *                     lambda y: (0, y),             # <<<<<<<<<<<<<<
 *                     lambda y: (origin_x, y),
 *                     ticks_y,
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_11GraphicsBox_11create_axes_12lambda41, 0, __pyx_n_s_GraphicsBox_create_axes_locals_l, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3368, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "mathics/builtin/graphics.py":3369
 *                     lambda x: (x, 0),
 *                     lambda y: (0, y),
 *                     lambda y: (origin_x, y),             # <<<<<<<<<<<<<<
 *                     ticks_y,
 *                     ticks_y_small,
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_11GraphicsBox_11create_axes_13lambda42, 0, __pyx_n_s_GraphicsBox_create_axes_locals_l, ((PyObject*)__pyx_cur_scope), __pyx_n_s_mathics_builtin_graphics, __pyx_d, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3369, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "mathics/builtin/graphics.py":3365
 *                 ),
 *                 (
 *                     ymin,             # <<<<<<<<<<<<<<
 *                     ymax,
 *                     lambda x: (x, 0),
 */
  __pyx_t_11 = PyTuple_New(8); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3365, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_INCREF(__pyx_v_ymin);
  __Pyx_GIVEREF(__pyx_v_ymin);
  PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_ymin);
  __Pyx_INCREF(__pyx_v_ymax);
  __Pyx_GIVEREF(__pyx_v_ymax);
  PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_v_ymax);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_11, 3, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_11, 4, __pyx_t_5);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_ticks_y);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_ticks_y);
  PyTuple_SET_ITEM(__pyx_t_11, 5, __pyx_cur_scope->__pyx_v_ticks_y);
  __Pyx_INCREF(__pyx_v_ticks_y_small);
  __Pyx_GIVEREF(__pyx_v_ticks_y_small);
  PyTuple_SET_ITEM(__pyx_t_11, 6, __pyx_v_ticks_y_small);
  __Pyx_INCREF(__pyx_v_ticks_y_int);
  __Pyx_GIVEREF(__pyx_v_ticks_y_int);
  PyTuple_SET_ITEM(__pyx_t_11, 7, __pyx_v_ticks_y_int);
  __pyx_t_2 = 0;
  __pyx_t_1 = 0;
  __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":3353
 *             ticks_int,
 *         ) in enumerate(
 *             [             # <<<<<<<<<<<<<<
 *                 (
 *                     xmin,
 */
  __pyx_t_5 = PyList_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3353, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_8);
  PyList_SET_ITEM(__pyx_t_5, 0, __pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_11);
  PyList_SET_ITEM(__pyx_t_5, 1, __pyx_t_11);
  __pyx_t_8 = 0;
  __pyx_t_11 = 0;

  /* "mathics/builtin/graphics.py":3352
 *             ticks_small,
 *             ticks_int,
 *         ) in enumerate(             # <<<<<<<<<<<<<<
 *             [
 *                 (
 */
  __pyx_t_11 = __pyx_t_5; __Pyx_INCREF(__pyx_t_11); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  for (;;) {
    if (__pyx_t_6 >= 2) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_5 = PyList_GET_ITEM(__pyx_t_11, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 3352, __pyx_L1_error)
    #else
    __pyx_t_5 = PySequence_ITEM(__pyx_t_11, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3352, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    #endif
    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 != 8)) {
        if (size > 8) __Pyx_RaiseTooManyValuesError(8);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 3344, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
        __pyx_t_2 = PyTuple_GET_ITEM(sequence, 2); 
        __pyx_t_12 = PyTuple_GET_ITEM(sequence, 3); 
        __pyx_t_13 = PyTuple_GET_ITEM(sequence, 4); 
        __pyx_t_14 = PyTuple_GET_ITEM(sequence, 5); 
        __pyx_t_15 = PyTuple_GET_ITEM(sequence, 6); 
        __pyx_t_16 = PyTuple_GET_ITEM(sequence, 7); 
      } else {
        __pyx_t_8 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_1 = PyList_GET_ITEM(sequence, 1); 
        __pyx_t_2 = PyList_GET_ITEM(sequence, 2); 
        __pyx_t_12 = PyList_GET_ITEM(sequence, 3); 
        __pyx_t_13 = PyList_GET_ITEM(sequence, 4); 
        __pyx_t_14 = PyList_GET_ITEM(sequence, 5); 
        __pyx_t_15 = PyList_GET_ITEM(sequence, 6); 
        __pyx_t_16 = PyList_GET_ITEM(sequence, 7); 
      }
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_12);
      __Pyx_INCREF(__pyx_t_13);
      __Pyx_INCREF(__pyx_t_14);
      __Pyx_INCREF(__pyx_t_15);
      __Pyx_INCREF(__pyx_t_16);
      #else
      {
        Py_ssize_t i;
        PyObject** temps[8] = {&__pyx_t_8,&__pyx_t_1,&__pyx_t_2,&__pyx_t_12,&__pyx_t_13,&__pyx_t_14,&__pyx_t_15,&__pyx_t_16};
        for (i=0; i < 8; i++) {
          PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 3344, __pyx_L1_error)
          __Pyx_GOTREF(item);
          *(temps[i]) = item;
        }
      }
      #endif
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else {
      Py_ssize_t index = -1;
      PyObject** temps[8] = {&__pyx_t_8,&__pyx_t_1,&__pyx_t_2,&__pyx_t_12,&__pyx_t_13,&__pyx_t_14,&__pyx_t_15,&__pyx_t_16};
      __pyx_t_17 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 3344, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_17);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_10 = Py_TYPE(__pyx_t_17)->tp_iternext;
      for (index=0; index < 8; index++) {
        PyObject* item = __pyx_t_10(__pyx_t_17); if (unlikely(!item)) goto __pyx_L24_unpacking_failed;
        __Pyx_GOTREF(item);
        *(temps[index]) = item;
      }
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_17), 8) < 0) __PYX_ERR(0, 3344, __pyx_L1_error)
      __pyx_t_10 = NULL;
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      goto __pyx_L25_unpacking_done;
      __pyx_L24_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      __pyx_t_10 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 3344, __pyx_L1_error)
      __pyx_L25_unpacking_done:;
    }

    /* "mathics/builtin/graphics.py":3344
 * 
 *         for index, (
 *             min,             # <<<<<<<<<<<<<<
 *             max,
 *             p_self0,
 */
    __Pyx_XDECREF_SET(__pyx_v_min, __pyx_t_8);
    __pyx_t_8 = 0;
    __Pyx_XDECREF_SET(__pyx_v_max, __pyx_t_1);
    __pyx_t_1 = 0;
    __Pyx_XDECREF_SET(__pyx_v_p_self0, __pyx_t_2);
    __pyx_t_2 = 0;
    __Pyx_XDECREF_SET(__pyx_v_p_other0, __pyx_t_12);
    __pyx_t_12 = 0;
    __Pyx_XDECREF_SET(__pyx_v_p_origin, __pyx_t_13);
    __pyx_t_13 = 0;
    __Pyx_XDECREF_SET(__pyx_v_ticks, __pyx_t_14);
    __pyx_t_14 = 0;
    __Pyx_XDECREF_SET(__pyx_v_ticks_small, __pyx_t_15);
    __pyx_t_15 = 0;
    __Pyx_XDECREF_SET(__pyx_v_ticks_int, __pyx_t_16);
    __pyx_t_16 = 0;

    /* "mathics/builtin/graphics.py":3343
 *         ticks_y_int = all(floor(x) == x for x in ticks_y)
 * 
 *         for index, (             # <<<<<<<<<<<<<<
 *             min,
 *             max,
 */
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_3);

    /* "mathics/builtin/graphics.py":3352
 *             ticks_small,
 *             ticks_int,
 *         ) in enumerate(             # <<<<<<<<<<<<<<
 *             [
 *                 (
 */
    __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3352, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3);
    __pyx_t_3 = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "mathics/builtin/graphics.py":3376
 *             ]
 *         ):
 *             if axes[index]:             # <<<<<<<<<<<<<<
 *                 add_element(
 *                     LineBox(
 */
    __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_axes, __pyx_v_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3376, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 3376, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_4) {

      /* "mathics/builtin/graphics.py":3378
 *             if axes[index]:
 *                 add_element(
 *                     LineBox(             # <<<<<<<<<<<<<<
 *                         elements,
 *                         axes_style[index],
 */
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_LineBox); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3378, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);

      /* "mathics/builtin/graphics.py":3380
 *                     LineBox(
 *                         elements,
 *                         axes_style[index],             # <<<<<<<<<<<<<<
 *                         lines=[
 *                             [
 */
      __pyx_t_16 = __Pyx_PyObject_GetItem(__pyx_v_axes_style, __pyx_v_index); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 3380, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_16);

      /* "mathics/builtin/graphics.py":3378
 *             if axes[index]:
 *                 add_element(
 *                     LineBox(             # <<<<<<<<<<<<<<
 *                         elements,
 *                         axes_style[index],
 */
      __pyx_t_15 = PyTuple_New(2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 3378, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_15);
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_elements);
      __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_elements);
      PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_cur_scope->__pyx_v_elements);
      __Pyx_GIVEREF(__pyx_t_16);
      PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_t_16);
      __pyx_t_16 = 0;

      /* "mathics/builtin/graphics.py":3381
 *                         elements,
 *                         axes_style[index],
 *                         lines=[             # <<<<<<<<<<<<<<
 *                             [
 *                                 Coords(
 */
      __pyx_t_16 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 3381, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_16);

      /* "mathics/builtin/graphics.py":3383
 *                         lines=[
 *                             [
 *                                 Coords(             # <<<<<<<<<<<<<<
 *                                     elements, pos=p_origin(min), d=p_other0(-axes_extra)
 *                                 ),
 */
      __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_Coords); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 3383, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);

      /* "mathics/builtin/graphics.py":3384
 *                             [
 *                                 Coords(
 *                                     elements, pos=p_origin(min), d=p_other0(-axes_extra)             # <<<<<<<<<<<<<<
 *                                 ),
 *                                 Coords(
 */
      __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3383, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_elements);
      __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_elements);
      PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_cur_scope->__pyx_v_elements);
      __pyx_t_12 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3384, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_INCREF(__pyx_v_p_origin);
      __pyx_t_1 = __pyx_v_p_origin; __pyx_t_8 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      __pyx_t_2 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_8, __pyx_v_min) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_min);
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3384, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_pos, __pyx_t_2) < 0) __PYX_ERR(0, 3384, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_1 = PyNumber_Negative(__pyx_v_axes_extra); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3384, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_v_p_other0);
      __pyx_t_8 = __pyx_v_p_other0; __pyx_t_17 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
        __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_8);
        if (likely(__pyx_t_17)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
          __Pyx_INCREF(__pyx_t_17);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_8, function);
        }
      }
      __pyx_t_2 = (__pyx_t_17) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_17, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_1);
      __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3384, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_d, __pyx_t_2) < 0) __PYX_ERR(0, 3384, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "mathics/builtin/graphics.py":3383
 *                         lines=[
 *                             [
 *                                 Coords(             # <<<<<<<<<<<<<<
 *                                     elements, pos=p_origin(min), d=p_other0(-axes_extra)
 *                                 ),
 */
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_13, __pyx_t_12); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3383, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__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;

      /* "mathics/builtin/graphics.py":3386
 *                                     elements, pos=p_origin(min), d=p_other0(-axes_extra)
 *                                 ),
 *                                 Coords(             # <<<<<<<<<<<<<<
 *                                     elements, pos=p_origin(max), d=p_other0(axes_extra)
 *                                 ),
 */
      __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_Coords); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3386, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);

      /* "mathics/builtin/graphics.py":3387
 *                                 ),
 *                                 Coords(
 *                                     elements, pos=p_origin(max), d=p_other0(axes_extra)             # <<<<<<<<<<<<<<
 *                                 ),
 *                             ]
 */
      __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3386, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_elements);
      __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_elements);
      PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_cur_scope->__pyx_v_elements);
      __pyx_t_14 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 3387, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_INCREF(__pyx_v_p_origin);
      __pyx_t_1 = __pyx_v_p_origin; __pyx_t_17 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_17)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_17);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      __pyx_t_8 = (__pyx_t_17) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_17, __pyx_v_max) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_max);
      __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
      if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3387, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_pos, __pyx_t_8) < 0) __PYX_ERR(0, 3387, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_INCREF(__pyx_v_p_other0);
      __pyx_t_1 = __pyx_v_p_other0; __pyx_t_17 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_17)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_17);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      __pyx_t_8 = (__pyx_t_17) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_17, __pyx_v_axes_extra) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_axes_extra);
      __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
      if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3387, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_d, __pyx_t_8) < 0) __PYX_ERR(0, 3387, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "mathics/builtin/graphics.py":3386
 *                                     elements, pos=p_origin(min), d=p_other0(-axes_extra)
 *                                 ),
 *                                 Coords(             # <<<<<<<<<<<<<<
 *                                     elements, pos=p_origin(max), d=p_other0(axes_extra)
 *                                 ),
 */
      __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, __pyx_t_14); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3386, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __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;

      /* "mathics/builtin/graphics.py":3382
 *                         axes_style[index],
 *                         lines=[
 *                             [             # <<<<<<<<<<<<<<
 *                                 Coords(
 *                                     elements, pos=p_origin(min), d=p_other0(-axes_extra)
 */
      __pyx_t_14 = PyList_New(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 3382, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_GIVEREF(__pyx_t_2);
      PyList_SET_ITEM(__pyx_t_14, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_8);
      PyList_SET_ITEM(__pyx_t_14, 1, __pyx_t_8);
      __pyx_t_2 = 0;
      __pyx_t_8 = 0;

      /* "mathics/builtin/graphics.py":3381
 *                         elements,
 *                         axes_style[index],
 *                         lines=[             # <<<<<<<<<<<<<<
 *                             [
 *                                 Coords(
 */
      __pyx_t_8 = PyList_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3381, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_14);
      PyList_SET_ITEM(__pyx_t_8, 0, __pyx_t_14);
      __pyx_t_14 = 0;
      if (PyDict_SetItem(__pyx_t_16, __pyx_n_s_lines, __pyx_t_8) < 0) __PYX_ERR(0, 3381, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "mathics/builtin/graphics.py":3378
 *             if axes[index]:
 *                 add_element(
 *                     LineBox(             # <<<<<<<<<<<<<<
 *                         elements,
 *                         axes_style[index],
 */
      __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_15, __pyx_t_16); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3378, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

      /* "mathics/builtin/graphics.py":3377
 *         ):
 *             if axes[index]:
 *                 add_element(             # <<<<<<<<<<<<<<
 *                     LineBox(
 *                         elements,
 */
      __pyx_t_16 = __pyx_pf_7mathics_7builtin_8graphics_11GraphicsBox_11create_axes_add_element(__pyx_v_add_element, __pyx_t_8); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 3377, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_16);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

      /* "mathics/builtin/graphics.py":3393
 *                     )
 *                 )
 *                 ticks_lines = []             # <<<<<<<<<<<<<<
 *                 tick_label_style = ticks_style[index].clone()
 *                 tick_label_style.extend(label_style)
 */
      __pyx_t_16 = PyList_New(0); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 3393, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_16);
      __Pyx_XDECREF_SET(__pyx_v_ticks_lines, ((PyObject*)__pyx_t_16));
      __pyx_t_16 = 0;

      /* "mathics/builtin/graphics.py":3394
 *                 )
 *                 ticks_lines = []
 *                 tick_label_style = ticks_style[index].clone()             # <<<<<<<<<<<<<<
 *                 tick_label_style.extend(label_style)
 *                 for x in ticks:
 */
      __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_v_ticks_style, __pyx_v_index); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3394, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_clone); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 3394, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_15);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_15))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_15);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_15, function);
        }
      }
      __pyx_t_16 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_15, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_15);
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 3394, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_16);
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      __Pyx_XDECREF_SET(__pyx_v_tick_label_style, __pyx_t_16);
      __pyx_t_16 = 0;

      /* "mathics/builtin/graphics.py":3395
 *                 ticks_lines = []
 *                 tick_label_style = ticks_style[index].clone()
 *                 tick_label_style.extend(label_style)             # <<<<<<<<<<<<<<
 *                 for x in ticks:
 *                     ticks_lines.append(
 */
      __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_tick_label_style, __pyx_n_s_extend); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 3395, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_15);
      __pyx_t_8 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_15))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_15);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_15, function);
        }
      }
      __pyx_t_16 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_15, __pyx_t_8, __pyx_v_label_style) : __Pyx_PyObject_CallOneArg(__pyx_t_15, __pyx_v_label_style);
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 3395, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_16);
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

      /* "mathics/builtin/graphics.py":3396
 *                 tick_label_style = ticks_style[index].clone()
 *                 tick_label_style.extend(label_style)
 *                 for x in ticks:             # <<<<<<<<<<<<<<
 *                     ticks_lines.append(
 *                         [
 */
      if (likely(PyList_CheckExact(__pyx_v_ticks)) || PyTuple_CheckExact(__pyx_v_ticks)) {
        __pyx_t_16 = __pyx_v_ticks; __Pyx_INCREF(__pyx_t_16); __pyx_t_18 = 0;
        __pyx_t_7 = NULL;
      } else {
        __pyx_t_18 = -1; __pyx_t_16 = PyObject_GetIter(__pyx_v_ticks); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 3396, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_16);
        __pyx_t_7 = Py_TYPE(__pyx_t_16)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3396, __pyx_L1_error)
      }
      for (;;) {
        if (likely(!__pyx_t_7)) {
          if (likely(PyList_CheckExact(__pyx_t_16))) {
            if (__pyx_t_18 >= PyList_GET_SIZE(__pyx_t_16)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_15 = PyList_GET_ITEM(__pyx_t_16, __pyx_t_18); __Pyx_INCREF(__pyx_t_15); __pyx_t_18++; if (unlikely(0 < 0)) __PYX_ERR(0, 3396, __pyx_L1_error)
            #else
            __pyx_t_15 = PySequence_ITEM(__pyx_t_16, __pyx_t_18); __pyx_t_18++; if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 3396, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_15);
            #endif
          } else {
            if (__pyx_t_18 >= PyTuple_GET_SIZE(__pyx_t_16)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_15 = PyTuple_GET_ITEM(__pyx_t_16, __pyx_t_18); __Pyx_INCREF(__pyx_t_15); __pyx_t_18++; if (unlikely(0 < 0)) __PYX_ERR(0, 3396, __pyx_L1_error)
            #else
            __pyx_t_15 = PySequence_ITEM(__pyx_t_16, __pyx_t_18); __pyx_t_18++; if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 3396, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_15);
            #endif
          }
        } else {
          __pyx_t_15 = __pyx_t_7(__pyx_t_16);
          if (unlikely(!__pyx_t_15)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 3396, __pyx_L1_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_15);
        }
        __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_15);
        __pyx_t_15 = 0;

        /* "mathics/builtin/graphics.py":3399
 *                     ticks_lines.append(
 *                         [
 *                             Coords(elements, pos=p_origin(x)),             # <<<<<<<<<<<<<<
 *                             Coords(
 *                                 elements, pos=p_origin(x), d=p_self0(tick_large_size)
 */
        __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_Coords); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 3399, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_15);
        __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3399, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_INCREF(__pyx_cur_scope->__pyx_v_elements);
        __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_elements);
        PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_cur_scope->__pyx_v_elements);
        __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3399, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_INCREF(__pyx_v_p_origin);
        __pyx_t_2 = __pyx_v_p_origin; __pyx_t_13 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_2);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_2, function);
          }
        }
        __pyx_t_14 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_13, __pyx_v_x) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_x);
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 3399, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_pos, __pyx_t_14) < 0) __PYX_ERR(0, 3399, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_8, __pyx_t_5); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 3399, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "mathics/builtin/graphics.py":3400
 *                         [
 *                             Coords(elements, pos=p_origin(x)),
 *                             Coords(             # <<<<<<<<<<<<<<
 *                                 elements, pos=p_origin(x), d=p_self0(tick_large_size)
 *                             ),
 */
        __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Coords); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3400, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);

        /* "mathics/builtin/graphics.py":3401
 *                             Coords(elements, pos=p_origin(x)),
 *                             Coords(
 *                                 elements, pos=p_origin(x), d=p_self0(tick_large_size)             # <<<<<<<<<<<<<<
 *                             ),
 *                         ]
 */
        __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3400, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_INCREF(__pyx_cur_scope->__pyx_v_elements);
        __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_elements);
        PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_cur_scope->__pyx_v_elements);
        __pyx_t_15 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 3401, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_15);
        __Pyx_INCREF(__pyx_v_p_origin);
        __pyx_t_13 = __pyx_v_p_origin; __pyx_t_12 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_13))) {
          __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_13);
          if (likely(__pyx_t_12)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
            __Pyx_INCREF(__pyx_t_12);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_13, function);
          }
        }
        __pyx_t_2 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_12, __pyx_v_x) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_v_x);
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3401, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        if (PyDict_SetItem(__pyx_t_15, __pyx_n_s_pos, __pyx_t_2) < 0) __PYX_ERR(0, 3401, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_13 = __Pyx_PyInt_From_long(__pyx_v_tick_large_size); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3401, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_INCREF(__pyx_v_p_self0);
        __pyx_t_12 = __pyx_v_p_self0; __pyx_t_1 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) {
          __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_12);
          if (likely(__pyx_t_1)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
            __Pyx_INCREF(__pyx_t_1);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_12, function);
          }
        }
        __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_12, __pyx_t_1, __pyx_t_13) : __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_13);
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3401, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        if (PyDict_SetItem(__pyx_t_15, __pyx_n_s_d, __pyx_t_2) < 0) __PYX_ERR(0, 3401, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "mathics/builtin/graphics.py":3400
 *                         [
 *                             Coords(elements, pos=p_origin(x)),
 *                             Coords(             # <<<<<<<<<<<<<<
 *                                 elements, pos=p_origin(x), d=p_self0(tick_large_size)
 *                             ),
 */
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, __pyx_t_15); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3400, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

        /* "mathics/builtin/graphics.py":3398
 *                 for x in ticks:
 *                     ticks_lines.append(
 *                         [             # <<<<<<<<<<<<<<
 *                             Coords(elements, pos=p_origin(x)),
 *                             Coords(
 */
        __pyx_t_15 = PyList_New(2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 3398, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_15);
        __Pyx_GIVEREF(__pyx_t_14);
        PyList_SET_ITEM(__pyx_t_15, 0, __pyx_t_14);
        __Pyx_GIVEREF(__pyx_t_2);
        PyList_SET_ITEM(__pyx_t_15, 1, __pyx_t_2);
        __pyx_t_14 = 0;
        __pyx_t_2 = 0;

        /* "mathics/builtin/graphics.py":3397
 *                 tick_label_style.extend(label_style)
 *                 for x in ticks:
 *                     ticks_lines.append(             # <<<<<<<<<<<<<<
 *                         [
 *                             Coords(elements, pos=p_origin(x)),
 */
        __pyx_t_19 = __Pyx_PyList_Append(__pyx_v_ticks_lines, __pyx_t_15); if (unlikely(__pyx_t_19 == ((int)-1))) __PYX_ERR(0, 3397, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

        /* "mathics/builtin/graphics.py":3405
 *                         ]
 *                     )
 *                     if ticks_int:             # <<<<<<<<<<<<<<
 *                         content = String(str(int(x)))
 *                     elif x == floor(x):
 */
        __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_ticks_int); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 3405, __pyx_L1_error)
        if (__pyx_t_4) {

          /* "mathics/builtin/graphics.py":3406
 *                     )
 *                     if ticks_int:
 *                         content = String(str(int(x)))             # <<<<<<<<<<<<<<
 *                     elif x == floor(x):
 *                         content = String("%.1f" % x)  # e.g. 1.0 (instead of 1.)
 */
          __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_String); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3406, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_14 = __Pyx_PyNumber_Int(__pyx_v_x); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 3406, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_14);
          __pyx_t_8 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_14); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3406, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __pyx_t_14 = NULL;
          if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
            __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_2);
            if (likely(__pyx_t_14)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
              __Pyx_INCREF(__pyx_t_14);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_2, function);
            }
          }
          __pyx_t_15 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_14, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_8);
          __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 3406, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_15);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF_SET(__pyx_v_content, __pyx_t_15);
          __pyx_t_15 = 0;

          /* "mathics/builtin/graphics.py":3405
 *                         ]
 *                     )
 *                     if ticks_int:             # <<<<<<<<<<<<<<
 *                         content = String(str(int(x)))
 *                     elif x == floor(x):
 */
          goto __pyx_L29;
        }

        /* "mathics/builtin/graphics.py":3407
 *                     if ticks_int:
 *                         content = String(str(int(x)))
 *                     elif x == floor(x):             # <<<<<<<<<<<<<<
 *                         content = String("%.1f" % x)  # e.g. 1.0 (instead of 1.)
 *                     else:
 */
        __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_floor); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3407, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_8 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
          __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
          if (likely(__pyx_t_8)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
            __Pyx_INCREF(__pyx_t_8);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_2, function);
          }
        }
        __pyx_t_15 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_8, __pyx_v_x) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_x);
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 3407, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_15);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = PyObject_RichCompare(__pyx_v_x, __pyx_t_15, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3407, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 3407, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (__pyx_t_4) {

          /* "mathics/builtin/graphics.py":3408
 *                         content = String(str(int(x)))
 *                     elif x == floor(x):
 *                         content = String("%.1f" % x)  # e.g. 1.0 (instead of 1.)             # <<<<<<<<<<<<<<
 *                     else:
 *                         content = String("%g" % x)  # fix e.g. 0.6000000000000001
 */
          __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_String); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 3408, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_15);
          __pyx_t_8 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_1f, __pyx_v_x); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3408, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_14 = NULL;
          if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_15))) {
            __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_15);
            if (likely(__pyx_t_14)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15);
              __Pyx_INCREF(__pyx_t_14);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_15, function);
            }
          }
          __pyx_t_2 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_15, __pyx_t_14, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_15, __pyx_t_8);
          __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3408, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
          __Pyx_XDECREF_SET(__pyx_v_content, __pyx_t_2);
          __pyx_t_2 = 0;

          /* "mathics/builtin/graphics.py":3407
 *                     if ticks_int:
 *                         content = String(str(int(x)))
 *                     elif x == floor(x):             # <<<<<<<<<<<<<<
 *                         content = String("%.1f" % x)  # e.g. 1.0 (instead of 1.)
 *                     else:
 */
          goto __pyx_L29;
        }

        /* "mathics/builtin/graphics.py":3410
 *                         content = String("%.1f" % x)  # e.g. 1.0 (instead of 1.)
 *                     else:
 *                         content = String("%g" % x)  # fix e.g. 0.6000000000000001             # <<<<<<<<<<<<<<
 *                     add_element(
 *                         InsetBox(
 */
        /*else*/ {
          __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_String); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 3410, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_15);
          __pyx_t_8 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_g_2, __pyx_v_x); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3410, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_14 = NULL;
          if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_15))) {
            __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_15);
            if (likely(__pyx_t_14)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15);
              __Pyx_INCREF(__pyx_t_14);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_15, function);
            }
          }
          __pyx_t_2 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_15, __pyx_t_14, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_15, __pyx_t_8);
          __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3410, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
          __Pyx_XDECREF_SET(__pyx_v_content, __pyx_t_2);
          __pyx_t_2 = 0;
        }
        __pyx_L29:;

        /* "mathics/builtin/graphics.py":3412
 *                         content = String("%g" % x)  # fix e.g. 0.6000000000000001
 *                     add_element(
 *                         InsetBox(             # <<<<<<<<<<<<<<
 *                             elements,
 *                             tick_label_style,
 */
        __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_InsetBox); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3412, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);

        /* "mathics/builtin/graphics.py":3414
 *                         InsetBox(
 *                             elements,
 *                             tick_label_style,             # <<<<<<<<<<<<<<
 *                             content=content,
 *                             pos=Coords(
 */
        __pyx_t_15 = PyTuple_New(2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 3412, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_15);
        __Pyx_INCREF(__pyx_cur_scope->__pyx_v_elements);
        __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_elements);
        PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_cur_scope->__pyx_v_elements);
        __Pyx_INCREF(__pyx_v_tick_label_style);
        __Pyx_GIVEREF(__pyx_v_tick_label_style);
        PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_v_tick_label_style);

        /* "mathics/builtin/graphics.py":3415
 *                             elements,
 *                             tick_label_style,
 *                             content=content,             # <<<<<<<<<<<<<<
 *                             pos=Coords(
 *                                 elements, pos=p_origin(x), d=p_self0(-tick_label_d)
 */
        __pyx_t_8 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3415, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_content, __pyx_v_content) < 0) __PYX_ERR(0, 3415, __pyx_L1_error)

        /* "mathics/builtin/graphics.py":3416
 *                             tick_label_style,
 *                             content=content,
 *                             pos=Coords(             # <<<<<<<<<<<<<<
 *                                 elements, pos=p_origin(x), d=p_self0(-tick_label_d)
 *                             ),
 */
        __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_Coords); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 3416, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_14);

        /* "mathics/builtin/graphics.py":3417
 *                             content=content,
 *                             pos=Coords(
 *                                 elements, pos=p_origin(x), d=p_self0(-tick_label_d)             # <<<<<<<<<<<<<<
 *                             ),
 *                             opos=p_self0(1),
 */
        __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3416, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_INCREF(__pyx_cur_scope->__pyx_v_elements);
        __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_elements);
        PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_cur_scope->__pyx_v_elements);
        __pyx_t_12 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3417, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_INCREF(__pyx_v_p_origin);
        __pyx_t_1 = __pyx_v_p_origin; __pyx_t_17 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
          __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_1);
          if (likely(__pyx_t_17)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
            __Pyx_INCREF(__pyx_t_17);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_1, function);
          }
        }
        __pyx_t_13 = (__pyx_t_17) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_17, __pyx_v_x) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_x);
        __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
        if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3417, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_pos, __pyx_t_13) < 0) __PYX_ERR(0, 3417, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __pyx_t_1 = PyNumber_Negative(__pyx_v_tick_label_d); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3417, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_INCREF(__pyx_v_p_self0);
        __pyx_t_17 = __pyx_v_p_self0; __pyx_t_20 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_17))) {
          __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_17);
          if (likely(__pyx_t_20)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17);
            __Pyx_INCREF(__pyx_t_20);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_17, function);
          }
        }
        __pyx_t_13 = (__pyx_t_20) ? __Pyx_PyObject_Call2Args(__pyx_t_17, __pyx_t_20, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_17, __pyx_t_1);
        __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3417, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
        if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_d, __pyx_t_13) < 0) __PYX_ERR(0, 3417, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

        /* "mathics/builtin/graphics.py":3416
 *                             tick_label_style,
 *                             content=content,
 *                             pos=Coords(             # <<<<<<<<<<<<<<
 *                                 elements, pos=p_origin(x), d=p_self0(-tick_label_d)
 *                             ),
 */
        __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_5, __pyx_t_12); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3416, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_pos, __pyx_t_13) < 0) __PYX_ERR(0, 3415, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

        /* "mathics/builtin/graphics.py":3419
 *                                 elements, pos=p_origin(x), d=p_self0(-tick_label_d)
 *                             ),
 *                             opos=p_self0(1),             # <<<<<<<<<<<<<<
 *                         )
 *                     )
 */
        __Pyx_INCREF(__pyx_v_p_self0);
        __pyx_t_12 = __pyx_v_p_self0; __pyx_t_5 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_12);
          if (likely(__pyx_t_5)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_12, function);
          }
        }
        __pyx_t_13 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_12, __pyx_t_5, __pyx_int_1) : __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_int_1);
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3419, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_opos, __pyx_t_13) < 0) __PYX_ERR(0, 3415, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

        /* "mathics/builtin/graphics.py":3412
 *                         content = String("%g" % x)  # fix e.g. 0.6000000000000001
 *                     add_element(
 *                         InsetBox(             # <<<<<<<<<<<<<<
 *                             elements,
 *                             tick_label_style,
 */
        __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_15, __pyx_t_8); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3412, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

        /* "mathics/builtin/graphics.py":3411
 *                     else:
 *                         content = String("%g" % x)  # fix e.g. 0.6000000000000001
 *                     add_element(             # <<<<<<<<<<<<<<
 *                         InsetBox(
 *                             elements,
 */
        __pyx_t_8 = __pyx_pf_7mathics_7builtin_8graphics_11GraphicsBox_11create_axes_add_element(__pyx_v_add_element, __pyx_t_13); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3411, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

        /* "mathics/builtin/graphics.py":3396
 *                 tick_label_style = ticks_style[index].clone()
 *                 tick_label_style.extend(label_style)
 *                 for x in ticks:             # <<<<<<<<<<<<<<
 *                     ticks_lines.append(
 *                         [
 */
      }
      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

      /* "mathics/builtin/graphics.py":3422
 *                         )
 *                     )
 *                 for x in ticks_small:             # <<<<<<<<<<<<<<
 *                     pos = p_origin(x)
 *                     ticks_lines.append(
 */
      if (likely(PyList_CheckExact(__pyx_v_ticks_small)) || PyTuple_CheckExact(__pyx_v_ticks_small)) {
        __pyx_t_16 = __pyx_v_ticks_small; __Pyx_INCREF(__pyx_t_16); __pyx_t_18 = 0;
        __pyx_t_7 = NULL;
      } else {
        __pyx_t_18 = -1; __pyx_t_16 = PyObject_GetIter(__pyx_v_ticks_small); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 3422, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_16);
        __pyx_t_7 = Py_TYPE(__pyx_t_16)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3422, __pyx_L1_error)
      }
      for (;;) {
        if (likely(!__pyx_t_7)) {
          if (likely(PyList_CheckExact(__pyx_t_16))) {
            if (__pyx_t_18 >= PyList_GET_SIZE(__pyx_t_16)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_8 = PyList_GET_ITEM(__pyx_t_16, __pyx_t_18); __Pyx_INCREF(__pyx_t_8); __pyx_t_18++; if (unlikely(0 < 0)) __PYX_ERR(0, 3422, __pyx_L1_error)
            #else
            __pyx_t_8 = PySequence_ITEM(__pyx_t_16, __pyx_t_18); __pyx_t_18++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3422, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_8);
            #endif
          } else {
            if (__pyx_t_18 >= PyTuple_GET_SIZE(__pyx_t_16)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_16, __pyx_t_18); __Pyx_INCREF(__pyx_t_8); __pyx_t_18++; if (unlikely(0 < 0)) __PYX_ERR(0, 3422, __pyx_L1_error)
            #else
            __pyx_t_8 = PySequence_ITEM(__pyx_t_16, __pyx_t_18); __pyx_t_18++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3422, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_8);
            #endif
          }
        } else {
          __pyx_t_8 = __pyx_t_7(__pyx_t_16);
          if (unlikely(!__pyx_t_8)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 3422, __pyx_L1_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_8);
        }
        __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_8);
        __pyx_t_8 = 0;

        /* "mathics/builtin/graphics.py":3423
 *                     )
 *                 for x in ticks_small:
 *                     pos = p_origin(x)             # <<<<<<<<<<<<<<
 *                     ticks_lines.append(
 *                         [
 */
        __Pyx_INCREF(__pyx_v_p_origin);
        __pyx_t_13 = __pyx_v_p_origin; __pyx_t_15 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_13))) {
          __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_13);
          if (likely(__pyx_t_15)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
            __Pyx_INCREF(__pyx_t_15);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_13, function);
          }
        }
        __pyx_t_8 = (__pyx_t_15) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_15, __pyx_v_x) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_v_x);
        __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
        if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3423, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_XDECREF_SET(__pyx_v_pos, __pyx_t_8);
        __pyx_t_8 = 0;

        /* "mathics/builtin/graphics.py":3426
 *                     ticks_lines.append(
 *                         [
 *                             Coords(elements, pos=pos),             # <<<<<<<<<<<<<<
 *                             Coords(elements, pos=pos, d=p_self0(tick_small_size)),
 *                         ]
 */
        __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_Coords); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3426, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3426, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_INCREF(__pyx_cur_scope->__pyx_v_elements);
        __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_elements);
        PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_cur_scope->__pyx_v_elements);
        __pyx_t_15 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 3426, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_15);
        if (PyDict_SetItem(__pyx_t_15, __pyx_n_s_pos, __pyx_v_pos) < 0) __PYX_ERR(0, 3426, __pyx_L1_error)
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_13, __pyx_t_15); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3426, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

        /* "mathics/builtin/graphics.py":3427
 *                         [
 *                             Coords(elements, pos=pos),
 *                             Coords(elements, pos=pos, d=p_self0(tick_small_size)),             # <<<<<<<<<<<<<<
 *                         ]
 *                     )
 */
        __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_Coords); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 3427, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_15);
        __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3427, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_INCREF(__pyx_cur_scope->__pyx_v_elements);
        __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_elements);
        PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_cur_scope->__pyx_v_elements);
        __pyx_t_8 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3427, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_pos, __pyx_v_pos) < 0) __PYX_ERR(0, 3427, __pyx_L1_error)
        __pyx_t_5 = __Pyx_PyInt_From_long(__pyx_v_tick_small_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3427, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_INCREF(__pyx_v_p_self0);
        __pyx_t_14 = __pyx_v_p_self0; __pyx_t_17 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_14))) {
          __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_14);
          if (likely(__pyx_t_17)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
            __Pyx_INCREF(__pyx_t_17);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_14, function);
          }
        }
        __pyx_t_12 = (__pyx_t_17) ? __Pyx_PyObject_Call2Args(__pyx_t_14, __pyx_t_17, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_t_5);
        __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3427, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_d, __pyx_t_12) < 0) __PYX_ERR(0, 3427, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_13, __pyx_t_8); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3427, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

        /* "mathics/builtin/graphics.py":3425
 *                     pos = p_origin(x)
 *                     ticks_lines.append(
 *                         [             # <<<<<<<<<<<<<<
 *                             Coords(elements, pos=pos),
 *                             Coords(elements, pos=pos, d=p_self0(tick_small_size)),
 */
        __pyx_t_8 = PyList_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3425, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GIVEREF(__pyx_t_2);
        PyList_SET_ITEM(__pyx_t_8, 0, __pyx_t_2);
        __Pyx_GIVEREF(__pyx_t_12);
        PyList_SET_ITEM(__pyx_t_8, 1, __pyx_t_12);
        __pyx_t_2 = 0;
        __pyx_t_12 = 0;

        /* "mathics/builtin/graphics.py":3424
 *                 for x in ticks_small:
 *                     pos = p_origin(x)
 *                     ticks_lines.append(             # <<<<<<<<<<<<<<
 *                         [
 *                             Coords(elements, pos=pos),
 */
        __pyx_t_19 = __Pyx_PyList_Append(__pyx_v_ticks_lines, __pyx_t_8); if (unlikely(__pyx_t_19 == ((int)-1))) __PYX_ERR(0, 3424, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

        /* "mathics/builtin/graphics.py":3422
 *                         )
 *                     )
 *                 for x in ticks_small:             # <<<<<<<<<<<<<<
 *                     pos = p_origin(x)
 *                     ticks_lines.append(
 */
      }
      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

      /* "mathics/builtin/graphics.py":3430
 *                         ]
 *                     )
 *                 add_element(LineBox(elements, axes_style[0], lines=ticks_lines))             # <<<<<<<<<<<<<<
 *         return axes
 * 
 */
      __Pyx_GetModuleGlobalName(__pyx_t_16, __pyx_n_s_LineBox); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 3430, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_16);
      __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_axes_style, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3430, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3430, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_elements);
      __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_elements);
      PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_cur_scope->__pyx_v_elements);
      __Pyx_GIVEREF(__pyx_t_8);
      PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_8);
      __pyx_t_8 = 0;
      __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3430, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_lines, __pyx_v_ticks_lines) < 0) __PYX_ERR(0, 3430, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_16, __pyx_t_12, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3430, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = __pyx_pf_7mathics_7builtin_8graphics_11GraphicsBox_11create_axes_add_element(__pyx_v_add_element, __pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3430, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "mathics/builtin/graphics.py":3376
 *             ]
 *         ):
 *             if axes[index]:             # <<<<<<<<<<<<<<
 *                 add_element(
 *                     LineBox(
 */
    }

    /* "mathics/builtin/graphics.py":3343
 *         ticks_y_int = all(floor(x) == x for x in ticks_y)
 * 
 *         for index, (             # <<<<<<<<<<<<<<
 *             min,
 *             max,
 */
  }
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":3431
 *                     )
 *                 add_element(LineBox(elements, axes_style[0], lines=ticks_lines))
 *         return axes             # <<<<<<<<<<<<<<
 * 
 *         """if axes[1]:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_axes);
  __pyx_r = __pyx_v_axes;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":3302
 *         return ticks, ticks_small, origin_x
 * 
 *     def create_axes(self, elements, graphics_options, xmin, xmax, ymin, ymax):             # <<<<<<<<<<<<<<
 *         axes = graphics_options.get("System`Axes")
 *         if axes.is_true():
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_XDECREF(__pyx_t_20);
  __Pyx_AddTraceback("mathics.builtin.graphics.GraphicsBox.create_axes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_axes);
  __Pyx_XDECREF(__pyx_v_ticks_style);
  __Pyx_XDECREF(__pyx_v_axes_style);
  __Pyx_XDECREF(__pyx_v_label_style);
  __Pyx_XDECREF(__pyx_v_add_element);
  __Pyx_XDECREF(__pyx_v_ticks_x_small);
  __Pyx_XDECREF(__pyx_v_ticks_y_small);
  __Pyx_XDECREF(__pyx_v_axes_extra);
  __Pyx_XDECREF(__pyx_v_tick_label_d);
  __Pyx_XDECREF(__pyx_v_ticks_x_int);
  __Pyx_XDECREF(__pyx_v_ticks_y_int);
  __Pyx_XDECREF(__pyx_v_index);
  __Pyx_XDECREF(__pyx_v_min);
  __Pyx_XDECREF(__pyx_v_max);
  __Pyx_XDECREF(__pyx_v_p_self0);
  __Pyx_XDECREF(__pyx_v_p_other0);
  __Pyx_XDECREF(__pyx_v_p_origin);
  __Pyx_XDECREF(__pyx_v_ticks);
  __Pyx_XDECREF(__pyx_v_ticks_small);
  __Pyx_XDECREF(__pyx_v_ticks_int);
  __Pyx_XDECREF(__pyx_v_ticks_lines);
  __Pyx_XDECREF(__pyx_v_tick_label_style);
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XDECREF(__pyx_v_content);
  __Pyx_XDECREF(__pyx_v_pos);
  __Pyx_XDECREF(__pyx_9genexpr62__pyx_v_s);
  __Pyx_XDECREF(__pyx_9genexpr63__pyx_v_s);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":3510
 *     }
 * 
 *     def do_blend(self, colors, values):             # <<<<<<<<<<<<<<
 *         type = None
 *         homogenous = True
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_5Blend_1do_blend(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_5Blend_1do_blend = {"do_blend", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_5Blend_1do_blend, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_5Blend_1do_blend(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_colors = 0;
  PyObject *__pyx_v_values = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("do_blend (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_colors,&__pyx_n_s_values,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_colors)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("do_blend", 1, 3, 3, 1); __PYX_ERR(0, 3510, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("do_blend", 1, 3, 3, 2); __PYX_ERR(0, 3510, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "do_blend") < 0)) __PYX_ERR(0, 3510, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_self = values[0];
    __pyx_v_colors = values[1];
    __pyx_v_values = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("do_blend", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3510, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.Blend.do_blend", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_5Blend_do_blend(__pyx_self, __pyx_v_self, __pyx_v_colors, __pyx_v_values);

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_5Blend_do_blend(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_colors, PyObject *__pyx_v_values) {
  PyObject *__pyx_v_type = NULL;
  int __pyx_v_homogenous;
  PyObject *__pyx_v_color = NULL;
  PyObject *__pyx_v_total = NULL;
  PyObject *__pyx_v_result = NULL;
  PyObject *__pyx_v_value = NULL;
  PyObject *__pyx_v_frac = NULL;
  PyObject *__pyx_v_part = NULL;
  PyObject *__pyx_9genexpr66__pyx_v_color = NULL;
  PyObject *__pyx_9genexpr67__pyx_v_component = NULL;
  PyObject *__pyx_9genexpr68__pyx_v_r = NULL;
  PyObject *__pyx_9genexpr68__pyx_v_p = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *(*__pyx_t_12)(PyObject *);
  Py_ssize_t __pyx_t_13;
  PyObject *(*__pyx_t_14)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("do_blend", 0);
  __Pyx_INCREF(__pyx_v_colors);

  /* "mathics/builtin/graphics.py":3511
 * 
 *     def do_blend(self, colors, values):
 *         type = None             # <<<<<<<<<<<<<<
 *         homogenous = True
 *         for color in colors:
 */
  __Pyx_INCREF(Py_None);
  __pyx_v_type = Py_None;

  /* "mathics/builtin/graphics.py":3512
 *     def do_blend(self, colors, values):
 *         type = None
 *         homogenous = True             # <<<<<<<<<<<<<<
 *         for color in colors:
 *             if type is None:
 */
  __pyx_v_homogenous = 1;

  /* "mathics/builtin/graphics.py":3513
 *         type = None
 *         homogenous = True
 *         for color in colors:             # <<<<<<<<<<<<<<
 *             if type is None:
 *                 type = color.__class__
 */
  if (likely(PyList_CheckExact(__pyx_v_colors)) || PyTuple_CheckExact(__pyx_v_colors)) {
    __pyx_t_1 = __pyx_v_colors; __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_colors); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3513, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3513, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 3513, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3513, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 3513, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3513, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 3513, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_color, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "mathics/builtin/graphics.py":3514
 *         homogenous = True
 *         for color in colors:
 *             if type is None:             # <<<<<<<<<<<<<<
 *                 type = color.__class__
 *             else:
 */
    __pyx_t_5 = (__pyx_v_type == Py_None);
    __pyx_t_6 = (__pyx_t_5 != 0);
    if (__pyx_t_6) {

      /* "mathics/builtin/graphics.py":3515
 *         for color in colors:
 *             if type is None:
 *                 type = color.__class__             # <<<<<<<<<<<<<<
 *             else:
 *                 if color.__class__ != type:
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_color, __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3515, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_type, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "mathics/builtin/graphics.py":3514
 *         homogenous = True
 *         for color in colors:
 *             if type is None:             # <<<<<<<<<<<<<<
 *                 type = color.__class__
 *             else:
 */
      goto __pyx_L5;
    }

    /* "mathics/builtin/graphics.py":3517
 *                 type = color.__class__
 *             else:
 *                 if color.__class__ != type:             # <<<<<<<<<<<<<<
 *                     homogenous = False
 *                     break
 */
    /*else*/ {
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_color, __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3517, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_7 = PyObject_RichCompare(__pyx_t_4, __pyx_v_type, Py_NE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3517, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 3517, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (__pyx_t_6) {

        /* "mathics/builtin/graphics.py":3518
 *             else:
 *                 if color.__class__ != type:
 *                     homogenous = False             # <<<<<<<<<<<<<<
 *                     break
 *         if not homogenous:
 */
        __pyx_v_homogenous = 0;

        /* "mathics/builtin/graphics.py":3519
 *                 if color.__class__ != type:
 *                     homogenous = False
 *                     break             # <<<<<<<<<<<<<<
 *         if not homogenous:
 *             colors = [RGBColor(components=color.to_rgba()) for color in colors]
 */
        goto __pyx_L4_break;

        /* "mathics/builtin/graphics.py":3517
 *                 type = color.__class__
 *             else:
 *                 if color.__class__ != type:             # <<<<<<<<<<<<<<
 *                     homogenous = False
 *                     break
 */
      }
    }
    __pyx_L5:;

    /* "mathics/builtin/graphics.py":3513
 *         type = None
 *         homogenous = True
 *         for color in colors:             # <<<<<<<<<<<<<<
 *             if type is None:
 *                 type = color.__class__
 */
  }
  __pyx_L4_break:;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":3520
 *                     homogenous = False
 *                     break
 *         if not homogenous:             # <<<<<<<<<<<<<<
 *             colors = [RGBColor(components=color.to_rgba()) for color in colors]
 *             type = RGBColor
 */
  __pyx_t_6 = ((!(__pyx_v_homogenous != 0)) != 0);
  if (__pyx_t_6) {

    /* "mathics/builtin/graphics.py":3521
 *                     break
 *         if not homogenous:
 *             colors = [RGBColor(components=color.to_rgba()) for color in colors]             # <<<<<<<<<<<<<<
 *             type = RGBColor
 *         total = sum(values)
 */
    { /* enter inner scope */
      __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3521, __pyx_L10_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (likely(PyList_CheckExact(__pyx_v_colors)) || PyTuple_CheckExact(__pyx_v_colors)) {
        __pyx_t_7 = __pyx_v_colors; __Pyx_INCREF(__pyx_t_7); __pyx_t_2 = 0;
        __pyx_t_3 = NULL;
      } else {
        __pyx_t_2 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_colors); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3521, __pyx_L10_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_3 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3521, __pyx_L10_error)
      }
      for (;;) {
        if (likely(!__pyx_t_3)) {
          if (likely(PyList_CheckExact(__pyx_t_7))) {
            if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_7)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_4 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 3521, __pyx_L10_error)
            #else
            __pyx_t_4 = PySequence_ITEM(__pyx_t_7, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3521, __pyx_L10_error)
            __Pyx_GOTREF(__pyx_t_4);
            #endif
          } else {
            if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 3521, __pyx_L10_error)
            #else
            __pyx_t_4 = PySequence_ITEM(__pyx_t_7, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3521, __pyx_L10_error)
            __Pyx_GOTREF(__pyx_t_4);
            #endif
          }
        } else {
          __pyx_t_4 = __pyx_t_3(__pyx_t_7);
          if (unlikely(!__pyx_t_4)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 3521, __pyx_L10_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_4);
        }
        __Pyx_XDECREF_SET(__pyx_9genexpr66__pyx_v_color, __pyx_t_4);
        __pyx_t_4 = 0;
        __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_RGBColor); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3521, __pyx_L10_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3521, __pyx_L10_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr66__pyx_v_color, __pyx_n_s_to_rgba); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3521, __pyx_L10_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_11 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
          __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10);
          if (likely(__pyx_t_11)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
            __Pyx_INCREF(__pyx_t_11);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_10, function);
          }
        }
        __pyx_t_9 = (__pyx_t_11) ? __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_11) : __Pyx_PyObject_CallNoArg(__pyx_t_10);
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3521, __pyx_L10_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_components, __pyx_t_9) < 0) __PYX_ERR(0, 3521, __pyx_L10_error)
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3521, __pyx_L10_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 3521, __pyx_L10_error)
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_9genexpr66__pyx_v_color); __pyx_9genexpr66__pyx_v_color = 0;
      goto __pyx_L13_exit_scope;
      __pyx_L10_error:;
      __Pyx_XDECREF(__pyx_9genexpr66__pyx_v_color); __pyx_9genexpr66__pyx_v_color = 0;
      goto __pyx_L1_error;
      __pyx_L13_exit_scope:;
    } /* exit inner scope */
    __Pyx_DECREF_SET(__pyx_v_colors, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "mathics/builtin/graphics.py":3522
 *         if not homogenous:
 *             colors = [RGBColor(components=color.to_rgba()) for color in colors]
 *             type = RGBColor             # <<<<<<<<<<<<<<
 *         total = sum(values)
 *         result = None
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_RGBColor); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3522, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v_type, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "mathics/builtin/graphics.py":3520
 *                     homogenous = False
 *                     break
 *         if not homogenous:             # <<<<<<<<<<<<<<
 *             colors = [RGBColor(components=color.to_rgba()) for color in colors]
 *             type = RGBColor
 */
  }

  /* "mathics/builtin/graphics.py":3523
 *             colors = [RGBColor(components=color.to_rgba()) for color in colors]
 *             type = RGBColor
 *         total = sum(values)             # <<<<<<<<<<<<<<
 *         result = None
 *         for color, value in zip(colors, values):
 */
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_v_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3523, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_total = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":3524
 *             type = RGBColor
 *         total = sum(values)
 *         result = None             # <<<<<<<<<<<<<<
 *         for color, value in zip(colors, values):
 *             frac = value / total
 */
  __Pyx_INCREF(Py_None);
  __pyx_v_result = ((PyObject*)Py_None);

  /* "mathics/builtin/graphics.py":3525
 *         total = sum(values)
 *         result = None
 *         for color, value in zip(colors, values):             # <<<<<<<<<<<<<<
 *             frac = value / total
 *             part = [component * frac for component in color.components]
 */
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3525, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_colors);
  __Pyx_GIVEREF(__pyx_v_colors);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_colors);
  __Pyx_INCREF(__pyx_v_values);
  __Pyx_GIVEREF(__pyx_v_values);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_values);
  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_1, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3525, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (likely(PyList_CheckExact(__pyx_t_7)) || PyTuple_CheckExact(__pyx_t_7)) {
    __pyx_t_1 = __pyx_t_7; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3525, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3525, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_7 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_7); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 3525, __pyx_L1_error)
        #else
        __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3525, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_7); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 3525, __pyx_L1_error)
        #else
        __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3525, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        #endif
      }
    } else {
      __pyx_t_7 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_7)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 3525, __pyx_L1_error)
        }
        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(0, 3525, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_9 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_9 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_8 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_8);
      #else
      __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3525, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3525, __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_4 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3525, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_12 = Py_TYPE(__pyx_t_4)->tp_iternext;
      index = 0; __pyx_t_9 = __pyx_t_12(__pyx_t_4); if (unlikely(!__pyx_t_9)) goto __pyx_L16_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_9);
      index = 1; __pyx_t_8 = __pyx_t_12(__pyx_t_4); if (unlikely(!__pyx_t_8)) goto __pyx_L16_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_8);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_4), 2) < 0) __PYX_ERR(0, 3525, __pyx_L1_error)
      __pyx_t_12 = NULL;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L17_unpacking_done;
      __pyx_L16_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_12 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 3525, __pyx_L1_error)
      __pyx_L17_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_color, __pyx_t_9);
    __pyx_t_9 = 0;
    __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_8);
    __pyx_t_8 = 0;

    /* "mathics/builtin/graphics.py":3526
 *         result = None
 *         for color, value in zip(colors, values):
 *             frac = value / total             # <<<<<<<<<<<<<<
 *             part = [component * frac for component in color.components]
 *             if result is None:
 */
    __pyx_t_7 = __Pyx_PyNumber_Divide(__pyx_v_value, __pyx_v_total); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3526, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_XDECREF_SET(__pyx_v_frac, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "mathics/builtin/graphics.py":3527
 *         for color, value in zip(colors, values):
 *             frac = value / total
 *             part = [component * frac for component in color.components]             # <<<<<<<<<<<<<<
 *             if result is None:
 *                 result = part
 */
    { /* enter inner scope */
      __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3527, __pyx_L20_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_color, __pyx_n_s_components); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3527, __pyx_L20_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (likely(PyList_CheckExact(__pyx_t_8)) || PyTuple_CheckExact(__pyx_t_8)) {
        __pyx_t_9 = __pyx_t_8; __Pyx_INCREF(__pyx_t_9); __pyx_t_13 = 0;
        __pyx_t_14 = NULL;
      } else {
        __pyx_t_13 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3527, __pyx_L20_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_14 = Py_TYPE(__pyx_t_9)->tp_iternext; if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 3527, __pyx_L20_error)
      }
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      for (;;) {
        if (likely(!__pyx_t_14)) {
          if (likely(PyList_CheckExact(__pyx_t_9))) {
            if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_9)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_8 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_13); __Pyx_INCREF(__pyx_t_8); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 3527, __pyx_L20_error)
            #else
            __pyx_t_8 = PySequence_ITEM(__pyx_t_9, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3527, __pyx_L20_error)
            __Pyx_GOTREF(__pyx_t_8);
            #endif
          } else {
            if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_9)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_13); __Pyx_INCREF(__pyx_t_8); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 3527, __pyx_L20_error)
            #else
            __pyx_t_8 = PySequence_ITEM(__pyx_t_9, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3527, __pyx_L20_error)
            __Pyx_GOTREF(__pyx_t_8);
            #endif
          }
        } else {
          __pyx_t_8 = __pyx_t_14(__pyx_t_9);
          if (unlikely(!__pyx_t_8)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 3527, __pyx_L20_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_8);
        }
        __Pyx_XDECREF_SET(__pyx_9genexpr67__pyx_v_component, __pyx_t_8);
        __pyx_t_8 = 0;
        __pyx_t_8 = PyNumber_Multiply(__pyx_9genexpr67__pyx_v_component, __pyx_v_frac); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3527, __pyx_L20_error)
        __Pyx_GOTREF(__pyx_t_8);
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 3527, __pyx_L20_error)
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_XDECREF(__pyx_9genexpr67__pyx_v_component); __pyx_9genexpr67__pyx_v_component = 0;
      goto __pyx_L23_exit_scope;
      __pyx_L20_error:;
      __Pyx_XDECREF(__pyx_9genexpr67__pyx_v_component); __pyx_9genexpr67__pyx_v_component = 0;
      goto __pyx_L1_error;
      __pyx_L23_exit_scope:;
    } /* exit inner scope */
    __Pyx_XDECREF_SET(__pyx_v_part, ((PyObject*)__pyx_t_7));
    __pyx_t_7 = 0;

    /* "mathics/builtin/graphics.py":3528
 *             frac = value / total
 *             part = [component * frac for component in color.components]
 *             if result is None:             # <<<<<<<<<<<<<<
 *                 result = part
 *             else:
 */
    __pyx_t_6 = (__pyx_v_result == ((PyObject*)Py_None));
    __pyx_t_5 = (__pyx_t_6 != 0);
    if (__pyx_t_5) {

      /* "mathics/builtin/graphics.py":3529
 *             part = [component * frac for component in color.components]
 *             if result is None:
 *                 result = part             # <<<<<<<<<<<<<<
 *             else:
 *                 result = [r + p for r, p in zip(result, part)]
 */
      __Pyx_INCREF(__pyx_v_part);
      __Pyx_DECREF_SET(__pyx_v_result, __pyx_v_part);

      /* "mathics/builtin/graphics.py":3528
 *             frac = value / total
 *             part = [component * frac for component in color.components]
 *             if result is None:             # <<<<<<<<<<<<<<
 *                 result = part
 *             else:
 */
      goto __pyx_L24;
    }

    /* "mathics/builtin/graphics.py":3531
 *                 result = part
 *             else:
 *                 result = [r + p for r, p in zip(result, part)]             # <<<<<<<<<<<<<<
 *         return type(components=result)
 * 
 */
    /*else*/ {
      { /* enter inner scope */
        __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3531, __pyx_L27_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3531, __pyx_L27_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_INCREF(__pyx_v_result);
        __Pyx_GIVEREF(__pyx_v_result);
        PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_result);
        __Pyx_INCREF(__pyx_v_part);
        __Pyx_GIVEREF(__pyx_v_part);
        PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_part);
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3531, __pyx_L27_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (likely(PyList_CheckExact(__pyx_t_8)) || PyTuple_CheckExact(__pyx_t_8)) {
          __pyx_t_9 = __pyx_t_8; __Pyx_INCREF(__pyx_t_9); __pyx_t_13 = 0;
          __pyx_t_14 = NULL;
        } else {
          __pyx_t_13 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3531, __pyx_L27_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_14 = Py_TYPE(__pyx_t_9)->tp_iternext; if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 3531, __pyx_L27_error)
        }
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        for (;;) {
          if (likely(!__pyx_t_14)) {
            if (likely(PyList_CheckExact(__pyx_t_9))) {
              if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_9)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_8 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_13); __Pyx_INCREF(__pyx_t_8); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 3531, __pyx_L27_error)
              #else
              __pyx_t_8 = PySequence_ITEM(__pyx_t_9, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3531, __pyx_L27_error)
              __Pyx_GOTREF(__pyx_t_8);
              #endif
            } else {
              if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_9)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_13); __Pyx_INCREF(__pyx_t_8); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 3531, __pyx_L27_error)
              #else
              __pyx_t_8 = PySequence_ITEM(__pyx_t_9, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3531, __pyx_L27_error)
              __Pyx_GOTREF(__pyx_t_8);
              #endif
            }
          } else {
            __pyx_t_8 = __pyx_t_14(__pyx_t_9);
            if (unlikely(!__pyx_t_8)) {
              PyObject* exc_type = PyErr_Occurred();
              if (exc_type) {
                if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                else __PYX_ERR(0, 3531, __pyx_L27_error)
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_8);
          }
          if ((likely(PyTuple_CheckExact(__pyx_t_8))) || (PyList_CheckExact(__pyx_t_8))) {
            PyObject* sequence = __pyx_t_8;
            Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
            if (unlikely(size != 2)) {
              if (size > 2) __Pyx_RaiseTooManyValuesError(2);
              else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
              __PYX_ERR(0, 3531, __pyx_L27_error)
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            if (likely(PyTuple_CheckExact(sequence))) {
              __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); 
              __pyx_t_10 = PyTuple_GET_ITEM(sequence, 1); 
            } else {
              __pyx_t_4 = PyList_GET_ITEM(sequence, 0); 
              __pyx_t_10 = PyList_GET_ITEM(sequence, 1); 
            }
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_10);
            #else
            __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3531, __pyx_L27_error)
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_10 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3531, __pyx_L27_error)
            __Pyx_GOTREF(__pyx_t_10);
            #endif
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          } else {
            Py_ssize_t index = -1;
            __pyx_t_11 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3531, __pyx_L27_error)
            __Pyx_GOTREF(__pyx_t_11);
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            __pyx_t_12 = Py_TYPE(__pyx_t_11)->tp_iternext;
            index = 0; __pyx_t_4 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_4)) goto __pyx_L30_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_L30_unpacking_failed;
            __Pyx_GOTREF(__pyx_t_10);
            if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 2) < 0) __PYX_ERR(0, 3531, __pyx_L27_error)
            __pyx_t_12 = NULL;
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            goto __pyx_L31_unpacking_done;
            __pyx_L30_unpacking_failed:;
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            __pyx_t_12 = NULL;
            if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
            __PYX_ERR(0, 3531, __pyx_L27_error)
            __pyx_L31_unpacking_done:;
          }
          __Pyx_XDECREF_SET(__pyx_9genexpr68__pyx_v_r, __pyx_t_4);
          __pyx_t_4 = 0;
          __Pyx_XDECREF_SET(__pyx_9genexpr68__pyx_v_p, __pyx_t_10);
          __pyx_t_10 = 0;
          __pyx_t_8 = PyNumber_Add(__pyx_9genexpr68__pyx_v_r, __pyx_9genexpr68__pyx_v_p); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3531, __pyx_L27_error)
          __Pyx_GOTREF(__pyx_t_8);
          if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 3531, __pyx_L27_error)
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        }
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_XDECREF(__pyx_9genexpr68__pyx_v_p); __pyx_9genexpr68__pyx_v_p = 0;
        __Pyx_XDECREF(__pyx_9genexpr68__pyx_v_r); __pyx_9genexpr68__pyx_v_r = 0;
        goto __pyx_L32_exit_scope;
        __pyx_L27_error:;
        __Pyx_XDECREF(__pyx_9genexpr68__pyx_v_p); __pyx_9genexpr68__pyx_v_p = 0;
        __Pyx_XDECREF(__pyx_9genexpr68__pyx_v_r); __pyx_9genexpr68__pyx_v_r = 0;
        goto __pyx_L1_error;
        __pyx_L32_exit_scope:;
      } /* exit inner scope */
      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_7));
      __pyx_t_7 = 0;
    }
    __pyx_L24:;

    /* "mathics/builtin/graphics.py":3525
 *         total = sum(values)
 *         result = None
 *         for color, value in zip(colors, values):             # <<<<<<<<<<<<<<
 *             frac = value / total
 *             part = [component * frac for component in color.components]
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":3532
 *             else:
 *                 result = [r + p for r, p in zip(result, part)]
 *         return type(components=result)             # <<<<<<<<<<<<<<
 * 
 *     def apply(self, colors, u, evaluation):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3532, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_components, __pyx_v_result) < 0) __PYX_ERR(0, 3532, __pyx_L1_error)
  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_v_type, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3532, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "mathics/builtin/graphics.py":3510
 *     }
 * 
 *     def do_blend(self, colors, values):             # <<<<<<<<<<<<<<
 *         type = None
 *         homogenous = True
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("mathics.builtin.graphics.Blend.do_blend", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_type);
  __Pyx_XDECREF(__pyx_v_color);
  __Pyx_XDECREF(__pyx_v_total);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XDECREF(__pyx_v_frac);
  __Pyx_XDECREF(__pyx_v_part);
  __Pyx_XDECREF(__pyx_9genexpr66__pyx_v_color);
  __Pyx_XDECREF(__pyx_9genexpr67__pyx_v_component);
  __Pyx_XDECREF(__pyx_9genexpr68__pyx_v_r);
  __Pyx_XDECREF(__pyx_9genexpr68__pyx_v_p);
  __Pyx_XDECREF(__pyx_v_colors);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":3534
 *         return type(components=result)
 * 
 *     def apply(self, colors, u, evaluation):             # <<<<<<<<<<<<<<
 *         "Blend[{colors___}, u_]"
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_5Blend_3apply(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7mathics_7builtin_8graphics_5Blend_2apply[] = "Blend[{colors___}, u_]";
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_5Blend_3apply = {"apply", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_5Blend_3apply, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7mathics_7builtin_8graphics_5Blend_2apply};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_5Blend_3apply(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_colors = 0;
  PyObject *__pyx_v_u = 0;
  PyObject *__pyx_v_evaluation = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("apply (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_colors,&__pyx_n_s_u,&__pyx_n_s_evaluation,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_colors)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("apply", 1, 4, 4, 1); __PYX_ERR(0, 3534, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_u)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("apply", 1, 4, 4, 2); __PYX_ERR(0, 3534, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_evaluation)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("apply", 1, 4, 4, 3); __PYX_ERR(0, 3534, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "apply") < 0)) __PYX_ERR(0, 3534, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __pyx_v_self = values[0];
    __pyx_v_colors = values[1];
    __pyx_v_u = values[2];
    __pyx_v_evaluation = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("apply", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3534, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mathics.builtin.graphics.Blend.apply", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_5Blend_2apply(__pyx_self, __pyx_v_self, __pyx_v_colors, __pyx_v_u, __pyx_v_evaluation);

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_5Blend_2apply(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_colors, PyObject *__pyx_v_u, PyObject *__pyx_v_evaluation) {
  PyObject *__pyx_v_colors_orig = NULL;
  PyObject *__pyx_v_values = NULL;
  int __pyx_v_use_list;
  PyObject *__pyx_v_x = NULL;
  PyObject *__pyx_v_pos = NULL;
  PyObject *__pyx_9genexpr69__pyx_v_color = NULL;
  PyObject *__pyx_9genexpr70__pyx_v_value = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  int __pyx_t_12;
  int __pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  Py_ssize_t __pyx_t_18;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("apply", 0);
  __Pyx_INCREF(__pyx_v_colors);

  /* "mathics/builtin/graphics.py":3537
 *         "Blend[{colors___}, u_]"
 * 
 *         colors_orig = colors             # <<<<<<<<<<<<<<
 *         try:
 *             colors = [_Color.create(color) for color in colors.get_sequence()]
 */
  __Pyx_INCREF(__pyx_v_colors);
  __pyx_v_colors_orig = __pyx_v_colors;

  /* "mathics/builtin/graphics.py":3538
 * 
 *         colors_orig = colors
 *         try:             # <<<<<<<<<<<<<<
 *             colors = [_Color.create(color) for color in colors.get_sequence()]
 *             if not colors:
 */
  {
    __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:*/ {

      /* "mathics/builtin/graphics.py":3539
 *         colors_orig = colors
 *         try:
 *             colors = [_Color.create(color) for color in colors.get_sequence()]             # <<<<<<<<<<<<<<
 *             if not colors:
 *                 raise ColorError
 */
      { /* enter inner scope */
        __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3539, __pyx_L11_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_colors, __pyx_n_s_get_sequence); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3539, __pyx_L11_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3539, __pyx_L11_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
          __pyx_t_6 = __pyx_t_5; __Pyx_INCREF(__pyx_t_6); __pyx_t_8 = 0;
          __pyx_t_9 = NULL;
        } else {
          __pyx_t_8 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3539, __pyx_L11_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_9 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3539, __pyx_L11_error)
        }
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        for (;;) {
          if (likely(!__pyx_t_9)) {
            if (likely(PyList_CheckExact(__pyx_t_6))) {
              if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_6)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_5 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 3539, __pyx_L11_error)
              #else
              __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3539, __pyx_L11_error)
              __Pyx_GOTREF(__pyx_t_5);
              #endif
            } else {
              if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 3539, __pyx_L11_error)
              #else
              __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3539, __pyx_L11_error)
              __Pyx_GOTREF(__pyx_t_5);
              #endif
            }
          } else {
            __pyx_t_5 = __pyx_t_9(__pyx_t_6);
            if (unlikely(!__pyx_t_5)) {
              PyObject* exc_type = PyErr_Occurred();
              if (exc_type) {
                if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                else __PYX_ERR(0, 3539, __pyx_L11_error)
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_5);
          }
          __Pyx_XDECREF_SET(__pyx_9genexpr69__pyx_v_color, __pyx_t_5);
          __pyx_t_5 = 0;
          __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Color); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3539, __pyx_L11_error)
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_create); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3539, __pyx_L11_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __pyx_t_7 = NULL;
          if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
            __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_10);
            if (likely(__pyx_t_7)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
              __Pyx_INCREF(__pyx_t_7);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_10, function);
            }
          }
          __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_7, __pyx_9genexpr69__pyx_v_color) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_9genexpr69__pyx_v_color);
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3539, __pyx_L11_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 3539, __pyx_L11_error)
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_XDECREF(__pyx_9genexpr69__pyx_v_color); __pyx_9genexpr69__pyx_v_color = 0;
        goto __pyx_L14_exit_scope;
        __pyx_L11_error:;
        __Pyx_XDECREF(__pyx_9genexpr69__pyx_v_color); __pyx_9genexpr69__pyx_v_color = 0;
        goto __pyx_L3_error;
        __pyx_L14_exit_scope:;
      } /* exit inner scope */
      __Pyx_DECREF_SET(__pyx_v_colors, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "mathics/builtin/graphics.py":3540
 *         try:
 *             colors = [_Color.create(color) for color in colors.get_sequence()]
 *             if not colors:             # <<<<<<<<<<<<<<
 *                 raise ColorError
 *         except ColorError:
 */
      __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_colors); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 3540, __pyx_L3_error)
      __pyx_t_12 = ((!__pyx_t_11) != 0);
      if (unlikely(__pyx_t_12)) {

        /* "mathics/builtin/graphics.py":3541
 *             colors = [_Color.create(color) for color in colors.get_sequence()]
 *             if not colors:
 *                 raise ColorError             # <<<<<<<<<<<<<<
 *         except ColorError:
 *             evaluation.message("Blend", "arg", Expression("List", colors_orig))
 */
        __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ColorError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3541, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_Raise(__pyx_t_4, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __PYX_ERR(0, 3541, __pyx_L3_error)

        /* "mathics/builtin/graphics.py":3540
 *         try:
 *             colors = [_Color.create(color) for color in colors.get_sequence()]
 *             if not colors:             # <<<<<<<<<<<<<<
 *                 raise ColorError
 *         except ColorError:
 */
      }

      /* "mathics/builtin/graphics.py":3538
 * 
 *         colors_orig = colors
 *         try:             # <<<<<<<<<<<<<<
 *             colors = [_Color.create(color) for color in colors.get_sequence()]
 *             if not colors:
 */
    }
    __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_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "mathics/builtin/graphics.py":3542
 *             if not colors:
 *                 raise ColorError
 *         except ColorError:             # <<<<<<<<<<<<<<
 *             evaluation.message("Blend", "arg", Expression("List", colors_orig))
 *             return
 */
    __Pyx_ErrFetch(&__pyx_t_4, &__pyx_t_6, &__pyx_t_5);
    __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_ColorError); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3542, __pyx_L5_except_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_13 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_4, __pyx_t_10);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_ErrRestore(__pyx_t_4, __pyx_t_6, __pyx_t_5);
    __pyx_t_4 = 0; __pyx_t_6 = 0; __pyx_t_5 = 0;
    if (__pyx_t_13) {
      __Pyx_AddTraceback("mathics.builtin.graphics.Blend.apply", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_4) < 0) __PYX_ERR(0, 3542, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_4);

      /* "mathics/builtin/graphics.py":3543
 *                 raise ColorError
 *         except ColorError:
 *             evaluation.message("Blend", "arg", Expression("List", colors_orig))             # <<<<<<<<<<<<<<
 *             return
 * 
 */
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_evaluation, __pyx_n_s_message); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3543, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_Expression); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 3543, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_15);
      __pyx_t_16 = NULL;
      __pyx_t_13 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_15))) {
        __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_15);
        if (likely(__pyx_t_16)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15);
          __Pyx_INCREF(__pyx_t_16);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_15, function);
          __pyx_t_13 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_15)) {
        PyObject *__pyx_temp[3] = {__pyx_t_16, __pyx_n_u_List, __pyx_v_colors_orig};
        __pyx_t_14 = __Pyx_PyFunction_FastCall(__pyx_t_15, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 3543, __pyx_L5_except_error)
        __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
        __Pyx_GOTREF(__pyx_t_14);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_15)) {
        PyObject *__pyx_temp[3] = {__pyx_t_16, __pyx_n_u_List, __pyx_v_colors_orig};
        __pyx_t_14 = __Pyx_PyCFunction_FastCall(__pyx_t_15, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 3543, __pyx_L5_except_error)
        __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
        __Pyx_GOTREF(__pyx_t_14);
      } else
      #endif
      {
        __pyx_t_17 = PyTuple_New(2+__pyx_t_13); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 3543, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_17);
        if (__pyx_t_16) {
          __Pyx_GIVEREF(__pyx_t_16); PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_16); __pyx_t_16 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_List);
        __Pyx_GIVEREF(__pyx_n_u_List);
        PyTuple_SET_ITEM(__pyx_t_17, 0+__pyx_t_13, __pyx_n_u_List);
        __Pyx_INCREF(__pyx_v_colors_orig);
        __Pyx_GIVEREF(__pyx_v_colors_orig);
        PyTuple_SET_ITEM(__pyx_t_17, 1+__pyx_t_13, __pyx_v_colors_orig);
        __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_17, NULL); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 3543, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      }
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      __pyx_t_15 = NULL;
      __pyx_t_13 = 0;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_15)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_15);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_13 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[4] = {__pyx_t_15, __pyx_n_u_Blend, __pyx_n_u_arg, __pyx_t_14};
        __pyx_t_10 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_13, 3+__pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3543, __pyx_L5_except_error)
        __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[4] = {__pyx_t_15, __pyx_n_u_Blend, __pyx_n_u_arg, __pyx_t_14};
        __pyx_t_10 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_13, 3+__pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3543, __pyx_L5_except_error)
        __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      } else
      #endif
      {
        __pyx_t_17 = PyTuple_New(3+__pyx_t_13); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 3543, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_17);
        if (__pyx_t_15) {
          __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_15); __pyx_t_15 = NULL;
        }
        __Pyx_INCREF(__pyx_n_u_Blend);
        __Pyx_GIVEREF(__pyx_n_u_Blend);
        PyTuple_SET_ITEM(__pyx_t_17, 0+__pyx_t_13, __pyx_n_u_Blend);
        __Pyx_INCREF(__pyx_n_u_arg);
        __Pyx_GIVEREF(__pyx_n_u_arg);
        PyTuple_SET_ITEM(__pyx_t_17, 1+__pyx_t_13, __pyx_n_u_arg);
        __Pyx_GIVEREF(__pyx_t_14);
        PyTuple_SET_ITEM(__pyx_t_17, 2+__pyx_t_13, __pyx_t_14);
        __pyx_t_14 = 0;
        __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_17, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3543, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

      /* "mathics/builtin/graphics.py":3544
 *         except ColorError:
 *             evaluation.message("Blend", "arg", Expression("List", colors_orig))
 *             return             # <<<<<<<<<<<<<<
 * 
 *         if u.has_form("List", None):
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L6_except_return;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "mathics/builtin/graphics.py":3538
 * 
 *         colors_orig = colors
 *         try:             # <<<<<<<<<<<<<<
 *             colors = [_Color.create(color) for color in colors.get_sequence()]
 *             if not colors:
 */
    __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_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L8_try_end:;
  }

  /* "mathics/builtin/graphics.py":3546
 *             return
 * 
 *         if u.has_form("List", None):             # <<<<<<<<<<<<<<
 *             values = [value.round_to_float(evaluation) for value in u.leaves]
 *             if None in values:
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_u, __pyx_n_s_has_form); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3546, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3546, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 3546, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__pyx_t_12) {

    /* "mathics/builtin/graphics.py":3547
 * 
 *         if u.has_form("List", None):
 *             values = [value.round_to_float(evaluation) for value in u.leaves]             # <<<<<<<<<<<<<<
 *             if None in values:
 *                 values = None
 */
    { /* enter inner scope */
      __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3547, __pyx_L21_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_u, __pyx_n_s_leaves); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3547, __pyx_L21_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
        __pyx_t_5 = __pyx_t_4; __Pyx_INCREF(__pyx_t_5); __pyx_t_8 = 0;
        __pyx_t_9 = NULL;
      } else {
        __pyx_t_8 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3547, __pyx_L21_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_9 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3547, __pyx_L21_error)
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      for (;;) {
        if (likely(!__pyx_t_9)) {
          if (likely(PyList_CheckExact(__pyx_t_5))) {
            if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_5)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 3547, __pyx_L21_error)
            #else
            __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3547, __pyx_L21_error)
            __Pyx_GOTREF(__pyx_t_4);
            #endif
          } else {
            if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 3547, __pyx_L21_error)
            #else
            __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3547, __pyx_L21_error)
            __Pyx_GOTREF(__pyx_t_4);
            #endif
          }
        } else {
          __pyx_t_4 = __pyx_t_9(__pyx_t_5);
          if (unlikely(!__pyx_t_4)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 3547, __pyx_L21_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_4);
        }
        __Pyx_XDECREF_SET(__pyx_9genexpr70__pyx_v_value, __pyx_t_4);
        __pyx_t_4 = 0;
        __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr70__pyx_v_value, __pyx_n_s_round_to_float); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3547, __pyx_L21_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_10);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_10, function);
          }
        }
        __pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_7, __pyx_v_evaluation) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_v_evaluation);
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3547, __pyx_L21_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_6, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 3547, __pyx_L21_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_9genexpr70__pyx_v_value); __pyx_9genexpr70__pyx_v_value = 0;
      goto __pyx_L24_exit_scope;
      __pyx_L21_error:;
      __Pyx_XDECREF(__pyx_9genexpr70__pyx_v_value); __pyx_9genexpr70__pyx_v_value = 0;
      goto __pyx_L1_error;
      __pyx_L24_exit_scope:;
    } /* exit inner scope */
    __pyx_v_values = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "mathics/builtin/graphics.py":3548
 *         if u.has_form("List", None):
 *             values = [value.round_to_float(evaluation) for value in u.leaves]
 *             if None in values:             # <<<<<<<<<<<<<<
 *                 values = None
 *             if len(u.leaves) != len(colors):
 */
    __pyx_t_12 = (__Pyx_PySequence_ContainsTF(Py_None, __pyx_v_values, Py_EQ)); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 3548, __pyx_L1_error)
    __pyx_t_11 = (__pyx_t_12 != 0);
    if (__pyx_t_11) {

      /* "mathics/builtin/graphics.py":3549
 *             values = [value.round_to_float(evaluation) for value in u.leaves]
 *             if None in values:
 *                 values = None             # <<<<<<<<<<<<<<
 *             if len(u.leaves) != len(colors):
 *                 values = None
 */
      __Pyx_INCREF(Py_None);
      __Pyx_DECREF_SET(__pyx_v_values, Py_None);

      /* "mathics/builtin/graphics.py":3548
 *         if u.has_form("List", None):
 *             values = [value.round_to_float(evaluation) for value in u.leaves]
 *             if None in values:             # <<<<<<<<<<<<<<
 *                 values = None
 *             if len(u.leaves) != len(colors):
 */
    }

    /* "mathics/builtin/graphics.py":3550
 *             if None in values:
 *                 values = None
 *             if len(u.leaves) != len(colors):             # <<<<<<<<<<<<<<
 *                 values = None
 *             use_list = True
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_u, __pyx_n_s_leaves); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3550, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = PyObject_Length(__pyx_t_6); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 3550, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_18 = PyObject_Length(__pyx_v_colors); if (unlikely(__pyx_t_18 == ((Py_ssize_t)-1))) __PYX_ERR(0, 3550, __pyx_L1_error)
    __pyx_t_11 = ((__pyx_t_8 != __pyx_t_18) != 0);
    if (__pyx_t_11) {

      /* "mathics/builtin/graphics.py":3551
 *                 values = None
 *             if len(u.leaves) != len(colors):
 *                 values = None             # <<<<<<<<<<<<<<
 *             use_list = True
 *         else:
 */
      __Pyx_INCREF(Py_None);
      __Pyx_DECREF_SET(__pyx_v_values, Py_None);

      /* "mathics/builtin/graphics.py":3550
 *             if None in values:
 *                 values = None
 *             if len(u.leaves) != len(colors):             # <<<<<<<<<<<<<<
 *                 values = None
 *             use_list = True
 */
    }

    /* "mathics/builtin/graphics.py":3552
 *             if len(u.leaves) != len(colors):
 *                 values = None
 *             use_list = True             # <<<<<<<<<<<<<<
 *         else:
 *             values = u.round_to_float(evaluation)
 */
    __pyx_v_use_list = 1;

    /* "mathics/builtin/graphics.py":3546
 *             return
 * 
 *         if u.has_form("List", None):             # <<<<<<<<<<<<<<
 *             values = [value.round_to_float(evaluation) for value in u.leaves]
 *             if None in values:
 */
    goto __pyx_L18;
  }

  /* "mathics/builtin/graphics.py":3554
 *             use_list = True
 *         else:
 *             values = u.round_to_float(evaluation)             # <<<<<<<<<<<<<<
 *             if values is None:
 *                 pass
 */
  /*else*/ {
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_u, __pyx_n_s_round_to_float); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3554, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_6 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_v_evaluation) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_evaluation);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3554, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_values = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "mathics/builtin/graphics.py":3555
 *         else:
 *             values = u.round_to_float(evaluation)
 *             if values is None:             # <<<<<<<<<<<<<<
 *                 pass
 *             elif values > 1:
 */
    __pyx_t_11 = (__pyx_v_values == Py_None);
    __pyx_t_12 = (__pyx_t_11 != 0);
    if (__pyx_t_12) {
      goto __pyx_L27;
    }

    /* "mathics/builtin/graphics.py":3557
 *             if values is None:
 *                 pass
 *             elif values > 1:             # <<<<<<<<<<<<<<
 *                 values = 1.0
 *             elif values < 0:
 */
    __pyx_t_6 = PyObject_RichCompare(__pyx_v_values, __pyx_int_1, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3557, __pyx_L1_error)
    __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 3557, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (__pyx_t_12) {

      /* "mathics/builtin/graphics.py":3558
 *                 pass
 *             elif values > 1:
 *                 values = 1.0             # <<<<<<<<<<<<<<
 *             elif values < 0:
 *                 values = 0.0
 */
      __Pyx_INCREF(__pyx_float_1_0);
      __Pyx_DECREF_SET(__pyx_v_values, __pyx_float_1_0);

      /* "mathics/builtin/graphics.py":3557
 *             if values is None:
 *                 pass
 *             elif values > 1:             # <<<<<<<<<<<<<<
 *                 values = 1.0
 *             elif values < 0:
 */
      goto __pyx_L27;
    }

    /* "mathics/builtin/graphics.py":3559
 *             elif values > 1:
 *                 values = 1.0
 *             elif values < 0:             # <<<<<<<<<<<<<<
 *                 values = 0.0
 *             use_list = False
 */
    __pyx_t_6 = PyObject_RichCompare(__pyx_v_values, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3559, __pyx_L1_error)
    __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 3559, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (__pyx_t_12) {

      /* "mathics/builtin/graphics.py":3560
 *                 values = 1.0
 *             elif values < 0:
 *                 values = 0.0             # <<<<<<<<<<<<<<
 *             use_list = False
 *         if values is None:
 */
      __Pyx_INCREF(__pyx_float_0_0);
      __Pyx_DECREF_SET(__pyx_v_values, __pyx_float_0_0);

      /* "mathics/builtin/graphics.py":3559
 *             elif values > 1:
 *                 values = 1.0
 *             elif values < 0:             # <<<<<<<<<<<<<<
 *                 values = 0.0
 *             use_list = False
 */
    }
    __pyx_L27:;

    /* "mathics/builtin/graphics.py":3561
 *             elif values < 0:
 *                 values = 0.0
 *             use_list = False             # <<<<<<<<<<<<<<
 *         if values is None:
 *             return evaluation.message(
 */
    __pyx_v_use_list = 0;
  }
  __pyx_L18:;

  /* "mathics/builtin/graphics.py":3562
 *                 values = 0.0
 *             use_list = False
 *         if values is None:             # <<<<<<<<<<<<<<
 *             return evaluation.message(
 *                 "Blend", "argl", u, Expression("List", colors_orig)
 */
  __pyx_t_12 = (__pyx_v_values == Py_None);
  __pyx_t_11 = (__pyx_t_12 != 0);
  if (__pyx_t_11) {

    /* "mathics/builtin/graphics.py":3563
 *             use_list = False
 *         if values is None:
 *             return evaluation.message(             # <<<<<<<<<<<<<<
 *                 "Blend", "argl", u, Expression("List", colors_orig)
 *             )
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_evaluation, __pyx_n_s_message); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3563, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);

    /* "mathics/builtin/graphics.py":3564
 *         if values is None:
 *             return evaluation.message(
 *                 "Blend", "argl", u, Expression("List", colors_orig)             # <<<<<<<<<<<<<<
 *             )
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_Expression); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3564, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_7 = NULL;
    __pyx_t_13 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_10);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_10, function);
        __pyx_t_13 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_10)) {
      PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_n_u_List, __pyx_v_colors_orig};
      __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3564, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_4);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) {
      PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_n_u_List, __pyx_v_colors_orig};
      __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3564, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_4);
    } else
    #endif
    {
      __pyx_t_17 = PyTuple_New(2+__pyx_t_13); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 3564, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_17);
      if (__pyx_t_7) {
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_7); __pyx_t_7 = NULL;
      }
      __Pyx_INCREF(__pyx_n_u_List);
      __Pyx_GIVEREF(__pyx_n_u_List);
      PyTuple_SET_ITEM(__pyx_t_17, 0+__pyx_t_13, __pyx_n_u_List);
      __Pyx_INCREF(__pyx_v_colors_orig);
      __Pyx_GIVEREF(__pyx_v_colors_orig);
      PyTuple_SET_ITEM(__pyx_t_17, 1+__pyx_t_13, __pyx_v_colors_orig);
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_17, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3564, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
    }
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_10 = NULL;
    __pyx_t_13 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_10)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_13 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[5] = {__pyx_t_10, __pyx_n_u_Blend, __pyx_n_u_argl, __pyx_v_u, __pyx_t_4};
      __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_13, 4+__pyx_t_13); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3563, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[5] = {__pyx_t_10, __pyx_n_u_Blend, __pyx_n_u_argl, __pyx_v_u, __pyx_t_4};
      __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_13, 4+__pyx_t_13); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3563, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else
    #endif
    {
      __pyx_t_17 = PyTuple_New(4+__pyx_t_13); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 3563, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_17);
      if (__pyx_t_10) {
        __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_10); __pyx_t_10 = NULL;
      }
      __Pyx_INCREF(__pyx_n_u_Blend);
      __Pyx_GIVEREF(__pyx_n_u_Blend);
      PyTuple_SET_ITEM(__pyx_t_17, 0+__pyx_t_13, __pyx_n_u_Blend);
      __Pyx_INCREF(__pyx_n_u_argl);
      __Pyx_GIVEREF(__pyx_n_u_argl);
      PyTuple_SET_ITEM(__pyx_t_17, 1+__pyx_t_13, __pyx_n_u_argl);
      __Pyx_INCREF(__pyx_v_u);
      __Pyx_GIVEREF(__pyx_v_u);
      PyTuple_SET_ITEM(__pyx_t_17, 2+__pyx_t_13, __pyx_v_u);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_17, 3+__pyx_t_13, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_17, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3563, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    goto __pyx_L0;

    /* "mathics/builtin/graphics.py":3562
 *                 values = 0.0
 *             use_list = False
 *         if values is None:             # <<<<<<<<<<<<<<
 *             return evaluation.message(
 *                 "Blend", "argl", u, Expression("List", colors_orig)
 */
  }

  /* "mathics/builtin/graphics.py":3567
 *             )
 * 
 *         if use_list:             # <<<<<<<<<<<<<<
 *             return self.do_blend(colors, values).to_expr()
 *         else:
 */
  __pyx_t_11 = (__pyx_v_use_list != 0);
  if (__pyx_t_11) {

    /* "mathics/builtin/graphics.py":3568
 * 
 *         if use_list:
 *             return self.do_blend(colors, values).to_expr()             # <<<<<<<<<<<<<<
 *         else:
 *             x = values
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_do_blend); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 3568, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_17);
    __pyx_t_4 = NULL;
    __pyx_t_13 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_17))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_17);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_17, function);
        __pyx_t_13 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_17)) {
      PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_colors, __pyx_v_values};
      __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_17, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3568, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_5);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_17)) {
      PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_colors, __pyx_v_values};
      __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_17, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3568, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_5);
    } else
    #endif
    {
      __pyx_t_10 = PyTuple_New(2+__pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3568, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      if (__pyx_t_4) {
        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_4); __pyx_t_4 = NULL;
      }
      __Pyx_INCREF(__pyx_v_colors);
      __Pyx_GIVEREF(__pyx_v_colors);
      PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_13, __pyx_v_colors);
      __Pyx_INCREF(__pyx_v_values);
      __Pyx_GIVEREF(__pyx_v_values);
      PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_13, __pyx_v_values);
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_17, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3568, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    }
    __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
    __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_to_expr); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 3568, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_17);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_17))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_17);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_17, function);
      }
    }
    __pyx_t_6 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_17, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_17);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3568, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    goto __pyx_L0;

    /* "mathics/builtin/graphics.py":3567
 *             )
 * 
 *         if use_list:             # <<<<<<<<<<<<<<
 *             return self.do_blend(colors, values).to_expr()
 *         else:
 */
  }

  /* "mathics/builtin/graphics.py":3570
 *             return self.do_blend(colors, values).to_expr()
 *         else:
 *             x = values             # <<<<<<<<<<<<<<
 *             pos = int(floor(x * (len(colors) - 1)))
 *             x = (x - pos * 1.0 / (len(colors) - 1)) * (len(colors) - 1)
 */
  /*else*/ {
    __Pyx_INCREF(__pyx_v_values);
    __pyx_v_x = __pyx_v_values;

    /* "mathics/builtin/graphics.py":3571
 *         else:
 *             x = values
 *             pos = int(floor(x * (len(colors) - 1)))             # <<<<<<<<<<<<<<
 *             x = (x - pos * 1.0 / (len(colors) - 1)) * (len(colors) - 1)
 *             if pos == len(colors) - 1:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_17, __pyx_n_s_floor); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 3571, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_17);
    __pyx_t_18 = PyObject_Length(__pyx_v_colors); if (unlikely(__pyx_t_18 == ((Py_ssize_t)-1))) __PYX_ERR(0, 3571, __pyx_L1_error)
    __pyx_t_5 = PyInt_FromSsize_t((__pyx_t_18 - 1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3571, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_10 = PyNumber_Multiply(__pyx_v_x, __pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3571, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_17))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_17);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_17, function);
      }
    }
    __pyx_t_6 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_17, __pyx_t_5, __pyx_t_10) : __Pyx_PyObject_CallOneArg(__pyx_t_17, __pyx_t_10);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3571, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
    __pyx_t_17 = __Pyx_PyNumber_Int(__pyx_t_6); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 3571, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_17);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_pos = __pyx_t_17;
    __pyx_t_17 = 0;

    /* "mathics/builtin/graphics.py":3572
 *             x = values
 *             pos = int(floor(x * (len(colors) - 1)))
 *             x = (x - pos * 1.0 / (len(colors) - 1)) * (len(colors) - 1)             # <<<<<<<<<<<<<<
 *             if pos == len(colors) - 1:
 *                 return colors[-1].to_expr()
 */
    __pyx_t_17 = PyNumber_Multiply(__pyx_v_pos, __pyx_float_1_0); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 3572, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_17);
    __pyx_t_18 = PyObject_Length(__pyx_v_colors); if (unlikely(__pyx_t_18 == ((Py_ssize_t)-1))) __PYX_ERR(0, 3572, __pyx_L1_error)
    __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_18 - 1)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3572, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_10 = __Pyx_PyNumber_Divide(__pyx_t_17, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3572, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyNumber_Subtract(__pyx_v_x, __pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3572, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_18 = PyObject_Length(__pyx_v_colors); if (unlikely(__pyx_t_18 == ((Py_ssize_t)-1))) __PYX_ERR(0, 3572, __pyx_L1_error)
    __pyx_t_10 = PyInt_FromSsize_t((__pyx_t_18 - 1)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3572, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_17 = PyNumber_Multiply(__pyx_t_6, __pyx_t_10); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 3572, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_17);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF_SET(__pyx_v_x, __pyx_t_17);
    __pyx_t_17 = 0;

    /* "mathics/builtin/graphics.py":3573
 *             pos = int(floor(x * (len(colors) - 1)))
 *             x = (x - pos * 1.0 / (len(colors) - 1)) * (len(colors) - 1)
 *             if pos == len(colors) - 1:             # <<<<<<<<<<<<<<
 *                 return colors[-1].to_expr()
 *             else:
 */
    __pyx_t_18 = PyObject_Length(__pyx_v_colors); if (unlikely(__pyx_t_18 == ((Py_ssize_t)-1))) __PYX_ERR(0, 3573, __pyx_L1_error)
    __pyx_t_17 = PyInt_FromSsize_t((__pyx_t_18 - 1)); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 3573, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_17);
    __pyx_t_10 = PyObject_RichCompare(__pyx_v_pos, __pyx_t_17, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3573, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
    __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 3573, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (__pyx_t_11) {

      /* "mathics/builtin/graphics.py":3574
 *             x = (x - pos * 1.0 / (len(colors) - 1)) * (len(colors) - 1)
 *             if pos == len(colors) - 1:
 *                 return colors[-1].to_expr()             # <<<<<<<<<<<<<<
 *             else:
 *                 return self.do_blend(colors[pos : (pos + 2)], [1 - x, x]).to_expr()
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_17 = __Pyx_GetItemInt(__pyx_v_colors, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 3574, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_17);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_to_expr); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3574, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      __pyx_t_17 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_17)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_17);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
        }
      }
      __pyx_t_10 = (__pyx_t_17) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_17) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
      if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3574, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_r = __pyx_t_10;
      __pyx_t_10 = 0;
      goto __pyx_L0;

      /* "mathics/builtin/graphics.py":3573
 *             pos = int(floor(x * (len(colors) - 1)))
 *             x = (x - pos * 1.0 / (len(colors) - 1)) * (len(colors) - 1)
 *             if pos == len(colors) - 1:             # <<<<<<<<<<<<<<
 *                 return colors[-1].to_expr()
 *             else:
 */
    }

    /* "mathics/builtin/graphics.py":3576
 *                 return colors[-1].to_expr()
 *             else:
 *                 return self.do_blend(colors[pos : (pos + 2)], [1 - x, x]).to_expr()             # <<<<<<<<<<<<<<
 * 
 * 
 */
    /*else*/ {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_do_blend); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 3576, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_17);
      __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_v_pos, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3576, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_v_colors, 0, 0, &__pyx_v_pos, &__pyx_t_5, NULL, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3576, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_PyInt_SubtractCObj(__pyx_int_1, __pyx_v_x, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3576, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_7 = PyList_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3576, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5);
      PyList_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
      __Pyx_INCREF(__pyx_v_x);
      __Pyx_GIVEREF(__pyx_v_x);
      PyList_SET_ITEM(__pyx_t_7, 1, __pyx_v_x);
      __pyx_t_5 = 0;
      __pyx_t_5 = NULL;
      __pyx_t_13 = 0;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_17))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_17);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_17, function);
          __pyx_t_13 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_17)) {
        PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_4, __pyx_t_7};
        __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_17, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3576, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_17)) {
        PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_4, __pyx_t_7};
        __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_17, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3576, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      } else
      #endif
      {
        __pyx_t_14 = PyTuple_New(2+__pyx_t_13); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 3576, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_14);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_GIVEREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_13, __pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_7);
        PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_13, __pyx_t_7);
        __pyx_t_4 = 0;
        __pyx_t_7 = 0;
        __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_17, __pyx_t_14, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3576, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      }
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_to_expr); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 3576, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_17);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_17))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_17);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_17, function);
        }
      }
      __pyx_t_10 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_17, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_17);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3576, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      __pyx_r = __pyx_t_10;
      __pyx_t_10 = 0;
      goto __pyx_L0;
    }
  }

  /* "mathics/builtin/graphics.py":3534
 *         return type(components=result)
 * 
 *     def apply(self, colors, u, evaluation):             # <<<<<<<<<<<<<<
 *         "Blend[{colors___}, u_]"
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_AddTraceback("mathics.builtin.graphics.Blend.apply", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_colors_orig);
  __Pyx_XDECREF(__pyx_v_values);
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XDECREF(__pyx_v_pos);
  __Pyx_XDECREF(__pyx_9genexpr69__pyx_v_color);
  __Pyx_XDECREF(__pyx_9genexpr70__pyx_v_value);
  __Pyx_XDECREF(__pyx_v_colors);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mathics/builtin/graphics.py":3624
 *     text_name = None
 * 
 *     def __init__(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         super(_ColorObject, self).__init__(*args, **kwargs)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_12_ColorObject_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7mathics_7builtin_8graphics_12_ColorObject_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7mathics_7builtin_8graphics_12_ColorObject_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7mathics_7builtin_8graphics_12_ColorObject_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 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);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_args)) {
      __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_args);
  } else {
    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        default:
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "__init__") < 0)) __PYX_ERR(0, 3624, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3624, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("mathics.builtin.graphics._ColorObject.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7mathics_7builtin_8graphics_12_ColorObject___init__(__pyx_self, __pyx_v_self, __pyx_v_args, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_7mathics_7builtin_8graphics_12_ColorObject___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_v_text_name = NULL;
  PyObject *__pyx_v_doc = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "mathics/builtin/graphics.py":3625
 * 
 *     def __init__(self, *args, **kwargs):
 *         super(_ColorObject, self).__init__(*args, **kwargs)             # <<<<<<<<<<<<<<
 * 
 *         if self.text_name is None:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ColorObject); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3625, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3625, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_INCREF(__pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_self);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3625, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_init_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3625, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3625, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":3627
 *         super(_ColorObject, self).__init__(*args, **kwargs)
 * 
 *         if self.text_name is None:             # <<<<<<<<<<<<<<
 *             text_name = strip_context(self.get_name()).lower()
 *         else:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_text_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3627, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = (__pyx_t_1 == Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "mathics/builtin/graphics.py":3628
 * 
 *         if self.text_name is None:
 *             text_name = strip_context(self.get_name()).lower()             # <<<<<<<<<<<<<<
 *         else:
 *             text_name = self.text_name
 */
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_strip_context); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3628, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_get_name); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3628, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    __pyx_t_6 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3628, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3628, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_lower); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3628, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3628, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_text_name = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "mathics/builtin/graphics.py":3627
 *         super(_ColorObject, self).__init__(*args, **kwargs)
 * 
 *         if self.text_name is None:             # <<<<<<<<<<<<<<
 *             text_name = strip_context(self.get_name()).lower()
 *         else:
 */
    goto __pyx_L3;
  }

  /* "mathics/builtin/graphics.py":3630
 *             text_name = strip_context(self.get_name()).lower()
 *         else:
 *             text_name = self.text_name             # <<<<<<<<<<<<<<
 *         doc = """
 *             <dl>
 */
  /*else*/ {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_text_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3630, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_text_name = __pyx_t_1;
    __pyx_t_1 = 0;
  }
  __pyx_L3:;

  /* "mathics/builtin/graphics.py":3643
 *              = StyleBox[GraphicsBox[...], ...]
 *         """ % {
 *             "name": strip_context(self.get_name()),             # <<<<<<<<<<<<<<
 *             "text_name": text_name,
 *         }
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3643, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_strip_context); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3643, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_get_name); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3643, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
    }
  }
  __pyx_t_6 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3643, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3643, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_name, __pyx_t_5) < 0) __PYX_ERR(0, 3643, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":3644
 *         """ % {
 *             "name": strip_context(self.get_name()),
 *             "text_name": text_name,             # <<<<<<<<<<<<<<
 *         }
 *         if self.__doc__ is None:
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_text_name, __pyx_v_text_name) < 0) __PYX_ERR(0, 3643, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":3642
 *             >> %(name)s // ToBoxes
 *              = StyleBox[GraphicsBox[...], ...]
 *         """ % {             # <<<<<<<<<<<<<<
 *             "name": strip_context(self.get_name()),
 *             "text_name": text_name,
 */
  __pyx_t_5 = PyUnicode_Format(__pyx_kp_u_dl_dt_name_s_dd_represents_the, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3642, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_doc = ((PyObject*)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":3646
 *             "text_name": text_name,
 *         }
 *         if self.__doc__ is None:             # <<<<<<<<<<<<<<
 *             self.__doc__ = doc
 *         else:
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_doc); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3646, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = (__pyx_t_5 == Py_None);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "mathics/builtin/graphics.py":3647
 *         }
 *         if self.__doc__ is None:
 *             self.__doc__ = doc             # <<<<<<<<<<<<<<
 *         else:
 *             self.__doc__ = doc + self.__doc__
 */
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_doc, __pyx_v_doc) < 0) __PYX_ERR(0, 3647, __pyx_L1_error)

    /* "mathics/builtin/graphics.py":3646
 *             "text_name": text_name,
 *         }
 *         if self.__doc__ is None:             # <<<<<<<<<<<<<<
 *             self.__doc__ = doc
 *         else:
 */
    goto __pyx_L4;
  }

  /* "mathics/builtin/graphics.py":3649
 *             self.__doc__ = doc
 *         else:
 *             self.__doc__ = doc + self.__doc__             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_doc); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3649, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyNumber_Add(__pyx_v_doc, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3649, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_doc, __pyx_t_1) < 0) __PYX_ERR(0, 3649, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_L4:;

  /* "mathics/builtin/graphics.py":3624
 *     text_name = None
 * 
 *     def __init__(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         super(_ColorObject, self).__init__(*args, **kwargs)
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("mathics.builtin.graphics._ColorObject.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_text_name);
  __Pyx_XDECREF(__pyx_v_doc);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct___euclidean_distance *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct___euclidean_distance[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct___euclidean_distance = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct___euclidean_distance(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct___euclidean_distance > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct___euclidean_distance)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct___euclidean_distance[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct___euclidean_distance];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct___euclidean_distance));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct___euclidean_distance(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct___euclidean_distance *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct___euclidean_distance *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_a);
  Py_CLEAR(p->__pyx_v_b);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct___euclidean_distance < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct___euclidean_distance)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct___euclidean_distance[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct___euclidean_distance++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct___euclidean_distance *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct___euclidean_distance(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct___euclidean_distance *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct___euclidean_distance *)o;
  if (p->__pyx_v_a) {
    e = (*v)(p->__pyx_v_a, a); if (e) return e;
  }
  if (p->__pyx_v_b) {
    e = (*v)(p->__pyx_v_b, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7mathics_7builtin_8graphics___pyx_scope_struct___euclidean_distance(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct___euclidean_distance *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct___euclidean_distance *)o;
  tmp = ((PyObject*)p->__pyx_v_a);
  p->__pyx_v_a = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_b);
  p->__pyx_v_b = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct___euclidean_distance = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct___euclidean_distance", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct___euclidean_distance), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct___euclidean_distance, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct___euclidean_distance, /*tp_traverse*/
  __pyx_tp_clear_7mathics_7builtin_8graphics___pyx_scope_struct___euclidean_distance, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct___euclidean_distance, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_1_genexpr *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_1_genexpr[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_1_genexpr = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_1_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_1_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_1_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_1_genexpr[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_1_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_1_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_1_genexpr(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_1_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_x1);
  Py_CLEAR(p->__pyx_v_x2);
  Py_CLEAR(p->__pyx_t_0);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_1_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_1_genexpr)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_1_genexpr[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_1_genexpr++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_1_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_1_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_1_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_x1) {
    e = (*v)(p->__pyx_v_x1, a); if (e) return e;
  }
  if (p->__pyx_v_x2) {
    e = (*v)(p->__pyx_v_x2, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_1_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_1_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_1_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_1_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_1_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_1_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_2__extract_graphics *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_2__extract_graphics[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_2__extract_graphics = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_2__extract_graphics(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_2__extract_graphics > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_2__extract_graphics)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_2__extract_graphics[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_2__extract_graphics];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_2__extract_graphics));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_2__extract_graphics(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_2__extract_graphics *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_2__extract_graphics *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_elements);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_2__extract_graphics < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_2__extract_graphics)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_2__extract_graphics[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_2__extract_graphics++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_2__extract_graphics *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_2__extract_graphics(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_2__extract_graphics *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_2__extract_graphics *)o;
  if (p->__pyx_v_elements) {
    e = (*v)(p->__pyx_v_elements, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7mathics_7builtin_8graphics___pyx_scope_struct_2__extract_graphics(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_2__extract_graphics *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_2__extract_graphics *)o;
  tmp = ((PyObject*)p->__pyx_v_elements);
  p->__pyx_v_elements = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_2__extract_graphics = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_2__extract_graphics", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_2__extract_graphics), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_2__extract_graphics, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_2__extract_graphics, /*tp_traverse*/
  __pyx_tp_clear_7mathics_7builtin_8graphics___pyx_scope_struct_2__extract_graphics, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_2__extract_graphics, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_3_genexpr *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_3_genexpr[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_3_genexpr = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_3_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_3_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_3_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_3_genexpr[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_3_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_3_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_3_genexpr(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_3_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_element);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_3_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_3_genexpr)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_3_genexpr[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_3_genexpr++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_3_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_3_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_3_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_element) {
    e = (*v)(p->__pyx_v_element, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_3_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_3_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_3_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_3_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_3_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_3_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_4_apply_makeboxes *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_4_apply_makeboxes[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_4_apply_makeboxes = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_4_apply_makeboxes(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_4_apply_makeboxes > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_4_apply_makeboxes)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_4_apply_makeboxes[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_4_apply_makeboxes];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_4_apply_makeboxes));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_4_apply_makeboxes(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_4_apply_makeboxes *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_4_apply_makeboxes *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_convert);
  Py_CLEAR(p->__pyx_v_evaluation);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_4_apply_makeboxes < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_4_apply_makeboxes)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_4_apply_makeboxes[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_4_apply_makeboxes++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_4_apply_makeboxes *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_4_apply_makeboxes(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_4_apply_makeboxes *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_4_apply_makeboxes *)o;
  if (p->__pyx_v_convert) {
    e = (*v)(p->__pyx_v_convert, a); if (e) return e;
  }
  if (p->__pyx_v_evaluation) {
    e = (*v)(p->__pyx_v_evaluation, a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(p->__pyx_v_self, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7mathics_7builtin_8graphics___pyx_scope_struct_4_apply_makeboxes(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_4_apply_makeboxes *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_4_apply_makeboxes *)o;
  tmp = ((PyObject*)p->__pyx_v_convert);
  p->__pyx_v_convert = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_evaluation);
  p->__pyx_v_evaluation = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_self);
  p->__pyx_v_self = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_4_apply_makeboxes = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_4_apply_makeboxes", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_4_apply_makeboxes), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_4_apply_makeboxes, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_4_apply_makeboxes, /*tp_traverse*/
  __pyx_tp_clear_7mathics_7builtin_8graphics___pyx_scope_struct_4_apply_makeboxes, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_4_apply_makeboxes, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_5_convert *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_5_convert[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_5_convert = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_5_convert(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_5_convert > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_5_convert)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_5_convert[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_5_convert];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_5_convert));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_5_convert(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_5_convert *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_5_convert *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_atoms);
  Py_CLEAR(p->__pyx_v_content);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_5_convert < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_5_convert)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_5_convert[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_5_convert++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_5_convert *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_5_convert(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_5_convert *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_5_convert *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_atoms) {
    e = (*v)(p->__pyx_v_atoms, a); if (e) return e;
  }
  if (p->__pyx_v_content) {
    e = (*v)(p->__pyx_v_content, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7mathics_7builtin_8graphics___pyx_scope_struct_5_convert(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_5_convert *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_5_convert *)o;
  tmp = ((PyObject*)p->__pyx_outer_scope);
  p->__pyx_outer_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_4_apply_makeboxes *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_atoms);
  p->__pyx_v_atoms = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_content);
  p->__pyx_v_content = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_5_convert = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_5_convert", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_5_convert), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_5_convert, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_5_convert, /*tp_traverse*/
  __pyx_tp_clear_7mathics_7builtin_8graphics___pyx_scope_struct_5_convert, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_5_convert, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_6_genexpr *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_6_genexpr[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_6_genexpr = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_6_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_6_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_6_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_6_genexpr[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_6_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_6_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_6_genexpr(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_6_genexpr *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_6_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_atom);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_6_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_6_genexpr)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_6_genexpr[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_6_genexpr++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_6_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_6_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_6_genexpr *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_6_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_atom) {
    e = (*v)(p->__pyx_v_atom, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_6_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_6_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_6_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_6_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_6_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_6_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_7_genexpr *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_7_genexpr[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_7_genexpr = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_7_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_7_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_7_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_7_genexpr[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_7_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_7_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_7_genexpr(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_7_genexpr *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_7_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_leaf);
  Py_CLEAR(p->__pyx_t_0);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_7_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_7_genexpr)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_7_genexpr[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_7_genexpr++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_7_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_7_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_7_genexpr *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_7_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_leaf) {
    e = (*v)(p->__pyx_v_leaf, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_7_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_7_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_7_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_7_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_7_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_7_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_8_hsl_to_rgba *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_8_hsl_to_rgba[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_8_hsl_to_rgba = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_8_hsl_to_rgba(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_8_hsl_to_rgba > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_8_hsl_to_rgba)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_8_hsl_to_rgba[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_8_hsl_to_rgba];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_8_hsl_to_rgba));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_8_hsl_to_rgba(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_8_hsl_to_rgba *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_8_hsl_to_rgba *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_p);
  Py_CLEAR(p->__pyx_v_q);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_8_hsl_to_rgba < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_8_hsl_to_rgba)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_8_hsl_to_rgba[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_8_hsl_to_rgba++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_8_hsl_to_rgba *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_8_hsl_to_rgba(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_8_hsl_to_rgba *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_8_hsl_to_rgba *)o;
  if (p->__pyx_v_p) {
    e = (*v)(p->__pyx_v_p, a); if (e) return e;
  }
  if (p->__pyx_v_q) {
    e = (*v)(p->__pyx_v_q, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7mathics_7builtin_8graphics___pyx_scope_struct_8_hsl_to_rgba(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_8_hsl_to_rgba *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_8_hsl_to_rgba *)o;
  tmp = ((PyObject*)p->__pyx_v_p);
  p->__pyx_v_p = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_q);
  p->__pyx_v_q = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_8_hsl_to_rgba = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_8_hsl_to_rgba", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_8_hsl_to_rgba), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_8_hsl_to_rgba, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_8_hsl_to_rgba, /*tp_traverse*/
  __pyx_tp_clear_7mathics_7builtin_8graphics___pyx_scope_struct_8_hsl_to_rgba, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_8_hsl_to_rgba, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_9_apply *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_9_apply[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_9_apply = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_9_apply(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_9_apply > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_9_apply)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_9_apply[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_9_apply];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_9_apply));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_9_apply(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_9_apply *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_9_apply *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_chroma);
  Py_CLEAR(p->__pyx_v_compute);
  Py_CLEAR(p->__pyx_v_distance_function);
  Py_CLEAR(p->__pyx_v_evaluation);
  Py_CLEAR(p->__pyx_v_lightness);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_9_apply < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_9_apply)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_9_apply[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_9_apply++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_9_apply *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_9_apply(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_9_apply *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_9_apply *)o;
  if (p->__pyx_v_chroma) {
    e = (*v)(p->__pyx_v_chroma, a); if (e) return e;
  }
  if (p->__pyx_v_compute) {
    e = (*v)(p->__pyx_v_compute, a); if (e) return e;
  }
  if (p->__pyx_v_distance_function) {
    e = (*v)(p->__pyx_v_distance_function, a); if (e) return e;
  }
  if (p->__pyx_v_evaluation) {
    e = (*v)(p->__pyx_v_evaluation, a); if (e) return e;
  }
  if (p->__pyx_v_lightness) {
    e = (*v)(p->__pyx_v_lightness, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7mathics_7builtin_8graphics___pyx_scope_struct_9_apply(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_9_apply *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_9_apply *)o;
  tmp = ((PyObject*)p->__pyx_v_chroma);
  p->__pyx_v_chroma = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_compute);
  p->__pyx_v_compute = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_distance_function);
  p->__pyx_v_distance_function = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_evaluation);
  p->__pyx_v_evaluation = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_lightness);
  p->__pyx_v_lightness = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_9_apply = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_9_apply", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_9_apply), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_9_apply, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_9_apply, /*tp_traverse*/
  __pyx_tp_clear_7mathics_7builtin_8graphics___pyx_scope_struct_9_apply, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_9_apply, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_10_to_svg *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_10_to_svg[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_10_to_svg = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_10_to_svg(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_10_to_svg > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_10_to_svg)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_10_to_svg[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_10_to_svg];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_10_to_svg));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_10_to_svg(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_10_to_svg *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_10_to_svg *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_ex);
  Py_CLEAR(p->__pyx_v_ey);
  Py_CLEAR(p->__pyx_v_large_arc);
  Py_CLEAR(p->__pyx_v_rx);
  Py_CLEAR(p->__pyx_v_ry);
  Py_CLEAR(p->__pyx_v_sx);
  Py_CLEAR(p->__pyx_v_sy);
  Py_CLEAR(p->__pyx_v_x);
  Py_CLEAR(p->__pyx_v_y);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_10_to_svg < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_10_to_svg)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_10_to_svg[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_10_to_svg++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_10_to_svg *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_10_to_svg(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_10_to_svg *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_10_to_svg *)o;
  if (p->__pyx_v_ex) {
    e = (*v)(p->__pyx_v_ex, a); if (e) return e;
  }
  if (p->__pyx_v_ey) {
    e = (*v)(p->__pyx_v_ey, a); if (e) return e;
  }
  if (p->__pyx_v_large_arc) {
    e = (*v)(p->__pyx_v_large_arc, a); if (e) return e;
  }
  if (p->__pyx_v_rx) {
    e = (*v)(p->__pyx_v_rx, a); if (e) return e;
  }
  if (p->__pyx_v_ry) {
    e = (*v)(p->__pyx_v_ry, a); if (e) return e;
  }
  if (p->__pyx_v_sx) {
    e = (*v)(p->__pyx_v_sx, a); if (e) return e;
  }
  if (p->__pyx_v_sy) {
    e = (*v)(p->__pyx_v_sy, a); if (e) return e;
  }
  if (p->__pyx_v_x) {
    e = (*v)(p->__pyx_v_x, a); if (e) return e;
  }
  if (p->__pyx_v_y) {
    e = (*v)(p->__pyx_v_y, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7mathics_7builtin_8graphics___pyx_scope_struct_10_to_svg(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_10_to_svg *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_10_to_svg *)o;
  tmp = ((PyObject*)p->__pyx_v_ex);
  p->__pyx_v_ex = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_ey);
  p->__pyx_v_ey = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_large_arc);
  p->__pyx_v_large_arc = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_rx);
  p->__pyx_v_rx = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_ry);
  p->__pyx_v_ry = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_sx);
  p->__pyx_v_sx = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_sy);
  p->__pyx_v_sy = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_x);
  p->__pyx_v_x = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_y);
  p->__pyx_v_y = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_10_to_svg = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_10_to_svg", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_10_to_svg), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_10_to_svg, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_10_to_svg, /*tp_traverse*/
  __pyx_tp_clear_7mathics_7builtin_8graphics___pyx_scope_struct_10_to_svg, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_10_to_svg, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_11_path *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_11_path[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_11_path = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_11_path(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_11_path > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_11_path)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_11_path[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_11_path];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_11_path));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_11_path(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_11_path *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_11_path *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_closed);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_11_path < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_11_path)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_11_path[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_11_path++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_11_path *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_11_path(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_11_path *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_11_path *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_closed) {
    e = (*v)(p->__pyx_v_closed, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_11_path = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_11_path", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_11_path), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_11_path, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_11_path, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_11_path, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_12_to_asy *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_12_to_asy[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_12_to_asy = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_12_to_asy(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_12_to_asy > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_12_to_asy)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_12_to_asy[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_12_to_asy];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_12_to_asy));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_12_to_asy(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_12_to_asy *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_12_to_asy *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_ex);
  Py_CLEAR(p->__pyx_v_ey);
  Py_CLEAR(p->__pyx_v_sx);
  Py_CLEAR(p->__pyx_v_sy);
  Py_CLEAR(p->__pyx_v_x);
  Py_CLEAR(p->__pyx_v_y);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_12_to_asy < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_12_to_asy)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_12_to_asy[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_12_to_asy++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_12_to_asy *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_12_to_asy(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_12_to_asy *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_12_to_asy *)o;
  if (p->__pyx_v_ex) {
    e = (*v)(p->__pyx_v_ex, a); if (e) return e;
  }
  if (p->__pyx_v_ey) {
    e = (*v)(p->__pyx_v_ey, a); if (e) return e;
  }
  if (p->__pyx_v_sx) {
    e = (*v)(p->__pyx_v_sx, a); if (e) return e;
  }
  if (p->__pyx_v_sy) {
    e = (*v)(p->__pyx_v_sy, a); if (e) return e;
  }
  if (p->__pyx_v_x) {
    e = (*v)(p->__pyx_v_x, a); if (e) return e;
  }
  if (p->__pyx_v_y) {
    e = (*v)(p->__pyx_v_y, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7mathics_7builtin_8graphics___pyx_scope_struct_12_to_asy(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_12_to_asy *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_12_to_asy *)o;
  tmp = ((PyObject*)p->__pyx_v_ex);
  p->__pyx_v_ex = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_ey);
  p->__pyx_v_ey = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_sx);
  p->__pyx_v_sx = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_sy);
  p->__pyx_v_sy = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_x);
  p->__pyx_v_x = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_y);
  p->__pyx_v_y = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_12_to_asy = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_12_to_asy", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_12_to_asy), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_12_to_asy, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_12_to_asy, /*tp_traverse*/
  __pyx_tp_clear_7mathics_7builtin_8graphics___pyx_scope_struct_12_to_asy, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_12_to_asy, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_13_path *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_13_path[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_13_path = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_13_path(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_13_path > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_13_path)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_13_path[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_13_path];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_13_path));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_13_path(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_13_path *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_13_path *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_closed);
  Py_CLEAR(p->__pyx_v_genexpr);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_13_path < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_13_path)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_13_path[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_13_path++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_13_path *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_13_path(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_13_path *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_13_path *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_closed) {
    e = (*v)(p->__pyx_v_closed, a); if (e) return e;
  }
  if (p->__pyx_v_genexpr) {
    e = (*v)(p->__pyx_v_genexpr, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_13_path = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_13_path", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_13_path), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_13_path, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_13_path, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_13_path, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_14_genexpr *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_14_genexpr[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_14_genexpr = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_14_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_14_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_14_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_14_genexpr[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_14_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_14_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_14_genexpr(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_14_genexpr *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_14_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_t);
  Py_CLEAR(p->__pyx_t_0);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_14_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_14_genexpr)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_14_genexpr[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_14_genexpr++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_14_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_14_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_14_genexpr *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_14_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_t) {
    e = (*v)(p->__pyx_v_t, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_14_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_14_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_14_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_14_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_14_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_14_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_15_genexpr *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_15_genexpr[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_15_genexpr = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_15_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_15_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_15_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_15_genexpr[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_15_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_15_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_15_genexpr(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_15_genexpr *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_15_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_t);
  Py_CLEAR(p->__pyx_t_0);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_15_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_15_genexpr)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_15_genexpr[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_15_genexpr++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_15_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_15_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_15_genexpr *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_15_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_t) {
    e = (*v)(p->__pyx_v_t, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_15_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_15_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_15_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_15_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_15_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_15_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_16_do_init *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_16_do_init[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_16_do_init = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_16_do_init(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_16_do_init > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_16_do_init)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_16_do_init[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_16_do_init];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_16_do_init));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_16_do_init(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_16_do_init *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_16_do_init *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_points);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_16_do_init < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_16_do_init)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_16_do_init[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_16_do_init++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_16_do_init *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_16_do_init(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_16_do_init *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_16_do_init *)o;
  if (p->__pyx_v_points) {
    e = (*v)(p->__pyx_v_points, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7mathics_7builtin_8graphics___pyx_scope_struct_16_do_init(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_16_do_init *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_16_do_init *)o;
  tmp = ((PyObject*)p->__pyx_v_points);
  p->__pyx_v_points = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_16_do_init = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_16_do_init", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_16_do_init), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_16_do_init, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_16_do_init, /*tp_traverse*/
  __pyx_tp_clear_7mathics_7builtin_8graphics___pyx_scope_struct_16_do_init, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_16_do_init, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_17_genexpr *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_17_genexpr[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_17_genexpr = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_17_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_17_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_17_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_17_genexpr[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_17_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_17_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_17_genexpr(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_17_genexpr *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_17_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_leaf);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_17_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_17_genexpr)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_17_genexpr[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_17_genexpr++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_17_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_17_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_17_genexpr *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_17_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_leaf) {
    e = (*v)(p->__pyx_v_leaf, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_17_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_17_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_17_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_17_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_17_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_17_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_18_init *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_18_init[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_18_init = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_18_init(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_18_init > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_18_init)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_18_init[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_18_init];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_18_init));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_18_init(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_18_init *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_18_init *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_points);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_18_init < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_18_init)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_18_init[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_18_init++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_18_init *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_18_init(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_18_init *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_18_init *)o;
  if (p->__pyx_v_points) {
    e = (*v)(p->__pyx_v_points, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7mathics_7builtin_8graphics___pyx_scope_struct_18_init(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_18_init *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_18_init *)o;
  tmp = ((PyObject*)p->__pyx_v_points);
  p->__pyx_v_points = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_18_init = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_18_init", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_18_init), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_18_init, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_18_init, /*tp_traverse*/
  __pyx_tp_clear_7mathics_7builtin_8graphics___pyx_scope_struct_18_init, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_18_init, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_19_genexpr *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_19_genexpr[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_19_genexpr = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_19_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_19_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_19_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_19_genexpr[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_19_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_19_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_19_genexpr(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_19_genexpr *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_19_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_leaf);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_19_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_19_genexpr)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_19_genexpr[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_19_genexpr++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_19_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_19_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_19_genexpr *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_19_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_leaf) {
    e = (*v)(p->__pyx_v_leaf, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_19_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_19_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_19_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_19_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_19_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_19_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_20__svg_bezier *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_20__svg_bezier[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_20__svg_bezier = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_20__svg_bezier(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_20__svg_bezier > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_20__svg_bezier)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_20__svg_bezier[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_20__svg_bezier];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_20__svg_bezier));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_20__svg_bezier(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_20__svg_bezier *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_20__svg_bezier *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_forms);
  Py_CLEAR(p->__pyx_v_k);
  Py_CLEAR(p->__pyx_v_p);
  Py_CLEAR(p->__pyx_v_path);
  Py_CLEAR(p->__pyx_v_s);
  Py_CLEAR(p->__pyx_v_segments);
  Py_CLEAR(p->__pyx_t_0);
  Py_CLEAR(p->__pyx_t_3);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_20__svg_bezier < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_20__svg_bezier)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_20__svg_bezier[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_20__svg_bezier++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_20__svg_bezier *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_20__svg_bezier(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_20__svg_bezier *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_20__svg_bezier *)o;
  if (p->__pyx_v_k) {
    e = (*v)(p->__pyx_v_k, a); if (e) return e;
  }
  if (p->__pyx_v_p) {
    e = (*v)(p->__pyx_v_p, a); if (e) return e;
  }
  if (p->__pyx_v_path) {
    e = (*v)(p->__pyx_v_path, a); if (e) return e;
  }
  if (p->__pyx_v_s) {
    e = (*v)(p->__pyx_v_s, a); if (e) return e;
  }
  if (p->__pyx_v_segments) {
    e = (*v)(p->__pyx_v_segments, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  if (p->__pyx_t_3) {
    e = (*v)(p->__pyx_t_3, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_20__svg_bezier = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_20__svg_bezier", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_20__svg_bezier), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_20__svg_bezier, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_20__svg_bezier, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_20__svg_bezier, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_21_path *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_21_path[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_21_path = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_21_path(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_21_path > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_21_path)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_21_path[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_21_path];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_21_path));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_21_path(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_21_path *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_21_path *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_genexpr);
  Py_CLEAR(p->__pyx_v_max_degree);
  Py_CLEAR(p->__pyx_v_n);
  Py_CLEAR(p->__pyx_v_p);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_21_path < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_21_path)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_21_path[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_21_path++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_21_path *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_21_path(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_21_path *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_21_path *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_genexpr) {
    e = (*v)(p->__pyx_v_genexpr, a); if (e) return e;
  }
  if (p->__pyx_v_max_degree) {
    e = (*v)(p->__pyx_v_max_degree, a); if (e) return e;
  }
  if (p->__pyx_v_n) {
    e = (*v)(p->__pyx_v_n, a); if (e) return e;
  }
  if (p->__pyx_v_p) {
    e = (*v)(p->__pyx_v_p, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_21_path = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_21_path", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_21_path), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_21_path, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_21_path, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_21_path, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_22_genexpr *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_22_genexpr[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_22_genexpr = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_22_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_22_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_22_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_22_genexpr[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_22_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_22_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_22_genexpr(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_22_genexpr *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_22_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_xy);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_22_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_22_genexpr)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_22_genexpr[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_22_genexpr++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_22_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_22_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_22_genexpr *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_22_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_xy) {
    e = (*v)(p->__pyx_v_xy, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_22_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_22_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_22_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_22_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_22_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_22_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_23__asy_bezier *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_23__asy_bezier[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_23__asy_bezier = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_23__asy_bezier(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_23__asy_bezier > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_23__asy_bezier)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_23__asy_bezier[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_23__asy_bezier];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_23__asy_bezier));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_23__asy_bezier(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_23__asy_bezier *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_23__asy_bezier *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_connect);
  Py_CLEAR(p->__pyx_v_cubic);
  Py_CLEAR(p->__pyx_v_forms);
  Py_CLEAR(p->__pyx_v_k);
  Py_CLEAR(p->__pyx_v_linear);
  Py_CLEAR(p->__pyx_v_p);
  Py_CLEAR(p->__pyx_v_path);
  Py_CLEAR(p->__pyx_v_quadratric);
  Py_CLEAR(p->__pyx_v_s);
  Py_CLEAR(p->__pyx_v_segments);
  Py_CLEAR(p->__pyx_t_0);
  Py_CLEAR(p->__pyx_t_1);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_23__asy_bezier < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_23__asy_bezier)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_23__asy_bezier[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_23__asy_bezier++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_23__asy_bezier *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_23__asy_bezier(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_23__asy_bezier *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_23__asy_bezier *)o;
  if (p->__pyx_v_connect) {
    e = (*v)(p->__pyx_v_connect, a); if (e) return e;
  }
  if (p->__pyx_v_cubic) {
    e = (*v)(p->__pyx_v_cubic, a); if (e) return e;
  }
  if (p->__pyx_v_forms) {
    e = (*v)(p->__pyx_v_forms, a); if (e) return e;
  }
  if (p->__pyx_v_k) {
    e = (*v)(p->__pyx_v_k, a); if (e) return e;
  }
  if (p->__pyx_v_linear) {
    e = (*v)(p->__pyx_v_linear, a); if (e) return e;
  }
  if (p->__pyx_v_p) {
    e = (*v)(p->__pyx_v_p, a); if (e) return e;
  }
  if (p->__pyx_v_path) {
    e = (*v)(p->__pyx_v_path, a); if (e) return e;
  }
  if (p->__pyx_v_quadratric) {
    e = (*v)(p->__pyx_v_quadratric, a); if (e) return e;
  }
  if (p->__pyx_v_s) {
    e = (*v)(p->__pyx_v_s, a); if (e) return e;
  }
  if (p->__pyx_v_segments) {
    e = (*v)(p->__pyx_v_segments, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  if (p->__pyx_t_1) {
    e = (*v)(p->__pyx_t_1, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_23__asy_bezier = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_23__asy_bezier", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_23__asy_bezier), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_23__asy_bezier, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_23__asy_bezier, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_23__asy_bezier, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_24_path *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_24_path[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_24_path = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_24_path(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_24_path > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_24_path)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_24_path[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_24_path];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_24_path));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_24_path(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_24_path *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_24_path *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_max_degree);
  Py_CLEAR(p->__pyx_v_n);
  Py_CLEAR(p->__pyx_v_p);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_24_path < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_24_path)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_24_path[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_24_path++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_24_path *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_24_path(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_24_path *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_24_path *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_max_degree) {
    e = (*v)(p->__pyx_v_max_degree, a); if (e) return e;
  }
  if (p->__pyx_v_n) {
    e = (*v)(p->__pyx_v_n, a); if (e) return e;
  }
  if (p->__pyx_v_p) {
    e = (*v)(p->__pyx_v_p, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_24_path = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_24_path", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_24_path), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_24_path, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_24_path, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_24_path, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_25_init *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_25_init[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_25_init = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_25_init(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_25_init > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_25_init)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_25_init[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_25_init];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_25_init));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_25_init(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_25_init *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_25_init *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_graphics);
  Py_CLEAR(p->__pyx_v_leaves);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_25_init < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_25_init)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_25_init[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_25_init++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_25_init *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_25_init(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_25_init *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_25_init *)o;
  if (p->__pyx_v_graphics) {
    e = (*v)(p->__pyx_v_graphics, a); if (e) return e;
  }
  if (p->__pyx_v_leaves) {
    e = (*v)(p->__pyx_v_leaves, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7mathics_7builtin_8graphics___pyx_scope_struct_25_init(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_25_init *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_25_init *)o;
  tmp = ((PyObject*)p->__pyx_v_graphics);
  p->__pyx_v_graphics = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_leaves);
  p->__pyx_v_leaves = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_25_init = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_25_init", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_25_init), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_25_init, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_25_init, /*tp_traverse*/
  __pyx_tp_clear_7mathics_7builtin_8graphics___pyx_scope_struct_25_init, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_25_init, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_26_parse_component *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_26_parse_component[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_26_parse_component = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_26_parse_component(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_26_parse_component > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_26_parse_component)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_26_parse_component[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_26_parse_component];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_26_parse_component));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_26_parse_component(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_26_parse_component *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_26_parse_component *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_coords);
  Py_CLEAR(p->__pyx_v_head);
  Py_CLEAR(p->__pyx_v_k);
  Py_CLEAR(p->__pyx_v_options);
  Py_CLEAR(p->__pyx_v_part);
  Py_CLEAR(p->__pyx_v_parts);
  Py_CLEAR(p->__pyx_v_segment);
  Py_CLEAR(p->__pyx_v_segments);
  Py_CLEAR(p->__pyx_v_spline_degree);
  Py_CLEAR(p->__pyx_9genexpr25__pyx_v_xy);
  Py_CLEAR(p->__pyx_t_0);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_26_parse_component < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_26_parse_component)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_26_parse_component[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_26_parse_component++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_26_parse_component *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_26_parse_component(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_26_parse_component *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_26_parse_component *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_coords) {
    e = (*v)(p->__pyx_v_coords, a); if (e) return e;
  }
  if (p->__pyx_v_head) {
    e = (*v)(p->__pyx_v_head, a); if (e) return e;
  }
  if (p->__pyx_v_k) {
    e = (*v)(p->__pyx_v_k, a); if (e) return e;
  }
  if (p->__pyx_v_options) {
    e = (*v)(p->__pyx_v_options, a); if (e) return e;
  }
  if (p->__pyx_v_part) {
    e = (*v)(p->__pyx_v_part, a); if (e) return e;
  }
  if (p->__pyx_v_parts) {
    e = (*v)(p->__pyx_v_parts, a); if (e) return e;
  }
  if (p->__pyx_v_segment) {
    e = (*v)(p->__pyx_v_segment, a); if (e) return e;
  }
  if (p->__pyx_v_segments) {
    e = (*v)(p->__pyx_v_segments, a); if (e) return e;
  }
  if (p->__pyx_v_spline_degree) {
    e = (*v)(p->__pyx_v_spline_degree, a); if (e) return e;
  }
  if (p->__pyx_9genexpr25__pyx_v_xy) {
    e = (*v)(p->__pyx_9genexpr25__pyx_v_xy, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_26_parse_component = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_26_parse_component", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_26_parse_component), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_26_parse_component, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_26_parse_component, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_26_parse_component, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_27_genexpr *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_27_genexpr[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_27_genexpr = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_27_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_27_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_27_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_27_genexpr[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_27_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_27_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_27_genexpr(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_27_genexpr *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_27_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_x);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_27_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_27_genexpr)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_27_genexpr[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_27_genexpr++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_27_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_27_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_27_genexpr *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_27_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_x) {
    e = (*v)(p->__pyx_v_x, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_27_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_27_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_27_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_27_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_27_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_27_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_28_to_svg *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_28_to_svg[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_28_to_svg = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_28_to_svg(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_28_to_svg > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_28_to_svg)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_28_to_svg[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_28_to_svg];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_28_to_svg));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_28_to_svg(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_28_to_svg *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_28_to_svg *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_28_to_svg < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_28_to_svg)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_28_to_svg[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_28_to_svg++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_28_to_svg *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_28_to_svg(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_28_to_svg *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_28_to_svg *)o;
  if (p->__pyx_v_self) {
    e = (*v)(p->__pyx_v_self, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7mathics_7builtin_8graphics___pyx_scope_struct_28_to_svg(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_28_to_svg *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_28_to_svg *)o;
  tmp = ((PyObject*)p->__pyx_v_self);
  p->__pyx_v_self = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_28_to_svg = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_28_to_svg", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_28_to_svg), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_28_to_svg, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_28_to_svg, /*tp_traverse*/
  __pyx_tp_clear_7mathics_7builtin_8graphics___pyx_scope_struct_28_to_svg, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_28_to_svg, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_29_components *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_29_components[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_29_components = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_29_components(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_29_components > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_29_components)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_29_components[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_29_components];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_29_components));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_29_components(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_29_components *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_29_components *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_component);
  Py_CLEAR(p->__pyx_9genexpr28__pyx_v_k);
  Py_CLEAR(p->__pyx_9genexpr28__pyx_v_p);
  Py_CLEAR(p->__pyx_v_transformed);
  Py_CLEAR(p->__pyx_9genexpr29__pyx_v_xy);
  Py_CLEAR(p->__pyx_t_0);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_29_components < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_29_components)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_29_components[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_29_components++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_29_components *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_29_components(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_29_components *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_29_components *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_component) {
    e = (*v)(p->__pyx_v_component, a); if (e) return e;
  }
  if (p->__pyx_9genexpr28__pyx_v_k) {
    e = (*v)(p->__pyx_9genexpr28__pyx_v_k, a); if (e) return e;
  }
  if (p->__pyx_9genexpr28__pyx_v_p) {
    e = (*v)(p->__pyx_9genexpr28__pyx_v_p, a); if (e) return e;
  }
  if (p->__pyx_v_transformed) {
    e = (*v)(p->__pyx_v_transformed, a); if (e) return e;
  }
  if (p->__pyx_9genexpr29__pyx_v_xy) {
    e = (*v)(p->__pyx_9genexpr29__pyx_v_xy, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_29_components = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_29_components", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_29_components), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_29_components, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_29_components, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_29_components, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_30_to_asy *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_30_to_asy[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_30_to_asy = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_30_to_asy(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_30_to_asy > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_30_to_asy)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_30_to_asy[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_30_to_asy];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_30_to_asy));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_30_to_asy(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_30_to_asy *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_30_to_asy *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_pen);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_30_to_asy < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_30_to_asy)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_30_to_asy[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_30_to_asy++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_30_to_asy *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_30_to_asy(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_30_to_asy *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_30_to_asy *)o;
  if (p->__pyx_v_pen) {
    e = (*v)(p->__pyx_v_pen, a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(p->__pyx_v_self, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7mathics_7builtin_8graphics___pyx_scope_struct_30_to_asy(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_30_to_asy *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_30_to_asy *)o;
  tmp = ((PyObject*)p->__pyx_v_pen);
  p->__pyx_v_pen = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_self);
  p->__pyx_v_self = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_30_to_asy = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_30_to_asy", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_30_to_asy), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_30_to_asy, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_30_to_asy, /*tp_traverse*/
  __pyx_tp_clear_7mathics_7builtin_8graphics___pyx_scope_struct_30_to_asy, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_30_to_asy, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_31_components *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_31_components[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_31_components = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_31_components(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_31_components > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_31_components)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_31_components[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_31_components];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_31_components));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_31_components(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_31_components *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_31_components *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_component);
  Py_CLEAR(p->__pyx_9genexpr30__pyx_v_k);
  Py_CLEAR(p->__pyx_9genexpr30__pyx_v_p);
  Py_CLEAR(p->__pyx_v_transformed);
  Py_CLEAR(p->__pyx_9genexpr31__pyx_v_xy);
  Py_CLEAR(p->__pyx_t_0);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_31_components < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_31_components)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_31_components[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_31_components++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_31_components *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_31_components(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_31_components *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_31_components *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_component) {
    e = (*v)(p->__pyx_v_component, a); if (e) return e;
  }
  if (p->__pyx_9genexpr30__pyx_v_k) {
    e = (*v)(p->__pyx_9genexpr30__pyx_v_k, a); if (e) return e;
  }
  if (p->__pyx_9genexpr30__pyx_v_p) {
    e = (*v)(p->__pyx_9genexpr30__pyx_v_p, a); if (e) return e;
  }
  if (p->__pyx_v_transformed) {
    e = (*v)(p->__pyx_v_transformed, a); if (e) return e;
  }
  if (p->__pyx_9genexpr31__pyx_v_xy) {
    e = (*v)(p->__pyx_9genexpr31__pyx_v_xy, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_31_components = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_31_components", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_31_components), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_31_components, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_31_components, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_31_components, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_32_to_svg *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_32_to_svg[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_32_to_svg = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_32_to_svg(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_32_to_svg > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_32_to_svg)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_32_to_svg[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_32_to_svg];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_32_to_svg));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_32_to_svg(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_32_to_svg *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_32_to_svg *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_line);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_32_to_svg < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_32_to_svg)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_32_to_svg[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_32_to_svg++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_32_to_svg *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_32_to_svg(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_32_to_svg *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_32_to_svg *)o;
  if (p->__pyx_v_line) {
    e = (*v)(p->__pyx_v_line, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7mathics_7builtin_8graphics___pyx_scope_struct_32_to_svg(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_32_to_svg *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_32_to_svg *)o;
  tmp = ((PyObject*)p->__pyx_v_line);
  p->__pyx_v_line = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_32_to_svg = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_32_to_svg", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_32_to_svg), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_32_to_svg, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_32_to_svg, /*tp_traverse*/
  __pyx_tp_clear_7mathics_7builtin_8graphics___pyx_scope_struct_32_to_svg, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_32_to_svg, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_33_genexpr *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_33_genexpr[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_33_genexpr = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_33_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_33_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_33_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_33_genexpr[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_33_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_33_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_33_genexpr(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_33_genexpr *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_33_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_coords);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_33_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_33_genexpr)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_33_genexpr[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_33_genexpr++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_33_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_33_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_33_genexpr *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_33_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_coords) {
    e = (*v)(p->__pyx_v_coords, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_33_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_33_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_33_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_33_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_33_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_33_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_34_init *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_34_init[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_34_init = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_34_init(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_34_init > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_34_init)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_34_init[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_34_init];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_34_init));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_34_init(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_34_init *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_34_init *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_n);
  Py_CLEAR(p->__pyx_v_phi0);
  Py_CLEAR(p->__pyx_v_pi2);
  Py_CLEAR(p->__pyx_v_r);
  Py_CLEAR(p->__pyx_v_x);
  Py_CLEAR(p->__pyx_v_y);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_34_init < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_34_init)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_34_init[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_34_init++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_34_init *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_34_init(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_34_init *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_34_init *)o;
  if (p->__pyx_v_n) {
    e = (*v)(p->__pyx_v_n, a); if (e) return e;
  }
  if (p->__pyx_v_phi0) {
    e = (*v)(p->__pyx_v_phi0, a); if (e) return e;
  }
  if (p->__pyx_v_pi2) {
    e = (*v)(p->__pyx_v_pi2, a); if (e) return e;
  }
  if (p->__pyx_v_r) {
    e = (*v)(p->__pyx_v_r, a); if (e) return e;
  }
  if (p->__pyx_v_x) {
    e = (*v)(p->__pyx_v_x, a); if (e) return e;
  }
  if (p->__pyx_v_y) {
    e = (*v)(p->__pyx_v_y, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7mathics_7builtin_8graphics___pyx_scope_struct_34_init(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_34_init *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_34_init *)o;
  tmp = ((PyObject*)p->__pyx_v_n);
  p->__pyx_v_n = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_phi0);
  p->__pyx_v_phi0 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_pi2);
  p->__pyx_v_pi2 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_r);
  p->__pyx_v_r = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_x);
  p->__pyx_v_x = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_y);
  p->__pyx_v_y = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_34_init = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_34_init", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_34_init), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_34_init, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_34_init, /*tp_traverse*/
  __pyx_tp_clear_7mathics_7builtin_8graphics___pyx_scope_struct_34_init, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_34_init, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_35_genexpr *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_35_genexpr[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_35_genexpr = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_35_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_35_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_35_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_35_genexpr[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_35_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_35_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_35_genexpr(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_35_genexpr *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_35_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_t);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_35_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_35_genexpr)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_35_genexpr[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_35_genexpr++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_35_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_35_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_35_genexpr *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_35_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_t) {
    e = (*v)(p->__pyx_v_t, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_35_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_35_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_35_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_35_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_35_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_35_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_36_vertices *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_36_vertices[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_36_vertices = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_36_vertices(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_36_vertices > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_36_vertices)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_36_vertices[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_36_vertices];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_36_vertices));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_36_vertices(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_36_vertices *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_36_vertices *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_i);
  Py_CLEAR(p->__pyx_v_phi);
  Py_CLEAR(p->__pyx_t_0);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_36_vertices < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_36_vertices)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_36_vertices[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_36_vertices++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_36_vertices *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_36_vertices(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_36_vertices *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_36_vertices *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_i) {
    e = (*v)(p->__pyx_v_i, a); if (e) return e;
  }
  if (p->__pyx_v_phi) {
    e = (*v)(p->__pyx_v_phi, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_36_vertices = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_36_vertices", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_36_vertices), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_36_vertices, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_36_vertices, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_36_vertices, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_37_heads *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_37_heads[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_37_heads = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_37_heads(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_37_heads > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_37_heads)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_37_heads[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_37_heads];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_37_heads));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_37_heads(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_37_heads *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_37_heads *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_arrow);
  Py_CLEAR(p->__pyx_v_custom_arrow);
  Py_CLEAR(p->__pyx_v_default_arrow);
  Py_CLEAR(p->__pyx_v_extent);
  Py_CLEAR(p->__pyx_v_genexpr);
  Py_CLEAR(p->__pyx_v_graphics);
  Py_CLEAR(p->__pyx_v_head);
  Py_CLEAR(p->__pyx_v_i);
  Py_CLEAR(p->__pyx_v_leaves);
  Py_CLEAR(p->__pyx_v_s);
  Py_CLEAR(p->__pyx_v_self);
  Py_CLEAR(p->__pyx_v_size_spec);
  Py_CLEAR(p->__pyx_v_spec);
  Py_CLEAR(p->__pyx_t_0);
  Py_CLEAR(p->__pyx_t_3);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_37_heads < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_37_heads)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_37_heads[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_37_heads++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_37_heads *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_37_heads(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_37_heads *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_37_heads *)o;
  if (p->__pyx_v_arrow) {
    e = (*v)(p->__pyx_v_arrow, a); if (e) return e;
  }
  if (p->__pyx_v_custom_arrow) {
    e = (*v)(p->__pyx_v_custom_arrow, a); if (e) return e;
  }
  if (p->__pyx_v_default_arrow) {
    e = (*v)(p->__pyx_v_default_arrow, a); if (e) return e;
  }
  if (p->__pyx_v_extent) {
    e = (*v)(p->__pyx_v_extent, a); if (e) return e;
  }
  if (p->__pyx_v_genexpr) {
    e = (*v)(p->__pyx_v_genexpr, a); if (e) return e;
  }
  if (p->__pyx_v_graphics) {
    e = (*v)(p->__pyx_v_graphics, a); if (e) return e;
  }
  if (p->__pyx_v_head) {
    e = (*v)(p->__pyx_v_head, a); if (e) return e;
  }
  if (p->__pyx_v_i) {
    e = (*v)(p->__pyx_v_i, a); if (e) return e;
  }
  if (p->__pyx_v_leaves) {
    e = (*v)(p->__pyx_v_leaves, a); if (e) return e;
  }
  if (p->__pyx_v_s) {
    e = (*v)(p->__pyx_v_s, a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(p->__pyx_v_self, a); if (e) return e;
  }
  if (p->__pyx_v_size_spec) {
    e = (*v)(p->__pyx_v_size_spec, a); if (e) return e;
  }
  if (p->__pyx_v_spec) {
    e = (*v)(p->__pyx_v_spec, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  if (p->__pyx_t_3) {
    e = (*v)(p->__pyx_t_3, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_37_heads = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_37_heads", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_37_heads), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_37_heads, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_37_heads, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_37_heads, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_38_genexpr *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_38_genexpr[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_38_genexpr = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_38_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_38_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_38_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_38_genexpr[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_38_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_38_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_38_genexpr(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_38_genexpr *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_38_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_x);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_38_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_38_genexpr)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_38_genexpr[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_38_genexpr++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_38_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_38_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_38_genexpr *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_38_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_x) {
    e = (*v)(p->__pyx_v_x, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_38_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_38_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_38_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_38_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_38_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_38_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_39_make_draw_svg *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_39_make_draw_svg[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_39_make_draw_svg = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_39_make_draw_svg(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_39_make_draw_svg > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_39_make_draw_svg)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_39_make_draw_svg[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_39_make_draw_svg];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_39_make_draw_svg));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_39_make_draw_svg(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_39_make_draw_svg *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_39_make_draw_svg *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_style);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_39_make_draw_svg < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_39_make_draw_svg)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_39_make_draw_svg[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_39_make_draw_svg++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_39_make_draw_svg *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_39_make_draw_svg(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_39_make_draw_svg *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_39_make_draw_svg *)o;
  if (p->__pyx_v_style) {
    e = (*v)(p->__pyx_v_style, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7mathics_7builtin_8graphics___pyx_scope_struct_39_make_draw_svg(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_39_make_draw_svg *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_39_make_draw_svg *)o;
  tmp = ((PyObject*)p->__pyx_v_style);
  p->__pyx_v_style = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_39_make_draw_svg = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_39_make_draw_svg", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_39_make_draw_svg), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_39_make_draw_svg, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_39_make_draw_svg, /*tp_traverse*/
  __pyx_tp_clear_7mathics_7builtin_8graphics___pyx_scope_struct_39_make_draw_svg, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_39_make_draw_svg, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_40_draw *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_40_draw[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_40_draw = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_40_draw(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_40_draw > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_40_draw)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_40_draw[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_40_draw];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_40_draw));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_40_draw(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_40_draw *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_40_draw *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_genexpr);
  Py_CLEAR(p->__pyx_v_points);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_40_draw < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_40_draw)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_40_draw[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_40_draw++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_40_draw *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_40_draw(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_40_draw *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_40_draw *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_genexpr) {
    e = (*v)(p->__pyx_v_genexpr, a); if (e) return e;
  }
  if (p->__pyx_v_points) {
    e = (*v)(p->__pyx_v_points, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_40_draw = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_40_draw", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_40_draw), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_40_draw, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_40_draw, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_40_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 PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_41_genexpr *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_41_genexpr[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_41_genexpr = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_41_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_41_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_41_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_41_genexpr[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_41_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_41_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_41_genexpr(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_41_genexpr *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_41_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_xy);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_41_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_41_genexpr)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_41_genexpr[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_41_genexpr++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_41_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_41_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_41_genexpr *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_41_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_xy) {
    e = (*v)(p->__pyx_v_xy, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_41_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_41_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_41_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_41_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_41_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_41_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_42_make_draw_asy *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_42_make_draw_asy[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_42_make_draw_asy = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_42_make_draw_asy(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_42_make_draw_asy > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_42_make_draw_asy)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_42_make_draw_asy[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_42_make_draw_asy];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_42_make_draw_asy));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_42_make_draw_asy(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_42_make_draw_asy *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_42_make_draw_asy *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_pen);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_42_make_draw_asy < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_42_make_draw_asy)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_42_make_draw_asy[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_42_make_draw_asy++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_42_make_draw_asy *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_42_make_draw_asy(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_42_make_draw_asy *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_42_make_draw_asy *)o;
  if (p->__pyx_v_pen) {
    e = (*v)(p->__pyx_v_pen, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7mathics_7builtin_8graphics___pyx_scope_struct_42_make_draw_asy(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_42_make_draw_asy *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_42_make_draw_asy *)o;
  tmp = ((PyObject*)p->__pyx_v_pen);
  p->__pyx_v_pen = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_42_make_draw_asy = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_42_make_draw_asy", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_42_make_draw_asy), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_42_make_draw_asy, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_42_make_draw_asy, /*tp_traverse*/
  __pyx_tp_clear_7mathics_7builtin_8graphics___pyx_scope_struct_42_make_draw_asy, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_42_make_draw_asy, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_43_draw *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_43_draw[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_43_draw = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_43_draw(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_43_draw > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_43_draw)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_43_draw[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_43_draw];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_43_draw));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_43_draw(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_43_draw *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_43_draw *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_points);
  Py_CLEAR(p->__pyx_9genexpr41__pyx_v_xy);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_43_draw < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_43_draw)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_43_draw[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_43_draw++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_43_draw *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_43_draw(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_43_draw *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_43_draw *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_points) {
    e = (*v)(p->__pyx_v_points, a); if (e) return e;
  }
  if (p->__pyx_9genexpr41__pyx_v_xy) {
    e = (*v)(p->__pyx_9genexpr41__pyx_v_xy, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_43_draw = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_43_draw", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_43_draw), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_43_draw, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_43_draw, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_43_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 PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_44_arrows *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_44_arrows[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_44_arrows = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_44_arrows(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_44_arrows > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_44_arrows)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_44_arrows[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_44_arrows];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_44_arrows));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_44_arrows(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_44_arrows *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_44_arrows *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_dl);
  Py_CLEAR(p->__pyx_v_draw);
  Py_CLEAR(p->__pyx_v_dx);
  Py_CLEAR(p->__pyx_v_dy);
  Py_CLEAR(p->__pyx_v_genexpr);
  Py_CLEAR(p->__pyx_v_heads);
  Py_CLEAR(p->__pyx_v_i);
  Py_CLEAR(p->__pyx_v_points);
  Py_CLEAR(p->__pyx_v_px);
  Py_CLEAR(p->__pyx_v_py);
  Py_CLEAR(p->__pyx_v_s);
  Py_CLEAR(p->__pyx_v_seg);
  Py_CLEAR(p->__pyx_v_segments);
  Py_CLEAR(p->__pyx_v_self);
  Py_CLEAR(p->__pyx_v_shape);
  Py_CLEAR(p->__pyx_v_t);
  Py_CLEAR(p->__pyx_v_t0);
  Py_CLEAR(p->__pyx_v_total);
  Py_CLEAR(p->__pyx_t_0);
  Py_CLEAR(p->__pyx_t_2);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_44_arrows < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_44_arrows)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_44_arrows[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_44_arrows++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_44_arrows *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_44_arrows(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_44_arrows *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_44_arrows *)o;
  if (p->__pyx_v_dl) {
    e = (*v)(p->__pyx_v_dl, a); if (e) return e;
  }
  if (p->__pyx_v_draw) {
    e = (*v)(p->__pyx_v_draw, a); if (e) return e;
  }
  if (p->__pyx_v_dx) {
    e = (*v)(p->__pyx_v_dx, a); if (e) return e;
  }
  if (p->__pyx_v_dy) {
    e = (*v)(p->__pyx_v_dy, a); if (e) return e;
  }
  if (p->__pyx_v_genexpr) {
    e = (*v)(p->__pyx_v_genexpr, a); if (e) return e;
  }
  if (p->__pyx_v_heads) {
    e = (*v)(p->__pyx_v_heads, a); if (e) return e;
  }
  if (p->__pyx_v_i) {
    e = (*v)(p->__pyx_v_i, a); if (e) return e;
  }
  if (p->__pyx_v_points) {
    e = (*v)(p->__pyx_v_points, a); if (e) return e;
  }
  if (p->__pyx_v_px) {
    e = (*v)(p->__pyx_v_px, a); if (e) return e;
  }
  if (p->__pyx_v_py) {
    e = (*v)(p->__pyx_v_py, a); if (e) return e;
  }
  if (p->__pyx_v_s) {
    e = (*v)(p->__pyx_v_s, a); if (e) return e;
  }
  if (p->__pyx_v_seg) {
    e = (*v)(p->__pyx_v_seg, a); if (e) return e;
  }
  if (p->__pyx_v_segments) {
    e = (*v)(p->__pyx_v_segments, a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(p->__pyx_v_self, a); if (e) return e;
  }
  if (p->__pyx_v_shape) {
    e = (*v)(p->__pyx_v_shape, a); if (e) return e;
  }
  if (p->__pyx_v_t) {
    e = (*v)(p->__pyx_v_t, a); if (e) return e;
  }
  if (p->__pyx_v_t0) {
    e = (*v)(p->__pyx_v_t0, a); if (e) return e;
  }
  if (p->__pyx_v_total) {
    e = (*v)(p->__pyx_v_total, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  if (p->__pyx_t_2) {
    e = (*v)(p->__pyx_t_2, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_44_arrows = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_44_arrows", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_44_arrows), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_44_arrows, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_44_arrows, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_44_arrows, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_45_segments *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_45_segments[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_45_segments = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_45_segments(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_45_segments > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_45_segments)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_45_segments[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_45_segments];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_45_segments));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_45_segments(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_45_segments *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_45_segments *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_dl);
  Py_CLEAR(p->__pyx_v_dx);
  Py_CLEAR(p->__pyx_v_dy);
  Py_CLEAR(p->__pyx_v_i);
  Py_CLEAR(p->__pyx_v_points);
  Py_CLEAR(p->__pyx_v_px);
  Py_CLEAR(p->__pyx_v_py);
  Py_CLEAR(p->__pyx_t_1);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_45_segments < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_45_segments)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_45_segments[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_45_segments++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_45_segments *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_45_segments(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_45_segments *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_45_segments *)o;
  if (p->__pyx_v_dl) {
    e = (*v)(p->__pyx_v_dl, a); if (e) return e;
  }
  if (p->__pyx_v_dx) {
    e = (*v)(p->__pyx_v_dx, a); if (e) return e;
  }
  if (p->__pyx_v_dy) {
    e = (*v)(p->__pyx_v_dy, a); if (e) return e;
  }
  if (p->__pyx_v_i) {
    e = (*v)(p->__pyx_v_i, a); if (e) return e;
  }
  if (p->__pyx_v_points) {
    e = (*v)(p->__pyx_v_points, a); if (e) return e;
  }
  if (p->__pyx_v_px) {
    e = (*v)(p->__pyx_v_px, a); if (e) return e;
  }
  if (p->__pyx_v_py) {
    e = (*v)(p->__pyx_v_py, a); if (e) return e;
  }
  if (p->__pyx_t_1) {
    e = (*v)(p->__pyx_t_1, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_45_segments = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_45_segments", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_45_segments), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_45_segments, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_45_segments, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_45_segments, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_46_genexpr *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_46_genexpr[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_46_genexpr = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_46_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_46_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_46_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_46_genexpr[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_46_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_46_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_46_genexpr(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_46_genexpr *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_46_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_segment);
  Py_CLEAR(p->__pyx_t_0);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_46_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_46_genexpr)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_46_genexpr[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_46_genexpr++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_46_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_46_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_46_genexpr *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_46_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_segment) {
    e = (*v)(p->__pyx_v_segment, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_46_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_46_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_46_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_46_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_46_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_46_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_47_genexpr *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_47_genexpr[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_47_genexpr = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_47_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_47_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_47_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_47_genexpr[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_47_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_47_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_47_genexpr(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_47_genexpr *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_47_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_draw);
  Py_CLEAR(p->__pyx_v_pos);
  Py_CLEAR(p->__pyx_v_s);
  Py_CLEAR(p->__pyx_t_0);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_47_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_47_genexpr)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_47_genexpr[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_47_genexpr++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_47_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_47_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_47_genexpr *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_47_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_draw) {
    e = (*v)(p->__pyx_v_draw, a); if (e) return e;
  }
  if (p->__pyx_v_pos) {
    e = (*v)(p->__pyx_v_pos, a); if (e) return e;
  }
  if (p->__pyx_v_s) {
    e = (*v)(p->__pyx_v_s, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_47_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_47_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_47_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_47_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_47_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_47_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_48_make_draw_svg *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_48_make_draw_svg[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_48_make_draw_svg = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_48_make_draw_svg(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_48_make_draw_svg > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_48_make_draw_svg)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_48_make_draw_svg[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_48_make_draw_svg];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_48_make_draw_svg));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_48_make_draw_svg(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_48_make_draw_svg *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_48_make_draw_svg *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_self);
  Py_CLEAR(p->__pyx_v_style);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_48_make_draw_svg < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_48_make_draw_svg)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_48_make_draw_svg[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_48_make_draw_svg++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_48_make_draw_svg *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_48_make_draw_svg(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_48_make_draw_svg *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_48_make_draw_svg *)o;
  if (p->__pyx_v_self) {
    e = (*v)(p->__pyx_v_self, a); if (e) return e;
  }
  if (p->__pyx_v_style) {
    e = (*v)(p->__pyx_v_style, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7mathics_7builtin_8graphics___pyx_scope_struct_48_make_draw_svg(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_48_make_draw_svg *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_48_make_draw_svg *)o;
  tmp = ((PyObject*)p->__pyx_v_self);
  p->__pyx_v_self = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_style);
  p->__pyx_v_style = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_48_make_draw_svg = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_48_make_draw_svg", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_48_make_draw_svg), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_48_make_draw_svg, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_48_make_draw_svg, /*tp_traverse*/
  __pyx_tp_clear_7mathics_7builtin_8graphics___pyx_scope_struct_48_make_draw_svg, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_48_make_draw_svg, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_49_draw *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_49_draw[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_49_draw = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_49_draw(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_49_draw > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_49_draw)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_49_draw[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_49_draw];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_49_draw));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_49_draw(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_49_draw *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_49_draw *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_points);
  Py_CLEAR(p->__pyx_v_s);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_49_draw < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_49_draw)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_49_draw[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_49_draw++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_49_draw *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_49_draw(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_49_draw *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_49_draw *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_points) {
    e = (*v)(p->__pyx_v_points, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_49_draw = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_49_draw", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_49_draw), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_49_draw, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_49_draw, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_49_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 PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_50_make_draw_asy *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_50_make_draw_asy[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_50_make_draw_asy = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_50_make_draw_asy(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_50_make_draw_asy > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_50_make_draw_asy)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_50_make_draw_asy[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_50_make_draw_asy];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_50_make_draw_asy));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_50_make_draw_asy(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_50_make_draw_asy *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_50_make_draw_asy *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_pen);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_50_make_draw_asy < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_50_make_draw_asy)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_50_make_draw_asy[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_50_make_draw_asy++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_50_make_draw_asy *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_50_make_draw_asy(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_50_make_draw_asy *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_50_make_draw_asy *)o;
  if (p->__pyx_v_pen) {
    e = (*v)(p->__pyx_v_pen, a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(p->__pyx_v_self, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7mathics_7builtin_8graphics___pyx_scope_struct_50_make_draw_asy(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_50_make_draw_asy *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_50_make_draw_asy *)o;
  tmp = ((PyObject*)p->__pyx_v_pen);
  p->__pyx_v_pen = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_self);
  p->__pyx_v_self = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_50_make_draw_asy = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_50_make_draw_asy", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_50_make_draw_asy), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_50_make_draw_asy, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_50_make_draw_asy, /*tp_traverse*/
  __pyx_tp_clear_7mathics_7builtin_8graphics___pyx_scope_struct_50_make_draw_asy, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_50_make_draw_asy, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_51_draw *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_51_draw[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_51_draw = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_51_draw(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_51_draw > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_51_draw)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_51_draw[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_51_draw];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_51_draw));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_51_draw(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_51_draw *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_51_draw *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_path);
  Py_CLEAR(p->__pyx_v_points);
  Py_CLEAR(p->__pyx_t_0);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_51_draw < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_51_draw)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_51_draw[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_51_draw++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_51_draw *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_51_draw(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_51_draw *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_51_draw *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_path) {
    e = (*v)(p->__pyx_v_path, a); if (e) return e;
  }
  if (p->__pyx_v_points) {
    e = (*v)(p->__pyx_v_points, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_51_draw = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_51_draw", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_51_draw), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_51_draw, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_51_draw, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_51_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 PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_52_arrows *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_52_arrows[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_52_arrows = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_52_arrows(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_52_arrows > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_52_arrows)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_52_arrows[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_52_arrows];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_52_arrows));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_52_arrows(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_52_arrows *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_52_arrows *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_cp);
  Py_CLEAR(p->__pyx_v_dcp);
  Py_CLEAR(p->__pyx_v_draw);
  Py_CLEAR(p->__pyx_v_heads);
  Py_CLEAR(p->__pyx_v_points);
  Py_CLEAR(p->__pyx_v_px);
  Py_CLEAR(p->__pyx_v_py);
  Py_CLEAR(p->__pyx_v_s);
  Py_CLEAR(p->__pyx_v_self);
  Py_CLEAR(p->__pyx_v_shape);
  Py_CLEAR(p->__pyx_v_t);
  Py_CLEAR(p->__pyx_v_tl);
  Py_CLEAR(p->__pyx_v_tx);
  Py_CLEAR(p->__pyx_v_ty);
  Py_CLEAR(p->__pyx_t_1);
  Py_CLEAR(p->__pyx_t_2);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_52_arrows < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_52_arrows)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_52_arrows[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_52_arrows++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_52_arrows *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_52_arrows(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_52_arrows *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_52_arrows *)o;
  if (p->__pyx_v_cp) {
    e = (*v)(p->__pyx_v_cp, a); if (e) return e;
  }
  if (p->__pyx_v_dcp) {
    e = (*v)(p->__pyx_v_dcp, a); if (e) return e;
  }
  if (p->__pyx_v_draw) {
    e = (*v)(p->__pyx_v_draw, a); if (e) return e;
  }
  if (p->__pyx_v_heads) {
    e = (*v)(p->__pyx_v_heads, a); if (e) return e;
  }
  if (p->__pyx_v_points) {
    e = (*v)(p->__pyx_v_points, a); if (e) return e;
  }
  if (p->__pyx_v_px) {
    e = (*v)(p->__pyx_v_px, a); if (e) return e;
  }
  if (p->__pyx_v_py) {
    e = (*v)(p->__pyx_v_py, a); if (e) return e;
  }
  if (p->__pyx_v_s) {
    e = (*v)(p->__pyx_v_s, a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(p->__pyx_v_self, a); if (e) return e;
  }
  if (p->__pyx_v_shape) {
    e = (*v)(p->__pyx_v_shape, a); if (e) return e;
  }
  if (p->__pyx_v_t) {
    e = (*v)(p->__pyx_v_t, a); if (e) return e;
  }
  if (p->__pyx_v_tl) {
    e = (*v)(p->__pyx_v_tl, a); if (e) return e;
  }
  if (p->__pyx_v_tx) {
    e = (*v)(p->__pyx_v_tx, a); if (e) return e;
  }
  if (p->__pyx_v_ty) {
    e = (*v)(p->__pyx_v_ty, a); if (e) return e;
  }
  if (p->__pyx_t_1) {
    e = (*v)(p->__pyx_t_1, a); if (e) return e;
  }
  if (p->__pyx_t_2) {
    e = (*v)(p->__pyx_t_2, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_52_arrows = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_52_arrows", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_52_arrows), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_52_arrows, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_52_arrows, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_52_arrows, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_53__setback_spec *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_53__setback_spec[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_53__setback_spec = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_53__setback_spec(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_53__setback_spec > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_53__setback_spec)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_53__setback_spec[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_53__setback_spec];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_53__setback_spec));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_53__setback_spec(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_53__setback_spec *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_53__setback_spec *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_leaves);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_53__setback_spec < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_53__setback_spec)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_53__setback_spec[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_53__setback_spec++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_53__setback_spec *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_53__setback_spec(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_53__setback_spec *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_53__setback_spec *)o;
  if (p->__pyx_v_leaves) {
    e = (*v)(p->__pyx_v_leaves, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7mathics_7builtin_8graphics___pyx_scope_struct_53__setback_spec(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_53__setback_spec *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_53__setback_spec *)o;
  tmp = ((PyObject*)p->__pyx_v_leaves);
  p->__pyx_v_leaves = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_53__setback_spec = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_53__setback_spec", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_53__setback_spec), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_53__setback_spec, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_53__setback_spec, /*tp_traverse*/
  __pyx_tp_clear_7mathics_7builtin_8graphics___pyx_scope_struct_53__setback_spec, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_53__setback_spec, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_54_genexpr *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_54_genexpr[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_54_genexpr = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_54_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_54_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_54_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_54_genexpr[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_54_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_54_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_54_genexpr(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_54_genexpr *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_54_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_l);
  Py_CLEAR(p->__pyx_t_0);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_54_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_54_genexpr)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_54_genexpr[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_54_genexpr++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_54_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_54_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_54_genexpr *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_54_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_l) {
    e = (*v)(p->__pyx_v_l, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_54_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_54_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_54_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_54_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_54_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_54_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_55__default_arrow *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_55__default_arrow[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_55__default_arrow = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_55__default_arrow(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_55__default_arrow > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_55__default_arrow)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_55__default_arrow[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_55__default_arrow];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_55__default_arrow));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_55__default_arrow(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_55__default_arrow *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_55__default_arrow *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_polygon);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_55__default_arrow < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_55__default_arrow)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_55__default_arrow[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_55__default_arrow++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_55__default_arrow *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_55__default_arrow(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_55__default_arrow *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_55__default_arrow *)o;
  if (p->__pyx_v_polygon) {
    e = (*v)(p->__pyx_v_polygon, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7mathics_7builtin_8graphics___pyx_scope_struct_55__default_arrow(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_55__default_arrow *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_55__default_arrow *)o;
  tmp = ((PyObject*)p->__pyx_v_polygon);
  p->__pyx_v_polygon = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_55__default_arrow = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_55__default_arrow", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_55__default_arrow), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_55__default_arrow, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_55__default_arrow, /*tp_traverse*/
  __pyx_tp_clear_7mathics_7builtin_8graphics___pyx_scope_struct_55__default_arrow, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_55__default_arrow, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_56_draw *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_56_draw[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_56_draw = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_56_draw(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_56_draw > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_56_draw)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_56_draw[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_56_draw];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_56_draw));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_56_draw(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_56_draw *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_56_draw *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_bx);
  Py_CLEAR(p->__pyx_v_by);
  Py_CLEAR(p->__pyx_v_ex);
  Py_CLEAR(p->__pyx_v_ey);
  Py_CLEAR(p->__pyx_v_head_points);
  Py_CLEAR(p->__pyx_v_hx);
  Py_CLEAR(p->__pyx_v_hy);
  Py_CLEAR(p->__pyx_v_px);
  Py_CLEAR(p->__pyx_v_py);
  Py_CLEAR(p->__pyx_v_s);
  Py_CLEAR(p->__pyx_v_shape);
  Py_CLEAR(p->__pyx_v_sx);
  Py_CLEAR(p->__pyx_v_sy);
  Py_CLEAR(p->__pyx_v_t0);
  Py_CLEAR(p->__pyx_v_t1);
  Py_CLEAR(p->__pyx_v_te);
  Py_CLEAR(p->__pyx_v_ts);
  Py_CLEAR(p->__pyx_v_vx);
  Py_CLEAR(p->__pyx_v_vy);
  Py_CLEAR(p->__pyx_t_0);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_56_draw < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_56_draw)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_56_draw[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_56_draw++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_56_draw *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_56_draw(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_56_draw *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_56_draw *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_bx) {
    e = (*v)(p->__pyx_v_bx, a); if (e) return e;
  }
  if (p->__pyx_v_by) {
    e = (*v)(p->__pyx_v_by, a); if (e) return e;
  }
  if (p->__pyx_v_ex) {
    e = (*v)(p->__pyx_v_ex, a); if (e) return e;
  }
  if (p->__pyx_v_ey) {
    e = (*v)(p->__pyx_v_ey, a); if (e) return e;
  }
  if (p->__pyx_v_head_points) {
    e = (*v)(p->__pyx_v_head_points, a); if (e) return e;
  }
  if (p->__pyx_v_hx) {
    e = (*v)(p->__pyx_v_hx, a); if (e) return e;
  }
  if (p->__pyx_v_hy) {
    e = (*v)(p->__pyx_v_hy, a); if (e) return e;
  }
  if (p->__pyx_v_px) {
    e = (*v)(p->__pyx_v_px, a); if (e) return e;
  }
  if (p->__pyx_v_py) {
    e = (*v)(p->__pyx_v_py, a); if (e) return e;
  }
  if (p->__pyx_v_s) {
    e = (*v)(p->__pyx_v_s, a); if (e) return e;
  }
  if (p->__pyx_v_shape) {
    e = (*v)(p->__pyx_v_shape, a); if (e) return e;
  }
  if (p->__pyx_v_sx) {
    e = (*v)(p->__pyx_v_sx, a); if (e) return e;
  }
  if (p->__pyx_v_sy) {
    e = (*v)(p->__pyx_v_sy, a); if (e) return e;
  }
  if (p->__pyx_v_t0) {
    e = (*v)(p->__pyx_v_t0, a); if (e) return e;
  }
  if (p->__pyx_v_t1) {
    e = (*v)(p->__pyx_v_t1, a); if (e) return e;
  }
  if (p->__pyx_v_te) {
    e = (*v)(p->__pyx_v_te, a); if (e) return e;
  }
  if (p->__pyx_v_ts) {
    e = (*v)(p->__pyx_v_ts, a); if (e) return e;
  }
  if (p->__pyx_v_vx) {
    e = (*v)(p->__pyx_v_vx, a); if (e) return e;
  }
  if (p->__pyx_v_vy) {
    e = (*v)(p->__pyx_v_vy, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_56_draw = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_56_draw", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_56_draw), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_56_draw, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_56_draw, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_56_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 PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_57__draw *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_57__draw[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_57__draw = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_57__draw(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_57__draw > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_57__draw)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_57__draw[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_57__draw];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_57__draw));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_57__draw(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_57__draw *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_57__draw *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_custom_arrow);
  Py_CLEAR(p->__pyx_v_default_arrow);
  Py_CLEAR(p->__pyx_v_extent);
  Py_CLEAR(p->__pyx_v_heads);
  Py_CLEAR(p->__pyx_v_line);
  Py_CLEAR(p->__pyx_v_polyline);
  Py_CLEAR(p->__pyx_v_s);
  Py_CLEAR(p->__pyx_v_self);
  Py_CLEAR(p->__pyx_v_setback);
  Py_CLEAR(p->__pyx_v_shrink);
  Py_CLEAR(p->__pyx_v_shrink_one_end);
  Py_CLEAR(p->__pyx_v_transformed_points);
  Py_CLEAR(p->__pyx_9genexpr50__pyx_v_xy);
  Py_CLEAR(p->__pyx_t_0);
  Py_CLEAR(p->__pyx_t_1);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_57__draw < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_57__draw)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_57__draw[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_57__draw++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_57__draw *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_57__draw(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_57__draw *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_57__draw *)o;
  if (p->__pyx_v_custom_arrow) {
    e = (*v)(p->__pyx_v_custom_arrow, a); if (e) return e;
  }
  if (p->__pyx_v_default_arrow) {
    e = (*v)(p->__pyx_v_default_arrow, a); if (e) return e;
  }
  if (p->__pyx_v_extent) {
    e = (*v)(p->__pyx_v_extent, a); if (e) return e;
  }
  if (p->__pyx_v_heads) {
    e = (*v)(p->__pyx_v_heads, a); if (e) return e;
  }
  if (p->__pyx_v_line) {
    e = (*v)(p->__pyx_v_line, a); if (e) return e;
  }
  if (p->__pyx_v_polyline) {
    e = (*v)(p->__pyx_v_polyline, a); if (e) return e;
  }
  if (p->__pyx_v_s) {
    e = (*v)(p->__pyx_v_s, a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(p->__pyx_v_self, a); if (e) return e;
  }
  if (p->__pyx_v_setback) {
    e = (*v)(p->__pyx_v_setback, a); if (e) return e;
  }
  if (p->__pyx_v_shrink) {
    e = (*v)(p->__pyx_v_shrink, a); if (e) return e;
  }
  if (p->__pyx_v_shrink_one_end) {
    e = (*v)(p->__pyx_v_shrink_one_end, a); if (e) return e;
  }
  if (p->__pyx_v_transformed_points) {
    e = (*v)(p->__pyx_v_transformed_points, a); if (e) return e;
  }
  if (p->__pyx_9genexpr50__pyx_v_xy) {
    e = (*v)(p->__pyx_9genexpr50__pyx_v_xy, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  if (p->__pyx_t_1) {
    e = (*v)(p->__pyx_t_1, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_57__draw = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_57__draw", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_57__draw), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_57__draw, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_57__draw, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_57__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 PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_58__custom_arrow *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_58__custom_arrow[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_58__custom_arrow = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_58__custom_arrow(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_58__custom_arrow > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_58__custom_arrow)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_58__custom_arrow[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_58__custom_arrow];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_58__custom_arrow));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_58__custom_arrow(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_58__custom_arrow *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_58__custom_arrow *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_format);
  Py_CLEAR(p->__pyx_v_format_transform);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_58__custom_arrow < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_58__custom_arrow)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_58__custom_arrow[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_58__custom_arrow++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_58__custom_arrow *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_58__custom_arrow(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_58__custom_arrow *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_58__custom_arrow *)o;
  if (p->__pyx_v_format) {
    e = (*v)(p->__pyx_v_format, a); if (e) return e;
  }
  if (p->__pyx_v_format_transform) {
    e = (*v)(p->__pyx_v_format_transform, a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(p->__pyx_v_self, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7mathics_7builtin_8graphics___pyx_scope_struct_58__custom_arrow(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_58__custom_arrow *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_58__custom_arrow *)o;
  tmp = ((PyObject*)p->__pyx_v_format);
  p->__pyx_v_format = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_format_transform);
  p->__pyx_v_format_transform = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_self);
  p->__pyx_v_self = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_58__custom_arrow = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_58__custom_arrow", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_58__custom_arrow), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_58__custom_arrow, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_58__custom_arrow, /*tp_traverse*/
  __pyx_tp_clear_7mathics_7builtin_8graphics___pyx_scope_struct_58__custom_arrow, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_58__custom_arrow, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_59_make *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_59_make[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_59_make = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_59_make(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_59_make > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_59_make)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_59_make[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_59_make];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_59_make));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_59_make(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_59_make *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_59_make *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_boxh);
  Py_CLEAR(p->__pyx_v_boxw);
  Py_CLEAR(p->__pyx_v_code);
  Py_CLEAR(p->__pyx_v_ex);
  Py_CLEAR(p->__pyx_v_ey);
  Py_CLEAR(p->__pyx_v_ox);
  Py_CLEAR(p->__pyx_v_oy);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_59_make < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_59_make)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_59_make[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_59_make++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_59_make *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_59_make(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_59_make *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_59_make *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_boxh) {
    e = (*v)(p->__pyx_v_boxh, a); if (e) return e;
  }
  if (p->__pyx_v_boxw) {
    e = (*v)(p->__pyx_v_boxw, a); if (e) return e;
  }
  if (p->__pyx_v_code) {
    e = (*v)(p->__pyx_v_code, a); if (e) return e;
  }
  if (p->__pyx_v_ex) {
    e = (*v)(p->__pyx_v_ex, a); if (e) return e;
  }
  if (p->__pyx_v_ey) {
    e = (*v)(p->__pyx_v_ey, a); if (e) return e;
  }
  if (p->__pyx_v_ox) {
    e = (*v)(p->__pyx_v_ox, a); if (e) return e;
  }
  if (p->__pyx_v_oy) {
    e = (*v)(p->__pyx_v_oy, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7mathics_7builtin_8graphics___pyx_scope_struct_59_make(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_59_make *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_59_make *)o;
  tmp = ((PyObject*)p->__pyx_outer_scope);
  p->__pyx_outer_scope = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_58__custom_arrow *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_boxh);
  p->__pyx_v_boxh = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_boxw);
  p->__pyx_v_boxw = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_code);
  p->__pyx_v_code = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_ex);
  p->__pyx_v_ex = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_ey);
  p->__pyx_v_ey = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_ox);
  p->__pyx_v_ox = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_oy);
  p->__pyx_v_oy = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_59_make = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_59_make", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_59_make), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_59_make, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_59_make, /*tp_traverse*/
  __pyx_tp_clear_7mathics_7builtin_8graphics___pyx_scope_struct_59_make, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_59_make, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_60_draw *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_60_draw[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_60_draw = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_60_draw(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_60_draw > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_60_draw)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_60_draw[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_60_draw];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_60_draw));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_60_draw(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_60_draw *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_60_draw *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_cx);
  Py_CLEAR(p->__pyx_v_cy);
  Py_CLEAR(p->__pyx_v_px);
  Py_CLEAR(p->__pyx_v_py);
  Py_CLEAR(p->__pyx_v_s);
  Py_CLEAR(p->__pyx_v_t0);
  Py_CLEAR(p->__pyx_v_t1);
  Py_CLEAR(p->__pyx_v_transform);
  Py_CLEAR(p->__pyx_v_vx);
  Py_CLEAR(p->__pyx_v_vy);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_60_draw < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_60_draw)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_60_draw[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_60_draw++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_60_draw *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_60_draw(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_60_draw *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_60_draw *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_cx) {
    e = (*v)(p->__pyx_v_cx, a); if (e) return e;
  }
  if (p->__pyx_v_cy) {
    e = (*v)(p->__pyx_v_cy, a); if (e) return e;
  }
  if (p->__pyx_v_px) {
    e = (*v)(p->__pyx_v_px, a); if (e) return e;
  }
  if (p->__pyx_v_py) {
    e = (*v)(p->__pyx_v_py, a); if (e) return e;
  }
  if (p->__pyx_v_s) {
    e = (*v)(p->__pyx_v_s, a); if (e) return e;
  }
  if (p->__pyx_v_t0) {
    e = (*v)(p->__pyx_v_t0, a); if (e) return e;
  }
  if (p->__pyx_v_t1) {
    e = (*v)(p->__pyx_v_t1, a); if (e) return e;
  }
  if (p->__pyx_v_transform) {
    e = (*v)(p->__pyx_v_transform, a); if (e) return e;
  }
  if (p->__pyx_v_vx) {
    e = (*v)(p->__pyx_v_vx, a); if (e) return e;
  }
  if (p->__pyx_v_vy) {
    e = (*v)(p->__pyx_v_vy, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_60_draw = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_60_draw", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_60_draw), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_60_draw, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_60_draw, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_60_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 PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_61_to_svg *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_61_to_svg[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_61_to_svg = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_61_to_svg(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_61_to_svg > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_61_to_svg)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_61_to_svg[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_61_to_svg];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_61_to_svg));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_61_to_svg(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_61_to_svg *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_61_to_svg *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_arrow_style);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_61_to_svg < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_61_to_svg)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_61_to_svg[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_61_to_svg++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_61_to_svg *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_61_to_svg(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_61_to_svg *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_61_to_svg *)o;
  if (p->__pyx_v_arrow_style) {
    e = (*v)(p->__pyx_v_arrow_style, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7mathics_7builtin_8graphics___pyx_scope_struct_61_to_svg(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_61_to_svg *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_61_to_svg *)o;
  tmp = ((PyObject*)p->__pyx_v_arrow_style);
  p->__pyx_v_arrow_style = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_61_to_svg = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_61_to_svg", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_61_to_svg), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_61_to_svg, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_61_to_svg, /*tp_traverse*/
  __pyx_tp_clear_7mathics_7builtin_8graphics___pyx_scope_struct_61_to_svg, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_61_to_svg, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_62_polygon *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_62_polygon[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_62_polygon = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_62_polygon(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_62_polygon > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_62_polygon)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_62_polygon[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_62_polygon];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_62_polygon));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_62_polygon(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_62_polygon *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_62_polygon *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_genexpr);
  Py_CLEAR(p->__pyx_v_points);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_62_polygon < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_62_polygon)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_62_polygon[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_62_polygon++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_62_polygon *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_62_polygon(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_62_polygon *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_62_polygon *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_genexpr) {
    e = (*v)(p->__pyx_v_genexpr, a); if (e) return e;
  }
  if (p->__pyx_v_points) {
    e = (*v)(p->__pyx_v_points, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_62_polygon = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_62_polygon", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_62_polygon), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_62_polygon, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_62_polygon, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_62_polygon, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_63_genexpr *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_63_genexpr[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_63_genexpr = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_63_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_63_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_63_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_63_genexpr[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_63_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_63_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_63_genexpr(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_63_genexpr *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_63_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_xy);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_63_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_63_genexpr)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_63_genexpr[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_63_genexpr++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_63_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_63_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_63_genexpr *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_63_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_xy) {
    e = (*v)(p->__pyx_v_xy, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_63_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_63_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_63_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_63_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_63_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_63_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_64_to_asy *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_64_to_asy[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_64_to_asy = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_64_to_asy(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_64_to_asy > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_64_to_asy)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_64_to_asy[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_64_to_asy];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_64_to_asy));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_64_to_asy(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_64_to_asy *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_64_to_asy *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_arrow_pen);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_64_to_asy < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_64_to_asy)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_64_to_asy[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_64_to_asy++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_64_to_asy *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_64_to_asy(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_64_to_asy *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_64_to_asy *)o;
  if (p->__pyx_v_arrow_pen) {
    e = (*v)(p->__pyx_v_arrow_pen, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7mathics_7builtin_8graphics___pyx_scope_struct_64_to_asy(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_64_to_asy *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_64_to_asy *)o;
  tmp = ((PyObject*)p->__pyx_v_arrow_pen);
  p->__pyx_v_arrow_pen = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_64_to_asy = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_64_to_asy", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_64_to_asy), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_64_to_asy, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_64_to_asy, /*tp_traverse*/
  __pyx_tp_clear_7mathics_7builtin_8graphics___pyx_scope_struct_64_to_asy, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_64_to_asy, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_65_polygon *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_65_polygon[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_65_polygon = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_65_polygon(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_65_polygon > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_65_polygon)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_65_polygon[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_65_polygon];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_65_polygon));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_65_polygon(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_65_polygon *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_65_polygon *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_points);
  Py_CLEAR(p->__pyx_9genexpr52__pyx_v_xy);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_65_polygon < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_65_polygon)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_65_polygon[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_65_polygon++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_65_polygon *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_65_polygon(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_65_polygon *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_65_polygon *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_points) {
    e = (*v)(p->__pyx_v_points, a); if (e) return e;
  }
  if (p->__pyx_9genexpr52__pyx_v_xy) {
    e = (*v)(p->__pyx_9genexpr52__pyx_v_xy, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_65_polygon = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_65_polygon", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_65_polygon), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_65_polygon, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_65_polygon, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_65_polygon, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_66_extent *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_66_extent[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_66_extent = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_66_extent(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_66_extent > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_66_extent)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_66_extent[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_66_extent];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_66_extent));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_66_extent(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_66_extent *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_66_extent *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_width);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_66_extent < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_66_extent)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_66_extent[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_66_extent++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_66_extent *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_66_extent(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_66_extent *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_66_extent *)o;
  if (p->__pyx_v_width) {
    e = (*v)(p->__pyx_v_width, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7mathics_7builtin_8graphics___pyx_scope_struct_66_extent(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_66_extent *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_66_extent *)o;
  tmp = ((PyObject*)p->__pyx_v_width);
  p->__pyx_v_width = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_66_extent = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_66_extent", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_66_extent), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_66_extent, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_66_extent, /*tp_traverse*/
  __pyx_tp_clear_7mathics_7builtin_8graphics___pyx_scope_struct_66_extent, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_66_extent, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_67_polyline *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_67_polyline[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_67_polyline = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_67_polyline(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_67_polyline > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_67_polyline)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_67_polyline[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_67_polyline];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_67_polyline));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_67_polyline(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_67_polyline *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_67_polyline *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_p);
  Py_CLEAR(p->__pyx_v_points);
  Py_CLEAR(p->__pyx_v_x);
  Py_CLEAR(p->__pyx_v_y);
  Py_CLEAR(p->__pyx_t_0);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_67_polyline < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_67_polyline)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_67_polyline[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_67_polyline++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_67_polyline *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_67_polyline(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_67_polyline *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_67_polyline *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_p) {
    e = (*v)(p->__pyx_v_p, a); if (e) return e;
  }
  if (p->__pyx_v_points) {
    e = (*v)(p->__pyx_v_points, a); if (e) return e;
  }
  if (p->__pyx_v_x) {
    e = (*v)(p->__pyx_v_x, a); if (e) return e;
  }
  if (p->__pyx_v_y) {
    e = (*v)(p->__pyx_v_y, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_67_polyline = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_67_polyline", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_67_polyline), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_67_polyline, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_67_polyline, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_67_polyline, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_68_polygon *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_68_polygon[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_68_polygon = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_68_polygon(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_68_polygon > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_68_polygon)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_68_polygon[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_68_polygon];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_68_polygon));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_68_polygon(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_68_polygon *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_68_polygon *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_p);
  Py_CLEAR(p->__pyx_v_points);
  Py_CLEAR(p->__pyx_t_0);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_68_polygon < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_68_polygon)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_68_polygon[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_68_polygon++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_68_polygon *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_68_polygon(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_68_polygon *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_68_polygon *)o;
  if (p->__pyx_v_p) {
    e = (*v)(p->__pyx_v_p, a); if (e) return e;
  }
  if (p->__pyx_v_points) {
    e = (*v)(p->__pyx_v_points, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_68_polygon = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_68_polygon", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_68_polygon), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_68_polygon, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_68_polygon, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_68_polygon, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_69_default_arrow *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_69_default_arrow[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_69_default_arrow = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_69_default_arrow(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_69_default_arrow > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_69_default_arrow)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_69_default_arrow[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_69_default_arrow];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_69_default_arrow));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_69_default_arrow(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_69_default_arrow *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_69_default_arrow *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_px);
  Py_CLEAR(p->__pyx_v_py);
  Py_CLEAR(p->__pyx_v_s);
  Py_CLEAR(p->__pyx_v_t1);
  Py_CLEAR(p->__pyx_v_vx);
  Py_CLEAR(p->__pyx_v_vy);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_69_default_arrow < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_69_default_arrow)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_69_default_arrow[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_69_default_arrow++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_69_default_arrow *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_69_default_arrow(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_69_default_arrow *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_69_default_arrow *)o;
  if (p->__pyx_v_px) {
    e = (*v)(p->__pyx_v_px, a); if (e) return e;
  }
  if (p->__pyx_v_py) {
    e = (*v)(p->__pyx_v_py, a); if (e) return e;
  }
  if (p->__pyx_v_s) {
    e = (*v)(p->__pyx_v_s, a); if (e) return e;
  }
  if (p->__pyx_v_t1) {
    e = (*v)(p->__pyx_v_t1, a); if (e) return e;
  }
  if (p->__pyx_v_vx) {
    e = (*v)(p->__pyx_v_vx, a); if (e) return e;
  }
  if (p->__pyx_v_vy) {
    e = (*v)(p->__pyx_v_vy, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_69_default_arrow = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_69_default_arrow", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_69_default_arrow), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_69_default_arrow, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_69_default_arrow, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_69_default_arrow, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_70__flatten *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_70__flatten[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_70__flatten = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_70__flatten(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_70__flatten > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_70__flatten)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_70__flatten[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_70__flatten];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_70__flatten));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_70__flatten(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_70__flatten *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_70__flatten *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_flattened);
  Py_CLEAR(p->__pyx_v_leaf);
  Py_CLEAR(p->__pyx_v_leaves);
  Py_CLEAR(p->__pyx_v_x);
  Py_CLEAR(p->__pyx_t_0);
  Py_CLEAR(p->__pyx_t_3);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_70__flatten < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_70__flatten)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_70__flatten[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_70__flatten++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_70__flatten *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_70__flatten(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_70__flatten *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_70__flatten *)o;
  if (p->__pyx_v_flattened) {
    e = (*v)(p->__pyx_v_flattened, a); if (e) return e;
  }
  if (p->__pyx_v_leaf) {
    e = (*v)(p->__pyx_v_leaf, a); if (e) return e;
  }
  if (p->__pyx_v_leaves) {
    e = (*v)(p->__pyx_v_leaves, a); if (e) return e;
  }
  if (p->__pyx_v_x) {
    e = (*v)(p->__pyx_v_x, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  if (p->__pyx_t_3) {
    e = (*v)(p->__pyx_t_3, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_70__flatten = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_70__flatten", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_70__flatten), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_70__flatten, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_70__flatten, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_70__flatten, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_71___init__ *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_71___init__[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_71___init__ = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_71___init__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_71___init__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_71___init__)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_71___init__[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_71___init__];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_71___init__));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_71___init__(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_71___init__ *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_71___init__ *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_builtins);
  Py_CLEAR(p->__pyx_v_convert);
  Py_CLEAR(p->__pyx_v_get_options);
  Py_CLEAR(p->__pyx_v_self);
  Py_CLEAR(p->__pyx_v_stylebox_style);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_71___init__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_71___init__)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_71___init__[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_71___init__++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_71___init__ *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_71___init__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_71___init__ *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_71___init__ *)o;
  if (p->__pyx_v_builtins) {
    e = (*v)(p->__pyx_v_builtins, a); if (e) return e;
  }
  if (p->__pyx_v_convert) {
    e = (*v)(p->__pyx_v_convert, a); if (e) return e;
  }
  if (p->__pyx_v_get_options) {
    e = (*v)(p->__pyx_v_get_options, a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(p->__pyx_v_self, a); if (e) return e;
  }
  if (p->__pyx_v_stylebox_style) {
    e = (*v)(p->__pyx_v_stylebox_style, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7mathics_7builtin_8graphics___pyx_scope_struct_71___init__(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_71___init__ *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_71___init__ *)o;
  tmp = ((PyObject*)p->__pyx_v_builtins);
  p->__pyx_v_builtins = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_convert);
  p->__pyx_v_convert = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_get_options);
  p->__pyx_v_get_options = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_self);
  p->__pyx_v_self = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_stylebox_style);
  p->__pyx_v_stylebox_style = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_71___init__ = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_71___init__", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_71___init__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_71___init__, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_71___init__, /*tp_traverse*/
  __pyx_tp_clear_7mathics_7builtin_8graphics___pyx_scope_struct_71___init__, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_71___init__, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_72_convert *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_72_convert[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_72_convert = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_72_convert(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_72_convert > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_72_convert)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_72_convert[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_72_convert];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_72_convert));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_72_convert(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_72_convert *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_72_convert *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_content);
  Py_CLEAR(p->__pyx_v_data);
  Py_CLEAR(p->__pyx_v_element);
  Py_CLEAR(p->__pyx_v_element_class);
  Py_CLEAR(p->__pyx_v_head);
  Py_CLEAR(p->__pyx_v_item);
  Py_CLEAR(p->__pyx_v_items);
  Py_CLEAR(p->__pyx_v_new_item);
  Py_CLEAR(p->__pyx_v_options);
  Py_CLEAR(p->__pyx_v_style);
  Py_CLEAR(p->__pyx_t_0);
  Py_CLEAR(p->__pyx_t_1);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_72_convert < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_72_convert)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_72_convert[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_72_convert++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_72_convert *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_72_convert(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_72_convert *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_72_convert *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_content) {
    e = (*v)(p->__pyx_v_content, a); if (e) return e;
  }
  if (p->__pyx_v_data) {
    e = (*v)(p->__pyx_v_data, a); if (e) return e;
  }
  if (p->__pyx_v_element) {
    e = (*v)(p->__pyx_v_element, a); if (e) return e;
  }
  if (p->__pyx_v_element_class) {
    e = (*v)(p->__pyx_v_element_class, a); if (e) return e;
  }
  if (p->__pyx_v_head) {
    e = (*v)(p->__pyx_v_head, a); if (e) return e;
  }
  if (p->__pyx_v_item) {
    e = (*v)(p->__pyx_v_item, a); if (e) return e;
  }
  if (p->__pyx_v_items) {
    e = (*v)(p->__pyx_v_items, a); if (e) return e;
  }
  if (p->__pyx_v_new_item) {
    e = (*v)(p->__pyx_v_new_item, a); if (e) return e;
  }
  if (p->__pyx_v_options) {
    e = (*v)(p->__pyx_v_options, a); if (e) return e;
  }
  if (p->__pyx_v_style) {
    e = (*v)(p->__pyx_v_style, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  if (p->__pyx_t_1) {
    e = (*v)(p->__pyx_t_1, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_72_convert = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_72_convert", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_72_convert), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_72_convert, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_72_convert, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_72_convert, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_73_create_style *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_73_create_style[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_73_create_style = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_73_create_style(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_73_create_style > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_73_create_style)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_73_create_style[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_73_create_style];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_73_create_style));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_73_create_style(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_73_create_style *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_73_create_style *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_convert);
  Py_CLEAR(p->__pyx_v_style);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_73_create_style < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_73_create_style)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_73_create_style[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_73_create_style++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_73_create_style *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_73_create_style(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_73_create_style *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_73_create_style *)o;
  if (p->__pyx_v_convert) {
    e = (*v)(p->__pyx_v_convert, a); if (e) return e;
  }
  if (p->__pyx_v_style) {
    e = (*v)(p->__pyx_v_style, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7mathics_7builtin_8graphics___pyx_scope_struct_73_create_style(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_73_create_style *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_73_create_style *)o;
  tmp = ((PyObject*)p->__pyx_v_convert);
  p->__pyx_v_convert = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_style);
  p->__pyx_v_style = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_73_create_style = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_73_create_style", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_73_create_style), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_73_create_style, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_73_create_style, /*tp_traverse*/
  __pyx_tp_clear_7mathics_7builtin_8graphics___pyx_scope_struct_73_create_style, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_73_create_style, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_74_to_svg *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_74_to_svg[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_74_to_svg = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_74_to_svg(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_74_to_svg > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_74_to_svg)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_74_to_svg[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_74_to_svg];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_74_to_svg));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_74_to_svg(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_74_to_svg *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_74_to_svg *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_74_to_svg < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_74_to_svg)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_74_to_svg[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_74_to_svg++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_74_to_svg *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_74_to_svg(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_74_to_svg *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_74_to_svg *)o;
  if (p->__pyx_v_self) {
    e = (*v)(p->__pyx_v_self, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7mathics_7builtin_8graphics___pyx_scope_struct_74_to_svg(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_74_to_svg *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_74_to_svg *)o;
  tmp = ((PyObject*)p->__pyx_v_self);
  p->__pyx_v_self = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_74_to_svg = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_74_to_svg", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_74_to_svg), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_74_to_svg, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_74_to_svg, /*tp_traverse*/
  __pyx_tp_clear_7mathics_7builtin_8graphics___pyx_scope_struct_74_to_svg, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_74_to_svg, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_75_genexpr *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_75_genexpr[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_75_genexpr = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_75_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_75_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_75_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_75_genexpr[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_75_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_75_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_75_genexpr(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_75_genexpr *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_75_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_element);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_75_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_75_genexpr)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_75_genexpr[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_75_genexpr++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_75_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_75_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_75_genexpr *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_75_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_element) {
    e = (*v)(p->__pyx_v_element, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_75_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_75_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_75_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_75_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_75_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_75_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_76_to_asy *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_76_to_asy[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_76_to_asy = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_76_to_asy(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_76_to_asy > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_76_to_asy)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_76_to_asy[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_76_to_asy];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_76_to_asy));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_76_to_asy(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_76_to_asy *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_76_to_asy *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_76_to_asy < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_76_to_asy)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_76_to_asy[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_76_to_asy++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_76_to_asy *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_76_to_asy(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_76_to_asy *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_76_to_asy *)o;
  if (p->__pyx_v_self) {
    e = (*v)(p->__pyx_v_self, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7mathics_7builtin_8graphics___pyx_scope_struct_76_to_asy(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_76_to_asy *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_76_to_asy *)o;
  tmp = ((PyObject*)p->__pyx_v_self);
  p->__pyx_v_self = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_76_to_asy = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_76_to_asy", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_76_to_asy), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_76_to_asy, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_76_to_asy, /*tp_traverse*/
  __pyx_tp_clear_7mathics_7builtin_8graphics___pyx_scope_struct_76_to_asy, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_76_to_asy, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_77_genexpr *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_77_genexpr[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_77_genexpr = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_77_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_77_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_77_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_77_genexpr[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_77_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_77_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_77_genexpr(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_77_genexpr *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_77_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_element);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_77_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_77_genexpr)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_77_genexpr[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_77_genexpr++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_77_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_77_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_77_genexpr *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_77_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_element) {
    e = (*v)(p->__pyx_v_element, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_77_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_77_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_77_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_77_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_77_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_77_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_78__prepare_elements *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_78__prepare_elements[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_78__prepare_elements = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_78__prepare_elements(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_78__prepare_elements > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_78__prepare_elements)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_78__prepare_elements[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_78__prepare_elements];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_78__prepare_elements));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_78__prepare_elements(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_78__prepare_elements *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_78__prepare_elements *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_axes);
  Py_CLEAR(p->__pyx_v_base_height);
  Py_CLEAR(p->__pyx_v_base_width);
  Py_CLEAR(p->__pyx_v_elements);
  Py_CLEAR(p->__pyx_v_plot_range);
  Py_CLEAR(p->__pyx_v_size_aspect);
  Py_CLEAR(p->__pyx_v_size_multiplier);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_78__prepare_elements < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_78__prepare_elements)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_78__prepare_elements[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_78__prepare_elements++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_78__prepare_elements *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_78__prepare_elements(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_78__prepare_elements *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_78__prepare_elements *)o;
  if (p->__pyx_v_axes) {
    e = (*v)(p->__pyx_v_axes, a); if (e) return e;
  }
  if (p->__pyx_v_base_height) {
    e = (*v)(p->__pyx_v_base_height, a); if (e) return e;
  }
  if (p->__pyx_v_base_width) {
    e = (*v)(p->__pyx_v_base_width, a); if (e) return e;
  }
  if (p->__pyx_v_elements) {
    e = (*v)(p->__pyx_v_elements, a); if (e) return e;
  }
  if (p->__pyx_v_plot_range) {
    e = (*v)(p->__pyx_v_plot_range, a); if (e) return e;
  }
  if (p->__pyx_v_size_aspect) {
    e = (*v)(p->__pyx_v_size_aspect, a); if (e) return e;
  }
  if (p->__pyx_v_size_multiplier) {
    e = (*v)(p->__pyx_v_size_multiplier, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7mathics_7builtin_8graphics___pyx_scope_struct_78__prepare_elements(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_78__prepare_elements *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_78__prepare_elements *)o;
  tmp = ((PyObject*)p->__pyx_v_axes);
  p->__pyx_v_axes = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_base_height);
  p->__pyx_v_base_height = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_base_width);
  p->__pyx_v_base_width = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_elements);
  p->__pyx_v_elements = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_plot_range);
  p->__pyx_v_plot_range = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_size_aspect);
  p->__pyx_v_size_aspect = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_size_multiplier);
  p->__pyx_v_size_multiplier = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_78__prepare_elements = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_78__prepare_elements", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_78__prepare_elements), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_78__prepare_elements, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_78__prepare_elements, /*tp_traverse*/
  __pyx_tp_clear_7mathics_7builtin_8graphics___pyx_scope_struct_78__prepare_elements, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_78__prepare_elements, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_79_genexpr *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_79_genexpr[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_79_genexpr = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_79_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_79_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_79_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_79_genexpr[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_79_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_79_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_79_genexpr(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_79_genexpr *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_79_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_x);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_79_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_79_genexpr)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_79_genexpr[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_79_genexpr++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_79_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_79_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_79_genexpr *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_79_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_x) {
    e = (*v)(p->__pyx_v_x, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_79_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_79_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_79_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_79_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_79_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_79_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_80_boxes_to_tex *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_80_boxes_to_tex[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_80_boxes_to_tex = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_80_boxes_to_tex(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_80_boxes_to_tex > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_80_boxes_to_tex)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_80_boxes_to_tex[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_80_boxes_to_tex];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_80_boxes_to_tex));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_80_boxes_to_tex(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_80_boxes_to_tex *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_80_boxes_to_tex *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_elements);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_80_boxes_to_tex < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_80_boxes_to_tex)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_80_boxes_to_tex[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_80_boxes_to_tex++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_80_boxes_to_tex *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_80_boxes_to_tex(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_80_boxes_to_tex *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_80_boxes_to_tex *)o;
  if (p->__pyx_v_elements) {
    e = (*v)(p->__pyx_v_elements, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7mathics_7builtin_8graphics___pyx_scope_struct_80_boxes_to_tex(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_80_boxes_to_tex *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_80_boxes_to_tex *)o;
  tmp = ((PyObject*)p->__pyx_v_elements);
  p->__pyx_v_elements = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_80_boxes_to_tex = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_80_boxes_to_tex", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_80_boxes_to_tex), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_80_boxes_to_tex, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_80_boxes_to_tex, /*tp_traverse*/
  __pyx_tp_clear_7mathics_7builtin_8graphics___pyx_scope_struct_80_boxes_to_tex, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_80_boxes_to_tex, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_81_genexpr *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_81_genexpr[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_81_genexpr = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_81_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_81_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_81_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_81_genexpr[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_81_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_81_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_81_genexpr(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_81_genexpr *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_81_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_element);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_81_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_81_genexpr)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_81_genexpr[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_81_genexpr++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_81_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_81_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_81_genexpr *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_81_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_element) {
    e = (*v)(p->__pyx_v_element, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_81_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_81_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_81_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_81_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_81_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_81_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_82_genexpr *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_82_genexpr[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_82_genexpr = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_82_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_82_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_82_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_82_genexpr[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_82_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_82_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_82_genexpr(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_82_genexpr *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_82_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_element);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_82_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_82_genexpr)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_82_genexpr[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_82_genexpr++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_82_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_82_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_82_genexpr *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_82_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_element) {
    e = (*v)(p->__pyx_v_element, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_82_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_82_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_82_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_82_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_82_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_82_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_83_boxes_to_xml *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_83_boxes_to_xml[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_83_boxes_to_xml = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_83_boxes_to_xml(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_83_boxes_to_xml > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_83_boxes_to_xml)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_83_boxes_to_xml[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_83_boxes_to_xml];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_83_boxes_to_xml));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_83_boxes_to_xml(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_83_boxes_to_xml *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_83_boxes_to_xml *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_h);
  Py_CLEAR(p->__pyx_v_w);
  Py_CLEAR(p->__pyx_v_xmin);
  Py_CLEAR(p->__pyx_v_ymin);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_83_boxes_to_xml < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_83_boxes_to_xml)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_83_boxes_to_xml[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_83_boxes_to_xml++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_83_boxes_to_xml *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_83_boxes_to_xml(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_83_boxes_to_xml *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_83_boxes_to_xml *)o;
  if (p->__pyx_v_h) {
    e = (*v)(p->__pyx_v_h, a); if (e) return e;
  }
  if (p->__pyx_v_w) {
    e = (*v)(p->__pyx_v_w, a); if (e) return e;
  }
  if (p->__pyx_v_xmin) {
    e = (*v)(p->__pyx_v_xmin, a); if (e) return e;
  }
  if (p->__pyx_v_ymin) {
    e = (*v)(p->__pyx_v_ymin, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7mathics_7builtin_8graphics___pyx_scope_struct_83_boxes_to_xml(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_83_boxes_to_xml *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_83_boxes_to_xml *)o;
  tmp = ((PyObject*)p->__pyx_v_h);
  p->__pyx_v_h = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_w);
  p->__pyx_v_w = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_xmin);
  p->__pyx_v_xmin = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_ymin);
  p->__pyx_v_ymin = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_83_boxes_to_xml = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_83_boxes_to_xml", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_83_boxes_to_xml), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_83_boxes_to_xml, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_83_boxes_to_xml, /*tp_traverse*/
  __pyx_tp_clear_7mathics_7builtin_8graphics___pyx_scope_struct_83_boxes_to_xml, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_83_boxes_to_xml, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_84_genexpr *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_84_genexpr[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_84_genexpr = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_84_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_84_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_84_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_84_genexpr[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_84_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_84_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_84_genexpr(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_84_genexpr *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_84_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_t);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_84_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_84_genexpr)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_84_genexpr[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_84_genexpr++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_84_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_84_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_84_genexpr *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_84_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_t) {
    e = (*v)(p->__pyx_v_t, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_84_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_84_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_84_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_84_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_84_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_84_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_85_create_axes *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_85_create_axes[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_85_create_axes = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_85_create_axes(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_85_create_axes > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_85_create_axes)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_85_create_axes[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_85_create_axes];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_85_create_axes));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_85_create_axes(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_85_create_axes *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_85_create_axes *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_elements);
  Py_CLEAR(p->__pyx_v_origin_x);
  Py_CLEAR(p->__pyx_v_origin_y);
  Py_CLEAR(p->__pyx_v_ticks_x);
  Py_CLEAR(p->__pyx_v_ticks_y);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_85_create_axes < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_85_create_axes)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_85_create_axes[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_85_create_axes++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_85_create_axes *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_85_create_axes(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_85_create_axes *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_85_create_axes *)o;
  if (p->__pyx_v_elements) {
    e = (*v)(p->__pyx_v_elements, a); if (e) return e;
  }
  if (p->__pyx_v_origin_x) {
    e = (*v)(p->__pyx_v_origin_x, a); if (e) return e;
  }
  if (p->__pyx_v_origin_y) {
    e = (*v)(p->__pyx_v_origin_y, a); if (e) return e;
  }
  if (p->__pyx_v_ticks_x) {
    e = (*v)(p->__pyx_v_ticks_x, a); if (e) return e;
  }
  if (p->__pyx_v_ticks_y) {
    e = (*v)(p->__pyx_v_ticks_y, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7mathics_7builtin_8graphics___pyx_scope_struct_85_create_axes(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_85_create_axes *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_85_create_axes *)o;
  tmp = ((PyObject*)p->__pyx_v_elements);
  p->__pyx_v_elements = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_origin_x);
  p->__pyx_v_origin_x = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_origin_y);
  p->__pyx_v_origin_y = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_ticks_x);
  p->__pyx_v_ticks_x = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_ticks_y);
  p->__pyx_v_ticks_y = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_85_create_axes = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_85_create_axes", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_85_create_axes), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_85_create_axes, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_85_create_axes, /*tp_traverse*/
  __pyx_tp_clear_7mathics_7builtin_8graphics___pyx_scope_struct_85_create_axes, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_85_create_axes, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_86_genexpr *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_86_genexpr[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_86_genexpr = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_86_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_86_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_86_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_86_genexpr[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_86_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_86_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_86_genexpr(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_86_genexpr *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_86_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_x);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_86_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_86_genexpr)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_86_genexpr[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_86_genexpr++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_86_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_86_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_86_genexpr *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_86_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_x) {
    e = (*v)(p->__pyx_v_x, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_86_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_86_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_86_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_86_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_86_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_86_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_87_genexpr *__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_87_genexpr[8];
static int __pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_87_genexpr = 0;

static PyObject *__pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_87_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_87_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_87_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_87_genexpr[--__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_87_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_87_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_87_genexpr(PyObject *o) {
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_87_genexpr *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_87_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_x);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_87_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_87_genexpr)))) {
    __pyx_freelist_7mathics_7builtin_8graphics___pyx_scope_struct_87_genexpr[__pyx_freecount_7mathics_7builtin_8graphics___pyx_scope_struct_87_genexpr++] = ((struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_87_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_87_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_87_genexpr *p = (struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_87_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_x) {
    e = (*v)(p->__pyx_v_x, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_87_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "mathics.builtin.graphics.__pyx_scope_struct_87_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7mathics_7builtin_8graphics___pyx_scope_struct_87_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7mathics_7builtin_8graphics___pyx_scope_struct_87_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7mathics_7builtin_8graphics___pyx_scope_struct_87_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7mathics_7builtin_8graphics___pyx_scope_struct_87_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static PyMethodDef __pyx_methods[] = {
  {0, 0, 0, 0}
};

#if PY_MAJOR_VERSION >= 3
#if CYTHON_PEP489_MULTI_PHASE_INIT
static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
static int __pyx_pymod_exec_graphics(PyObject* module); /*proto*/
static PyModuleDef_Slot __pyx_moduledef_slots[] = {
  {Py_mod_create, (void*)__pyx_pymod_create},
  {Py_mod_exec, (void*)__pyx_pymod_exec_graphics},
  {0, NULL}
};
#endif

static struct PyModuleDef __pyx_moduledef = {
    PyModuleDef_HEAD_INIT,
    "graphics",
    __pyx_k_Drawing_Graphics, /* m_doc */
  #if CYTHON_PEP489_MULTI_PHASE_INIT
    0, /* m_size */
  #else
    -1, /* m_size */
  #endif
    __pyx_methods /* m_methods */,
  #if CYTHON_PEP489_MULTI_PHASE_INIT
    __pyx_moduledef_slots, /* m_slots */
  #else
    NULL, /* m_reload */
  #endif
    NULL, /* m_traverse */
    NULL, /* m_clear */
    NULL /* m_free */
};
#endif
#ifndef CYTHON_SMALL_CODE
#if defined(__clang__)
    #define CYTHON_SMALL_CODE
#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
    #define CYTHON_SMALL_CODE __attribute__((cold))
#else
    #define CYTHON_SMALL_CODE
#endif
#endif

static __Pyx_StringTabEntry __pyx_string_tab[] = {
  {&__pyx_kp_u_0, __pyx_k_0, sizeof(__pyx_k_0), 0, 1, 0, 0},
  {&__pyx_kp_u_0_0, __pyx_k_0_0, sizeof(__pyx_k_0_0), 0, 1, 0, 0},
  {&__pyx_kp_u_0_2, __pyx_k_0_2, sizeof(__pyx_k_0_2), 0, 1, 0, 0},
  {&__pyx_kp_u_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 1, 0, 0},
  {&__pyx_kp_u_1_and_2_should_be_two_colors_or, __pyx_k_1_and_2_should_be_two_colors_or, sizeof(__pyx_k_1_and_2_should_be_two_colors_or), 0, 1, 0, 0},
  {&__pyx_kp_u_1_is_not_Automatic_or_a_valid_d, __pyx_k_1_is_not_Automatic_or_a_valid_d, sizeof(__pyx_k_1_is_not_Automatic_or_a_valid_d), 0, 1, 0, 0},
  {&__pyx_kp_u_1_is_not_a_valid_list_of_color, __pyx_k_1_is_not_a_valid_list_of_color, sizeof(__pyx_k_1_is_not_a_valid_list_of_color), 0, 1, 0, 0},
  {&__pyx_kp_u_1_should_be_a_real_number_or_a, __pyx_k_1_should_be_a_real_number_or_a, sizeof(__pyx_k_1_should_be_a_real_number_or_a), 0, 1, 0, 0},
  {&__pyx_kp_u_1f, __pyx_k_1f, sizeof(__pyx_k_1f), 0, 1, 0, 0},
  {&__pyx_kp_u_3, __pyx_k_3, sizeof(__pyx_k_3), 0, 1, 0, 0},
  {&__pyx_kp_u_5g, __pyx_k_5g, sizeof(__pyx_k_5g), 0, 1, 0, 0},
  {&__pyx_kp_u_5g_5g, __pyx_k_5g_5g, sizeof(__pyx_k_5g_5g), 0, 1, 0, 0},
  {&__pyx_kp_u_5g_5g_2, __pyx_k_5g_5g_2, sizeof(__pyx_k_5g_5g_2), 0, 1, 0, 0},
  {&__pyx_kp_u_5g_5g_3, __pyx_k_5g_5g_3, sizeof(__pyx_k_5g_5g_3), 0, 1, 0, 0},
  {&__pyx_kp_u_A, __pyx_k_A, sizeof(__pyx_k_A), 0, 1, 0, 0},
  {&__pyx_n_s_ASYTransform, __pyx_k_ASYTransform, sizeof(__pyx_k_ASYTransform), 0, 0, 1, 1},
  {&__pyx_n_s_ASYTransform___init, __pyx_k_ASYTransform___init, sizeof(__pyx_k_ASYTransform___init), 0, 0, 1, 1},
  {&__pyx_n_s_ASYTransform_apply, __pyx_k_ASYTransform_apply, sizeof(__pyx_k_ASYTransform_apply), 0, 0, 1, 1},
  {&__pyx_n_s_ASYTransform_matrix, __pyx_k_ASYTransform_matrix, sizeof(__pyx_k_ASYTransform_matrix), 0, 0, 1, 1},
  {&__pyx_n_s_ASYTransform_rotate, __pyx_k_ASYTransform_rotate, sizeof(__pyx_k_ASYTransform_rotate), 0, 0, 1, 1},
  {&__pyx_n_s_ASYTransform_scale, __pyx_k_ASYTransform_scale, sizeof(__pyx_k_ASYTransform_scale), 0, 0, 1, 1},
  {&__pyx_n_s_ASYTransform_translate, __pyx_k_ASYTransform_translate, sizeof(__pyx_k_ASYTransform_translate), 0, 0, 1, 1},
  {&__pyx_n_s_AbsoluteThickness, __pyx_k_AbsoluteThickness, sizeof(__pyx_k_AbsoluteThickness), 0, 0, 1, 1},
  {&__pyx_n_u_AbsoluteThickness, __pyx_k_AbsoluteThickness, sizeof(__pyx_k_AbsoluteThickness), 0, 1, 0, 1},
  {&__pyx_kp_u_AbsoluteThickness_0_5, __pyx_k_AbsoluteThickness_0_5, sizeof(__pyx_k_AbsoluteThickness_0_5), 0, 1, 0, 0},
  {&__pyx_kp_u_AbsoluteThickness_2, __pyx_k_AbsoluteThickness_2, sizeof(__pyx_k_AbsoluteThickness_2), 0, 1, 0, 0},
  {&__pyx_n_s_AbsoluteThickness_get_thickness, __pyx_k_AbsoluteThickness_get_thickness, sizeof(__pyx_k_AbsoluteThickness_get_thickness), 0, 0, 1, 1},
  {&__pyx_n_u_Acceptability, __pyx_k_Acceptability, sizeof(__pyx_k_Acceptability), 0, 1, 0, 1},
  {&__pyx_n_u_Apply, __pyx_k_Apply, sizeof(__pyx_k_Apply), 0, 1, 0, 1},
  {&__pyx_kp_u_Apply_name_s_x, __pyx_k_Apply_name_s_x, sizeof(__pyx_k_Apply_name_s_x), 0, 1, 0, 0},
  {&__pyx_n_s_ArcBox, __pyx_k_ArcBox, sizeof(__pyx_k_ArcBox), 0, 0, 1, 1},
  {&__pyx_n_s_ArcBox__arc_params, __pyx_k_ArcBox__arc_params, sizeof(__pyx_k_ArcBox__arc_params), 0, 0, 1, 1},
  {&__pyx_n_s_ArcBox_init, __pyx_k_ArcBox_init, sizeof(__pyx_k_ArcBox_init), 0, 0, 1, 1},
  {&__pyx_n_s_ArcBox_to_asy, __pyx_k_ArcBox_to_asy, sizeof(__pyx_k_ArcBox_to_asy), 0, 0, 1, 1},
  {&__pyx_n_s_ArcBox_to_asy_locals_path, __pyx_k_ArcBox_to_asy_locals_path, sizeof(__pyx_k_ArcBox_to_asy_locals_path), 0, 0, 1, 1},
  {&__pyx_n_s_ArcBox_to_asy_locals_path_local, __pyx_k_ArcBox_to_asy_locals_path_local, sizeof(__pyx_k_ArcBox_to_asy_locals_path_local), 0, 0, 1, 1},
  {&__pyx_n_s_ArcBox_to_svg, __pyx_k_ArcBox_to_svg, sizeof(__pyx_k_ArcBox_to_svg), 0, 0, 1, 1},
  {&__pyx_n_s_ArcBox_to_svg_locals_path, __pyx_k_ArcBox_to_svg_locals_path, sizeof(__pyx_k_ArcBox_to_svg_locals_path), 0, 0, 1, 1},
  {&__pyx_n_s_Arrow, __pyx_k_Arrow, sizeof(__pyx_k_Arrow), 0, 0, 1, 1},
  {&__pyx_n_u_Arrow, __pyx_k_Arrow, sizeof(__pyx_k_Arrow), 0, 1, 0, 1},
  {&__pyx_n_s_ArrowBox, __pyx_k_ArrowBox, sizeof(__pyx_k_ArrowBox), 0, 0, 1, 1},
  {&__pyx_n_u_ArrowBox, __pyx_k_ArrowBox, sizeof(__pyx_k_ArrowBox), 0, 1, 0, 1},
  {&__pyx_n_s_ArrowBox__custom_arrow, __pyx_k_ArrowBox__custom_arrow, sizeof(__pyx_k_ArrowBox__custom_arrow), 0, 0, 1, 1},
  {&__pyx_n_s_ArrowBox__custom_arrow_locals_ma, __pyx_k_ArrowBox__custom_arrow_locals_ma, sizeof(__pyx_k_ArrowBox__custom_arrow_locals_ma), 0, 0, 1, 1},
  {&__pyx_n_s_ArrowBox__custom_arrow_locals_ma_2, __pyx_k_ArrowBox__custom_arrow_locals_ma_2, sizeof(__pyx_k_ArrowBox__custom_arrow_locals_ma_2), 0, 0, 1, 1},
  {&__pyx_n_s_ArrowBox__default_arrow, __pyx_k_ArrowBox__default_arrow, sizeof(__pyx_k_ArrowBox__default_arrow), 0, 0, 1, 1},
  {&__pyx_n_s_ArrowBox__default_arrow_locals_d, __pyx_k_ArrowBox__default_arrow_locals_d, sizeof(__pyx_k_ArrowBox__default_arrow_locals_d), 0, 0, 1, 1},
  {&__pyx_n_s_ArrowBox__draw, __pyx_k_ArrowBox__draw, sizeof(__pyx_k_ArrowBox__draw), 0, 0, 1, 1},
  {&__pyx_n_s_ArrowBox__draw_locals_lambda, __pyx_k_ArrowBox__draw_locals_lambda, sizeof(__pyx_k_ArrowBox__draw_locals_lambda), 0, 0, 1, 1},
  {&__pyx_n_s_ArrowBox__draw_locals_setback, __pyx_k_ArrowBox__draw_locals_setback, sizeof(__pyx_k_ArrowBox__draw_locals_setback), 0, 0, 1, 1},
  {&__pyx_n_s_ArrowBox__draw_locals_shrink, __pyx_k_ArrowBox__draw_locals_shrink, sizeof(__pyx_k_ArrowBox__draw_locals_shrink), 0, 0, 1, 1},
  {&__pyx_n_s_ArrowBox__draw_locals_shrink_one, __pyx_k_ArrowBox__draw_locals_shrink_one, sizeof(__pyx_k_ArrowBox__draw_locals_shrink_one), 0, 0, 1, 1},
  {&__pyx_n_s_ArrowBox__setback_spec, __pyx_k_ArrowBox__setback_spec, sizeof(__pyx_k_ArrowBox__setback_spec), 0, 0, 1, 1},
  {&__pyx_n_s_ArrowBox__setback_spec_locals_ge, __pyx_k_ArrowBox__setback_spec_locals_ge, sizeof(__pyx_k_ArrowBox__setback_spec_locals_ge), 0, 0, 1, 1},
  {&__pyx_n_s_ArrowBox_extent, __pyx_k_ArrowBox_extent, sizeof(__pyx_k_ArrowBox_extent), 0, 0, 1, 1},
  {&__pyx_n_s_ArrowBox_extent_locals_default_a, __pyx_k_ArrowBox_extent_locals_default_a, sizeof(__pyx_k_ArrowBox_extent_locals_default_a), 0, 0, 1, 1},
  {&__pyx_n_s_ArrowBox_extent_locals_polygon, __pyx_k_ArrowBox_extent_locals_polygon, sizeof(__pyx_k_ArrowBox_extent_locals_polygon), 0, 0, 1, 1},
  {&__pyx_n_s_ArrowBox_extent_locals_polyline, __pyx_k_ArrowBox_extent_locals_polyline, sizeof(__pyx_k_ArrowBox_extent_locals_polyline), 0, 0, 1, 1},
  {&__pyx_n_s_ArrowBox_init, __pyx_k_ArrowBox_init, sizeof(__pyx_k_ArrowBox_init), 0, 0, 1, 1},
  {&__pyx_n_s_ArrowBox_to_asy, __pyx_k_ArrowBox_to_asy, sizeof(__pyx_k_ArrowBox_to_asy), 0, 0, 1, 1},
  {&__pyx_n_s_ArrowBox_to_asy_locals_polygon, __pyx_k_ArrowBox_to_asy_locals_polygon, sizeof(__pyx_k_ArrowBox_to_asy_locals_polygon), 0, 0, 1, 1},
  {&__pyx_n_s_ArrowBox_to_svg, __pyx_k_ArrowBox_to_svg, sizeof(__pyx_k_ArrowBox_to_svg), 0, 0, 1, 1},
  {&__pyx_n_s_ArrowBox_to_svg_locals_polygon, __pyx_k_ArrowBox_to_svg_locals_polygon, sizeof(__pyx_k_ArrowBox_to_svg_locals_polygon), 0, 0, 1, 1},
  {&__pyx_n_s_ArrowBox_to_svg_locals_polygon_l, __pyx_k_ArrowBox_to_svg_locals_polygon_l, sizeof(__pyx_k_ArrowBox_to_svg_locals_polygon_l), 0, 0, 1, 1},
  {&__pyx_n_s_Arrowheads, __pyx_k_Arrowheads, sizeof(__pyx_k_Arrowheads), 0, 0, 1, 1},
  {&__pyx_n_u_Arrowheads, __pyx_k_Arrowheads, sizeof(__pyx_k_Arrowheads), 0, 1, 0, 1},
  {&__pyx_n_s_Arrowheads__arrow_size, __pyx_k_Arrowheads__arrow_size, sizeof(__pyx_k_Arrowheads__arrow_size), 0, 0, 1, 1},
  {&__pyx_n_s_Arrowheads_heads, __pyx_k_Arrowheads_heads, sizeof(__pyx_k_Arrowheads_heads), 0, 0, 1, 1},
  {&__pyx_n_s_Arrowheads_heads_locals_genexpr, __pyx_k_Arrowheads_heads_locals_genexpr, sizeof(__pyx_k_Arrowheads_heads_locals_genexpr), 0, 0, 1, 1},
  {&__pyx_n_s_Arrowheads_init, __pyx_k_Arrowheads_init, sizeof(__pyx_k_Arrowheads_init), 0, 0, 1, 1},
  {&__pyx_n_u_AspectRatio, __pyx_k_AspectRatio, sizeof(__pyx_k_AspectRatio), 0, 1, 0, 1},
  {&__pyx_n_s_Automatic, __pyx_k_Automatic, sizeof(__pyx_k_Automatic), 0, 0, 1, 1},
  {&__pyx_n_u_Automatic, __pyx_k_Automatic, sizeof(__pyx_k_Automatic), 0, 1, 0, 1},
  {&__pyx_n_u_Axes, __pyx_k_Axes, sizeof(__pyx_k_Axes), 0, 1, 0, 1},
  {&__pyx_n_u_AxesStyle, __pyx_k_AxesStyle, sizeof(__pyx_k_AxesStyle), 0, 1, 0, 1},
  {&__pyx_n_u_Background, __pyx_k_Background, sizeof(__pyx_k_Background), 0, 1, 0, 1},
  {&__pyx_n_s_BernsteinBasis, __pyx_k_BernsteinBasis, sizeof(__pyx_k_BernsteinBasis), 0, 0, 1, 1},
  {&__pyx_kp_u_BernsteinBasis_d__n__x, __pyx_k_BernsteinBasis_d__n__x, sizeof(__pyx_k_BernsteinBasis_d__n__x), 0, 1, 0, 0},
  {&__pyx_n_s_BezierCurve, __pyx_k_BezierCurve, sizeof(__pyx_k_BezierCurve), 0, 0, 1, 1},
  {&__pyx_n_s_BezierCurveBox, __pyx_k_BezierCurveBox, sizeof(__pyx_k_BezierCurveBox), 0, 0, 1, 1},
  {&__pyx_n_u_BezierCurveBox, __pyx_k_BezierCurveBox, sizeof(__pyx_k_BezierCurveBox), 0, 1, 0, 1},
  {&__pyx_n_s_BezierCurveBox_init, __pyx_k_BezierCurveBox_init, sizeof(__pyx_k_BezierCurveBox_init), 0, 0, 1, 1},
  {&__pyx_n_s_BezierCurveBox_to_asy, __pyx_k_BezierCurveBox_to_asy, sizeof(__pyx_k_BezierCurveBox_to_asy), 0, 0, 1, 1},
  {&__pyx_n_s_BezierCurveBox_to_svg, __pyx_k_BezierCurveBox_to_svg, sizeof(__pyx_k_BezierCurveBox_to_svg), 0, 0, 1, 1},
  {&__pyx_n_s_BezierCurve_2, __pyx_k_BezierCurve_2, sizeof(__pyx_k_BezierCurve_2), 0, 0, 1, 1},
  {&__pyx_n_u_BezierCurve_2, __pyx_k_BezierCurve_2, sizeof(__pyx_k_BezierCurve_2), 0, 1, 0, 1},
  {&__pyx_n_s_BezierCurve___init, __pyx_k_BezierCurve___init, sizeof(__pyx_k_BezierCurve___init), 0, 0, 1, 1},
  {&__pyx_n_s_BezierCurve_arrows, __pyx_k_BezierCurve_arrows, sizeof(__pyx_k_BezierCurve_arrows), 0, 0, 1, 1},
  {&__pyx_n_s_BezierCurve_make_draw_asy, __pyx_k_BezierCurve_make_draw_asy, sizeof(__pyx_k_BezierCurve_make_draw_asy), 0, 0, 1, 1},
  {&__pyx_n_s_BezierCurve_make_draw_asy_local, __pyx_k_BezierCurve_make_draw_asy_local, sizeof(__pyx_k_BezierCurve_make_draw_asy_local), 0, 0, 1, 1},
  {&__pyx_n_s_BezierCurve_make_draw_svg, __pyx_k_BezierCurve_make_draw_svg, sizeof(__pyx_k_BezierCurve_make_draw_svg), 0, 0, 1, 1},
  {&__pyx_n_s_BezierCurve_make_draw_svg_local, __pyx_k_BezierCurve_make_draw_svg_local, sizeof(__pyx_k_BezierCurve_make_draw_svg_local), 0, 0, 1, 1},
  {&__pyx_n_s_BezierFunction, __pyx_k_BezierFunction, sizeof(__pyx_k_BezierFunction), 0, 0, 1, 1},
  {&__pyx_kp_u_BezierFunction_p, __pyx_k_BezierFunction_p, sizeof(__pyx_k_BezierFunction_p), 0, 1, 0, 0},
  {&__pyx_n_s_Black, __pyx_k_Black, sizeof(__pyx_k_Black), 0, 0, 1, 1},
  {&__pyx_n_u_Black, __pyx_k_Black, sizeof(__pyx_k_Black), 0, 1, 0, 1},
  {&__pyx_kp_s_Black_GrayLevel_0, __pyx_k_Black_GrayLevel_0, sizeof(__pyx_k_Black_GrayLevel_0), 0, 0, 1, 0},
  {&__pyx_n_s_Blend, __pyx_k_Blend, sizeof(__pyx_k_Blend), 0, 0, 1, 1},
  {&__pyx_n_u_Blend, __pyx_k_Blend, sizeof(__pyx_k_Blend), 0, 1, 0, 1},
  {&__pyx_n_s_Blend_apply, __pyx_k_Blend_apply, sizeof(__pyx_k_Blend_apply), 0, 0, 1, 1},
  {&__pyx_kp_u_Blend_c_Black_f, __pyx_k_Blend_c_Black_f, sizeof(__pyx_k_Blend_c_Black_f), 0, 1, 0, 0},
  {&__pyx_kp_u_Blend_c_White_f, __pyx_k_Blend_c_White_f, sizeof(__pyx_k_Blend_c_White_f), 0, 1, 0, 0},
  {&__pyx_kp_u_Blend_colors, __pyx_k_Blend_colors, sizeof(__pyx_k_Blend_colors), 0, 1, 0, 0},
  {&__pyx_kp_u_Blend_colors_ConstantArray_1_Len, __pyx_k_Blend_colors_ConstantArray_1_Len, sizeof(__pyx_k_Blend_colors_ConstantArray_1_Len), 0, 1, 0, 0},
  {&__pyx_n_s_Blend_do_blend, __pyx_k_Blend_do_blend, sizeof(__pyx_k_Blend_do_blend), 0, 0, 1, 1},
  {&__pyx_n_s_Blue, __pyx_k_Blue, sizeof(__pyx_k_Blue), 0, 0, 1, 1},
  {&__pyx_n_u_Blue, __pyx_k_Blue, sizeof(__pyx_k_Blue), 0, 1, 0, 1},
  {&__pyx_kp_s_Blue_RGBColor_0_0_1, __pyx_k_Blue_RGBColor_0_0_1, sizeof(__pyx_k_Blue_RGBColor_0_0_1), 0, 0, 1, 0},
  {&__pyx_n_u_Box, __pyx_k_Box, sizeof(__pyx_k_Box), 0, 1, 0, 1},
  {&__pyx_n_s_BoxConstruct, __pyx_k_BoxConstruct, sizeof(__pyx_k_BoxConstruct), 0, 0, 1, 1},
  {&__pyx_n_s_BoxConstructError, __pyx_k_BoxConstructError, sizeof(__pyx_k_BoxConstructError), 0, 0, 1, 1},
  {&__pyx_n_s_Builtin, __pyx_k_Builtin, sizeof(__pyx_k_Builtin), 0, 0, 1, 1},
  {&__pyx_n_s_C1, __pyx_k_C1, sizeof(__pyx_k_C1), 0, 0, 1, 1},
  {&__pyx_n_s_C2, __pyx_k_C2, sizeof(__pyx_k_C2), 0, 0, 1, 1},
  {&__pyx_n_u_CIE2000, __pyx_k_CIE2000, sizeof(__pyx_k_CIE2000), 0, 1, 0, 1},
  {&__pyx_n_u_CIE76, __pyx_k_CIE76, sizeof(__pyx_k_CIE76), 0, 1, 0, 1},
  {&__pyx_n_u_CIE94, __pyx_k_CIE94, sizeof(__pyx_k_CIE94), 0, 1, 0, 1},
  {&__pyx_n_u_CIEDE2000, __pyx_k_CIEDE2000, sizeof(__pyx_k_CIEDE2000), 0, 1, 0, 1},
  {&__pyx_n_u_CMC, __pyx_k_CMC, sizeof(__pyx_k_CMC), 0, 1, 0, 1},
  {&__pyx_n_s_CMC_distance, __pyx_k_CMC_distance, sizeof(__pyx_k_CMC_distance), 0, 0, 1, 1},
  {&__pyx_n_u_CMYK, __pyx_k_CMYK, sizeof(__pyx_k_CMYK), 0, 1, 0, 1},
  {&__pyx_n_s_CMYKColor, __pyx_k_CMYKColor, sizeof(__pyx_k_CMYKColor), 0, 0, 1, 1},
  {&__pyx_n_u_CMYKColor, __pyx_k_CMYKColor, sizeof(__pyx_k_CMYKColor), 0, 1, 0, 1},
  {&__pyx_n_s_Circle, __pyx_k_Circle, sizeof(__pyx_k_Circle), 0, 0, 1, 1},
  {&__pyx_n_u_Circle, __pyx_k_Circle, sizeof(__pyx_k_Circle), 0, 1, 0, 1},
  {&__pyx_n_s_CircleBox, __pyx_k_CircleBox, sizeof(__pyx_k_CircleBox), 0, 0, 1, 1},
  {&__pyx_n_u_CircleBox, __pyx_k_CircleBox, sizeof(__pyx_k_CircleBox), 0, 1, 0, 1},
  {&__pyx_kp_u_Circle_0_0, __pyx_k_Circle_0_0, sizeof(__pyx_k_Circle_0_0), 0, 1, 0, 0},
  {&__pyx_kp_u_Circle_2, __pyx_k_Circle_2, sizeof(__pyx_k_Circle_2), 0, 1, 0, 0},
  {&__pyx_n_s_Cm, __pyx_k_Cm, sizeof(__pyx_k_Cm), 0, 0, 1, 1},
  {&__pyx_n_s_Color, __pyx_k_Color, sizeof(__pyx_k_Color), 0, 0, 1, 1},
  {&__pyx_n_s_ColorDistance, __pyx_k_ColorDistance, sizeof(__pyx_k_ColorDistance), 0, 0, 1, 1},
  {&__pyx_n_u_ColorDistance, __pyx_k_ColorDistance, sizeof(__pyx_k_ColorDistance), 0, 1, 0, 1},
  {&__pyx_n_s_ColorDistance_apply, __pyx_k_ColorDistance_apply, sizeof(__pyx_k_ColorDistance_apply), 0, 0, 1, 1},
  {&__pyx_n_s_ColorDistance_apply_locals_compu, __pyx_k_ColorDistance_apply_locals_compu, sizeof(__pyx_k_ColorDistance_apply_locals_compu), 0, 0, 1, 1},
  {&__pyx_n_s_ColorDistance_apply_locals_dista, __pyx_k_ColorDistance_apply_locals_dista, sizeof(__pyx_k_ColorDistance_apply_locals_dista), 0, 0, 1, 1},
  {&__pyx_n_s_ColorDistance_apply_locals_lambd, __pyx_k_ColorDistance_apply_locals_lambd, sizeof(__pyx_k_ColorDistance_apply_locals_lambd), 0, 0, 1, 1},
  {&__pyx_n_s_ColorDistance_lambda, __pyx_k_ColorDistance_lambda, sizeof(__pyx_k_ColorDistance_lambda), 0, 0, 1, 1},
  {&__pyx_n_s_ColorError, __pyx_k_ColorError, sizeof(__pyx_k_ColorError), 0, 0, 1, 1},
  {&__pyx_n_s_ColorObject, __pyx_k_ColorObject, sizeof(__pyx_k_ColorObject), 0, 0, 1, 1},
  {&__pyx_n_s_ColorObject___init, __pyx_k_ColorObject___init, sizeof(__pyx_k_ColorObject___init), 0, 0, 1, 1},
  {&__pyx_n_u_Color_2, __pyx_k_Color_2, sizeof(__pyx_k_Color_2), 0, 1, 0, 1},
  {&__pyx_n_s_Color_create, __pyx_k_Color_create, sizeof(__pyx_k_Color_create), 0, 0, 1, 1},
  {&__pyx_n_s_Color_create_as_style, __pyx_k_Color_create_as_style, sizeof(__pyx_k_Color_create_as_style), 0, 0, 1, 1},
  {&__pyx_n_s_Color_init, __pyx_k_Color_init, sizeof(__pyx_k_Color_init), 0, 0, 1, 1},
  {&__pyx_n_s_Color_to_asy, __pyx_k_Color_to_asy, sizeof(__pyx_k_Color_to_asy), 0, 0, 1, 1},
  {&__pyx_n_s_Color_to_color_space, __pyx_k_Color_to_color_space, sizeof(__pyx_k_Color_to_color_space), 0, 0, 1, 1},
  {&__pyx_n_s_Color_to_css, __pyx_k_Color_to_css, sizeof(__pyx_k_Color_to_css), 0, 0, 1, 1},
  {&__pyx_n_s_Color_to_expr, __pyx_k_Color_to_expr, sizeof(__pyx_k_Color_to_expr), 0, 0, 1, 1},
  {&__pyx_n_s_Color_to_js, __pyx_k_Color_to_js, sizeof(__pyx_k_Color_to_js), 0, 0, 1, 1},
  {&__pyx_n_s_Color_to_rgba, __pyx_k_Color_to_rgba, sizeof(__pyx_k_Color_to_rgba), 0, 0, 1, 1},
  {&__pyx_n_s_CoordinatesError, __pyx_k_CoordinatesError, sizeof(__pyx_k_CoordinatesError), 0, 0, 1, 1},
  {&__pyx_n_s_Coords, __pyx_k_Coords, sizeof(__pyx_k_Coords), 0, 0, 1, 1},
  {&__pyx_n_s_Coords___init, __pyx_k_Coords___init, sizeof(__pyx_k_Coords___init), 0, 0, 1, 1},
  {&__pyx_n_s_Coords_add, __pyx_k_Coords_add, sizeof(__pyx_k_Coords_add), 0, 0, 1, 1},
  {&__pyx_n_s_Coords_pos, __pyx_k_Coords_pos, sizeof(__pyx_k_Coords_pos), 0, 0, 1, 1},
  {&__pyx_n_s_Cyan, __pyx_k_Cyan, sizeof(__pyx_k_Cyan), 0, 0, 1, 1},
  {&__pyx_n_u_Cyan, __pyx_k_Cyan, sizeof(__pyx_k_Cyan), 0, 1, 0, 1},
  {&__pyx_kp_s_Cyan_RGBColor_0_1_1, __pyx_k_Cyan_RGBColor_0_1_1, sizeof(__pyx_k_Cyan_RGBColor_0_1_1), 0, 0, 1, 0},
  {&__pyx_n_s_Darker, __pyx_k_Darker, sizeof(__pyx_k_Darker), 0, 0, 1, 1},
  {&__pyx_kp_u_Darker_c, __pyx_k_Darker_c, sizeof(__pyx_k_Darker_c), 0, 1, 0, 0},
  {&__pyx_kp_u_Darker_c_1_3, __pyx_k_Darker_c_1_3, sizeof(__pyx_k_Darker_c_1_3), 0, 1, 0, 0},
  {&__pyx_kp_u_Darker_c__f, __pyx_k_Darker_c__f, sizeof(__pyx_k_Darker_c__f), 0, 1, 0, 0},
  {&__pyx_n_u_DeltaC, __pyx_k_DeltaC, sizeof(__pyx_k_DeltaC), 0, 1, 0, 1},
  {&__pyx_n_u_DeltaH, __pyx_k_DeltaH, sizeof(__pyx_k_DeltaH), 0, 1, 0, 1},
  {&__pyx_n_u_DeltaL, __pyx_k_DeltaL, sizeof(__pyx_k_DeltaL), 0, 1, 0, 1},
  {&__pyx_n_s_Directive, __pyx_k_Directive, sizeof(__pyx_k_Directive), 0, 0, 1, 1},
  {&__pyx_n_u_Directive, __pyx_k_Directive, sizeof(__pyx_k_Directive), 0, 1, 0, 1},
  {&__pyx_n_s_Disk, __pyx_k_Disk, sizeof(__pyx_k_Disk), 0, 0, 1, 1},
  {&__pyx_n_u_Disk, __pyx_k_Disk, sizeof(__pyx_k_Disk), 0, 1, 0, 1},
  {&__pyx_n_s_DiskBox, __pyx_k_DiskBox, sizeof(__pyx_k_DiskBox), 0, 0, 1, 1},
  {&__pyx_n_u_DiskBox, __pyx_k_DiskBox, sizeof(__pyx_k_DiskBox), 0, 1, 0, 1},
  {&__pyx_kp_u_Disk_0_0, __pyx_k_Disk_0_0, sizeof(__pyx_k_Disk_0_0), 0, 1, 0, 0},
  {&__pyx_kp_u_Disk_2, __pyx_k_Disk_2, sizeof(__pyx_k_Disk_2), 0, 1, 0, 0},
  {&__pyx_n_u_DistanceFunction, __pyx_k_DistanceFunction, sizeof(__pyx_k_DistanceFunction), 0, 1, 0, 1},
  {&__pyx_n_s_EdgeForm, __pyx_k_EdgeForm, sizeof(__pyx_k_EdgeForm), 0, 0, 1, 1},
  {&__pyx_n_s_Expression, __pyx_k_Expression, sizeof(__pyx_k_Expression), 0, 0, 1, 1},
  {&__pyx_n_s_F, __pyx_k_F, sizeof(__pyx_k_F), 0, 0, 1, 1},
  {&__pyx_n_s_FaceForm, __pyx_k_FaceForm, sizeof(__pyx_k_FaceForm), 0, 0, 1, 1},
  {&__pyx_n_u_False, __pyx_k_False, sizeof(__pyx_k_False), 0, 1, 0, 1},
  {&__pyx_n_s_FilledCurve, __pyx_k_FilledCurve, sizeof(__pyx_k_FilledCurve), 0, 0, 1, 1},
  {&__pyx_n_u_FilledCurve, __pyx_k_FilledCurve, sizeof(__pyx_k_FilledCurve), 0, 1, 0, 1},
  {&__pyx_n_s_FilledCurveBox, __pyx_k_FilledCurveBox, sizeof(__pyx_k_FilledCurveBox), 0, 0, 1, 1},
  {&__pyx_n_u_FilledCurveBox, __pyx_k_FilledCurveBox, sizeof(__pyx_k_FilledCurveBox), 0, 1, 0, 1},
  {&__pyx_n_s_FilledCurveBox_extent, __pyx_k_FilledCurveBox_extent, sizeof(__pyx_k_FilledCurveBox_extent), 0, 0, 1, 1},
  {&__pyx_n_s_FilledCurveBox_init, __pyx_k_FilledCurveBox_init, sizeof(__pyx_k_FilledCurveBox_init), 0, 0, 1, 1},
  {&__pyx_n_s_FilledCurveBox_init_locals_genex, __pyx_k_FilledCurveBox_init_locals_genex, sizeof(__pyx_k_FilledCurveBox_init_locals_genex), 0, 0, 1, 1},
  {&__pyx_n_s_FilledCurveBox_init_locals_parse, __pyx_k_FilledCurveBox_init_locals_parse, sizeof(__pyx_k_FilledCurveBox_init_locals_parse), 0, 0, 1, 1},
  {&__pyx_n_s_FilledCurveBox_to_asy, __pyx_k_FilledCurveBox_to_asy, sizeof(__pyx_k_FilledCurveBox_to_asy), 0, 0, 1, 1},
  {&__pyx_n_s_FilledCurveBox_to_asy_locals_com, __pyx_k_FilledCurveBox_to_asy_locals_com, sizeof(__pyx_k_FilledCurveBox_to_asy_locals_com), 0, 0, 1, 1},
  {&__pyx_n_s_FilledCurveBox_to_svg, __pyx_k_FilledCurveBox_to_svg, sizeof(__pyx_k_FilledCurveBox_to_svg), 0, 0, 1, 1},
  {&__pyx_n_s_FilledCurveBox_to_svg_locals_com, __pyx_k_FilledCurveBox_to_svg_locals_com, sizeof(__pyx_k_FilledCurveBox_to_svg_locals_com), 0, 0, 1, 1},
  {&__pyx_n_s_FontColor, __pyx_k_FontColor, sizeof(__pyx_k_FontColor), 0, 0, 1, 1},
  {&__pyx_n_u_FontColor, __pyx_k_FontColor, sizeof(__pyx_k_FontColor), 0, 1, 0, 1},
  {&__pyx_kp_u_Function_x_Total_p_BernsteinBasi, __pyx_k_Function_x_Total_p_BernsteinBasi, sizeof(__pyx_k_Function_x_Total_p_BernsteinBasi), 0, 1, 0, 0},
  {&__pyx_n_s_GLOBALS, __pyx_k_GLOBALS, sizeof(__pyx_k_GLOBALS), 0, 0, 1, 1},
  {&__pyx_n_s_GLOBALS3D, __pyx_k_GLOBALS3D, sizeof(__pyx_k_GLOBALS3D), 0, 0, 1, 1},
  {&__pyx_n_s_GRAPHICS_OPTIONS, __pyx_k_GRAPHICS_OPTIONS, sizeof(__pyx_k_GRAPHICS_OPTIONS), 0, 0, 1, 1},
  {&__pyx_n_s_GRAPHICS_SYMBOLS, __pyx_k_GRAPHICS_SYMBOLS, sizeof(__pyx_k_GRAPHICS_SYMBOLS), 0, 0, 1, 1},
  {&__pyx_n_s_Graphics, __pyx_k_Graphics, sizeof(__pyx_k_Graphics), 0, 0, 1, 1},
  {&__pyx_n_u_Graphics, __pyx_k_Graphics, sizeof(__pyx_k_Graphics), 0, 1, 0, 1},
  {&__pyx_n_s_GraphicsBox, __pyx_k_GraphicsBox, sizeof(__pyx_k_GraphicsBox), 0, 0, 1, 1},
  {&__pyx_n_s_GraphicsBox__get_image_size, __pyx_k_GraphicsBox__get_image_size, sizeof(__pyx_k_GraphicsBox__get_image_size), 0, 0, 1, 1},
  {&__pyx_n_s_GraphicsBox__prepare_elements, __pyx_k_GraphicsBox__prepare_elements, sizeof(__pyx_k_GraphicsBox__prepare_elements), 0, 0, 1, 1},
  {&__pyx_n_s_GraphicsBox__prepare_elements_lo, __pyx_k_GraphicsBox__prepare_elements_lo, sizeof(__pyx_k_GraphicsBox__prepare_elements_lo), 0, 0, 1, 1},
  {&__pyx_n_s_GraphicsBox__prepare_elements_lo_2, __pyx_k_GraphicsBox__prepare_elements_lo_2, sizeof(__pyx_k_GraphicsBox__prepare_elements_lo_2), 0, 0, 1, 1},
  {&__pyx_n_s_GraphicsBox__prepare_elements_lo_3, __pyx_k_GraphicsBox__prepare_elements_lo_3, sizeof(__pyx_k_GraphicsBox__prepare_elements_lo_3), 0, 0, 1, 1},
  {&__pyx_n_s_GraphicsBox_axis_ticks, __pyx_k_GraphicsBox_axis_ticks, sizeof(__pyx_k_GraphicsBox_axis_ticks), 0, 0, 1, 1},
  {&__pyx_n_s_GraphicsBox_axis_ticks_locals_ro, __pyx_k_GraphicsBox_axis_ticks_locals_ro, sizeof(__pyx_k_GraphicsBox_axis_ticks_locals_ro), 0, 0, 1, 1},
  {&__pyx_n_s_GraphicsBox_axis_ticks_locals_ro_2, __pyx_k_GraphicsBox_axis_ticks_locals_ro_2, sizeof(__pyx_k_GraphicsBox_axis_ticks_locals_ro_2), 0, 0, 1, 1},
  {&__pyx_n_s_GraphicsBox_boxes_to_tex, __pyx_k_GraphicsBox_boxes_to_tex, sizeof(__pyx_k_GraphicsBox_boxes_to_tex), 0, 0, 1, 1},
  {&__pyx_n_s_GraphicsBox_boxes_to_tex_locals, __pyx_k_GraphicsBox_boxes_to_tex_locals, sizeof(__pyx_k_GraphicsBox_boxes_to_tex_locals), 0, 0, 1, 1},
  {&__pyx_n_s_GraphicsBox_boxes_to_text, __pyx_k_GraphicsBox_boxes_to_text, sizeof(__pyx_k_GraphicsBox_boxes_to_text), 0, 0, 1, 1},
  {&__pyx_n_s_GraphicsBox_boxes_to_xml, __pyx_k_GraphicsBox_boxes_to_xml, sizeof(__pyx_k_GraphicsBox_boxes_to_xml), 0, 0, 1, 1},
  {&__pyx_n_s_GraphicsBox_boxes_to_xml_locals, __pyx_k_GraphicsBox_boxes_to_xml_locals, sizeof(__pyx_k_GraphicsBox_boxes_to_xml_locals), 0, 0, 1, 1},
  {&__pyx_n_s_GraphicsBox_create_axes, __pyx_k_GraphicsBox_create_axes, sizeof(__pyx_k_GraphicsBox_create_axes), 0, 0, 1, 1},
  {&__pyx_n_s_GraphicsBox_create_axes_locals_a, __pyx_k_GraphicsBox_create_axes_locals_a, sizeof(__pyx_k_GraphicsBox_create_axes_locals_a), 0, 0, 1, 1},
  {&__pyx_n_s_GraphicsBox_create_axes_locals_g, __pyx_k_GraphicsBox_create_axes_locals_g, sizeof(__pyx_k_GraphicsBox_create_axes_locals_g), 0, 0, 1, 1},
  {&__pyx_n_s_GraphicsBox_create_axes_locals_l, __pyx_k_GraphicsBox_create_axes_locals_l, sizeof(__pyx_k_GraphicsBox_create_axes_locals_l), 0, 0, 1, 1},
  {&__pyx_n_s_GraphicsElement, __pyx_k_GraphicsElement, sizeof(__pyx_k_GraphicsElement), 0, 0, 1, 1},
  {&__pyx_n_s_GraphicsElement_create_as_style, __pyx_k_GraphicsElement_create_as_style, sizeof(__pyx_k_GraphicsElement_create_as_style), 0, 0, 1, 1},
  {&__pyx_n_s_GraphicsElement_init, __pyx_k_GraphicsElement_init, sizeof(__pyx_k_GraphicsElement_init), 0, 0, 1, 1},
  {&__pyx_n_s_GraphicsElements, __pyx_k_GraphicsElements, sizeof(__pyx_k_GraphicsElements), 0, 0, 1, 1},
  {&__pyx_n_s_GraphicsElements_2, __pyx_k_GraphicsElements_2, sizeof(__pyx_k_GraphicsElements_2), 0, 0, 1, 1},
  {&__pyx_n_s_GraphicsElements___init, __pyx_k_GraphicsElements___init, sizeof(__pyx_k_GraphicsElements___init), 0, 0, 1, 1},
  {&__pyx_n_s_GraphicsElements___init_2, __pyx_k_GraphicsElements___init_2, sizeof(__pyx_k_GraphicsElements___init_2), 0, 0, 1, 1},
  {&__pyx_n_s_GraphicsElements___init___local, __pyx_k_GraphicsElements___init___local, sizeof(__pyx_k_GraphicsElements___init___local), 0, 0, 1, 1},
  {&__pyx_n_s_GraphicsElements___init___local_2, __pyx_k_GraphicsElements___init___local_2, sizeof(__pyx_k_GraphicsElements___init___local_2), 0, 0, 1, 1},
  {&__pyx_n_s_GraphicsElements___init___local_3, __pyx_k_GraphicsElements___init___local_3, sizeof(__pyx_k_GraphicsElements___init___local_3), 0, 0, 1, 1},
  {&__pyx_n_s_GraphicsElements_create_style, __pyx_k_GraphicsElements_create_style, sizeof(__pyx_k_GraphicsElements_create_style), 0, 0, 1, 1},
  {&__pyx_n_s_GraphicsElements_create_style_l, __pyx_k_GraphicsElements_create_style_l, sizeof(__pyx_k_GraphicsElements_create_style_l), 0, 0, 1, 1},
  {&__pyx_n_s_GraphicsElements_extent, __pyx_k_GraphicsElements_extent, sizeof(__pyx_k_GraphicsElements_extent), 0, 0, 1, 1},
  {&__pyx_n_s_GraphicsElements_get_style_clas, __pyx_k_GraphicsElements_get_style_clas, sizeof(__pyx_k_GraphicsElements_get_style_clas), 0, 0, 1, 1},
  {&__pyx_n_s_GraphicsElements_set_size, __pyx_k_GraphicsElements_set_size, sizeof(__pyx_k_GraphicsElements_set_size), 0, 0, 1, 1},
  {&__pyx_n_s_GraphicsElements_to_asy, __pyx_k_GraphicsElements_to_asy, sizeof(__pyx_k_GraphicsElements_to_asy), 0, 0, 1, 1},
  {&__pyx_n_s_GraphicsElements_to_asy_locals_g, __pyx_k_GraphicsElements_to_asy_locals_g, sizeof(__pyx_k_GraphicsElements_to_asy_locals_g), 0, 0, 1, 1},
  {&__pyx_n_s_GraphicsElements_to_svg, __pyx_k_GraphicsElements_to_svg, sizeof(__pyx_k_GraphicsElements_to_svg), 0, 0, 1, 1},
  {&__pyx_n_s_GraphicsElements_to_svg_locals_g, __pyx_k_GraphicsElements_to_svg_locals_g, sizeof(__pyx_k_GraphicsElements_to_svg_locals_g), 0, 0, 1, 1},
  {&__pyx_n_s_GraphicsElements_translate, __pyx_k_GraphicsElements_translate, sizeof(__pyx_k_GraphicsElements_translate), 0, 0, 1, 1},
  {&__pyx_n_s_GraphicsElements_translate_absol, __pyx_k_GraphicsElements_translate_absol, sizeof(__pyx_k_GraphicsElements_translate_absol), 0, 0, 1, 1},
  {&__pyx_n_s_GraphicsElements_translate_relat, __pyx_k_GraphicsElements_translate_relat, sizeof(__pyx_k_GraphicsElements_translate_relat), 0, 0, 1, 1},
  {&__pyx_kp_u_Graphics_2, __pyx_k_Graphics_2, sizeof(__pyx_k_Graphics_2), 0, 1, 0, 0},
  {&__pyx_kp_s_Graphics_EdgeForm_Thick_Green_D, __pyx_k_Graphics_EdgeForm_Thick_Green_D, sizeof(__pyx_k_Graphics_EdgeForm_Thick_Green_D), 0, 0, 1, 0},
  {&__pyx_n_s_Graphics_apply_makeboxes, __pyx_k_Graphics_apply_makeboxes, sizeof(__pyx_k_Graphics_apply_makeboxes), 0, 0, 1, 1},
  {&__pyx_n_s_Graphics_apply_makeboxes_locals, __pyx_k_Graphics_apply_makeboxes_locals, sizeof(__pyx_k_Graphics_apply_makeboxes_locals), 0, 0, 1, 1},
  {&__pyx_n_s_Graphics_apply_makeboxes_locals_2, __pyx_k_Graphics_apply_makeboxes_locals_2, sizeof(__pyx_k_Graphics_apply_makeboxes_locals_2), 0, 0, 1, 1},
  {&__pyx_n_s_Gray, __pyx_k_Gray, sizeof(__pyx_k_Gray), 0, 0, 1, 1},
  {&__pyx_n_u_Gray, __pyx_k_Gray, sizeof(__pyx_k_Gray), 0, 1, 0, 1},
  {&__pyx_n_s_GrayLevel, __pyx_k_GrayLevel, sizeof(__pyx_k_GrayLevel), 0, 0, 1, 1},
  {&__pyx_n_u_GrayLevel, __pyx_k_GrayLevel, sizeof(__pyx_k_GrayLevel), 0, 1, 0, 1},
  {&__pyx_kp_u_GrayLevel_0, __pyx_k_GrayLevel_0, sizeof(__pyx_k_GrayLevel_0), 0, 1, 0, 0},
  {&__pyx_kp_u_GrayLevel_0_5, __pyx_k_GrayLevel_0_5, sizeof(__pyx_k_GrayLevel_0_5), 0, 1, 0, 0},
  {&__pyx_kp_u_GrayLevel_1, __pyx_k_GrayLevel_1, sizeof(__pyx_k_GrayLevel_1), 0, 1, 0, 0},
  {&__pyx_kp_s_Gray_GrayLevel_0_5, __pyx_k_Gray_GrayLevel_0_5, sizeof(__pyx_k_Gray_GrayLevel_0_5), 0, 0, 1, 0},
  {&__pyx_n_u_Grayscale, __pyx_k_Grayscale, sizeof(__pyx_k_Grayscale), 0, 1, 0, 1},
  {&__pyx_n_s_Green, __pyx_k_Green, sizeof(__pyx_k_Green), 0, 0, 1, 1},
  {&__pyx_n_u_Green, __pyx_k_Green, sizeof(__pyx_k_Green), 0, 1, 0, 1},
  {&__pyx_kp_s_Green_RGBColor_0_1_0, __pyx_k_Green_RGBColor_0_1_0, sizeof(__pyx_k_Green_RGBColor_0_1_0), 0, 0, 1, 0},
  {&__pyx_n_u_HSB, __pyx_k_HSB, sizeof(__pyx_k_HSB), 0, 1, 0, 1},
  {&__pyx_n_s_Hm, __pyx_k_Hm, sizeof(__pyx_k_Hm), 0, 0, 1, 1},
  {&__pyx_n_u_HoldAll, __pyx_k_HoldAll, sizeof(__pyx_k_HoldAll), 0, 1, 0, 1},
  {&__pyx_n_s_Hue, __pyx_k_Hue, sizeof(__pyx_k_Hue), 0, 0, 1, 1},
  {&__pyx_n_u_Hue, __pyx_k_Hue, sizeof(__pyx_k_Hue), 0, 1, 0, 1},
  {&__pyx_n_s_Hue_hsl_to_rgba, __pyx_k_Hue_hsl_to_rgba, sizeof(__pyx_k_Hue_hsl_to_rgba), 0, 0, 1, 1},
  {&__pyx_n_s_Hue_hsl_to_rgba_locals_map, __pyx_k_Hue_hsl_to_rgba_locals_map, sizeof(__pyx_k_Hue_hsl_to_rgba_locals_map), 0, 0, 1, 1},
  {&__pyx_n_s_Hue_hsl_to_rgba_locals_trans, __pyx_k_Hue_hsl_to_rgba_locals_trans, sizeof(__pyx_k_Hue_hsl_to_rgba_locals_trans), 0, 0, 1, 1},
  {&__pyx_n_u_Ignore, __pyx_k_Ignore, sizeof(__pyx_k_Ignore), 0, 1, 0, 1},
  {&__pyx_n_u_ImageSize, __pyx_k_ImageSize, sizeof(__pyx_k_ImageSize), 0, 1, 0, 1},
  {&__pyx_n_s_Inset, __pyx_k_Inset, sizeof(__pyx_k_Inset), 0, 0, 1, 1},
  {&__pyx_n_u_Inset, __pyx_k_Inset, sizeof(__pyx_k_Inset), 0, 1, 0, 1},
  {&__pyx_n_s_InsetBox, __pyx_k_InsetBox, sizeof(__pyx_k_InsetBox), 0, 0, 1, 1},
  {&__pyx_n_u_InsetBox, __pyx_k_InsetBox, sizeof(__pyx_k_InsetBox), 0, 1, 0, 1},
  {&__pyx_n_s_InsetBox_extent, __pyx_k_InsetBox_extent, sizeof(__pyx_k_InsetBox_extent), 0, 0, 1, 1},
  {&__pyx_n_s_InsetBox_init, __pyx_k_InsetBox_init, sizeof(__pyx_k_InsetBox_init), 0, 0, 1, 1},
  {&__pyx_n_s_InsetBox_to_asy, __pyx_k_InsetBox_to_asy, sizeof(__pyx_k_InsetBox_to_asy), 0, 0, 1, 1},
  {&__pyx_n_s_InsetBox_to_svg, __pyx_k_InsetBox_to_svg, sizeof(__pyx_k_InsetBox_to_svg), 0, 0, 1, 1},
  {&__pyx_n_s_InstancableBuiltin, __pyx_k_InstancableBuiltin, sizeof(__pyx_k_InstancableBuiltin), 0, 0, 1, 1},
  {&__pyx_n_s_Integer, __pyx_k_Integer, sizeof(__pyx_k_Integer), 0, 0, 1, 1},
  {&__pyx_kp_u_L, __pyx_k_L, sizeof(__pyx_k_L), 0, 1, 0, 0},
  {&__pyx_n_s_L1, __pyx_k_L1, sizeof(__pyx_k_L1), 0, 0, 1, 1},
  {&__pyx_n_s_L2, __pyx_k_L2, sizeof(__pyx_k_L2), 0, 0, 1, 1},
  {&__pyx_n_u_LAB, __pyx_k_LAB, sizeof(__pyx_k_LAB), 0, 1, 0, 1},
  {&__pyx_n_s_LABColor, __pyx_k_LABColor, sizeof(__pyx_k_LABColor), 0, 0, 1, 1},
  {&__pyx_n_u_LABColor, __pyx_k_LABColor, sizeof(__pyx_k_LABColor), 0, 1, 0, 1},
  {&__pyx_n_u_LCH, __pyx_k_LCH, sizeof(__pyx_k_LCH), 0, 1, 0, 1},
  {&__pyx_n_s_LCHColor, __pyx_k_LCHColor, sizeof(__pyx_k_LCHColor), 0, 0, 1, 1},
  {&__pyx_n_u_LCHColor, __pyx_k_LCHColor, sizeof(__pyx_k_LCHColor), 0, 1, 0, 1},
  {&__pyx_n_u_LQC, __pyx_k_LQC, sizeof(__pyx_k_LQC), 0, 1, 0, 1},
  {&__pyx_n_u_LUV, __pyx_k_LUV, sizeof(__pyx_k_LUV), 0, 1, 0, 1},
  {&__pyx_n_s_LUVColor, __pyx_k_LUVColor, sizeof(__pyx_k_LUVColor), 0, 0, 1, 1},
  {&__pyx_n_u_LUVColor, __pyx_k_LUVColor, sizeof(__pyx_k_LUVColor), 0, 1, 0, 1},
  {&__pyx_n_u_LabelStyle, __pyx_k_LabelStyle, sizeof(__pyx_k_LabelStyle), 0, 1, 0, 1},
  {&__pyx_n_s_Large, __pyx_k_Large, sizeof(__pyx_k_Large), 0, 0, 1, 1},
  {&__pyx_n_s_LightRed, __pyx_k_LightRed, sizeof(__pyx_k_LightRed), 0, 0, 1, 1},
  {&__pyx_n_u_LightRed, __pyx_k_LightRed, sizeof(__pyx_k_LightRed), 0, 1, 0, 1},
  {&__pyx_n_s_Lighter, __pyx_k_Lighter, sizeof(__pyx_k_Lighter), 0, 0, 1, 1},
  {&__pyx_kp_u_Lighter_Red_0_85, __pyx_k_Lighter_Red_0_85, sizeof(__pyx_k_Lighter_Red_0_85), 0, 1, 0, 0},
  {&__pyx_kp_u_Lighter_c, __pyx_k_Lighter_c, sizeof(__pyx_k_Lighter_c), 0, 1, 0, 0},
  {&__pyx_kp_u_Lighter_c_1_3, __pyx_k_Lighter_c_1_3, sizeof(__pyx_k_Lighter_c_1_3), 0, 1, 0, 0},
  {&__pyx_kp_u_Lighter_c__f, __pyx_k_Lighter_c__f, sizeof(__pyx_k_Lighter_c__f), 0, 1, 0, 0},
  {&__pyx_n_s_Line, __pyx_k_Line, sizeof(__pyx_k_Line), 0, 0, 1, 1},
  {&__pyx_n_s_LineBox, __pyx_k_LineBox, sizeof(__pyx_k_LineBox), 0, 0, 1, 1},
  {&__pyx_n_u_LineBox, __pyx_k_LineBox, sizeof(__pyx_k_LineBox), 0, 1, 0, 1},
  {&__pyx_n_s_LineBox_init, __pyx_k_LineBox_init, sizeof(__pyx_k_LineBox_init), 0, 0, 1, 1},
  {&__pyx_n_s_LineBox_to_asy, __pyx_k_LineBox_to_asy, sizeof(__pyx_k_LineBox_to_asy), 0, 0, 1, 1},
  {&__pyx_n_s_LineBox_to_svg, __pyx_k_LineBox_to_svg, sizeof(__pyx_k_LineBox_to_svg), 0, 0, 1, 1},
  {&__pyx_n_s_Line_2, __pyx_k_Line_2, sizeof(__pyx_k_Line_2), 0, 0, 1, 1},
  {&__pyx_n_u_Line_2, __pyx_k_Line_2, sizeof(__pyx_k_Line_2), 0, 1, 0, 1},
  {&__pyx_n_s_Line_arrows, __pyx_k_Line_arrows, sizeof(__pyx_k_Line_arrows), 0, 0, 1, 1},
  {&__pyx_n_s_Line_arrows_locals_genexpr, __pyx_k_Line_arrows_locals_genexpr, sizeof(__pyx_k_Line_arrows_locals_genexpr), 0, 0, 1, 1},
  {&__pyx_n_s_Line_arrows_locals_segments, __pyx_k_Line_arrows_locals_segments, sizeof(__pyx_k_Line_arrows_locals_segments), 0, 0, 1, 1},
  {&__pyx_n_s_Line_make_draw_asy, __pyx_k_Line_make_draw_asy, sizeof(__pyx_k_Line_make_draw_asy), 0, 0, 1, 1},
  {&__pyx_n_s_Line_make_draw_asy_locals_draw, __pyx_k_Line_make_draw_asy_locals_draw, sizeof(__pyx_k_Line_make_draw_asy_locals_draw), 0, 0, 1, 1},
  {&__pyx_n_s_Line_make_draw_svg, __pyx_k_Line_make_draw_svg, sizeof(__pyx_k_Line_make_draw_svg), 0, 0, 1, 1},
  {&__pyx_n_s_Line_make_draw_svg_locals_draw, __pyx_k_Line_make_draw_svg_locals_draw, sizeof(__pyx_k_Line_make_draw_svg_locals_draw), 0, 0, 1, 1},
  {&__pyx_n_s_Line_make_draw_svg_locals_draw_2, __pyx_k_Line_make_draw_svg_locals_draw_2, sizeof(__pyx_k_Line_make_draw_svg_locals_draw_2), 0, 0, 1, 1},
  {&__pyx_n_u_List, __pyx_k_List, sizeof(__pyx_k_List), 0, 1, 0, 1},
  {&__pyx_n_s_Lm, __pyx_k_Lm, sizeof(__pyx_k_Lm), 0, 0, 1, 1},
  {&__pyx_kp_u_M, __pyx_k_M, sizeof(__pyx_k_M), 0, 1, 0, 0},
  {&__pyx_kp_u_M_f_f, __pyx_k_M_f_f, sizeof(__pyx_k_M_f_f), 0, 1, 0, 0},
  {&__pyx_n_s_Magenta, __pyx_k_Magenta, sizeof(__pyx_k_Magenta), 0, 0, 1, 1},
  {&__pyx_n_u_Magenta, __pyx_k_Magenta, sizeof(__pyx_k_Magenta), 0, 1, 0, 1},
  {&__pyx_kp_s_Magenta_RGBColor_1_0_1, __pyx_k_Magenta_RGBColor_1_0_1, sizeof(__pyx_k_Magenta_RGBColor_1_0_1), 0, 0, 1, 0},
  {&__pyx_n_u_MakeBoxes, __pyx_k_MakeBoxes, sizeof(__pyx_k_MakeBoxes), 0, 1, 0, 1},
  {&__pyx_n_s_Medium, __pyx_k_Medium, sizeof(__pyx_k_Medium), 0, 0, 1, 1},
  {&__pyx_n_u_N, __pyx_k_N, sizeof(__pyx_k_N), 0, 1, 0, 1},
  {&__pyx_kp_u_None, __pyx_k_None, sizeof(__pyx_k_None), 0, 1, 0, 0},
  {&__pyx_n_s_NotImplementedError, __pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 0, 0, 1, 1},
  {&__pyx_kp_u_NumPy_needs_to_be_installed_for, __pyx_k_NumPy_needs_to_be_installed_for, sizeof(__pyx_k_NumPy_needs_to_be_installed_for), 0, 1, 0, 0},
  {&__pyx_n_s_Offset, __pyx_k_Offset, sizeof(__pyx_k_Offset), 0, 0, 1, 1},
  {&__pyx_n_u_Offset, __pyx_k_Offset, sizeof(__pyx_k_Offset), 0, 1, 0, 1},
  {&__pyx_kp_u_OptionSyntax, __pyx_k_OptionSyntax, sizeof(__pyx_k_OptionSyntax), 0, 1, 0, 0},
  {&__pyx_n_s_Orange, __pyx_k_Orange, sizeof(__pyx_k_Orange), 0, 0, 1, 1},
  {&__pyx_n_u_Orange, __pyx_k_Orange, sizeof(__pyx_k_Orange), 0, 1, 0, 1},
  {&__pyx_n_u_Perceptibility, __pyx_k_Perceptibility, sizeof(__pyx_k_Perceptibility), 0, 1, 0, 1},
  {&__pyx_kp_u_Piecewise_Binomial_d_n_x_n_1_x_d, __pyx_k_Piecewise_Binomial_d_n_x_n_1_x_d, sizeof(__pyx_k_Piecewise_Binomial_d_n_x_n_1_x_d), 0, 1, 0, 0},
  {&__pyx_n_u_PlotRange, __pyx_k_PlotRange, sizeof(__pyx_k_PlotRange), 0, 1, 0, 1},
  {&__pyx_n_u_PlotRangePadding, __pyx_k_PlotRangePadding, sizeof(__pyx_k_PlotRangePadding), 0, 1, 0, 1},
  {&__pyx_n_s_Point, __pyx_k_Point, sizeof(__pyx_k_Point), 0, 0, 1, 1},
  {&__pyx_n_u_Point, __pyx_k_Point, sizeof(__pyx_k_Point), 0, 1, 0, 1},
  {&__pyx_n_s_PointBox, __pyx_k_PointBox, sizeof(__pyx_k_PointBox), 0, 0, 1, 1},
  {&__pyx_n_u_PointBox, __pyx_k_PointBox, sizeof(__pyx_k_PointBox), 0, 1, 0, 1},
  {&__pyx_n_s_PointBox_init, __pyx_k_PointBox_init, sizeof(__pyx_k_PointBox_init), 0, 0, 1, 1},
  {&__pyx_n_s_PointBox_init_locals_genexpr, __pyx_k_PointBox_init_locals_genexpr, sizeof(__pyx_k_PointBox_init_locals_genexpr), 0, 0, 1, 1},
  {&__pyx_n_s_PointBox_to_asy, __pyx_k_PointBox_to_asy, sizeof(__pyx_k_PointBox_to_asy), 0, 0, 1, 1},
  {&__pyx_n_s_PointBox_to_svg, __pyx_k_PointBox_to_svg, sizeof(__pyx_k_PointBox_to_svg), 0, 0, 1, 1},
  {&__pyx_n_s_PointSize, __pyx_k_PointSize, sizeof(__pyx_k_PointSize), 0, 0, 1, 1},
  {&__pyx_n_u_PointSize, __pyx_k_PointSize, sizeof(__pyx_k_PointSize), 0, 1, 0, 1},
  {&__pyx_n_s_PointSize_get_size, __pyx_k_PointSize_get_size, sizeof(__pyx_k_PointSize_get_size), 0, 0, 1, 1},
  {&__pyx_n_s_Polygon, __pyx_k_Polygon, sizeof(__pyx_k_Polygon), 0, 0, 1, 1},
  {&__pyx_n_u_Polygon, __pyx_k_Polygon, sizeof(__pyx_k_Polygon), 0, 1, 0, 1},
  {&__pyx_n_s_PolygonBox, __pyx_k_PolygonBox, sizeof(__pyx_k_PolygonBox), 0, 0, 1, 1},
  {&__pyx_n_u_PolygonBox, __pyx_k_PolygonBox, sizeof(__pyx_k_PolygonBox), 0, 1, 0, 1},
  {&__pyx_n_s_PolygonBox_init, __pyx_k_PolygonBox_init, sizeof(__pyx_k_PolygonBox_init), 0, 0, 1, 1},
  {&__pyx_n_s_PolygonBox_process_option, __pyx_k_PolygonBox_process_option, sizeof(__pyx_k_PolygonBox_process_option), 0, 0, 1, 1},
  {&__pyx_n_s_PolygonBox_to_asy, __pyx_k_PolygonBox_to_asy, sizeof(__pyx_k_PolygonBox_to_asy), 0, 0, 1, 1},
  {&__pyx_n_s_PolygonBox_to_svg, __pyx_k_PolygonBox_to_svg, sizeof(__pyx_k_PolygonBox_to_svg), 0, 0, 1, 1},
  {&__pyx_n_s_PolygonBox_to_svg_locals_genexpr, __pyx_k_PolygonBox_to_svg_locals_genexpr, sizeof(__pyx_k_PolygonBox_to_svg_locals_genexpr), 0, 0, 1, 1},
  {&__pyx_n_s_Polyline, __pyx_k_Polyline, sizeof(__pyx_k_Polyline), 0, 0, 1, 1},
  {&__pyx_n_s_Polyline_do_init, __pyx_k_Polyline_do_init, sizeof(__pyx_k_Polyline_do_init), 0, 0, 1, 1},
  {&__pyx_n_s_Polyline_do_init_locals_genexpr, __pyx_k_Polyline_do_init_locals_genexpr, sizeof(__pyx_k_Polyline_do_init_locals_genexpr), 0, 0, 1, 1},
  {&__pyx_n_s_Polyline_extent, __pyx_k_Polyline_extent, sizeof(__pyx_k_Polyline_extent), 0, 0, 1, 1},
  {&__pyx_n_s_Purple, __pyx_k_Purple, sizeof(__pyx_k_Purple), 0, 0, 1, 1},
  {&__pyx_n_u_Purple, __pyx_k_Purple, sizeof(__pyx_k_Purple), 0, 1, 0, 1},
  {&__pyx_n_u_RGB, __pyx_k_RGB, sizeof(__pyx_k_RGB), 0, 1, 0, 1},
  {&__pyx_n_s_RGBColor, __pyx_k_RGBColor, sizeof(__pyx_k_RGBColor), 0, 0, 1, 1},
  {&__pyx_n_u_RGBColor, __pyx_k_RGBColor, sizeof(__pyx_k_RGBColor), 0, 1, 0, 1},
  {&__pyx_kp_u_RGBColor_0_0_1, __pyx_k_RGBColor_0_0_1, sizeof(__pyx_k_RGBColor_0_0_1), 0, 1, 0, 0},
  {&__pyx_kp_u_RGBColor_0_1_0, __pyx_k_RGBColor_0_1_0, sizeof(__pyx_k_RGBColor_0_1_0), 0, 1, 0, 0},
  {&__pyx_kp_u_RGBColor_0_1_1, __pyx_k_RGBColor_0_1_1, sizeof(__pyx_k_RGBColor_0_1_1), 0, 1, 0, 0},
  {&__pyx_kp_u_RGBColor_0_5_0_0_5, __pyx_k_RGBColor_0_5_0_0_5, sizeof(__pyx_k_RGBColor_0_5_0_0_5), 0, 1, 0, 0},
  {&__pyx_kp_u_RGBColor_1_0_0, __pyx_k_RGBColor_1_0_0, sizeof(__pyx_k_RGBColor_1_0_0), 0, 1, 0, 0},
  {&__pyx_kp_u_RGBColor_1_0_1, __pyx_k_RGBColor_1_0_1, sizeof(__pyx_k_RGBColor_1_0_1), 0, 1, 0, 0},
  {&__pyx_kp_u_RGBColor_1_0_5_0, __pyx_k_RGBColor_1_0_5_0, sizeof(__pyx_k_RGBColor_1_0_5_0), 0, 1, 0, 0},
  {&__pyx_kp_u_RGBColor_1_1_0, __pyx_k_RGBColor_1_1_0, sizeof(__pyx_k_RGBColor_1_1_0), 0, 1, 0, 0},
  {&__pyx_n_s_RGBColor_to_rgba, __pyx_k_RGBColor_to_rgba, sizeof(__pyx_k_RGBColor_to_rgba), 0, 0, 1, 1},
  {&__pyx_n_s_Rational, __pyx_k_Rational, sizeof(__pyx_k_Rational), 0, 0, 1, 1},
  {&__pyx_n_u_ReadProtected, __pyx_k_ReadProtected, sizeof(__pyx_k_ReadProtected), 0, 1, 0, 1},
  {&__pyx_n_s_Real, __pyx_k_Real, sizeof(__pyx_k_Real), 0, 0, 1, 1},
  {&__pyx_n_s_Rectangle, __pyx_k_Rectangle, sizeof(__pyx_k_Rectangle), 0, 0, 1, 1},
  {&__pyx_n_u_Rectangle, __pyx_k_Rectangle, sizeof(__pyx_k_Rectangle), 0, 1, 0, 1},
  {&__pyx_n_s_RectangleBox, __pyx_k_RectangleBox, sizeof(__pyx_k_RectangleBox), 0, 0, 1, 1},
  {&__pyx_n_u_RectangleBox, __pyx_k_RectangleBox, sizeof(__pyx_k_RectangleBox), 0, 1, 0, 1},
  {&__pyx_n_s_RectangleBox_extent, __pyx_k_RectangleBox_extent, sizeof(__pyx_k_RectangleBox_extent), 0, 0, 1, 1},
  {&__pyx_n_s_RectangleBox_init, __pyx_k_RectangleBox_init, sizeof(__pyx_k_RectangleBox_init), 0, 0, 1, 1},
  {&__pyx_n_s_RectangleBox_to_asy, __pyx_k_RectangleBox_to_asy, sizeof(__pyx_k_RectangleBox_to_asy), 0, 0, 1, 1},
  {&__pyx_n_s_RectangleBox_to_svg, __pyx_k_RectangleBox_to_svg, sizeof(__pyx_k_RectangleBox_to_svg), 0, 0, 1, 1},
  {&__pyx_kp_u_Rectangle_0_0, __pyx_k_Rectangle_0_0, sizeof(__pyx_k_Rectangle_0_0), 0, 1, 0, 0},
  {&__pyx_kp_u_Rectangle_2, __pyx_k_Rectangle_2, sizeof(__pyx_k_Rectangle_2), 0, 1, 0, 0},
  {&__pyx_n_s_Red, __pyx_k_Red, sizeof(__pyx_k_Red), 0, 0, 1, 1},
  {&__pyx_n_u_Red, __pyx_k_Red, sizeof(__pyx_k_Red), 0, 1, 0, 1},
  {&__pyx_kp_s_Red_RGBColor_1_0_0, __pyx_k_Red_RGBColor_1_0_0, sizeof(__pyx_k_Red_RGBColor_1_0_0), 0, 0, 1, 0},
  {&__pyx_n_s_RegularPolygon, __pyx_k_RegularPolygon, sizeof(__pyx_k_RegularPolygon), 0, 0, 1, 1},
  {&__pyx_n_u_RegularPolygon, __pyx_k_RegularPolygon, sizeof(__pyx_k_RegularPolygon), 0, 1, 0, 1},
  {&__pyx_n_s_RegularPolygonBox, __pyx_k_RegularPolygonBox, sizeof(__pyx_k_RegularPolygonBox), 0, 0, 1, 1},
  {&__pyx_n_u_RegularPolygonBox, __pyx_k_RegularPolygonBox, sizeof(__pyx_k_RegularPolygonBox), 0, 1, 0, 1},
  {&__pyx_n_s_RegularPolygonBox_init, __pyx_k_RegularPolygonBox_init, sizeof(__pyx_k_RegularPolygonBox_init), 0, 0, 1, 1},
  {&__pyx_n_s_RegularPolygonBox_init_locals_ge, __pyx_k_RegularPolygonBox_init_locals_ge, sizeof(__pyx_k_RegularPolygonBox_init_locals_ge), 0, 0, 1, 1},
  {&__pyx_n_s_RegularPolygonBox_init_locals_ve, __pyx_k_RegularPolygonBox_init_locals_ve, sizeof(__pyx_k_RegularPolygonBox_init_locals_ve), 0, 0, 1, 1},
  {&__pyx_n_s_RoundBox, __pyx_k_RoundBox, sizeof(__pyx_k_RoundBox), 0, 0, 1, 1},
  {&__pyx_n_s_RoundBox_extent, __pyx_k_RoundBox_extent, sizeof(__pyx_k_RoundBox_extent), 0, 0, 1, 1},
  {&__pyx_n_s_RoundBox_init, __pyx_k_RoundBox_init, sizeof(__pyx_k_RoundBox_init), 0, 0, 1, 1},
  {&__pyx_n_s_RoundBox_to_asy, __pyx_k_RoundBox_to_asy, sizeof(__pyx_k_RoundBox_to_asy), 0, 0, 1, 1},
  {&__pyx_n_s_RoundBox_to_svg, __pyx_k_RoundBox_to_svg, sizeof(__pyx_k_RoundBox_to_svg), 0, 0, 1, 1},
  {&__pyx_n_u_Rule, __pyx_k_Rule, sizeof(__pyx_k_Rule), 0, 1, 0, 1},
  {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
  {&__pyx_n_s_SC, __pyx_k_SC, sizeof(__pyx_k_SC), 0, 0, 1, 1},
  {&__pyx_n_s_SH, __pyx_k_SH, sizeof(__pyx_k_SH), 0, 0, 1, 1},
  {&__pyx_n_s_SL, __pyx_k_SL, sizeof(__pyx_k_SL), 0, 0, 1, 1},
  {&__pyx_n_s_SVGTransform, __pyx_k_SVGTransform, sizeof(__pyx_k_SVGTransform), 0, 0, 1, 1},
  {&__pyx_n_s_SVGTransform___init, __pyx_k_SVGTransform___init, sizeof(__pyx_k_SVGTransform___init), 0, 0, 1, 1},
  {&__pyx_n_s_SVGTransform_apply, __pyx_k_SVGTransform_apply, sizeof(__pyx_k_SVGTransform_apply), 0, 0, 1, 1},
  {&__pyx_n_s_SVGTransform_matrix, __pyx_k_SVGTransform_matrix, sizeof(__pyx_k_SVGTransform_matrix), 0, 0, 1, 1},
  {&__pyx_n_s_SVGTransform_rotate, __pyx_k_SVGTransform_rotate, sizeof(__pyx_k_SVGTransform_rotate), 0, 0, 1, 1},
  {&__pyx_n_s_SVGTransform_scale, __pyx_k_SVGTransform_scale, sizeof(__pyx_k_SVGTransform_scale), 0, 0, 1, 1},
  {&__pyx_n_s_SVGTransform_translate, __pyx_k_SVGTransform_translate, sizeof(__pyx_k_SVGTransform_translate), 0, 0, 1, 1},
  {&__pyx_n_s_Show, __pyx_k_Show, sizeof(__pyx_k_Show), 0, 0, 1, 1},
  {&__pyx_n_s_Show_apply, __pyx_k_Show_apply, sizeof(__pyx_k_Show_apply), 0, 0, 1, 1},
  {&__pyx_n_s_Size, __pyx_k_Size, sizeof(__pyx_k_Size), 0, 0, 1, 1},
  {&__pyx_n_s_Size_init, __pyx_k_Size_init, sizeof(__pyx_k_Size_init), 0, 0, 1, 1},
  {&__pyx_n_s_Small, __pyx_k_Small, sizeof(__pyx_k_Small), 0, 0, 1, 1},
  {&__pyx_n_u_Sphere, __pyx_k_Sphere, sizeof(__pyx_k_Sphere), 0, 1, 0, 1},
  {&__pyx_n_u_SplineDegree, __pyx_k_SplineDegree, sizeof(__pyx_k_SplineDegree), 0, 1, 0, 1},
  {&__pyx_n_u_StandardForm, __pyx_k_StandardForm, sizeof(__pyx_k_StandardForm), 0, 1, 0, 1},
  {&__pyx_n_s_String, __pyx_k_String, sizeof(__pyx_k_String), 0, 0, 1, 1},
  {&__pyx_n_s_Style, __pyx_k_Style, sizeof(__pyx_k_Style), 0, 0, 1, 1},
  {&__pyx_n_u_Style, __pyx_k_Style, sizeof(__pyx_k_Style), 0, 1, 0, 1},
  {&__pyx_n_u_StyleBox, __pyx_k_StyleBox, sizeof(__pyx_k_StyleBox), 0, 1, 0, 1},
  {&__pyx_kp_u_Style_Graphics_EdgeForm_Black_na, __pyx_k_Style_Graphics_EdgeForm_Black_na, sizeof(__pyx_k_Style_Graphics_EdgeForm_Black_na), 0, 1, 0, 0},
  {&__pyx_n_s_Style___init, __pyx_k_Style___init, sizeof(__pyx_k_Style___init), 0, 0, 1, 1},
  {&__pyx_n_s_Style_append, __pyx_k_Style_append, sizeof(__pyx_k_Style_append), 0, 0, 1, 1},
  {&__pyx_n_s_Style_clone, __pyx_k_Style_clone, sizeof(__pyx_k_Style_clone), 0, 0, 1, 1},
  {&__pyx_n_s_Style_extend, __pyx_k_Style_extend, sizeof(__pyx_k_Style_extend), 0, 0, 1, 1},
  {&__pyx_n_s_Style_get_default_edge_color, __pyx_k_Style_get_default_edge_color, sizeof(__pyx_k_Style_get_default_edge_color), 0, 0, 1, 1},
  {&__pyx_n_s_Style_get_default_face_color, __pyx_k_Style_get_default_face_color, sizeof(__pyx_k_Style_get_default_face_color), 0, 0, 1, 1},
  {&__pyx_n_s_Style_get_line_width, __pyx_k_Style_get_line_width, sizeof(__pyx_k_Style_get_line_width), 0, 0, 1, 1},
  {&__pyx_n_s_Style_get_option, __pyx_k_Style_get_option, sizeof(__pyx_k_Style_get_option), 0, 0, 1, 1},
  {&__pyx_n_s_Style_get_style, __pyx_k_Style_get_style, sizeof(__pyx_k_Style_get_style), 0, 0, 1, 1},
  {&__pyx_n_s_Style_set_option, __pyx_k_Style_set_option, sizeof(__pyx_k_Style_set_option), 0, 0, 1, 1},
  {&__pyx_n_s_Symbol, __pyx_k_Symbol, sizeof(__pyx_k_Symbol), 0, 0, 1, 1},
  {&__pyx_kp_u_System, __pyx_k_System, sizeof(__pyx_k_System), 0, 1, 0, 0},
  {&__pyx_kp_u_System_AspectRatio, __pyx_k_System_AspectRatio, sizeof(__pyx_k_System_AspectRatio), 0, 1, 0, 0},
  {&__pyx_kp_u_System_Automatic, __pyx_k_System_Automatic, sizeof(__pyx_k_System_Automatic), 0, 1, 0, 0},
  {&__pyx_kp_u_System_Axes, __pyx_k_System_Axes, sizeof(__pyx_k_System_Axes), 0, 1, 0, 0},
  {&__pyx_kp_u_System_AxesStyle, __pyx_k_System_AxesStyle, sizeof(__pyx_k_System_AxesStyle), 0, 1, 0, 0},
  {&__pyx_kp_u_System_BSplineCurve, __pyx_k_System_BSplineCurve, sizeof(__pyx_k_System_BSplineCurve), 0, 1, 0, 0},
  {&__pyx_kp_u_System_Background, __pyx_k_System_Background, sizeof(__pyx_k_System_Background), 0, 1, 0, 0},
  {&__pyx_kp_u_System_BezierCurve, __pyx_k_System_BezierCurve, sizeof(__pyx_k_System_BezierCurve), 0, 1, 0, 0},
  {&__pyx_kp_u_System_DistanceFunction, __pyx_k_System_DistanceFunction, sizeof(__pyx_k_System_DistanceFunction), 0, 1, 0, 0},
  {&__pyx_kp_u_System_EdgeForm, __pyx_k_System_EdgeForm, sizeof(__pyx_k_System_EdgeForm), 0, 1, 0, 0},
  {&__pyx_kp_u_System_FaceForm, __pyx_k_System_FaceForm, sizeof(__pyx_k_System_FaceForm), 0, 1, 0, 0},
  {&__pyx_kp_u_System_FontColor, __pyx_k_System_FontColor, sizeof(__pyx_k_System_FontColor), 0, 1, 0, 0},
  {&__pyx_kp_u_System_Graphics, __pyx_k_System_Graphics, sizeof(__pyx_k_System_Graphics), 0, 1, 0, 0},
  {&__pyx_kp_u_System_ImageSize, __pyx_k_System_ImageSize, sizeof(__pyx_k_System_ImageSize), 0, 1, 0, 0},
  {&__pyx_kp_u_System_Inset, __pyx_k_System_Inset, sizeof(__pyx_k_System_Inset), 0, 1, 0, 0},
  {&__pyx_kp_u_System_LabelStyle, __pyx_k_System_LabelStyle, sizeof(__pyx_k_System_LabelStyle), 0, 1, 0, 0},
  {&__pyx_kp_u_System_Large, __pyx_k_System_Large, sizeof(__pyx_k_System_Large), 0, 1, 0, 0},
  {&__pyx_kp_u_System_Line, __pyx_k_System_Line, sizeof(__pyx_k_System_Line), 0, 1, 0, 0},
  {&__pyx_kp_u_System_List, __pyx_k_System_List, sizeof(__pyx_k_System_List), 0, 1, 0, 0},
  {&__pyx_kp_u_System_Medium, __pyx_k_System_Medium, sizeof(__pyx_k_System_Medium), 0, 1, 0, 0},
  {&__pyx_kp_u_System_Null, __pyx_k_System_Null, sizeof(__pyx_k_System_Null), 0, 1, 0, 0},
  {&__pyx_kp_u_System_PlotRange, __pyx_k_System_PlotRange, sizeof(__pyx_k_System_PlotRange), 0, 1, 0, 0},
  {&__pyx_kp_u_System_Rule, __pyx_k_System_Rule, sizeof(__pyx_k_System_Rule), 0, 1, 0, 0},
  {&__pyx_kp_u_System_Small, __pyx_k_System_Small, sizeof(__pyx_k_System_Small), 0, 1, 0, 0},
  {&__pyx_kp_u_System_SplineDegree, __pyx_k_System_SplineDegree, sizeof(__pyx_k_System_SplineDegree), 0, 1, 0, 0},
  {&__pyx_kp_u_System_String, __pyx_k_System_String, sizeof(__pyx_k_System_String), 0, 1, 0, 0},
  {&__pyx_kp_u_System_Style, __pyx_k_System_Style, sizeof(__pyx_k_System_Style), 0, 1, 0, 0},
  {&__pyx_kp_u_System_StyleBox, __pyx_k_System_StyleBox, sizeof(__pyx_k_System_StyleBox), 0, 1, 0, 0},
  {&__pyx_kp_u_System_Symbol, __pyx_k_System_Symbol, sizeof(__pyx_k_System_Symbol), 0, 1, 0, 0},
  {&__pyx_kp_u_System_Text, __pyx_k_System_Text, sizeof(__pyx_k_System_Text), 0, 1, 0, 0},
  {&__pyx_kp_u_System_TicksStyle, __pyx_k_System_TicksStyle, sizeof(__pyx_k_System_TicksStyle), 0, 1, 0, 0},
  {&__pyx_kp_u_System_Tiny, __pyx_k_System_Tiny, sizeof(__pyx_k_System_Tiny), 0, 1, 0, 0},
  {&__pyx_kp_u_System_VertexColors, __pyx_k_System_VertexColors, sizeof(__pyx_k_System_VertexColors), 0, 1, 0, 0},
  {&__pyx_n_s_T, __pyx_k_T, sizeof(__pyx_k_T), 0, 0, 1, 1},
  {&__pyx_n_s_Text, __pyx_k_Text, sizeof(__pyx_k_Text), 0, 0, 1, 1},
  {&__pyx_n_u_Text, __pyx_k_Text, sizeof(__pyx_k_Text), 0, 1, 0, 1},
  {&__pyx_n_s_Thick, __pyx_k_Thick, sizeof(__pyx_k_Thick), 0, 0, 1, 1},
  {&__pyx_n_u_Thick, __pyx_k_Thick, sizeof(__pyx_k_Thick), 0, 1, 0, 1},
  {&__pyx_n_s_Thickness, __pyx_k_Thickness, sizeof(__pyx_k_Thickness), 0, 0, 1, 1},
  {&__pyx_n_s_Thickness_2, __pyx_k_Thickness_2, sizeof(__pyx_k_Thickness_2), 0, 0, 1, 1},
  {&__pyx_n_u_Thickness_2, __pyx_k_Thickness_2, sizeof(__pyx_k_Thickness_2), 0, 1, 0, 1},
  {&__pyx_n_s_Thickness_get_thickness, __pyx_k_Thickness_get_thickness, sizeof(__pyx_k_Thickness_get_thickness), 0, 0, 1, 1},
  {&__pyx_n_s_Thin, __pyx_k_Thin, sizeof(__pyx_k_Thin), 0, 0, 1, 1},
  {&__pyx_n_u_Thin, __pyx_k_Thin, sizeof(__pyx_k_Thin), 0, 1, 0, 1},
  {&__pyx_n_u_TicksStyle, __pyx_k_TicksStyle, sizeof(__pyx_k_TicksStyle), 0, 1, 0, 1},
  {&__pyx_n_s_Tiny, __pyx_k_Tiny, sizeof(__pyx_k_Tiny), 0, 0, 1, 1},
  {&__pyx_n_u_TraditionalForm, __pyx_k_TraditionalForm, sizeof(__pyx_k_TraditionalForm), 0, 1, 0, 1},
  {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
  {&__pyx_n_s_White, __pyx_k_White, sizeof(__pyx_k_White), 0, 0, 1, 1},
  {&__pyx_n_u_White, __pyx_k_White, sizeof(__pyx_k_White), 0, 1, 0, 1},
  {&__pyx_kp_s_White_GrayLevel_1, __pyx_k_White_GrayLevel_1, sizeof(__pyx_k_White_GrayLevel_1), 0, 0, 1, 0},
  {&__pyx_n_u_XYZ, __pyx_k_XYZ, sizeof(__pyx_k_XYZ), 0, 1, 0, 1},
  {&__pyx_n_s_XYZColor, __pyx_k_XYZColor, sizeof(__pyx_k_XYZColor), 0, 0, 1, 1},
  {&__pyx_n_u_XYZColor, __pyx_k_XYZColor, sizeof(__pyx_k_XYZColor), 0, 1, 0, 1},
  {&__pyx_n_s_Yellow, __pyx_k_Yellow, sizeof(__pyx_k_Yellow), 0, 0, 1, 1},
  {&__pyx_n_u_Yellow, __pyx_k_Yellow, sizeof(__pyx_k_Yellow), 0, 1, 0, 1},
  {&__pyx_kp_s_Yellow_RGBColor_1_1_0, __pyx_k_Yellow_RGBColor_1_1_0, sizeof(__pyx_k_Yellow_RGBColor_1_1_0), 0, 0, 1, 0},
  {&__pyx_n_u_Z, __pyx_k_Z, sizeof(__pyx_k_Z), 0, 1, 0, 1},
  {&__pyx_kp_u_Z_2, __pyx_k_Z_2, sizeof(__pyx_k_Z_2), 0, 1, 0, 0},
  {&__pyx_kp_u__10, __pyx_k__10, sizeof(__pyx_k__10), 0, 1, 0, 0},
  {&__pyx_kp_u__108, __pyx_k__108, sizeof(__pyx_k__108), 0, 1, 0, 0},
  {&__pyx_kp_u__109, __pyx_k__109, sizeof(__pyx_k__109), 0, 1, 0, 0},
  {&__pyx_kp_u__140, __pyx_k__140, sizeof(__pyx_k__140), 0, 1, 0, 0},
  {&__pyx_kp_u__141, __pyx_k__141, sizeof(__pyx_k__141), 0, 1, 0, 0},
  {&__pyx_kp_u__142, __pyx_k__142, sizeof(__pyx_k__142), 0, 1, 0, 0},
  {&__pyx_kp_u__151, __pyx_k__151, sizeof(__pyx_k__151), 0, 1, 0, 0},
  {&__pyx_kp_u__16, __pyx_k__16, sizeof(__pyx_k__16), 0, 1, 0, 0},
  {&__pyx_kp_u__17, __pyx_k__17, sizeof(__pyx_k__17), 0, 1, 0, 0},
  {&__pyx_kp_u__18, __pyx_k__18, sizeof(__pyx_k__18), 0, 1, 0, 0},
  {&__pyx_n_s__186, __pyx_k__186, sizeof(__pyx_k__186), 0, 0, 1, 1},
  {&__pyx_kp_u__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 1, 0, 0},
  {&__pyx_kp_u__30, __pyx_k__30, sizeof(__pyx_k__30), 0, 1, 0, 0},
  {&__pyx_kp_u__31, __pyx_k__31, sizeof(__pyx_k__31), 0, 1, 0, 0},
  {&__pyx_kp_u__32, __pyx_k__32, sizeof(__pyx_k__32), 0, 1, 0, 0},
  {&__pyx_kp_u__33, __pyx_k__33, sizeof(__pyx_k__33), 0, 1, 0, 0},
  {&__pyx_kp_u__34, __pyx_k__34, sizeof(__pyx_k__34), 0, 1, 0, 0},
  {&__pyx_kp_u__35, __pyx_k__35, sizeof(__pyx_k__35), 0, 1, 0, 0},
  {&__pyx_kp_u__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 1, 0, 0},
  {&__pyx_kp_u__41, __pyx_k__41, sizeof(__pyx_k__41), 0, 1, 0, 0},
  {&__pyx_kp_u__43, __pyx_k__43, sizeof(__pyx_k__43), 0, 1, 0, 0},
  {&__pyx_kp_u__5, __pyx_k__5, sizeof(__pyx_k__5), 0, 1, 0, 0},
  {&__pyx_kp_u__57, __pyx_k__57, sizeof(__pyx_k__57), 0, 1, 0, 0},
  {&__pyx_kp_u__58, __pyx_k__58, sizeof(__pyx_k__58), 0, 1, 0, 0},
  {&__pyx_kp_u__6, __pyx_k__6, sizeof(__pyx_k__6), 0, 1, 0, 0},
  {&__pyx_kp_u__66, __pyx_k__66, sizeof(__pyx_k__66), 0, 1, 0, 0},
  {&__pyx_kp_u__67, __pyx_k__67, sizeof(__pyx_k__67), 0, 1, 0, 0},
  {&__pyx_kp_u__7, __pyx_k__7, sizeof(__pyx_k__7), 0, 1, 0, 0},
  {&__pyx_kp_u__8, __pyx_k__8, sizeof(__pyx_k__8), 0, 1, 0, 0},
  {&__pyx_kp_u__9, __pyx_k__9, sizeof(__pyx_k__9), 0, 1, 0, 0},
  {&__pyx_n_s_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 0, 1, 1},
  {&__pyx_n_s_a1, __pyx_k_a1, sizeof(__pyx_k_a1), 0, 0, 1, 1},
  {&__pyx_n_s_a2, __pyx_k_a2, sizeof(__pyx_k_a2), 0, 0, 1, 1},
  {&__pyx_n_s_add, __pyx_k_add, sizeof(__pyx_k_add), 0, 0, 1, 1},
  {&__pyx_n_s_add_element, __pyx_k_add_element, sizeof(__pyx_k_add_element), 0, 0, 1, 1},
  {&__pyx_kp_u_add_s_new_picture_picture_saved, __pyx_k_add_s_new_picture_picture_saved, sizeof(__pyx_k_add_s_new_picture_picture_saved), 0, 1, 0, 0},
  {&__pyx_n_s_allow_forms, __pyx_k_allow_forms, sizeof(__pyx_k_allow_forms), 0, 0, 1, 1},
  {&__pyx_n_s_alpha, __pyx_k_alpha, sizeof(__pyx_k_alpha), 0, 0, 1, 1},
  {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1},
  {&__pyx_n_s_apply, __pyx_k_apply, sizeof(__pyx_k_apply), 0, 0, 1, 1},
  {&__pyx_n_s_apply_makeboxes, __pyx_k_apply_makeboxes, sizeof(__pyx_k_apply_makeboxes), 0, 0, 1, 1},
  {&__pyx_n_s_arc, __pyx_k_arc, sizeof(__pyx_k_arc), 0, 0, 1, 1},
  {&__pyx_n_s_arc_expr, __pyx_k_arc_expr, sizeof(__pyx_k_arc_expr), 0, 0, 1, 1},
  {&__pyx_n_s_arc_params, __pyx_k_arc_params, sizeof(__pyx_k_arc_params), 0, 0, 1, 1},
  {&__pyx_kp_u_arc_s_s_s_s_s_s, __pyx_k_arc_s_s_s_s_s_s, sizeof(__pyx_k_arc_s_s_s_s_s_s), 0, 1, 0, 0},
  {&__pyx_n_u_arg, __pyx_k_arg, sizeof(__pyx_k_arg), 0, 1, 0, 1},
  {&__pyx_n_u_argl, __pyx_k_argl, sizeof(__pyx_k_argl), 0, 1, 0, 1},
  {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1},
  {&__pyx_n_s_arrow, __pyx_k_arrow, sizeof(__pyx_k_arrow), 0, 0, 1, 1},
  {&__pyx_n_s_arrow_edge, __pyx_k_arrow_edge, sizeof(__pyx_k_arrow_edge), 0, 0, 1, 1},
  {&__pyx_n_s_arrow_pen, __pyx_k_arrow_pen, sizeof(__pyx_k_arrow_pen), 0, 0, 1, 1},
  {&__pyx_n_s_arrow_size, __pyx_k_arrow_size, sizeof(__pyx_k_arrow_size), 0, 0, 1, 1},
  {&__pyx_n_s_arrow_spread, __pyx_k_arrow_spread, sizeof(__pyx_k_arrow_spread), 0, 0, 1, 1},
  {&__pyx_n_s_arrow_style, __pyx_k_arrow_style, sizeof(__pyx_k_arrow_style), 0, 0, 1, 1},
  {&__pyx_n_s_arrows, __pyx_k_arrows, sizeof(__pyx_k_arrows), 0, 0, 1, 1},
  {&__pyx_n_s_aspect, __pyx_k_aspect, sizeof(__pyx_k_aspect), 0, 0, 1, 1},
  {&__pyx_n_s_aspect_ratio, __pyx_k_aspect_ratio, sizeof(__pyx_k_aspect_ratio), 0, 0, 1, 1},
  {&__pyx_n_s_asy, __pyx_k_asy, sizeof(__pyx_k_asy), 0, 0, 1, 1},
  {&__pyx_n_u_asy, __pyx_k_asy, sizeof(__pyx_k_asy), 0, 1, 0, 1},
  {&__pyx_n_s_asy_background, __pyx_k_asy_background, sizeof(__pyx_k_asy_background), 0, 0, 1, 1},
  {&__pyx_n_s_asy_bezier, __pyx_k_asy_bezier, sizeof(__pyx_k_asy_bezier), 0, 0, 1, 1},
  {&__pyx_n_s_asy_bezier_locals_cubic, __pyx_k_asy_bezier_locals_cubic, sizeof(__pyx_k_asy_bezier_locals_cubic), 0, 0, 1, 1},
  {&__pyx_n_s_asy_bezier_locals_linear, __pyx_k_asy_bezier_locals_linear, sizeof(__pyx_k_asy_bezier_locals_linear), 0, 0, 1, 1},
  {&__pyx_n_s_asy_bezier_locals_path, __pyx_k_asy_bezier_locals_path, sizeof(__pyx_k_asy_bezier_locals_path), 0, 0, 1, 1},
  {&__pyx_n_s_asy_bezier_locals_quadratric, __pyx_k_asy_bezier_locals_quadratric, sizeof(__pyx_k_asy_bezier_locals_quadratric), 0, 0, 1, 1},
  {&__pyx_n_s_asy_box, __pyx_k_asy_box, sizeof(__pyx_k_asy_box), 0, 0, 1, 1},
  {&__pyx_n_s_asy_completely_visible, __pyx_k_asy_completely_visible, sizeof(__pyx_k_asy_completely_visible), 0, 0, 1, 1},
  {&__pyx_n_s_asy_number, __pyx_k_asy_number, sizeof(__pyx_k_asy_number), 0, 0, 1, 1},
  {&__pyx_n_s_asy_regular, __pyx_k_asy_regular, sizeof(__pyx_k_asy_regular), 0, 0, 1, 1},
  {&__pyx_n_s_atan2, __pyx_k_atan2, sizeof(__pyx_k_atan2), 0, 0, 1, 1},
  {&__pyx_n_s_atoms, __pyx_k_atoms, sizeof(__pyx_k_atoms), 0, 0, 1, 1},
  {&__pyx_n_s_attributes, __pyx_k_attributes, sizeof(__pyx_k_attributes), 0, 0, 1, 1},
  {&__pyx_n_s_axes, __pyx_k_axes, sizeof(__pyx_k_axes), 0, 0, 1, 1},
  {&__pyx_n_s_axes_extra, __pyx_k_axes_extra, sizeof(__pyx_k_axes_extra), 0, 0, 1, 1},
  {&__pyx_n_s_axes_style, __pyx_k_axes_style, sizeof(__pyx_k_axes_style), 0, 0, 1, 1},
  {&__pyx_n_s_axis_ticks, __pyx_k_axis_ticks, sizeof(__pyx_k_axis_ticks), 0, 0, 1, 1},
  {&__pyx_n_s_b, __pyx_k_b, sizeof(__pyx_k_b), 0, 0, 1, 1},
  {&__pyx_n_s_b1, __pyx_k_b1, sizeof(__pyx_k_b1), 0, 0, 1, 1},
  {&__pyx_n_s_b2, __pyx_k_b2, sizeof(__pyx_k_b2), 0, 0, 1, 1},
  {&__pyx_n_s_b64encode, __pyx_k_b64encode, sizeof(__pyx_k_b64encode), 0, 0, 1, 1},
  {&__pyx_n_s_background, __pyx_k_background, sizeof(__pyx_k_background), 0, 0, 1, 1},
  {&__pyx_n_s_background_color, __pyx_k_background_color, sizeof(__pyx_k_background_color), 0, 0, 1, 1},
  {&__pyx_n_s_base64, __pyx_k_base64, sizeof(__pyx_k_base64), 0, 0, 1, 1},
  {&__pyx_n_s_base_height, __pyx_k_base_height, sizeof(__pyx_k_base_height), 0, 0, 1, 1},
  {&__pyx_n_s_base_width, __pyx_k_base_width, sizeof(__pyx_k_base_width), 0, 0, 1, 1},
  {&__pyx_kp_u_begin_asy_usepackage_amsmath_si, __pyx_k_begin_asy_usepackage_amsmath_si, sizeof(__pyx_k_begin_asy_usepackage_amsmath_si), 0, 1, 0, 0},
  {&__pyx_n_s_bezier_derivative, __pyx_k_bezier_derivative, sizeof(__pyx_k_bezier_derivative), 0, 0, 1, 1},
  {&__pyx_n_s_bezier_evaluate, __pyx_k_bezier_evaluate, sizeof(__pyx_k_bezier_evaluate), 0, 0, 1, 1},
  {&__pyx_n_s_black, __pyx_k_black, sizeof(__pyx_k_black), 0, 0, 1, 1},
  {&__pyx_n_s_border, __pyx_k_border, sizeof(__pyx_k_border), 0, 0, 1, 1},
  {&__pyx_kp_u_box, __pyx_k_box, sizeof(__pyx_k_box), 0, 1, 0, 0},
  {&__pyx_n_s_box_name, __pyx_k_box_name, sizeof(__pyx_k_box_name), 0, 0, 1, 1},
  {&__pyx_n_s_box_suffix, __pyx_k_box_suffix, sizeof(__pyx_k_box_suffix), 0, 0, 1, 1},
  {&__pyx_n_s_boxes_to_tex, __pyx_k_boxes_to_tex, sizeof(__pyx_k_boxes_to_tex), 0, 0, 1, 1},
  {&__pyx_n_s_boxes_to_text, __pyx_k_boxes_to_text, sizeof(__pyx_k_boxes_to_text), 0, 0, 1, 1},
  {&__pyx_n_s_boxes_to_xml, __pyx_k_boxes_to_xml, sizeof(__pyx_k_boxes_to_xml), 0, 0, 1, 1},
  {&__pyx_n_s_boxh, __pyx_k_boxh, sizeof(__pyx_k_boxh), 0, 0, 1, 1},
  {&__pyx_n_s_boxw, __pyx_k_boxw, sizeof(__pyx_k_boxw), 0, 0, 1, 1},
  {&__pyx_n_s_brush, __pyx_k_brush, sizeof(__pyx_k_brush), 0, 0, 1, 1},
  {&__pyx_n_s_builtin, __pyx_k_builtin, sizeof(__pyx_k_builtin), 0, 0, 1, 1},
  {&__pyx_n_s_builtins, __pyx_k_builtins, sizeof(__pyx_k_builtins), 0, 0, 1, 1},
  {&__pyx_n_s_bx, __pyx_k_bx, sizeof(__pyx_k_bx), 0, 0, 1, 1},
  {&__pyx_n_s_by, __pyx_k_by, sizeof(__pyx_k_by), 0, 0, 1, 1},
  {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1},
  {&__pyx_n_s_c1, __pyx_k_c1, sizeof(__pyx_k_c1), 0, 0, 1, 1},
  {&__pyx_n_s_c2, __pyx_k_c2, sizeof(__pyx_k_c2), 0, 0, 1, 1},
  {&__pyx_n_s_calc_dimensions, __pyx_k_calc_dimensions, sizeof(__pyx_k_calc_dimensions), 0, 0, 1, 1},
  {&__pyx_kp_u_cannot_compute_bezier_curve_of_o, __pyx_k_cannot_compute_bezier_curve_of_o, sizeof(__pyx_k_cannot_compute_bezier_curve_of_o), 0, 1, 0, 0},
  {&__pyx_kp_u_cannot_convert_from_color_space, __pyx_k_cannot_convert_from_color_space, sizeof(__pyx_k_cannot_convert_from_color_space), 0, 1, 0, 0},
  {&__pyx_n_s_ceil, __pyx_k_ceil, sizeof(__pyx_k_ceil), 0, 0, 1, 1},
  {&__pyx_n_s_chain, __pyx_k_chain, sizeof(__pyx_k_chain), 0, 0, 1, 1},
  {&__pyx_n_s_chroma, __pyx_k_chroma, sizeof(__pyx_k_chroma), 0, 0, 1, 1},
  {&__pyx_n_s_cie2000_distance, __pyx_k_cie2000_distance, sizeof(__pyx_k_cie2000_distance), 0, 0, 1, 1},
  {&__pyx_kp_u_circle_cx, __pyx_k_circle_cx, sizeof(__pyx_k_circle_cx), 0, 1, 0, 0},
  {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
  {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
  {&__pyx_kp_u_clip, __pyx_k_clip, sizeof(__pyx_k_clip), 0, 1, 0, 0},
  {&__pyx_n_s_clone, __pyx_k_clone, sizeof(__pyx_k_clone), 0, 0, 1, 1},
  {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1},
  {&__pyx_n_s_closed, __pyx_k_closed, sizeof(__pyx_k_closed), 0, 0, 1, 1},
  {&__pyx_n_s_cls, __pyx_k_cls, sizeof(__pyx_k_cls), 0, 0, 1, 1},
  {&__pyx_kp_u_cm, __pyx_k_cm, sizeof(__pyx_k_cm), 0, 1, 0, 0},
  {&__pyx_kp_u_cm_2, __pyx_k_cm_2, sizeof(__pyx_k_cm_2), 0, 1, 0, 0},
  {&__pyx_n_s_cmd, __pyx_k_cmd, sizeof(__pyx_k_cmd), 0, 0, 1, 1},
  {&__pyx_n_s_code, __pyx_k_code, sizeof(__pyx_k_code), 0, 0, 1, 1},
  {&__pyx_n_s_color, __pyx_k_color, sizeof(__pyx_k_color), 0, 0, 1, 1},
  {&__pyx_kp_u_color_s, __pyx_k_color_s, sizeof(__pyx_k_color_s), 0, 1, 0, 0},
  {&__pyx_n_s_color_space, __pyx_k_color_space, sizeof(__pyx_k_color_space), 0, 0, 1, 1},
  {&__pyx_n_s_color_to_expression, __pyx_k_color_to_expression, sizeof(__pyx_k_color_to_expression), 0, 0, 1, 1},
  {&__pyx_n_s_colors, __pyx_k_colors, sizeof(__pyx_k_colors), 0, 0, 1, 1},
  {&__pyx_n_s_colors_orig, __pyx_k_colors_orig, sizeof(__pyx_k_colors_orig), 0, 0, 1, 1},
  {&__pyx_n_s_colorspace, __pyx_k_colorspace, sizeof(__pyx_k_colorspace), 0, 0, 1, 1},
  {&__pyx_n_s_command, __pyx_k_command, sizeof(__pyx_k_command), 0, 0, 1, 1},
  {&__pyx_n_s_completely_visible_only, __pyx_k_completely_visible_only, sizeof(__pyx_k_completely_visible_only), 0, 0, 1, 1},
  {&__pyx_n_s_component, __pyx_k_component, sizeof(__pyx_k_component), 0, 0, 1, 1},
  {&__pyx_n_s_component_distance, __pyx_k_component_distance, sizeof(__pyx_k_component_distance), 0, 0, 1, 1},
  {&__pyx_n_s_components, __pyx_k_components, sizeof(__pyx_k_components), 0, 0, 1, 1},
  {&__pyx_n_s_components_sizes, __pyx_k_components_sizes, sizeof(__pyx_k_components_sizes), 0, 0, 1, 1},
  {&__pyx_n_s_compute, __pyx_k_compute, sizeof(__pyx_k_compute), 0, 0, 1, 1},
  {&__pyx_n_s_connect, __pyx_k_connect, sizeof(__pyx_k_connect), 0, 0, 1, 1},
  {&__pyx_n_s_consider_forms, __pyx_k_consider_forms, sizeof(__pyx_k_consider_forms), 0, 0, 1, 1},
  {&__pyx_n_s_content, __pyx_k_content, sizeof(__pyx_k_content), 0, 0, 1, 1},
  {&__pyx_n_s_content_text, __pyx_k_content_text, sizeof(__pyx_k_content_text), 0, 0, 1, 1},
  {&__pyx_kp_u_controls_5g_5g_and_5g_5g_5g_5g, __pyx_k_controls_5g_5g_and_5g_5g_5g_5g, sizeof(__pyx_k_controls_5g_5g_and_5g_5g_5g_5g), 0, 1, 0, 0},
  {&__pyx_n_s_convert, __pyx_k_convert, sizeof(__pyx_k_convert), 0, 0, 1, 1},
  {&__pyx_n_s_convert_color, __pyx_k_convert_color, sizeof(__pyx_k_convert_color), 0, 0, 1, 1},
  {&__pyx_n_s_converted_color_name, __pyx_k_converted_color_name, sizeof(__pyx_k_converted_color_name), 0, 0, 1, 1},
  {&__pyx_n_s_coords, __pyx_k_coords, sizeof(__pyx_k_coords), 0, 0, 1, 1},
  {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1},
  {&__pyx_n_s_cos, __pyx_k_cos, sizeof(__pyx_k_cos), 0, 0, 1, 1},
  {&__pyx_n_s_cp, __pyx_k_cp, sizeof(__pyx_k_cp), 0, 0, 1, 1},
  {&__pyx_n_s_cp0, __pyx_k_cp0, sizeof(__pyx_k_cp0), 0, 0, 1, 1},
  {&__pyx_n_s_cp1, __pyx_k_cp1, sizeof(__pyx_k_cp1), 0, 0, 1, 1},
  {&__pyx_n_s_cp2, __pyx_k_cp2, sizeof(__pyx_k_cp2), 0, 0, 1, 1},
  {&__pyx_n_s_cp3, __pyx_k_cp3, sizeof(__pyx_k_cp3), 0, 0, 1, 1},
  {&__pyx_n_s_create, __pyx_k_create, sizeof(__pyx_k_create), 0, 0, 1, 1},
  {&__pyx_n_s_create_as_style, __pyx_k_create_as_style, sizeof(__pyx_k_create_as_style), 0, 0, 1, 1},
  {&__pyx_n_s_create_axes, __pyx_k_create_axes, sizeof(__pyx_k_create_axes), 0, 0, 1, 1},
  {&__pyx_n_s_create_css, __pyx_k_create_css, sizeof(__pyx_k_create_css), 0, 0, 1, 1},
  {&__pyx_n_s_create_pens, __pyx_k_create_pens, sizeof(__pyx_k_create_pens), 0, 0, 1, 1},
  {&__pyx_n_s_create_style, __pyx_k_create_style, sizeof(__pyx_k_create_style), 0, 0, 1, 1},
  {&__pyx_n_s_css, __pyx_k_css, sizeof(__pyx_k_css), 0, 0, 1, 1},
  {&__pyx_n_s_cubic, __pyx_k_cubic, sizeof(__pyx_k_cubic), 0, 0, 1, 1},
  {&__pyx_n_u_currentpen, __pyx_k_currentpen, sizeof(__pyx_k_currentpen), 0, 1, 0, 1},
  {&__pyx_n_s_curve, __pyx_k_curve, sizeof(__pyx_k_curve), 0, 0, 1, 1},
  {&__pyx_n_s_curve_head_name, __pyx_k_curve_head_name, sizeof(__pyx_k_curve_head_name), 0, 0, 1, 1},
  {&__pyx_n_s_curve_points, __pyx_k_curve_points, sizeof(__pyx_k_curve_points), 0, 0, 1, 1},
  {&__pyx_n_s_custom_arrow, __pyx_k_custom_arrow, sizeof(__pyx_k_custom_arrow), 0, 0, 1, 1},
  {&__pyx_n_s_custom_arrow_2, __pyx_k_custom_arrow_2, sizeof(__pyx_k_custom_arrow_2), 0, 0, 1, 1},
  {&__pyx_n_s_cut, __pyx_k_cut, sizeof(__pyx_k_cut), 0, 0, 1, 1},
  {&__pyx_n_s_cx, __pyx_k_cx, sizeof(__pyx_k_cx), 0, 0, 1, 1},
  {&__pyx_kp_u_cy, __pyx_k_cy, sizeof(__pyx_k_cy), 0, 1, 0, 0},
  {&__pyx_n_s_cy_2, __pyx_k_cy_2, sizeof(__pyx_k_cy_2), 0, 0, 1, 1},
  {&__pyx_kp_u_cycle, __pyx_k_cycle, sizeof(__pyx_k_cycle), 0, 1, 0, 0},
  {&__pyx_kp_u_cycle_2, __pyx_k_cycle_2, sizeof(__pyx_k_cycle_2), 0, 1, 0, 0},
  {&__pyx_kp_u_cycle_3, __pyx_k_cycle_3, sizeof(__pyx_k_cycle_3), 0, 1, 0, 0},
  {&__pyx_kp_u_cycle_s, __pyx_k_cycle_s, sizeof(__pyx_k_cycle_s), 0, 1, 0, 0},
  {&__pyx_n_s_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 0, 1, 1},
  {&__pyx_n_u_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 1, 0, 1},
  {&__pyx_n_s_dC, __pyx_k_dC, sizeof(__pyx_k_dC), 0, 0, 1, 1},
  {&__pyx_n_s_dH, __pyx_k_dH, sizeof(__pyx_k_dH), 0, 0, 1, 1},
  {&__pyx_n_s_dH2, __pyx_k_dH2, sizeof(__pyx_k_dH2), 0, 0, 1, 1},
  {&__pyx_n_s_dL, __pyx_k_dL, sizeof(__pyx_k_dL), 0, 0, 1, 1},
  {&__pyx_n_s_da, __pyx_k_da, sizeof(__pyx_k_da), 0, 0, 1, 1},
  {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1},
  {&__pyx_n_s_data_and_options, __pyx_k_data_and_options, sizeof(__pyx_k_data_and_options), 0, 0, 1, 1},
  {&__pyx_n_s_db, __pyx_k_db, sizeof(__pyx_k_db), 0, 0, 1, 1},
  {&__pyx_n_s_dcp, __pyx_k_dcp, sizeof(__pyx_k_dcp), 0, 0, 1, 1},
  {&__pyx_n_s_decode, __pyx_k_decode, sizeof(__pyx_k_decode), 0, 0, 1, 1},
  {&__pyx_n_s_default_arrow, __pyx_k_default_arrow, sizeof(__pyx_k_default_arrow), 0, 0, 1, 1},
  {&__pyx_n_s_default_arrow_2, __pyx_k_default_arrow_2, sizeof(__pyx_k_default_arrow_2), 0, 0, 1, 1},
  {&__pyx_n_s_default_components, __pyx_k_default_components, sizeof(__pyx_k_default_components), 0, 0, 1, 1},
  {&__pyx_n_s_default_size, __pyx_k_default_size, sizeof(__pyx_k_default_size), 0, 0, 1, 1},
  {&__pyx_n_s_default_to_faces, __pyx_k_default_to_faces, sizeof(__pyx_k_default_to_faces), 0, 0, 1, 1},
  {&__pyx_n_s_defined_options, __pyx_k_defined_options, sizeof(__pyx_k_defined_options), 0, 0, 1, 1},
  {&__pyx_n_s_definitions, __pyx_k_definitions, sizeof(__pyx_k_definitions), 0, 0, 1, 1},
  {&__pyx_n_s_degrees, __pyx_k_degrees, sizeof(__pyx_k_degrees), 0, 0, 1, 1},
  {&__pyx_n_s_dh, __pyx_k_dh, sizeof(__pyx_k_dh), 0, 0, 1, 1},
  {&__pyx_n_s_dir, __pyx_k_dir, sizeof(__pyx_k_dir), 0, 0, 1, 1},
  {&__pyx_n_s_distance, __pyx_k_distance, sizeof(__pyx_k_distance), 0, 0, 1, 1},
  {&__pyx_n_s_distance_function, __pyx_k_distance_function, sizeof(__pyx_k_distance_function), 0, 0, 1, 1},
  {&__pyx_n_s_distances, __pyx_k_distances, sizeof(__pyx_k_distances), 0, 0, 1, 1},
  {&__pyx_n_s_dl, __pyx_k_dl, sizeof(__pyx_k_dl), 0, 0, 1, 1},
  {&__pyx_kp_s_dl_dt_AbsoluteThickness_p_dd_se, __pyx_k_dl_dt_AbsoluteThickness_p_dd_se, sizeof(__pyx_k_dl_dt_AbsoluteThickness_p_dd_se), 0, 0, 1, 0},
  {&__pyx_kp_s_dl_dt_Arrow_p1_p2_dd_represents, __pyx_k_dl_dt_Arrow_p1_p2_dd_represents, sizeof(__pyx_k_dl_dt_Arrow_p1_p2_dd_represents), 0, 0, 1, 0},
  {&__pyx_kp_s_dl_dt_Arrowheads_s_dd_specifies, __pyx_k_dl_dt_Arrowheads_s_dd_specifies, sizeof(__pyx_k_dl_dt_Arrowheads_s_dd_specifies), 0, 0, 1, 0},
  {&__pyx_kp_s_dl_dt_Automatic_dd_is_used_to_s, __pyx_k_dl_dt_Automatic_dd_is_used_to_s, sizeof(__pyx_k_dl_dt_Automatic_dd_is_used_to_s), 0, 0, 1, 0},
  {&__pyx_kp_s_dl_dt_BezierCurve_p1_p2_dd_repr, __pyx_k_dl_dt_BezierCurve_p1_p2_dd_repr, sizeof(__pyx_k_dl_dt_BezierCurve_p1_p2_dd_repr), 0, 0, 1, 0},
  {&__pyx_kp_s_dl_dt_Blend_c1_c2_dd_represents, __pyx_k_dl_dt_Blend_c1_c2_dd_represents, sizeof(__pyx_k_dl_dt_Blend_c1_c2_dd_represents), 0, 0, 1, 0},
  {&__pyx_kp_s_dl_dt_CMYKColor_c_m_y_k_dd_repr, __pyx_k_dl_dt_CMYKColor_c_m_y_k_dd_repr, sizeof(__pyx_k_dl_dt_CMYKColor_c_m_y_k_dd_repr), 0, 0, 1, 0},
  {&__pyx_kp_s_dl_dt_Circle_cx_cy_r_dd_draws_a, __pyx_k_dl_dt_Circle_cx_cy_r_dd_draws_a, sizeof(__pyx_k_dl_dt_Circle_cx_cy_r_dd_draws_a), 0, 0, 1, 0},
  {&__pyx_kp_s_dl_dt_ColorDistance_c1_c2_dd_re, __pyx_k_dl_dt_ColorDistance_c1_c2_dd_re, sizeof(__pyx_k_dl_dt_ColorDistance_c1_c2_dd_re), 0, 0, 1, 0},
  {&__pyx_kp_s_dl_dt_Darker_c_f_dd_is_equivale, __pyx_k_dl_dt_Darker_c_f_dd_is_equivale, sizeof(__pyx_k_dl_dt_Darker_c_f_dd_is_equivale), 0, 0, 1, 0},
  {&__pyx_kp_s_dl_dt_Disk_cx_cy_r_dd_fills_a_c, __pyx_k_dl_dt_Disk_cx_cy_r_dd_fills_a_c, sizeof(__pyx_k_dl_dt_Disk_cx_cy_r_dd_fills_a_c), 0, 0, 1, 0},
  {&__pyx_kp_s_dl_dt_FilledCurve_segment1_segm, __pyx_k_dl_dt_FilledCurve_segment1_segm, sizeof(__pyx_k_dl_dt_FilledCurve_segment1_segm), 0, 0, 1, 0},
  {&__pyx_kp_s_dl_dt_FontColor_dd_is_an_option, __pyx_k_dl_dt_FontColor_dd_is_an_option, sizeof(__pyx_k_dl_dt_FontColor_dd_is_an_option), 0, 0, 1, 0},
  {&__pyx_kp_s_dl_dt_Graphics_primitives_optio, __pyx_k_dl_dt_Graphics_primitives_optio, sizeof(__pyx_k_dl_dt_Graphics_primitives_optio), 0, 0, 1, 0},
  {&__pyx_kp_s_dl_dt_GrayLevel_g_dd_represents, __pyx_k_dl_dt_GrayLevel_g_dd_represents, sizeof(__pyx_k_dl_dt_GrayLevel_g_dd_represents), 0, 0, 1, 0},
  {&__pyx_kp_s_dl_dt_Hue_h_s_l_a_dd_represents, __pyx_k_dl_dt_Hue_h_s_l_a_dd_represents, sizeof(__pyx_k_dl_dt_Hue_h_s_l_a_dd_represents), 0, 0, 1, 0},
  {&__pyx_kp_s_dl_dt_ImageSize_Large_dd_produc, __pyx_k_dl_dt_ImageSize_Large_dd_produc, sizeof(__pyx_k_dl_dt_ImageSize_Large_dd_produc), 0, 0, 1, 0},
  {&__pyx_kp_s_dl_dt_ImageSize_Medium_dd_produ, __pyx_k_dl_dt_ImageSize_Medium_dd_produ, sizeof(__pyx_k_dl_dt_ImageSize_Medium_dd_produ), 0, 0, 1, 0},
  {&__pyx_kp_s_dl_dt_ImageSize_Small_dd_produc, __pyx_k_dl_dt_ImageSize_Small_dd_produc, sizeof(__pyx_k_dl_dt_ImageSize_Small_dd_produc), 0, 0, 1, 0},
  {&__pyx_kp_s_dl_dt_ImageSize_Tiny_dd_produce, __pyx_k_dl_dt_ImageSize_Tiny_dd_produce, sizeof(__pyx_k_dl_dt_ImageSize_Tiny_dd_produce), 0, 0, 1, 0},
  {&__pyx_kp_s_dl_dt_LABColor_l_a_b_dd_represe, __pyx_k_dl_dt_LABColor_l_a_b_dd_represe, sizeof(__pyx_k_dl_dt_LABColor_l_a_b_dd_represe), 0, 0, 1, 0},
  {&__pyx_kp_s_dl_dt_LCHColor_l_c_h_dd_represe, __pyx_k_dl_dt_LCHColor_l_c_h_dd_represe, sizeof(__pyx_k_dl_dt_LCHColor_l_c_h_dd_represe), 0, 0, 1, 0},
  {&__pyx_kp_s_dl_dt_LCHColor_l_u_v_dd_represe, __pyx_k_dl_dt_LCHColor_l_u_v_dd_represe, sizeof(__pyx_k_dl_dt_LCHColor_l_u_v_dd_represe), 0, 0, 1, 0},
  {&__pyx_kp_s_dl_dt_Lighter_c_f_dd_is_equival, __pyx_k_dl_dt_Lighter_c_f_dd_is_equival, sizeof(__pyx_k_dl_dt_Lighter_c_f_dd_is_equival), 0, 0, 1, 0},
  {&__pyx_kp_s_dl_dt_Line_point_1_point_2_dd_r, __pyx_k_dl_dt_Line_point_1_point_2_dd_r, sizeof(__pyx_k_dl_dt_Line_point_1_point_2_dd_r), 0, 0, 1, 0},
  {&__pyx_kp_s_dl_dt_PointSize_t_dd_sets_the_d, __pyx_k_dl_dt_PointSize_t_dd_sets_the_d, sizeof(__pyx_k_dl_dt_PointSize_t_dd_sets_the_d), 0, 0, 1, 0},
  {&__pyx_kp_s_dl_dt_Point_point_1_point_2_dd, __pyx_k_dl_dt_Point_point_1_point_2_dd, sizeof(__pyx_k_dl_dt_Point_point_1_point_2_dd), 0, 0, 1, 0},
  {&__pyx_kp_s_dl_dt_Polygon_point_1_point_2_d, __pyx_k_dl_dt_Polygon_point_1_point_2_d, sizeof(__pyx_k_dl_dt_Polygon_point_1_point_2_d), 0, 0, 1, 0},
  {&__pyx_kp_s_dl_dt_RGBColor_r_g_b_dd_represe, __pyx_k_dl_dt_RGBColor_r_g_b_dd_represe, sizeof(__pyx_k_dl_dt_RGBColor_r_g_b_dd_represe), 0, 0, 1, 0},
  {&__pyx_kp_s_dl_dt_Rectangle_xmin_ymin_dd_re, __pyx_k_dl_dt_Rectangle_xmin_ymin_dd_re, sizeof(__pyx_k_dl_dt_Rectangle_xmin_ymin_dd_re), 0, 0, 1, 0},
  {&__pyx_kp_s_dl_dt_RegularPolygon_n_dd_gives, __pyx_k_dl_dt_RegularPolygon_n_dd_gives, sizeof(__pyx_k_dl_dt_RegularPolygon_n_dd_gives), 0, 0, 1, 0},
  {&__pyx_kp_s_dl_dt_Show_graphics_options_dd, __pyx_k_dl_dt_Show_graphics_options_dd, sizeof(__pyx_k_dl_dt_Show_graphics_options_dd), 0, 0, 1, 0},
  {&__pyx_kp_s_dl_dt_Text_text_x_y_dd_draws_te, __pyx_k_dl_dt_Text_text_x_y_dd_draws_te, sizeof(__pyx_k_dl_dt_Text_text_x_y_dd_draws_te), 0, 0, 1, 0},
  {&__pyx_kp_s_dl_dt_Thick_dd_sets_the_line_wi, __pyx_k_dl_dt_Thick_dd_sets_the_line_wi, sizeof(__pyx_k_dl_dt_Thick_dd_sets_the_line_wi), 0, 0, 1, 0},
  {&__pyx_kp_s_dl_dt_Thickness_t_dd_sets_the_l, __pyx_k_dl_dt_Thickness_t_dd_sets_the_l, sizeof(__pyx_k_dl_dt_Thickness_t_dd_sets_the_l), 0, 0, 1, 0},
  {&__pyx_kp_s_dl_dt_Thin_dd_sets_the_line_wid, __pyx_k_dl_dt_Thin_dd_sets_the_line_wid, sizeof(__pyx_k_dl_dt_Thin_dd_sets_the_line_wid), 0, 0, 1, 0},
  {&__pyx_kp_s_dl_dt_XYZColor_x_y_z_dd_represe, __pyx_k_dl_dt_XYZColor_x_y_z_dd_represe, sizeof(__pyx_k_dl_dt_XYZColor_x_y_z_dd_represe), 0, 0, 1, 0},
  {&__pyx_kp_u_dl_dt_name_s_dd_represents_the, __pyx_k_dl_dt_name_s_dd_represents_the, sizeof(__pyx_k_dl_dt_name_s_dd_represents_the), 0, 1, 0, 0},
  {&__pyx_n_s_do_blend, __pyx_k_do_blend, sizeof(__pyx_k_do_blend), 0, 0, 1, 1},
  {&__pyx_n_s_do_init, __pyx_k_do_init, sizeof(__pyx_k_do_init), 0, 0, 1, 1},
  {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
  {&__pyx_n_s_doc_2, __pyx_k_doc_2, sizeof(__pyx_k_doc_2), 0, 0, 1, 1},
  {&__pyx_kp_u_dot, __pyx_k_dot, sizeof(__pyx_k_dot), 0, 1, 0, 0},
  {&__pyx_n_s_draw, __pyx_k_draw, sizeof(__pyx_k_draw), 0, 0, 1, 1},
  {&__pyx_n_u_draw, __pyx_k_draw, sizeof(__pyx_k_draw), 0, 1, 0, 1},
  {&__pyx_kp_u_draw_2, __pyx_k_draw_2, sizeof(__pyx_k_draw_2), 0, 1, 0, 0},
  {&__pyx_n_s_draw_3, __pyx_k_draw_3, sizeof(__pyx_k_draw_3), 0, 0, 1, 1},
  {&__pyx_n_s_dumps, __pyx_k_dumps, sizeof(__pyx_k_dumps), 0, 0, 1, 1},
  {&__pyx_n_s_dx, __pyx_k_dx, sizeof(__pyx_k_dx), 0, 0, 1, 1},
  {&__pyx_n_s_dy, __pyx_k_dy, sizeof(__pyx_k_dy), 0, 0, 1, 1},
  {&__pyx_n_s_e, __pyx_k_e, sizeof(__pyx_k_e), 0, 0, 1, 1},
  {&__pyx_n_s_edge, __pyx_k_edge, sizeof(__pyx_k_edge), 0, 0, 1, 1},
  {&__pyx_n_s_edge_color, __pyx_k_edge_color, sizeof(__pyx_k_edge_color), 0, 0, 1, 1},
  {&__pyx_n_s_edge_style, __pyx_k_edge_style, sizeof(__pyx_k_edge_style), 0, 0, 1, 1},
  {&__pyx_n_s_edges, __pyx_k_edges, sizeof(__pyx_k_edges), 0, 0, 1, 1},
  {&__pyx_n_s_element, __pyx_k_element, sizeof(__pyx_k_element), 0, 0, 1, 1},
  {&__pyx_n_s_element_class, __pyx_k_element_class, sizeof(__pyx_k_element_class), 0, 0, 1, 1},
  {&__pyx_n_s_element_heads, __pyx_k_element_heads, sizeof(__pyx_k_element_heads), 0, 0, 1, 1},
  {&__pyx_n_s_elements, __pyx_k_elements, sizeof(__pyx_k_elements), 0, 0, 1, 1},
  {&__pyx_kp_u_ellipse, __pyx_k_ellipse, sizeof(__pyx_k_ellipse), 0, 1, 0, 0},
  {&__pyx_kp_u_ellipse_cx, __pyx_k_ellipse_cx, sizeof(__pyx_k_ellipse_cx), 0, 1, 0, 0},
  {&__pyx_n_s_end_angle, __pyx_k_end_angle, sizeof(__pyx_k_end_angle), 0, 0, 1, 1},
  {&__pyx_kp_u_end_asy, __pyx_k_end_asy, sizeof(__pyx_k_end_asy), 0, 1, 0, 0},
  {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
  {&__pyx_n_s_euclidean_distance, __pyx_k_euclidean_distance, sizeof(__pyx_k_euclidean_distance), 0, 0, 1, 1},
  {&__pyx_n_s_euclidean_distance_locals_genex, __pyx_k_euclidean_distance_locals_genex, sizeof(__pyx_k_euclidean_distance_locals_genex), 0, 0, 1, 1},
  {&__pyx_n_s_evaluate, __pyx_k_evaluate, sizeof(__pyx_k_evaluate), 0, 0, 1, 1},
  {&__pyx_n_s_evaluation, __pyx_k_evaluation, sizeof(__pyx_k_evaluation), 0, 0, 1, 1},
  {&__pyx_n_u_evaluation, __pyx_k_evaluation, sizeof(__pyx_k_evaluation), 0, 1, 0, 1},
  {&__pyx_n_s_ex, __pyx_k_ex, sizeof(__pyx_k_ex), 0, 0, 1, 1},
  {&__pyx_n_s_exmax, __pyx_k_exmax, sizeof(__pyx_k_exmax), 0, 0, 1, 1},
  {&__pyx_n_s_exmin, __pyx_k_exmin, sizeof(__pyx_k_exmin), 0, 0, 1, 1},
  {&__pyx_n_s_exp, __pyx_k_exp, sizeof(__pyx_k_exp), 0, 0, 1, 1},
  {&__pyx_n_s_expr, __pyx_k_expr, sizeof(__pyx_k_expr), 0, 0, 1, 1},
  {&__pyx_n_s_expression, __pyx_k_expression, sizeof(__pyx_k_expression), 0, 0, 1, 1},
  {&__pyx_n_s_expression_to_color, __pyx_k_expression_to_color, sizeof(__pyx_k_expression_to_color), 0, 0, 1, 1},
  {&__pyx_n_s_ext, __pyx_k_ext, sizeof(__pyx_k_ext), 0, 0, 1, 1},
  {&__pyx_n_s_extend, __pyx_k_extend, sizeof(__pyx_k_extend), 0, 0, 1, 1},
  {&__pyx_n_s_extent, __pyx_k_extent, sizeof(__pyx_k_extent), 0, 0, 1, 1},
  {&__pyx_n_s_extent_height, __pyx_k_extent_height, sizeof(__pyx_k_extent_height), 0, 0, 1, 1},
  {&__pyx_n_s_extent_width, __pyx_k_extent_width, sizeof(__pyx_k_extent_width), 0, 0, 1, 1},
  {&__pyx_n_s_extents, __pyx_k_extents, sizeof(__pyx_k_extents), 0, 0, 1, 1},
  {&__pyx_n_s_extract_graphics, __pyx_k_extract_graphics, sizeof(__pyx_k_extract_graphics), 0, 0, 1, 1},
  {&__pyx_n_s_extract_graphics_locals_genexpr, __pyx_k_extract_graphics_locals_genexpr, sizeof(__pyx_k_extract_graphics_locals_genexpr), 0, 0, 1, 1},
  {&__pyx_n_s_ey, __pyx_k_ey, sizeof(__pyx_k_ey), 0, 0, 1, 1},
  {&__pyx_n_s_eymax, __pyx_k_eymax, sizeof(__pyx_k_eymax), 0, 0, 1, 1},
  {&__pyx_n_s_eymin, __pyx_k_eymin, sizeof(__pyx_k_eymin), 0, 0, 1, 1},
  {&__pyx_n_s_f, __pyx_k_f, sizeof(__pyx_k_f), 0, 0, 1, 1},
  {&__pyx_n_u_f, __pyx_k_f, sizeof(__pyx_k_f), 0, 1, 0, 1},
  {&__pyx_kp_u_f_2, __pyx_k_f_2, sizeof(__pyx_k_f_2), 0, 1, 0, 0},
  {&__pyx_kp_u_f_f, __pyx_k_f_f, sizeof(__pyx_k_f_f), 0, 1, 0, 0},
  {&__pyx_n_s_face, __pyx_k_face, sizeof(__pyx_k_face), 0, 0, 1, 1},
  {&__pyx_n_s_face_color, __pyx_k_face_color, sizeof(__pyx_k_face_color), 0, 0, 1, 1},
  {&__pyx_n_s_face_element, __pyx_k_face_element, sizeof(__pyx_k_face_element), 0, 0, 1, 1},
  {&__pyx_n_s_face_style, __pyx_k_face_style, sizeof(__pyx_k_face_style), 0, 0, 1, 1},
  {&__pyx_kp_u_fill, __pyx_k_fill, sizeof(__pyx_k_fill), 0, 1, 0, 0},
  {&__pyx_kp_u_fill_none, __pyx_k_fill_none, sizeof(__pyx_k_fill_none), 0, 1, 0, 0},
  {&__pyx_kp_u_fill_opacity_s, __pyx_k_fill_opacity_s, sizeof(__pyx_k_fill_opacity_s), 0, 1, 0, 0},
  {&__pyx_kp_u_fill_rule_evenodd, __pyx_k_fill_rule_evenodd, sizeof(__pyx_k_fill_rule_evenodd), 0, 1, 0, 0},
  {&__pyx_kp_u_fill_s, __pyx_k_fill_s, sizeof(__pyx_k_fill_s), 0, 1, 0, 0},
  {&__pyx_kp_u_filldraw, __pyx_k_filldraw, sizeof(__pyx_k_filldraw), 0, 1, 0, 0},
  {&__pyx_n_u_filldraw_2, __pyx_k_filldraw_2, sizeof(__pyx_k_filldraw_2), 0, 1, 0, 1},
  {&__pyx_kp_u_filldraw_3, __pyx_k_filldraw_3, sizeof(__pyx_k_filldraw_3), 0, 1, 0, 0},
  {&__pyx_n_s_final_pass, __pyx_k_final_pass, sizeof(__pyx_k_final_pass), 0, 0, 1, 1},
  {&__pyx_n_s_flatten, __pyx_k_flatten, sizeof(__pyx_k_flatten), 0, 0, 1, 1},
  {&__pyx_n_s_flatten_2, __pyx_k_flatten_2, sizeof(__pyx_k_flatten_2), 0, 0, 1, 1},
  {&__pyx_n_s_flattened, __pyx_k_flattened, sizeof(__pyx_k_flattened), 0, 0, 1, 1},
  {&__pyx_n_s_floor, __pyx_k_floor, sizeof(__pyx_k_floor), 0, 0, 1, 1},
  {&__pyx_n_s_font_color, __pyx_k_font_color, sizeof(__pyx_k_font_color), 0, 0, 1, 1},
  {&__pyx_kp_u_foreignObject_x, __pyx_k_foreignObject_x, sizeof(__pyx_k_foreignObject_x), 0, 1, 0, 0},
  {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
  {&__pyx_n_s_format_transform, __pyx_k_format_transform, sizeof(__pyx_k_format_transform), 0, 0, 1, 1},
  {&__pyx_n_s_formats, __pyx_k_formats, sizeof(__pyx_k_formats), 0, 0, 1, 1},
  {&__pyx_n_s_forms, __pyx_k_forms, sizeof(__pyx_k_forms), 0, 0, 1, 1},
  {&__pyx_n_s_frac, __pyx_k_frac, sizeof(__pyx_k_frac), 0, 0, 1, 1},
  {&__pyx_n_s_from_python, __pyx_k_from_python, sizeof(__pyx_k_from_python), 0, 0, 1, 1},
  {&__pyx_kp_u_g, __pyx_k_g, sizeof(__pyx_k_g), 0, 1, 0, 0},
  {&__pyx_kp_u_g_2, __pyx_k_g_2, sizeof(__pyx_k_g_2), 0, 1, 0, 0},
  {&__pyx_kp_u_g_transform, __pyx_k_g_transform, sizeof(__pyx_k_g_transform), 0, 1, 0, 0},
  {&__pyx_n_s_genexpr, __pyx_k_genexpr, sizeof(__pyx_k_genexpr), 0, 0, 1, 1},
  {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1},
  {&__pyx_n_s_get_atoms, __pyx_k_get_atoms, sizeof(__pyx_k_get_atoms), 0, 0, 1, 1},
  {&__pyx_n_s_get_class, __pyx_k_get_class, sizeof(__pyx_k_get_class), 0, 0, 1, 1},
  {&__pyx_n_s_get_default_edge_color, __pyx_k_get_default_edge_color, sizeof(__pyx_k_get_default_edge_color), 0, 0, 1, 1},
  {&__pyx_n_s_get_default_face_color, __pyx_k_get_default_face_color, sizeof(__pyx_k_get_default_face_color), 0, 0, 1, 1},
  {&__pyx_n_s_get_head_name, __pyx_k_get_head_name, sizeof(__pyx_k_get_head_name), 0, 0, 1, 1},
  {&__pyx_n_s_get_image_size, __pyx_k_get_image_size, sizeof(__pyx_k_get_image_size), 0, 0, 1, 1},
  {&__pyx_n_s_get_int_value, __pyx_k_get_int_value, sizeof(__pyx_k_get_int_value), 0, 0, 1, 1},
  {&__pyx_n_s_get_line_width, __pyx_k_get_line_width, sizeof(__pyx_k_get_line_width), 0, 0, 1, 1},
  {&__pyx_n_s_get_name, __pyx_k_get_name, sizeof(__pyx_k_get_name), 0, 0, 1, 1},
  {&__pyx_n_s_get_option, __pyx_k_get_option, sizeof(__pyx_k_get_option), 0, 0, 1, 1},
  {&__pyx_n_s_get_option_values, __pyx_k_get_option_values, sizeof(__pyx_k_get_option_values), 0, 0, 1, 1},
  {&__pyx_n_s_get_options, __pyx_k_get_options, sizeof(__pyx_k_get_options), 0, 0, 1, 1},
  {&__pyx_n_s_get_range, __pyx_k_get_range, sizeof(__pyx_k_get_range), 0, 0, 1, 1},
  {&__pyx_n_s_get_sequence, __pyx_k_get_sequence, sizeof(__pyx_k_get_sequence), 0, 0, 1, 1},
  {&__pyx_n_s_get_size, __pyx_k_get_size, sizeof(__pyx_k_get_size), 0, 0, 1, 1},
  {&__pyx_n_s_get_string_value, __pyx_k_get_string_value, sizeof(__pyx_k_get_string_value), 0, 0, 1, 1},
  {&__pyx_n_s_get_style, __pyx_k_get_style, sizeof(__pyx_k_get_style), 0, 0, 1, 1},
  {&__pyx_n_s_get_style_class, __pyx_k_get_style_class, sizeof(__pyx_k_get_style_class), 0, 0, 1, 1},
  {&__pyx_n_s_get_thickness, __pyx_k_get_thickness, sizeof(__pyx_k_get_thickness), 0, 0, 1, 1},
  {&__pyx_kp_u_gouraudshade, __pyx_k_gouraudshade, sizeof(__pyx_k_gouraudshade), 0, 1, 0, 0},
  {&__pyx_n_s_graphics, __pyx_k_graphics, sizeof(__pyx_k_graphics), 0, 0, 1, 1},
  {&__pyx_n_s_graphics_box, __pyx_k_graphics_box, sizeof(__pyx_k_graphics_box), 0, 0, 1, 1},
  {&__pyx_n_s_graphics_options, __pyx_k_graphics_options, sizeof(__pyx_k_graphics_options), 0, 0, 1, 1},
  {&__pyx_n_s_h, __pyx_k_h, sizeof(__pyx_k_h), 0, 0, 1, 1},
  {&__pyx_n_s_h1, __pyx_k_h1, sizeof(__pyx_k_h1), 0, 0, 1, 1},
  {&__pyx_n_s_h2, __pyx_k_h2, sizeof(__pyx_k_h2), 0, 0, 1, 1},
  {&__pyx_n_s_has_form, __pyx_k_has_form, sizeof(__pyx_k_has_form), 0, 0, 1, 1},
  {&__pyx_n_s_head, __pyx_k_head, sizeof(__pyx_k_head), 0, 0, 1, 1},
  {&__pyx_n_s_head_name, __pyx_k_head_name, sizeof(__pyx_k_head_name), 0, 0, 1, 1},
  {&__pyx_n_s_head_points, __pyx_k_head_points, sizeof(__pyx_k_head_points), 0, 0, 1, 1},
  {&__pyx_n_s_heads, __pyx_k_heads, sizeof(__pyx_k_heads), 0, 0, 1, 1},
  {&__pyx_kp_u_height, __pyx_k_height, sizeof(__pyx_k_height), 0, 1, 0, 0},
  {&__pyx_n_s_height_2, __pyx_k_height_2, sizeof(__pyx_k_height_2), 0, 0, 1, 1},
  {&__pyx_n_s_homogenous, __pyx_k_homogenous, sizeof(__pyx_k_homogenous), 0, 0, 1, 1},
  {&__pyx_n_s_hsl_to_rgba, __pyx_k_hsl_to_rgba, sizeof(__pyx_k_hsl_to_rgba), 0, 0, 1, 1},
  {&__pyx_n_s_hx, __pyx_k_hx, sizeof(__pyx_k_hx), 0, 0, 1, 1},
  {&__pyx_n_s_hy, __pyx_k_hy, sizeof(__pyx_k_hy), 0, 0, 1, 1},
  {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
  {&__pyx_n_s_image_size, __pyx_k_image_size, sizeof(__pyx_k_image_size), 0, 0, 1, 1},
  {&__pyx_n_s_image_size_multipliers, __pyx_k_image_size_multipliers, sizeof(__pyx_k_image_size_multipliers), 0, 0, 1, 1},
  {&__pyx_n_u_image_size_multipliers, __pyx_k_image_size_multipliers, sizeof(__pyx_k_image_size_multipliers), 0, 1, 0, 1},
  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
  {&__pyx_n_s_include_heads, __pyx_k_include_heads, sizeof(__pyx_k_include_heads), 0, 0, 1, 1},
  {&__pyx_n_s_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 1, 1},
  {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1},
  {&__pyx_n_s_init_2, __pyx_k_init_2, sizeof(__pyx_k_init_2), 0, 0, 1, 1},
  {&__pyx_n_s_inside_list, __pyx_k_inside_list, sizeof(__pyx_k_inside_list), 0, 0, 1, 1},
  {&__pyx_n_u_inside_list, __pyx_k_inside_list, sizeof(__pyx_k_inside_list), 0, 1, 0, 1},
  {&__pyx_n_s_inside_row, __pyx_k_inside_row, sizeof(__pyx_k_inside_row), 0, 0, 1, 1},
  {&__pyx_n_u_inside_row, __pyx_k_inside_row, sizeof(__pyx_k_inside_row), 0, 1, 0, 1},
  {&__pyx_n_u_invarg, __pyx_k_invarg, sizeof(__pyx_k_invarg), 0, 1, 0, 1},
  {&__pyx_n_u_invdist, __pyx_k_invdist, sizeof(__pyx_k_invdist), 0, 1, 0, 1},
  {&__pyx_n_s_is_completely_visible, __pyx_k_is_completely_visible, sizeof(__pyx_k_is_completely_visible), 0, 0, 1, 1},
  {&__pyx_n_s_is_face_element, __pyx_k_is_face_element, sizeof(__pyx_k_is_face_element), 0, 0, 1, 1},
  {&__pyx_n_s_is_numeric, __pyx_k_is_numeric, sizeof(__pyx_k_is_numeric), 0, 0, 1, 1},
  {&__pyx_n_s_is_true, __pyx_k_is_true, sizeof(__pyx_k_is_true), 0, 0, 1, 1},
  {&__pyx_n_s_item, __pyx_k_item, sizeof(__pyx_k_item), 0, 0, 1, 1},
  {&__pyx_n_s_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1},
  {&__pyx_n_s_itertools, __pyx_k_itertools, sizeof(__pyx_k_itertools), 0, 0, 1, 1},
  {&__pyx_n_s_json, __pyx_k_json, sizeof(__pyx_k_json), 0, 0, 1, 1},
  {&__pyx_n_s_k, __pyx_k_k, sizeof(__pyx_k_k), 0, 0, 1, 1},
  {&__pyx_n_s_kC, __pyx_k_kC, sizeof(__pyx_k_kC), 0, 0, 1, 1},
  {&__pyx_n_s_kH, __pyx_k_kH, sizeof(__pyx_k_kH), 0, 0, 1, 1},
  {&__pyx_n_s_kL, __pyx_k_kL, sizeof(__pyx_k_kL), 0, 0, 1, 1},
  {&__pyx_n_s_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 0, 1, 1},
  {&__pyx_n_s_keys, __pyx_k_keys, sizeof(__pyx_k_keys), 0, 0, 1, 1},
  {&__pyx_n_s_klass, __pyx_k_klass, sizeof(__pyx_k_klass), 0, 0, 1, 1},
  {&__pyx_n_s_kwargs, __pyx_k_kwargs, sizeof(__pyx_k_kwargs), 0, 0, 1, 1},
  {&__pyx_n_s_l, __pyx_k_l, sizeof(__pyx_k_l), 0, 0, 1, 1},
  {&__pyx_n_s_lab1, __pyx_k_lab1, sizeof(__pyx_k_lab1), 0, 0, 1, 1},
  {&__pyx_n_s_lab2, __pyx_k_lab2, sizeof(__pyx_k_lab2), 0, 0, 1, 1},
  {&__pyx_kp_u_label, __pyx_k_label, sizeof(__pyx_k_label), 0, 1, 0, 0},
  {&__pyx_n_s_label_style, __pyx_k_label_style, sizeof(__pyx_k_label_style), 0, 0, 1, 1},
  {&__pyx_n_s_large_arc, __pyx_k_large_arc, sizeof(__pyx_k_large_arc), 0, 0, 1, 1},
  {&__pyx_n_s_leaf, __pyx_k_leaf, sizeof(__pyx_k_leaf), 0, 0, 1, 1},
  {&__pyx_n_s_leaf_name, __pyx_k_leaf_name, sizeof(__pyx_k_leaf_name), 0, 0, 1, 1},
  {&__pyx_n_s_leaves, __pyx_k_leaves, sizeof(__pyx_k_leaves), 0, 0, 1, 1},
  {&__pyx_n_s_length, __pyx_k_length, sizeof(__pyx_k_length), 0, 0, 1, 1},
  {&__pyx_kp_u_light_red, __pyx_k_light_red, sizeof(__pyx_k_light_red), 0, 1, 0, 0},
  {&__pyx_n_s_lightness, __pyx_k_lightness, sizeof(__pyx_k_lightness), 0, 0, 1, 1},
  {&__pyx_n_s_line, __pyx_k_line, sizeof(__pyx_k_line), 0, 0, 1, 1},
  {&__pyx_n_s_line_colors, __pyx_k_line_colors, sizeof(__pyx_k_line_colors), 0, 0, 1, 1},
  {&__pyx_n_s_line_index, __pyx_k_line_index, sizeof(__pyx_k_line_index), 0, 0, 1, 1},
  {&__pyx_n_s_linear, __pyx_k_linear, sizeof(__pyx_k_linear), 0, 0, 1, 1},
  {&__pyx_n_s_lines, __pyx_k_lines, sizeof(__pyx_k_lines), 0, 0, 1, 1},
  {&__pyx_kp_u_linewidth_s, __pyx_k_linewidth_s, sizeof(__pyx_k_linewidth_s), 0, 1, 0, 0},
  {&__pyx_n_s_log10, __pyx_k_log10, sizeof(__pyx_k_log10), 0, 0, 1, 1},
  {&__pyx_n_s_lower, __pyx_k_lower, sizeof(__pyx_k_lower), 0, 0, 1, 1},
  {&__pyx_n_s_machine_epsilon, __pyx_k_machine_epsilon, sizeof(__pyx_k_machine_epsilon), 0, 0, 1, 1},
  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
  {&__pyx_n_s_make, __pyx_k_make, sizeof(__pyx_k_make), 0, 0, 1, 1},
  {&__pyx_n_s_make_draw_asy, __pyx_k_make_draw_asy, sizeof(__pyx_k_make_draw_asy), 0, 0, 1, 1},
  {&__pyx_n_s_make_draw_svg, __pyx_k_make_draw_svg, sizeof(__pyx_k_make_draw_svg), 0, 0, 1, 1},
  {&__pyx_n_s_map, __pyx_k_map, sizeof(__pyx_k_map), 0, 0, 1, 1},
  {&__pyx_kp_u_math, __pyx_k_math, sizeof(__pyx_k_math), 0, 1, 0, 0},
  {&__pyx_n_s_math_2, __pyx_k_math_2, sizeof(__pyx_k_math_2), 0, 0, 1, 1},
  {&__pyx_kp_u_math_foreignObject, __pyx_k_math_foreignObject, sizeof(__pyx_k_math_foreignObject), 0, 1, 0, 0},
  {&__pyx_n_s_mathics_builtin_base, __pyx_k_mathics_builtin_base, sizeof(__pyx_k_mathics_builtin_base), 0, 0, 1, 1},
  {&__pyx_n_s_mathics_builtin_colors, __pyx_k_mathics_builtin_colors, sizeof(__pyx_k_mathics_builtin_colors), 0, 0, 1, 1},
  {&__pyx_n_s_mathics_builtin_graphics, __pyx_k_mathics_builtin_graphics, sizeof(__pyx_k_mathics_builtin_graphics), 0, 0, 1, 1},
  {&__pyx_n_s_mathics_builtin_graphics3d, __pyx_k_mathics_builtin_graphics3d, sizeof(__pyx_k_mathics_builtin_graphics3d), 0, 0, 1, 1},
  {&__pyx_kp_s_mathics_builtin_graphics_py, __pyx_k_mathics_builtin_graphics_py, sizeof(__pyx_k_mathics_builtin_graphics_py), 0, 0, 1, 0},
  {&__pyx_n_s_mathics_builtin_options, __pyx_k_mathics_builtin_options, sizeof(__pyx_k_mathics_builtin_options), 0, 0, 1, 1},
  {&__pyx_n_s_mathics_core_expression, __pyx_k_mathics_core_expression, sizeof(__pyx_k_mathics_core_expression), 0, 0, 1, 1},
  {&__pyx_n_s_mathics_core_numbers, __pyx_k_mathics_core_numbers, sizeof(__pyx_k_mathics_core_numbers), 0, 0, 1, 1},
  {&__pyx_kp_u_matrix, __pyx_k_matrix, sizeof(__pyx_k_matrix), 0, 1, 0, 0},
  {&__pyx_n_s_matrix_2, __pyx_k_matrix_2, sizeof(__pyx_k_matrix_2), 0, 0, 1, 1},
  {&__pyx_n_s_max, __pyx_k_max, sizeof(__pyx_k_max), 0, 0, 1, 1},
  {&__pyx_n_s_max_degree, __pyx_k_max_degree, sizeof(__pyx_k_max_degree), 0, 0, 1, 1},
  {&__pyx_n_s_max_width, __pyx_k_max_width, sizeof(__pyx_k_max_width), 0, 0, 1, 1},
  {&__pyx_n_s_mesh, __pyx_k_mesh, sizeof(__pyx_k_mesh), 0, 0, 1, 1},
  {&__pyx_kp_u_meshgradient_data_s, __pyx_k_meshgradient_data_s, sizeof(__pyx_k_meshgradient_data_s), 0, 1, 0, 0},
  {&__pyx_n_s_message, __pyx_k_message, sizeof(__pyx_k_message), 0, 0, 1, 1},
  {&__pyx_n_s_messages, __pyx_k_messages, sizeof(__pyx_k_messages), 0, 0, 1, 1},
  {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
  {&__pyx_kp_u_mglyph_width, __pyx_k_mglyph_width, sizeof(__pyx_k_mglyph_width), 0, 1, 0, 0},
  {&__pyx_n_s_min, __pyx_k_min, sizeof(__pyx_k_min), 0, 0, 1, 1},
  {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1},
  {&__pyx_n_s_mt, __pyx_k_mt, sizeof(__pyx_k_mt), 0, 0, 1, 1},
  {&__pyx_n_s_mt2, __pyx_k_mt2, sizeof(__pyx_k_mt2), 0, 0, 1, 1},
  {&__pyx_n_s_mt3, __pyx_k_mt3, sizeof(__pyx_k_mt3), 0, 0, 1, 1},
  {&__pyx_n_s_multi, __pyx_k_multi, sizeof(__pyx_k_multi), 0, 0, 1, 1},
  {&__pyx_n_s_multi_parts, __pyx_k_multi_parts, sizeof(__pyx_k_multi_parts), 0, 0, 1, 1},
  {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1},
  {&__pyx_n_s_n_leaves, __pyx_k_n_leaves, sizeof(__pyx_k_n_leaves), 0, 0, 1, 1},
  {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
  {&__pyx_n_u_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 1, 0, 1},
  {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
  {&__pyx_n_s_name_head, __pyx_k_name_head, sizeof(__pyx_k_name_head), 0, 0, 1, 1},
  {&__pyx_kp_u_name_s_x_List, __pyx_k_name_s_x_List, sizeof(__pyx_k_name_s_x_List), 0, 1, 0, 0},
  {&__pyx_kp_u_name_s_x___NumericQ_0_1, __pyx_k_name_s_x___NumericQ_0_1, sizeof(__pyx_k_name_s_x___NumericQ_0_1), 0, 1, 0, 0},
  {&__pyx_n_s_neg_y, __pyx_k_neg_y, sizeof(__pyx_k_neg_y), 0, 0, 1, 1},
  {&__pyx_kp_u_new_int, __pyx_k_new_int, sizeof(__pyx_k_new_int), 0, 1, 0, 0},
  {&__pyx_n_s_new_item, __pyx_k_new_item, sizeof(__pyx_k_new_item), 0, 0, 1, 1},
  {&__pyx_n_s_new_leaf, __pyx_k_new_leaf, sizeof(__pyx_k_new_leaf), 0, 0, 1, 1},
  {&__pyx_n_s_new_leaves, __pyx_k_new_leaves, sizeof(__pyx_k_new_leaves), 0, 0, 1, 1},
  {&__pyx_kp_u_new_pen, __pyx_k_new_pen, sizeof(__pyx_k_new_pen), 0, 1, 0, 0},
  {&__pyx_n_s_new_style, __pyx_k_new_style, sizeof(__pyx_k_new_style), 0, 0, 1, 1},
  {&__pyx_n_s_norm, __pyx_k_norm, sizeof(__pyx_k_norm), 0, 0, 1, 1},
  {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
  {&__pyx_n_u_nullpen, __pyx_k_nullpen, sizeof(__pyx_k_nullpen), 0, 1, 0, 1},
  {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
  {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1},
  {&__pyx_n_s_opacity, __pyx_k_opacity, sizeof(__pyx_k_opacity), 0, 0, 1, 1},
  {&__pyx_kp_u_opacity_s, __pyx_k_opacity_s, sizeof(__pyx_k_opacity_s), 0, 1, 0, 0},
  {&__pyx_n_s_opos, __pyx_k_opos, sizeof(__pyx_k_opos), 0, 0, 1, 1},
  {&__pyx_n_s_option, __pyx_k_option, sizeof(__pyx_k_option), 0, 0, 1, 1},
  {&__pyx_n_s_options, __pyx_k_options, sizeof(__pyx_k_options), 0, 0, 1, 1},
  {&__pyx_n_s_options_set, __pyx_k_options_set, sizeof(__pyx_k_options_set), 0, 0, 1, 1},
  {&__pyx_n_s_options_to_rules, __pyx_k_options_to_rules, sizeof(__pyx_k_options_to_rules), 0, 0, 1, 1},
  {&__pyx_n_s_origin_k_x, __pyx_k_origin_k_x, sizeof(__pyx_k_origin_k_x), 0, 0, 1, 1},
  {&__pyx_n_s_origin_x, __pyx_k_origin_x, sizeof(__pyx_k_origin_x), 0, 0, 1, 1},
  {&__pyx_n_s_origin_y, __pyx_k_origin_y, sizeof(__pyx_k_origin_y), 0, 0, 1, 1},
  {&__pyx_n_s_ox, __pyx_k_ox, sizeof(__pyx_k_ox), 0, 0, 1, 1},
  {&__pyx_kp_u_ox_2, __pyx_k_ox_2, sizeof(__pyx_k_ox_2), 0, 1, 0, 0},
  {&__pyx_n_s_oy, __pyx_k_oy, sizeof(__pyx_k_oy), 0, 0, 1, 1},
  {&__pyx_kp_u_oy_2, __pyx_k_oy_2, sizeof(__pyx_k_oy_2), 0, 1, 0, 0},
  {&__pyx_n_s_p, __pyx_k_p, sizeof(__pyx_k_p), 0, 0, 1, 1},
  {&__pyx_n_s_p0, __pyx_k_p0, sizeof(__pyx_k_p0), 0, 0, 1, 1},
  {&__pyx_n_s_p1, __pyx_k_p1, sizeof(__pyx_k_p1), 0, 0, 1, 1},
  {&__pyx_n_s_p2, __pyx_k_p2, sizeof(__pyx_k_p2), 0, 0, 1, 1},
  {&__pyx_n_s_p3, __pyx_k_p3, sizeof(__pyx_k_p3), 0, 0, 1, 1},
  {&__pyx_n_s_p_origin, __pyx_k_p_origin, sizeof(__pyx_k_p_origin), 0, 0, 1, 1},
  {&__pyx_n_s_p_other0, __pyx_k_p_other0, sizeof(__pyx_k_p_other0), 0, 0, 1, 1},
  {&__pyx_n_s_p_self0, __pyx_k_p_self0, sizeof(__pyx_k_p_self0), 0, 0, 1, 1},
  {&__pyx_n_s_parse_component, __pyx_k_parse_component, sizeof(__pyx_k_parse_component), 0, 0, 1, 1},
  {&__pyx_n_s_part, __pyx_k_part, sizeof(__pyx_k_part), 0, 0, 1, 1},
  {&__pyx_n_s_parts, __pyx_k_parts, sizeof(__pyx_k_parts), 0, 0, 1, 1},
  {&__pyx_n_s_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 0, 1, 1},
  {&__pyx_kp_u_path_d, __pyx_k_path_d, sizeof(__pyx_k_path_d), 0, 1, 0, 0},
  {&__pyx_n_s_paths, __pyx_k_paths, sizeof(__pyx_k_paths), 0, 0, 1, 1},
  {&__pyx_n_s_pen, __pyx_k_pen, sizeof(__pyx_k_pen), 0, 0, 1, 1},
  {&__pyx_n_s_pens, __pyx_k_pens, sizeof(__pyx_k_pens), 0, 0, 1, 1},
  {&__pyx_n_s_phi, __pyx_k_phi, sizeof(__pyx_k_phi), 0, 0, 1, 1},
  {&__pyx_n_s_phi0, __pyx_k_phi0, sizeof(__pyx_k_phi0), 0, 0, 1, 1},
  {&__pyx_n_s_pi, __pyx_k_pi, sizeof(__pyx_k_pi), 0, 0, 1, 1},
  {&__pyx_n_s_pi2, __pyx_k_pi2, sizeof(__pyx_k_pi2), 0, 0, 1, 1},
  {&__pyx_n_s_pixel_height, __pyx_k_pixel_height, sizeof(__pyx_k_pixel_height), 0, 0, 1, 1},
  {&__pyx_n_s_pixel_width, __pyx_k_pixel_width, sizeof(__pyx_k_pixel_width), 0, 0, 1, 1},
  {&__pyx_n_s_plot_range, __pyx_k_plot_range, sizeof(__pyx_k_plot_range), 0, 0, 1, 1},
  {&__pyx_n_s_point, __pyx_k_point, sizeof(__pyx_k_point), 0, 0, 1, 1},
  {&__pyx_n_s_point_size, __pyx_k_point_size, sizeof(__pyx_k_point_size), 0, 0, 1, 1},
  {&__pyx_n_s_points, __pyx_k_points, sizeof(__pyx_k_points), 0, 0, 1, 1},
  {&__pyx_n_s_polygon, __pyx_k_polygon, sizeof(__pyx_k_polygon), 0, 0, 1, 1},
  {&__pyx_kp_u_polygon_points, __pyx_k_polygon_points, sizeof(__pyx_k_polygon_points), 0, 1, 0, 0},
  {&__pyx_n_s_polyline, __pyx_k_polyline, sizeof(__pyx_k_polyline), 0, 0, 1, 1},
  {&__pyx_kp_u_polyline_points, __pyx_k_polyline_points, sizeof(__pyx_k_polyline_points), 0, 1, 0, 0},
  {&__pyx_n_s_pop, __pyx_k_pop, sizeof(__pyx_k_pop), 0, 0, 1, 1},
  {&__pyx_n_s_pos, __pyx_k_pos, sizeof(__pyx_k_pos), 0, 0, 1, 1},
  {&__pyx_n_s_pre, __pyx_k_pre, sizeof(__pyx_k_pre), 0, 0, 1, 1},
  {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1},
  {&__pyx_n_s_prepare_elements, __pyx_k_prepare_elements, sizeof(__pyx_k_prepare_elements), 0, 0, 1, 1},
  {&__pyx_n_s_process_option, __pyx_k_process_option, sizeof(__pyx_k_process_option), 0, 0, 1, 1},
  {&__pyx_n_s_px, __pyx_k_px, sizeof(__pyx_k_px), 0, 0, 1, 1},
  {&__pyx_kp_u_px_height, __pyx_k_px_height, sizeof(__pyx_k_px_height), 0, 1, 0, 0},
  {&__pyx_kp_u_px_src_data_image_svg_xml_base64, __pyx_k_px_src_data_image_svg_xml_base64, sizeof(__pyx_k_px_src_data_image_svg_xml_base64), 0, 1, 0, 0},
  {&__pyx_n_s_py, __pyx_k_py, sizeof(__pyx_k_py), 0, 0, 1, 1},
  {&__pyx_n_s_py_a, __pyx_k_py_a, sizeof(__pyx_k_py_a), 0, 0, 1, 1},
  {&__pyx_n_s_py_b, __pyx_k_py_b, sizeof(__pyx_k_py_b), 0, 0, 1, 1},
  {&__pyx_n_s_py_name, __pyx_k_py_name, sizeof(__pyx_k_py_name), 0, 0, 1, 1},
  {&__pyx_n_s_q, __pyx_k_q, sizeof(__pyx_k_q), 0, 0, 1, 1},
  {&__pyx_n_s_qp0, __pyx_k_qp0, sizeof(__pyx_k_qp0), 0, 0, 1, 1},
  {&__pyx_n_s_qp0x, __pyx_k_qp0x, sizeof(__pyx_k_qp0x), 0, 0, 1, 1},
  {&__pyx_n_s_qp0y, __pyx_k_qp0y, sizeof(__pyx_k_qp0y), 0, 0, 1, 1},
  {&__pyx_n_s_qp1, __pyx_k_qp1, sizeof(__pyx_k_qp1), 0, 0, 1, 1},
  {&__pyx_n_s_qp1x, __pyx_k_qp1x, sizeof(__pyx_k_qp1x), 0, 0, 1, 1},
  {&__pyx_n_s_qp1y, __pyx_k_qp1y, sizeof(__pyx_k_qp1y), 0, 0, 1, 1},
  {&__pyx_n_s_qp2, __pyx_k_qp2, sizeof(__pyx_k_qp2), 0, 0, 1, 1},
  {&__pyx_n_s_qp2x, __pyx_k_qp2x, sizeof(__pyx_k_qp2x), 0, 0, 1, 1},
  {&__pyx_n_s_qp2y, __pyx_k_qp2y, sizeof(__pyx_k_qp2y), 0, 0, 1, 1},
  {&__pyx_n_s_quadratric, __pyx_k_quadratric, sizeof(__pyx_k_quadratric), 0, 0, 1, 1},
  {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1},
  {&__pyx_n_s_qx, __pyx_k_qx, sizeof(__pyx_k_qx), 0, 0, 1, 1},
  {&__pyx_n_s_qy, __pyx_k_qy, sizeof(__pyx_k_qy), 0, 0, 1, 1},
  {&__pyx_n_s_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 0, 1, 1},
  {&__pyx_n_s_rT, __pyx_k_rT, sizeof(__pyx_k_rT), 0, 0, 1, 1},
  {&__pyx_kp_u_r_2, __pyx_k_r_2, sizeof(__pyx_k_r_2), 0, 1, 0, 0},
  {&__pyx_n_s_radians, __pyx_k_radians, sizeof(__pyx_k_radians), 0, 0, 1, 1},
  {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
  {&__pyx_kp_u_rect_x, __pyx_k_rect_x, sizeof(__pyx_k_rect_x), 0, 1, 0, 0},
  {&__pyx_n_s_restructure, __pyx_k_restructure, sizeof(__pyx_k_restructure), 0, 0, 1, 1},
  {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1},
  {&__pyx_n_s_reversed, __pyx_k_reversed, sizeof(__pyx_k_reversed), 0, 0, 1, 1},
  {&__pyx_kp_u_rgb, __pyx_k_rgb, sizeof(__pyx_k_rgb), 0, 1, 0, 0},
  {&__pyx_n_s_rgb_2, __pyx_k_rgb_2, sizeof(__pyx_k_rgb_2), 0, 0, 1, 1},
  {&__pyx_n_s_rgba, __pyx_k_rgba, sizeof(__pyx_k_rgba), 0, 0, 1, 1},
  {&__pyx_n_s_rotate, __pyx_k_rotate, sizeof(__pyx_k_rotate), 0, 0, 1, 1},
  {&__pyx_kp_u_rotate_f, __pyx_k_rotate_f, sizeof(__pyx_k_rotate_f), 0, 1, 0, 0},
  {&__pyx_n_s_round_step, __pyx_k_round_step, sizeof(__pyx_k_round_step), 0, 0, 1, 1},
  {&__pyx_n_s_round_to_float, __pyx_k_round_to_float, sizeof(__pyx_k_round_to_float), 0, 0, 1, 1},
  {&__pyx_n_s_round_to_zero, __pyx_k_round_to_zero, sizeof(__pyx_k_round_to_zero), 0, 0, 1, 1},
  {&__pyx_n_s_rspec, __pyx_k_rspec, sizeof(__pyx_k_rspec), 0, 0, 1, 1},
  {&__pyx_n_s_rules, __pyx_k_rules, sizeof(__pyx_k_rules), 0, 0, 1, 1},
  {&__pyx_kp_u_rx, __pyx_k_rx, sizeof(__pyx_k_rx), 0, 1, 0, 0},
  {&__pyx_n_s_rx_2, __pyx_k_rx_2, sizeof(__pyx_k_rx_2), 0, 0, 1, 1},
  {&__pyx_kp_u_ry, __pyx_k_ry, sizeof(__pyx_k_ry), 0, 1, 0, 0},
  {&__pyx_n_s_ry_2, __pyx_k_ry_2, sizeof(__pyx_k_ry_2), 0, 0, 1, 1},
  {&__pyx_n_s_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 0, 1, 1},
  {&__pyx_n_s_s1, __pyx_k_s1, sizeof(__pyx_k_s1), 0, 0, 1, 1},
  {&__pyx_n_s_s2, __pyx_k_s2, sizeof(__pyx_k_s2), 0, 0, 1, 1},
  {&__pyx_kp_u_s_2, __pyx_k_s_2, sizeof(__pyx_k_s_2), 0, 1, 0, 0},
  {&__pyx_kp_u_s_s_s_s, __pyx_k_s_s_s_s, sizeof(__pyx_k_s_s_s_s), 0, 1, 0, 0},
  {&__pyx_kp_u_scale, __pyx_k_scale, sizeof(__pyx_k_scale), 0, 1, 0, 0},
  {&__pyx_n_s_scale_2, __pyx_k_scale_2, sizeof(__pyx_k_scale_2), 0, 0, 1, 1},
  {&__pyx_n_s_seg, __pyx_k_seg, sizeof(__pyx_k_seg), 0, 0, 1, 1},
  {&__pyx_n_s_segment, __pyx_k_segment, sizeof(__pyx_k_segment), 0, 0, 1, 1},
  {&__pyx_n_s_segments, __pyx_k_segments, sizeof(__pyx_k_segments), 0, 0, 1, 1},
  {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
  {&__pyx_n_s_send, __pyx_k_send, sizeof(__pyx_k_send), 0, 0, 1, 1},
  {&__pyx_n_s_set_option, __pyx_k_set_option, sizeof(__pyx_k_set_option), 0, 0, 1, 1},
  {&__pyx_n_s_set_size, __pyx_k_set_size, sizeof(__pyx_k_set_size), 0, 0, 1, 1},
  {&__pyx_n_s_setback, __pyx_k_setback, sizeof(__pyx_k_setback), 0, 0, 1, 1},
  {&__pyx_n_s_setback_spec, __pyx_k_setback_spec, sizeof(__pyx_k_setback_spec), 0, 0, 1, 1},
  {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1},
  {&__pyx_kp_u_shift, __pyx_k_shift, sizeof(__pyx_k_shift), 0, 1, 0, 0},
  {&__pyx_n_s_shift_2, __pyx_k_shift_2, sizeof(__pyx_k_shift_2), 0, 0, 1, 1},
  {&__pyx_n_s_shrink, __pyx_k_shrink, sizeof(__pyx_k_shrink), 0, 0, 1, 1},
  {&__pyx_n_s_shrink_one_end, __pyx_k_shrink_one_end, sizeof(__pyx_k_shrink_one_end), 0, 0, 1, 1},
  {&__pyx_n_s_sin, __pyx_k_sin, sizeof(__pyx_k_sin), 0, 0, 1, 1},
  {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
  {&__pyx_n_s_size_aspect, __pyx_k_size_aspect, sizeof(__pyx_k_size_aspect), 0, 0, 1, 1},
  {&__pyx_n_s_size_multiplier, __pyx_k_size_multiplier, sizeof(__pyx_k_size_multiplier), 0, 0, 1, 1},
  {&__pyx_n_s_size_spec, __pyx_k_size_spec, sizeof(__pyx_k_size_spec), 0, 0, 1, 1},
  {&__pyx_n_s_sorted, __pyx_k_sorted, sizeof(__pyx_k_sorted), 0, 0, 1, 1},
  {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1},
  {&__pyx_n_s_specs, __pyx_k_specs, sizeof(__pyx_k_specs), 0, 0, 1, 1},
  {&__pyx_n_s_spline_degree, __pyx_k_spline_degree, sizeof(__pyx_k_spline_degree), 0, 0, 1, 1},
  {&__pyx_n_s_sqrt, __pyx_k_sqrt, sizeof(__pyx_k_sqrt), 0, 0, 1, 1},
  {&__pyx_n_s_start_angle, __pyx_k_start_angle, sizeof(__pyx_k_start_angle), 0, 0, 1, 1},
  {&__pyx_n_s_start_k_x, __pyx_k_start_k_x, sizeof(__pyx_k_start_k_x), 0, 0, 1, 1},
  {&__pyx_n_s_start_k_x_small, __pyx_k_start_k_x_small, sizeof(__pyx_k_start_k_x_small), 0, 0, 1, 1},
  {&__pyx_n_s_staticmethod, __pyx_k_staticmethod, sizeof(__pyx_k_staticmethod), 0, 0, 1, 1},
  {&__pyx_n_s_step_x, __pyx_k_step_x, sizeof(__pyx_k_step_x), 0, 0, 1, 1},
  {&__pyx_n_s_step_x_small, __pyx_k_step_x_small, sizeof(__pyx_k_step_x_small), 0, 0, 1, 1},
  {&__pyx_n_s_steps_x, __pyx_k_steps_x, sizeof(__pyx_k_steps_x), 0, 0, 1, 1},
  {&__pyx_n_s_steps_x_small, __pyx_k_steps_x_small, sizeof(__pyx_k_steps_x_small), 0, 0, 1, 1},
  {&__pyx_n_s_strip_context, __pyx_k_strip_context, sizeof(__pyx_k_strip_context), 0, 0, 1, 1},
  {&__pyx_kp_u_stroke_none, __pyx_k_stroke_none, sizeof(__pyx_k_stroke_none), 0, 1, 0, 0},
  {&__pyx_kp_u_stroke_opacity_s, __pyx_k_stroke_opacity_s, sizeof(__pyx_k_stroke_opacity_s), 0, 1, 0, 0},
  {&__pyx_kp_u_stroke_s, __pyx_k_stroke_s, sizeof(__pyx_k_stroke_s), 0, 1, 0, 0},
  {&__pyx_n_s_stroke_width, __pyx_k_stroke_width, sizeof(__pyx_k_stroke_width), 0, 0, 1, 1},
  {&__pyx_kp_u_stroke_width_fpx, __pyx_k_stroke_width_fpx, sizeof(__pyx_k_stroke_width_fpx), 0, 1, 0, 0},
  {&__pyx_n_s_style, __pyx_k_style, sizeof(__pyx_k_style), 0, 0, 1, 1},
  {&__pyx_kp_u_style_2, __pyx_k_style_2, sizeof(__pyx_k_style_2), 0, 1, 0, 0},
  {&__pyx_n_s_style_3, __pyx_k_style_3, sizeof(__pyx_k_style_3), 0, 0, 1, 1},
  {&__pyx_n_s_style_and_form_heads, __pyx_k_style_and_form_heads, sizeof(__pyx_k_style_and_form_heads), 0, 0, 1, 1},
  {&__pyx_n_s_style_class, __pyx_k_style_class, sizeof(__pyx_k_style_class), 0, 0, 1, 1},
  {&__pyx_kp_u_style_fill, __pyx_k_style_fill, sizeof(__pyx_k_style_fill), 0, 1, 0, 0},
  {&__pyx_n_s_style_heads, __pyx_k_style_heads, sizeof(__pyx_k_style_heads), 0, 0, 1, 1},
  {&__pyx_n_s_style_options, __pyx_k_style_options, sizeof(__pyx_k_style_options), 0, 0, 1, 1},
  {&__pyx_kp_u_style_s, __pyx_k_style_s, sizeof(__pyx_k_style_s), 0, 1, 0, 0},
  {&__pyx_n_s_stylebox_style, __pyx_k_stylebox_style, sizeof(__pyx_k_stylebox_style), 0, 0, 1, 1},
  {&__pyx_n_s_styles, __pyx_k_styles, sizeof(__pyx_k_styles), 0, 0, 1, 1},
  {&__pyx_n_s_sub_steps, __pyx_k_sub_steps, sizeof(__pyx_k_sub_steps), 0, 0, 1, 1},
  {&__pyx_n_s_sub_x, __pyx_k_sub_x, sizeof(__pyx_k_sub_x), 0, 0, 1, 1},
  {&__pyx_n_s_sum, __pyx_k_sum, sizeof(__pyx_k_sum), 0, 0, 1, 1},
  {&__pyx_n_s_super, __pyx_k_super, sizeof(__pyx_k_super), 0, 0, 1, 1},
  {&__pyx_n_s_svg, __pyx_k_svg, sizeof(__pyx_k_svg), 0, 0, 1, 1},
  {&__pyx_n_u_svg, __pyx_k_svg, sizeof(__pyx_k_svg), 0, 1, 0, 1},
  {&__pyx_kp_u_svg_2, __pyx_k_svg_2, sizeof(__pyx_k_svg_2), 0, 1, 0, 0},
  {&__pyx_n_s_svg_bezier, __pyx_k_svg_bezier, sizeof(__pyx_k_svg_bezier), 0, 0, 1, 1},
  {&__pyx_n_s_svg_bezier_locals_path, __pyx_k_svg_bezier_locals_path, sizeof(__pyx_k_svg_bezier_locals_path), 0, 0, 1, 1},
  {&__pyx_n_s_svg_bezier_locals_path_locals_g, __pyx_k_svg_bezier_locals_path_locals_g, sizeof(__pyx_k_svg_bezier_locals_path_locals_g), 0, 0, 1, 1},
  {&__pyx_n_s_svg_xml, __pyx_k_svg_xml, sizeof(__pyx_k_svg_xml), 0, 0, 1, 1},
  {&__pyx_kp_u_svg_xmlns_svg_http_www_w3_org_2, __pyx_k_svg_xmlns_svg_http_www_w3_org_2, sizeof(__pyx_k_svg_xmlns_svg_http_www_w3_org_2), 0, 1, 0, 0},
  {&__pyx_n_s_sx, __pyx_k_sx, sizeof(__pyx_k_sx), 0, 0, 1, 1},
  {&__pyx_n_s_sy, __pyx_k_sy, sizeof(__pyx_k_sy), 0, 0, 1, 1},
  {&__pyx_n_s_symbolic_sizes, __pyx_k_symbolic_sizes, sizeof(__pyx_k_symbolic_sizes), 0, 0, 1, 1},
  {&__pyx_n_s_system_symbols, __pyx_k_system_symbols, sizeof(__pyx_k_system_symbols), 0, 0, 1, 1},
  {&__pyx_n_s_system_symbols_dict, __pyx_k_system_symbols_dict, sizeof(__pyx_k_system_symbols_dict), 0, 0, 1, 1},
  {&__pyx_n_s_t, __pyx_k_t, sizeof(__pyx_k_t), 0, 0, 1, 1},
  {&__pyx_n_s_t0, __pyx_k_t0, sizeof(__pyx_k_t0), 0, 0, 1, 1},
  {&__pyx_n_s_t1, __pyx_k_t1, sizeof(__pyx_k_t1), 0, 0, 1, 1},
  {&__pyx_n_s_t2, __pyx_k_t2, sizeof(__pyx_k_t2), 0, 0, 1, 1},
  {&__pyx_n_s_t3, __pyx_k_t3, sizeof(__pyx_k_t3), 0, 0, 1, 1},
  {&__pyx_n_s_te, __pyx_k_te, sizeof(__pyx_k_te), 0, 0, 1, 1},
  {&__pyx_n_s_template, __pyx_k_template, sizeof(__pyx_k_template), 0, 0, 1, 1},
  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
  {&__pyx_n_s_tex, __pyx_k_tex, sizeof(__pyx_k_tex), 0, 0, 1, 1},
  {&__pyx_n_s_text_name, __pyx_k_text_name, sizeof(__pyx_k_text_name), 0, 0, 1, 1},
  {&__pyx_n_u_text_name, __pyx_k_text_name, sizeof(__pyx_k_text_name), 0, 1, 0, 1},
  {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1},
  {&__pyx_n_s_tick_label_d, __pyx_k_tick_label_d, sizeof(__pyx_k_tick_label_d), 0, 0, 1, 1},
  {&__pyx_n_s_tick_label_style, __pyx_k_tick_label_style, sizeof(__pyx_k_tick_label_style), 0, 0, 1, 1},
  {&__pyx_n_s_tick_large_size, __pyx_k_tick_large_size, sizeof(__pyx_k_tick_large_size), 0, 0, 1, 1},
  {&__pyx_n_s_tick_small_size, __pyx_k_tick_small_size, sizeof(__pyx_k_tick_small_size), 0, 0, 1, 1},
  {&__pyx_n_s_ticks, __pyx_k_ticks, sizeof(__pyx_k_ticks), 0, 0, 1, 1},
  {&__pyx_n_s_ticks_int, __pyx_k_ticks_int, sizeof(__pyx_k_ticks_int), 0, 0, 1, 1},
  {&__pyx_n_s_ticks_lines, __pyx_k_ticks_lines, sizeof(__pyx_k_ticks_lines), 0, 0, 1, 1},
  {&__pyx_n_s_ticks_small, __pyx_k_ticks_small, sizeof(__pyx_k_ticks_small), 0, 0, 1, 1},
  {&__pyx_n_s_ticks_style, __pyx_k_ticks_style, sizeof(__pyx_k_ticks_style), 0, 0, 1, 1},
  {&__pyx_n_s_ticks_x, __pyx_k_ticks_x, sizeof(__pyx_k_ticks_x), 0, 0, 1, 1},
  {&__pyx_n_s_ticks_x_int, __pyx_k_ticks_x_int, sizeof(__pyx_k_ticks_x_int), 0, 0, 1, 1},
  {&__pyx_n_s_ticks_x_small, __pyx_k_ticks_x_small, sizeof(__pyx_k_ticks_x_small), 0, 0, 1, 1},
  {&__pyx_n_s_ticks_y, __pyx_k_ticks_y, sizeof(__pyx_k_ticks_y), 0, 0, 1, 1},
  {&__pyx_n_s_ticks_y_int, __pyx_k_ticks_y_int, sizeof(__pyx_k_ticks_y_int), 0, 0, 1, 1},
  {&__pyx_n_s_ticks_y_small, __pyx_k_ticks_y_small, sizeof(__pyx_k_ticks_y_small), 0, 0, 1, 1},
  {&__pyx_n_s_tl, __pyx_k_tl, sizeof(__pyx_k_tl), 0, 0, 1, 1},
  {&__pyx_kp_u_to, __pyx_k_to, sizeof(__pyx_k_to), 0, 1, 0, 0},
  {&__pyx_n_s_to_asy, __pyx_k_to_asy, sizeof(__pyx_k_to_asy), 0, 0, 1, 1},
  {&__pyx_n_s_to_color_space, __pyx_k_to_color_space, sizeof(__pyx_k_to_color_space), 0, 0, 1, 1},
  {&__pyx_n_s_to_css, __pyx_k_to_css, sizeof(__pyx_k_to_css), 0, 0, 1, 1},
  {&__pyx_n_s_to_expr, __pyx_k_to_expr, sizeof(__pyx_k_to_expr), 0, 0, 1, 1},
  {&__pyx_n_s_to_float, __pyx_k_to_float, sizeof(__pyx_k_to_float), 0, 0, 1, 1},
  {&__pyx_n_s_to_js, __pyx_k_to_js, sizeof(__pyx_k_to_js), 0, 0, 1, 1},
  {&__pyx_n_s_to_python, __pyx_k_to_python, sizeof(__pyx_k_to_python), 0, 0, 1, 1},
  {&__pyx_n_s_to_rgba, __pyx_k_to_rgba, sizeof(__pyx_k_to_rgba), 0, 0, 1, 1},
  {&__pyx_n_s_to_svg, __pyx_k_to_svg, sizeof(__pyx_k_to_svg), 0, 0, 1, 1},
  {&__pyx_n_s_total, __pyx_k_total, sizeof(__pyx_k_total), 0, 0, 1, 1},
  {&__pyx_n_s_total_extent, __pyx_k_total_extent, sizeof(__pyx_k_total_extent), 0, 0, 1, 1},
  {&__pyx_n_s_trans, __pyx_k_trans, sizeof(__pyx_k_trans), 0, 0, 1, 1},
  {&__pyx_n_s_transform, __pyx_k_transform, sizeof(__pyx_k_transform), 0, 0, 1, 1},
  {&__pyx_n_s_transformed, __pyx_k_transformed, sizeof(__pyx_k_transformed), 0, 0, 1, 1},
  {&__pyx_n_s_transformed_points, __pyx_k_transformed_points, sizeof(__pyx_k_transformed_points), 0, 0, 1, 1},
  {&__pyx_n_s_transforms, __pyx_k_transforms, sizeof(__pyx_k_transforms), 0, 0, 1, 1},
  {&__pyx_n_s_translate, __pyx_k_translate, sizeof(__pyx_k_translate), 0, 0, 1, 1},
  {&__pyx_kp_u_translate_2, __pyx_k_translate_2, sizeof(__pyx_k_translate_2), 0, 1, 0, 0},
  {&__pyx_n_s_translate_absolute, __pyx_k_translate_absolute, sizeof(__pyx_k_translate_absolute), 0, 0, 1, 1},
  {&__pyx_n_s_translate_relative, __pyx_k_translate_relative, sizeof(__pyx_k_translate_relative), 0, 0, 1, 1},
  {&__pyx_n_s_ts, __pyx_k_ts, sizeof(__pyx_k_ts), 0, 0, 1, 1},
  {&__pyx_n_s_tx, __pyx_k_tx, sizeof(__pyx_k_tx), 0, 0, 1, 1},
  {&__pyx_n_s_ty, __pyx_k_ty, sizeof(__pyx_k_ty), 0, 0, 1, 1},
  {&__pyx_n_s_type, __pyx_k_type, sizeof(__pyx_k_type), 0, 0, 1, 1},
  {&__pyx_n_s_u, __pyx_k_u, sizeof(__pyx_k_u), 0, 0, 1, 1},
  {&__pyx_n_s_union, __pyx_k_union, sizeof(__pyx_k_union), 0, 0, 1, 1},
  {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
  {&__pyx_n_s_use_list, __pyx_k_use_list, sizeof(__pyx_k_use_list), 0, 0, 1, 1},
  {&__pyx_n_u_utf8, __pyx_k_utf8, sizeof(__pyx_k_utf8), 0, 1, 0, 1},
  {&__pyx_n_s_val, __pyx_k_val, sizeof(__pyx_k_val), 0, 0, 1, 1},
  {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1},
  {&__pyx_n_s_values, __pyx_k_values, sizeof(__pyx_k_values), 0, 0, 1, 1},
  {&__pyx_n_s_vertex_colors, __pyx_k_vertex_colors, sizeof(__pyx_k_vertex_colors), 0, 0, 1, 1},
  {&__pyx_n_s_vertices, __pyx_k_vertices, sizeof(__pyx_k_vertices), 0, 0, 1, 1},
  {&__pyx_n_s_view_width, __pyx_k_view_width, sizeof(__pyx_k_view_width), 0, 0, 1, 1},
  {&__pyx_n_s_vx, __pyx_k_vx, sizeof(__pyx_k_vx), 0, 0, 1, 1},
  {&__pyx_n_s_vy, __pyx_k_vy, sizeof(__pyx_k_vy), 0, 0, 1, 1},
  {&__pyx_n_s_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 0, 1, 1},
  {&__pyx_kp_u_width, __pyx_k_width, sizeof(__pyx_k_width), 0, 1, 0, 0},
  {&__pyx_n_s_width_2, __pyx_k_width_2, sizeof(__pyx_k_width_2), 0, 0, 1, 1},
  {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1},
  {&__pyx_n_s_x0, __pyx_k_x0, sizeof(__pyx_k_x0), 0, 0, 1, 1},
  {&__pyx_n_s_x1, __pyx_k_x1, sizeof(__pyx_k_x1), 0, 0, 1, 1},
  {&__pyx_n_s_x2, __pyx_k_x2, sizeof(__pyx_k_x2), 0, 0, 1, 1},
  {&__pyx_n_s_xmax, __pyx_k_xmax, sizeof(__pyx_k_xmax), 0, 0, 1, 1},
  {&__pyx_n_s_xmin, __pyx_k_xmin, sizeof(__pyx_k_xmin), 0, 0, 1, 1},
  {&__pyx_n_s_xy, __pyx_k_xy, sizeof(__pyx_k_xy), 0, 0, 1, 1},
  {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1},
  {&__pyx_n_s_y1, __pyx_k_y1, sizeof(__pyx_k_y1), 0, 0, 1, 1},
  {&__pyx_n_s_y2, __pyx_k_y2, sizeof(__pyx_k_y2), 0, 0, 1, 1},
  {&__pyx_kp_u_y_2, __pyx_k_y_2, sizeof(__pyx_k_y_2), 0, 1, 0, 0},
  {&__pyx_n_s_ymax, __pyx_k_ymax, sizeof(__pyx_k_ymax), 0, 0, 1, 1},
  {&__pyx_n_s_ymin, __pyx_k_ymin, sizeof(__pyx_k_ymin), 0, 0, 1, 1},
  {&__pyx_n_s_zip, __pyx_k_zip, sizeof(__pyx_k_zip), 0, 0, 1, 1},
  {0, 0, 0, 0, 0, 0, 0}
};
static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) __PYX_ERR(0, 81, __pyx_L1_error)
  __pyx_builtin_staticmethod = __Pyx_GetBuiltinName(__pyx_n_s_staticmethod); if (!__pyx_builtin_staticmethod) __PYX_ERR(0, 523, __pyx_L1_error)
  __pyx_builtin_sum = __Pyx_GetBuiltinName(__pyx_n_s_sum); if (!__pyx_builtin_sum) __PYX_ERR(0, 197, __pyx_L1_error)
  __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_n_s_zip); if (!__pyx_builtin_zip) __PYX_ERR(0, 197, __pyx_L1_error)
  __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(0, 323, __pyx_L1_error)
  __pyx_builtin_super = __Pyx_GetBuiltinName(__pyx_n_s_super); if (!__pyx_builtin_super) __PYX_ERR(0, 548, __pyx_L1_error)
  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 615, __pyx_L1_error)
  __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 892, __pyx_L1_error)
  __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(0, 1906, __pyx_L1_error)
  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 2054, __pyx_L1_error)
  __pyx_builtin_sorted = __Pyx_GetBuiltinName(__pyx_n_s_sorted); if (!__pyx_builtin_sorted) __PYX_ERR(0, 2433, __pyx_L1_error)
  __pyx_builtin_reversed = __Pyx_GetBuiltinName(__pyx_n_s_reversed); if (!__pyx_builtin_reversed) __PYX_ERR(0, 2459, __pyx_L1_error)
  __pyx_builtin_map = __Pyx_GetBuiltinName(__pyx_n_s_map); if (!__pyx_builtin_map) __PYX_ERR(0, 3074, __pyx_L1_error)
  __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 3105, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}

static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);

  /* "mathics/builtin/graphics.py":73
 * 
 * def coords(value):
 *     if value.has_form("List", 2):             # <<<<<<<<<<<<<<
 *         x, y = value.leaves[0].round_to_float(), value.leaves[1].round_to_float()
 *         if x is None or y is None:
 */
  __pyx_tuple_ = PyTuple_Pack(2, __pyx_n_u_List, __pyx_int_2); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 73, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple_);
  __Pyx_GIVEREF(__pyx_tuple_);

  /* "mathics/builtin/graphics.py":87
 *         self.d = d
 *         if expr is not None:
 *             if expr.has_form("Offset", 1, 2):             # <<<<<<<<<<<<<<
 *                 self.d = coords(expr.leaves[0])
 *                 if len(expr.leaves) > 1:
 */
  __pyx_tuple__2 = PyTuple_Pack(3, __pyx_n_u_Offset, __pyx_int_1, __pyx_int_2); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__2);
  __Pyx_GIVEREF(__pyx_tuple__2);

  /* "mathics/builtin/graphics.py":478
 * 
 *             if head == "System`List":
 *                 return Expression("List", *[convert(item) for item in content.leaves])             # <<<<<<<<<<<<<<
 *             elif head == "System`Style":
 *                 return Expression(
 */
  __pyx_tuple__11 = PyTuple_Pack(1, __pyx_n_u_List); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 478, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__11);
  __Pyx_GIVEREF(__pyx_tuple__11);

  /* "mathics/builtin/graphics.py":480
 *                 return Expression("List", *[convert(item) for item in content.leaves])
 *             elif head == "System`Style":
 *                 return Expression(             # <<<<<<<<<<<<<<
 *                     "StyleBox", *[convert(item) for item in content.leaves]
 *                 )
 */
  __pyx_tuple__12 = PyTuple_Pack(1, __pyx_n_u_StyleBox); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 480, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__12);
  __Pyx_GIVEREF(__pyx_tuple__12);

  /* "mathics/builtin/graphics.py":496
 *                         n_leaves = [content.leaves[0]] + [
 *                             Expression("N", leaf).evaluate(evaluation)
 *                             for leaf in content.leaves[1:]             # <<<<<<<<<<<<<<
 *                         ]
 *                     else:
 */
  __pyx_slice__13 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__13)) __PYX_ERR(0, 496, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__13);
  __Pyx_GIVEREF(__pyx_slice__13);

  /* "mathics/builtin/graphics.py":474
 *         StandardForm|TraditionalForm|OutputForm]"""
 * 
 *         def convert(content):             # <<<<<<<<<<<<<<
 *             head = content.get_head_name()
 * 
 */
  __pyx_tuple__14 = PyTuple_Pack(10, __pyx_n_s_content, __pyx_n_s_head, __pyx_n_s_atoms, __pyx_n_s_n_leaves, __pyx_n_s_item, __pyx_n_s_item, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_leaf, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 474, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__14);
  __Pyx_GIVEREF(__pyx_tuple__14);
  __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(1, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_convert, 474, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 474, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":744
 * 
 *     def hsl_to_rgba(self):
 *         h, s, l = self.components[:3]             # <<<<<<<<<<<<<<
 *         if l < 0.5:
 *             q = l * (1 + s)
 */
  __pyx_slice__19 = PySlice_New(Py_None, __pyx_int_3, Py_None); if (unlikely(!__pyx_slice__19)) __PYX_ERR(0, 744, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__19);
  __Pyx_GIVEREF(__pyx_slice__19);

  /* "mathics/builtin/graphics.py":753
 *         rgb = (h + 1 / 3, h, h - 1 / 3)
 * 
 *         def map(value):             # <<<<<<<<<<<<<<
 *             if value < 0:
 *                 value += 1
 */
  __pyx_tuple__20 = PyTuple_Pack(1, __pyx_n_s_value); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 753, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__20);
  __Pyx_GIVEREF(__pyx_tuple__20);
  __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_map, 753, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(0, 753, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":760
 *             return value
 * 
 *         def trans(t):             # <<<<<<<<<<<<<<
 *             if t < 1 / 6:
 *                 return p + ((q - p) * 6 * t)
 */
  __pyx_tuple__22 = PyTuple_Pack(1, __pyx_n_s_t); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 760, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__22);
  __Pyx_GIVEREF(__pyx_tuple__22);
  __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_trans, 760, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(0, 760, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":892
 *             import numpy as np
 *         except:
 *             raise RuntimeError("NumPy needs to be installed for ColorDistance")             # <<<<<<<<<<<<<<
 * 
 *         distance_function = options.get("System`DistanceFunction")
 */
  __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_u_NumPy_needs_to_be_installed_for); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 892, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__24);
  __Pyx_GIVEREF(__pyx_tuple__24);

  /* "mathics/builtin/graphics.py":948
 *         else:
 * 
 *             def compute(a, b):             # <<<<<<<<<<<<<<
 *                 return Expression(
 *                     "Apply",
 */
  __pyx_tuple__25 = PyTuple_Pack(4, __pyx_n_s_a, __pyx_n_s_b, __pyx_n_s_val, __pyx_n_s_val); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 948, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__25);
  __Pyx_GIVEREF(__pyx_tuple__25);
  __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_compute, 948, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 948, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":967
 *             return
 * 
 *         def distance(a, b):             # <<<<<<<<<<<<<<
 *             try:
 *                 py_a = _Color.create(a)
 */
  __pyx_tuple__27 = PyTuple_Pack(5, __pyx_n_s_a, __pyx_n_s_b, __pyx_n_s_py_a, __pyx_n_s_py_b, __pyx_n_s_result); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 967, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__27);
  __Pyx_GIVEREF(__pyx_tuple__27);
  __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_distance, 967, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 967, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1208
 *         self.p1 = Coords(graphics, item.leaves[0])
 *         if len(item.leaves) == 1:
 *             self.p2 = self.p1.add(1, 1)             # <<<<<<<<<<<<<<
 *         elif len(item.leaves) == 2:
 *             self.p2 = Coords(graphics, item.leaves[1])
 */
  __pyx_tuple__29 = PyTuple_Pack(2, __pyx_int_1, __pyx_int_1); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 1208, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__29);
  __Pyx_GIVEREF(__pyx_tuple__29);

  /* "mathics/builtin/graphics.py":1350
 *                     self.arc = (start_angle, end_angle)
 * 
 *             item = Expression(item.get_head_name(), *item.leaves[:2])             # <<<<<<<<<<<<<<
 *         else:
 *             self.arc = None
 */
  __pyx_slice__36 = PySlice_New(Py_None, __pyx_int_2, Py_None); if (unlikely(!__pyx_slice__36)) __PYX_ERR(0, 1350, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__36);
  __Pyx_GIVEREF(__pyx_slice__36);

  /* "mathics/builtin/graphics.py":1383
 *         x, y, rx, ry, sx, sy, ex, ey, large_arc = self._arc_params()
 * 
 *         def path(closed):             # <<<<<<<<<<<<<<
 *             if closed:
 *                 yield "M %f,%f" % (x, y)
 */
  __pyx_tuple__37 = PyTuple_Pack(1, __pyx_n_s_closed); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 1383, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__37);
  __Pyx_GIVEREF(__pyx_tuple__37);
  __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_path, 1383, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(0, 1383, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1405
 *         x, y, rx, ry, sx, sy, ex, ey, large_arc = self._arc_params()
 * 
 *         def path(closed):             # <<<<<<<<<<<<<<
 *             if closed:
 *                 yield "(%s,%s)--(%s,%s)--" % tuple(
 */
  __pyx_tuple__39 = PyTuple_Pack(4, __pyx_n_s_closed, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 1405, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__39);
  __Pyx_GIVEREF(__pyx_tuple__39);
  __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_path, 1405, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(0, 1405, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1444
 *             points.leaves
 *             and points.leaves[0].has_form("List", None)
 *             and all(leaf.has_form("List", None) for leaf in points.leaves[0].leaves)             # <<<<<<<<<<<<<<
 *         ):
 *             leaves = points.leaves
 */
  __pyx_tuple__42 = PyTuple_Pack(2, __pyx_n_u_List, Py_None); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 1444, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__42);
  __Pyx_GIVEREF(__pyx_tuple__42);

  /* "mathics/builtin/graphics.py":1607
 *     forms = "LQC"  # SVG commands for line, quadratic bezier, cubic bezier
 * 
 *     def path(max_degree, p):             # <<<<<<<<<<<<<<
 *         max_degree = min(max_degree, len(forms))
 *         while p:
 */
  __pyx_tuple__45 = PyTuple_Pack(5, __pyx_n_s_max_degree, __pyx_n_s_p, __pyx_n_s_n, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 1607, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__45);
  __Pyx_GIVEREF(__pyx_tuple__45);
  __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_path, 1607, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(0, 1607, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1636
 *         return
 * 
 *     def cubic(p0, p1, p2, p3):             # <<<<<<<<<<<<<<
 *         return "..controls(%.5g,%.5g) and (%.5g,%.5g)..(%.5g,%.5g)" % tuple(
 *             list(chain(p1, p2, p3))
 */
  __pyx_tuple__48 = PyTuple_Pack(4, __pyx_n_s_p0, __pyx_n_s_p1, __pyx_n_s_p2, __pyx_n_s_p3); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 1636, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__48);
  __Pyx_GIVEREF(__pyx_tuple__48);
  __pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_cubic, 1636, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__49)) __PYX_ERR(0, 1636, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1641
 *         )
 * 
 *     def quadratric(qp0, qp1, qp2):             # <<<<<<<<<<<<<<
 *         # asymptote only supports cubic beziers, so we convert this quadratic
 *         # bezier to a cubic bezier, see http://fontforge.github.io/bezier.html
 */
  __pyx_tuple__50 = PyTuple_Pack(14, __pyx_n_s_qp0, __pyx_n_s_qp1, __pyx_n_s_qp2, __pyx_n_s_qp0x, __pyx_n_s_qp0y, __pyx_n_s_qp1x, __pyx_n_s_qp1y, __pyx_n_s_qp2x, __pyx_n_s_qp2y, __pyx_n_s_t, __pyx_n_s_cp0, __pyx_n_s_cp1, __pyx_n_s_cp2, __pyx_n_s_cp3); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(0, 1641, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__50);
  __Pyx_GIVEREF(__pyx_tuple__50);
  __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(3, 0, 14, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__50, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_quadratric, 1641, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__51)) __PYX_ERR(0, 1641, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1662
 *         return cubic(cp0, cp1, cp2, cp3)
 * 
 *     def linear(p0, p1):             # <<<<<<<<<<<<<<
 *         return "--(%.5g,%.5g)" % p1
 * 
 */
  __pyx_tuple__52 = PyTuple_Pack(2, __pyx_n_s_p0, __pyx_n_s_p1); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(0, 1662, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__52);
  __Pyx_GIVEREF(__pyx_tuple__52);
  __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__52, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_linear, 1662, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__53)) __PYX_ERR(0, 1662, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1667
 *     forms = (linear, quadratric, cubic)
 * 
 *     def path(max_degree, p):             # <<<<<<<<<<<<<<
 *         max_degree = min(max_degree, len(forms))
 *         while p:
 */
  __pyx_tuple__54 = PyTuple_Pack(3, __pyx_n_s_max_degree, __pyx_n_s_p, __pyx_n_s_n); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(0, 1667, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__54);
  __Pyx_GIVEREF(__pyx_tuple__54);
  __pyx_codeobj__55 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__54, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_path, 1667, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__55)) __PYX_ERR(0, 1667, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1683
 *         for s in path(k, list(chain(connect, p))):
 *             yield s
 *         connect = p[-1:]             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_slice__56 = PySlice_New(__pyx_int_neg_1, Py_None, Py_None); if (unlikely(!__pyx_slice__56)) __PYX_ERR(0, 1683, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__56);
  __Pyx_GIVEREF(__pyx_slice__56);

  /* "mathics/builtin/graphics.py":1780
 *             leaves = item.leaves[0].leaves
 * 
 *             def parse_component(segments):             # <<<<<<<<<<<<<<
 *                 for segment in segments:
 *                     head = segment.get_head_name()
 */
  __pyx_tuple__59 = PyTuple_Pack(10, __pyx_n_s_segments, __pyx_n_s_segment, __pyx_n_s_head, __pyx_n_s_k, __pyx_n_s_parts, __pyx_n_s_options, __pyx_n_s_spline_degree, __pyx_n_s_coords, __pyx_n_s_part, __pyx_n_s_xy); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(0, 1780, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__59);
  __Pyx_GIVEREF(__pyx_tuple__59);
  __pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(1, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__59, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_parse_component, 1780, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__60)) __PYX_ERR(0, 1780, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1823
 *         )
 * 
 *         def components():             # <<<<<<<<<<<<<<
 *             for component in self.components:
 *                 transformed = [(k, [xy.pos() for xy in p]) for k, p in component]
 */
  __pyx_tuple__61 = PyTuple_Pack(5, __pyx_n_s_component, __pyx_n_s_transformed, __pyx_n_s_k, __pyx_n_s_p, __pyx_n_s_xy); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(0, 1823, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__61);
  __Pyx_GIVEREF(__pyx_tuple__61);
  __pyx_codeobj__62 = (PyObject*)__Pyx_PyCode_New(0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__61, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_components, 1823, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__62)) __PYX_ERR(0, 1823, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1840
 *             pen = "currentpen"
 * 
 *         def components():             # <<<<<<<<<<<<<<
 *             for component in self.components:
 *                 transformed = [(k, [xy.pos() for xy in p]) for k, p in component]
 */
  __pyx_tuple__63 = PyTuple_Pack(5, __pyx_n_s_component, __pyx_n_s_transformed, __pyx_n_s_k, __pyx_n_s_p, __pyx_n_s_xy); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(0, 1840, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__63);
  __Pyx_GIVEREF(__pyx_tuple__63);
  __pyx_codeobj__64 = (PyObject*)__Pyx_PyCode_New(0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__63, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_components, 1840, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__64)) __PYX_ERR(0, 1840, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1890
 *             self.vertex_colors = None
 *             for leaf in item.leaves[1:]:
 *                 if not leaf.has_form("Rule", 2):             # <<<<<<<<<<<<<<
 *                     raise BoxConstructError
 *                 name = leaf.leaves[0].get_name()
 */
  __pyx_tuple__65 = PyTuple_Pack(2, __pyx_n_u_Rule, __pyx_int_2); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(0, 1890, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__65);
  __Pyx_GIVEREF(__pyx_tuple__65);

  /* "mathics/builtin/graphics.py":2053
 *             pi2 = pi * 2.0
 * 
 *             def vertices():             # <<<<<<<<<<<<<<
 *                 for i in range(n):
 *                     phi = phi0 + pi2 * i / float(n)
 */
  __pyx_tuple__68 = PyTuple_Pack(2, __pyx_n_s_i, __pyx_n_s_phi); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(0, 2053, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__68);
  __Pyx_GIVEREF(__pyx_tuple__68);
  __pyx_codeobj__69 = (PyObject*)__Pyx_PyCode_New(0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__68, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_vertices, 2053, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__69)) __PYX_ERR(0, 2053, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2204
 * class _Line:
 *     def make_draw_svg(self, style):
 *         def draw(points):             # <<<<<<<<<<<<<<
 *             yield '<polyline points="'
 *             yield " ".join("%f,%f" % xy for xy in points)
 */
  __pyx_tuple__71 = PyTuple_Pack(3, __pyx_n_s_points, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(0, 2204, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__71);
  __Pyx_GIVEREF(__pyx_tuple__71);
  __pyx_codeobj__72 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_draw, 2204, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__72)) __PYX_ERR(0, 2204, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2212
 * 
 *     def make_draw_asy(self, pen):
 *         def draw(points):             # <<<<<<<<<<<<<<
 *             yield "draw("
 *             yield "--".join(["(%.5g,%5g)" % xy for xy in points])
 */
  __pyx_tuple__73 = PyTuple_Pack(2, __pyx_n_s_points, __pyx_n_s_xy); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(0, 2212, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__73);
  __Pyx_GIVEREF(__pyx_tuple__73);
  __pyx_codeobj__74 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_draw, 2212, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__74)) __PYX_ERR(0, 2212, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2220
 * 
 *     def arrows(self, points, heads):  # heads has to be sorted by pos
 *         def segments(points):             # <<<<<<<<<<<<<<
 *             for i in range(len(points) - 1):
 *                 px, py = points[i]
 */
  __pyx_tuple__76 = PyTuple_Pack(7, __pyx_n_s_points, __pyx_n_s_i, __pyx_n_s_px, __pyx_n_s_py, __pyx_n_s_dx, __pyx_n_s_dy, __pyx_n_s_dl); if (unlikely(!__pyx_tuple__76)) __PYX_ERR(0, 2220, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__76);
  __Pyx_GIVEREF(__pyx_tuple__76);
  __pyx_codeobj__77 = (PyObject*)__Pyx_PyCode_New(1, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__76, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_segments, 2220, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__77)) __PYX_ERR(0, 2220, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2292
 * 
 *     def make_draw_svg(self, style):
 *         def draw(points):             # <<<<<<<<<<<<<<
 *             s = " ".join(_svg_bezier((self.spline_degree, points)))
 *             yield '<path d="%s" style="%s"/>' % (s, style)
 */
  __pyx_tuple__78 = PyTuple_Pack(2, __pyx_n_s_points, __pyx_n_s_s); if (unlikely(!__pyx_tuple__78)) __PYX_ERR(0, 2292, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__78);
  __Pyx_GIVEREF(__pyx_tuple__78);
  __pyx_codeobj__79 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__78, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_draw, 2292, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__79)) __PYX_ERR(0, 2292, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2299
 * 
 *     def make_draw_asy(self, pen):
 *         def draw(points):             # <<<<<<<<<<<<<<
 *             for path in _asy_bezier((self.spline_degree, points)):
 *                 yield "draw(%s, %s);" % (path, pen)
 */
  __pyx_tuple__80 = PyTuple_Pack(2, __pyx_n_s_points, __pyx_n_s_path); if (unlikely(!__pyx_tuple__80)) __PYX_ERR(0, 2299, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__80);
  __Pyx_GIVEREF(__pyx_tuple__80);
  __pyx_codeobj__81 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__80, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_draw, 2299, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__81)) __PYX_ERR(0, 2299, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2343
 *             setback = self._setback_spec(leaves[1])
 *         elif len(leaves) == 1:
 *             setback = (0, 0)             # <<<<<<<<<<<<<<
 *         else:
 *             raise BoxConstructError
 */
  __pyx_tuple__83 = PyTuple_Pack(2, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__83)) __PYX_ERR(0, 2343, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__83);
  __Pyx_GIVEREF(__pyx_tuple__83);

  /* "mathics/builtin/graphics.py":2407
 *         arrow_edge = 1.1
 * 
 *         def draw(px, py, vx, vy, t1, s):             # <<<<<<<<<<<<<<
 *             hx = px + t1 * vx  # compute H
 *             hy = py + t1 * vy
 */
  __pyx_tuple__84 = PyTuple_Pack(19, __pyx_n_s_px, __pyx_n_s_py, __pyx_n_s_vx, __pyx_n_s_vy, __pyx_n_s_t1, __pyx_n_s_s, __pyx_n_s_hx, __pyx_n_s_hy, __pyx_n_s_t0, __pyx_n_s_bx, __pyx_n_s_by, __pyx_n_s_te, __pyx_n_s_ex, __pyx_n_s_ey, __pyx_n_s_ts, __pyx_n_s_sx, __pyx_n_s_sy, __pyx_n_s_head_points, __pyx_n_s_shape); if (unlikely(!__pyx_tuple__84)) __PYX_ERR(0, 2407, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__84);
  __Pyx_GIVEREF(__pyx_tuple__84);
  __pyx_codeobj__85 = (PyObject*)__Pyx_PyCode_New(6, 0, 19, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__84, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_draw, 2407, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__85)) __PYX_ERR(0, 2407, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2460
 *             return list(
 *                 reversed(
 *                     shrink_one_end(list(reversed(shrink_one_end(line[:], s1))), s2)             # <<<<<<<<<<<<<<
 *                 )
 *             )
 */
  __pyx_slice__87 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__87)) __PYX_ERR(0, 2460, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__87);
  __Pyx_GIVEREF(__pyx_slice__87);

  /* "mathics/builtin/graphics.py":2437
 *             heads = ((extent * Arrowheads.default_size, 1, default_arrow),)
 * 
 *         def setback(p, q, d):             # <<<<<<<<<<<<<<
 *             dx, dy, length = _norm(p, q)
 *             if d >= length:
 */
  __pyx_tuple__88 = PyTuple_Pack(7, __pyx_n_s_p, __pyx_n_s_q, __pyx_n_s_d, __pyx_n_s_dx, __pyx_n_s_dy, __pyx_n_s_length, __pyx_n_s_s); if (unlikely(!__pyx_tuple__88)) __PYX_ERR(0, 2437, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__88);
  __Pyx_GIVEREF(__pyx_tuple__88);
  __pyx_codeobj__89 = (PyObject*)__Pyx_PyCode_New(3, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__88, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_setback, 2437, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__89)) __PYX_ERR(0, 2437, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2445
 *                 return (s * dx, s * dy), d
 * 
 *         def shrink_one_end(line, s):             # <<<<<<<<<<<<<<
 *             while s > 0.0:
 *                 if len(line) < 2:
 */
  __pyx_tuple__90 = PyTuple_Pack(4, __pyx_n_s_line, __pyx_n_s_s, __pyx_n_s_xy, __pyx_n_s_length); if (unlikely(!__pyx_tuple__90)) __PYX_ERR(0, 2445, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__90);
  __Pyx_GIVEREF(__pyx_tuple__90);
  __pyx_codeobj__91 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__90, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_shrink_one_end, 2445, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__91)) __PYX_ERR(0, 2445, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2457
 *             return line
 * 
 *         def shrink(line, s1, s2):             # <<<<<<<<<<<<<<
 *             return list(
 *                 reversed(
 */
  __pyx_tuple__92 = PyTuple_Pack(3, __pyx_n_s_line, __pyx_n_s_s1, __pyx_n_s_s2); if (unlikely(!__pyx_tuple__92)) __PYX_ERR(0, 2457, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__92);
  __Pyx_GIVEREF(__pyx_tuple__92);
  __pyx_codeobj__93 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__92, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_shrink, 2457, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__93)) __PYX_ERR(0, 2457, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2487
 *             boxh = ymax - ymin
 * 
 *             def draw(px, py, vx, vy, t1, s):             # <<<<<<<<<<<<<<
 *                 t0 = t1
 *                 cx = px + t0 * vx
 */
  __pyx_tuple__94 = PyTuple_Pack(10, __pyx_n_s_px, __pyx_n_s_py, __pyx_n_s_vx, __pyx_n_s_vy, __pyx_n_s_t1, __pyx_n_s_s, __pyx_n_s_t0, __pyx_n_s_cx, __pyx_n_s_cy_2, __pyx_n_s_transform); if (unlikely(!__pyx_tuple__94)) __PYX_ERR(0, 2487, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__94);
  __Pyx_GIVEREF(__pyx_tuple__94);
  __pyx_codeobj__95 = (PyObject*)__Pyx_PyCode_New(6, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__94, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_draw, 2487, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__95)) __PYX_ERR(0, 2487, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2480
 * 
 *     def _custom_arrow(self, format, format_transform):
 *         def make(graphics):             # <<<<<<<<<<<<<<
 *             xmin, xmax, ymin, ymax, ox, oy, ex, ey, code = _extract_graphics(
 *                 graphics, format, self.graphics.evaluation
 */
  __pyx_tuple__96 = PyTuple_Pack(14, __pyx_n_s_graphics, __pyx_n_s_xmin, __pyx_n_s_xmax, __pyx_n_s_ymin, __pyx_n_s_ymax, __pyx_n_s_ox, __pyx_n_s_oy, __pyx_n_s_ex, __pyx_n_s_ey, __pyx_n_s_code, __pyx_n_s_boxw, __pyx_n_s_boxh, __pyx_n_s_draw, __pyx_n_s_draw); if (unlikely(!__pyx_tuple__96)) __PYX_ERR(0, 2480, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__96);
  __Pyx_GIVEREF(__pyx_tuple__96);
  __pyx_codeobj__97 = (PyObject*)__Pyx_PyCode_New(1, 0, 14, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__96, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_make, 2480, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__97)) __PYX_ERR(0, 2480, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2510
 *         arrow_style = create_css(face_color=self.edge_color, stroke_width=width)
 * 
 *         def polygon(points):             # <<<<<<<<<<<<<<
 *             yield '<polygon points="'
 *             yield " ".join("%f,%f" % xy for xy in points)
 */
  __pyx_tuple__98 = PyTuple_Pack(3, __pyx_n_s_points, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__98)) __PYX_ERR(0, 2510, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__98);
  __Pyx_GIVEREF(__pyx_tuple__98);
  __pyx_codeobj__99 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__98, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_polygon, 2510, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__99)) __PYX_ERR(0, 2510, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2527
 *         arrow_pen = create_pens(face_color=self.edge_color, stroke_width=width)
 * 
 *         def polygon(points):             # <<<<<<<<<<<<<<
 *             yield "filldraw("
 *             yield "--".join(["(%.5g,%5g)" % xy for xy in points])
 */
  __pyx_tuple__100 = PyTuple_Pack(2, __pyx_n_s_points, __pyx_n_s_xy); if (unlikely(!__pyx_tuple__100)) __PYX_ERR(0, 2527, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__100);
  __Pyx_GIVEREF(__pyx_tuple__100);
  __pyx_codeobj__101 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__100, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_polygon, 2527, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__101)) __PYX_ERR(0, 2527, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2540
 *         width = self.style.get_line_width(face_element=False)
 * 
 *         def polyline(points):             # <<<<<<<<<<<<<<
 *             for p in points:
 *                 x, y = p
 */
  __pyx_tuple__102 = PyTuple_Pack(4, __pyx_n_s_points, __pyx_n_s_p, __pyx_n_s_x, __pyx_n_s_y); if (unlikely(!__pyx_tuple__102)) __PYX_ERR(0, 2540, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__102);
  __Pyx_GIVEREF(__pyx_tuple__102);
  __pyx_codeobj__103 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__102, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_polyline, 2540, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__103)) __PYX_ERR(0, 2540, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2548
 *                 yield x + width, y + width
 * 
 *         def polygon(points):             # <<<<<<<<<<<<<<
 *             for p in points:
 *                 yield p
 */
  __pyx_tuple__104 = PyTuple_Pack(2, __pyx_n_s_points, __pyx_n_s_p); if (unlikely(!__pyx_tuple__104)) __PYX_ERR(0, 2548, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__104);
  __Pyx_GIVEREF(__pyx_tuple__104);
  __pyx_codeobj__105 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__104, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_polygon, 2548, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__105)) __PYX_ERR(0, 2548, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2552
 *                 yield p
 * 
 *         def default_arrow(px, py, vx, vy, t1, s):             # <<<<<<<<<<<<<<
 *             yield px, py
 * 
 */
  __pyx_tuple__106 = PyTuple_Pack(6, __pyx_n_s_px, __pyx_n_s_py, __pyx_n_s_vx, __pyx_n_s_vy, __pyx_n_s_t1, __pyx_n_s_s); if (unlikely(!__pyx_tuple__106)) __PYX_ERR(0, 2552, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__106);
  __Pyx_GIVEREF(__pyx_tuple__106);
  __pyx_codeobj__107 = (PyObject*)__Pyx_PyCode_New(6, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__106, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_default_arrow, 2552, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__107)) __PYX_ERR(0, 2552, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2702
 * 
 *     def get_default_face_color(self):
 *         return RGBColor(components=(0, 0, 0, 1))             # <<<<<<<<<<<<<<
 * 
 *     def get_default_edge_color(self):
 */
  __pyx_tuple__110 = PyTuple_Pack(4, __pyx_int_0, __pyx_int_0, __pyx_int_0, __pyx_int_1); if (unlikely(!__pyx_tuple__110)) __PYX_ERR(0, 2702, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__110);
  __Pyx_GIVEREF(__pyx_tuple__110);

  /* "mathics/builtin/graphics.py":2820
 *                     ):
 *                         yield element
 *                 elif head[-3:] == "Box":  # and head[:-3] in element_heads:             # <<<<<<<<<<<<<<
 *                     element_class = get_class(head)
 *                     if element_class is not None:
 */
  __pyx_slice__112 = PySlice_New(__pyx_int_neg_3, Py_None, Py_None); if (unlikely(!__pyx_slice__112)) __PYX_ERR(0, 2820, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__112);
  __Pyx_GIVEREF(__pyx_slice__112);

  /* "mathics/builtin/graphics.py":2823
 *                     element_class = get_class(head)
 *                     if element_class is not None:
 *                         options = get_options(head[:-3])             # <<<<<<<<<<<<<<
 *                         if options:
 *                             data, options = _data_and_options(item.leaves, options)
 */
  __pyx_slice__113 = PySlice_New(Py_None, __pyx_int_neg_3, Py_None); if (unlikely(!__pyx_slice__113)) __PYX_ERR(0, 2823, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__113);
  __Pyx_GIVEREF(__pyx_slice__113);

  /* "mathics/builtin/graphics.py":2774
 *         builtins = evaluation.definitions.builtin
 * 
 *         def get_options(name):             # <<<<<<<<<<<<<<
 *             builtin = builtins.get(name)
 *             if builtin is None:
 */
  __pyx_tuple__114 = PyTuple_Pack(2, __pyx_n_s_name, __pyx_n_s_builtin); if (unlikely(!__pyx_tuple__114)) __PYX_ERR(0, 2774, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__114);
  __Pyx_GIVEREF(__pyx_tuple__114);
  __pyx_codeobj__115 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__114, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_get_options, 2774, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__115)) __PYX_ERR(0, 2774, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2780
 *             return builtin.options
 * 
 *         def stylebox_style(style, specs):             # <<<<<<<<<<<<<<
 *             new_style = style.clone()
 *             for spec in _flatten(specs):
 */
  __pyx_tuple__116 = PyTuple_Pack(9, __pyx_n_s_style, __pyx_n_s_specs, __pyx_n_s_new_style, __pyx_n_s_spec, __pyx_n_s_head_name, __pyx_n_s_option, __pyx_n_s_expr, __pyx_n_s_name, __pyx_n_s_create); if (unlikely(!__pyx_tuple__116)) __PYX_ERR(0, 2780, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__116);
  __Pyx_GIVEREF(__pyx_tuple__116);
  __pyx_codeobj__117 = (PyObject*)__Pyx_PyCode_New(2, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__116, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_stylebox_style, 2780, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__117)) __PYX_ERR(0, 2780, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2801
 *             return new_style
 * 
 *         def convert(content, style):             # <<<<<<<<<<<<<<
 *             if content.has_form("List", None):
 *                 items = content.leaves
 */
  __pyx_tuple__118 = PyTuple_Pack(10, __pyx_n_s_content, __pyx_n_s_style, __pyx_n_s_items, __pyx_n_s_item, __pyx_n_s_head, __pyx_n_s_element, __pyx_n_s_element_class, __pyx_n_s_options, __pyx_n_s_data, __pyx_n_s_new_item); if (unlikely(!__pyx_tuple__118)) __PYX_ERR(0, 2801, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__118);
  __Pyx_GIVEREF(__pyx_tuple__118);
  __pyx_codeobj__119 = (PyObject*)__Pyx_PyCode_New(2, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__118, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_convert, 2801, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__119)) __PYX_ERR(0, 2801, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2845
 * 
 *         def convert(expr):
 *             if expr.has_form(("List", "Directive"), None):             # <<<<<<<<<<<<<<
 *                 for item in expr.leaves:
 *                     convert(item)
 */
  __pyx_tuple__120 = PyTuple_Pack(2, __pyx_n_u_List, __pyx_n_u_Directive); if (unlikely(!__pyx_tuple__120)) __PYX_ERR(0, 2845, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__120);
  __Pyx_GIVEREF(__pyx_tuple__120);
  __pyx_tuple__121 = PyTuple_Pack(2, __pyx_tuple__120, Py_None); if (unlikely(!__pyx_tuple__121)) __PYX_ERR(0, 2845, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__121);
  __Pyx_GIVEREF(__pyx_tuple__121);

  /* "mathics/builtin/graphics.py":2844
 *         style = self.get_style_class()(self)
 * 
 *         def convert(expr):             # <<<<<<<<<<<<<<
 *             if expr.has_form(("List", "Directive"), None):
 *                 for item in expr.leaves:
 */
  __pyx_tuple__122 = PyTuple_Pack(2, __pyx_n_s_expr, __pyx_n_s_item); if (unlikely(!__pyx_tuple__122)) __PYX_ERR(0, 2844, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__122);
  __Pyx_GIVEREF(__pyx_tuple__122);
  __pyx_codeobj__123 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__122, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_convert, 2844, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__123)) __PYX_ERR(0, 2844, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2909
 *         if xmin == xmax:
 *             if xmin is None:
 *                 return 0, 0, 0, 0             # <<<<<<<<<<<<<<
 *             xmin = 0
 *             xmax *= 2
 */
  __pyx_tuple__124 = PyTuple_Pack(4, __pyx_int_0, __pyx_int_0, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__124)) __PYX_ERR(0, 2909, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__124);
  __Pyx_GIVEREF(__pyx_tuple__124);

  /* "mathics/builtin/graphics.py":2944
 * 
 *     def _get_image_size(self, options, graphics_options, max_width):
 *         inside_row = options.pop("inside_row", False)             # <<<<<<<<<<<<<<
 *         inside_list = options.pop("inside_list", False)
 *         image_size_multipliers = options.pop("image_size_multipliers", None)
 */
  __pyx_tuple__125 = PyTuple_Pack(2, __pyx_n_u_inside_row, Py_False); if (unlikely(!__pyx_tuple__125)) __PYX_ERR(0, 2944, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__125);
  __Pyx_GIVEREF(__pyx_tuple__125);

  /* "mathics/builtin/graphics.py":2945
 *     def _get_image_size(self, options, graphics_options, max_width):
 *         inside_row = options.pop("inside_row", False)
 *         inside_list = options.pop("inside_list", False)             # <<<<<<<<<<<<<<
 *         image_size_multipliers = options.pop("image_size_multipliers", None)
 * 
 */
  __pyx_tuple__126 = PyTuple_Pack(2, __pyx_n_u_inside_list, Py_False); if (unlikely(!__pyx_tuple__126)) __PYX_ERR(0, 2945, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__126);
  __Pyx_GIVEREF(__pyx_tuple__126);

  /* "mathics/builtin/graphics.py":2946
 *         inside_row = options.pop("inside_row", False)
 *         inside_list = options.pop("inside_list", False)
 *         image_size_multipliers = options.pop("image_size_multipliers", None)             # <<<<<<<<<<<<<<
 * 
 *         aspect_ratio = graphics_options["System`AspectRatio"]
 */
  __pyx_tuple__127 = PyTuple_Pack(2, __pyx_n_u_image_size_multipliers, Py_None); if (unlikely(!__pyx_tuple__127)) __PYX_ERR(0, 2946, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__127);
  __Pyx_GIVEREF(__pyx_tuple__127);

  /* "mathics/builtin/graphics.py":2951
 * 
 *         if image_size_multipliers is None:
 *             image_size_multipliers = (0.5, 0.25)             # <<<<<<<<<<<<<<
 * 
 *         if aspect_ratio == Symbol("Automatic"):
 */
  __pyx_tuple__128 = PyTuple_Pack(2, __pyx_float_0_5, __pyx_float_0_25); if (unlikely(!__pyx_tuple__128)) __PYX_ERR(0, 2951, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__128);
  __Pyx_GIVEREF(__pyx_tuple__128);

  /* "mathics/builtin/graphics.py":2962
 *             base_width = image_size.get_int_value()
 *             base_height = None  # will be computed later in calc_dimensions
 *         elif image_size.has_form("System`List", 2):             # <<<<<<<<<<<<<<
 *             base_width, base_height = (
 *                 [x.round_to_float() for x in image_size.leaves] + [0, 0]
 */
  __pyx_tuple__129 = PyTuple_Pack(2, __pyx_kp_u_System_List, __pyx_int_2); if (unlikely(!__pyx_tuple__129)) __PYX_ERR(0, 2962, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__129);
  __Pyx_GIVEREF(__pyx_tuple__129);

  /* "mathics/builtin/graphics.py":2972
 *             image_size = image_size.get_name()
 *             base_width, base_height = {
 *                 "System`Automatic": (400, 350),             # <<<<<<<<<<<<<<
 *                 "System`Tiny": (100, 100),
 *                 "System`Small": (200, 200),
 */
  __pyx_tuple__130 = PyTuple_Pack(2, __pyx_int_400, __pyx_int_350); if (unlikely(!__pyx_tuple__130)) __PYX_ERR(0, 2972, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__130);
  __Pyx_GIVEREF(__pyx_tuple__130);

  /* "mathics/builtin/graphics.py":2973
 *             base_width, base_height = {
 *                 "System`Automatic": (400, 350),
 *                 "System`Tiny": (100, 100),             # <<<<<<<<<<<<<<
 *                 "System`Small": (200, 200),
 *                 "System`Medium": (400, 350),
 */
  __pyx_tuple__131 = PyTuple_Pack(2, __pyx_int_100, __pyx_int_100); if (unlikely(!__pyx_tuple__131)) __PYX_ERR(0, 2973, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__131);
  __Pyx_GIVEREF(__pyx_tuple__131);

  /* "mathics/builtin/graphics.py":2974
 *                 "System`Automatic": (400, 350),
 *                 "System`Tiny": (100, 100),
 *                 "System`Small": (200, 200),             # <<<<<<<<<<<<<<
 *                 "System`Medium": (400, 350),
 *                 "System`Large": (600, 500),
 */
  __pyx_tuple__132 = PyTuple_Pack(2, __pyx_int_200, __pyx_int_200); if (unlikely(!__pyx_tuple__132)) __PYX_ERR(0, 2974, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__132);
  __Pyx_GIVEREF(__pyx_tuple__132);

  /* "mathics/builtin/graphics.py":2976
 *                 "System`Small": (200, 200),
 *                 "System`Medium": (400, 350),
 *                 "System`Large": (600, 500),             # <<<<<<<<<<<<<<
 *             }.get(image_size, (None, None))
 *         if base_width is None:
 */
  __pyx_tuple__133 = PyTuple_Pack(2, __pyx_int_600, __pyx_int_500); if (unlikely(!__pyx_tuple__133)) __PYX_ERR(0, 2976, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__133);
  __Pyx_GIVEREF(__pyx_tuple__133);

  /* "mathics/builtin/graphics.py":2977
 *                 "System`Medium": (400, 350),
 *                 "System`Large": (600, 500),
 *             }.get(image_size, (None, None))             # <<<<<<<<<<<<<<
 *         if base_width is None:
 *             raise BoxConstructError
 */
  __pyx_tuple__134 = PyTuple_Pack(2, Py_None, Py_None); if (unlikely(!__pyx_tuple__134)) __PYX_ERR(0, 2977, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__134);
  __Pyx_GIVEREF(__pyx_tuple__134);

  /* "mathics/builtin/graphics.py":3053
 *                 exmin = exmax = eymin = eymax = None
 * 
 *             def get_range(min, max):             # <<<<<<<<<<<<<<
 *                 if max < min:
 *                     min, max = max, min
 */
  __pyx_tuple__135 = PyTuple_Pack(2, __pyx_n_s_min, __pyx_n_s_max); if (unlikely(!__pyx_tuple__135)) __PYX_ERR(0, 3053, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__135);
  __Pyx_GIVEREF(__pyx_tuple__135);
  __pyx_codeobj__136 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__135, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_get_range, 3053, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__136)) __PYX_ERR(0, 3053, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":3021
 *         axes = []  # to be filled further down
 * 
 *         def calc_dimensions(final_pass=True):             # <<<<<<<<<<<<<<
 *             """
 *             calc_dimensions gets called twice: In the first run
 */
  __pyx_tuple__137 = PyTuple_Pack(18, __pyx_n_s_final_pass, __pyx_n_s_xmin, __pyx_n_s_xmax, __pyx_n_s_ymin, __pyx_n_s_ymax, __pyx_n_s_exmin, __pyx_n_s_exmax, __pyx_n_s_eymin, __pyx_n_s_eymax, __pyx_n_s_get_range, __pyx_n_s_get_range, __pyx_n_s_w, __pyx_n_s_h, __pyx_n_s_aspect, __pyx_n_s_height_2, __pyx_n_s_width_2, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__137)) __PYX_ERR(0, 3021, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__137);
  __Pyx_GIVEREF(__pyx_tuple__137);
  __pyx_codeobj__138 = (PyObject*)__Pyx_PyCode_New(1, 0, 18, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__137, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_calc_dimensions, 3021, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__138)) __PYX_ERR(0, 3021, __pyx_L1_error)
  __pyx_tuple__139 = PyTuple_Pack(1, ((PyObject *)Py_True)); if (unlikely(!__pyx_tuple__139)) __PYX_ERR(0, 3021, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__139);
  __Pyx_GIVEREF(__pyx_tuple__139);

  /* "mathics/builtin/graphics.py":3243
 * 
 *     def axis_ticks(self, xmin, xmax):
 *         def round_to_zero(value):             # <<<<<<<<<<<<<<
 *             if value == 0:
 *                 return 0
 */
  __pyx_tuple__143 = PyTuple_Pack(1, __pyx_n_s_value); if (unlikely(!__pyx_tuple__143)) __PYX_ERR(0, 3243, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__143);
  __Pyx_GIVEREF(__pyx_tuple__143);
  __pyx_codeobj__144 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__143, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_round_to_zero, 3243, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__144)) __PYX_ERR(0, 3243, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":3251
 *                 return floor(value)
 * 
 *         def round_step(value):             # <<<<<<<<<<<<<<
 *             if not value:
 *                 return 1, 1
 */
  __pyx_tuple__145 = PyTuple_Pack(3, __pyx_n_s_value, __pyx_n_s_sub_steps, __pyx_n_s_shift_2); if (unlikely(!__pyx_tuple__145)) __PYX_ERR(0, 3251, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__145);
  __Pyx_GIVEREF(__pyx_tuple__145);
  __pyx_codeobj__146 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__145, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_round_step, 3251, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__146)) __PYX_ERR(0, 3251, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":3305
 *         axes = graphics_options.get("System`Axes")
 *         if axes.is_true():
 *             axes = (True, True)             # <<<<<<<<<<<<<<
 *         elif axes.has_form("List", 2):
 *             axes = (axes.leaves[0].is_true(), axes.leaves[1].is_true())
 */
  __pyx_tuple__147 = PyTuple_Pack(2, Py_True, Py_True); if (unlikely(!__pyx_tuple__147)) __PYX_ERR(0, 3305, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__147);
  __Pyx_GIVEREF(__pyx_tuple__147);

  /* "mathics/builtin/graphics.py":3309
 *             axes = (axes.leaves[0].is_true(), axes.leaves[1].is_true())
 *         else:
 *             axes = (False, False)             # <<<<<<<<<<<<<<
 *         ticks_style = graphics_options.get("System`TicksStyle")
 *         axes_style = graphics_options.get("System`AxesStyle")
 */
  __pyx_tuple__148 = PyTuple_Pack(2, Py_False, Py_False); if (unlikely(!__pyx_tuple__148)) __PYX_ERR(0, 3309, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__148);
  __Pyx_GIVEREF(__pyx_tuple__148);

  /* "mathics/builtin/graphics.py":3328
 *         ticks_style[1].extend(axes_style[1])
 * 
 *         def add_element(element):             # <<<<<<<<<<<<<<
 *             element.is_completely_visible = True
 *             elements.elements.append(element)
 */
  __pyx_tuple__149 = PyTuple_Pack(1, __pyx_n_s_element); if (unlikely(!__pyx_tuple__149)) __PYX_ERR(0, 3328, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__149);
  __Pyx_GIVEREF(__pyx_tuple__149);
  __pyx_codeobj__150 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__149, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_add_element, 3328, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__150)) __PYX_ERR(0, 3328, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":59
 * 
 * 
 * def get_class(name):             # <<<<<<<<<<<<<<
 *     from mathics.builtin.graphics3d import GLOBALS3D
 * 
 */
  __pyx_tuple__152 = PyTuple_Pack(3, __pyx_n_s_name, __pyx_n_s_GLOBALS3D, __pyx_n_s_c); if (unlikely(!__pyx_tuple__152)) __PYX_ERR(0, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__152);
  __Pyx_GIVEREF(__pyx_tuple__152);
  __pyx_codeobj__153 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__152, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_get_class, 59, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__153)) __PYX_ERR(0, 59, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":72
 * 
 * 
 * def coords(value):             # <<<<<<<<<<<<<<
 *     if value.has_form("List", 2):
 *         x, y = value.leaves[0].round_to_float(), value.leaves[1].round_to_float()
 */
  __pyx_tuple__154 = PyTuple_Pack(3, __pyx_n_s_value, __pyx_n_s_x, __pyx_n_s_y); if (unlikely(!__pyx_tuple__154)) __PYX_ERR(0, 72, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__154);
  __Pyx_GIVEREF(__pyx_tuple__154);
  __pyx_codeobj__155 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__154, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_coords, 72, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__155)) __PYX_ERR(0, 72, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":81
 * 
 * 
 * class Coords(object):             # <<<<<<<<<<<<<<
 *     def __init__(self, graphics, expr=None, pos=None, d=None):
 *         self.graphics = graphics
 */
  __pyx_tuple__156 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__156)) __PYX_ERR(0, 81, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__156);
  __Pyx_GIVEREF(__pyx_tuple__156);

  /* "mathics/builtin/graphics.py":82
 * 
 * class Coords(object):
 *     def __init__(self, graphics, expr=None, pos=None, d=None):             # <<<<<<<<<<<<<<
 *         self.graphics = graphics
 *         self.p = pos
 */
  __pyx_tuple__157 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_graphics, __pyx_n_s_expr, __pyx_n_s_pos, __pyx_n_s_d); if (unlikely(!__pyx_tuple__157)) __PYX_ERR(0, 82, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__157);
  __Pyx_GIVEREF(__pyx_tuple__157);
  __pyx_codeobj__158 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__157, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_init_2, 82, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__158)) __PYX_ERR(0, 82, __pyx_L1_error)
  __pyx_tuple__159 = PyTuple_Pack(3, ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__159)) __PYX_ERR(0, 82, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__159);
  __Pyx_GIVEREF(__pyx_tuple__159);

  /* "mathics/builtin/graphics.py":96
 *                 self.p = coords(expr)
 * 
 *     def pos(self):             # <<<<<<<<<<<<<<
 *         p = self.graphics.translate(self.p)
 *         p = (cut(p[0]), cut(p[1]))
 */
  __pyx_tuple__160 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_p, __pyx_n_s_d); if (unlikely(!__pyx_tuple__160)) __PYX_ERR(0, 96, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__160);
  __Pyx_GIVEREF(__pyx_tuple__160);
  __pyx_codeobj__161 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__160, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_pos, 96, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__161)) __PYX_ERR(0, 96, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":104
 *         return p
 * 
 *     def add(self, x, y):             # <<<<<<<<<<<<<<
 *         p = (self.p[0] + x, self.p[1] + y)
 *         return Coords(self.graphics, pos=p, d=self.d)
 */
  __pyx_tuple__162 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_p); if (unlikely(!__pyx_tuple__162)) __PYX_ERR(0, 104, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__162);
  __Pyx_GIVEREF(__pyx_tuple__162);
  __pyx_codeobj__163 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__162, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_add, 104, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__163)) __PYX_ERR(0, 104, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":109
 * 
 * 
 * def cut(value):             # <<<<<<<<<<<<<<
 *     "Cut values in graphics primitives (not displayed otherwise in SVG)"
 *     border = 10 ** 8
 */
  __pyx_tuple__164 = PyTuple_Pack(2, __pyx_n_s_value, __pyx_n_s_border); if (unlikely(!__pyx_tuple__164)) __PYX_ERR(0, 109, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__164);
  __Pyx_GIVEREF(__pyx_tuple__164);
  __pyx_codeobj__165 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__164, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_cut, 109, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__165)) __PYX_ERR(0, 109, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":119
 * 
 * 
 * def create_css(edge_color=None, face_color=None, stroke_width=None, font_color=None):             # <<<<<<<<<<<<<<
 *     css = []
 *     if edge_color is not None:
 */
  __pyx_tuple__166 = PyTuple_Pack(7, __pyx_n_s_edge_color, __pyx_n_s_face_color, __pyx_n_s_stroke_width, __pyx_n_s_font_color, __pyx_n_s_css, __pyx_n_s_color, __pyx_n_s_opacity); if (unlikely(!__pyx_tuple__166)) __PYX_ERR(0, 119, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__166);
  __Pyx_GIVEREF(__pyx_tuple__166);
  __pyx_codeobj__167 = (PyObject*)__Pyx_PyCode_New(4, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__166, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_create_css, 119, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__167)) __PYX_ERR(0, 119, __pyx_L1_error)
  __pyx_tuple__168 = PyTuple_Pack(4, ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__168)) __PYX_ERR(0, 119, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__168);
  __Pyx_GIVEREF(__pyx_tuple__168);

  /* "mathics/builtin/graphics.py":141
 * 
 * 
 * def asy_number(value):             # <<<<<<<<<<<<<<
 *     return "%.5g" % value
 * 
 */
  __pyx_tuple__169 = PyTuple_Pack(1, __pyx_n_s_value); if (unlikely(!__pyx_tuple__169)) __PYX_ERR(0, 141, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__169);
  __Pyx_GIVEREF(__pyx_tuple__169);
  __pyx_codeobj__170 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__169, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_asy_number, 141, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__170)) __PYX_ERR(0, 141, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":145
 * 
 * 
 * def _to_float(x):             # <<<<<<<<<<<<<<
 *     x = x.round_to_float()
 *     if x is None:
 */
  __pyx_tuple__171 = PyTuple_Pack(1, __pyx_n_s_x); if (unlikely(!__pyx_tuple__171)) __PYX_ERR(0, 145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__171);
  __Pyx_GIVEREF(__pyx_tuple__171);
  __pyx_codeobj__172 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__171, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_to_float, 145, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__172)) __PYX_ERR(0, 145, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":152
 * 
 * 
 * def create_pens(             # <<<<<<<<<<<<<<
 *     edge_color=None, face_color=None, stroke_width=None, is_face_element=False
 * ):
 */
  __pyx_tuple__173 = PyTuple_Pack(8, __pyx_n_s_edge_color, __pyx_n_s_face_color, __pyx_n_s_stroke_width, __pyx_n_s_is_face_element, __pyx_n_s_result, __pyx_n_s_brush, __pyx_n_s_opacity, __pyx_n_s_pen); if (unlikely(!__pyx_tuple__173)) __PYX_ERR(0, 152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__173);
  __Pyx_GIVEREF(__pyx_tuple__173);
  __pyx_codeobj__174 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__173, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_create_pens, 152, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__174)) __PYX_ERR(0, 152, __pyx_L1_error)
  __pyx_tuple__175 = PyTuple_Pack(4, ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__175)) __PYX_ERR(0, 152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__175);
  __Pyx_GIVEREF(__pyx_tuple__175);

  /* "mathics/builtin/graphics.py":175
 * 
 * 
 * def _data_and_options(leaves, defined_options):             # <<<<<<<<<<<<<<
 *     data = []
 *     options = defined_options.copy()
 */
  __pyx_tuple__176 = PyTuple_Pack(9, __pyx_n_s_leaves, __pyx_n_s_defined_options, __pyx_n_s_data, __pyx_n_s_options, __pyx_n_s_leaf, __pyx_n_s_name, __pyx_n_s_value, __pyx_n_s_name_head, __pyx_n_s_py_name); if (unlikely(!__pyx_tuple__176)) __PYX_ERR(0, 175, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__176);
  __Pyx_GIVEREF(__pyx_tuple__176);
  __pyx_codeobj__177 = (PyObject*)__Pyx_PyCode_New(2, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__176, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_data_and_options, 175, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__177)) __PYX_ERR(0, 175, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":196
 * 
 * 
 * def _euclidean_distance(a, b):             # <<<<<<<<<<<<<<
 *     return sqrt(sum((x1 - x2) * (x1 - x2) for x1, x2 in zip(a, b)))
 * 
 */
  __pyx_tuple__178 = PyTuple_Pack(4, __pyx_n_s_a, __pyx_n_s_b, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__178)) __PYX_ERR(0, 196, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__178);
  __Pyx_GIVEREF(__pyx_tuple__178);
  __pyx_codeobj__179 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__178, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_euclidean_distance, 196, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__179)) __PYX_ERR(0, 196, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":200
 * 
 * 
 * def _component_distance(a, b, i):             # <<<<<<<<<<<<<<
 *     return abs(a[i] - b[i])
 * 
 */
  __pyx_tuple__180 = PyTuple_Pack(3, __pyx_n_s_a, __pyx_n_s_b, __pyx_n_s_i); if (unlikely(!__pyx_tuple__180)) __PYX_ERR(0, 200, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__180);
  __Pyx_GIVEREF(__pyx_tuple__180);
  __pyx_codeobj__181 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__180, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_component_distance, 200, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__181)) __PYX_ERR(0, 200, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":204
 * 
 * 
 * def _cie2000_distance(lab1, lab2):             # <<<<<<<<<<<<<<
 *     # reference: https://en.wikipedia.org/wiki/Color_difference#CIEDE2000
 *     e = machine_epsilon
 */
  __pyx_tuple__182 = PyTuple_Pack(28, __pyx_n_s_lab1, __pyx_n_s_lab2, __pyx_n_s_e, __pyx_n_s_kL, __pyx_n_s_kC, __pyx_n_s_kH, __pyx_n_s_L1, __pyx_n_s_L2, __pyx_n_s_a1, __pyx_n_s_a2, __pyx_n_s_b1, __pyx_n_s_b2, __pyx_n_s_dL, __pyx_n_s_Lm, __pyx_n_s_C1, __pyx_n_s_C2, __pyx_n_s_Cm, __pyx_n_s_dC, __pyx_n_s_h1, __pyx_n_s_h2, __pyx_n_s_dh, __pyx_n_s_dH, __pyx_n_s_Hm, __pyx_n_s_T, __pyx_n_s_SL, __pyx_n_s_SC, __pyx_n_s_SH, __pyx_n_s_rT); if (unlikely(!__pyx_tuple__182)) __PYX_ERR(0, 204, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__182);
  __Pyx_GIVEREF(__pyx_tuple__182);
  __pyx_codeobj__183 = (PyObject*)__Pyx_PyCode_New(2, 0, 28, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__182, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_cie2000_distance, 204, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__183)) __PYX_ERR(0, 204, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":264
 * 
 * 
 * def _CMC_distance(lab1, lab2, l, c):             # <<<<<<<<<<<<<<
 *     # reference https://en.wikipedia.org/wiki/Color_difference#CMC_l:c_.281984.29
 *     L1, L2 = lab1[0], lab2[0]
 */
  __pyx_tuple__184 = PyTuple_Pack(24, __pyx_n_s_lab1, __pyx_n_s_lab2, __pyx_n_s_l, __pyx_n_s_c, __pyx_n_s_L1, __pyx_n_s_L2, __pyx_n_s_a1, __pyx_n_s_a2, __pyx_n_s_b1, __pyx_n_s_b2, __pyx_n_s_dL, __pyx_n_s_da, __pyx_n_s_db, __pyx_n_s_e, __pyx_n_s_C1, __pyx_n_s_C2, __pyx_n_s_h1, __pyx_n_s_dC, __pyx_n_s_dH2, __pyx_n_s_F, __pyx_n_s_T, __pyx_n_s_SL, __pyx_n_s_SC, __pyx_n_s_SH); if (unlikely(!__pyx_tuple__184)) __PYX_ERR(0, 264, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__184);
  __Pyx_GIVEREF(__pyx_tuple__184);
  __pyx_codeobj__185 = (PyObject*)__Pyx_PyCode_New(4, 0, 24, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__184, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_CMC_distance, 264, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__185)) __PYX_ERR(0, 264, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":292
 * 
 * 
 * def _extract_graphics(graphics, format, evaluation):             # <<<<<<<<<<<<<<
 *     graphics_box = Expression("MakeBoxes", graphics).evaluate(evaluation)
 *     builtin = GraphicsBox(expression=False)
 */
  __pyx_tuple__187 = PyTuple_Pack(21, __pyx_n_s_graphics, __pyx_n_s_format, __pyx_n_s_evaluation, __pyx_n_s_graphics_box, __pyx_n_s_builtin, __pyx_n_s_elements, __pyx_n_s_calc_dimensions, __pyx_n_s_xmin, __pyx_n_s_xmax, __pyx_n_s_ymin, __pyx_n_s_ymax, __pyx_n_s__186, __pyx_n_s_ex, __pyx_n_s_ey, __pyx_n_s_sx, __pyx_n_s_sy, __pyx_n_s_ox, __pyx_n_s_oy, __pyx_n_s_code, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__187)) __PYX_ERR(0, 292, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__187);
  __Pyx_GIVEREF(__pyx_tuple__187);
  __pyx_codeobj__188 = (PyObject*)__Pyx_PyCode_New(3, 0, 21, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__187, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_extract_graphics, 292, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__188)) __PYX_ERR(0, 292, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":329
 * 
 * class _SVGTransform:
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         self.transforms = []
 * 
 */
  __pyx_tuple__189 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__189)) __PYX_ERR(0, 329, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__189);
  __Pyx_GIVEREF(__pyx_tuple__189);
  __pyx_codeobj__190 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__189, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_init_2, 329, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__190)) __PYX_ERR(0, 329, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":332
 *         self.transforms = []
 * 
 *     def matrix(self, a, b, c, d, e, f):             # <<<<<<<<<<<<<<
 *         # a c e
 *         # b d f
 */
  __pyx_tuple__191 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_a, __pyx_n_s_b, __pyx_n_s_c, __pyx_n_s_d, __pyx_n_s_e, __pyx_n_s_f); if (unlikely(!__pyx_tuple__191)) __PYX_ERR(0, 332, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__191);
  __Pyx_GIVEREF(__pyx_tuple__191);
  __pyx_codeobj__192 = (PyObject*)__Pyx_PyCode_New(7, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__191, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_matrix_2, 332, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__192)) __PYX_ERR(0, 332, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":338
 *         self.transforms.append("matrix(%f, %f, %f, %f, %f, %f)" % (a, b, c, d, e, f))
 * 
 *     def translate(self, x, y):             # <<<<<<<<<<<<<<
 *         self.transforms.append("translate(%f, %f)" % (x, y))
 * 
 */
  __pyx_tuple__193 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_x, __pyx_n_s_y); if (unlikely(!__pyx_tuple__193)) __PYX_ERR(0, 338, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__193);
  __Pyx_GIVEREF(__pyx_tuple__193);
  __pyx_codeobj__194 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__193, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_translate, 338, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__194)) __PYX_ERR(0, 338, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":341
 *         self.transforms.append("translate(%f, %f)" % (x, y))
 * 
 *     def scale(self, x, y):             # <<<<<<<<<<<<<<
 *         self.transforms.append("scale(%f, %f)" % (x, y))
 * 
 */
  __pyx_tuple__195 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_x, __pyx_n_s_y); if (unlikely(!__pyx_tuple__195)) __PYX_ERR(0, 341, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__195);
  __Pyx_GIVEREF(__pyx_tuple__195);
  __pyx_codeobj__196 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__195, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_scale_2, 341, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__196)) __PYX_ERR(0, 341, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":344
 *         self.transforms.append("scale(%f, %f)" % (x, y))
 * 
 *     def rotate(self, x):             # <<<<<<<<<<<<<<
 *         self.transforms.append("rotate(%f)" % x)
 * 
 */
  __pyx_tuple__197 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_x); if (unlikely(!__pyx_tuple__197)) __PYX_ERR(0, 344, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__197);
  __Pyx_GIVEREF(__pyx_tuple__197);
  __pyx_codeobj__198 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__197, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_rotate, 344, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__198)) __PYX_ERR(0, 344, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":347
 *         self.transforms.append("rotate(%f)" % x)
 * 
 *     def apply(self, svg):             # <<<<<<<<<<<<<<
 *         return '<g transform="%s">%s</g>' % (" ".join(self.transforms), svg)
 * 
 */
  __pyx_tuple__199 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_svg); if (unlikely(!__pyx_tuple__199)) __PYX_ERR(0, 347, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__199);
  __Pyx_GIVEREF(__pyx_tuple__199);
  __pyx_codeobj__200 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__199, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_apply, 347, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__200)) __PYX_ERR(0, 347, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":363
 *     """
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         self.transforms = []
 * 
 */
  __pyx_tuple__201 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__201)) __PYX_ERR(0, 363, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__201);
  __Pyx_GIVEREF(__pyx_tuple__201);
  __pyx_codeobj__202 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__201, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_init_2, 363, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__202)) __PYX_ERR(0, 363, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":366
 *         self.transforms = []
 * 
 *     def matrix(self, a, b, c, d, e, f):             # <<<<<<<<<<<<<<
 *         # a c e
 *         # b d f
 */
  __pyx_tuple__203 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_a, __pyx_n_s_b, __pyx_n_s_c, __pyx_n_s_d, __pyx_n_s_e, __pyx_n_s_f); if (unlikely(!__pyx_tuple__203)) __PYX_ERR(0, 366, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__203);
  __Pyx_GIVEREF(__pyx_tuple__203);
  __pyx_codeobj__204 = (PyObject*)__Pyx_PyCode_New(7, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__203, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_matrix_2, 366, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__204)) __PYX_ERR(0, 366, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":373
 *         self.transforms.append("(%f, %f, %f, %f, %f, %f)" % (e, f, a, c, b, d))
 * 
 *     def translate(self, x, y):             # <<<<<<<<<<<<<<
 *         self.transforms.append("shift(%f, %f)" % (x, y))
 * 
 */
  __pyx_tuple__205 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_x, __pyx_n_s_y); if (unlikely(!__pyx_tuple__205)) __PYX_ERR(0, 373, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__205);
  __Pyx_GIVEREF(__pyx_tuple__205);
  __pyx_codeobj__206 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__205, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_translate, 373, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__206)) __PYX_ERR(0, 373, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":376
 *         self.transforms.append("shift(%f, %f)" % (x, y))
 * 
 *     def scale(self, x, y):             # <<<<<<<<<<<<<<
 *         self.transforms.append("scale(%f, %f)" % (x, y))
 * 
 */
  __pyx_tuple__207 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_x, __pyx_n_s_y); if (unlikely(!__pyx_tuple__207)) __PYX_ERR(0, 376, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__207);
  __Pyx_GIVEREF(__pyx_tuple__207);
  __pyx_codeobj__208 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__207, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_scale_2, 376, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__208)) __PYX_ERR(0, 376, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":379
 *         self.transforms.append("scale(%f, %f)" % (x, y))
 * 
 *     def rotate(self, x):             # <<<<<<<<<<<<<<
 *         self.transforms.append("rotate(%f)" % x)
 * 
 */
  __pyx_tuple__209 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_x); if (unlikely(!__pyx_tuple__209)) __PYX_ERR(0, 379, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__209);
  __Pyx_GIVEREF(__pyx_tuple__209);
  __pyx_codeobj__210 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__209, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_rotate, 379, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__210)) __PYX_ERR(0, 379, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":382
 *         self.transforms.append("rotate(%f)" % x)
 * 
 *     def apply(self, asy):             # <<<<<<<<<<<<<<
 *         return self._template % (" * ".join(self.transforms), asy)
 * 
 */
  __pyx_tuple__211 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_asy); if (unlikely(!__pyx_tuple__211)) __PYX_ERR(0, 382, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__211);
  __Pyx_GIVEREF(__pyx_tuple__211);
  __pyx_codeobj__212 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__211, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_apply, 382, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__212)) __PYX_ERR(0, 382, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":396
 *     options = GRAPHICS_OPTIONS
 * 
 *     def apply(self, graphics, evaluation, options):             # <<<<<<<<<<<<<<
 *         """Show[graphics_, OptionsPattern[%(name)s]]"""
 * 
 */
  __pyx_tuple__213 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_graphics, __pyx_n_s_evaluation, __pyx_n_s_options, __pyx_n_s_option, __pyx_n_s_new_leaves, __pyx_n_s_options_set, __pyx_n_s_leaf, __pyx_n_s_new_leaf, __pyx_n_s_leaf_name); if (unlikely(!__pyx_tuple__213)) __PYX_ERR(0, 396, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__213);
  __Pyx_GIVEREF(__pyx_tuple__213);
  __pyx_codeobj__214 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__213, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_apply, 396, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__214)) __PYX_ERR(0, 396, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":470
 *     box_suffix = "Box"
 * 
 *     def apply_makeboxes(self, content, evaluation, options):             # <<<<<<<<<<<<<<
 *         """MakeBoxes[%(name)s[content_, OptionsPattern[%(name)s]],
 *         StandardForm|TraditionalForm|OutputForm]"""
 */
  __pyx_tuple__215 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_content, __pyx_n_s_evaluation, __pyx_n_s_options, __pyx_n_s_convert, __pyx_n_s_convert, __pyx_n_s_option, __pyx_n_s_box_name); if (unlikely(!__pyx_tuple__215)) __PYX_ERR(0, 470, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__215);
  __Pyx_GIVEREF(__pyx_tuple__215);
  __pyx_codeobj__216 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__215, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_apply_makeboxes, 470, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__216)) __PYX_ERR(0, 470, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":516
 * 
 * class _GraphicsElement(InstancableBuiltin):
 *     def init(self, graphics, item=None, style=None):             # <<<<<<<<<<<<<<
 *         if item is not None and not item.has_form(self.get_name(), None):
 *             raise BoxConstructError
 */
  __pyx_tuple__217 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_graphics, __pyx_n_s_item, __pyx_n_s_style); if (unlikely(!__pyx_tuple__217)) __PYX_ERR(0, 516, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__217);
  __Pyx_GIVEREF(__pyx_tuple__217);
  __pyx_codeobj__218 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__217, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_init, 516, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__218)) __PYX_ERR(0, 516, __pyx_L1_error)
  __pyx_tuple__219 = PyTuple_Pack(2, ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__219)) __PYX_ERR(0, 516, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__219);
  __Pyx_GIVEREF(__pyx_tuple__219);

  /* "mathics/builtin/graphics.py":524
 * 
 *     @staticmethod
 *     def create_as_style(klass, graphics, item):             # <<<<<<<<<<<<<<
 *         return klass(graphics, item)
 * 
 */
  __pyx_tuple__220 = PyTuple_Pack(3, __pyx_n_s_klass, __pyx_n_s_graphics, __pyx_n_s_item); if (unlikely(!__pyx_tuple__220)) __PYX_ERR(0, 524, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__220);
  __Pyx_GIVEREF(__pyx_tuple__220);
  __pyx_codeobj__221 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__220, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_create_as_style, 524, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__221)) __PYX_ERR(0, 524, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":534
 *         # way in the notebook, so we restrict the rule to StandardForm.
 *         (
 *             ("StandardForm",),             # <<<<<<<<<<<<<<
 *             "%(name)s[x__?(NumericQ[#] && 0 <= # <= 1&)]",
 *         ): "Style[Graphics[{EdgeForm[Black], %(name)s[x], Rectangle[]}, ImageSize -> 16], "
 */
  __pyx_tuple__222 = PyTuple_Pack(1, __pyx_n_u_StandardForm); if (unlikely(!__pyx_tuple__222)) __PYX_ERR(0, 534, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__222);
  __Pyx_GIVEREF(__pyx_tuple__222);
  __pyx_tuple__223 = PyTuple_Pack(2, __pyx_tuple__222, __pyx_kp_u_name_s_x___NumericQ_0_1); if (unlikely(!__pyx_tuple__223)) __PYX_ERR(0, 534, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__223);
  __Pyx_GIVEREF(__pyx_tuple__223);

  /* "mathics/builtin/graphics.py":547
 *     default_components = []
 * 
 *     def init(self, item=None, components=None):             # <<<<<<<<<<<<<<
 *         super(_Color, self).init(None, item)
 *         if item is not None:
 */
  __pyx_tuple__224 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_item, __pyx_n_s_components, __pyx_n_s_leaves, __pyx_n_s_value); if (unlikely(!__pyx_tuple__224)) __PYX_ERR(0, 547, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__224);
  __Pyx_GIVEREF(__pyx_tuple__224);
  __pyx_codeobj__225 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__224, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_init, 547, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__225)) __PYX_ERR(0, 547, __pyx_L1_error)
  __pyx_tuple__226 = PyTuple_Pack(2, ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__226)) __PYX_ERR(0, 547, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__226);
  __Pyx_GIVEREF(__pyx_tuple__226);

  /* "mathics/builtin/graphics.py":575
 * 
 *     @staticmethod
 *     def create(expr):             # <<<<<<<<<<<<<<
 *         head = expr.get_head_name()
 *         cls = get_class(head)
 */
  __pyx_tuple__227 = PyTuple_Pack(3, __pyx_n_s_expr, __pyx_n_s_head, __pyx_n_s_cls); if (unlikely(!__pyx_tuple__227)) __PYX_ERR(0, 575, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__227);
  __Pyx_GIVEREF(__pyx_tuple__227);
  __pyx_codeobj__228 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__227, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_create, 575, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__228)) __PYX_ERR(0, 575, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":583
 * 
 *     @staticmethod
 *     def create_as_style(klass, graphics, item):             # <<<<<<<<<<<<<<
 *         return klass(item)
 * 
 */
  __pyx_tuple__229 = PyTuple_Pack(3, __pyx_n_s_klass, __pyx_n_s_graphics, __pyx_n_s_item); if (unlikely(!__pyx_tuple__229)) __PYX_ERR(0, 583, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__229);
  __Pyx_GIVEREF(__pyx_tuple__229);
  __pyx_codeobj__230 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__229, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_create_as_style, 583, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__230)) __PYX_ERR(0, 583, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":586
 *         return klass(item)
 * 
 *     def to_css(self):             # <<<<<<<<<<<<<<
 *         rgba = self.to_rgba()
 *         alpha = rgba[3] if len(rgba) > 3 else 1.0
 */
  __pyx_tuple__231 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_rgba, __pyx_n_s_alpha); if (unlikely(!__pyx_tuple__231)) __PYX_ERR(0, 586, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__231);
  __Pyx_GIVEREF(__pyx_tuple__231);
  __pyx_codeobj__232 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__231, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_to_css, 586, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__232)) __PYX_ERR(0, 586, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":594
 *         )
 * 
 *     def to_asy(self):             # <<<<<<<<<<<<<<
 *         rgba = self.to_rgba()
 *         alpha = rgba[3] if len(rgba) > 3 else 1.0
 */
  __pyx_tuple__233 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_rgba, __pyx_n_s_alpha); if (unlikely(!__pyx_tuple__233)) __PYX_ERR(0, 594, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__233);
  __Pyx_GIVEREF(__pyx_tuple__233);
  __pyx_codeobj__234 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__233, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_to_asy, 594, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__234)) __PYX_ERR(0, 594, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":603
 *         )
 * 
 *     def to_js(self):             # <<<<<<<<<<<<<<
 *         return self.to_rgba()
 * 
 */
  __pyx_tuple__235 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__235)) __PYX_ERR(0, 603, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__235);
  __Pyx_GIVEREF(__pyx_tuple__235);
  __pyx_codeobj__236 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__235, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_to_js, 603, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__236)) __PYX_ERR(0, 603, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":606
 *         return self.to_rgba()
 * 
 *     def to_expr(self):             # <<<<<<<<<<<<<<
 *         return Expression(self.get_name(), *self.components)
 * 
 */
  __pyx_tuple__237 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__237)) __PYX_ERR(0, 606, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__237);
  __Pyx_GIVEREF(__pyx_tuple__237);
  __pyx_codeobj__238 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__237, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_to_expr, 606, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__238)) __PYX_ERR(0, 606, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":609
 *         return Expression(self.get_name(), *self.components)
 * 
 *     def to_rgba(self):             # <<<<<<<<<<<<<<
 *         return self.to_color_space("RGB")
 * 
 */
  __pyx_tuple__239 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__239)) __PYX_ERR(0, 609, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__239);
  __Pyx_GIVEREF(__pyx_tuple__239);
  __pyx_codeobj__240 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__239, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_to_rgba, 609, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__240)) __PYX_ERR(0, 609, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":612
 *         return self.to_color_space("RGB")
 * 
 *     def to_color_space(self, color_space):             # <<<<<<<<<<<<<<
 *         components = convert_color(self.components, self.color_space, color_space)
 *         if components is None:
 */
  __pyx_tuple__241 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_color_space, __pyx_n_s_components); if (unlikely(!__pyx_tuple__241)) __PYX_ERR(0, 612, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__241);
  __Pyx_GIVEREF(__pyx_tuple__241);
  __pyx_codeobj__242 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__241, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_to_color_space, 612, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__242)) __PYX_ERR(0, 612, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":644
 *     default_components = [0, 0, 0, 1]
 * 
 *     def to_rgba(self):             # <<<<<<<<<<<<<<
 *         return self.components
 * 
 */
  __pyx_tuple__243 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__243)) __PYX_ERR(0, 644, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__243);
  __Pyx_GIVEREF(__pyx_tuple__243);
  __pyx_codeobj__244 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__243, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_to_rgba, 644, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__244)) __PYX_ERR(0, 644, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":743
 *     default_components = [0, 1, 1, 1]
 * 
 *     def hsl_to_rgba(self):             # <<<<<<<<<<<<<<
 *         h, s, l = self.components[:3]
 *         if l < 0.5:
 */
  __pyx_tuple__245 = PyTuple_Pack(13, __pyx_n_s_self, __pyx_n_s_h, __pyx_n_s_s, __pyx_n_s_l, __pyx_n_s_q, __pyx_n_s_p, __pyx_n_s_rgb_2, __pyx_n_s_map, __pyx_n_s_map, __pyx_n_s_trans, __pyx_n_s_trans, __pyx_n_s_result, __pyx_n_s_t); if (unlikely(!__pyx_tuple__245)) __PYX_ERR(0, 743, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__245);
  __Pyx_GIVEREF(__pyx_tuple__245);
  __pyx_codeobj__246 = (PyObject*)__Pyx_PyCode_New(1, 0, 13, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__245, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_hsl_to_rgba, 743, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__246)) __PYX_ERR(0, 743, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":790
 * 
 * 
 * def expression_to_color(color):             # <<<<<<<<<<<<<<
 *     try:
 *         return _Color.create(color)
 */
  __pyx_tuple__247 = PyTuple_Pack(1, __pyx_n_s_color); if (unlikely(!__pyx_tuple__247)) __PYX_ERR(0, 790, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__247);
  __Pyx_GIVEREF(__pyx_tuple__247);
  __pyx_codeobj__248 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__247, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_expression_to_color, 790, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__248)) __PYX_ERR(0, 790, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":797
 * 
 * 
 * def color_to_expression(components, colorspace):             # <<<<<<<<<<<<<<
 *     if colorspace == "Grayscale":
 *         converted_color_name = "GrayLevel"
 */
  __pyx_tuple__249 = PyTuple_Pack(3, __pyx_n_s_components, __pyx_n_s_colorspace, __pyx_n_s_converted_color_name); if (unlikely(!__pyx_tuple__249)) __PYX_ERR(0, 797, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__249);
  __Pyx_GIVEREF(__pyx_tuple__249);
  __pyx_codeobj__250 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__249, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_color_to_expression, 797, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__250)) __PYX_ERR(0, 797, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":884
 *     }
 * 
 *     def apply(self, c1, c2, evaluation, options):             # <<<<<<<<<<<<<<
 *         "ColorDistance[c1_, c2_, OptionsPattern[ColorDistance]]"
 * 
 */
  __pyx_tuple__251 = PyTuple_Pack(17, __pyx_n_s_self, __pyx_n_s_c1, __pyx_n_s_c2, __pyx_n_s_evaluation, __pyx_n_s_options, __pyx_n_s_np, __pyx_n_s_distance_function, __pyx_n_s_compute, __pyx_n_s_lightness, __pyx_n_s_chroma, __pyx_n_s_compute, __pyx_n_s_distance, __pyx_n_s_distance, __pyx_n_s_a, __pyx_n_s_b, __pyx_n_s_c, __pyx_n_s_c); if (unlikely(!__pyx_tuple__251)) __PYX_ERR(0, 884, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__251);
  __Pyx_GIVEREF(__pyx_tuple__251);
  __pyx_codeobj__252 = (PyObject*)__Pyx_PyCode_New(5, 0, 17, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__251, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_apply, 884, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__252)) __PYX_ERR(0, 884, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1002
 * 
 * class _Size(_GraphicsElement):
 *     def init(self, graphics, item=None, value=None):             # <<<<<<<<<<<<<<
 *         super(_Size, self).init(graphics, item)
 *         if item is not None:
 */
  __pyx_tuple__253 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_graphics, __pyx_n_s_item, __pyx_n_s_value); if (unlikely(!__pyx_tuple__253)) __PYX_ERR(0, 1002, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__253);
  __Pyx_GIVEREF(__pyx_tuple__253);
  __pyx_codeobj__254 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__253, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_init, 1002, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__254)) __PYX_ERR(0, 1002, __pyx_L1_error)
  __pyx_tuple__255 = PyTuple_Pack(2, ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__255)) __PYX_ERR(0, 1002, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__255);
  __Pyx_GIVEREF(__pyx_tuple__255);

  /* "mathics/builtin/graphics.py":1030
 *     """
 * 
 *     def get_thickness(self):             # <<<<<<<<<<<<<<
 *         return self.graphics.translate_absolute((self.value, 0))[0]
 * 
 */
  __pyx_tuple__256 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__256)) __PYX_ERR(0, 1030, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__256);
  __Pyx_GIVEREF(__pyx_tuple__256);
  __pyx_codeobj__257 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__256, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_get_thickness, 1030, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__257)) __PYX_ERR(0, 1030, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1046
 *     """
 * 
 *     def get_thickness(self):             # <<<<<<<<<<<<<<
 *         return self.graphics.translate_relative(self.value)
 * 
 */
  __pyx_tuple__258 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__258)) __PYX_ERR(0, 1046, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__258);
  __Pyx_GIVEREF(__pyx_tuple__258);
  __pyx_codeobj__259 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__258, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_get_thickness, 1046, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__259)) __PYX_ERR(0, 1046, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1084
 *     """
 * 
 *     def get_size(self):             # <<<<<<<<<<<<<<
 *         return self.graphics.view_width * self.value
 * 
 */
  __pyx_tuple__260 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__260)) __PYX_ERR(0, 1084, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__260);
  __Pyx_GIVEREF(__pyx_tuple__260);
  __pyx_codeobj__261 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__260, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_get_size, 1084, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__261)) __PYX_ERR(0, 1084, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1201
 * 
 * class RectangleBox(_GraphicsElement):
 *     def init(self, graphics, style, item):             # <<<<<<<<<<<<<<
 *         super(RectangleBox, self).init(graphics, item, style)
 *         if len(item.leaves) not in (1, 2):
 */
  __pyx_tuple__262 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_graphics, __pyx_n_s_style, __pyx_n_s_item); if (unlikely(!__pyx_tuple__262)) __PYX_ERR(0, 1201, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__262);
  __Pyx_GIVEREF(__pyx_tuple__262);
  __pyx_codeobj__263 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__262, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_init, 1201, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__263)) __PYX_ERR(0, 1201, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1212
 *             self.p2 = Coords(graphics, item.leaves[1])
 * 
 *     def extent(self):             # <<<<<<<<<<<<<<
 *         l = self.style.get_line_width(face_element=True) / 2
 *         result = []
 */
  __pyx_tuple__264 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_l, __pyx_n_s_result, __pyx_n_s_p, __pyx_n_s_x, __pyx_n_s_y); if (unlikely(!__pyx_tuple__264)) __PYX_ERR(0, 1212, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__264);
  __Pyx_GIVEREF(__pyx_tuple__264);
  __pyx_codeobj__265 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__264, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_extent, 1212, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__265)) __PYX_ERR(0, 1212, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1222
 *         return result
 * 
 *     def to_svg(self):             # <<<<<<<<<<<<<<
 *         l = self.style.get_line_width(face_element=True)
 *         x1, y1 = self.p1.pos()
 */
  __pyx_tuple__266 = PyTuple_Pack(11, __pyx_n_s_self, __pyx_n_s_l, __pyx_n_s_x1, __pyx_n_s_y1, __pyx_n_s_x2, __pyx_n_s_y2, __pyx_n_s_xmin, __pyx_n_s_ymin, __pyx_n_s_w, __pyx_n_s_h, __pyx_n_s_style); if (unlikely(!__pyx_tuple__266)) __PYX_ERR(0, 1222, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__266);
  __Pyx_GIVEREF(__pyx_tuple__266);
  __pyx_codeobj__267 = (PyObject*)__Pyx_PyCode_New(1, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__266, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_to_svg, 1222, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__267)) __PYX_ERR(0, 1222, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1239
 *         )
 * 
 *     def to_asy(self):             # <<<<<<<<<<<<<<
 *         l = self.style.get_line_width(face_element=True)
 *         x1, y1 = self.p1.pos()
 */
  __pyx_tuple__268 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_l, __pyx_n_s_x1, __pyx_n_s_y1, __pyx_n_s_x2, __pyx_n_s_y2, __pyx_n_s_pens); if (unlikely(!__pyx_tuple__268)) __PYX_ERR(0, 1239, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__268);
  __Pyx_GIVEREF(__pyx_tuple__268);
  __pyx_codeobj__269 = (PyObject*)__Pyx_PyCode_New(1, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__268, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_to_asy, 1239, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__269)) __PYX_ERR(0, 1239, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1261
 *     face_element = None
 * 
 *     def init(self, graphics, style, item):             # <<<<<<<<<<<<<<
 *         super(_RoundBox, self).init(graphics, item, style)
 *         if len(item.leaves) not in (1, 2):
 */
  __pyx_tuple__270 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_graphics, __pyx_n_s_style, __pyx_n_s_item, __pyx_n_s_rx_2, __pyx_n_s_ry_2, __pyx_n_s_r); if (unlikely(!__pyx_tuple__270)) __PYX_ERR(0, 1261, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__270);
  __Pyx_GIVEREF(__pyx_tuple__270);
  __pyx_codeobj__271 = (PyObject*)__Pyx_PyCode_New(4, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__270, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_init, 1261, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__271)) __PYX_ERR(0, 1261, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1280
 *         self.r = self.c.add(rx, ry)
 * 
 *     def extent(self):             # <<<<<<<<<<<<<<
 *         l = self.style.get_line_width(face_element=self.face_element) / 2
 *         x, y = self.c.pos()
 */
  __pyx_tuple__272 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_l, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_rx_2, __pyx_n_s_ry_2); if (unlikely(!__pyx_tuple__272)) __PYX_ERR(0, 1280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__272);
  __Pyx_GIVEREF(__pyx_tuple__272);
  __pyx_codeobj__273 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__272, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_extent, 1280, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__273)) __PYX_ERR(0, 1280, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1290
 *         return [(x - rx, y - ry), (x - rx, y + ry), (x + rx, y - ry), (x + rx, y + ry)]
 * 
 *     def to_svg(self):             # <<<<<<<<<<<<<<
 *         x, y = self.c.pos()
 *         rx, ry = self.r.pos()
 */
  __pyx_tuple__274 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_rx_2, __pyx_n_s_ry_2, __pyx_n_s_l, __pyx_n_s_style); if (unlikely(!__pyx_tuple__274)) __PYX_ERR(0, 1290, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__274);
  __Pyx_GIVEREF(__pyx_tuple__274);
  __pyx_codeobj__275 = (PyObject*)__Pyx_PyCode_New(1, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__274, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_to_svg, 1290, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__275)) __PYX_ERR(0, 1290, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1305
 *         )
 * 
 *     def to_asy(self):             # <<<<<<<<<<<<<<
 *         x, y = self.c.pos()
 *         rx, ry = self.r.pos()
 */
  __pyx_tuple__276 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_rx_2, __pyx_n_s_ry_2, __pyx_n_s_l, __pyx_n_s_pen, __pyx_n_s_cmd); if (unlikely(!__pyx_tuple__276)) __PYX_ERR(0, 1305, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__276);
  __Pyx_GIVEREF(__pyx_tuple__276);
  __pyx_codeobj__277 = (PyObject*)__Pyx_PyCode_New(1, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__276, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_to_asy, 1305, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__277)) __PYX_ERR(0, 1305, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1329
 * 
 * class _ArcBox(_RoundBox):
 *     def init(self, graphics, style, item):             # <<<<<<<<<<<<<<
 *         if len(item.leaves) == 3:
 *             arc_expr = item.leaves[2]
 */
  __pyx_tuple__278 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_graphics, __pyx_n_s_style, __pyx_n_s_item, __pyx_n_s_arc_expr, __pyx_n_s_arc, __pyx_n_s_pi2, __pyx_n_s_start_angle, __pyx_n_s_end_angle); if (unlikely(!__pyx_tuple__278)) __PYX_ERR(0, 1329, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__278);
  __Pyx_GIVEREF(__pyx_tuple__278);
  __pyx_codeobj__279 = (PyObject*)__Pyx_PyCode_New(4, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__278, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_init, 1329, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__279)) __PYX_ERR(0, 1329, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1355
 *         super(_ArcBox, self).init(graphics, style, item)
 * 
 *     def _arc_params(self):             # <<<<<<<<<<<<<<
 *         x, y = self.c.pos()
 *         rx, ry = self.r.pos()
 */
  __pyx_tuple__280 = PyTuple_Pack(12, __pyx_n_s_self, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_rx_2, __pyx_n_s_ry_2, __pyx_n_s_start_angle, __pyx_n_s_end_angle, __pyx_n_s_large_arc, __pyx_n_s_sx, __pyx_n_s_sy, __pyx_n_s_ex, __pyx_n_s_ey); if (unlikely(!__pyx_tuple__280)) __PYX_ERR(0, 1355, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__280);
  __Pyx_GIVEREF(__pyx_tuple__280);
  __pyx_codeobj__281 = (PyObject*)__Pyx_PyCode_New(1, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__280, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_arc_params, 1355, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__281)) __PYX_ERR(0, 1355, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1377
 *         return x, y, abs(rx), abs(ry), sx, sy, ex, ey, large_arc
 * 
 *     def to_svg(self):             # <<<<<<<<<<<<<<
 *         if self.arc is None:
 *             return super(_ArcBox, self).to_svg()
 */
  __pyx_tuple__282 = PyTuple_Pack(14, __pyx_n_s_self, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_rx_2, __pyx_n_s_ry_2, __pyx_n_s_sx, __pyx_n_s_sy, __pyx_n_s_ex, __pyx_n_s_ey, __pyx_n_s_large_arc, __pyx_n_s_path, __pyx_n_s_path, __pyx_n_s_l, __pyx_n_s_style); if (unlikely(!__pyx_tuple__282)) __PYX_ERR(0, 1377, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__282);
  __Pyx_GIVEREF(__pyx_tuple__282);
  __pyx_codeobj__283 = (PyObject*)__Pyx_PyCode_New(1, 0, 14, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__282, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_to_svg, 1377, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__283)) __PYX_ERR(0, 1377, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1399
 *         return '<path d="%s" style="%s" />' % (" ".join(path(self.face_element)), style)
 * 
 *     def to_asy(self):             # <<<<<<<<<<<<<<
 *         if self.arc is None:
 *             return super(_ArcBox, self).to_asy()
 */
  __pyx_tuple__284 = PyTuple_Pack(15, __pyx_n_s_self, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_rx_2, __pyx_n_s_ry_2, __pyx_n_s_sx, __pyx_n_s_sy, __pyx_n_s_ex, __pyx_n_s_ey, __pyx_n_s_large_arc, __pyx_n_s_path, __pyx_n_s_path, __pyx_n_s_l, __pyx_n_s_pen, __pyx_n_s_command); if (unlikely(!__pyx_tuple__284)) __PYX_ERR(0, 1399, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__284);
  __Pyx_GIVEREF(__pyx_tuple__284);
  __pyx_codeobj__285 = (PyObject*)__Pyx_PyCode_New(1, 0, 15, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__284, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_to_asy, 1399, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__285)) __PYX_ERR(0, 1399, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1438
 * 
 * class _Polyline(_GraphicsElement):
 *     def do_init(self, graphics, points):             # <<<<<<<<<<<<<<
 *         if not points.has_form("List", None):
 *             raise BoxConstructError
 */
  __pyx_tuple__286 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_graphics, __pyx_n_s_points, __pyx_n_s_leaves, __pyx_n_s_lines, __pyx_n_s_leaf, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_line, __pyx_n_s_point); if (unlikely(!__pyx_tuple__286)) __PYX_ERR(0, 1438, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__286);
  __Pyx_GIVEREF(__pyx_tuple__286);
  __pyx_codeobj__287 = (PyObject*)__Pyx_PyCode_New(3, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__286, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_do_init, 1438, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__287)) __PYX_ERR(0, 1438, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1461
 *         ]
 * 
 *     def extent(self):             # <<<<<<<<<<<<<<
 *         l = self.style.get_line_width(face_element=False)
 *         result = []
 */
  __pyx_tuple__288 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_l, __pyx_n_s_result, __pyx_n_s_line, __pyx_n_s_c, __pyx_n_s_x, __pyx_n_s_y); if (unlikely(!__pyx_tuple__288)) __PYX_ERR(0, 1461, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__288);
  __Pyx_GIVEREF(__pyx_tuple__288);
  __pyx_codeobj__289 = (PyObject*)__Pyx_PyCode_New(1, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__288, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_extent, 1461, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__289)) __PYX_ERR(0, 1461, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1496
 * 
 * class PointBox(_Polyline):
 *     def init(self, graphics, style, item=None):             # <<<<<<<<<<<<<<
 *         super(PointBox, self).init(graphics, item, style)
 *         self.edge_color, self.face_color = style.get_style(_Color, face_element=True)
 */
  __pyx_tuple__290 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_graphics, __pyx_n_s_style, __pyx_n_s_item, __pyx_n_s_points, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__290)) __PYX_ERR(0, 1496, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__290);
  __Pyx_GIVEREF(__pyx_tuple__290);
  __pyx_codeobj__291 = (PyObject*)__Pyx_PyCode_New(4, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__290, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_init, 1496, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__291)) __PYX_ERR(0, 1496, __pyx_L1_error)
  __pyx_tuple__292 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__292)) __PYX_ERR(0, 1496, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__292);
  __Pyx_GIVEREF(__pyx_tuple__292);

  /* "mathics/builtin/graphics.py":1510
 *             raise BoxConstructError
 * 
 *     def to_svg(self):             # <<<<<<<<<<<<<<
 *         point_size, _ = self.style.get_style(PointSize, face_element=False)
 *         if point_size is None:
 */
  __pyx_tuple__293 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_point_size, __pyx_n_s__186, __pyx_n_s_size, __pyx_n_s_style, __pyx_n_s_svg, __pyx_n_s_line, __pyx_n_s_coords); if (unlikely(!__pyx_tuple__293)) __PYX_ERR(0, 1510, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__293);
  __Pyx_GIVEREF(__pyx_tuple__293);
  __pyx_codeobj__294 = (PyObject*)__Pyx_PyCode_New(1, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__293, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_to_svg, 1510, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__294)) __PYX_ERR(0, 1510, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1530
 *         return svg
 * 
 *     def to_asy(self):             # <<<<<<<<<<<<<<
 *         pen = create_pens(face_color=self.face_color, is_face_element=False)
 * 
 */
  __pyx_tuple__295 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_pen, __pyx_n_s_asy, __pyx_n_s_line, __pyx_n_s_coords); if (unlikely(!__pyx_tuple__295)) __PYX_ERR(0, 1530, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__295);
  __Pyx_GIVEREF(__pyx_tuple__295);
  __pyx_codeobj__296 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__295, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_to_asy, 1530, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__296)) __PYX_ERR(0, 1530, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1561
 * 
 * class LineBox(_Polyline):
 *     def init(self, graphics, style, item=None, lines=None):             # <<<<<<<<<<<<<<
 *         super(LineBox, self).init(graphics, item, style)
 *         self.edge_color, _ = style.get_style(_Color, face_element=False)
 */
  __pyx_tuple__297 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_graphics, __pyx_n_s_style, __pyx_n_s_item, __pyx_n_s_lines, __pyx_n_s__186, __pyx_n_s_points); if (unlikely(!__pyx_tuple__297)) __PYX_ERR(0, 1561, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__297);
  __Pyx_GIVEREF(__pyx_tuple__297);
  __pyx_codeobj__298 = (PyObject*)__Pyx_PyCode_New(5, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__297, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_init, 1561, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__298)) __PYX_ERR(0, 1561, __pyx_L1_error)
  __pyx_tuple__299 = PyTuple_Pack(2, ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__299)) __PYX_ERR(0, 1561, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__299);
  __Pyx_GIVEREF(__pyx_tuple__299);

  /* "mathics/builtin/graphics.py":1574
 *             raise BoxConstructError
 * 
 *     def to_svg(self):             # <<<<<<<<<<<<<<
 *         l = self.style.get_line_width(face_element=False)
 *         style = create_css(edge_color=self.edge_color, stroke_width=l)
 */
  __pyx_tuple__300 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_l, __pyx_n_s_style, __pyx_n_s_svg, __pyx_n_s_line, __pyx_n_s_coords); if (unlikely(!__pyx_tuple__300)) __PYX_ERR(0, 1574, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__300);
  __Pyx_GIVEREF(__pyx_tuple__300);
  __pyx_codeobj__301 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__300, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_to_svg, 1574, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__301)) __PYX_ERR(0, 1574, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1585
 *         return svg
 * 
 *     def to_asy(self):             # <<<<<<<<<<<<<<
 *         l = self.style.get_line_width(face_element=False)
 *         pen = create_pens(edge_color=self.edge_color, stroke_width=l)
 */
  __pyx_tuple__302 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_l, __pyx_n_s_pen, __pyx_n_s_asy, __pyx_n_s_line, __pyx_n_s_path, __pyx_n_s_coords); if (unlikely(!__pyx_tuple__302)) __PYX_ERR(0, 1585, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__302);
  __Pyx_GIVEREF(__pyx_tuple__302);
  __pyx_codeobj__303 = (PyObject*)__Pyx_PyCode_New(1, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__302, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_to_asy, 1585, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__303)) __PYX_ERR(0, 1585, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1595
 * 
 * 
 * def _svg_bezier(*segments):             # <<<<<<<<<<<<<<
 *     # see https://www.w3.org/TR/SVG/paths.html#PathDataCubicBezierCommands
 *     # see https://docs.webplatform.org/wiki/svg/tutorials/smarter_svg_shapes
 */
  __pyx_tuple__304 = PyTuple_Pack(7, __pyx_n_s_segments, __pyx_n_s_forms, __pyx_n_s_path, __pyx_n_s_path, __pyx_n_s_k, __pyx_n_s_p, __pyx_n_s_s); if (unlikely(!__pyx_tuple__304)) __PYX_ERR(0, 1595, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__304);
  __Pyx_GIVEREF(__pyx_tuple__304);
  __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__304, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_svg_bezier, 1595, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) __PYX_ERR(0, 1595, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1627
 * 
 * 
 * def _asy_bezier(*segments):             # <<<<<<<<<<<<<<
 *     # see http://asymptote.sourceforge.net/doc/Bezier-curves.html#Bezier-curves
 * 
 */
  __pyx_tuple__305 = PyTuple_Pack(14, __pyx_n_s_segments, __pyx_n_s_cubic, __pyx_n_s_cubic, __pyx_n_s_quadratric, __pyx_n_s_quadratric, __pyx_n_s_linear, __pyx_n_s_linear, __pyx_n_s_forms, __pyx_n_s_path, __pyx_n_s_path, __pyx_n_s_k, __pyx_n_s_p, __pyx_n_s_connect, __pyx_n_s_s); if (unlikely(!__pyx_tuple__305)) __PYX_ERR(0, 1627, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__305);
  __Pyx_GIVEREF(__pyx_tuple__305);
  __pyx_codeobj__47 = (PyObject*)__Pyx_PyCode_New(0, 0, 14, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__305, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_asy_bezier, 1627, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__47)) __PYX_ERR(0, 1627, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1718
 * 
 * class BezierCurveBox(_Polyline):
 *     def init(self, graphics, style, item, options):             # <<<<<<<<<<<<<<
 *         super(BezierCurveBox, self).init(graphics, item, style)
 *         if len(item.leaves) != 1 or item.leaves[0].get_head_name() != "System`List":
 */
  __pyx_tuple__306 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_graphics, __pyx_n_s_style, __pyx_n_s_item, __pyx_n_s_options, __pyx_n_s__186, __pyx_n_s_points, __pyx_n_s_spline_degree); if (unlikely(!__pyx_tuple__306)) __PYX_ERR(0, 1718, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__306);
  __Pyx_GIVEREF(__pyx_tuple__306);
  __pyx_codeobj__307 = (PyObject*)__Pyx_PyCode_New(5, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__306, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_init, 1718, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__307)) __PYX_ERR(0, 1718, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1730
 *         self.spline_degree = spline_degree.get_int_value()
 * 
 *     def to_svg(self):             # <<<<<<<<<<<<<<
 *         l = self.style.get_line_width(face_element=False)
 *         style = create_css(edge_color=self.edge_color, stroke_width=l)
 */
  __pyx_tuple__308 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_l, __pyx_n_s_style, __pyx_n_s_svg, __pyx_n_s_line, __pyx_n_s_s, __pyx_n_s_xy); if (unlikely(!__pyx_tuple__308)) __PYX_ERR(0, 1730, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__308);
  __Pyx_GIVEREF(__pyx_tuple__308);
  __pyx_codeobj__309 = (PyObject*)__Pyx_PyCode_New(1, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__308, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_to_svg, 1730, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__309)) __PYX_ERR(0, 1730, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1740
 *         return svg
 * 
 *     def to_asy(self):             # <<<<<<<<<<<<<<
 *         l = self.style.get_line_width(face_element=False)
 *         pen = create_pens(edge_color=self.edge_color, stroke_width=l)
 */
  __pyx_tuple__310 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_l, __pyx_n_s_pen, __pyx_n_s_asy, __pyx_n_s_line, __pyx_n_s_path, __pyx_n_s_xy); if (unlikely(!__pyx_tuple__310)) __PYX_ERR(0, 1740, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__310);
  __Pyx_GIVEREF(__pyx_tuple__310);
  __pyx_codeobj__311 = (PyObject*)__Pyx_PyCode_New(1, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__310, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_to_asy, 1740, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__311)) __PYX_ERR(0, 1740, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1771
 * 
 * class FilledCurveBox(_GraphicsElement):
 *     def init(self, graphics, style, item=None):             # <<<<<<<<<<<<<<
 *         super(FilledCurveBox, self).init(graphics, item, style)
 *         self.edge_color, self.face_color = style.get_style(_Color, face_element=True)
 */
  __pyx_tuple__312 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_graphics, __pyx_n_s_style, __pyx_n_s_item, __pyx_n_s_leaves, __pyx_n_s_parse_component, __pyx_n_s_parse_component, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_x); if (unlikely(!__pyx_tuple__312)) __PYX_ERR(0, 1771, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__312);
  __Pyx_GIVEREF(__pyx_tuple__312);
  __pyx_codeobj__313 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__312, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_init, 1771, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__313)) __PYX_ERR(0, 1771, __pyx_L1_error)
  __pyx_tuple__314 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__314)) __PYX_ERR(0, 1771, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__314);
  __Pyx_GIVEREF(__pyx_tuple__314);

  /* "mathics/builtin/graphics.py":1817
 *             raise BoxConstructError
 * 
 *     def to_svg(self):             # <<<<<<<<<<<<<<
 *         l = self.style.get_line_width(face_element=False)
 *         style = create_css(
 */
  __pyx_tuple__315 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_l, __pyx_n_s_style, __pyx_n_s_components, __pyx_n_s_components); if (unlikely(!__pyx_tuple__315)) __PYX_ERR(0, 1817, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__315);
  __Pyx_GIVEREF(__pyx_tuple__315);
  __pyx_codeobj__316 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__315, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_to_svg, 1817, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__316)) __PYX_ERR(0, 1817, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1833
 *         )
 * 
 *     def to_asy(self):             # <<<<<<<<<<<<<<
 *         l = self.style.get_line_width(face_element=False)
 *         pen = create_pens(edge_color=self.edge_color, stroke_width=l)
 */
  __pyx_tuple__317 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_l, __pyx_n_s_pen, __pyx_n_s_components, __pyx_n_s_components); if (unlikely(!__pyx_tuple__317)) __PYX_ERR(0, 1833, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__317);
  __Pyx_GIVEREF(__pyx_tuple__317);
  __pyx_codeobj__318 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__317, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_to_asy, 1833, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__318)) __PYX_ERR(0, 1833, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1847
 *         return "".join(components())
 * 
 *     def extent(self):             # <<<<<<<<<<<<<<
 *         l = self.style.get_line_width(face_element=False)
 *         result = []
 */
  __pyx_tuple__319 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_l, __pyx_n_s_result, __pyx_n_s_component, __pyx_n_s__186, __pyx_n_s_points, __pyx_n_s_p, __pyx_n_s_x, __pyx_n_s_y); if (unlikely(!__pyx_tuple__319)) __PYX_ERR(0, 1847, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__319);
  __Pyx_GIVEREF(__pyx_tuple__319);
  __pyx_codeobj__320 = (PyObject*)__Pyx_PyCode_New(1, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__319, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_extent, 1847, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__320)) __PYX_ERR(0, 1847, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1880
 * 
 * class PolygonBox(_Polyline):
 *     def init(self, graphics, style, item=None):             # <<<<<<<<<<<<<<
 *         super(PolygonBox, self).init(graphics, item, style)
 *         self.edge_color, self.face_color = style.get_style(_Color, face_element=True)
 */
  __pyx_tuple__321 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_graphics, __pyx_n_s_style, __pyx_n_s_item, __pyx_n_s_points, __pyx_n_s_leaf, __pyx_n_s_name); if (unlikely(!__pyx_tuple__321)) __PYX_ERR(0, 1880, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__321);
  __Pyx_GIVEREF(__pyx_tuple__321);
  __pyx_codeobj__322 = (PyObject*)__Pyx_PyCode_New(4, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__321, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_init, 1880, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__322)) __PYX_ERR(0, 1880, __pyx_L1_error)
  __pyx_tuple__323 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__323)) __PYX_ERR(0, 1880, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__323);
  __Pyx_GIVEREF(__pyx_tuple__323);

  /* "mathics/builtin/graphics.py":1897
 *             raise BoxConstructError
 * 
 *     def process_option(self, name, value):             # <<<<<<<<<<<<<<
 *         if name == "System`VertexColors":
 *             if not value.has_form("List", None):
 */
  __pyx_tuple__324 = PyTuple_Pack(11, __pyx_n_s_self, __pyx_n_s_name, __pyx_n_s_value, __pyx_n_s_black, __pyx_n_s_colors, __pyx_n_s_line_index, __pyx_n_s_line, __pyx_n_s_line_colors, __pyx_n_s_index, __pyx_n_s_color, __pyx_n_s_line); if (unlikely(!__pyx_tuple__324)) __PYX_ERR(0, 1897, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__324);
  __Pyx_GIVEREF(__pyx_tuple__324);
  __pyx_codeobj__325 = (PyObject*)__Pyx_PyCode_New(3, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__324, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_process_option, 1897, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__325)) __PYX_ERR(0, 1897, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1922
 *             raise BoxConstructError
 * 
 *     def to_svg(self):             # <<<<<<<<<<<<<<
 *         l = self.style.get_line_width(face_element=True)
 *         if self.vertex_colors is None:
 */
  __pyx_tuple__326 = PyTuple_Pack(13, __pyx_n_s_self, __pyx_n_s_l, __pyx_n_s_face_color, __pyx_n_s_style, __pyx_n_s_svg, __pyx_n_s_mesh, __pyx_n_s_index, __pyx_n_s_line, __pyx_n_s_data, __pyx_n_s_coords, __pyx_n_s_color, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__326)) __PYX_ERR(0, 1922, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__326);
  __Pyx_GIVEREF(__pyx_tuple__326);
  __pyx_codeobj__327 = (PyObject*)__Pyx_PyCode_New(1, 0, 13, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__326, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_to_svg, 1922, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__327)) __PYX_ERR(0, 1922, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1948
 *         return svg
 * 
 *     def to_asy(self):             # <<<<<<<<<<<<<<
 *         l = self.style.get_line_width(face_element=True)
 *         if self.vertex_colors is None:
 */
  __pyx_tuple__328 = PyTuple_Pack(14, __pyx_n_s_self, __pyx_n_s_l, __pyx_n_s_face_color, __pyx_n_s_pens, __pyx_n_s_asy, __pyx_n_s_paths, __pyx_n_s_colors, __pyx_n_s_edges, __pyx_n_s_index, __pyx_n_s_line, __pyx_n_s_path, __pyx_n_s_coords, __pyx_n_s_color, __pyx_n_s_coords); if (unlikely(!__pyx_tuple__328)) __PYX_ERR(0, 1948, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__328);
  __Pyx_GIVEREF(__pyx_tuple__328);
  __pyx_codeobj__329 = (PyObject*)__Pyx_PyCode_New(1, 0, 14, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__328, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_to_asy, 1948, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__329)) __PYX_ERR(0, 1948, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2017
 * 
 * class RegularPolygonBox(PolygonBox):
 *     def init(self, graphics, style, item):             # <<<<<<<<<<<<<<
 *         if len(item.leaves) in (1, 2, 3) and isinstance(item.leaves[-1], Integer):
 *             r = 1.0
 */
  __pyx_tuple__330 = PyTuple_Pack(17, __pyx_n_s_self, __pyx_n_s_graphics, __pyx_n_s_style, __pyx_n_s_item, __pyx_n_s_r, __pyx_n_s_phi0, __pyx_n_s_rspec, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_pos, __pyx_n_s_n, __pyx_n_s_pi2, __pyx_n_s_vertices, __pyx_n_s_vertices, __pyx_n_s_new_item, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__330)) __PYX_ERR(0, 2017, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__330);
  __Pyx_GIVEREF(__pyx_tuple__330);
  __pyx_codeobj__331 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__330, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_init, 2017, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__331)) __PYX_ERR(0, 2017, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2137
 *     }
 * 
 *     def init(self, graphics, item=None):             # <<<<<<<<<<<<<<
 *         super(Arrowheads, self).init(graphics, item)
 *         if len(item.leaves) != 1:
 */
  __pyx_tuple__332 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_graphics, __pyx_n_s_item); if (unlikely(!__pyx_tuple__332)) __PYX_ERR(0, 2137, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__332);
  __Pyx_GIVEREF(__pyx_tuple__332);
  __pyx_codeobj__333 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__332, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_init, 2137, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__333)) __PYX_ERR(0, 2137, __pyx_L1_error)
  __pyx_tuple__334 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__334)) __PYX_ERR(0, 2137, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__334);
  __Pyx_GIVEREF(__pyx_tuple__334);

  /* "mathics/builtin/graphics.py":2143
 *         self.spec = item.leaves[0]
 * 
 *     def _arrow_size(self, s, extent):             # <<<<<<<<<<<<<<
 *         if isinstance(s, Symbol):
 *             size = self.symbolic_sizes.get(s.get_name(), 0)
 */
  __pyx_tuple__335 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_s, __pyx_n_s_extent, __pyx_n_s_size); if (unlikely(!__pyx_tuple__335)) __PYX_ERR(0, 2143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__335);
  __Pyx_GIVEREF(__pyx_tuple__335);
  __pyx_codeobj__336 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__335, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_arrow_size, 2143, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__336)) __PYX_ERR(0, 2143, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2150
 *             return _to_float(s) * extent
 * 
 *     def heads(self, extent, default_arrow, custom_arrow):             # <<<<<<<<<<<<<<
 *         # see https://reference.wolfram.com/language/ref/Arrowheads.html
 * 
 */
  __pyx_tuple__337 = PyTuple_Pack(15, __pyx_n_s_self, __pyx_n_s_extent, __pyx_n_s_default_arrow, __pyx_n_s_custom_arrow, __pyx_n_s_leaves, __pyx_n_s_head, __pyx_n_s_spec, __pyx_n_s_size_spec, __pyx_n_s_s, __pyx_n_s_graphics, __pyx_n_s_arrow, __pyx_n_s_n, __pyx_n_s_i, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__337)) __PYX_ERR(0, 2150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__337);
  __Pyx_GIVEREF(__pyx_tuple__337);
  __pyx_codeobj__70 = (PyObject*)__Pyx_PyCode_New(4, 0, 15, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__337, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_heads, 2150, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__70)) __PYX_ERR(0, 2150, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2191
 * 
 * 
 * def _norm(p, q):             # <<<<<<<<<<<<<<
 *     px, py = p
 *     qx, qy = q
 */
  __pyx_tuple__338 = PyTuple_Pack(9, __pyx_n_s_p, __pyx_n_s_q, __pyx_n_s_px, __pyx_n_s_py, __pyx_n_s_qx, __pyx_n_s_qy, __pyx_n_s_dx, __pyx_n_s_dy, __pyx_n_s_length); if (unlikely(!__pyx_tuple__338)) __PYX_ERR(0, 2191, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__338);
  __Pyx_GIVEREF(__pyx_tuple__338);
  __pyx_codeobj__339 = (PyObject*)__Pyx_PyCode_New(2, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__338, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_norm, 2191, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__339)) __PYX_ERR(0, 2191, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2203
 * 
 * class _Line:
 *     def make_draw_svg(self, style):             # <<<<<<<<<<<<<<
 *         def draw(points):
 *             yield '<polyline points="'
 */
  __pyx_tuple__340 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_style, __pyx_n_s_draw, __pyx_n_s_draw); if (unlikely(!__pyx_tuple__340)) __PYX_ERR(0, 2203, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__340);
  __Pyx_GIVEREF(__pyx_tuple__340);
  __pyx_codeobj__341 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__340, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_make_draw_svg, 2203, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__341)) __PYX_ERR(0, 2203, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2211
 *         return draw
 * 
 *     def make_draw_asy(self, pen):             # <<<<<<<<<<<<<<
 *         def draw(points):
 *             yield "draw("
 */
  __pyx_tuple__342 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_pen, __pyx_n_s_draw, __pyx_n_s_draw); if (unlikely(!__pyx_tuple__342)) __PYX_ERR(0, 2211, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__342);
  __Pyx_GIVEREF(__pyx_tuple__342);
  __pyx_codeobj__343 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__342, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_make_draw_asy, 2211, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__343)) __PYX_ERR(0, 2211, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2219
 *         return draw
 * 
 *     def arrows(self, points, heads):  # heads has to be sorted by pos             # <<<<<<<<<<<<<<
 *         def segments(points):
 *             for i in range(len(points) - 1):
 */
  __pyx_tuple__344 = PyTuple_Pack(22, __pyx_n_s_self, __pyx_n_s_points, __pyx_n_s_heads, __pyx_n_s_segments, __pyx_n_s_segments, __pyx_n_s_seg, __pyx_n_s_i, __pyx_n_s_t0, __pyx_n_s_n, __pyx_n_s_dl, __pyx_n_s_px, __pyx_n_s_py, __pyx_n_s_dx, __pyx_n_s_dy, __pyx_n_s_total, __pyx_n_s_s, __pyx_n_s_t, __pyx_n_s_draw, __pyx_n_s_shape, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__344)) __PYX_ERR(0, 2219, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__344);
  __Pyx_GIVEREF(__pyx_tuple__344);
  __pyx_codeobj__75 = (PyObject*)__Pyx_PyCode_New(3, 0, 22, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__344, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_arrows, 2219, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__75)) __PYX_ERR(0, 2219, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2257
 * 
 * 
 * def _bezier_derivative(p):             # <<<<<<<<<<<<<<
 *     # see http://pomax.github.io/bezierinfo/, Section 12 Derivatives
 *     n = len(p[0]) - 1
 */
  __pyx_tuple__345 = PyTuple_Pack(5, __pyx_n_s_p, __pyx_n_s_n, __pyx_n_s_w, __pyx_n_s_x1, __pyx_n_s_x0); if (unlikely(!__pyx_tuple__345)) __PYX_ERR(0, 2257, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__345);
  __Pyx_GIVEREF(__pyx_tuple__345);
  __pyx_codeobj__346 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__345, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_bezier_derivative, 2257, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__346)) __PYX_ERR(0, 2257, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2263
 * 
 * 
 * def _bezier_evaluate(p, t):             # <<<<<<<<<<<<<<
 *     # see http://pomax.github.io/bezierinfo/, Section 4 Controlling Bezier Curvatures
 *     n = len(p[0]) - 1
 */
  __pyx_tuple__347 = PyTuple_Pack(11, __pyx_n_s_p, __pyx_n_s_t, __pyx_n_s_n, __pyx_n_s_t2, __pyx_n_s_t3, __pyx_n_s_mt, __pyx_n_s_mt2, __pyx_n_s_mt3, __pyx_n_s_w, __pyx_n_s_w, __pyx_n_s_w); if (unlikely(!__pyx_tuple__347)) __PYX_ERR(0, 2263, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__347);
  __Pyx_GIVEREF(__pyx_tuple__347);
  __pyx_codeobj__348 = (PyObject*)__Pyx_PyCode_New(2, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__347, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_bezier_evaluate, 2263, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__348)) __PYX_ERR(0, 2263, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2288
 * 
 * class _BezierCurve:
 *     def __init__(self, spline_degree=3):             # <<<<<<<<<<<<<<
 *         self.spline_degree = spline_degree
 * 
 */
  __pyx_tuple__349 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_spline_degree); if (unlikely(!__pyx_tuple__349)) __PYX_ERR(0, 2288, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__349);
  __Pyx_GIVEREF(__pyx_tuple__349);
  __pyx_codeobj__350 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__349, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_init_2, 2288, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__350)) __PYX_ERR(0, 2288, __pyx_L1_error)
  __pyx_tuple__351 = PyTuple_Pack(1, ((PyObject *)__pyx_int_3)); if (unlikely(!__pyx_tuple__351)) __PYX_ERR(0, 2288, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__351);
  __Pyx_GIVEREF(__pyx_tuple__351);

  /* "mathics/builtin/graphics.py":2291
 *         self.spline_degree = spline_degree
 * 
 *     def make_draw_svg(self, style):             # <<<<<<<<<<<<<<
 *         def draw(points):
 *             s = " ".join(_svg_bezier((self.spline_degree, points)))
 */
  __pyx_tuple__352 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_style, __pyx_n_s_draw, __pyx_n_s_draw); if (unlikely(!__pyx_tuple__352)) __PYX_ERR(0, 2291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__352);
  __Pyx_GIVEREF(__pyx_tuple__352);
  __pyx_codeobj__353 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__352, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_make_draw_svg, 2291, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__353)) __PYX_ERR(0, 2291, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2298
 *         return draw
 * 
 *     def make_draw_asy(self, pen):             # <<<<<<<<<<<<<<
 *         def draw(points):
 *             for path in _asy_bezier((self.spline_degree, points)):
 */
  __pyx_tuple__354 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_pen, __pyx_n_s_draw, __pyx_n_s_draw); if (unlikely(!__pyx_tuple__354)) __PYX_ERR(0, 2298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__354);
  __Pyx_GIVEREF(__pyx_tuple__354);
  __pyx_codeobj__355 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__354, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_make_draw_asy, 2298, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__355)) __PYX_ERR(0, 2298, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2305
 *         return draw
 * 
 *     def arrows(self, points, heads):  # heads has to be sorted by pos             # <<<<<<<<<<<<<<
 *         if len(points) < 2:
 *             return
 */
  __pyx_tuple__356 = PyTuple_Pack(14, __pyx_n_s_self, __pyx_n_s_points, __pyx_n_s_heads, __pyx_n_s_cp, __pyx_n_s_dcp, __pyx_n_s_s, __pyx_n_s_t, __pyx_n_s_draw, __pyx_n_s_px, __pyx_n_s_py, __pyx_n_s_tx, __pyx_n_s_ty, __pyx_n_s_tl, __pyx_n_s_shape); if (unlikely(!__pyx_tuple__356)) __PYX_ERR(0, 2305, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__356);
  __Pyx_GIVEREF(__pyx_tuple__356);
  __pyx_codeobj__82 = (PyObject*)__Pyx_PyCode_New(3, 0, 14, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__356, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_arrows, 2305, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__82)) __PYX_ERR(0, 2305, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2333
 * 
 * class ArrowBox(_Polyline):
 *     def init(self, graphics, style, item=None):             # <<<<<<<<<<<<<<
 *         if not item:
 *             raise BoxConstructError
 */
  __pyx_tuple__357 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_graphics, __pyx_n_s_style, __pyx_n_s_item, __pyx_n_s_leaves, __pyx_n_s_setback, __pyx_n_s_curve, __pyx_n_s_curve_head_name, __pyx_n_s_curve_points, __pyx_n_s__186); if (unlikely(!__pyx_tuple__357)) __PYX_ERR(0, 2333, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__357);
  __Pyx_GIVEREF(__pyx_tuple__357);
  __pyx_codeobj__358 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__357, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_init, 2333, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__358)) __PYX_ERR(0, 2333, __pyx_L1_error)
  __pyx_tuple__359 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__359)) __PYX_ERR(0, 2333, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__359);
  __Pyx_GIVEREF(__pyx_tuple__359);

  /* "mathics/builtin/graphics.py":2373
 * 
 *     @staticmethod
 *     def _setback_spec(expr):             # <<<<<<<<<<<<<<
 *         if expr.get_head_name() == "System`List":
 *             leaves = expr.leaves
 */
  __pyx_tuple__360 = PyTuple_Pack(5, __pyx_n_s_expr, __pyx_n_s_leaves, __pyx_n_s_s, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__360)) __PYX_ERR(0, 2373, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__360);
  __Pyx_GIVEREF(__pyx_tuple__360);
  __pyx_codeobj__361 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__360, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_setback_spec, 2373, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__361)) __PYX_ERR(0, 2373, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2384
 * 
 *     @staticmethod
 *     def _default_arrow(polygon):             # <<<<<<<<<<<<<<
 *         # the default arrow drawn by draw() below looks looks like this:
 *         #
 */
  __pyx_tuple__362 = PyTuple_Pack(5, __pyx_n_s_polygon, __pyx_n_s_arrow_spread, __pyx_n_s_arrow_edge, __pyx_n_s_draw, __pyx_n_s_draw); if (unlikely(!__pyx_tuple__362)) __PYX_ERR(0, 2384, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__362);
  __Pyx_GIVEREF(__pyx_tuple__362);
  __pyx_codeobj__363 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__362, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_default_arrow_2, 2384, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__363)) __PYX_ERR(0, 2384, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2430
 *         return draw
 * 
 *     def _draw(self, polyline, default_arrow, custom_arrow, extent):             # <<<<<<<<<<<<<<
 *         if self.heads:
 *             heads = list(self.heads.heads(extent, default_arrow, custom_arrow))
 */
  __pyx_tuple__364 = PyTuple_Pack(16, __pyx_n_s_self, __pyx_n_s_polyline, __pyx_n_s_default_arrow, __pyx_n_s_custom_arrow, __pyx_n_s_extent, __pyx_n_s_heads, __pyx_n_s_setback, __pyx_n_s_setback, __pyx_n_s_shrink_one_end, __pyx_n_s_shrink_one_end, __pyx_n_s_shrink, __pyx_n_s_shrink, __pyx_n_s_line, __pyx_n_s_transformed_points, __pyx_n_s_s, __pyx_n_s_xy); if (unlikely(!__pyx_tuple__364)) __PYX_ERR(0, 2430, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__364);
  __Pyx_GIVEREF(__pyx_tuple__364);
  __pyx_codeobj__86 = (PyObject*)__Pyx_PyCode_New(5, 0, 16, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__364, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_draw_3, 2430, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__86)) __PYX_ERR(0, 2430, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2479
 *                 yield s
 * 
 *     def _custom_arrow(self, format, format_transform):             # <<<<<<<<<<<<<<
 *         def make(graphics):
 *             xmin, xmax, ymin, ymax, ox, oy, ex, ey, code = _extract_graphics(
 */
  __pyx_tuple__365 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_format, __pyx_n_s_format_transform, __pyx_n_s_make, __pyx_n_s_make); if (unlikely(!__pyx_tuple__365)) __PYX_ERR(0, 2479, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__365);
  __Pyx_GIVEREF(__pyx_tuple__365);
  __pyx_codeobj__366 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__365, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_custom_arrow_2, 2479, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__366)) __PYX_ERR(0, 2479, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2503
 *         return make
 * 
 *     def to_svg(self):             # <<<<<<<<<<<<<<
 *         width = self.style.get_line_width(face_element=False)
 *         style = create_css(edge_color=self.edge_color, stroke_width=width)
 */
  __pyx_tuple__367 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_width_2, __pyx_n_s_style, __pyx_n_s_polyline, __pyx_n_s_arrow_style, __pyx_n_s_polygon, __pyx_n_s_polygon, __pyx_n_s_extent, __pyx_n_s_default_arrow, __pyx_n_s_custom_arrow); if (unlikely(!__pyx_tuple__367)) __PYX_ERR(0, 2503, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__367);
  __Pyx_GIVEREF(__pyx_tuple__367);
  __pyx_codeobj__368 = (PyObject*)__Pyx_PyCode_New(1, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__367, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_to_svg, 2503, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__368)) __PYX_ERR(0, 2503, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2520
 *         return "".join(self._draw(polyline, default_arrow, custom_arrow, extent))
 * 
 *     def to_asy(self):             # <<<<<<<<<<<<<<
 *         width = self.style.get_line_width(face_element=False)
 *         pen = create_pens(edge_color=self.edge_color, stroke_width=width)
 */
  __pyx_tuple__369 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_width_2, __pyx_n_s_pen, __pyx_n_s_polyline, __pyx_n_s_arrow_pen, __pyx_n_s_polygon, __pyx_n_s_polygon, __pyx_n_s_extent, __pyx_n_s_default_arrow, __pyx_n_s_custom_arrow); if (unlikely(!__pyx_tuple__369)) __PYX_ERR(0, 2520, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__369);
  __Pyx_GIVEREF(__pyx_tuple__369);
  __pyx_codeobj__370 = (PyObject*)__Pyx_PyCode_New(1, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__369, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_to_asy, 2520, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__370)) __PYX_ERR(0, 2520, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2537
 *         return "".join(self._draw(polyline, default_arrow, custom_arrow, extent))
 * 
 *     def extent(self):             # <<<<<<<<<<<<<<
 *         width = self.style.get_line_width(face_element=False)
 * 
 */
  __pyx_tuple__371 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_width_2, __pyx_n_s_polyline, __pyx_n_s_polyline, __pyx_n_s_polygon, __pyx_n_s_polygon, __pyx_n_s_default_arrow, __pyx_n_s_default_arrow); if (unlikely(!__pyx_tuple__371)) __PYX_ERR(0, 2537, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__371);
  __Pyx_GIVEREF(__pyx_tuple__371);
  __pyx_codeobj__372 = (PyObject*)__Pyx_PyCode_New(1, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__371, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_extent, 2537, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__372)) __PYX_ERR(0, 2537, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2559
 * 
 * class InsetBox(_GraphicsElement):
 *     def init(self, graphics, style, item=None, content=None, pos=None, opos=(0, 0)):             # <<<<<<<<<<<<<<
 *         super(InsetBox, self).init(graphics, item, style)
 * 
 */
  __pyx_tuple__373 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_graphics, __pyx_n_s_style, __pyx_n_s_item, __pyx_n_s_content, __pyx_n_s_pos, __pyx_n_s_opos, __pyx_n_s__186); if (unlikely(!__pyx_tuple__373)) __PYX_ERR(0, 2559, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__373);
  __Pyx_GIVEREF(__pyx_tuple__373);
  __pyx_codeobj__374 = (PyObject*)__Pyx_PyCode_New(7, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__373, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_init, 2559, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__374)) __PYX_ERR(0, 2559, __pyx_L1_error)
  __pyx_tuple__375 = PyTuple_Pack(4, ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject*)__pyx_tuple__83)); if (unlikely(!__pyx_tuple__375)) __PYX_ERR(0, 2559, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__375);
  __Pyx_GIVEREF(__pyx_tuple__375);

  /* "mathics/builtin/graphics.py":2587
 *         )
 * 
 *     def extent(self):             # <<<<<<<<<<<<<<
 *         p = self.pos.pos()
 *         h = 25
 */
  __pyx_tuple__376 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_p, __pyx_n_s_h, __pyx_n_s_w, __pyx_n_s_opos, __pyx_n_s_x, __pyx_n_s_y); if (unlikely(!__pyx_tuple__376)) __PYX_ERR(0, 2587, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__376);
  __Pyx_GIVEREF(__pyx_tuple__376);
  __pyx_codeobj__377 = (PyObject*)__Pyx_PyCode_New(1, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__376, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_extent, 2587, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__377)) __PYX_ERR(0, 2587, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2596
 *         return [(x, y), (x + w, y + h)]
 * 
 *     def to_svg(self):             # <<<<<<<<<<<<<<
 *         x, y = self.pos.pos()
 *         content = self.content.boxes_to_xml(evaluation=self.graphics.evaluation)
 */
  __pyx_tuple__378 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_content, __pyx_n_s_style, __pyx_n_s_svg); if (unlikely(!__pyx_tuple__378)) __PYX_ERR(0, 2596, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__378);
  __Pyx_GIVEREF(__pyx_tuple__378);
  __pyx_codeobj__379 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__378, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_to_svg, 2596, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__379)) __PYX_ERR(0, 2596, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2606
 *         return svg
 * 
 *     def to_asy(self):             # <<<<<<<<<<<<<<
 *         x, y = self.pos.pos()
 *         content = self.content.boxes_to_tex(evaluation=self.graphics.evaluation)
 */
  __pyx_tuple__380 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_content, __pyx_n_s_pen, __pyx_n_s_asy); if (unlikely(!__pyx_tuple__380)) __PYX_ERR(0, 2606, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__380);
  __Pyx_GIVEREF(__pyx_tuple__380);
  __pyx_codeobj__381 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__380, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_to_asy, 2606, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__381)) __PYX_ERR(0, 2606, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2621
 * 
 * 
 * def total_extent(extents):             # <<<<<<<<<<<<<<
 *     xmin = xmax = ymin = ymax = None
 *     for extent in extents:
 */
  __pyx_tuple__382 = PyTuple_Pack(8, __pyx_n_s_extents, __pyx_n_s_xmin, __pyx_n_s_xmax, __pyx_n_s_ymin, __pyx_n_s_ymax, __pyx_n_s_extent, __pyx_n_s_x, __pyx_n_s_y); if (unlikely(!__pyx_tuple__382)) __PYX_ERR(0, 2621, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__382);
  __Pyx_GIVEREF(__pyx_tuple__382);
  __pyx_codeobj__383 = (PyObject*)__Pyx_PyCode_New(1, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__382, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_total_extent, 2621, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__383)) __PYX_ERR(0, 2621, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2652
 * 
 * 
 * def _style(graphics, item):             # <<<<<<<<<<<<<<
 *     head = item.get_head_name()
 *     if head in style_heads:
 */
  __pyx_tuple__384 = PyTuple_Pack(6, __pyx_n_s_graphics, __pyx_n_s_item, __pyx_n_s_head, __pyx_n_s_klass, __pyx_n_s_style, __pyx_n_s_dir); if (unlikely(!__pyx_tuple__384)) __PYX_ERR(0, 2652, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__384);
  __Pyx_GIVEREF(__pyx_tuple__384);
  __pyx_codeobj__385 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__384, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_style_3, 2652, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__385)) __PYX_ERR(0, 2652, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2674
 * 
 * 
 * class Style(object):             # <<<<<<<<<<<<<<
 *     def __init__(self, graphics, edge=False, face=False):
 *         self.styles = []
 */
  __pyx_tuple__386 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__386)) __PYX_ERR(0, 2674, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__386);
  __Pyx_GIVEREF(__pyx_tuple__386);

  /* "mathics/builtin/graphics.py":2675
 * 
 * class Style(object):
 *     def __init__(self, graphics, edge=False, face=False):             # <<<<<<<<<<<<<<
 *         self.styles = []
 *         self.options = {}
 */
  __pyx_tuple__387 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_graphics, __pyx_n_s_edge, __pyx_n_s_face); if (unlikely(!__pyx_tuple__387)) __PYX_ERR(0, 2675, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__387);
  __Pyx_GIVEREF(__pyx_tuple__387);
  __pyx_codeobj__388 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__387, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_init_2, 2675, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__388)) __PYX_ERR(0, 2675, __pyx_L1_error)
  __pyx_tuple__389 = PyTuple_Pack(2, ((PyObject *)Py_False), ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__389)) __PYX_ERR(0, 2675, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__389);
  __Pyx_GIVEREF(__pyx_tuple__389);

  /* "mathics/builtin/graphics.py":2683
 *         self.klass = graphics.get_style_class()
 * 
 *     def append(self, item, allow_forms=True):             # <<<<<<<<<<<<<<
 *         self.styles.append(_style(self.graphics, item))
 * 
 */
  __pyx_tuple__390 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_item, __pyx_n_s_allow_forms); if (unlikely(!__pyx_tuple__390)) __PYX_ERR(0, 2683, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__390);
  __Pyx_GIVEREF(__pyx_tuple__390);
  __pyx_codeobj__391 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__390, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_append, 2683, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__391)) __PYX_ERR(0, 2683, __pyx_L1_error)
  __pyx_tuple__392 = PyTuple_Pack(1, ((PyObject *)Py_True)); if (unlikely(!__pyx_tuple__392)) __PYX_ERR(0, 2683, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__392);
  __Pyx_GIVEREF(__pyx_tuple__392);

  /* "mathics/builtin/graphics.py":2686
 *         self.styles.append(_style(self.graphics, item))
 * 
 *     def set_option(self, name, value):             # <<<<<<<<<<<<<<
 *         self.options[name] = value
 * 
 */
  __pyx_tuple__393 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_name, __pyx_n_s_value); if (unlikely(!__pyx_tuple__393)) __PYX_ERR(0, 2686, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__393);
  __Pyx_GIVEREF(__pyx_tuple__393);
  __pyx_codeobj__394 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__393, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_set_option, 2686, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__394)) __PYX_ERR(0, 2686, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2689
 *         self.options[name] = value
 * 
 *     def extend(self, style, pre=True):             # <<<<<<<<<<<<<<
 *         if pre:
 *             self.styles = style.styles + self.styles
 */
  __pyx_tuple__395 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_style, __pyx_n_s_pre); if (unlikely(!__pyx_tuple__395)) __PYX_ERR(0, 2689, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__395);
  __Pyx_GIVEREF(__pyx_tuple__395);
  __pyx_codeobj__396 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__395, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_extend, 2689, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__396)) __PYX_ERR(0, 2689, __pyx_L1_error)
  __pyx_tuple__397 = PyTuple_Pack(1, ((PyObject *)Py_True)); if (unlikely(!__pyx_tuple__397)) __PYX_ERR(0, 2689, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__397);
  __Pyx_GIVEREF(__pyx_tuple__397);

  /* "mathics/builtin/graphics.py":2695
 *             self.styles.extend(style.styles)
 * 
 *     def clone(self):             # <<<<<<<<<<<<<<
 *         result = self.klass(self.graphics, edge=self.edge, face=self.face)
 *         result.styles = self.styles[:]
 */
  __pyx_tuple__398 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_result); if (unlikely(!__pyx_tuple__398)) __PYX_ERR(0, 2695, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__398);
  __Pyx_GIVEREF(__pyx_tuple__398);
  __pyx_codeobj__399 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__398, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_clone, 2695, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__399)) __PYX_ERR(0, 2695, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2701
 *         return result
 * 
 *     def get_default_face_color(self):             # <<<<<<<<<<<<<<
 *         return RGBColor(components=(0, 0, 0, 1))
 * 
 */
  __pyx_tuple__400 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__400)) __PYX_ERR(0, 2701, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__400);
  __Pyx_GIVEREF(__pyx_tuple__400);
  __pyx_codeobj__401 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__400, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_get_default_face_color, 2701, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__401)) __PYX_ERR(0, 2701, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2704
 *         return RGBColor(components=(0, 0, 0, 1))
 * 
 *     def get_default_edge_color(self):             # <<<<<<<<<<<<<<
 *         return RGBColor(components=(0, 0, 0, 1))
 * 
 */
  __pyx_tuple__402 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__402)) __PYX_ERR(0, 2704, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__402);
  __Pyx_GIVEREF(__pyx_tuple__402);
  __pyx_codeobj__403 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__402, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_get_default_edge_color, 2704, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__403)) __PYX_ERR(0, 2704, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2707
 *         return RGBColor(components=(0, 0, 0, 1))
 * 
 *     def get_style(             # <<<<<<<<<<<<<<
 *         self, style_class, face_element=None, default_to_faces=True, consider_forms=True
 *     ):
 */
  __pyx_tuple__404 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_style_class, __pyx_n_s_face_element, __pyx_n_s_default_to_faces, __pyx_n_s_consider_forms, __pyx_n_s_edge_style, __pyx_n_s_face_style, __pyx_n_s_item, __pyx_n_s__186); if (unlikely(!__pyx_tuple__404)) __PYX_ERR(0, 2707, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__404);
  __Pyx_GIVEREF(__pyx_tuple__404);
  __pyx_codeobj__405 = (PyObject*)__Pyx_PyCode_New(5, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__404, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_get_style, 2707, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__405)) __PYX_ERR(0, 2707, __pyx_L1_error)
  __pyx_tuple__406 = PyTuple_Pack(3, ((PyObject *)Py_None), ((PyObject *)Py_True), ((PyObject *)Py_True)); if (unlikely(!__pyx_tuple__406)) __PYX_ERR(0, 2707, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__406);
  __Pyx_GIVEREF(__pyx_tuple__406);

  /* "mathics/builtin/graphics.py":2740
 *         return edge_style, face_style
 * 
 *     def get_option(self, name):             # <<<<<<<<<<<<<<
 *         return self.options.get(name, None)
 * 
 */
  __pyx_tuple__407 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_name); if (unlikely(!__pyx_tuple__407)) __PYX_ERR(0, 2740, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__407);
  __Pyx_GIVEREF(__pyx_tuple__407);
  __pyx_codeobj__408 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__407, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_get_option, 2740, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__408)) __PYX_ERR(0, 2740, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2743
 *         return self.options.get(name, None)
 * 
 *     def get_line_width(self, face_element=True):             # <<<<<<<<<<<<<<
 *         if self.graphics.pixel_width is None:
 *             return 0
 */
  __pyx_tuple__409 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_face_element, __pyx_n_s_edge_style, __pyx_n_s__186); if (unlikely(!__pyx_tuple__409)) __PYX_ERR(0, 2743, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__409);
  __Pyx_GIVEREF(__pyx_tuple__409);
  __pyx_codeobj__410 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__409, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_get_line_width, 2743, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__410)) __PYX_ERR(0, 2743, __pyx_L1_error)
  __pyx_tuple__411 = PyTuple_Pack(1, ((PyObject *)Py_True)); if (unlikely(!__pyx_tuple__411)) __PYX_ERR(0, 2743, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__411);
  __Pyx_GIVEREF(__pyx_tuple__411);

  /* "mathics/builtin/graphics.py":2754
 * 
 * 
 * def _flatten(leaves):             # <<<<<<<<<<<<<<
 *     for leaf in leaves:
 *         if leaf.get_head_name() == "System`List":
 */
  __pyx_tuple__412 = PyTuple_Pack(4, __pyx_n_s_leaves, __pyx_n_s_leaf, __pyx_n_s_flattened, __pyx_n_s_x); if (unlikely(!__pyx_tuple__412)) __PYX_ERR(0, 2754, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__412);
  __Pyx_GIVEREF(__pyx_tuple__412);
  __pyx_codeobj__111 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__412, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_flatten, 2754, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__111)) __PYX_ERR(0, 2754, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2767
 * 
 * 
 * class _GraphicsElements(object):             # <<<<<<<<<<<<<<
 *     def __init__(self, content, evaluation):
 *         self.evaluation = evaluation
 */
  __pyx_tuple__413 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__413)) __PYX_ERR(0, 2767, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__413);
  __Pyx_GIVEREF(__pyx_tuple__413);

  /* "mathics/builtin/graphics.py":2768
 * 
 * class _GraphicsElements(object):
 *     def __init__(self, content, evaluation):             # <<<<<<<<<<<<<<
 *         self.evaluation = evaluation
 *         self.elements = []
 */
  __pyx_tuple__414 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_content, __pyx_n_s_evaluation, __pyx_n_s_builtins, __pyx_n_s_get_options, __pyx_n_s_get_options, __pyx_n_s_stylebox_style, __pyx_n_s_stylebox_style, __pyx_n_s_convert, __pyx_n_s_convert); if (unlikely(!__pyx_tuple__414)) __PYX_ERR(0, 2768, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__414);
  __Pyx_GIVEREF(__pyx_tuple__414);
  __pyx_codeobj__415 = (PyObject*)__Pyx_PyCode_New(3, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__414, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_init_2, 2768, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__415)) __PYX_ERR(0, 2768, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2841
 *         self.elements = list(convert(content, self.get_style_class()(self)))
 * 
 *     def create_style(self, expr):             # <<<<<<<<<<<<<<
 *         style = self.get_style_class()(self)
 * 
 */
  __pyx_tuple__416 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_expr, __pyx_n_s_style, __pyx_n_s_convert, __pyx_n_s_convert); if (unlikely(!__pyx_tuple__416)) __PYX_ERR(0, 2841, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__416);
  __Pyx_GIVEREF(__pyx_tuple__416);
  __pyx_codeobj__417 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__416, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_create_style, 2841, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__417)) __PYX_ERR(0, 2841, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2854
 *         return style
 * 
 *     def get_style_class(self):             # <<<<<<<<<<<<<<
 *         return Style
 * 
 */
  __pyx_tuple__418 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__418)) __PYX_ERR(0, 2854, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__418);
  __Pyx_GIVEREF(__pyx_tuple__418);
  __pyx_codeobj__419 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__418, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_get_style_class, 2854, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__419)) __PYX_ERR(0, 2854, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2861
 *     coords = Coords
 * 
 *     def __init__(self, content, evaluation, neg_y=False):             # <<<<<<<<<<<<<<
 *         super(GraphicsElements, self).__init__(content, evaluation)
 *         self.neg_y = neg_y
 */
  __pyx_tuple__420 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_content, __pyx_n_s_evaluation, __pyx_n_s_neg_y); if (unlikely(!__pyx_tuple__420)) __PYX_ERR(0, 2861, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__420);
  __Pyx_GIVEREF(__pyx_tuple__420);
  __pyx_codeobj__421 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__420, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_init_2, 2861, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__421)) __PYX_ERR(0, 2861, __pyx_L1_error)
  __pyx_tuple__422 = PyTuple_Pack(1, ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__422)) __PYX_ERR(0, 2861, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__422);
  __Pyx_GIVEREF(__pyx_tuple__422);

  /* "mathics/builtin/graphics.py":2868
 *         self.view_width = None
 * 
 *     def translate(self, coords):             # <<<<<<<<<<<<<<
 *         if self.pixel_width is not None:
 *             w = self.extent_width if self.extent_width > 0 else 1
 */
  __pyx_tuple__423 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_coords, __pyx_n_s_w, __pyx_n_s_h, __pyx_n_s_result); if (unlikely(!__pyx_tuple__423)) __PYX_ERR(0, 2868, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__423);
  __Pyx_GIVEREF(__pyx_tuple__423);
  __pyx_codeobj__424 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__423, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_translate, 2868, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__424)) __PYX_ERR(0, 2868, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2882
 *             return (coords[0], coords[1])
 * 
 *     def translate_absolute(self, d):             # <<<<<<<<<<<<<<
 *         if self.pixel_width is None:
 *             return (0, 0)
 */
  __pyx_tuple__425 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_d, __pyx_n_s_l); if (unlikely(!__pyx_tuple__425)) __PYX_ERR(0, 2882, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__425);
  __Pyx_GIVEREF(__pyx_tuple__425);
  __pyx_codeobj__426 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__425, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_translate_absolute, 2882, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__426)) __PYX_ERR(0, 2882, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2889
 *             return (d[0] * l, (-1 if self.neg_y else 1) * d[1] * l)
 * 
 *     def translate_relative(self, x):             # <<<<<<<<<<<<<<
 *         if self.pixel_width is None:
 *             return 0
 */
  __pyx_tuple__427 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_x); if (unlikely(!__pyx_tuple__427)) __PYX_ERR(0, 2889, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__427);
  __Pyx_GIVEREF(__pyx_tuple__427);
  __pyx_codeobj__428 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__427, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_translate_relative, 2889, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__428)) __PYX_ERR(0, 2889, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2895
 *             return x * self.pixel_width
 * 
 *     def extent(self, completely_visible_only=False):             # <<<<<<<<<<<<<<
 *         if completely_visible_only:
 *             ext = total_extent(
 */
  __pyx_tuple__429 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_completely_visible_only, __pyx_n_s_ext, __pyx_n_s_xmin, __pyx_n_s_xmax, __pyx_n_s_ymin, __pyx_n_s_ymax, __pyx_n_s_element, __pyx_n_s_element); if (unlikely(!__pyx_tuple__429)) __PYX_ERR(0, 2895, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__429);
  __Pyx_GIVEREF(__pyx_tuple__429);
  __pyx_codeobj__430 = (PyObject*)__Pyx_PyCode_New(2, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__429, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_extent, 2895, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__430)) __PYX_ERR(0, 2895, __pyx_L1_error)
  __pyx_tuple__431 = PyTuple_Pack(1, ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__431)) __PYX_ERR(0, 2895, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__431);
  __Pyx_GIVEREF(__pyx_tuple__431);

  /* "mathics/builtin/graphics.py":2919
 *         return xmin, xmax, ymin, ymax
 * 
 *     def to_svg(self):             # <<<<<<<<<<<<<<
 *         return "\n".join(element.to_svg() for element in self.elements)
 * 
 */
  __pyx_tuple__432 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__432)) __PYX_ERR(0, 2919, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__432);
  __Pyx_GIVEREF(__pyx_tuple__432);
  __pyx_codeobj__433 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__432, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_to_svg, 2919, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__433)) __PYX_ERR(0, 2919, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2922
 *         return "\n".join(element.to_svg() for element in self.elements)
 * 
 *     def to_asy(self):             # <<<<<<<<<<<<<<
 *         return "\n".join(element.to_asy() for element in self.elements)
 * 
 */
  __pyx_tuple__434 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__434)) __PYX_ERR(0, 2922, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__434);
  __Pyx_GIVEREF(__pyx_tuple__434);
  __pyx_codeobj__435 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__434, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_to_asy, 2922, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__435)) __PYX_ERR(0, 2922, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2925
 *         return "\n".join(element.to_asy() for element in self.elements)
 * 
 *     def set_size(             # <<<<<<<<<<<<<<
 *         self, xmin, ymin, extent_width, extent_height, pixel_width, pixel_height
 *     ):
 */
  __pyx_tuple__436 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_xmin, __pyx_n_s_ymin, __pyx_n_s_extent_width, __pyx_n_s_extent_height, __pyx_n_s_pixel_width, __pyx_n_s_pixel_height); if (unlikely(!__pyx_tuple__436)) __PYX_ERR(0, 2925, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__436);
  __Pyx_GIVEREF(__pyx_tuple__436);
  __pyx_codeobj__437 = (PyObject*)__Pyx_PyCode_New(7, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__436, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_set_size, 2925, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__437)) __PYX_ERR(0, 2925, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2937
 *     options = Graphics.options
 * 
 *     attributes = ("HoldAll", "ReadProtected")             # <<<<<<<<<<<<<<
 * 
 *     def boxes_to_text(self, leaves, **options):
 */
  __pyx_tuple__438 = PyTuple_Pack(2, __pyx_n_u_HoldAll, __pyx_n_u_ReadProtected); if (unlikely(!__pyx_tuple__438)) __PYX_ERR(0, 2937, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__438);
  __Pyx_GIVEREF(__pyx_tuple__438);

  /* "mathics/builtin/graphics.py":2939
 *     attributes = ("HoldAll", "ReadProtected")
 * 
 *     def boxes_to_text(self, leaves, **options):             # <<<<<<<<<<<<<<
 *         self._prepare_elements(leaves, options)  # to test for Box errors
 *         return "-Graphics-"
 */
  __pyx_tuple__439 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_leaves, __pyx_n_s_options); if (unlikely(!__pyx_tuple__439)) __PYX_ERR(0, 2939, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__439);
  __Pyx_GIVEREF(__pyx_tuple__439);
  __pyx_codeobj__440 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__439, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_boxes_to_text, 2939, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__440)) __PYX_ERR(0, 2939, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2943
 *         return "-Graphics-"
 * 
 *     def _get_image_size(self, options, graphics_options, max_width):             # <<<<<<<<<<<<<<
 *         inside_row = options.pop("inside_row", False)
 *         inside_list = options.pop("inside_list", False)
 */
  __pyx_tuple__441 = PyTuple_Pack(14, __pyx_n_s_self, __pyx_n_s_options, __pyx_n_s_graphics_options, __pyx_n_s_max_width, __pyx_n_s_inside_row, __pyx_n_s_inside_list, __pyx_n_s_image_size_multipliers, __pyx_n_s_aspect_ratio, __pyx_n_s_aspect, __pyx_n_s_image_size, __pyx_n_s_base_width, __pyx_n_s_base_height, __pyx_n_s_multi, __pyx_n_s_x); if (unlikely(!__pyx_tuple__441)) __PYX_ERR(0, 2943, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__441);
  __Pyx_GIVEREF(__pyx_tuple__441);
  __pyx_codeobj__442 = (PyObject*)__Pyx_PyCode_New(4, 0, 14, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__441, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_get_image_size, 2943, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__442)) __PYX_ERR(0, 2943, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2992
 *         return base_width, base_height, multi, aspect
 * 
 *     def _prepare_elements(self, leaves, options, neg_y=False, max_width=None):             # <<<<<<<<<<<<<<
 *         if not leaves:
 *             raise BoxConstructError
 */
  __pyx_tuple__443 = PyTuple_Pack(24, __pyx_n_s_self, __pyx_n_s_leaves, __pyx_n_s_options, __pyx_n_s_neg_y, __pyx_n_s_max_width, __pyx_n_s_graphics_options, __pyx_n_s_background, __pyx_n_s_base_width, __pyx_n_s_base_height, __pyx_n_s_size_multiplier, __pyx_n_s_size_aspect, __pyx_n_s_plot_range, __pyx_n_s_elements, __pyx_n_s_axes, __pyx_n_s_calc_dimensions, __pyx_n_s_calc_dimensions, __pyx_n_s_xmin, __pyx_n_s_xmax, __pyx_n_s_ymin, __pyx_n_s_ymax, __pyx_n_s_w, __pyx_n_s_h, __pyx_n_s_width_2, __pyx_n_s_height_2); if (unlikely(!__pyx_tuple__443)) __PYX_ERR(0, 2992, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__443);
  __Pyx_GIVEREF(__pyx_tuple__443);
  __pyx_codeobj__444 = (PyObject*)__Pyx_PyCode_New(5, 0, 24, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__443, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_prepare_elements, 2992, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__444)) __PYX_ERR(0, 2992, __pyx_L1_error)
  __pyx_tuple__445 = PyTuple_Pack(2, ((PyObject *)Py_False), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__445)) __PYX_ERR(0, 2992, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__445);
  __Pyx_GIVEREF(__pyx_tuple__445);

  /* "mathics/builtin/graphics.py":3145
 *         return elements, calc_dimensions
 * 
 *     def boxes_to_tex(self, leaves, **options):             # <<<<<<<<<<<<<<
 *         elements, calc_dimensions = self._prepare_elements(
 *             leaves, options, max_width=450
 */
  __pyx_tuple__446 = PyTuple_Pack(23, __pyx_n_s_self, __pyx_n_s_leaves, __pyx_n_s_options, __pyx_n_s_elements, __pyx_n_s_calc_dimensions, __pyx_n_s_xmin, __pyx_n_s_xmax, __pyx_n_s_ymin, __pyx_n_s_ymax, __pyx_n_s_w, __pyx_n_s_h, __pyx_n_s_width_2, __pyx_n_s_height_2, __pyx_n_s_asy_completely_visible, __pyx_n_s_asy_regular, __pyx_n_s_asy_box, __pyx_n_s_color, __pyx_n_s_opacity, __pyx_n_s_asy_background, __pyx_n_s_tex, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__446)) __PYX_ERR(0, 3145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__446);
  __Pyx_GIVEREF(__pyx_tuple__446);
  __pyx_codeobj__447 = (PyObject*)__Pyx_PyCode_New(2, 0, 23, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__446, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_boxes_to_tex, 3145, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__447)) __PYX_ERR(0, 3145, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":3198
 *         return tex
 * 
 *     def boxes_to_xml(self, leaves, **options):             # <<<<<<<<<<<<<<
 *         elements, calc_dimensions = self._prepare_elements(leaves, options, neg_y=True)
 * 
 */
  __pyx_tuple__448 = PyTuple_Pack(17, __pyx_n_s_self, __pyx_n_s_leaves, __pyx_n_s_options, __pyx_n_s_elements, __pyx_n_s_calc_dimensions, __pyx_n_s_xmin, __pyx_n_s_xmax, __pyx_n_s_ymin, __pyx_n_s_ymax, __pyx_n_s_w, __pyx_n_s_h, __pyx_n_s_width_2, __pyx_n_s_height_2, __pyx_n_s_svg, __pyx_n_s_svg_xml, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__448)) __PYX_ERR(0, 3198, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__448);
  __Pyx_GIVEREF(__pyx_tuple__448);
  __pyx_codeobj__449 = (PyObject*)__Pyx_PyCode_New(2, 0, 17, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__448, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_boxes_to_xml, 3198, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__449)) __PYX_ERR(0, 3198, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":3242
 *         )
 * 
 *     def axis_ticks(self, xmin, xmax):             # <<<<<<<<<<<<<<
 *         def round_to_zero(value):
 *             if value == 0:
 */
  __pyx_tuple__450 = PyTuple_Pack(20, __pyx_n_s_self, __pyx_n_s_xmin, __pyx_n_s_xmax, __pyx_n_s_round_to_zero, __pyx_n_s_round_to_zero, __pyx_n_s_round_step, __pyx_n_s_round_step, __pyx_n_s_step_x, __pyx_n_s_sub_x, __pyx_n_s_step_x_small, __pyx_n_s_steps_x, __pyx_n_s_steps_x_small, __pyx_n_s_start_k_x, __pyx_n_s_start_k_x_small, __pyx_n_s_origin_k_x, __pyx_n_s_origin_x, __pyx_n_s_ticks, __pyx_n_s_ticks_small, __pyx_n_s_k, __pyx_n_s_x); if (unlikely(!__pyx_tuple__450)) __PYX_ERR(0, 3242, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__450);
  __Pyx_GIVEREF(__pyx_tuple__450);
  __pyx_codeobj__451 = (PyObject*)__Pyx_PyCode_New(3, 0, 20, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__450, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_axis_ticks, 3242, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__451)) __PYX_ERR(0, 3242, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":3302
 *         return ticks, ticks_small, origin_x
 * 
 *     def create_axes(self, elements, graphics_options, xmin, xmax, ymin, ymax):             # <<<<<<<<<<<<<<
 *         axes = graphics_options.get("System`Axes")
 *         if axes.is_true():
 */
  __pyx_tuple__452 = PyTuple_Pack(44, __pyx_n_s_self, __pyx_n_s_elements, __pyx_n_s_graphics_options, __pyx_n_s_xmin, __pyx_n_s_xmax, __pyx_n_s_ymin, __pyx_n_s_ymax, __pyx_n_s_axes, __pyx_n_s_ticks_style, __pyx_n_s_axes_style, __pyx_n_s_label_style, __pyx_n_s_add_element, __pyx_n_s_add_element, __pyx_n_s_ticks_x, __pyx_n_s_ticks_x_small, __pyx_n_s_origin_x, __pyx_n_s_ticks_y, __pyx_n_s_ticks_y_small, __pyx_n_s_origin_y, __pyx_n_s_axes_extra, __pyx_n_s_tick_small_size, __pyx_n_s_tick_large_size, __pyx_n_s_tick_label_d, __pyx_n_s_ticks_x_int, __pyx_n_s_ticks_y_int, __pyx_n_s_index, __pyx_n_s_min, __pyx_n_s_max, __pyx_n_s_p_self0, __pyx_n_s_p_other0, __pyx_n_s_p_origin, __pyx_n_s_ticks, __pyx_n_s_ticks_small, __pyx_n_s_ticks_int, __pyx_n_s_ticks_lines, __pyx_n_s_tick_label_style, __pyx_n_s_x, __pyx_n_s_content, __pyx_n_s_pos, __pyx_n_s_s, __pyx_n_s_s, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__452)) __PYX_ERR(0, 3302, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__452);
  __Pyx_GIVEREF(__pyx_tuple__452);
  __pyx_codeobj__453 = (PyObject*)__Pyx_PyCode_New(7, 0, 44, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__452, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_create_axes, 3302, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__453)) __PYX_ERR(0, 3302, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":3461
 * 
 * class Directive(Builtin):
 *     attributes = ("ReadProtected",)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_tuple__454 = PyTuple_Pack(1, __pyx_n_u_ReadProtected); if (unlikely(!__pyx_tuple__454)) __PYX_ERR(0, 3461, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__454);
  __Pyx_GIVEREF(__pyx_tuple__454);

  /* "mathics/builtin/graphics.py":3510
 *     }
 * 
 *     def do_blend(self, colors, values):             # <<<<<<<<<<<<<<
 *         type = None
 *         homogenous = True
 */
  __pyx_tuple__455 = PyTuple_Pack(15, __pyx_n_s_self, __pyx_n_s_colors, __pyx_n_s_values, __pyx_n_s_type, __pyx_n_s_homogenous, __pyx_n_s_color, __pyx_n_s_total, __pyx_n_s_result, __pyx_n_s_value, __pyx_n_s_frac, __pyx_n_s_part, __pyx_n_s_color, __pyx_n_s_component, __pyx_n_s_r, __pyx_n_s_p); if (unlikely(!__pyx_tuple__455)) __PYX_ERR(0, 3510, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__455);
  __Pyx_GIVEREF(__pyx_tuple__455);
  __pyx_codeobj__456 = (PyObject*)__Pyx_PyCode_New(3, 0, 15, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__455, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_do_blend, 3510, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__456)) __PYX_ERR(0, 3510, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":3534
 *         return type(components=result)
 * 
 *     def apply(self, colors, u, evaluation):             # <<<<<<<<<<<<<<
 *         "Blend[{colors___}, u_]"
 * 
 */
  __pyx_tuple__457 = PyTuple_Pack(11, __pyx_n_s_self, __pyx_n_s_colors, __pyx_n_s_u, __pyx_n_s_evaluation, __pyx_n_s_colors_orig, __pyx_n_s_values, __pyx_n_s_use_list, __pyx_n_s_x, __pyx_n_s_pos, __pyx_n_s_color, __pyx_n_s_value); if (unlikely(!__pyx_tuple__457)) __PYX_ERR(0, 3534, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__457);
  __Pyx_GIVEREF(__pyx_tuple__457);
  __pyx_codeobj__458 = (PyObject*)__Pyx_PyCode_New(4, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__457, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_apply, 3534, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__458)) __PYX_ERR(0, 3534, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":3624
 *     text_name = None
 * 
 *     def __init__(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         super(_ColorObject, self).__init__(*args, **kwargs)
 * 
 */
  __pyx_tuple__459 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_text_name, __pyx_n_s_doc_2); if (unlikely(!__pyx_tuple__459)) __PYX_ERR(0, 3624, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__459);
  __Pyx_GIVEREF(__pyx_tuple__459);
  __pyx_codeobj__460 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__459, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mathics_builtin_graphics_py, __pyx_n_s_init_2, 3624, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__460)) __PYX_ERR(0, 3624, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":3823
 * 
 * element_heads = frozenset(
 *     system_symbols(             # <<<<<<<<<<<<<<
 *         "Rectangle",
 *         "Disk",
 */
  __pyx_tuple__461 = PyTuple_Pack(14, __pyx_n_u_Rectangle, __pyx_n_u_Disk, __pyx_n_u_Line_2, __pyx_n_u_Arrow, __pyx_n_u_FilledCurve, __pyx_n_u_BezierCurve_2, __pyx_n_u_Point, __pyx_n_u_Circle, __pyx_n_u_Polygon, __pyx_n_u_RegularPolygon, __pyx_n_u_Inset, __pyx_n_u_Text, __pyx_n_u_Sphere, __pyx_n_u_Style); if (unlikely(!__pyx_tuple__461)) __PYX_ERR(0, 3823, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__461);
  __Pyx_GIVEREF(__pyx_tuple__461);
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
  __pyx_umethod_PyDict_Type_get.type = (PyObject*)&PyDict_Type;
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  __pyx_float_0_0 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_float_0_0)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_float_0_2 = PyFloat_FromDouble(0.2); if (unlikely(!__pyx_float_0_2)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_float_0_4 = PyFloat_FromDouble(0.4); if (unlikely(!__pyx_float_0_4)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_float_0_5 = PyFloat_FromDouble(0.5); if (unlikely(!__pyx_float_0_5)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_float_1_0 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_float_1_0)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_float_1_5 = PyFloat_FromDouble(1.5); if (unlikely(!__pyx_float_1_5)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_float_2_0 = PyFloat_FromDouble(2.0); if (unlikely(!__pyx_float_2_0)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_float_5_0 = PyFloat_FromDouble(5.0); if (unlikely(!__pyx_float_5_0)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_float_0_02 = PyFloat_FromDouble(0.02); if (unlikely(!__pyx_float_0_02)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_float_0_04 = PyFloat_FromDouble(0.04); if (unlikely(!__pyx_float_0_04)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_float_0_17 = PyFloat_FromDouble(0.17); if (unlikely(!__pyx_float_0_17)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_float_0_24 = PyFloat_FromDouble(0.24); if (unlikely(!__pyx_float_0_24)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_float_0_25 = PyFloat_FromDouble(0.25); if (unlikely(!__pyx_float_0_25)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_float_0_32 = PyFloat_FromDouble(0.32); if (unlikely(!__pyx_float_0_32)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_float_0_36 = PyFloat_FromDouble(0.36); if (unlikely(!__pyx_float_0_36)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_float_0_56 = PyFloat_FromDouble(0.56); if (unlikely(!__pyx_float_0_56)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_float_10_0 = PyFloat_FromDouble(10.0); if (unlikely(!__pyx_float_10_0)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_float_0_005 = PyFloat_FromDouble(0.005); if (unlikely(!__pyx_float_0_005)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_float_0_015 = PyFloat_FromDouble(0.015); if (unlikely(!__pyx_float_0_015)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_float_0_045 = PyFloat_FromDouble(0.045); if (unlikely(!__pyx_float_0_045)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_float_0_511 = PyFloat_FromDouble(0.511); if (unlikely(!__pyx_float_0_511)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_float_0_638 = PyFloat_FromDouble(0.638); if (unlikely(!__pyx_float_0_638)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_float_0_0131 = PyFloat_FromDouble(0.0131); if (unlikely(!__pyx_float_0_0131)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_float_0_0638 = PyFloat_FromDouble(0.0638); if (unlikely(!__pyx_float_0_0638)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_float_0_01765 = PyFloat_FromDouble(0.01765); if (unlikely(!__pyx_float_0_01765)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_float_0_040975 = PyFloat_FromDouble(0.040975); if (unlikely(!__pyx_float_0_040975)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_5 = PyInt_FromLong(5); if (unlikely(!__pyx_int_5)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_6 = PyInt_FromLong(6); if (unlikely(!__pyx_int_6)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_7 = PyInt_FromLong(7); if (unlikely(!__pyx_int_7)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_8 = PyInt_FromLong(8); if (unlikely(!__pyx_int_8)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_9 = PyInt_FromLong(9); if (unlikely(!__pyx_int_9)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_10 = PyInt_FromLong(10); if (unlikely(!__pyx_int_10)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_16 = PyInt_FromLong(16); if (unlikely(!__pyx_int_16)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_18 = PyInt_FromLong(18); if (unlikely(!__pyx_int_18)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_20 = PyInt_FromLong(20); if (unlikely(!__pyx_int_20)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_25 = PyInt_FromLong(25); if (unlikely(!__pyx_int_25)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_30 = PyInt_FromLong(30); if (unlikely(!__pyx_int_30)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_35 = PyInt_FromLong(35); if (unlikely(!__pyx_int_35)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_50 = PyInt_FromLong(50); if (unlikely(!__pyx_int_50)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_60 = PyInt_FromLong(60); if (unlikely(!__pyx_int_60)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_63 = PyInt_FromLong(63); if (unlikely(!__pyx_int_63)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_90 = PyInt_FromLong(90); if (unlikely(!__pyx_int_90)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_100 = PyInt_FromLong(100); if (unlikely(!__pyx_int_100)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_164 = PyInt_FromLong(164); if (unlikely(!__pyx_int_164)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_168 = PyInt_FromLong(168); if (unlikely(!__pyx_int_168)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_180 = PyInt_FromLong(180); if (unlikely(!__pyx_int_180)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_200 = PyInt_FromLong(200); if (unlikely(!__pyx_int_200)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_275 = PyInt_FromLong(275); if (unlikely(!__pyx_int_275)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_345 = PyInt_FromLong(345); if (unlikely(!__pyx_int_345)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_350 = PyInt_FromLong(350); if (unlikely(!__pyx_int_350)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_360 = PyInt_FromLong(360); if (unlikely(!__pyx_int_360)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_400 = PyInt_FromLong(400); if (unlikely(!__pyx_int_400)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_450 = PyInt_FromLong(450); if (unlikely(!__pyx_int_450)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_500 = PyInt_FromLong(500); if (unlikely(!__pyx_int_500)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_600 = PyInt_FromLong(600); if (unlikely(!__pyx_int_600)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_625 = PyInt_FromLong(625); if (unlikely(!__pyx_int_625)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_1900 = PyInt_FromLong(1900); if (unlikely(!__pyx_int_1900)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_100000000 = PyInt_FromLong(100000000L); if (unlikely(!__pyx_int_100000000)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_6103515625 = PyInt_FromString((char *)"6103515625", 0, 0); if (unlikely(!__pyx_int_6103515625)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_neg_2 = PyInt_FromLong(-2); if (unlikely(!__pyx_int_neg_2)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_neg_3 = PyInt_FromLong(-3); if (unlikely(!__pyx_int_neg_3)) __PYX_ERR(0, 1, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}

static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/

static int __Pyx_modinit_global_init_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
  /*--- Global init code ---*/
  __pyx_9genexpr71__pyx_v_7mathics_7builtin_8graphics_element = Py_None; Py_INCREF(Py_None);
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_variable_export_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
  /*--- Variable export code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_function_export_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
  /*--- Function export code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_type_init_code(void) {
  __Pyx_RefNannyDeclarations
  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 (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct___euclidean_distance) < 0) __PYX_ERR(0, 196, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct___euclidean_distance.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct___euclidean_distance.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct___euclidean_distance.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct___euclidean_distance.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct___euclidean_distance = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct___euclidean_distance;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_1_genexpr) < 0) __PYX_ERR(0, 197, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_1_genexpr.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_1_genexpr.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_1_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_1_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_1_genexpr = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_1_genexpr;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_2__extract_graphics) < 0) __PYX_ERR(0, 292, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_2__extract_graphics.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_2__extract_graphics.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_2__extract_graphics.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_2__extract_graphics.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_2__extract_graphics = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_2__extract_graphics;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_3_genexpr) < 0) __PYX_ERR(0, 319, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_3_genexpr.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_3_genexpr.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_3_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_3_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_3_genexpr = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_3_genexpr;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_4_apply_makeboxes) < 0) __PYX_ERR(0, 470, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_4_apply_makeboxes.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_4_apply_makeboxes.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_4_apply_makeboxes.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_4_apply_makeboxes.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_4_apply_makeboxes = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_4_apply_makeboxes;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_5_convert) < 0) __PYX_ERR(0, 474, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_5_convert.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_5_convert.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_5_convert.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_5_convert.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_5_convert = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_5_convert;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_6_genexpr) < 0) __PYX_ERR(0, 490, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_6_genexpr.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_6_genexpr.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_6_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_6_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_6_genexpr = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_6_genexpr;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_7_genexpr) < 0) __PYX_ERR(0, 500, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_7_genexpr.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_7_genexpr.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_7_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_7_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_7_genexpr = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_7_genexpr;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_8_hsl_to_rgba) < 0) __PYX_ERR(0, 743, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_8_hsl_to_rgba.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_8_hsl_to_rgba.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_8_hsl_to_rgba.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_8_hsl_to_rgba.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_8_hsl_to_rgba = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_8_hsl_to_rgba;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_9_apply) < 0) __PYX_ERR(0, 884, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_9_apply.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_9_apply.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_9_apply.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_9_apply.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_9_apply = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_9_apply;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_10_to_svg) < 0) __PYX_ERR(0, 1377, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_10_to_svg.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_10_to_svg.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_10_to_svg.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_10_to_svg.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_10_to_svg = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_10_to_svg;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_11_path) < 0) __PYX_ERR(0, 1383, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_11_path.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_11_path.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_11_path.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_11_path.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_11_path = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_11_path;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_12_to_asy) < 0) __PYX_ERR(0, 1399, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_12_to_asy.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_12_to_asy.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_12_to_asy.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_12_to_asy.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_12_to_asy = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_12_to_asy;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_13_path) < 0) __PYX_ERR(0, 1405, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_13_path.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_13_path.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_13_path.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_13_path.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_13_path = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_13_path;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_14_genexpr) < 0) __PYX_ERR(0, 1408, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_14_genexpr.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_14_genexpr.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_14_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_14_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_14_genexpr = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_14_genexpr;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_15_genexpr) < 0) __PYX_ERR(0, 1412, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_15_genexpr.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_15_genexpr.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_15_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_15_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_15_genexpr = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_15_genexpr;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_16_do_init) < 0) __PYX_ERR(0, 1438, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_16_do_init.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_16_do_init.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_16_do_init.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_16_do_init.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_16_do_init = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_16_do_init;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_17_genexpr) < 0) __PYX_ERR(0, 1444, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_17_genexpr.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_17_genexpr.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_17_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_17_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_17_genexpr = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_17_genexpr;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_18_init) < 0) __PYX_ERR(0, 1496, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_18_init.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_18_init.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_18_init.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_18_init.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_18_init = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_18_init;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_19_genexpr) < 0) __PYX_ERR(0, 1504, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_19_genexpr.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_19_genexpr.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_19_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_19_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_19_genexpr = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_19_genexpr;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_20__svg_bezier) < 0) __PYX_ERR(0, 1595, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_20__svg_bezier.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_20__svg_bezier.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_20__svg_bezier.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_20__svg_bezier.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_20__svg_bezier = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_20__svg_bezier;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_21_path) < 0) __PYX_ERR(0, 1607, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_21_path.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_21_path.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_21_path.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_21_path.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_21_path = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_21_path;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_22_genexpr) < 0) __PYX_ERR(0, 1613, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_22_genexpr.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_22_genexpr.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_22_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_22_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_22_genexpr = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_22_genexpr;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_23__asy_bezier) < 0) __PYX_ERR(0, 1627, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_23__asy_bezier.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_23__asy_bezier.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_23__asy_bezier.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_23__asy_bezier.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_23__asy_bezier = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_23__asy_bezier;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_24_path) < 0) __PYX_ERR(0, 1667, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_24_path.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_24_path.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_24_path.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_24_path.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_24_path = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_24_path;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_25_init) < 0) __PYX_ERR(0, 1771, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_25_init.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_25_init.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_25_init.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_25_init.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_25_init = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_25_init;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_26_parse_component) < 0) __PYX_ERR(0, 1780, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_26_parse_component.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_26_parse_component.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_26_parse_component.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_26_parse_component.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_26_parse_component = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_26_parse_component;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_27_genexpr) < 0) __PYX_ERR(0, 1810, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_27_genexpr.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_27_genexpr.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_27_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_27_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_27_genexpr = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_27_genexpr;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_28_to_svg) < 0) __PYX_ERR(0, 1817, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_28_to_svg.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_28_to_svg.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_28_to_svg.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_28_to_svg.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_28_to_svg = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_28_to_svg;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_29_components) < 0) __PYX_ERR(0, 1823, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_29_components.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_29_components.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_29_components.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_29_components.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_29_components = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_29_components;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_30_to_asy) < 0) __PYX_ERR(0, 1833, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_30_to_asy.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_30_to_asy.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_30_to_asy.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_30_to_asy.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_30_to_asy = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_30_to_asy;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_31_components) < 0) __PYX_ERR(0, 1840, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_31_components.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_31_components.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_31_components.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_31_components.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_31_components = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_31_components;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_32_to_svg) < 0) __PYX_ERR(0, 1922, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_32_to_svg.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_32_to_svg.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_32_to_svg.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_32_to_svg.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_32_to_svg = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_32_to_svg;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_33_genexpr) < 0) __PYX_ERR(0, 1943, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_33_genexpr.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_33_genexpr.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_33_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_33_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_33_genexpr = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_33_genexpr;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_34_init) < 0) __PYX_ERR(0, 2017, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_34_init.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_34_init.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_34_init.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_34_init.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_34_init = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_34_init;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_35_genexpr) < 0) __PYX_ERR(0, 2043, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_35_genexpr.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_35_genexpr.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_35_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_35_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_35_genexpr = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_35_genexpr;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_36_vertices) < 0) __PYX_ERR(0, 2053, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_36_vertices.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_36_vertices.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_36_vertices.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_36_vertices.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_36_vertices = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_36_vertices;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_37_heads) < 0) __PYX_ERR(0, 2150, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_37_heads.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_37_heads.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_37_heads.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_37_heads.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_37_heads = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_37_heads;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_38_genexpr) < 0) __PYX_ERR(0, 2155, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_38_genexpr.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_38_genexpr.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_38_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_38_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_38_genexpr = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_38_genexpr;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_39_make_draw_svg) < 0) __PYX_ERR(0, 2203, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_39_make_draw_svg.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_39_make_draw_svg.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_39_make_draw_svg.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_39_make_draw_svg.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_39_make_draw_svg = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_39_make_draw_svg;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_40_draw) < 0) __PYX_ERR(0, 2204, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_40_draw.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_40_draw.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_40_draw.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_40_draw.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_40_draw = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_40_draw;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_41_genexpr) < 0) __PYX_ERR(0, 2206, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_41_genexpr.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_41_genexpr.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_41_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_41_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_41_genexpr = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_41_genexpr;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_42_make_draw_asy) < 0) __PYX_ERR(0, 2211, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_42_make_draw_asy.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_42_make_draw_asy.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_42_make_draw_asy.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_42_make_draw_asy.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_42_make_draw_asy = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_42_make_draw_asy;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_43_draw) < 0) __PYX_ERR(0, 2212, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_43_draw.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_43_draw.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_43_draw.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_43_draw.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_43_draw = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_43_draw;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_44_arrows) < 0) __PYX_ERR(0, 2219, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_44_arrows.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_44_arrows.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_44_arrows.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_44_arrows.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_44_arrows = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_44_arrows;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_45_segments) < 0) __PYX_ERR(0, 2220, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_45_segments.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_45_segments.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_45_segments.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_45_segments.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_45_segments = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_45_segments;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_46_genexpr) < 0) __PYX_ERR(0, 2235, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_46_genexpr.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_46_genexpr.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_46_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_46_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_46_genexpr = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_46_genexpr;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_47_genexpr) < 0) __PYX_ERR(0, 2237, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_47_genexpr.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_47_genexpr.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_47_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_47_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_47_genexpr = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_47_genexpr;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_48_make_draw_svg) < 0) __PYX_ERR(0, 2291, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_48_make_draw_svg.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_48_make_draw_svg.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_48_make_draw_svg.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_48_make_draw_svg.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_48_make_draw_svg = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_48_make_draw_svg;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_49_draw) < 0) __PYX_ERR(0, 2292, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_49_draw.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_49_draw.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_49_draw.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_49_draw.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_49_draw = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_49_draw;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_50_make_draw_asy) < 0) __PYX_ERR(0, 2298, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_50_make_draw_asy.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_50_make_draw_asy.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_50_make_draw_asy.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_50_make_draw_asy.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_50_make_draw_asy = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_50_make_draw_asy;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_51_draw) < 0) __PYX_ERR(0, 2299, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_51_draw.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_51_draw.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_51_draw.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_51_draw.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_51_draw = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_51_draw;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_52_arrows) < 0) __PYX_ERR(0, 2305, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_52_arrows.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_52_arrows.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_52_arrows.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_52_arrows.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_52_arrows = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_52_arrows;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_53__setback_spec) < 0) __PYX_ERR(0, 2373, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_53__setback_spec.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_53__setback_spec.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_53__setback_spec.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_53__setback_spec.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_53__setback_spec = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_53__setback_spec;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_54_genexpr) < 0) __PYX_ERR(0, 2378, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_54_genexpr.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_54_genexpr.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_54_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_54_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_54_genexpr = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_54_genexpr;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_55__default_arrow) < 0) __PYX_ERR(0, 2384, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_55__default_arrow.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_55__default_arrow.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_55__default_arrow.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_55__default_arrow.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_55__default_arrow = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_55__default_arrow;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_56_draw) < 0) __PYX_ERR(0, 2407, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_56_draw.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_56_draw.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_56_draw.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_56_draw.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_56_draw = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_56_draw;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_57__draw) < 0) __PYX_ERR(0, 2430, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_57__draw.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_57__draw.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_57__draw.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_57__draw.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_57__draw = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_57__draw;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_58__custom_arrow) < 0) __PYX_ERR(0, 2479, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_58__custom_arrow.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_58__custom_arrow.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_58__custom_arrow.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_58__custom_arrow.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_58__custom_arrow = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_58__custom_arrow;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_59_make) < 0) __PYX_ERR(0, 2480, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_59_make.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_59_make.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_59_make.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_59_make.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_59_make = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_59_make;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_60_draw) < 0) __PYX_ERR(0, 2487, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_60_draw.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_60_draw.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_60_draw.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_60_draw.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_60_draw = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_60_draw;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_61_to_svg) < 0) __PYX_ERR(0, 2503, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_61_to_svg.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_61_to_svg.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_61_to_svg.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_61_to_svg.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_61_to_svg = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_61_to_svg;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_62_polygon) < 0) __PYX_ERR(0, 2510, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_62_polygon.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_62_polygon.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_62_polygon.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_62_polygon.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_62_polygon = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_62_polygon;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_63_genexpr) < 0) __PYX_ERR(0, 2512, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_63_genexpr.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_63_genexpr.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_63_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_63_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_63_genexpr = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_63_genexpr;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_64_to_asy) < 0) __PYX_ERR(0, 2520, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_64_to_asy.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_64_to_asy.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_64_to_asy.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_64_to_asy.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_64_to_asy = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_64_to_asy;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_65_polygon) < 0) __PYX_ERR(0, 2527, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_65_polygon.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_65_polygon.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_65_polygon.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_65_polygon.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_65_polygon = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_65_polygon;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_66_extent) < 0) __PYX_ERR(0, 2537, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_66_extent.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_66_extent.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_66_extent.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_66_extent.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_66_extent = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_66_extent;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_67_polyline) < 0) __PYX_ERR(0, 2540, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_67_polyline.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_67_polyline.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_67_polyline.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_67_polyline.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_67_polyline = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_67_polyline;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_68_polygon) < 0) __PYX_ERR(0, 2548, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_68_polygon.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_68_polygon.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_68_polygon.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_68_polygon.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_68_polygon = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_68_polygon;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_69_default_arrow) < 0) __PYX_ERR(0, 2552, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_69_default_arrow.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_69_default_arrow.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_69_default_arrow.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_69_default_arrow.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_69_default_arrow = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_69_default_arrow;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_70__flatten) < 0) __PYX_ERR(0, 2754, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_70__flatten.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_70__flatten.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_70__flatten.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_70__flatten.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_70__flatten = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_70__flatten;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_71___init__) < 0) __PYX_ERR(0, 2768, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_71___init__.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_71___init__.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_71___init__.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_71___init__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_71___init__ = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_71___init__;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_72_convert) < 0) __PYX_ERR(0, 2801, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_72_convert.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_72_convert.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_72_convert.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_72_convert.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_72_convert = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_72_convert;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_73_create_style) < 0) __PYX_ERR(0, 2841, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_73_create_style.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_73_create_style.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_73_create_style.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_73_create_style.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_73_create_style = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_73_create_style;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_74_to_svg) < 0) __PYX_ERR(0, 2919, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_74_to_svg.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_74_to_svg.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_74_to_svg.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_74_to_svg.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_74_to_svg = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_74_to_svg;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_75_genexpr) < 0) __PYX_ERR(0, 2920, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_75_genexpr.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_75_genexpr.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_75_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_75_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_75_genexpr = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_75_genexpr;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_76_to_asy) < 0) __PYX_ERR(0, 2922, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_76_to_asy.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_76_to_asy.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_76_to_asy.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_76_to_asy.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_76_to_asy = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_76_to_asy;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_77_genexpr) < 0) __PYX_ERR(0, 2923, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_77_genexpr.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_77_genexpr.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_77_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_77_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_77_genexpr = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_77_genexpr;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_78__prepare_elements) < 0) __PYX_ERR(0, 2992, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_78__prepare_elements.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_78__prepare_elements.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_78__prepare_elements.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_78__prepare_elements.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_78__prepare_elements = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_78__prepare_elements;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_79_genexpr) < 0) __PYX_ERR(0, 3041, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_79_genexpr.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_79_genexpr.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_79_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_79_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_79_genexpr = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_79_genexpr;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_80_boxes_to_tex) < 0) __PYX_ERR(0, 3145, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_80_boxes_to_tex.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_80_boxes_to_tex.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_80_boxes_to_tex.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_80_boxes_to_tex.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_80_boxes_to_tex = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_80_boxes_to_tex;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_81_genexpr) < 0) __PYX_ERR(0, 3154, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_81_genexpr.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_81_genexpr.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_81_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_81_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_81_genexpr = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_81_genexpr;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_82_genexpr) < 0) __PYX_ERR(0, 3160, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_82_genexpr.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_82_genexpr.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_82_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_82_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_82_genexpr = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_82_genexpr;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_83_boxes_to_xml) < 0) __PYX_ERR(0, 3198, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_83_boxes_to_xml.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_83_boxes_to_xml.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_83_boxes_to_xml.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_83_boxes_to_xml.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_83_boxes_to_xml = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_83_boxes_to_xml;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_84_genexpr) < 0) __PYX_ERR(0, 3229, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_84_genexpr.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_84_genexpr.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_84_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_84_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_84_genexpr = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_84_genexpr;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_85_create_axes) < 0) __PYX_ERR(0, 3302, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_85_create_axes.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_85_create_axes.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_85_create_axes.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_85_create_axes.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_85_create_axes = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_85_create_axes;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_86_genexpr) < 0) __PYX_ERR(0, 3340, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_86_genexpr.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_86_genexpr.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_86_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_86_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_86_genexpr = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_86_genexpr;
  if (PyType_Ready(&__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_87_genexpr) < 0) __PYX_ERR(0, 3341, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_87_genexpr.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_87_genexpr.tp_dictoffset && __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_87_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_87_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7mathics_7builtin_8graphics___pyx_scope_struct_87_genexpr = &__pyx_type_7mathics_7builtin_8graphics___pyx_scope_struct_87_genexpr;
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_type_import_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
  /*--- Type import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_variable_import_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
  /*--- Variable import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_function_import_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
  /*--- Function import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}


#ifndef CYTHON_NO_PYINIT_EXPORT
#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
#elif PY_MAJOR_VERSION < 3
#ifdef __cplusplus
#define __Pyx_PyMODINIT_FUNC extern "C" void
#else
#define __Pyx_PyMODINIT_FUNC void
#endif
#else
#ifdef __cplusplus
#define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
#else
#define __Pyx_PyMODINIT_FUNC PyObject *
#endif
#endif


#if PY_MAJOR_VERSION < 3
__Pyx_PyMODINIT_FUNC initgraphics(void) CYTHON_SMALL_CODE; /*proto*/
__Pyx_PyMODINIT_FUNC initgraphics(void)
#else
__Pyx_PyMODINIT_FUNC PyInit_graphics(void) CYTHON_SMALL_CODE; /*proto*/
__Pyx_PyMODINIT_FUNC PyInit_graphics(void)
#if CYTHON_PEP489_MULTI_PHASE_INIT
{
  return PyModuleDef_Init(&__pyx_moduledef);
}
static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
    #if PY_VERSION_HEX >= 0x030700A1
    static PY_INT64_T main_interpreter_id = -1;
    PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
    if (main_interpreter_id == -1) {
        main_interpreter_id = current_id;
        return (unlikely(current_id == -1)) ? -1 : 0;
    } else if (unlikely(main_interpreter_id != current_id))
    #else
    static PyInterpreterState *main_interpreter = NULL;
    PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
    if (!main_interpreter) {
        main_interpreter = current_interpreter;
    } else if (unlikely(main_interpreter != current_interpreter))
    #endif
    {
        PyErr_SetString(
            PyExc_ImportError,
            "Interpreter change detected - this module can only be loaded into one interpreter per process.");
        return -1;
    }
    return 0;
}
static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) {
    PyObject *value = PyObject_GetAttrString(spec, from_name);
    int result = 0;
    if (likely(value)) {
        if (allow_none || value != Py_None) {
            result = PyDict_SetItemString(moddict, to_name, value);
        }
        Py_DECREF(value);
    } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
        PyErr_Clear();
    } else {
        result = -1;
    }
    return result;
}
static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
    PyObject *module = NULL, *moddict, *modname;
    if (__Pyx_check_single_interpreter())
        return NULL;
    if (__pyx_m)
        return __Pyx_NewRef(__pyx_m);
    modname = PyObject_GetAttrString(spec, "name");
    if (unlikely(!modname)) goto bad;
    module = PyModule_NewObject(modname);
    Py_DECREF(modname);
    if (unlikely(!module)) goto bad;
    moddict = PyModule_GetDict(module);
    if (unlikely(!moddict)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
    return module;
bad:
    Py_XDECREF(module);
    return NULL;
}


static CYTHON_SMALL_CODE int __pyx_pymod_exec_graphics(PyObject *__pyx_pyinit_module)
#endif
#endif
{
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  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_RefNannyDeclarations
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  if (__pyx_m) {
    if (__pyx_m == __pyx_pyinit_module) return 0;
    PyErr_SetString(PyExc_RuntimeError, "Module 'graphics' has already been imported. Re-initialisation is not supported.");
    return -1;
  }
  #elif PY_MAJOR_VERSION >= 3
  if (__pyx_m) return __Pyx_NewRef(__pyx_m);
  #endif
  #if CYTHON_REFNANNY
__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
if (!__Pyx_RefNanny) {
  PyErr_Clear();
  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
  if (!__Pyx_RefNanny)
      Py_FatalError("failed to import 'refnanny' module");
}
#endif
  __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_graphics(void)", 0);
  if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #ifdef __Pxy_PyFrame_Initialize_Offsets
  __Pxy_PyFrame_Initialize_Offsets();
  #endif
  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
  #ifdef __Pyx_CyFunction_USED
  if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_FusedFunction_USED
  if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Coroutine_USED
  if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Generator_USED
  if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_AsyncGen_USED
  if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_StopAsyncIteration_USED
  if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  /*--- Library function declarations ---*/
  /*--- Threads initialization code ---*/
  #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
  #ifdef WITH_THREAD /* Python build with threading support? */
  PyEval_InitThreads();
  #endif
  #endif
  /*--- Module creation code ---*/
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  __pyx_m = __pyx_pyinit_module;
  Py_INCREF(__pyx_m);
  #else
  #if PY_MAJOR_VERSION < 3
  __pyx_m = Py_InitModule4("graphics", __pyx_methods, __pyx_k_Drawing_Graphics, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
  #else
  __pyx_m = PyModule_Create(&__pyx_moduledef);
  #endif
  if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
  Py_INCREF(__pyx_d);
  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
  Py_INCREF(__pyx_b);
  __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
  Py_INCREF(__pyx_cython_runtime);
  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  /*--- Initialize various global constants etc. ---*/
  if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
  if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  if (__pyx_module_is_main_mathics__builtin__graphics) {
    if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  }
  #if PY_MAJOR_VERSION >= 3
  {
    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
    if (!PyDict_GetItemString(modules, "mathics.builtin.graphics")) {
      if (unlikely(PyDict_SetItemString(modules, "mathics.builtin.graphics", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
    }
  }
  #endif
  /*--- Builtin init code ---*/
  if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Constants init code ---*/
  if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Global type/function init code ---*/
  (void)__Pyx_modinit_global_init_code();
  (void)__Pyx_modinit_variable_export_code();
  (void)__Pyx_modinit_function_export_code();
  if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
  (void)__Pyx_modinit_type_import_code();
  (void)__Pyx_modinit_variable_import_code();
  (void)__Pyx_modinit_function_import_code();
  /*--- Execution code ---*/
  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
  if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif

  /* "mathics/builtin/graphics.py":10
 * 
 * 
 * from math import floor, ceil, log10, sin, cos, pi, sqrt, atan2, degrees, radians, exp             # <<<<<<<<<<<<<<
 * import json
 * import base64
 */
  __pyx_t_1 = PyList_New(11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_floor);
  __Pyx_GIVEREF(__pyx_n_s_floor);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_floor);
  __Pyx_INCREF(__pyx_n_s_ceil);
  __Pyx_GIVEREF(__pyx_n_s_ceil);
  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_ceil);
  __Pyx_INCREF(__pyx_n_s_log10);
  __Pyx_GIVEREF(__pyx_n_s_log10);
  PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_log10);
  __Pyx_INCREF(__pyx_n_s_sin);
  __Pyx_GIVEREF(__pyx_n_s_sin);
  PyList_SET_ITEM(__pyx_t_1, 3, __pyx_n_s_sin);
  __Pyx_INCREF(__pyx_n_s_cos);
  __Pyx_GIVEREF(__pyx_n_s_cos);
  PyList_SET_ITEM(__pyx_t_1, 4, __pyx_n_s_cos);
  __Pyx_INCREF(__pyx_n_s_pi);
  __Pyx_GIVEREF(__pyx_n_s_pi);
  PyList_SET_ITEM(__pyx_t_1, 5, __pyx_n_s_pi);
  __Pyx_INCREF(__pyx_n_s_sqrt);
  __Pyx_GIVEREF(__pyx_n_s_sqrt);
  PyList_SET_ITEM(__pyx_t_1, 6, __pyx_n_s_sqrt);
  __Pyx_INCREF(__pyx_n_s_atan2);
  __Pyx_GIVEREF(__pyx_n_s_atan2);
  PyList_SET_ITEM(__pyx_t_1, 7, __pyx_n_s_atan2);
  __Pyx_INCREF(__pyx_n_s_degrees);
  __Pyx_GIVEREF(__pyx_n_s_degrees);
  PyList_SET_ITEM(__pyx_t_1, 8, __pyx_n_s_degrees);
  __Pyx_INCREF(__pyx_n_s_radians);
  __Pyx_GIVEREF(__pyx_n_s_radians);
  PyList_SET_ITEM(__pyx_t_1, 9, __pyx_n_s_radians);
  __Pyx_INCREF(__pyx_n_s_exp);
  __Pyx_GIVEREF(__pyx_n_s_exp);
  PyList_SET_ITEM(__pyx_t_1, 10, __pyx_n_s_exp);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_math_2, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_floor); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_floor, __pyx_t_1) < 0) __PYX_ERR(0, 10, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ceil); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ceil, __pyx_t_1) < 0) __PYX_ERR(0, 10, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_log10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_log10, __pyx_t_1) < 0) __PYX_ERR(0, 10, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_sin); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sin, __pyx_t_1) < 0) __PYX_ERR(0, 10, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_cos); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_cos, __pyx_t_1) < 0) __PYX_ERR(0, 10, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_pi); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pi, __pyx_t_1) < 0) __PYX_ERR(0, 10, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sqrt, __pyx_t_1) < 0) __PYX_ERR(0, 10, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_atan2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_atan2, __pyx_t_1) < 0) __PYX_ERR(0, 10, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_degrees); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_degrees, __pyx_t_1) < 0) __PYX_ERR(0, 10, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_radians); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_radians, __pyx_t_1) < 0) __PYX_ERR(0, 10, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_exp); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_exp, __pyx_t_1) < 0) __PYX_ERR(0, 10, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":11
 * 
 * from math import floor, ceil, log10, sin, cos, pi, sqrt, atan2, degrees, radians, exp
 * import json             # <<<<<<<<<<<<<<
 * import base64
 * from itertools import chain
 */
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_json, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_json, __pyx_t_2) < 0) __PYX_ERR(0, 11, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":12
 * from math import floor, ceil, log10, sin, cos, pi, sqrt, atan2, degrees, radians, exp
 * import json
 * import base64             # <<<<<<<<<<<<<<
 * from itertools import chain
 * 
 */
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_base64, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_base64, __pyx_t_2) < 0) __PYX_ERR(0, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":13
 * import json
 * import base64
 * from itertools import chain             # <<<<<<<<<<<<<<
 * 
 * from mathics.builtin.base import (
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 13, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_chain);
  __Pyx_GIVEREF(__pyx_n_s_chain);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_chain);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_itertools, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_chain); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 13, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_chain, __pyx_t_2) < 0) __PYX_ERR(0, 13, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":16
 * 
 * from mathics.builtin.base import (
 *     Builtin,             # <<<<<<<<<<<<<<
 *     InstancableBuiltin,
 *     BoxConstruct,
 */
  __pyx_t_1 = PyList_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_Builtin);
  __Pyx_GIVEREF(__pyx_n_s_Builtin);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Builtin);
  __Pyx_INCREF(__pyx_n_s_InstancableBuiltin);
  __Pyx_GIVEREF(__pyx_n_s_InstancableBuiltin);
  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_InstancableBuiltin);
  __Pyx_INCREF(__pyx_n_s_BoxConstruct);
  __Pyx_GIVEREF(__pyx_n_s_BoxConstruct);
  PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_BoxConstruct);
  __Pyx_INCREF(__pyx_n_s_BoxConstructError);
  __Pyx_GIVEREF(__pyx_n_s_BoxConstructError);
  PyList_SET_ITEM(__pyx_t_1, 3, __pyx_n_s_BoxConstructError);

  /* "mathics/builtin/graphics.py":15
 * from itertools import chain
 * 
 * from mathics.builtin.base import (             # <<<<<<<<<<<<<<
 *     Builtin,
 *     InstancableBuiltin,
 */
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_mathics_builtin_base, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Builtin); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Builtin, __pyx_t_1) < 0) __PYX_ERR(0, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_InstancableBuiltin); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_InstancableBuiltin, __pyx_t_1) < 0) __PYX_ERR(0, 17, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_BoxConstruct); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_BoxConstruct, __pyx_t_1) < 0) __PYX_ERR(0, 18, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_BoxConstructError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_BoxConstructError, __pyx_t_1) < 0) __PYX_ERR(0, 19, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":21
 *     BoxConstructError,
 * )
 * from mathics.builtin.options import options_to_rules             # <<<<<<<<<<<<<<
 * from mathics.core.expression import (
 *     Expression,
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_options_to_rules);
  __Pyx_GIVEREF(__pyx_n_s_options_to_rules);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_options_to_rules);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_mathics_builtin_options, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_options_to_rules); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_options_to_rules, __pyx_t_2) < 0) __PYX_ERR(0, 21, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":23
 * from mathics.builtin.options import options_to_rules
 * from mathics.core.expression import (
 *     Expression,             # <<<<<<<<<<<<<<
 *     Integer,
 *     Rational,
 */
  __pyx_t_1 = PyList_New(10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_Expression);
  __Pyx_GIVEREF(__pyx_n_s_Expression);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Expression);
  __Pyx_INCREF(__pyx_n_s_Integer);
  __Pyx_GIVEREF(__pyx_n_s_Integer);
  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_Integer);
  __Pyx_INCREF(__pyx_n_s_Rational);
  __Pyx_GIVEREF(__pyx_n_s_Rational);
  PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_Rational);
  __Pyx_INCREF(__pyx_n_s_Real);
  __Pyx_GIVEREF(__pyx_n_s_Real);
  PyList_SET_ITEM(__pyx_t_1, 3, __pyx_n_s_Real);
  __Pyx_INCREF(__pyx_n_s_String);
  __Pyx_GIVEREF(__pyx_n_s_String);
  PyList_SET_ITEM(__pyx_t_1, 4, __pyx_n_s_String);
  __Pyx_INCREF(__pyx_n_s_Symbol);
  __Pyx_GIVEREF(__pyx_n_s_Symbol);
  PyList_SET_ITEM(__pyx_t_1, 5, __pyx_n_s_Symbol);
  __Pyx_INCREF(__pyx_n_s_strip_context);
  __Pyx_GIVEREF(__pyx_n_s_strip_context);
  PyList_SET_ITEM(__pyx_t_1, 6, __pyx_n_s_strip_context);
  __Pyx_INCREF(__pyx_n_s_system_symbols);
  __Pyx_GIVEREF(__pyx_n_s_system_symbols);
  PyList_SET_ITEM(__pyx_t_1, 7, __pyx_n_s_system_symbols);
  __Pyx_INCREF(__pyx_n_s_system_symbols_dict);
  __Pyx_GIVEREF(__pyx_n_s_system_symbols_dict);
  PyList_SET_ITEM(__pyx_t_1, 8, __pyx_n_s_system_symbols_dict);
  __Pyx_INCREF(__pyx_n_s_from_python);
  __Pyx_GIVEREF(__pyx_n_s_from_python);
  PyList_SET_ITEM(__pyx_t_1, 9, __pyx_n_s_from_python);

  /* "mathics/builtin/graphics.py":22
 * )
 * from mathics.builtin.options import options_to_rules
 * from mathics.core.expression import (             # <<<<<<<<<<<<<<
 *     Expression,
 *     Integer,
 */
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_mathics_core_expression, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Expression); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Expression, __pyx_t_1) < 0) __PYX_ERR(0, 23, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Integer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Integer, __pyx_t_1) < 0) __PYX_ERR(0, 24, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Rational); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Rational, __pyx_t_1) < 0) __PYX_ERR(0, 25, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Real); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Real, __pyx_t_1) < 0) __PYX_ERR(0, 26, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_String); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_String, __pyx_t_1) < 0) __PYX_ERR(0, 27, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Symbol); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Symbol, __pyx_t_1) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_strip_context); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_strip_context, __pyx_t_1) < 0) __PYX_ERR(0, 29, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_system_symbols); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_system_symbols, __pyx_t_1) < 0) __PYX_ERR(0, 30, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_system_symbols_dict); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_system_symbols_dict, __pyx_t_1) < 0) __PYX_ERR(0, 31, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_from_python); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_from_python, __pyx_t_1) < 0) __PYX_ERR(0, 32, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":34
 *     from_python,
 * )
 * from mathics.builtin.colors import convert as convert_color             # <<<<<<<<<<<<<<
 * from mathics.core.numbers import machine_epsilon
 * 
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_convert);
  __Pyx_GIVEREF(__pyx_n_s_convert);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_convert);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_mathics_builtin_colors, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_convert); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_convert_color, __pyx_t_2) < 0) __PYX_ERR(0, 34, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":35
 * )
 * from mathics.builtin.colors import convert as convert_color
 * from mathics.core.numbers import machine_epsilon             # <<<<<<<<<<<<<<
 * 
 * GRAPHICS_OPTIONS = {
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_machine_epsilon);
  __Pyx_GIVEREF(__pyx_n_s_machine_epsilon);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_machine_epsilon);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_mathics_core_numbers, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_machine_epsilon); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_machine_epsilon, __pyx_t_1) < 0) __PYX_ERR(0, 35, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":38
 * 
 * GRAPHICS_OPTIONS = {
 *     "Axes": "False",             # <<<<<<<<<<<<<<
 *     "TicksStyle": "{}",
 *     "AxesStyle": "{}",
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 38, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_Axes, __pyx_n_u_False) < 0) __PYX_ERR(0, 38, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_TicksStyle, __pyx_kp_u__151) < 0) __PYX_ERR(0, 38, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_AxesStyle, __pyx_kp_u__151) < 0) __PYX_ERR(0, 38, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_LabelStyle, __pyx_kp_u__151) < 0) __PYX_ERR(0, 38, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_AspectRatio, __pyx_n_u_Automatic) < 0) __PYX_ERR(0, 38, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_PlotRange, __pyx_n_u_Automatic) < 0) __PYX_ERR(0, 38, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_PlotRangePadding, __pyx_n_u_Automatic) < 0) __PYX_ERR(0, 38, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_ImageSize, __pyx_n_u_Automatic) < 0) __PYX_ERR(0, 38, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_Background, __pyx_n_u_Automatic) < 0) __PYX_ERR(0, 38, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_OptionSyntax, __pyx_n_u_Ignore) < 0) __PYX_ERR(0, 38, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_GRAPHICS_OPTIONS, __pyx_t_2) < 0) __PYX_ERR(0, 37, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":51
 * 
 * 
 * class CoordinatesError(BoxConstructError):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_BoxConstructError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_CoordinatesError, __pyx_n_s_CoordinatesError, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_CoordinatesError, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_CoordinatesError, __pyx_t_4) < 0) __PYX_ERR(0, 51, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":55
 * 
 * 
 * class ColorError(BoxConstructError):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_BoxConstructError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_ColorError, __pyx_n_s_ColorError, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_ColorError, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ColorError, __pyx_t_4) < 0) __PYX_ERR(0, 55, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":59
 * 
 * 
 * def get_class(name):             # <<<<<<<<<<<<<<
 *     from mathics.builtin.graphics3d import GLOBALS3D
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_1get_class, 0, __pyx_n_s_get_class, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__153)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_class, __pyx_t_2) < 0) __PYX_ERR(0, 59, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":72
 * 
 * 
 * def coords(value):             # <<<<<<<<<<<<<<
 *     if value.has_form("List", 2):
 *         x, y = value.leaves[0].round_to_float(), value.leaves[1].round_to_float()
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_3coords, 0, __pyx_n_s_coords, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__155)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 72, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_coords, __pyx_t_2) < 0) __PYX_ERR(0, 72, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":81
 * 
 * 
 * class Coords(object):             # <<<<<<<<<<<<<<
 *     def __init__(self, graphics, expr=None, pos=None, d=None):
 *         self.graphics = graphics
 */
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__156); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 81, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_tuple__156, __pyx_n_s_Coords, __pyx_n_s_Coords, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 81, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "mathics/builtin/graphics.py":82
 * 
 * class Coords(object):
 *     def __init__(self, graphics, expr=None, pos=None, d=None):             # <<<<<<<<<<<<<<
 *         self.graphics = graphics
 *         self.p = pos
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_6Coords_1__init__, 0, __pyx_n_s_Coords___init, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__158)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 82, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__159);
  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_init_2, __pyx_t_3) < 0) __PYX_ERR(0, 82, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":96
 *                 self.p = coords(expr)
 * 
 *     def pos(self):             # <<<<<<<<<<<<<<
 *         p = self.graphics.translate(self.p)
 *         p = (cut(p[0]), cut(p[1]))
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_6Coords_3pos, 0, __pyx_n_s_Coords_pos, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__161)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 96, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_pos, __pyx_t_3) < 0) __PYX_ERR(0, 96, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":104
 *         return p
 * 
 *     def add(self, x, y):             # <<<<<<<<<<<<<<
 *         p = (self.p[0] + x, self.p[1] + y)
 *         return Coords(self.graphics, pos=p, d=self.d)
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_6Coords_5add, 0, __pyx_n_s_Coords_add, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__163)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 104, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_add, __pyx_t_3) < 0) __PYX_ERR(0, 104, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":81
 * 
 * 
 * class Coords(object):             # <<<<<<<<<<<<<<
 *     def __init__(self, graphics, expr=None, pos=None, d=None):
 *         self.graphics = graphics
 */
  __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_Coords, __pyx_tuple__156, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 81, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Coords, __pyx_t_3) < 0) __PYX_ERR(0, 81, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":109
 * 
 * 
 * def cut(value):             # <<<<<<<<<<<<<<
 *     "Cut values in graphics primitives (not displayed otherwise in SVG)"
 *     border = 10 ** 8
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_5cut, 0, __pyx_n_s_cut, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__165)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 109, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_cut, __pyx_t_2) < 0) __PYX_ERR(0, 109, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":119
 * 
 * 
 * def create_css(edge_color=None, face_color=None, stroke_width=None, font_color=None):             # <<<<<<<<<<<<<<
 *     css = []
 *     if edge_color is not None:
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_7create_css, 0, __pyx_n_s_create_css, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__167)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 119, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__168);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_create_css, __pyx_t_2) < 0) __PYX_ERR(0, 119, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":141
 * 
 * 
 * def asy_number(value):             # <<<<<<<<<<<<<<
 *     return "%.5g" % value
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_9asy_number, 0, __pyx_n_s_asy_number, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__170)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 141, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_asy_number, __pyx_t_2) < 0) __PYX_ERR(0, 141, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":145
 * 
 * 
 * def _to_float(x):             # <<<<<<<<<<<<<<
 *     x = x.round_to_float()
 *     if x is None:
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_11_to_float, 0, __pyx_n_s_to_float, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__172)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_to_float, __pyx_t_2) < 0) __PYX_ERR(0, 145, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":152
 * 
 * 
 * def create_pens(             # <<<<<<<<<<<<<<
 *     edge_color=None, face_color=None, stroke_width=None, is_face_element=False
 * ):
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_13create_pens, 0, __pyx_n_s_create_pens, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__174)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__175);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_create_pens, __pyx_t_2) < 0) __PYX_ERR(0, 152, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":175
 * 
 * 
 * def _data_and_options(leaves, defined_options):             # <<<<<<<<<<<<<<
 *     data = []
 *     options = defined_options.copy()
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_15_data_and_options, 0, __pyx_n_s_data_and_options, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__177)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 175, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_data_and_options, __pyx_t_2) < 0) __PYX_ERR(0, 175, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":196
 * 
 * 
 * def _euclidean_distance(a, b):             # <<<<<<<<<<<<<<
 *     return sqrt(sum((x1 - x2) * (x1 - x2) for x1, x2 in zip(a, b)))
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_17_euclidean_distance, 0, __pyx_n_s_euclidean_distance, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__179)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 196, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_euclidean_distance, __pyx_t_2) < 0) __PYX_ERR(0, 196, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":200
 * 
 * 
 * def _component_distance(a, b, i):             # <<<<<<<<<<<<<<
 *     return abs(a[i] - b[i])
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_19_component_distance, 0, __pyx_n_s_component_distance, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__181)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 200, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_component_distance, __pyx_t_2) < 0) __PYX_ERR(0, 200, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":204
 * 
 * 
 * def _cie2000_distance(lab1, lab2):             # <<<<<<<<<<<<<<
 *     # reference: https://en.wikipedia.org/wiki/Color_difference#CIEDE2000
 *     e = machine_epsilon
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_21_cie2000_distance, 0, __pyx_n_s_cie2000_distance, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__183)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 204, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_cie2000_distance, __pyx_t_2) < 0) __PYX_ERR(0, 204, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":264
 * 
 * 
 * def _CMC_distance(lab1, lab2, l, c):             # <<<<<<<<<<<<<<
 *     # reference https://en.wikipedia.org/wiki/Color_difference#CMC_l:c_.281984.29
 *     L1, L2 = lab1[0], lab2[0]
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_23_CMC_distance, 0, __pyx_n_s_CMC_distance, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__185)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 264, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_CMC_distance, __pyx_t_2) < 0) __PYX_ERR(0, 264, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":292
 * 
 * 
 * def _extract_graphics(graphics, format, evaluation):             # <<<<<<<<<<<<<<
 *     graphics_box = Expression("MakeBoxes", graphics).evaluate(evaluation)
 *     builtin = GraphicsBox(expression=False)
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_25_extract_graphics, 0, __pyx_n_s_extract_graphics, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__188)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 292, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_extract_graphics, __pyx_t_2) < 0) __PYX_ERR(0, 292, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":328
 * 
 * 
 * class _SVGTransform:             # <<<<<<<<<<<<<<
 *     def __init__(self):
 *         self.transforms = []
 */
  __pyx_t_2 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_SVGTransform, __pyx_n_s_SVGTransform, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 328, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "mathics/builtin/graphics.py":329
 * 
 * class _SVGTransform:
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         self.transforms = []
 * 
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_13_SVGTransform_1__init__, 0, __pyx_n_s_SVGTransform___init, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__190)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 329, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init_2, __pyx_t_1) < 0) __PYX_ERR(0, 329, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":332
 *         self.transforms = []
 * 
 *     def matrix(self, a, b, c, d, e, f):             # <<<<<<<<<<<<<<
 *         # a c e
 *         # b d f
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_13_SVGTransform_3matrix, 0, __pyx_n_s_SVGTransform_matrix, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__192)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 332, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_matrix_2, __pyx_t_1) < 0) __PYX_ERR(0, 332, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":338
 *         self.transforms.append("matrix(%f, %f, %f, %f, %f, %f)" % (a, b, c, d, e, f))
 * 
 *     def translate(self, x, y):             # <<<<<<<<<<<<<<
 *         self.transforms.append("translate(%f, %f)" % (x, y))
 * 
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_13_SVGTransform_5translate, 0, __pyx_n_s_SVGTransform_translate, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__194)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 338, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_translate, __pyx_t_1) < 0) __PYX_ERR(0, 338, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":341
 *         self.transforms.append("translate(%f, %f)" % (x, y))
 * 
 *     def scale(self, x, y):             # <<<<<<<<<<<<<<
 *         self.transforms.append("scale(%f, %f)" % (x, y))
 * 
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_13_SVGTransform_7scale, 0, __pyx_n_s_SVGTransform_scale, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__196)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 341, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_scale_2, __pyx_t_1) < 0) __PYX_ERR(0, 341, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":344
 *         self.transforms.append("scale(%f, %f)" % (x, y))
 * 
 *     def rotate(self, x):             # <<<<<<<<<<<<<<
 *         self.transforms.append("rotate(%f)" % x)
 * 
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_13_SVGTransform_9rotate, 0, __pyx_n_s_SVGTransform_rotate, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__198)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 344, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_rotate, __pyx_t_1) < 0) __PYX_ERR(0, 344, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":347
 *         self.transforms.append("rotate(%f)" % x)
 * 
 *     def apply(self, svg):             # <<<<<<<<<<<<<<
 *         return '<g transform="%s">%s</g>' % (" ".join(self.transforms), svg)
 * 
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_13_SVGTransform_11apply, 0, __pyx_n_s_SVGTransform_apply, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__200)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 347, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_apply, __pyx_t_1) < 0) __PYX_ERR(0, 347, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":328
 * 
 * 
 * class _SVGTransform:             # <<<<<<<<<<<<<<
 *     def __init__(self):
 *         self.transforms = []
 */
  __pyx_t_1 = __Pyx_Py3ClassCreate(((PyObject*)&__Pyx_DefaultClassType), __pyx_n_s_SVGTransform, __pyx_empty_tuple, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 328, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_SVGTransform, __pyx_t_1) < 0) __PYX_ERR(0, 328, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":351
 * 
 * 
 * class _ASYTransform:             # <<<<<<<<<<<<<<
 *     _template = """
 *     add(%s * (new picture() {
 */
  __pyx_t_2 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_ASYTransform, __pyx_n_s_ASYTransform, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 351, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "mathics/builtin/graphics.py":352
 * 
 * class _ASYTransform:
 *     _template = """             # <<<<<<<<<<<<<<
 *     add(%s * (new picture() {
 *         picture saved = currentpicture;
 */
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_template, __pyx_kp_u_add_s_new_picture_picture_saved) < 0) __PYX_ERR(0, 352, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":363
 *     """
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         self.transforms = []
 * 
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_13_ASYTransform_1__init__, 0, __pyx_n_s_ASYTransform___init, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__202)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 363, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init_2, __pyx_t_1) < 0) __PYX_ERR(0, 363, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":366
 *         self.transforms = []
 * 
 *     def matrix(self, a, b, c, d, e, f):             # <<<<<<<<<<<<<<
 *         # a c e
 *         # b d f
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_13_ASYTransform_3matrix, 0, __pyx_n_s_ASYTransform_matrix, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__204)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 366, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_matrix_2, __pyx_t_1) < 0) __PYX_ERR(0, 366, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":373
 *         self.transforms.append("(%f, %f, %f, %f, %f, %f)" % (e, f, a, c, b, d))
 * 
 *     def translate(self, x, y):             # <<<<<<<<<<<<<<
 *         self.transforms.append("shift(%f, %f)" % (x, y))
 * 
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_13_ASYTransform_5translate, 0, __pyx_n_s_ASYTransform_translate, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__206)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 373, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_translate, __pyx_t_1) < 0) __PYX_ERR(0, 373, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":376
 *         self.transforms.append("shift(%f, %f)" % (x, y))
 * 
 *     def scale(self, x, y):             # <<<<<<<<<<<<<<
 *         self.transforms.append("scale(%f, %f)" % (x, y))
 * 
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_13_ASYTransform_7scale, 0, __pyx_n_s_ASYTransform_scale, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__208)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 376, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_scale_2, __pyx_t_1) < 0) __PYX_ERR(0, 376, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":379
 *         self.transforms.append("scale(%f, %f)" % (x, y))
 * 
 *     def rotate(self, x):             # <<<<<<<<<<<<<<
 *         self.transforms.append("rotate(%f)" % x)
 * 
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_13_ASYTransform_9rotate, 0, __pyx_n_s_ASYTransform_rotate, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__210)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 379, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_rotate, __pyx_t_1) < 0) __PYX_ERR(0, 379, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":382
 *         self.transforms.append("rotate(%f)" % x)
 * 
 *     def apply(self, asy):             # <<<<<<<<<<<<<<
 *         return self._template % (" * ".join(self.transforms), asy)
 * 
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_13_ASYTransform_11apply, 0, __pyx_n_s_ASYTransform_apply, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__212)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 382, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_apply, __pyx_t_1) < 0) __PYX_ERR(0, 382, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":351
 * 
 * 
 * class _ASYTransform:             # <<<<<<<<<<<<<<
 *     _template = """
 *     add(%s * (new picture() {
 */
  __pyx_t_1 = __Pyx_Py3ClassCreate(((PyObject*)&__Pyx_DefaultClassType), __pyx_n_s_ASYTransform, __pyx_empty_tuple, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 351, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASYTransform, __pyx_t_1) < 0) __PYX_ERR(0, 351, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":386
 * 
 * 
 * class Show(Builtin):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Builtin); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 386, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 386, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 386, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_Show, __pyx_n_s_Show, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_kp_s_dl_dt_Show_graphics_options_dd); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 386, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "mathics/builtin/graphics.py":394
 *     """
 * 
 *     options = GRAPHICS_OPTIONS             # <<<<<<<<<<<<<<
 * 
 *     def apply(self, graphics, evaluation, options):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_GRAPHICS_OPTIONS); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 394, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_options, __pyx_t_4) < 0) __PYX_ERR(0, 394, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":396
 *     options = GRAPHICS_OPTIONS
 * 
 *     def apply(self, graphics, evaluation, options):             # <<<<<<<<<<<<<<
 *         """Show[graphics_, OptionsPattern[%(name)s]]"""
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_4Show_1apply, 0, __pyx_n_s_Show_apply, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__214)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 396, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_apply, __pyx_t_4) < 0) __PYX_ERR(0, 396, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":386
 * 
 * 
 * class Show(Builtin):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_Show, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 386, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Show, __pyx_t_4) < 0) __PYX_ERR(0, 386, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":419
 * 
 * 
 * class Graphics(Builtin):             # <<<<<<<<<<<<<<
 *     r"""
 *     <dl>
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Builtin); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 419, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 419, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 419, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_Graphics, __pyx_n_s_Graphics, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_kp_s_dl_dt_Graphics_primitives_optio); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 419, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "mathics/builtin/graphics.py":466
 *     """
 * 
 *     options = GRAPHICS_OPTIONS             # <<<<<<<<<<<<<<
 * 
 *     box_suffix = "Box"
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_GRAPHICS_OPTIONS); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 466, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_options, __pyx_t_4) < 0) __PYX_ERR(0, 466, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":468
 *     options = GRAPHICS_OPTIONS
 * 
 *     box_suffix = "Box"             # <<<<<<<<<<<<<<
 * 
 *     def apply_makeboxes(self, content, evaluation, options):
 */
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_box_suffix, __pyx_n_u_Box) < 0) __PYX_ERR(0, 468, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":470
 *     box_suffix = "Box"
 * 
 *     def apply_makeboxes(self, content, evaluation, options):             # <<<<<<<<<<<<<<
 *         """MakeBoxes[%(name)s[content_, OptionsPattern[%(name)s]],
 *         StandardForm|TraditionalForm|OutputForm]"""
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_8Graphics_1apply_makeboxes, 0, __pyx_n_s_Graphics_apply_makeboxes, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__216)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 470, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_apply_makeboxes, __pyx_t_4) < 0) __PYX_ERR(0, 470, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":419
 * 
 * 
 * class Graphics(Builtin):             # <<<<<<<<<<<<<<
 *     r"""
 *     <dl>
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_Graphics, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 419, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Graphics, __pyx_t_4) < 0) __PYX_ERR(0, 419, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":515
 * 
 * 
 * class _GraphicsElement(InstancableBuiltin):             # <<<<<<<<<<<<<<
 *     def init(self, graphics, item=None, style=None):
 *         if item is not None and not item.has_form(self.get_name(), None):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_InstancableBuiltin); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 515, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 515, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 515, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_GraphicsElement, __pyx_n_s_GraphicsElement, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 515, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "mathics/builtin/graphics.py":516
 * 
 * class _GraphicsElement(InstancableBuiltin):
 *     def init(self, graphics, item=None, style=None):             # <<<<<<<<<<<<<<
 *         if item is not None and not item.has_form(self.get_name(), None):
 *             raise BoxConstructError
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_16_GraphicsElement_1init, 0, __pyx_n_s_GraphicsElement_init, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__218)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 516, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__219);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(0, 516, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":524
 * 
 *     @staticmethod
 *     def create_as_style(klass, graphics, item):             # <<<<<<<<<<<<<<
 *         return klass(graphics, item)
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_16_GraphicsElement_3create_as_style, __Pyx_CYFUNCTION_STATICMETHOD, __pyx_n_s_GraphicsElement_create_as_style, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__221)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 524, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "mathics/builtin/graphics.py":523
 *         self.is_completely_visible = False  # True for axis elements
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def create_as_style(klass, graphics, item):
 *         return klass(graphics, item)
 */
  __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 523, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_create_as_style, __pyx_t_5) < 0) __PYX_ERR(0, 524, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":515
 * 
 * 
 * class _GraphicsElement(InstancableBuiltin):             # <<<<<<<<<<<<<<
 *     def init(self, graphics, item=None, style=None):
 *         if item is not None and not item.has_form(self.get_name(), None):
 */
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_GraphicsElement, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 515, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_GraphicsElement, __pyx_t_5) < 0) __PYX_ERR(0, 515, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":528
 * 
 * 
 * class _Color(_GraphicsElement):             # <<<<<<<<<<<<<<
 *     formats = {
 *         # we are adding ImageSizeMultipliers in the rule below, because we do _not_ want color boxes to
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_GraphicsElement); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 528, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 528, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 528, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_Color, __pyx_n_s_Color, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 528, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "mathics/builtin/graphics.py":534
 *         # way in the notebook, so we restrict the rule to StandardForm.
 *         (
 *             ("StandardForm",),             # <<<<<<<<<<<<<<
 *             "%(name)s[x__?(NumericQ[#] && 0 <= # <= 1&)]",
 *         ): "Style[Graphics[{EdgeForm[Black], %(name)s[x], Rectangle[]}, ImageSize -> 16], "
 */
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 534, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_tuple__223, __pyx_kp_u_Style_Graphics_EdgeForm_Black_na) < 0) __PYX_ERR(0, 534, __pyx_L1_error)
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_formats, __pyx_t_5) < 0) __PYX_ERR(0, 529, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":541
 * 
 *     rules = {
 *         "%(name)s[x_List]": "Apply[%(name)s, x]",             # <<<<<<<<<<<<<<
 *     }
 * 
 */
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 541, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_kp_u_name_s_x_List, __pyx_kp_u_Apply_name_s_x) < 0) __PYX_ERR(0, 541, __pyx_L1_error)
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_rules, __pyx_t_5) < 0) __PYX_ERR(0, 540, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":544
 *     }
 * 
 *     components_sizes = []             # <<<<<<<<<<<<<<
 *     default_components = []
 * 
 */
  __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 544, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_components_sizes, __pyx_t_5) < 0) __PYX_ERR(0, 544, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":545
 * 
 *     components_sizes = []
 *     default_components = []             # <<<<<<<<<<<<<<
 * 
 *     def init(self, item=None, components=None):
 */
  __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 545, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_default_components, __pyx_t_5) < 0) __PYX_ERR(0, 545, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":547
 *     default_components = []
 * 
 *     def init(self, item=None, components=None):             # <<<<<<<<<<<<<<
 *         super(_Color, self).init(None, item)
 *         if item is not None:
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_6_Color_1init, 0, __pyx_n_s_Color_init, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__225)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 547, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_tuple__226);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_init, __pyx_t_5) < 0) __PYX_ERR(0, 547, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":575
 * 
 *     @staticmethod
 *     def create(expr):             # <<<<<<<<<<<<<<
 *         head = expr.get_head_name()
 *         cls = get_class(head)
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_6_Color_3create, __Pyx_CYFUNCTION_STATICMETHOD, __pyx_n_s_Color_create, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__228)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 575, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "mathics/builtin/graphics.py":574
 *             self.components = components
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def create(expr):
 *         head = expr.get_head_name()
 */
  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 574, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_create, __pyx_t_4) < 0) __PYX_ERR(0, 575, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":583
 * 
 *     @staticmethod
 *     def create_as_style(klass, graphics, item):             # <<<<<<<<<<<<<<
 *         return klass(item)
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_6_Color_5create_as_style, __Pyx_CYFUNCTION_STATICMETHOD, __pyx_n_s_Color_create_as_style, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__230)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 583, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "mathics/builtin/graphics.py":582
 *         return cls(expr)
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def create_as_style(klass, graphics, item):
 *         return klass(item)
 */
  __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 582, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_create_as_style, __pyx_t_5) < 0) __PYX_ERR(0, 583, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":586
 *         return klass(item)
 * 
 *     def to_css(self):             # <<<<<<<<<<<<<<
 *         rgba = self.to_rgba()
 *         alpha = rgba[3] if len(rgba) > 3 else 1.0
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_6_Color_7to_css, 0, __pyx_n_s_Color_to_css, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__232)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 586, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_to_css, __pyx_t_5) < 0) __PYX_ERR(0, 586, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":594
 *         )
 * 
 *     def to_asy(self):             # <<<<<<<<<<<<<<
 *         rgba = self.to_rgba()
 *         alpha = rgba[3] if len(rgba) > 3 else 1.0
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_6_Color_9to_asy, 0, __pyx_n_s_Color_to_asy, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__234)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 594, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_to_asy, __pyx_t_5) < 0) __PYX_ERR(0, 594, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":603
 *         )
 * 
 *     def to_js(self):             # <<<<<<<<<<<<<<
 *         return self.to_rgba()
 * 
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_6_Color_11to_js, 0, __pyx_n_s_Color_to_js, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__236)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 603, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_to_js, __pyx_t_5) < 0) __PYX_ERR(0, 603, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":606
 *         return self.to_rgba()
 * 
 *     def to_expr(self):             # <<<<<<<<<<<<<<
 *         return Expression(self.get_name(), *self.components)
 * 
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_6_Color_13to_expr, 0, __pyx_n_s_Color_to_expr, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__238)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 606, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_to_expr, __pyx_t_5) < 0) __PYX_ERR(0, 606, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":609
 *         return Expression(self.get_name(), *self.components)
 * 
 *     def to_rgba(self):             # <<<<<<<<<<<<<<
 *         return self.to_color_space("RGB")
 * 
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_6_Color_15to_rgba, 0, __pyx_n_s_Color_to_rgba, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__240)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 609, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_to_rgba, __pyx_t_5) < 0) __PYX_ERR(0, 609, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":612
 *         return self.to_color_space("RGB")
 * 
 *     def to_color_space(self, color_space):             # <<<<<<<<<<<<<<
 *         components = convert_color(self.components, self.color_space, color_space)
 *         if components is None:
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_6_Color_17to_color_space, 0, __pyx_n_s_Color_to_color_space, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__242)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 612, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_to_color_space, __pyx_t_5) < 0) __PYX_ERR(0, 612, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":528
 * 
 * 
 * class _Color(_GraphicsElement):             # <<<<<<<<<<<<<<
 *     formats = {
 *         # we are adding ImageSizeMultipliers in the rule below, because we do _not_ want color boxes to
 */
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_Color, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 528, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Color, __pyx_t_5) < 0) __PYX_ERR(0, 528, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":622
 * 
 * 
 * class RGBColor(_Color):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Color); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 622, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 622, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 622, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_RGBColor, __pyx_n_s_RGBColor, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_kp_s_dl_dt_RGBColor_r_g_b_dd_represe); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 622, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "mathics/builtin/graphics.py":640
 *     """
 * 
 *     color_space = "RGB"             # <<<<<<<<<<<<<<
 *     components_sizes = [3, 4]
 *     default_components = [0, 0, 0, 1]
 */
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_color_space, __pyx_n_u_RGB) < 0) __PYX_ERR(0, 640, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":641
 * 
 *     color_space = "RGB"
 *     components_sizes = [3, 4]             # <<<<<<<<<<<<<<
 *     default_components = [0, 0, 0, 1]
 * 
 */
  __pyx_t_5 = PyList_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 641, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_int_3);
  __Pyx_GIVEREF(__pyx_int_3);
  PyList_SET_ITEM(__pyx_t_5, 0, __pyx_int_3);
  __Pyx_INCREF(__pyx_int_4);
  __Pyx_GIVEREF(__pyx_int_4);
  PyList_SET_ITEM(__pyx_t_5, 1, __pyx_int_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_components_sizes, __pyx_t_5) < 0) __PYX_ERR(0, 641, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":642
 *     color_space = "RGB"
 *     components_sizes = [3, 4]
 *     default_components = [0, 0, 0, 1]             # <<<<<<<<<<<<<<
 * 
 *     def to_rgba(self):
 */
  __pyx_t_5 = PyList_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 642, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyList_SET_ITEM(__pyx_t_5, 0, __pyx_int_0);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyList_SET_ITEM(__pyx_t_5, 1, __pyx_int_0);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyList_SET_ITEM(__pyx_t_5, 2, __pyx_int_0);
  __Pyx_INCREF(__pyx_int_1);
  __Pyx_GIVEREF(__pyx_int_1);
  PyList_SET_ITEM(__pyx_t_5, 3, __pyx_int_1);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_default_components, __pyx_t_5) < 0) __PYX_ERR(0, 642, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":644
 *     default_components = [0, 0, 0, 1]
 * 
 *     def to_rgba(self):             # <<<<<<<<<<<<<<
 *         return self.components
 * 
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_8RGBColor_1to_rgba, 0, __pyx_n_s_RGBColor_to_rgba, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__244)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 644, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_to_rgba, __pyx_t_5) < 0) __PYX_ERR(0, 644, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":622
 * 
 * 
 * class RGBColor(_Color):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_RGBColor, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 622, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_RGBColor, __pyx_t_5) < 0) __PYX_ERR(0, 622, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":648
 * 
 * 
 * class LABColor(_Color):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 648, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 648, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 648, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_LABColor, __pyx_n_s_LABColor, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_kp_s_dl_dt_LABColor_l_a_b_dd_represe); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 648, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "mathics/builtin/graphics.py":657
 *     """
 * 
 *     color_space = "LAB"             # <<<<<<<<<<<<<<
 *     components_sizes = [3, 4]
 *     default_components = [0, 0, 0, 1]
 */
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_color_space, __pyx_n_u_LAB) < 0) __PYX_ERR(0, 657, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":658
 * 
 *     color_space = "LAB"
 *     components_sizes = [3, 4]             # <<<<<<<<<<<<<<
 *     default_components = [0, 0, 0, 1]
 * 
 */
  __pyx_t_5 = PyList_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 658, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_int_3);
  __Pyx_GIVEREF(__pyx_int_3);
  PyList_SET_ITEM(__pyx_t_5, 0, __pyx_int_3);
  __Pyx_INCREF(__pyx_int_4);
  __Pyx_GIVEREF(__pyx_int_4);
  PyList_SET_ITEM(__pyx_t_5, 1, __pyx_int_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_components_sizes, __pyx_t_5) < 0) __PYX_ERR(0, 658, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":659
 *     color_space = "LAB"
 *     components_sizes = [3, 4]
 *     default_components = [0, 0, 0, 1]             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_5 = PyList_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 659, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyList_SET_ITEM(__pyx_t_5, 0, __pyx_int_0);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyList_SET_ITEM(__pyx_t_5, 1, __pyx_int_0);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyList_SET_ITEM(__pyx_t_5, 2, __pyx_int_0);
  __Pyx_INCREF(__pyx_int_1);
  __Pyx_GIVEREF(__pyx_int_1);
  PyList_SET_ITEM(__pyx_t_5, 3, __pyx_int_1);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_default_components, __pyx_t_5) < 0) __PYX_ERR(0, 659, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":648
 * 
 * 
 * class LABColor(_Color):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_LABColor, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 648, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_LABColor, __pyx_t_5) < 0) __PYX_ERR(0, 648, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":662
 * 
 * 
 * class LCHColor(_Color):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Color); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 662, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 662, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 662, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_LCHColor, __pyx_n_s_LCHColor, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_kp_s_dl_dt_LCHColor_l_c_h_dd_represe); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 662, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "mathics/builtin/graphics.py":671
 *     """
 * 
 *     color_space = "LCH"             # <<<<<<<<<<<<<<
 *     components_sizes = [3, 4]
 *     default_components = [0, 0, 0, 1]
 */
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_color_space, __pyx_n_u_LCH) < 0) __PYX_ERR(0, 671, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":672
 * 
 *     color_space = "LCH"
 *     components_sizes = [3, 4]             # <<<<<<<<<<<<<<
 *     default_components = [0, 0, 0, 1]
 * 
 */
  __pyx_t_5 = PyList_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 672, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_int_3);
  __Pyx_GIVEREF(__pyx_int_3);
  PyList_SET_ITEM(__pyx_t_5, 0, __pyx_int_3);
  __Pyx_INCREF(__pyx_int_4);
  __Pyx_GIVEREF(__pyx_int_4);
  PyList_SET_ITEM(__pyx_t_5, 1, __pyx_int_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_components_sizes, __pyx_t_5) < 0) __PYX_ERR(0, 672, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":673
 *     color_space = "LCH"
 *     components_sizes = [3, 4]
 *     default_components = [0, 0, 0, 1]             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_5 = PyList_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 673, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyList_SET_ITEM(__pyx_t_5, 0, __pyx_int_0);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyList_SET_ITEM(__pyx_t_5, 1, __pyx_int_0);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyList_SET_ITEM(__pyx_t_5, 2, __pyx_int_0);
  __Pyx_INCREF(__pyx_int_1);
  __Pyx_GIVEREF(__pyx_int_1);
  PyList_SET_ITEM(__pyx_t_5, 3, __pyx_int_1);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_default_components, __pyx_t_5) < 0) __PYX_ERR(0, 673, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":662
 * 
 * 
 * class LCHColor(_Color):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_LCHColor, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 662, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_LCHColor, __pyx_t_5) < 0) __PYX_ERR(0, 662, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":676
 * 
 * 
 * class LUVColor(_Color):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 676, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 676, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 676, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_LUVColor, __pyx_n_s_LUVColor, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_kp_s_dl_dt_LCHColor_l_u_v_dd_represe); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 676, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "mathics/builtin/graphics.py":684
 *     """
 * 
 *     color_space = "LUV"             # <<<<<<<<<<<<<<
 *     components_sizes = [3, 4]
 *     default_components = [0, 0, 0, 1]
 */
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_color_space, __pyx_n_u_LUV) < 0) __PYX_ERR(0, 684, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":685
 * 
 *     color_space = "LUV"
 *     components_sizes = [3, 4]             # <<<<<<<<<<<<<<
 *     default_components = [0, 0, 0, 1]
 * 
 */
  __pyx_t_5 = PyList_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 685, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_int_3);
  __Pyx_GIVEREF(__pyx_int_3);
  PyList_SET_ITEM(__pyx_t_5, 0, __pyx_int_3);
  __Pyx_INCREF(__pyx_int_4);
  __Pyx_GIVEREF(__pyx_int_4);
  PyList_SET_ITEM(__pyx_t_5, 1, __pyx_int_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_components_sizes, __pyx_t_5) < 0) __PYX_ERR(0, 685, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":686
 *     color_space = "LUV"
 *     components_sizes = [3, 4]
 *     default_components = [0, 0, 0, 1]             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_5 = PyList_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 686, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyList_SET_ITEM(__pyx_t_5, 0, __pyx_int_0);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyList_SET_ITEM(__pyx_t_5, 1, __pyx_int_0);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyList_SET_ITEM(__pyx_t_5, 2, __pyx_int_0);
  __Pyx_INCREF(__pyx_int_1);
  __Pyx_GIVEREF(__pyx_int_1);
  PyList_SET_ITEM(__pyx_t_5, 3, __pyx_int_1);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_default_components, __pyx_t_5) < 0) __PYX_ERR(0, 686, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":676
 * 
 * 
 * class LUVColor(_Color):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_LUVColor, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 676, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_LUVColor, __pyx_t_5) < 0) __PYX_ERR(0, 676, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":689
 * 
 * 
 * class XYZColor(_Color):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Color); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 689, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 689, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 689, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_XYZColor, __pyx_n_s_XYZColor, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_kp_s_dl_dt_XYZColor_x_y_z_dd_represe); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 689, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "mathics/builtin/graphics.py":697
 *     """
 * 
 *     color_space = "XYZ"             # <<<<<<<<<<<<<<
 *     components_sizes = [3, 4]
 *     default_components = [0, 0, 0, 1]
 */
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_color_space, __pyx_n_u_XYZ) < 0) __PYX_ERR(0, 697, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":698
 * 
 *     color_space = "XYZ"
 *     components_sizes = [3, 4]             # <<<<<<<<<<<<<<
 *     default_components = [0, 0, 0, 1]
 * 
 */
  __pyx_t_5 = PyList_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 698, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_int_3);
  __Pyx_GIVEREF(__pyx_int_3);
  PyList_SET_ITEM(__pyx_t_5, 0, __pyx_int_3);
  __Pyx_INCREF(__pyx_int_4);
  __Pyx_GIVEREF(__pyx_int_4);
  PyList_SET_ITEM(__pyx_t_5, 1, __pyx_int_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_components_sizes, __pyx_t_5) < 0) __PYX_ERR(0, 698, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":699
 *     color_space = "XYZ"
 *     components_sizes = [3, 4]
 *     default_components = [0, 0, 0, 1]             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_5 = PyList_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 699, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyList_SET_ITEM(__pyx_t_5, 0, __pyx_int_0);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyList_SET_ITEM(__pyx_t_5, 1, __pyx_int_0);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyList_SET_ITEM(__pyx_t_5, 2, __pyx_int_0);
  __Pyx_INCREF(__pyx_int_1);
  __Pyx_GIVEREF(__pyx_int_1);
  PyList_SET_ITEM(__pyx_t_5, 3, __pyx_int_1);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_default_components, __pyx_t_5) < 0) __PYX_ERR(0, 699, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":689
 * 
 * 
 * class XYZColor(_Color):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_XYZColor, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 689, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_XYZColor, __pyx_t_5) < 0) __PYX_ERR(0, 689, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":702
 * 
 * 
 * class CMYKColor(_Color):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 702, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 702, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 702, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_CMYKColor, __pyx_n_s_CMYKColor, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_kp_s_dl_dt_CMYKColor_c_m_y_k_dd_repr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 702, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "mathics/builtin/graphics.py":714
 *     """
 * 
 *     color_space = "CMYK"             # <<<<<<<<<<<<<<
 *     components_sizes = [3, 4, 5]
 *     default_components = [0, 0, 0, 0, 1]
 */
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_color_space, __pyx_n_u_CMYK) < 0) __PYX_ERR(0, 714, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":715
 * 
 *     color_space = "CMYK"
 *     components_sizes = [3, 4, 5]             # <<<<<<<<<<<<<<
 *     default_components = [0, 0, 0, 0, 1]
 * 
 */
  __pyx_t_5 = PyList_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 715, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_int_3);
  __Pyx_GIVEREF(__pyx_int_3);
  PyList_SET_ITEM(__pyx_t_5, 0, __pyx_int_3);
  __Pyx_INCREF(__pyx_int_4);
  __Pyx_GIVEREF(__pyx_int_4);
  PyList_SET_ITEM(__pyx_t_5, 1, __pyx_int_4);
  __Pyx_INCREF(__pyx_int_5);
  __Pyx_GIVEREF(__pyx_int_5);
  PyList_SET_ITEM(__pyx_t_5, 2, __pyx_int_5);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_components_sizes, __pyx_t_5) < 0) __PYX_ERR(0, 715, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":716
 *     color_space = "CMYK"
 *     components_sizes = [3, 4, 5]
 *     default_components = [0, 0, 0, 0, 1]             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_5 = PyList_New(5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 716, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyList_SET_ITEM(__pyx_t_5, 0, __pyx_int_0);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyList_SET_ITEM(__pyx_t_5, 1, __pyx_int_0);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyList_SET_ITEM(__pyx_t_5, 2, __pyx_int_0);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyList_SET_ITEM(__pyx_t_5, 3, __pyx_int_0);
  __Pyx_INCREF(__pyx_int_1);
  __Pyx_GIVEREF(__pyx_int_1);
  PyList_SET_ITEM(__pyx_t_5, 4, __pyx_int_1);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_default_components, __pyx_t_5) < 0) __PYX_ERR(0, 716, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":702
 * 
 * 
 * class CMYKColor(_Color):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_CMYKColor, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 702, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_CMYKColor, __pyx_t_5) < 0) __PYX_ERR(0, 702, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":719
 * 
 * 
 * class Hue(_Color):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Color); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 719, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 719, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 719, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_Hue, __pyx_n_s_Hue, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_kp_s_dl_dt_Hue_h_s_l_a_dd_represents); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 719, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "mathics/builtin/graphics.py":739
 *     """
 * 
 *     color_space = "HSB"             # <<<<<<<<<<<<<<
 *     components_sizes = [1, 2, 3, 4]
 *     default_components = [0, 1, 1, 1]
 */
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_color_space, __pyx_n_u_HSB) < 0) __PYX_ERR(0, 739, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":740
 * 
 *     color_space = "HSB"
 *     components_sizes = [1, 2, 3, 4]             # <<<<<<<<<<<<<<
 *     default_components = [0, 1, 1, 1]
 * 
 */
  __pyx_t_5 = PyList_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 740, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_int_1);
  __Pyx_GIVEREF(__pyx_int_1);
  PyList_SET_ITEM(__pyx_t_5, 0, __pyx_int_1);
  __Pyx_INCREF(__pyx_int_2);
  __Pyx_GIVEREF(__pyx_int_2);
  PyList_SET_ITEM(__pyx_t_5, 1, __pyx_int_2);
  __Pyx_INCREF(__pyx_int_3);
  __Pyx_GIVEREF(__pyx_int_3);
  PyList_SET_ITEM(__pyx_t_5, 2, __pyx_int_3);
  __Pyx_INCREF(__pyx_int_4);
  __Pyx_GIVEREF(__pyx_int_4);
  PyList_SET_ITEM(__pyx_t_5, 3, __pyx_int_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_components_sizes, __pyx_t_5) < 0) __PYX_ERR(0, 740, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":741
 *     color_space = "HSB"
 *     components_sizes = [1, 2, 3, 4]
 *     default_components = [0, 1, 1, 1]             # <<<<<<<<<<<<<<
 * 
 *     def hsl_to_rgba(self):
 */
  __pyx_t_5 = PyList_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 741, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyList_SET_ITEM(__pyx_t_5, 0, __pyx_int_0);
  __Pyx_INCREF(__pyx_int_1);
  __Pyx_GIVEREF(__pyx_int_1);
  PyList_SET_ITEM(__pyx_t_5, 1, __pyx_int_1);
  __Pyx_INCREF(__pyx_int_1);
  __Pyx_GIVEREF(__pyx_int_1);
  PyList_SET_ITEM(__pyx_t_5, 2, __pyx_int_1);
  __Pyx_INCREF(__pyx_int_1);
  __Pyx_GIVEREF(__pyx_int_1);
  PyList_SET_ITEM(__pyx_t_5, 3, __pyx_int_1);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_default_components, __pyx_t_5) < 0) __PYX_ERR(0, 741, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":743
 *     default_components = [0, 1, 1, 1]
 * 
 *     def hsl_to_rgba(self):             # <<<<<<<<<<<<<<
 *         h, s, l = self.components[:3]
 *         if l < 0.5:
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_3Hue_1hsl_to_rgba, 0, __pyx_n_s_Hue_hsl_to_rgba, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__246)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 743, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_hsl_to_rgba, __pyx_t_5) < 0) __PYX_ERR(0, 743, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":719
 * 
 * 
 * class Hue(_Color):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_Hue, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 719, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Hue, __pyx_t_5) < 0) __PYX_ERR(0, 719, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":774
 * 
 * 
 * class GrayLevel(_Color):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 774, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 774, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 774, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_GrayLevel, __pyx_n_s_GrayLevel, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_kp_s_dl_dt_GrayLevel_g_dd_represents); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 774, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "mathics/builtin/graphics.py":785
 *     """
 * 
 *     color_space = "Grayscale"             # <<<<<<<<<<<<<<
 *     components_sizes = [1, 2]
 *     default_components = [0, 1]
 */
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_color_space, __pyx_n_u_Grayscale) < 0) __PYX_ERR(0, 785, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":786
 * 
 *     color_space = "Grayscale"
 *     components_sizes = [1, 2]             # <<<<<<<<<<<<<<
 *     default_components = [0, 1]
 * 
 */
  __pyx_t_5 = PyList_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 786, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_int_1);
  __Pyx_GIVEREF(__pyx_int_1);
  PyList_SET_ITEM(__pyx_t_5, 0, __pyx_int_1);
  __Pyx_INCREF(__pyx_int_2);
  __Pyx_GIVEREF(__pyx_int_2);
  PyList_SET_ITEM(__pyx_t_5, 1, __pyx_int_2);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_components_sizes, __pyx_t_5) < 0) __PYX_ERR(0, 786, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":787
 *     color_space = "Grayscale"
 *     components_sizes = [1, 2]
 *     default_components = [0, 1]             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_5 = PyList_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 787, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyList_SET_ITEM(__pyx_t_5, 0, __pyx_int_0);
  __Pyx_INCREF(__pyx_int_1);
  __Pyx_GIVEREF(__pyx_int_1);
  PyList_SET_ITEM(__pyx_t_5, 1, __pyx_int_1);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_default_components, __pyx_t_5) < 0) __PYX_ERR(0, 787, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":774
 * 
 * 
 * class GrayLevel(_Color):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_GrayLevel, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 774, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_GrayLevel, __pyx_t_5) < 0) __PYX_ERR(0, 774, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":790
 * 
 * 
 * def expression_to_color(color):             # <<<<<<<<<<<<<<
 *     try:
 *         return _Color.create(color)
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_27expression_to_color, 0, __pyx_n_s_expression_to_color, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__248)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 790, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_expression_to_color, __pyx_t_2) < 0) __PYX_ERR(0, 790, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":797
 * 
 * 
 * def color_to_expression(components, colorspace):             # <<<<<<<<<<<<<<
 *     if colorspace == "Grayscale":
 *         converted_color_name = "GrayLevel"
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_29color_to_expression, 0, __pyx_n_s_color_to_expression, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__250)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 797, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_color_to_expression, __pyx_t_2) < 0) __PYX_ERR(0, 797, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":808
 * 
 * 
 * class ColorDistance(Builtin):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Builtin); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 808, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 808, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 808, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_ColorDistance, __pyx_n_s_ColorDistance, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_kp_s_dl_dt_ColorDistance_c1_c2_dd_re); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 808, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "mathics/builtin/graphics.py":842
 * 
 *     options = {
 *         "DistanceFunction": "Automatic",             # <<<<<<<<<<<<<<
 *     }
 * 
 */
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 842, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_DistanceFunction, __pyx_n_u_Automatic) < 0) __PYX_ERR(0, 842, __pyx_L1_error)
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_options, __pyx_t_5) < 0) __PYX_ERR(0, 841, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":846
 * 
 *     messages = {
 *         "invdist": "`1` is not Automatic or a valid distance specification.",             # <<<<<<<<<<<<<<
 *         "invarg": "`1` and `2` should be two colors or a color and a lists of colors or "
 *         + "two lists of colors of the same length.",
 */
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 846, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_invdist, __pyx_kp_u_1_is_not_Automatic_or_a_valid_d) < 0) __PYX_ERR(0, 846, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_invarg, __pyx_kp_u_1_and_2_should_be_two_colors_or) < 0) __PYX_ERR(0, 846, __pyx_L1_error)
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_messages, __pyx_t_5) < 0) __PYX_ERR(0, 845, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":855
 * 
 *     _distances = {
 *         "CIE76": lambda c1, c2: _euclidean_distance(             # <<<<<<<<<<<<<<
 *             c1.to_color_space("LAB")[:3], c2.to_color_space("LAB")[:3]
 *         ),
 */
  __pyx_t_5 = __Pyx_PyDict_NewPresized(8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 855, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_13ColorDistance_2lambda4, 0, __pyx_n_s_ColorDistance_lambda, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 855, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_CIE76, __pyx_t_4) < 0) __PYX_ERR(0, 855, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":858
 *             c1.to_color_space("LAB")[:3], c2.to_color_space("LAB")[:3]
 *         ),
 *         "CIE94": lambda c1, c2: _euclidean_distance(             # <<<<<<<<<<<<<<
 *             c1.to_color_space("LCH")[:3], c2.to_color_space("LCH")[:3]
 *         ),
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_13ColorDistance_3lambda5, 0, __pyx_n_s_ColorDistance_lambda, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 858, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_CIE94, __pyx_t_4) < 0) __PYX_ERR(0, 855, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":861
 *             c1.to_color_space("LCH")[:3], c2.to_color_space("LCH")[:3]
 *         ),
 *         "CIE2000": lambda c1, c2: _cie2000_distance(             # <<<<<<<<<<<<<<
 *             100 * c1.to_color_space("LAB")[:3], 100 * c2.to_color_space("LAB")[:3]
 *         )
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_13ColorDistance_4lambda6, 0, __pyx_n_s_ColorDistance_lambda, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 861, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_CIE2000, __pyx_t_4) < 0) __PYX_ERR(0, 855, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":865
 *         )
 *         / 100,
 *         "CIEDE2000": lambda c1, c2: _cie2000_distance(             # <<<<<<<<<<<<<<
 *             100 * c1.to_color_space("LAB")[:3], 100 * c2.to_color_space("LAB")[:3]
 *         )
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_13ColorDistance_5lambda7, 0, __pyx_n_s_ColorDistance_lambda, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 865, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_CIEDE2000, __pyx_t_4) < 0) __PYX_ERR(0, 855, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":869
 *         )
 *         / 100,
 *         "DeltaL": lambda c1, c2: _component_distance(             # <<<<<<<<<<<<<<
 *             c1.to_color_space("LCH"), c2.to_color_space("LCH"), 0
 *         ),
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_13ColorDistance_6lambda8, 0, __pyx_n_s_ColorDistance_lambda, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 869, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_DeltaL, __pyx_t_4) < 0) __PYX_ERR(0, 855, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":872
 *             c1.to_color_space("LCH"), c2.to_color_space("LCH"), 0
 *         ),
 *         "DeltaC": lambda c1, c2: _component_distance(             # <<<<<<<<<<<<<<
 *             c1.to_color_space("LCH"), c2.to_color_space("LCH"), 1
 *         ),
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_13ColorDistance_7lambda9, 0, __pyx_n_s_ColorDistance_lambda, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 872, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_DeltaC, __pyx_t_4) < 0) __PYX_ERR(0, 855, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":875
 *             c1.to_color_space("LCH"), c2.to_color_space("LCH"), 1
 *         ),
 *         "DeltaH": lambda c1, c2: _component_distance(             # <<<<<<<<<<<<<<
 *             c1.to_color_space("LCH"), c2.to_color_space("LCH"), 2
 *         ),
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_13ColorDistance_8lambda10, 0, __pyx_n_s_ColorDistance_lambda, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 875, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_DeltaH, __pyx_t_4) < 0) __PYX_ERR(0, 855, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":878
 *             c1.to_color_space("LCH"), c2.to_color_space("LCH"), 2
 *         ),
 *         "CMC": lambda c1, c2: _CMC_distance(             # <<<<<<<<<<<<<<
 *             100 * c1.to_color_space("LAB")[:3], 100 * c2.to_color_space("LAB")[:3], 1, 1
 *         )
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_13ColorDistance_9lambda11, 0, __pyx_n_s_ColorDistance_lambda, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 878, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_CMC, __pyx_t_4) < 0) __PYX_ERR(0, 855, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_distances, __pyx_t_5) < 0) __PYX_ERR(0, 854, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":884
 *     }
 * 
 *     def apply(self, c1, c2, evaluation, options):             # <<<<<<<<<<<<<<
 *         "ColorDistance[c1_, c2_, OptionsPattern[ColorDistance]]"
 * 
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_13ColorDistance_1apply, 0, __pyx_n_s_ColorDistance_apply, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__252)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 884, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_apply, __pyx_t_5) < 0) __PYX_ERR(0, 884, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":808
 * 
 * 
 * class ColorDistance(Builtin):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_ColorDistance, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 808, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ColorDistance, __pyx_t_5) < 0) __PYX_ERR(0, 808, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1001
 * 
 * 
 * class _Size(_GraphicsElement):             # <<<<<<<<<<<<<<
 *     def init(self, graphics, item=None, value=None):
 *         super(_Size, self).init(graphics, item)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_GraphicsElement); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1001, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1001, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1001, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_Size, __pyx_n_s_Size, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1001, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "mathics/builtin/graphics.py":1002
 * 
 * class _Size(_GraphicsElement):
 *     def init(self, graphics, item=None, value=None):             # <<<<<<<<<<<<<<
 *         super(_Size, self).init(graphics, item)
 *         if item is not None:
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_5_Size_1init, 0, __pyx_n_s_Size_init, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__254)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1002, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_tuple__255);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_init, __pyx_t_5) < 0) __PYX_ERR(0, 1002, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":1001
 * 
 * 
 * class _Size(_GraphicsElement):             # <<<<<<<<<<<<<<
 *     def init(self, graphics, item=None, value=None):
 *         super(_Size, self).init(graphics, item)
 */
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_Size, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1001, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Size, __pyx_t_5) < 0) __PYX_ERR(0, 1001, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":1014
 * 
 * 
 * class _Thickness(_Size):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1014, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1014, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1014, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_Thickness, __pyx_n_s_Thickness, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1014, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_Thickness, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1014, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Thickness, __pyx_t_5) < 0) __PYX_ERR(0, 1014, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1018
 * 
 * 
 * class AbsoluteThickness(_Thickness):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Thickness); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1018, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1018, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1018, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_AbsoluteThickness, __pyx_n_s_AbsoluteThickness, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_kp_s_dl_dt_AbsoluteThickness_p_dd_se); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1018, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "mathics/builtin/graphics.py":1030
 *     """
 * 
 *     def get_thickness(self):             # <<<<<<<<<<<<<<
 *         return self.graphics.translate_absolute((self.value, 0))[0]
 * 
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_17AbsoluteThickness_1get_thickness, 0, __pyx_n_s_AbsoluteThickness_get_thickness, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__257)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1030, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_get_thickness, __pyx_t_5) < 0) __PYX_ERR(0, 1030, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":1018
 * 
 * 
 * class AbsoluteThickness(_Thickness):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_AbsoluteThickness, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1018, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_AbsoluteThickness, __pyx_t_5) < 0) __PYX_ERR(0, 1018, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":1034
 * 
 * 
 * class Thickness(_Thickness):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Thickness); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1034, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1034, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1034, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_Thickness_2, __pyx_n_s_Thickness_2, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_kp_s_dl_dt_Thickness_t_dd_sets_the_l); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1034, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "mathics/builtin/graphics.py":1046
 *     """
 * 
 *     def get_thickness(self):             # <<<<<<<<<<<<<<
 *         return self.graphics.translate_relative(self.value)
 * 
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_9Thickness_1get_thickness, 0, __pyx_n_s_Thickness_get_thickness, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__259)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1046, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_get_thickness, __pyx_t_5) < 0) __PYX_ERR(0, 1046, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":1034
 * 
 * 
 * class Thickness(_Thickness):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_Thickness_2, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1034, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Thickness_2, __pyx_t_5) < 0) __PYX_ERR(0, 1034, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1050
 * 
 * 
 * class Thin(Builtin):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Builtin); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1050, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1050, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1050, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_Thin, __pyx_n_s_Thin, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_kp_s_dl_dt_Thin_dd_sets_the_line_wid); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1050, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "mathics/builtin/graphics.py":1059
 * 
 *     rules = {
 *         "Thin": "AbsoluteThickness[0.5]",             # <<<<<<<<<<<<<<
 *     }
 * 
 */
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1059, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_Thin, __pyx_kp_u_AbsoluteThickness_0_5) < 0) __PYX_ERR(0, 1059, __pyx_L1_error)
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_rules, __pyx_t_5) < 0) __PYX_ERR(0, 1058, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":1050
 * 
 * 
 * class Thin(Builtin):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_Thin, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1050, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Thin, __pyx_t_5) < 0) __PYX_ERR(0, 1050, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":1063
 * 
 * 
 * class Thick(Builtin):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Builtin); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1063, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1063, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1063, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_Thick, __pyx_n_s_Thick, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_kp_s_dl_dt_Thick_dd_sets_the_line_wi); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1063, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "mathics/builtin/graphics.py":1072
 * 
 *     rules = {
 *         "Thick": "AbsoluteThickness[2]",             # <<<<<<<<<<<<<<
 *     }
 * 
 */
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1072, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_Thick, __pyx_kp_u_AbsoluteThickness_2) < 0) __PYX_ERR(0, 1072, __pyx_L1_error)
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_rules, __pyx_t_5) < 0) __PYX_ERR(0, 1071, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":1063
 * 
 * 
 * class Thick(Builtin):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_Thick, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1063, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Thick, __pyx_t_5) < 0) __PYX_ERR(0, 1063, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1076
 * 
 * 
 * class PointSize(_Size):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1076, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1076, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1076, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_PointSize, __pyx_n_s_PointSize, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_kp_s_dl_dt_PointSize_t_dd_sets_the_d); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1076, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "mathics/builtin/graphics.py":1084
 *     """
 * 
 *     def get_size(self):             # <<<<<<<<<<<<<<
 *         return self.graphics.view_width * self.value
 * 
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_9PointSize_1get_size, 0, __pyx_n_s_PointSize_get_size, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__261)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1084, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_get_size, __pyx_t_5) < 0) __PYX_ERR(0, 1084, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":1076
 * 
 * 
 * class PointSize(_Size):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_PointSize, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1076, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PointSize, __pyx_t_5) < 0) __PYX_ERR(0, 1076, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":1088
 * 
 * 
 * class FontColor(Builtin):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Builtin); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1088, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1088, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1088, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_FontColor, __pyx_n_s_FontColor, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_kp_s_dl_dt_FontColor_dd_is_an_option); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1088, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_FontColor, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1088, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FontColor, __pyx_t_5) < 0) __PYX_ERR(0, 1088, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1099
 * 
 * 
 * class Offset(Builtin):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Builtin); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1099, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1099, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1099, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_Offset, __pyx_n_s_Offset, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1099, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_Offset, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1099, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Offset, __pyx_t_5) < 0) __PYX_ERR(0, 1099, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":1103
 * 
 * 
 * class Rectangle(Builtin):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Builtin); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1103, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1103, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1103, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_Rectangle, __pyx_n_s_Rectangle, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_kp_s_dl_dt_Rectangle_xmin_ymin_dd_re); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1103, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "mathics/builtin/graphics.py":1120
 * 
 *     rules = {
 *         "Rectangle[]": "Rectangle[{0, 0}]",             # <<<<<<<<<<<<<<
 *     }
 * 
 */
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1120, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_kp_u_Rectangle_2, __pyx_kp_u_Rectangle_0_0) < 0) __PYX_ERR(0, 1120, __pyx_L1_error)
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_rules, __pyx_t_5) < 0) __PYX_ERR(0, 1119, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":1103
 * 
 * 
 * class Rectangle(Builtin):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_Rectangle, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1103, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Rectangle, __pyx_t_5) < 0) __PYX_ERR(0, 1103, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1124
 * 
 * 
 * class Disk(Builtin):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Builtin); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1124, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1124, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1124, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_Disk, __pyx_n_s_Disk, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_kp_s_dl_dt_Disk_cx_cy_r_dd_fills_a_c); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1124, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "mathics/builtin/graphics.py":1153
 * 
 *     rules = {
 *         "Disk[]": "Disk[{0, 0}]",             # <<<<<<<<<<<<<<
 *     }
 * 
 */
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_kp_u_Disk_2, __pyx_kp_u_Disk_0_0) < 0) __PYX_ERR(0, 1153, __pyx_L1_error)
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_rules, __pyx_t_5) < 0) __PYX_ERR(0, 1152, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":1124
 * 
 * 
 * class Disk(Builtin):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_Disk, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1124, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Disk, __pyx_t_5) < 0) __PYX_ERR(0, 1124, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":1157
 * 
 * 
 * class Circle(Builtin):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Builtin); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1157, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1157, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1157, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_Circle, __pyx_n_s_Circle, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_kp_s_dl_dt_Circle_cx_cy_r_dd_draws_a); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1157, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "mathics/builtin/graphics.py":1177
 * 
 *     rules = {
 *         "Circle[]": "Circle[{0, 0}]",             # <<<<<<<<<<<<<<
 *     }
 * 
 */
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_kp_u_Circle_2, __pyx_kp_u_Circle_0_0) < 0) __PYX_ERR(0, 1177, __pyx_L1_error)
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_rules, __pyx_t_5) < 0) __PYX_ERR(0, 1176, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":1157
 * 
 * 
 * class Circle(Builtin):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_Circle, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1157, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Circle, __pyx_t_5) < 0) __PYX_ERR(0, 1157, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1181
 * 
 * 
 * class Inset(Builtin):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Builtin); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1181, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1181, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1181, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_Inset, __pyx_n_s_Inset, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1181, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_Inset, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1181, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Inset, __pyx_t_5) < 0) __PYX_ERR(0, 1181, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":1185
 * 
 * 
 * class Text(Inset):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Inset); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1185, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1185, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1185, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_Text, __pyx_n_s_Text, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_kp_s_dl_dt_Text_text_x_y_dd_draws_te); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1185, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_Text, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1185, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Text, __pyx_t_5) < 0) __PYX_ERR(0, 1185, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1200
 * 
 * 
 * class RectangleBox(_GraphicsElement):             # <<<<<<<<<<<<<<
 *     def init(self, graphics, style, item):
 *         super(RectangleBox, self).init(graphics, item, style)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_GraphicsElement); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1200, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1200, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1200, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_RectangleBox, __pyx_n_s_RectangleBox, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1200, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "mathics/builtin/graphics.py":1201
 * 
 * class RectangleBox(_GraphicsElement):
 *     def init(self, graphics, style, item):             # <<<<<<<<<<<<<<
 *         super(RectangleBox, self).init(graphics, item, style)
 *         if len(item.leaves) not in (1, 2):
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_12RectangleBox_1init, 0, __pyx_n_s_RectangleBox_init, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__263)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1201, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_init, __pyx_t_5) < 0) __PYX_ERR(0, 1201, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":1212
 *             self.p2 = Coords(graphics, item.leaves[1])
 * 
 *     def extent(self):             # <<<<<<<<<<<<<<
 *         l = self.style.get_line_width(face_element=True) / 2
 *         result = []
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_12RectangleBox_3extent, 0, __pyx_n_s_RectangleBox_extent, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__265)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1212, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_extent, __pyx_t_5) < 0) __PYX_ERR(0, 1212, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":1222
 *         return result
 * 
 *     def to_svg(self):             # <<<<<<<<<<<<<<
 *         l = self.style.get_line_width(face_element=True)
 *         x1, y1 = self.p1.pos()
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_12RectangleBox_5to_svg, 0, __pyx_n_s_RectangleBox_to_svg, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__267)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1222, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_to_svg, __pyx_t_5) < 0) __PYX_ERR(0, 1222, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":1239
 *         )
 * 
 *     def to_asy(self):             # <<<<<<<<<<<<<<
 *         l = self.style.get_line_width(face_element=True)
 *         x1, y1 = self.p1.pos()
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_12RectangleBox_7to_asy, 0, __pyx_n_s_RectangleBox_to_asy, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__269)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1239, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_to_asy, __pyx_t_5) < 0) __PYX_ERR(0, 1239, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":1200
 * 
 * 
 * class RectangleBox(_GraphicsElement):             # <<<<<<<<<<<<<<
 *     def init(self, graphics, style, item):
 *         super(RectangleBox, self).init(graphics, item, style)
 */
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_RectangleBox, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1200, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_RectangleBox, __pyx_t_5) < 0) __PYX_ERR(0, 1200, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":1258
 * 
 * 
 * class _RoundBox(_GraphicsElement):             # <<<<<<<<<<<<<<
 *     face_element = None
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_GraphicsElement); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_RoundBox, __pyx_n_s_RoundBox, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "mathics/builtin/graphics.py":1259
 * 
 * class _RoundBox(_GraphicsElement):
 *     face_element = None             # <<<<<<<<<<<<<<
 * 
 *     def init(self, graphics, style, item):
 */
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_face_element, Py_None) < 0) __PYX_ERR(0, 1259, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1261
 *     face_element = None
 * 
 *     def init(self, graphics, style, item):             # <<<<<<<<<<<<<<
 *         super(_RoundBox, self).init(graphics, item, style)
 *         if len(item.leaves) not in (1, 2):
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_9_RoundBox_1init, 0, __pyx_n_s_RoundBox_init, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__271)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1261, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_init, __pyx_t_5) < 0) __PYX_ERR(0, 1261, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":1280
 *         self.r = self.c.add(rx, ry)
 * 
 *     def extent(self):             # <<<<<<<<<<<<<<
 *         l = self.style.get_line_width(face_element=self.face_element) / 2
 *         x, y = self.c.pos()
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_9_RoundBox_3extent, 0, __pyx_n_s_RoundBox_extent, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__273)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_extent, __pyx_t_5) < 0) __PYX_ERR(0, 1280, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":1290
 *         return [(x - rx, y - ry), (x - rx, y + ry), (x + rx, y - ry), (x + rx, y + ry)]
 * 
 *     def to_svg(self):             # <<<<<<<<<<<<<<
 *         x, y = self.c.pos()
 *         rx, ry = self.r.pos()
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_9_RoundBox_5to_svg, 0, __pyx_n_s_RoundBox_to_svg, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__275)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1290, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_to_svg, __pyx_t_5) < 0) __PYX_ERR(0, 1290, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":1305
 *         )
 * 
 *     def to_asy(self):             # <<<<<<<<<<<<<<
 *         x, y = self.c.pos()
 *         rx, ry = self.r.pos()
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_9_RoundBox_7to_asy, 0, __pyx_n_s_RoundBox_to_asy, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__277)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1305, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_to_asy, __pyx_t_5) < 0) __PYX_ERR(0, 1305, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":1258
 * 
 * 
 * class _RoundBox(_GraphicsElement):             # <<<<<<<<<<<<<<
 *     face_element = None
 * 
 */
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_RoundBox, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_RoundBox, __pyx_t_5) < 0) __PYX_ERR(0, 1258, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1328
 * 
 * 
 * class _ArcBox(_RoundBox):             # <<<<<<<<<<<<<<
 *     def init(self, graphics, style, item):
 *         if len(item.leaves) == 3:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_RoundBox); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1328, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1328, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1328, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_ArcBox, __pyx_n_s_ArcBox, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1328, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "mathics/builtin/graphics.py":1329
 * 
 * class _ArcBox(_RoundBox):
 *     def init(self, graphics, style, item):             # <<<<<<<<<<<<<<
 *         if len(item.leaves) == 3:
 *             arc_expr = item.leaves[2]
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_7_ArcBox_1init, 0, __pyx_n_s_ArcBox_init, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__279)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1329, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_init, __pyx_t_5) < 0) __PYX_ERR(0, 1329, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":1355
 *         super(_ArcBox, self).init(graphics, style, item)
 * 
 *     def _arc_params(self):             # <<<<<<<<<<<<<<
 *         x, y = self.c.pos()
 *         rx, ry = self.r.pos()
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_7_ArcBox_3_arc_params, 0, __pyx_n_s_ArcBox__arc_params, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__281)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1355, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_arc_params, __pyx_t_5) < 0) __PYX_ERR(0, 1355, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":1377
 *         return x, y, abs(rx), abs(ry), sx, sy, ex, ey, large_arc
 * 
 *     def to_svg(self):             # <<<<<<<<<<<<<<
 *         if self.arc is None:
 *             return super(_ArcBox, self).to_svg()
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_7_ArcBox_5to_svg, 0, __pyx_n_s_ArcBox_to_svg, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__283)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1377, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_to_svg, __pyx_t_5) < 0) __PYX_ERR(0, 1377, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":1399
 *         return '<path d="%s" style="%s" />' % (" ".join(path(self.face_element)), style)
 * 
 *     def to_asy(self):             # <<<<<<<<<<<<<<
 *         if self.arc is None:
 *             return super(_ArcBox, self).to_asy()
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_7_ArcBox_7to_asy, 0, __pyx_n_s_ArcBox_to_asy, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__285)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1399, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_to_asy, __pyx_t_5) < 0) __PYX_ERR(0, 1399, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":1328
 * 
 * 
 * class _ArcBox(_RoundBox):             # <<<<<<<<<<<<<<
 *     def init(self, graphics, style, item):
 *         if len(item.leaves) == 3:
 */
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_ArcBox, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1328, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ArcBox, __pyx_t_5) < 0) __PYX_ERR(0, 1328, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":1429
 * 
 * 
 * class DiskBox(_ArcBox):             # <<<<<<<<<<<<<<
 *     face_element = True
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ArcBox); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1429, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1429, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1429, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_DiskBox, __pyx_n_s_DiskBox, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1429, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "mathics/builtin/graphics.py":1430
 * 
 * class DiskBox(_ArcBox):
 *     face_element = True             # <<<<<<<<<<<<<<
 * 
 * 
 */
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_face_element, Py_True) < 0) __PYX_ERR(0, 1430, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1429
 * 
 * 
 * class DiskBox(_ArcBox):             # <<<<<<<<<<<<<<
 *     face_element = True
 * 
 */
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_DiskBox, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1429, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_DiskBox, __pyx_t_5) < 0) __PYX_ERR(0, 1429, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1433
 * 
 * 
 * class CircleBox(_ArcBox):             # <<<<<<<<<<<<<<
 *     face_element = False
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ArcBox); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1433, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1433, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1433, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_CircleBox, __pyx_n_s_CircleBox, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1433, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "mathics/builtin/graphics.py":1434
 * 
 * class CircleBox(_ArcBox):
 *     face_element = False             # <<<<<<<<<<<<<<
 * 
 * 
 */
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_face_element, Py_False) < 0) __PYX_ERR(0, 1434, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":1433
 * 
 * 
 * class CircleBox(_ArcBox):             # <<<<<<<<<<<<<<
 *     face_element = False
 * 
 */
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_CircleBox, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1433, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_CircleBox, __pyx_t_5) < 0) __PYX_ERR(0, 1433, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":1437
 * 
 * 
 * class _Polyline(_GraphicsElement):             # <<<<<<<<<<<<<<
 *     def do_init(self, graphics, points):
 *         if not points.has_form("List", None):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_GraphicsElement); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1437, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1437, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1437, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_Polyline, __pyx_n_s_Polyline, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1437, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "mathics/builtin/graphics.py":1438
 * 
 * class _Polyline(_GraphicsElement):
 *     def do_init(self, graphics, points):             # <<<<<<<<<<<<<<
 *         if not points.has_form("List", None):
 *             raise BoxConstructError
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_9_Polyline_1do_init, 0, __pyx_n_s_Polyline_do_init, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__287)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1438, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_do_init, __pyx_t_5) < 0) __PYX_ERR(0, 1438, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":1461
 *         ]
 * 
 *     def extent(self):             # <<<<<<<<<<<<<<
 *         l = self.style.get_line_width(face_element=False)
 *         result = []
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_9_Polyline_3extent, 0, __pyx_n_s_Polyline_extent, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__289)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1461, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_extent, __pyx_t_5) < 0) __PYX_ERR(0, 1461, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":1437
 * 
 * 
 * class _Polyline(_GraphicsElement):             # <<<<<<<<<<<<<<
 *     def do_init(self, graphics, points):
 *         if not points.has_form("List", None):
 */
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_Polyline, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1437, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Polyline, __pyx_t_5) < 0) __PYX_ERR(0, 1437, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1473
 * 
 * 
 * class Point(Builtin):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Builtin); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1473, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1473, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1473, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_Point, __pyx_n_s_Point, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_kp_s_dl_dt_Point_point_1_point_2_dd); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1473, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_Point, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1473, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Point, __pyx_t_5) < 0) __PYX_ERR(0, 1473, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":1495
 * 
 * 
 * class PointBox(_Polyline):             # <<<<<<<<<<<<<<
 *     def init(self, graphics, style, item=None):
 *         super(PointBox, self).init(graphics, item, style)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Polyline); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1495, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1495, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1495, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_PointBox, __pyx_n_s_PointBox, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1495, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "mathics/builtin/graphics.py":1496
 * 
 * class PointBox(_Polyline):
 *     def init(self, graphics, style, item=None):             # <<<<<<<<<<<<<<
 *         super(PointBox, self).init(graphics, item, style)
 *         self.edge_color, self.face_color = style.get_style(_Color, face_element=True)
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_8PointBox_1init, 0, __pyx_n_s_PointBox_init, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__291)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1496, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_tuple__292);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_init, __pyx_t_5) < 0) __PYX_ERR(0, 1496, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":1510
 *             raise BoxConstructError
 * 
 *     def to_svg(self):             # <<<<<<<<<<<<<<
 *         point_size, _ = self.style.get_style(PointSize, face_element=False)
 *         if point_size is None:
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_8PointBox_3to_svg, 0, __pyx_n_s_PointBox_to_svg, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__294)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1510, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_to_svg, __pyx_t_5) < 0) __PYX_ERR(0, 1510, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":1530
 *         return svg
 * 
 *     def to_asy(self):             # <<<<<<<<<<<<<<
 *         pen = create_pens(face_color=self.face_color, is_face_element=False)
 * 
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_8PointBox_5to_asy, 0, __pyx_n_s_PointBox_to_asy, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__296)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1530, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_to_asy, __pyx_t_5) < 0) __PYX_ERR(0, 1530, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":1495
 * 
 * 
 * class PointBox(_Polyline):             # <<<<<<<<<<<<<<
 *     def init(self, graphics, style, item=None):
 *         super(PointBox, self).init(graphics, item, style)
 */
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_PointBox, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1495, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PointBox, __pyx_t_5) < 0) __PYX_ERR(0, 1495, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1541
 * 
 * 
 * class Line(Builtin):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Builtin); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1541, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1541, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1541, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_Line_2, __pyx_n_s_Line_2, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_kp_s_dl_dt_Line_point_1_point_2_dd_r); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1541, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_Line_2, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1541, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Line_2, __pyx_t_5) < 0) __PYX_ERR(0, 1541, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":1560
 * 
 * 
 * class LineBox(_Polyline):             # <<<<<<<<<<<<<<
 *     def init(self, graphics, style, item=None, lines=None):
 *         super(LineBox, self).init(graphics, item, style)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Polyline); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1560, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1560, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1560, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_LineBox, __pyx_n_s_LineBox, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1560, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "mathics/builtin/graphics.py":1561
 * 
 * class LineBox(_Polyline):
 *     def init(self, graphics, style, item=None, lines=None):             # <<<<<<<<<<<<<<
 *         super(LineBox, self).init(graphics, item, style)
 *         self.edge_color, _ = style.get_style(_Color, face_element=False)
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_7LineBox_1init, 0, __pyx_n_s_LineBox_init, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__298)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1561, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_tuple__299);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_init, __pyx_t_5) < 0) __PYX_ERR(0, 1561, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":1574
 *             raise BoxConstructError
 * 
 *     def to_svg(self):             # <<<<<<<<<<<<<<
 *         l = self.style.get_line_width(face_element=False)
 *         style = create_css(edge_color=self.edge_color, stroke_width=l)
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_7LineBox_3to_svg, 0, __pyx_n_s_LineBox_to_svg, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__301)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1574, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_to_svg, __pyx_t_5) < 0) __PYX_ERR(0, 1574, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":1585
 *         return svg
 * 
 *     def to_asy(self):             # <<<<<<<<<<<<<<
 *         l = self.style.get_line_width(face_element=False)
 *         pen = create_pens(edge_color=self.edge_color, stroke_width=l)
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_7LineBox_5to_asy, 0, __pyx_n_s_LineBox_to_asy, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__303)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1585, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_to_asy, __pyx_t_5) < 0) __PYX_ERR(0, 1585, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":1560
 * 
 * 
 * class LineBox(_Polyline):             # <<<<<<<<<<<<<<
 *     def init(self, graphics, style, item=None, lines=None):
 *         super(LineBox, self).init(graphics, item, style)
 */
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_LineBox, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1560, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_LineBox, __pyx_t_5) < 0) __PYX_ERR(0, 1560, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1595
 * 
 * 
 * def _svg_bezier(*segments):             # <<<<<<<<<<<<<<
 *     # see https://www.w3.org/TR/SVG/paths.html#PathDataCubicBezierCommands
 *     # see https://docs.webplatform.org/wiki/svg/tutorials/smarter_svg_shapes
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_31_svg_bezier, 0, __pyx_n_s_svg_bezier, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__44)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1595, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_svg_bezier, __pyx_t_1) < 0) __PYX_ERR(0, 1595, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1627
 * 
 * 
 * def _asy_bezier(*segments):             # <<<<<<<<<<<<<<
 *     # see http://asymptote.sourceforge.net/doc/Bezier-curves.html#Bezier-curves
 * 
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_34_asy_bezier, 0, __pyx_n_s_asy_bezier, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__47)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1627, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_asy_bezier, __pyx_t_1) < 0) __PYX_ERR(0, 1627, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1686
 * 
 * 
 * class BernsteinBasis(Builtin):             # <<<<<<<<<<<<<<
 *     rules = {
 *         "BernsteinBasis[d_, n_, x_]": "Piecewise[{{Binomial[d, n] * x ^ n * (1 - x) ^ (d - n), 0 < x < 1}}, 0]",
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Builtin); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1686, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1686, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1686, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_BernsteinBasis, __pyx_n_s_BernsteinBasis, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1686, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "mathics/builtin/graphics.py":1688
 * class BernsteinBasis(Builtin):
 *     rules = {
 *         "BernsteinBasis[d_, n_, x_]": "Piecewise[{{Binomial[d, n] * x ^ n * (1 - x) ^ (d - n), 0 < x < 1}}, 0]",             # <<<<<<<<<<<<<<
 *     }
 * 
 */
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1688, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_kp_u_BernsteinBasis_d__n__x, __pyx_kp_u_Piecewise_Binomial_d_n_x_n_1_x_d) < 0) __PYX_ERR(0, 1688, __pyx_L1_error)
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_rules, __pyx_t_5) < 0) __PYX_ERR(0, 1687, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":1686
 * 
 * 
 * class BernsteinBasis(Builtin):             # <<<<<<<<<<<<<<
 *     rules = {
 *         "BernsteinBasis[d_, n_, x_]": "Piecewise[{{Binomial[d, n] * x ^ n * (1 - x) ^ (d - n), 0 < x < 1}}, 0]",
 */
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_BernsteinBasis, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1686, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_BernsteinBasis, __pyx_t_5) < 0) __PYX_ERR(0, 1686, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":1692
 * 
 * 
 * class BezierFunction(Builtin):             # <<<<<<<<<<<<<<
 *     rules = {
 *         "BezierFunction[p_]": "Function[x, Total[p * BernsteinBasis[Length[p] - 1, Range[0, Length[p] - 1], x]]]",
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Builtin); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1692, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1692, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1692, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_BezierFunction, __pyx_n_s_BezierFunction, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1692, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "mathics/builtin/graphics.py":1694
 * class BezierFunction(Builtin):
 *     rules = {
 *         "BezierFunction[p_]": "Function[x, Total[p * BernsteinBasis[Length[p] - 1, Range[0, Length[p] - 1], x]]]",             # <<<<<<<<<<<<<<
 *     }
 * 
 */
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1694, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_kp_u_BezierFunction_p, __pyx_kp_u_Function_x_Total_p_BernsteinBasi) < 0) __PYX_ERR(0, 1694, __pyx_L1_error)
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_rules, __pyx_t_5) < 0) __PYX_ERR(0, 1693, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":1692
 * 
 * 
 * class BezierFunction(Builtin):             # <<<<<<<<<<<<<<
 *     rules = {
 *         "BezierFunction[p_]": "Function[x, Total[p * BernsteinBasis[Length[p] - 1, Range[0, Length[p] - 1], x]]]",
 */
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_BezierFunction, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1692, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_BezierFunction, __pyx_t_5) < 0) __PYX_ERR(0, 1692, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1698
 * 
 * 
 * class BezierCurve(Builtin):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Builtin); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1698, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1698, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1698, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_BezierCurve_2, __pyx_n_s_BezierCurve_2, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_kp_s_dl_dt_BezierCurve_p1_p2_dd_repr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1698, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "mathics/builtin/graphics.py":1713
 * 
 *     options = {
 *         "SplineDegree": "3",             # <<<<<<<<<<<<<<
 *     }
 * 
 */
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1713, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_SplineDegree, __pyx_kp_u_3) < 0) __PYX_ERR(0, 1713, __pyx_L1_error)
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_options, __pyx_t_5) < 0) __PYX_ERR(0, 1712, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":1698
 * 
 * 
 * class BezierCurve(Builtin):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_BezierCurve_2, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1698, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_BezierCurve_2, __pyx_t_5) < 0) __PYX_ERR(0, 1698, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":1717
 * 
 * 
 * class BezierCurveBox(_Polyline):             # <<<<<<<<<<<<<<
 *     def init(self, graphics, style, item, options):
 *         super(BezierCurveBox, self).init(graphics, item, style)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Polyline); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1717, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1717, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1717, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_BezierCurveBox, __pyx_n_s_BezierCurveBox, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1717, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "mathics/builtin/graphics.py":1718
 * 
 * class BezierCurveBox(_Polyline):
 *     def init(self, graphics, style, item, options):             # <<<<<<<<<<<<<<
 *         super(BezierCurveBox, self).init(graphics, item, style)
 *         if len(item.leaves) != 1 or item.leaves[0].get_head_name() != "System`List":
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_14BezierCurveBox_1init, 0, __pyx_n_s_BezierCurveBox_init, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__307)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1718, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_init, __pyx_t_5) < 0) __PYX_ERR(0, 1718, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":1730
 *         self.spline_degree = spline_degree.get_int_value()
 * 
 *     def to_svg(self):             # <<<<<<<<<<<<<<
 *         l = self.style.get_line_width(face_element=False)
 *         style = create_css(edge_color=self.edge_color, stroke_width=l)
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_14BezierCurveBox_3to_svg, 0, __pyx_n_s_BezierCurveBox_to_svg, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__309)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1730, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_to_svg, __pyx_t_5) < 0) __PYX_ERR(0, 1730, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":1740
 *         return svg
 * 
 *     def to_asy(self):             # <<<<<<<<<<<<<<
 *         l = self.style.get_line_width(face_element=False)
 *         pen = create_pens(edge_color=self.edge_color, stroke_width=l)
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_14BezierCurveBox_5to_asy, 0, __pyx_n_s_BezierCurveBox_to_asy, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__311)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1740, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_to_asy, __pyx_t_5) < 0) __PYX_ERR(0, 1740, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":1717
 * 
 * 
 * class BezierCurveBox(_Polyline):             # <<<<<<<<<<<<<<
 *     def init(self, graphics, style, item, options):
 *         super(BezierCurveBox, self).init(graphics, item, style)
 */
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_BezierCurveBox, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1717, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_BezierCurveBox, __pyx_t_5) < 0) __PYX_ERR(0, 1717, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1753
 * 
 * 
 * class FilledCurve(Builtin):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Builtin); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1753, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1753, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1753, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_FilledCurve, __pyx_n_s_FilledCurve, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_kp_s_dl_dt_FilledCurve_segment1_segm); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1753, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_FilledCurve, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1753, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FilledCurve, __pyx_t_5) < 0) __PYX_ERR(0, 1753, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":1770
 * 
 * 
 * class FilledCurveBox(_GraphicsElement):             # <<<<<<<<<<<<<<
 *     def init(self, graphics, style, item=None):
 *         super(FilledCurveBox, self).init(graphics, item, style)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_GraphicsElement); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1770, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1770, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1770, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_FilledCurveBox, __pyx_n_s_FilledCurveBox, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1770, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "mathics/builtin/graphics.py":1771
 * 
 * class FilledCurveBox(_GraphicsElement):
 *     def init(self, graphics, style, item=None):             # <<<<<<<<<<<<<<
 *         super(FilledCurveBox, self).init(graphics, item, style)
 *         self.edge_color, self.face_color = style.get_style(_Color, face_element=True)
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_14FilledCurveBox_1init, 0, __pyx_n_s_FilledCurveBox_init, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__313)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1771, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_tuple__314);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_init, __pyx_t_5) < 0) __PYX_ERR(0, 1771, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":1817
 *             raise BoxConstructError
 * 
 *     def to_svg(self):             # <<<<<<<<<<<<<<
 *         l = self.style.get_line_width(face_element=False)
 *         style = create_css(
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_14FilledCurveBox_3to_svg, 0, __pyx_n_s_FilledCurveBox_to_svg, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__316)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1817, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_to_svg, __pyx_t_5) < 0) __PYX_ERR(0, 1817, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":1833
 *         )
 * 
 *     def to_asy(self):             # <<<<<<<<<<<<<<
 *         l = self.style.get_line_width(face_element=False)
 *         pen = create_pens(edge_color=self.edge_color, stroke_width=l)
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_14FilledCurveBox_5to_asy, 0, __pyx_n_s_FilledCurveBox_to_asy, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__318)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1833, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_to_asy, __pyx_t_5) < 0) __PYX_ERR(0, 1833, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":1847
 *         return "".join(components())
 * 
 *     def extent(self):             # <<<<<<<<<<<<<<
 *         l = self.style.get_line_width(face_element=False)
 *         result = []
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_14FilledCurveBox_7extent, 0, __pyx_n_s_FilledCurveBox_extent, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__320)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1847, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_extent, __pyx_t_5) < 0) __PYX_ERR(0, 1847, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":1770
 * 
 * 
 * class FilledCurveBox(_GraphicsElement):             # <<<<<<<<<<<<<<
 *     def init(self, graphics, style, item=None):
 *         super(FilledCurveBox, self).init(graphics, item, style)
 */
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_FilledCurveBox, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1770, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FilledCurveBox, __pyx_t_5) < 0) __PYX_ERR(0, 1770, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1860
 * 
 * 
 * class Polygon(Builtin):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Builtin); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1860, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1860, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1860, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_Polygon, __pyx_n_s_Polygon, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_kp_s_dl_dt_Polygon_point_1_point_2_d); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1860, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_Polygon, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1860, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Polygon, __pyx_t_5) < 0) __PYX_ERR(0, 1860, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":1879
 * 
 * 
 * class PolygonBox(_Polyline):             # <<<<<<<<<<<<<<
 *     def init(self, graphics, style, item=None):
 *         super(PolygonBox, self).init(graphics, item, style)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Polyline); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1879, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1879, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1879, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_PolygonBox, __pyx_n_s_PolygonBox, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1879, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "mathics/builtin/graphics.py":1880
 * 
 * class PolygonBox(_Polyline):
 *     def init(self, graphics, style, item=None):             # <<<<<<<<<<<<<<
 *         super(PolygonBox, self).init(graphics, item, style)
 *         self.edge_color, self.face_color = style.get_style(_Color, face_element=True)
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_10PolygonBox_1init, 0, __pyx_n_s_PolygonBox_init, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__322)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1880, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_tuple__323);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_init, __pyx_t_5) < 0) __PYX_ERR(0, 1880, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":1897
 *             raise BoxConstructError
 * 
 *     def process_option(self, name, value):             # <<<<<<<<<<<<<<
 *         if name == "System`VertexColors":
 *             if not value.has_form("List", None):
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_10PolygonBox_3process_option, 0, __pyx_n_s_PolygonBox_process_option, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__325)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1897, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_process_option, __pyx_t_5) < 0) __PYX_ERR(0, 1897, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":1922
 *             raise BoxConstructError
 * 
 *     def to_svg(self):             # <<<<<<<<<<<<<<
 *         l = self.style.get_line_width(face_element=True)
 *         if self.vertex_colors is None:
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_10PolygonBox_5to_svg, 0, __pyx_n_s_PolygonBox_to_svg, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__327)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1922, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_to_svg, __pyx_t_5) < 0) __PYX_ERR(0, 1922, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":1948
 *         return svg
 * 
 *     def to_asy(self):             # <<<<<<<<<<<<<<
 *         l = self.style.get_line_width(face_element=True)
 *         if self.vertex_colors is None:
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_10PolygonBox_7to_asy, 0, __pyx_n_s_PolygonBox_to_asy, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__329)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1948, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_to_asy, __pyx_t_5) < 0) __PYX_ERR(0, 1948, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":1879
 * 
 * 
 * class PolygonBox(_Polyline):             # <<<<<<<<<<<<<<
 *     def init(self, graphics, style, item=None):
 *         super(PolygonBox, self).init(graphics, item, style)
 */
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_PolygonBox, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1879, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PolygonBox, __pyx_t_5) < 0) __PYX_ERR(0, 1879, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1995
 * 
 * 
 * class RegularPolygon(Builtin):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Builtin); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1995, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1995, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1995, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_RegularPolygon, __pyx_n_s_RegularPolygon, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_kp_s_dl_dt_RegularPolygon_n_dd_gives); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1995, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_RegularPolygon, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1995, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_RegularPolygon, __pyx_t_5) < 0) __PYX_ERR(0, 1995, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":2016
 * 
 * 
 * class RegularPolygonBox(PolygonBox):             # <<<<<<<<<<<<<<
 *     def init(self, graphics, style, item):
 *         if len(item.leaves) in (1, 2, 3) and isinstance(item.leaves[-1], Integer):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PolygonBox); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2016, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2016, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2016, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_RegularPolygonBox, __pyx_n_s_RegularPolygonBox, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2016, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "mathics/builtin/graphics.py":2017
 * 
 * class RegularPolygonBox(PolygonBox):
 *     def init(self, graphics, style, item):             # <<<<<<<<<<<<<<
 *         if len(item.leaves) in (1, 2, 3) and isinstance(item.leaves[-1], Integer):
 *             r = 1.0
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_17RegularPolygonBox_1init, 0, __pyx_n_s_RegularPolygonBox_init, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__331)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2017, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_init, __pyx_t_5) < 0) __PYX_ERR(0, 2017, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":2016
 * 
 * 
 * class RegularPolygonBox(PolygonBox):             # <<<<<<<<<<<<<<
 *     def init(self, graphics, style, item):
 *         if len(item.leaves) in (1, 2, 3) and isinstance(item.leaves[-1], Integer):
 */
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_RegularPolygonBox, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2016, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_RegularPolygonBox, __pyx_t_5) < 0) __PYX_ERR(0, 2016, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":2069
 * 
 * 
 * class Arrow(Builtin):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Builtin); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2069, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2069, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2069, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_Arrow, __pyx_n_s_Arrow, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_kp_s_dl_dt_Arrow_p1_p2_dd_represents); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2069, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_Arrow, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2069, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Arrow, __pyx_t_5) < 0) __PYX_ERR(0, 2069, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":2097
 * 
 * 
 * class Arrowheads(_GraphicsElement):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_GraphicsElement); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2097, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2097, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2097, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_Arrowheads, __pyx_n_s_Arrowheads, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_kp_s_dl_dt_Arrowheads_s_dd_specifies); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2097, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "mathics/builtin/graphics.py":2128
 *     """
 * 
 *     default_size = 0.04             # <<<<<<<<<<<<<<
 * 
 *     symbolic_sizes = {
 */
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_default_size, __pyx_float_0_04) < 0) __PYX_ERR(0, 2128, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2131
 * 
 *     symbolic_sizes = {
 *         "System`Tiny": 3,             # <<<<<<<<<<<<<<
 *         "System`Small": 5,
 *         "System`Medium": 9,
 */
  __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2131, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_kp_u_System_Tiny, __pyx_int_3) < 0) __PYX_ERR(0, 2131, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_kp_u_System_Small, __pyx_int_5) < 0) __PYX_ERR(0, 2131, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_kp_u_System_Medium, __pyx_int_9) < 0) __PYX_ERR(0, 2131, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_kp_u_System_Large, __pyx_int_18) < 0) __PYX_ERR(0, 2131, __pyx_L1_error)
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_symbolic_sizes, __pyx_t_5) < 0) __PYX_ERR(0, 2130, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":2137
 *     }
 * 
 *     def init(self, graphics, item=None):             # <<<<<<<<<<<<<<
 *         super(Arrowheads, self).init(graphics, item)
 *         if len(item.leaves) != 1:
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_10Arrowheads_1init, 0, __pyx_n_s_Arrowheads_init, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__333)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2137, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_tuple__334);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_init, __pyx_t_5) < 0) __PYX_ERR(0, 2137, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":2143
 *         self.spec = item.leaves[0]
 * 
 *     def _arrow_size(self, s, extent):             # <<<<<<<<<<<<<<
 *         if isinstance(s, Symbol):
 *             size = self.symbolic_sizes.get(s.get_name(), 0)
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_10Arrowheads_3_arrow_size, 0, __pyx_n_s_Arrowheads__arrow_size, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__336)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_arrow_size, __pyx_t_5) < 0) __PYX_ERR(0, 2143, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":2150
 *             return _to_float(s) * extent
 * 
 *     def heads(self, extent, default_arrow, custom_arrow):             # <<<<<<<<<<<<<<
 *         # see https://reference.wolfram.com/language/ref/Arrowheads.html
 * 
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_10Arrowheads_5heads, 0, __pyx_n_s_Arrowheads_heads, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__70)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_heads, __pyx_t_5) < 0) __PYX_ERR(0, 2150, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":2097
 * 
 * 
 * class Arrowheads(_GraphicsElement):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_Arrowheads, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2097, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Arrowheads, __pyx_t_5) < 0) __PYX_ERR(0, 2097, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":2191
 * 
 * 
 * def _norm(p, q):             # <<<<<<<<<<<<<<
 *     px, py = p
 *     qx, qy = q
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_37_norm, 0, __pyx_n_s_norm, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__339)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2191, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_norm, __pyx_t_1) < 0) __PYX_ERR(0, 2191, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":2202
 * 
 * 
 * class _Line:             # <<<<<<<<<<<<<<
 *     def make_draw_svg(self, style):
 *         def draw(points):
 */
  __pyx_t_1 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_Line, __pyx_n_s_Line, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2202, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "mathics/builtin/graphics.py":2203
 * 
 * class _Line:
 *     def make_draw_svg(self, style):             # <<<<<<<<<<<<<<
 *         def draw(points):
 *             yield '<polyline points="'
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_5_Line_1make_draw_svg, 0, __pyx_n_s_Line_make_draw_svg, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__341)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2203, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_make_draw_svg, __pyx_t_2) < 0) __PYX_ERR(0, 2203, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":2211
 *         return draw
 * 
 *     def make_draw_asy(self, pen):             # <<<<<<<<<<<<<<
 *         def draw(points):
 *             yield "draw("
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_5_Line_3make_draw_asy, 0, __pyx_n_s_Line_make_draw_asy, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__343)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2211, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_make_draw_asy, __pyx_t_2) < 0) __PYX_ERR(0, 2211, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":2219
 *         return draw
 * 
 *     def arrows(self, points, heads):  # heads has to be sorted by pos             # <<<<<<<<<<<<<<
 *         def segments(points):
 *             for i in range(len(points) - 1):
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_5_Line_5arrows, 0, __pyx_n_s_Line_arrows, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2219, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_arrows, __pyx_t_2) < 0) __PYX_ERR(0, 2219, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":2202
 * 
 * 
 * class _Line:             # <<<<<<<<<<<<<<
 *     def make_draw_svg(self, style):
 *         def draw(points):
 */
  __pyx_t_2 = __Pyx_Py3ClassCreate(((PyObject*)&__Pyx_DefaultClassType), __pyx_n_s_Line, __pyx_empty_tuple, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2202, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Line, __pyx_t_2) < 0) __PYX_ERR(0, 2202, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":2257
 * 
 * 
 * def _bezier_derivative(p):             # <<<<<<<<<<<<<<
 *     # see http://pomax.github.io/bezierinfo/, Section 12 Derivatives
 *     n = len(p[0]) - 1
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_39_bezier_derivative, 0, __pyx_n_s_bezier_derivative, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__346)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2257, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_bezier_derivative, __pyx_t_1) < 0) __PYX_ERR(0, 2257, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":2263
 * 
 * 
 * def _bezier_evaluate(p, t):             # <<<<<<<<<<<<<<
 *     # see http://pomax.github.io/bezierinfo/, Section 4 Controlling Bezier Curvatures
 *     n = len(p[0]) - 1
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_41_bezier_evaluate, 0, __pyx_n_s_bezier_evaluate, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__348)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2263, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_bezier_evaluate, __pyx_t_1) < 0) __PYX_ERR(0, 2263, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":2287
 * 
 * 
 * class _BezierCurve:             # <<<<<<<<<<<<<<
 *     def __init__(self, spline_degree=3):
 *         self.spline_degree = spline_degree
 */
  __pyx_t_1 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_BezierCurve, __pyx_n_s_BezierCurve, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2287, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "mathics/builtin/graphics.py":2288
 * 
 * class _BezierCurve:
 *     def __init__(self, spline_degree=3):             # <<<<<<<<<<<<<<
 *         self.spline_degree = spline_degree
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_12_BezierCurve_1__init__, 0, __pyx_n_s_BezierCurve___init, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__350)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2288, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__351);
  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_init_2, __pyx_t_2) < 0) __PYX_ERR(0, 2288, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":2291
 *         self.spline_degree = spline_degree
 * 
 *     def make_draw_svg(self, style):             # <<<<<<<<<<<<<<
 *         def draw(points):
 *             s = " ".join(_svg_bezier((self.spline_degree, points)))
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_12_BezierCurve_3make_draw_svg, 0, __pyx_n_s_BezierCurve_make_draw_svg, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__353)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_make_draw_svg, __pyx_t_2) < 0) __PYX_ERR(0, 2291, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":2298
 *         return draw
 * 
 *     def make_draw_asy(self, pen):             # <<<<<<<<<<<<<<
 *         def draw(points):
 *             for path in _asy_bezier((self.spline_degree, points)):
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_12_BezierCurve_5make_draw_asy, 0, __pyx_n_s_BezierCurve_make_draw_asy, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__355)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_make_draw_asy, __pyx_t_2) < 0) __PYX_ERR(0, 2298, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":2305
 *         return draw
 * 
 *     def arrows(self, points, heads):  # heads has to be sorted by pos             # <<<<<<<<<<<<<<
 *         if len(points) < 2:
 *             return
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_12_BezierCurve_7arrows, 0, __pyx_n_s_BezierCurve_arrows, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__82)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2305, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_arrows, __pyx_t_2) < 0) __PYX_ERR(0, 2305, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":2287
 * 
 * 
 * class _BezierCurve:             # <<<<<<<<<<<<<<
 *     def __init__(self, spline_degree=3):
 *         self.spline_degree = spline_degree
 */
  __pyx_t_2 = __Pyx_Py3ClassCreate(((PyObject*)&__Pyx_DefaultClassType), __pyx_n_s_BezierCurve, __pyx_empty_tuple, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2287, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_BezierCurve, __pyx_t_2) < 0) __PYX_ERR(0, 2287, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":2332
 * 
 * 
 * class ArrowBox(_Polyline):             # <<<<<<<<<<<<<<
 *     def init(self, graphics, style, item=None):
 *         if not item:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Polyline); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2332, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2332, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2332, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_ArrowBox, __pyx_n_s_ArrowBox, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2332, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "mathics/builtin/graphics.py":2333
 * 
 * class ArrowBox(_Polyline):
 *     def init(self, graphics, style, item=None):             # <<<<<<<<<<<<<<
 *         if not item:
 *             raise BoxConstructError
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_8ArrowBox_1init, 0, __pyx_n_s_ArrowBox_init, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__358)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2333, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_tuple__359);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_init, __pyx_t_5) < 0) __PYX_ERR(0, 2333, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":2373
 * 
 *     @staticmethod
 *     def _setback_spec(expr):             # <<<<<<<<<<<<<<
 *         if expr.get_head_name() == "System`List":
 *             leaves = expr.leaves
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_8ArrowBox_3_setback_spec, __Pyx_CYFUNCTION_STATICMETHOD, __pyx_n_s_ArrowBox__setback_spec, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__361)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2373, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "mathics/builtin/graphics.py":2372
 *         self.heads, _ = style.get_style(Arrowheads, face_element=False)
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def _setback_spec(expr):
 *         if expr.get_head_name() == "System`List":
 */
  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2372, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_setback_spec, __pyx_t_4) < 0) __PYX_ERR(0, 2373, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":2384
 * 
 *     @staticmethod
 *     def _default_arrow(polygon):             # <<<<<<<<<<<<<<
 *         # the default arrow drawn by draw() below looks looks like this:
 *         #
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_8ArrowBox_5_default_arrow, __Pyx_CYFUNCTION_STATICMETHOD, __pyx_n_s_ArrowBox__default_arrow, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__363)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2384, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "mathics/builtin/graphics.py":2383
 *             return s, s
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def _default_arrow(polygon):
 *         # the default arrow drawn by draw() below looks looks like this:
 */
  __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2383, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_default_arrow_2, __pyx_t_5) < 0) __PYX_ERR(0, 2384, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":2430
 *         return draw
 * 
 *     def _draw(self, polyline, default_arrow, custom_arrow, extent):             # <<<<<<<<<<<<<<
 *         if self.heads:
 *             heads = list(self.heads.heads(extent, default_arrow, custom_arrow))
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_8ArrowBox_7_draw, 0, __pyx_n_s_ArrowBox__draw, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__86)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2430, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_draw_3, __pyx_t_5) < 0) __PYX_ERR(0, 2430, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":2479
 *                 yield s
 * 
 *     def _custom_arrow(self, format, format_transform):             # <<<<<<<<<<<<<<
 *         def make(graphics):
 *             xmin, xmax, ymin, ymax, ox, oy, ex, ey, code = _extract_graphics(
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_8ArrowBox_10_custom_arrow, 0, __pyx_n_s_ArrowBox__custom_arrow, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__366)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2479, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_custom_arrow_2, __pyx_t_5) < 0) __PYX_ERR(0, 2479, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":2503
 *         return make
 * 
 *     def to_svg(self):             # <<<<<<<<<<<<<<
 *         width = self.style.get_line_width(face_element=False)
 *         style = create_css(edge_color=self.edge_color, stroke_width=width)
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_8ArrowBox_12to_svg, 0, __pyx_n_s_ArrowBox_to_svg, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__368)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2503, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_to_svg, __pyx_t_5) < 0) __PYX_ERR(0, 2503, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":2520
 *         return "".join(self._draw(polyline, default_arrow, custom_arrow, extent))
 * 
 *     def to_asy(self):             # <<<<<<<<<<<<<<
 *         width = self.style.get_line_width(face_element=False)
 *         pen = create_pens(edge_color=self.edge_color, stroke_width=width)
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_8ArrowBox_14to_asy, 0, __pyx_n_s_ArrowBox_to_asy, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__370)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2520, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_to_asy, __pyx_t_5) < 0) __PYX_ERR(0, 2520, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":2537
 *         return "".join(self._draw(polyline, default_arrow, custom_arrow, extent))
 * 
 *     def extent(self):             # <<<<<<<<<<<<<<
 *         width = self.style.get_line_width(face_element=False)
 * 
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_8ArrowBox_16extent, 0, __pyx_n_s_ArrowBox_extent, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__372)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2537, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_extent, __pyx_t_5) < 0) __PYX_ERR(0, 2537, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":2332
 * 
 * 
 * class ArrowBox(_Polyline):             # <<<<<<<<<<<<<<
 *     def init(self, graphics, style, item=None):
 *         if not item:
 */
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_ArrowBox, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2332, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ArrowBox, __pyx_t_5) < 0) __PYX_ERR(0, 2332, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":2558
 * 
 * 
 * class InsetBox(_GraphicsElement):             # <<<<<<<<<<<<<<
 *     def init(self, graphics, style, item=None, content=None, pos=None, opos=(0, 0)):
 *         super(InsetBox, self).init(graphics, item, style)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_GraphicsElement); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2558, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2558, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2558, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_InsetBox, __pyx_n_s_InsetBox, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2558, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "mathics/builtin/graphics.py":2559
 * 
 * class InsetBox(_GraphicsElement):
 *     def init(self, graphics, style, item=None, content=None, pos=None, opos=(0, 0)):             # <<<<<<<<<<<<<<
 *         super(InsetBox, self).init(graphics, item, style)
 * 
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_8InsetBox_1init, 0, __pyx_n_s_InsetBox_init, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__374)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2559, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_tuple__375);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_init, __pyx_t_5) < 0) __PYX_ERR(0, 2559, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":2587
 *         )
 * 
 *     def extent(self):             # <<<<<<<<<<<<<<
 *         p = self.pos.pos()
 *         h = 25
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_8InsetBox_3extent, 0, __pyx_n_s_InsetBox_extent, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__377)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2587, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_extent, __pyx_t_5) < 0) __PYX_ERR(0, 2587, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":2596
 *         return [(x, y), (x + w, y + h)]
 * 
 *     def to_svg(self):             # <<<<<<<<<<<<<<
 *         x, y = self.pos.pos()
 *         content = self.content.boxes_to_xml(evaluation=self.graphics.evaluation)
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_8InsetBox_5to_svg, 0, __pyx_n_s_InsetBox_to_svg, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__379)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2596, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_to_svg, __pyx_t_5) < 0) __PYX_ERR(0, 2596, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":2606
 *         return svg
 * 
 *     def to_asy(self):             # <<<<<<<<<<<<<<
 *         x, y = self.pos.pos()
 *         content = self.content.boxes_to_tex(evaluation=self.graphics.evaluation)
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_8InsetBox_7to_asy, 0, __pyx_n_s_InsetBox_to_asy, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__381)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2606, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_to_asy, __pyx_t_5) < 0) __PYX_ERR(0, 2606, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":2558
 * 
 * 
 * class InsetBox(_GraphicsElement):             # <<<<<<<<<<<<<<
 *     def init(self, graphics, style, item=None, content=None, pos=None, opos=(0, 0)):
 *         super(InsetBox, self).init(graphics, item, style)
 */
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_InsetBox, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2558, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_InsetBox, __pyx_t_5) < 0) __PYX_ERR(0, 2558, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":2621
 * 
 * 
 * def total_extent(extents):             # <<<<<<<<<<<<<<
 *     xmin = xmax = ymin = ymax = None
 *     for extent in extents:
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_43total_extent, 0, __pyx_n_s_total_extent, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__383)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2621, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_total_extent, __pyx_t_1) < 0) __PYX_ERR(0, 2621, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":2636
 * 
 * 
 * class EdgeForm(Builtin):             # <<<<<<<<<<<<<<
 *     """
 *     >> Graphics[{EdgeForm[{Thick, Green}], Disk[]}]
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Builtin); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2636, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2636, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2636, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_EdgeForm, __pyx_n_s_EdgeForm, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_kp_s_Graphics_EdgeForm_Thick_Green_D); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2636, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_EdgeForm, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2636, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_EdgeForm, __pyx_t_5) < 0) __PYX_ERR(0, 2636, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":2648
 * 
 * 
 * class FaceForm(Builtin):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Builtin); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2648, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2648, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2648, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_FaceForm, __pyx_n_s_FaceForm, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2648, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_FaceForm, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2648, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FaceForm, __pyx_t_5) < 0) __PYX_ERR(0, 2648, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":2652
 * 
 * 
 * def _style(graphics, item):             # <<<<<<<<<<<<<<
 *     head = item.get_head_name()
 *     if head in style_heads:
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_45_style, 0, __pyx_n_s_style_3, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__385)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2652, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_style_3, __pyx_t_1) < 0) __PYX_ERR(0, 2652, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":2674
 * 
 * 
 * class Style(object):             # <<<<<<<<<<<<<<
 *     def __init__(self, graphics, edge=False, face=False):
 *         self.styles = []
 */
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__386); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2674, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_tuple__386, __pyx_n_s_Style, __pyx_n_s_Style, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2674, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "mathics/builtin/graphics.py":2675
 * 
 * class Style(object):
 *     def __init__(self, graphics, edge=False, face=False):             # <<<<<<<<<<<<<<
 *         self.styles = []
 *         self.options = {}
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_5Style_1__init__, 0, __pyx_n_s_Style___init, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__388)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2675, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__389);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init_2, __pyx_t_3) < 0) __PYX_ERR(0, 2675, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":2683
 *         self.klass = graphics.get_style_class()
 * 
 *     def append(self, item, allow_forms=True):             # <<<<<<<<<<<<<<
 *         self.styles.append(_style(self.graphics, item))
 * 
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_5Style_3append, 0, __pyx_n_s_Style_append, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__391)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2683, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__392);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_append, __pyx_t_3) < 0) __PYX_ERR(0, 2683, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":2686
 *         self.styles.append(_style(self.graphics, item))
 * 
 *     def set_option(self, name, value):             # <<<<<<<<<<<<<<
 *         self.options[name] = value
 * 
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_5Style_5set_option, 0, __pyx_n_s_Style_set_option, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__394)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2686, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_set_option, __pyx_t_3) < 0) __PYX_ERR(0, 2686, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":2689
 *         self.options[name] = value
 * 
 *     def extend(self, style, pre=True):             # <<<<<<<<<<<<<<
 *         if pre:
 *             self.styles = style.styles + self.styles
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_5Style_7extend, 0, __pyx_n_s_Style_extend, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__396)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2689, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__397);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_extend, __pyx_t_3) < 0) __PYX_ERR(0, 2689, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":2695
 *             self.styles.extend(style.styles)
 * 
 *     def clone(self):             # <<<<<<<<<<<<<<
 *         result = self.klass(self.graphics, edge=self.edge, face=self.face)
 *         result.styles = self.styles[:]
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_5Style_9clone, 0, __pyx_n_s_Style_clone, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__399)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2695, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_clone, __pyx_t_3) < 0) __PYX_ERR(0, 2695, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":2701
 *         return result
 * 
 *     def get_default_face_color(self):             # <<<<<<<<<<<<<<
 *         return RGBColor(components=(0, 0, 0, 1))
 * 
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_5Style_11get_default_face_color, 0, __pyx_n_s_Style_get_default_face_color, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__401)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2701, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_get_default_face_color, __pyx_t_3) < 0) __PYX_ERR(0, 2701, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":2704
 *         return RGBColor(components=(0, 0, 0, 1))
 * 
 *     def get_default_edge_color(self):             # <<<<<<<<<<<<<<
 *         return RGBColor(components=(0, 0, 0, 1))
 * 
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_5Style_13get_default_edge_color, 0, __pyx_n_s_Style_get_default_edge_color, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__403)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2704, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_get_default_edge_color, __pyx_t_3) < 0) __PYX_ERR(0, 2704, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":2707
 *         return RGBColor(components=(0, 0, 0, 1))
 * 
 *     def get_style(             # <<<<<<<<<<<<<<
 *         self, style_class, face_element=None, default_to_faces=True, consider_forms=True
 *     ):
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_5Style_15get_style, 0, __pyx_n_s_Style_get_style, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__405)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2707, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__406);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_get_style, __pyx_t_3) < 0) __PYX_ERR(0, 2707, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":2740
 *         return edge_style, face_style
 * 
 *     def get_option(self, name):             # <<<<<<<<<<<<<<
 *         return self.options.get(name, None)
 * 
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_5Style_17get_option, 0, __pyx_n_s_Style_get_option, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__408)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2740, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_get_option, __pyx_t_3) < 0) __PYX_ERR(0, 2740, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":2743
 *         return self.options.get(name, None)
 * 
 *     def get_line_width(self, face_element=True):             # <<<<<<<<<<<<<<
 *         if self.graphics.pixel_width is None:
 *             return 0
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_5Style_19get_line_width, 0, __pyx_n_s_Style_get_line_width, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__410)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2743, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__411);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_get_line_width, __pyx_t_3) < 0) __PYX_ERR(0, 2743, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":2674
 * 
 * 
 * class Style(object):             # <<<<<<<<<<<<<<
 *     def __init__(self, graphics, edge=False, face=False):
 *         self.styles = []
 */
  __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_Style, __pyx_tuple__386, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2674, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Style, __pyx_t_3) < 0) __PYX_ERR(0, 2674, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":2754
 * 
 * 
 * def _flatten(leaves):             # <<<<<<<<<<<<<<
 *     for leaf in leaves:
 *         if leaf.get_head_name() == "System`List":
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_47_flatten, 0, __pyx_n_s_flatten, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__111)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2754, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_flatten, __pyx_t_1) < 0) __PYX_ERR(0, 2754, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":2767
 * 
 * 
 * class _GraphicsElements(object):             # <<<<<<<<<<<<<<
 *     def __init__(self, content, evaluation):
 *         self.evaluation = evaluation
 */
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__413); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2767, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_tuple__413, __pyx_n_s_GraphicsElements_2, __pyx_n_s_GraphicsElements_2, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2767, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "mathics/builtin/graphics.py":2768
 * 
 * class _GraphicsElements(object):
 *     def __init__(self, content, evaluation):             # <<<<<<<<<<<<<<
 *         self.evaluation = evaluation
 *         self.elements = []
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_17_GraphicsElements_1__init__, 0, __pyx_n_s_GraphicsElements___init, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__415)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2768, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init_2, __pyx_t_3) < 0) __PYX_ERR(0, 2768, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":2841
 *         self.elements = list(convert(content, self.get_style_class()(self)))
 * 
 *     def create_style(self, expr):             # <<<<<<<<<<<<<<
 *         style = self.get_style_class()(self)
 * 
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_17_GraphicsElements_3create_style, 0, __pyx_n_s_GraphicsElements_create_style, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__417)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2841, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_create_style, __pyx_t_3) < 0) __PYX_ERR(0, 2841, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":2854
 *         return style
 * 
 *     def get_style_class(self):             # <<<<<<<<<<<<<<
 *         return Style
 * 
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_17_GraphicsElements_5get_style_class, 0, __pyx_n_s_GraphicsElements_get_style_clas, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__419)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2854, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_get_style_class, __pyx_t_3) < 0) __PYX_ERR(0, 2854, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":2767
 * 
 * 
 * class _GraphicsElements(object):             # <<<<<<<<<<<<<<
 *     def __init__(self, content, evaluation):
 *         self.evaluation = evaluation
 */
  __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_GraphicsElements_2, __pyx_tuple__413, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2767, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_GraphicsElements_2, __pyx_t_3) < 0) __PYX_ERR(0, 2767, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":2858
 * 
 * 
 * class GraphicsElements(_GraphicsElements):             # <<<<<<<<<<<<<<
 *     coords = Coords
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_GraphicsElements_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2858, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2858, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2858, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_GraphicsElements, __pyx_n_s_GraphicsElements, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2858, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "mathics/builtin/graphics.py":2859
 * 
 * class GraphicsElements(_GraphicsElements):
 *     coords = Coords             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, content, evaluation, neg_y=False):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Coords); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2859, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_coords, __pyx_t_5) < 0) __PYX_ERR(0, 2859, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":2861
 *     coords = Coords
 * 
 *     def __init__(self, content, evaluation, neg_y=False):             # <<<<<<<<<<<<<<
 *         super(GraphicsElements, self).__init__(content, evaluation)
 *         self.neg_y = neg_y
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_16GraphicsElements_1__init__, 0, __pyx_n_s_GraphicsElements___init_2, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__421)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2861, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_tuple__422);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_init_2, __pyx_t_5) < 0) __PYX_ERR(0, 2861, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":2868
 *         self.view_width = None
 * 
 *     def translate(self, coords):             # <<<<<<<<<<<<<<
 *         if self.pixel_width is not None:
 *             w = self.extent_width if self.extent_width > 0 else 1
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_16GraphicsElements_3translate, 0, __pyx_n_s_GraphicsElements_translate, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__424)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2868, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_translate, __pyx_t_5) < 0) __PYX_ERR(0, 2868, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":2882
 *             return (coords[0], coords[1])
 * 
 *     def translate_absolute(self, d):             # <<<<<<<<<<<<<<
 *         if self.pixel_width is None:
 *             return (0, 0)
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_16GraphicsElements_5translate_absolute, 0, __pyx_n_s_GraphicsElements_translate_absol, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__426)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2882, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_translate_absolute, __pyx_t_5) < 0) __PYX_ERR(0, 2882, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":2889
 *             return (d[0] * l, (-1 if self.neg_y else 1) * d[1] * l)
 * 
 *     def translate_relative(self, x):             # <<<<<<<<<<<<<<
 *         if self.pixel_width is None:
 *             return 0
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_16GraphicsElements_7translate_relative, 0, __pyx_n_s_GraphicsElements_translate_relat, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__428)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2889, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_translate_relative, __pyx_t_5) < 0) __PYX_ERR(0, 2889, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":2895
 *             return x * self.pixel_width
 * 
 *     def extent(self, completely_visible_only=False):             # <<<<<<<<<<<<<<
 *         if completely_visible_only:
 *             ext = total_extent(
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_16GraphicsElements_9extent, 0, __pyx_n_s_GraphicsElements_extent, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__430)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2895, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_tuple__431);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_extent, __pyx_t_5) < 0) __PYX_ERR(0, 2895, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":2919
 *         return xmin, xmax, ymin, ymax
 * 
 *     def to_svg(self):             # <<<<<<<<<<<<<<
 *         return "\n".join(element.to_svg() for element in self.elements)
 * 
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_16GraphicsElements_11to_svg, 0, __pyx_n_s_GraphicsElements_to_svg, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__433)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2919, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_to_svg, __pyx_t_5) < 0) __PYX_ERR(0, 2919, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":2922
 *         return "\n".join(element.to_svg() for element in self.elements)
 * 
 *     def to_asy(self):             # <<<<<<<<<<<<<<
 *         return "\n".join(element.to_asy() for element in self.elements)
 * 
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_16GraphicsElements_13to_asy, 0, __pyx_n_s_GraphicsElements_to_asy, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__435)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2922, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_to_asy, __pyx_t_5) < 0) __PYX_ERR(0, 2922, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":2925
 *         return "\n".join(element.to_asy() for element in self.elements)
 * 
 *     def set_size(             # <<<<<<<<<<<<<<
 *         self, xmin, ymin, extent_width, extent_height, pixel_width, pixel_height
 *     ):
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_16GraphicsElements_15set_size, 0, __pyx_n_s_GraphicsElements_set_size, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__437)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2925, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_set_size, __pyx_t_5) < 0) __PYX_ERR(0, 2925, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "mathics/builtin/graphics.py":2858
 * 
 * 
 * class GraphicsElements(_GraphicsElements):             # <<<<<<<<<<<<<<
 *     coords = Coords
 * 
 */
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_GraphicsElements, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2858, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_GraphicsElements, __pyx_t_5) < 0) __PYX_ERR(0, 2858, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":2934
 * 
 * 
 * class GraphicsBox(BoxConstruct):             # <<<<<<<<<<<<<<
 *     options = Graphics.options
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_BoxConstruct); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2934, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2934, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2934, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_GraphicsBox, __pyx_n_s_GraphicsBox, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2934, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "mathics/builtin/graphics.py":2935
 * 
 * class GraphicsBox(BoxConstruct):
 *     options = Graphics.options             # <<<<<<<<<<<<<<
 * 
 *     attributes = ("HoldAll", "ReadProtected")
 */
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Graphics); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2935, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_options); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2935, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_options, __pyx_t_4) < 0) __PYX_ERR(0, 2935, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":2937
 *     options = Graphics.options
 * 
 *     attributes = ("HoldAll", "ReadProtected")             # <<<<<<<<<<<<<<
 * 
 *     def boxes_to_text(self, leaves, **options):
 */
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_attributes, __pyx_tuple__438) < 0) __PYX_ERR(0, 2937, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":2939
 *     attributes = ("HoldAll", "ReadProtected")
 * 
 *     def boxes_to_text(self, leaves, **options):             # <<<<<<<<<<<<<<
 *         self._prepare_elements(leaves, options)  # to test for Box errors
 *         return "-Graphics-"
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_11GraphicsBox_1boxes_to_text, 0, __pyx_n_s_GraphicsBox_boxes_to_text, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__440)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2939, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_boxes_to_text, __pyx_t_4) < 0) __PYX_ERR(0, 2939, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":2943
 *         return "-Graphics-"
 * 
 *     def _get_image_size(self, options, graphics_options, max_width):             # <<<<<<<<<<<<<<
 *         inside_row = options.pop("inside_row", False)
 *         inside_list = options.pop("inside_list", False)
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_11GraphicsBox_3_get_image_size, 0, __pyx_n_s_GraphicsBox__get_image_size, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__442)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2943, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_get_image_size, __pyx_t_4) < 0) __PYX_ERR(0, 2943, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":2992
 *         return base_width, base_height, multi, aspect
 * 
 *     def _prepare_elements(self, leaves, options, neg_y=False, max_width=None):             # <<<<<<<<<<<<<<
 *         if not leaves:
 *             raise BoxConstructError
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_11GraphicsBox_5_prepare_elements, 0, __pyx_n_s_GraphicsBox__prepare_elements, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__444)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2992, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__445);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_prepare_elements, __pyx_t_4) < 0) __PYX_ERR(0, 2992, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":3145
 *         return elements, calc_dimensions
 * 
 *     def boxes_to_tex(self, leaves, **options):             # <<<<<<<<<<<<<<
 *         elements, calc_dimensions = self._prepare_elements(
 *             leaves, options, max_width=450
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_11GraphicsBox_7boxes_to_tex, 0, __pyx_n_s_GraphicsBox_boxes_to_tex, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__447)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_boxes_to_tex, __pyx_t_4) < 0) __PYX_ERR(0, 3145, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":3198
 *         return tex
 * 
 *     def boxes_to_xml(self, leaves, **options):             # <<<<<<<<<<<<<<
 *         elements, calc_dimensions = self._prepare_elements(leaves, options, neg_y=True)
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_11GraphicsBox_9boxes_to_xml, 0, __pyx_n_s_GraphicsBox_boxes_to_xml, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__449)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3198, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_boxes_to_xml, __pyx_t_4) < 0) __PYX_ERR(0, 3198, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":3242
 *         )
 * 
 *     def axis_ticks(self, xmin, xmax):             # <<<<<<<<<<<<<<
 *         def round_to_zero(value):
 *             if value == 0:
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_11GraphicsBox_11axis_ticks, 0, __pyx_n_s_GraphicsBox_axis_ticks, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__451)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3242, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_axis_ticks, __pyx_t_4) < 0) __PYX_ERR(0, 3242, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":3302
 *         return ticks, ticks_small, origin_x
 * 
 *     def create_axes(self, elements, graphics_options, xmin, xmax, ymin, ymax):             # <<<<<<<<<<<<<<
 *         axes = graphics_options.get("System`Axes")
 *         if axes.is_true():
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_11GraphicsBox_13create_axes, 0, __pyx_n_s_GraphicsBox_create_axes, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__453)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3302, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_create_axes, __pyx_t_4) < 0) __PYX_ERR(0, 3302, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":2934
 * 
 * 
 * class GraphicsBox(BoxConstruct):             # <<<<<<<<<<<<<<
 *     options = Graphics.options
 * 
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_GraphicsBox, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2934, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_GraphicsBox, __pyx_t_4) < 0) __PYX_ERR(0, 2934, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":3460
 * 
 * 
 * class Directive(Builtin):             # <<<<<<<<<<<<<<
 *     attributes = ("ReadProtected",)
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Builtin); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3460, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3460, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3460, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_Directive, __pyx_n_s_Directive, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3460, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "mathics/builtin/graphics.py":3461
 * 
 * class Directive(Builtin):
 *     attributes = ("ReadProtected",)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_attributes, __pyx_tuple__454) < 0) __PYX_ERR(0, 3461, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":3460
 * 
 * 
 * class Directive(Builtin):             # <<<<<<<<<<<<<<
 *     attributes = ("ReadProtected",)
 * 
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_Directive, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3460, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Directive, __pyx_t_4) < 0) __PYX_ERR(0, 3460, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":3464
 * 
 * 
 * class Blend(Builtin):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Builtin); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3464, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3464, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3464, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_Blend, __pyx_n_s_Blend, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_kp_s_dl_dt_Blend_c1_c2_dd_represents); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3464, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "mathics/builtin/graphics.py":3496
 * 
 *     messages = {
 *         "arg": (             # <<<<<<<<<<<<<<
 *             "`1` is not a valid list of color or gray-level directives, "
 *             "or pairs of a real number and a directive."
 */
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3496, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_arg, __pyx_kp_u_1_is_not_a_valid_list_of_color) < 0) __PYX_ERR(0, 3496, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_argl, __pyx_kp_u_1_should_be_a_real_number_or_a) < 0) __PYX_ERR(0, 3496, __pyx_L1_error)
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_messages, __pyx_t_4) < 0) __PYX_ERR(0, 3495, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":3507
 * 
 *     rules = {
 *         "Blend[colors_]": "Blend[colors, ConstantArray[1, Length[colors]]]",             # <<<<<<<<<<<<<<
 *     }
 * 
 */
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3507, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_Blend_colors, __pyx_kp_u_Blend_colors_ConstantArray_1_Len) < 0) __PYX_ERR(0, 3507, __pyx_L1_error)
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_rules, __pyx_t_4) < 0) __PYX_ERR(0, 3506, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":3510
 *     }
 * 
 *     def do_blend(self, colors, values):             # <<<<<<<<<<<<<<
 *         type = None
 *         homogenous = True
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_5Blend_1do_blend, 0, __pyx_n_s_Blend_do_blend, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__456)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3510, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_do_blend, __pyx_t_4) < 0) __PYX_ERR(0, 3510, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":3534
 *         return type(components=result)
 * 
 *     def apply(self, colors, u, evaluation):             # <<<<<<<<<<<<<<
 *         "Blend[{colors___}, u_]"
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_5Blend_3apply, 0, __pyx_n_s_Blend_apply, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__458)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3534, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_apply, __pyx_t_4) < 0) __PYX_ERR(0, 3534, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":3464
 * 
 * 
 * class Blend(Builtin):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_Blend, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3464, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Blend, __pyx_t_4) < 0) __PYX_ERR(0, 3464, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":3579
 * 
 * 
 * class Lighter(Builtin):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Builtin); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3579, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3579, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3579, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_Lighter, __pyx_n_s_Lighter, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_kp_s_dl_dt_Lighter_c_f_dd_is_equival); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3579, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "mathics/builtin/graphics.py":3597
 * 
 *     rules = {
 *         "Lighter[c_, f_]": "Blend[{c, White}, f]",             # <<<<<<<<<<<<<<
 *         "Lighter[c_]": "Lighter[c, 1/3]",
 *     }
 */
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3597, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_Lighter_c__f, __pyx_kp_u_Blend_c_White_f) < 0) __PYX_ERR(0, 3597, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_Lighter_c, __pyx_kp_u_Lighter_c_1_3) < 0) __PYX_ERR(0, 3597, __pyx_L1_error)
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_rules, __pyx_t_4) < 0) __PYX_ERR(0, 3596, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":3579
 * 
 * 
 * class Lighter(Builtin):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_Lighter, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3579, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Lighter, __pyx_t_4) < 0) __PYX_ERR(0, 3579, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":3602
 * 
 * 
 * class Darker(Builtin):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Builtin); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3602, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3602, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3602, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_Darker, __pyx_n_s_Darker, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_kp_s_dl_dt_Darker_c_f_dd_is_equivale); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3602, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "mathics/builtin/graphics.py":3616
 * 
 *     rules = {
 *         "Darker[c_, f_]": "Blend[{c, Black}, f]",             # <<<<<<<<<<<<<<
 *         "Darker[c_]": "Darker[c, 1/3]",
 *     }
 */
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3616, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_Darker_c__f, __pyx_kp_u_Blend_c_Black_f) < 0) __PYX_ERR(0, 3616, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_Darker_c, __pyx_kp_u_Darker_c_1_3) < 0) __PYX_ERR(0, 3616, __pyx_L1_error)
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_rules, __pyx_t_4) < 0) __PYX_ERR(0, 3615, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":3602
 * 
 * 
 * class Darker(Builtin):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_Darker, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3602, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Darker, __pyx_t_4) < 0) __PYX_ERR(0, 3602, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":3621
 * 
 * 
 * class _ColorObject(Builtin):             # <<<<<<<<<<<<<<
 *     text_name = None
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Builtin); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3621, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3621, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3621, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_ColorObject, __pyx_n_s_ColorObject, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3621, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "mathics/builtin/graphics.py":3622
 * 
 * class _ColorObject(Builtin):
 *     text_name = None             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, *args, **kwargs):
 */
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_text_name, Py_None) < 0) __PYX_ERR(0, 3622, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":3624
 *     text_name = None
 * 
 *     def __init__(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         super(_ColorObject, self).__init__(*args, **kwargs)
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7mathics_7builtin_8graphics_12_ColorObject_1__init__, 0, __pyx_n_s_ColorObject___init, NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_d, ((PyObject *)__pyx_codeobj__460)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3624, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_init_2, __pyx_t_4) < 0) __PYX_ERR(0, 3624, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":3621
 * 
 * 
 * class _ColorObject(Builtin):             # <<<<<<<<<<<<<<
 *     text_name = None
 * 
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_ColorObject, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3621, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ColorObject, __pyx_t_4) < 0) __PYX_ERR(0, 3621, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":3652
 * 
 * 
 * class Black(_ColorObject):             # <<<<<<<<<<<<<<
 *     """
 *     >> Black
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ColorObject); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3652, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3652, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3652, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_Black, __pyx_n_s_Black, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_kp_s_Black_GrayLevel_0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3652, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "mathics/builtin/graphics.py":3659
 * 
 *     rules = {
 *         "Black": "GrayLevel[0]",             # <<<<<<<<<<<<<<
 *     }
 * 
 */
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3659, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_Black, __pyx_kp_u_GrayLevel_0) < 0) __PYX_ERR(0, 3659, __pyx_L1_error)
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_rules, __pyx_t_4) < 0) __PYX_ERR(0, 3658, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":3652
 * 
 * 
 * class Black(_ColorObject):             # <<<<<<<<<<<<<<
 *     """
 *     >> Black
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_Black, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3652, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Black, __pyx_t_4) < 0) __PYX_ERR(0, 3652, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":3663
 * 
 * 
 * class White(_ColorObject):             # <<<<<<<<<<<<<<
 *     """
 *     >> White
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ColorObject); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3663, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3663, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3663, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_White, __pyx_n_s_White, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_kp_s_White_GrayLevel_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3663, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "mathics/builtin/graphics.py":3670
 * 
 *     rules = {
 *         "White": "GrayLevel[1]",             # <<<<<<<<<<<<<<
 *     }
 * 
 */
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3670, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_White, __pyx_kp_u_GrayLevel_1) < 0) __PYX_ERR(0, 3670, __pyx_L1_error)
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_rules, __pyx_t_4) < 0) __PYX_ERR(0, 3669, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":3663
 * 
 * 
 * class White(_ColorObject):             # <<<<<<<<<<<<<<
 *     """
 *     >> White
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_White, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3663, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_White, __pyx_t_4) < 0) __PYX_ERR(0, 3663, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":3674
 * 
 * 
 * class Gray(_ColorObject):             # <<<<<<<<<<<<<<
 *     """
 *     >> Gray
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ColorObject); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3674, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3674, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3674, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_Gray, __pyx_n_s_Gray, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_kp_s_Gray_GrayLevel_0_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3674, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "mathics/builtin/graphics.py":3681
 * 
 *     rules = {
 *         "Gray": "GrayLevel[0.5]",             # <<<<<<<<<<<<<<
 *     }
 * 
 */
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3681, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_Gray, __pyx_kp_u_GrayLevel_0_5) < 0) __PYX_ERR(0, 3681, __pyx_L1_error)
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_rules, __pyx_t_4) < 0) __PYX_ERR(0, 3680, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":3674
 * 
 * 
 * class Gray(_ColorObject):             # <<<<<<<<<<<<<<
 *     """
 *     >> Gray
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_Gray, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3674, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Gray, __pyx_t_4) < 0) __PYX_ERR(0, 3674, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":3685
 * 
 * 
 * class Red(_ColorObject):             # <<<<<<<<<<<<<<
 *     """
 *     >> Red
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ColorObject); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3685, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3685, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3685, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_Red, __pyx_n_s_Red, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_kp_s_Red_RGBColor_1_0_0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3685, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "mathics/builtin/graphics.py":3692
 * 
 *     rules = {
 *         "Red": "RGBColor[1, 0, 0]",             # <<<<<<<<<<<<<<
 *     }
 * 
 */
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3692, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_Red, __pyx_kp_u_RGBColor_1_0_0) < 0) __PYX_ERR(0, 3692, __pyx_L1_error)
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_rules, __pyx_t_4) < 0) __PYX_ERR(0, 3691, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":3685
 * 
 * 
 * class Red(_ColorObject):             # <<<<<<<<<<<<<<
 *     """
 *     >> Red
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_Red, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3685, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Red, __pyx_t_4) < 0) __PYX_ERR(0, 3685, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":3696
 * 
 * 
 * class Green(_ColorObject):             # <<<<<<<<<<<<<<
 *     """
 *     >> Green
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ColorObject); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3696, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3696, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3696, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_Green, __pyx_n_s_Green, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_kp_s_Green_RGBColor_0_1_0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3696, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "mathics/builtin/graphics.py":3703
 * 
 *     rules = {
 *         "Green": "RGBColor[0, 1, 0]",             # <<<<<<<<<<<<<<
 *     }
 * 
 */
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3703, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_Green, __pyx_kp_u_RGBColor_0_1_0) < 0) __PYX_ERR(0, 3703, __pyx_L1_error)
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_rules, __pyx_t_4) < 0) __PYX_ERR(0, 3702, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":3696
 * 
 * 
 * class Green(_ColorObject):             # <<<<<<<<<<<<<<
 *     """
 *     >> Green
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_Green, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3696, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Green, __pyx_t_4) < 0) __PYX_ERR(0, 3696, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":3707
 * 
 * 
 * class Blue(_ColorObject):             # <<<<<<<<<<<<<<
 *     """
 *     >> Blue
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ColorObject); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3707, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3707, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3707, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_Blue, __pyx_n_s_Blue, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_kp_s_Blue_RGBColor_0_0_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3707, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "mathics/builtin/graphics.py":3714
 * 
 *     rules = {
 *         "Blue": "RGBColor[0, 0, 1]",             # <<<<<<<<<<<<<<
 *     }
 * 
 */
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3714, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_Blue, __pyx_kp_u_RGBColor_0_0_1) < 0) __PYX_ERR(0, 3714, __pyx_L1_error)
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_rules, __pyx_t_4) < 0) __PYX_ERR(0, 3713, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":3707
 * 
 * 
 * class Blue(_ColorObject):             # <<<<<<<<<<<<<<
 *     """
 *     >> Blue
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_Blue, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3707, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Blue, __pyx_t_4) < 0) __PYX_ERR(0, 3707, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":3718
 * 
 * 
 * class Cyan(_ColorObject):             # <<<<<<<<<<<<<<
 *     """
 *     >> Cyan
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ColorObject); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3718, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3718, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3718, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_Cyan, __pyx_n_s_Cyan, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_kp_s_Cyan_RGBColor_0_1_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3718, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "mathics/builtin/graphics.py":3725
 * 
 *     rules = {
 *         "Cyan": "RGBColor[0, 1, 1]",             # <<<<<<<<<<<<<<
 *     }
 * 
 */
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3725, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_Cyan, __pyx_kp_u_RGBColor_0_1_1) < 0) __PYX_ERR(0, 3725, __pyx_L1_error)
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_rules, __pyx_t_4) < 0) __PYX_ERR(0, 3724, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":3718
 * 
 * 
 * class Cyan(_ColorObject):             # <<<<<<<<<<<<<<
 *     """
 *     >> Cyan
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_Cyan, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3718, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Cyan, __pyx_t_4) < 0) __PYX_ERR(0, 3718, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":3729
 * 
 * 
 * class Magenta(_ColorObject):             # <<<<<<<<<<<<<<
 *     """
 *     >> Magenta
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ColorObject); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3729, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3729, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3729, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_Magenta, __pyx_n_s_Magenta, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_kp_s_Magenta_RGBColor_1_0_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3729, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "mathics/builtin/graphics.py":3736
 * 
 *     rules = {
 *         "Magenta": "RGBColor[1, 0, 1]",             # <<<<<<<<<<<<<<
 *     }
 * 
 */
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3736, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_Magenta, __pyx_kp_u_RGBColor_1_0_1) < 0) __PYX_ERR(0, 3736, __pyx_L1_error)
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_rules, __pyx_t_4) < 0) __PYX_ERR(0, 3735, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":3729
 * 
 * 
 * class Magenta(_ColorObject):             # <<<<<<<<<<<<<<
 *     """
 *     >> Magenta
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_Magenta, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3729, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Magenta, __pyx_t_4) < 0) __PYX_ERR(0, 3729, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":3740
 * 
 * 
 * class Yellow(_ColorObject):             # <<<<<<<<<<<<<<
 *     """
 *     >> Yellow
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ColorObject); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3740, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3740, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3740, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_Yellow, __pyx_n_s_Yellow, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_kp_s_Yellow_RGBColor_1_1_0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3740, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "mathics/builtin/graphics.py":3747
 * 
 *     rules = {
 *         "Yellow": "RGBColor[1, 1, 0]",             # <<<<<<<<<<<<<<
 *     }
 * 
 */
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3747, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_Yellow, __pyx_kp_u_RGBColor_1_1_0) < 0) __PYX_ERR(0, 3747, __pyx_L1_error)
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_rules, __pyx_t_4) < 0) __PYX_ERR(0, 3746, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":3740
 * 
 * 
 * class Yellow(_ColorObject):             # <<<<<<<<<<<<<<
 *     """
 *     >> Yellow
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_Yellow, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3740, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Yellow, __pyx_t_4) < 0) __PYX_ERR(0, 3740, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":3751
 * 
 * 
 * class Purple(_ColorObject):             # <<<<<<<<<<<<<<
 *     rules = {
 *         "Purple": "RGBColor[0.5, 0, 0.5]",
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ColorObject); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3751, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3751, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3751, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_Purple, __pyx_n_s_Purple, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3751, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "mathics/builtin/graphics.py":3753
 * class Purple(_ColorObject):
 *     rules = {
 *         "Purple": "RGBColor[0.5, 0, 0.5]",             # <<<<<<<<<<<<<<
 *     }
 * 
 */
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3753, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_Purple, __pyx_kp_u_RGBColor_0_5_0_0_5) < 0) __PYX_ERR(0, 3753, __pyx_L1_error)
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_rules, __pyx_t_4) < 0) __PYX_ERR(0, 3752, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":3751
 * 
 * 
 * class Purple(_ColorObject):             # <<<<<<<<<<<<<<
 *     rules = {
 *         "Purple": "RGBColor[0.5, 0, 0.5]",
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_Purple, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3751, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Purple, __pyx_t_4) < 0) __PYX_ERR(0, 3751, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":3757
 * 
 * 
 * class LightRed(_ColorObject):             # <<<<<<<<<<<<<<
 *     text_name = "light red"
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ColorObject); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3757, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3757, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3757, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_LightRed, __pyx_n_s_LightRed, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3757, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "mathics/builtin/graphics.py":3758
 * 
 * class LightRed(_ColorObject):
 *     text_name = "light red"             # <<<<<<<<<<<<<<
 * 
 *     rules = {
 */
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_text_name, __pyx_kp_u_light_red) < 0) __PYX_ERR(0, 3758, __pyx_L1_error)

  /* "mathics/builtin/graphics.py":3761
 * 
 *     rules = {
 *         "LightRed": "Lighter[Red, 0.85]",             # <<<<<<<<<<<<<<
 *     }
 * 
 */
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3761, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_LightRed, __pyx_kp_u_Lighter_Red_0_85) < 0) __PYX_ERR(0, 3761, __pyx_L1_error)
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_rules, __pyx_t_4) < 0) __PYX_ERR(0, 3760, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":3757
 * 
 * 
 * class LightRed(_ColorObject):             # <<<<<<<<<<<<<<
 *     text_name = "light red"
 * 
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_LightRed, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3757, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_LightRed, __pyx_t_4) < 0) __PYX_ERR(0, 3757, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":3765
 * 
 * 
 * class Orange(_ColorObject):             # <<<<<<<<<<<<<<
 *     rules = {
 *         "Orange": "RGBColor[1, 0.5, 0]",
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ColorObject); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3765, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3765, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3765, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_Orange, __pyx_n_s_Orange, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3765, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "mathics/builtin/graphics.py":3767
 * class Orange(_ColorObject):
 *     rules = {
 *         "Orange": "RGBColor[1, 0.5, 0]",             # <<<<<<<<<<<<<<
 *     }
 * 
 */
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3767, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_Orange, __pyx_kp_u_RGBColor_1_0_5_0) < 0) __PYX_ERR(0, 3767, __pyx_L1_error)
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_rules, __pyx_t_4) < 0) __PYX_ERR(0, 3766, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "mathics/builtin/graphics.py":3765
 * 
 * 
 * class Orange(_ColorObject):             # <<<<<<<<<<<<<<
 *     rules = {
 *         "Orange": "RGBColor[1, 0.5, 0]",
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_Orange, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3765, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Orange, __pyx_t_4) < 0) __PYX_ERR(0, 3765, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":3771
 * 
 * 
 * class Automatic(Builtin):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Builtin); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3771, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3771, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3771, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_Automatic, __pyx_n_s_Automatic, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_kp_s_dl_dt_Automatic_dd_is_used_to_s); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3771, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_Automatic, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3771, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Automatic, __pyx_t_4) < 0) __PYX_ERR(0, 3771, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":3786
 * 
 * 
 * class Tiny(Builtin):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Builtin); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3786, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3786, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3786, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_Tiny, __pyx_n_s_Tiny, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_kp_s_dl_dt_ImageSize_Tiny_dd_produce); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3786, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_Tiny, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3786, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Tiny, __pyx_t_4) < 0) __PYX_ERR(0, 3786, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":3795
 * 
 * 
 * class Small(Builtin):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Builtin); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3795, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3795, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3795, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_Small, __pyx_n_s_Small, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_kp_s_dl_dt_ImageSize_Small_dd_produc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3795, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_Small, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3795, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Small, __pyx_t_4) < 0) __PYX_ERR(0, 3795, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":3804
 * 
 * 
 * class Medium(Builtin):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Builtin); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3804, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3804, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3804, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_Medium, __pyx_n_s_Medium, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_kp_s_dl_dt_ImageSize_Medium_dd_produ); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3804, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_Medium, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3804, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Medium, __pyx_t_4) < 0) __PYX_ERR(0, 3804, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":3813
 * 
 * 
 * class Large(Builtin):             # <<<<<<<<<<<<<<
 *     """
 *     <dl>
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Builtin); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3813, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3813, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3813, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_Large, __pyx_n_s_Large, (PyObject *) NULL, __pyx_n_s_mathics_builtin_graphics, __pyx_kp_s_dl_dt_ImageSize_Large_dd_produc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3813, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_Large, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3813, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Large, __pyx_t_4) < 0) __PYX_ERR(0, 3813, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":3823
 * 
 * element_heads = frozenset(
 *     system_symbols(             # <<<<<<<<<<<<<<
 *         "Rectangle",
 *         "Disk",
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_system_symbols); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3823, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__461, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3823, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":3822
 * 
 * 
 * element_heads = frozenset(             # <<<<<<<<<<<<<<
 *     system_symbols(
 *         "Rectangle",
 */
  __pyx_t_1 = __Pyx_PyFrozenSet_New(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3822, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_element_heads, __pyx_t_1) < 0) __PYX_ERR(0, 3822, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":3841
 * )
 * 
 * styles = system_symbols_dict(             # <<<<<<<<<<<<<<
 *     {
 *         "RGBColor": RGBColor,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_system_symbols_dict); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3841, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "mathics/builtin/graphics.py":3843
 * styles = system_symbols_dict(
 *     {
 *         "RGBColor": RGBColor,             # <<<<<<<<<<<<<<
 *         "XYZColor": XYZColor,
 *         "LABColor": LABColor,
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(14); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3843, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_RGBColor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3843, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_RGBColor, __pyx_t_3) < 0) __PYX_ERR(0, 3843, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":3844
 *     {
 *         "RGBColor": RGBColor,
 *         "XYZColor": XYZColor,             # <<<<<<<<<<<<<<
 *         "LABColor": LABColor,
 *         "LCHColor": LCHColor,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_XYZColor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3844, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_XYZColor, __pyx_t_3) < 0) __PYX_ERR(0, 3843, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":3845
 *         "RGBColor": RGBColor,
 *         "XYZColor": XYZColor,
 *         "LABColor": LABColor,             # <<<<<<<<<<<<<<
 *         "LCHColor": LCHColor,
 *         "LUVColor": LUVColor,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_LABColor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3845, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_LABColor, __pyx_t_3) < 0) __PYX_ERR(0, 3843, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":3846
 *         "XYZColor": XYZColor,
 *         "LABColor": LABColor,
 *         "LCHColor": LCHColor,             # <<<<<<<<<<<<<<
 *         "LUVColor": LUVColor,
 *         "CMYKColor": CMYKColor,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_LCHColor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3846, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_LCHColor, __pyx_t_3) < 0) __PYX_ERR(0, 3843, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":3847
 *         "LABColor": LABColor,
 *         "LCHColor": LCHColor,
 *         "LUVColor": LUVColor,             # <<<<<<<<<<<<<<
 *         "CMYKColor": CMYKColor,
 *         "Hue": Hue,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_LUVColor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3847, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_LUVColor, __pyx_t_3) < 0) __PYX_ERR(0, 3843, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":3848
 *         "LCHColor": LCHColor,
 *         "LUVColor": LUVColor,
 *         "CMYKColor": CMYKColor,             # <<<<<<<<<<<<<<
 *         "Hue": Hue,
 *         "GrayLevel": GrayLevel,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_CMYKColor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3848, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_CMYKColor, __pyx_t_3) < 0) __PYX_ERR(0, 3843, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":3849
 *         "LUVColor": LUVColor,
 *         "CMYKColor": CMYKColor,
 *         "Hue": Hue,             # <<<<<<<<<<<<<<
 *         "GrayLevel": GrayLevel,
 *         "Thickness": Thickness,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Hue); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3849, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_Hue, __pyx_t_3) < 0) __PYX_ERR(0, 3843, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":3850
 *         "CMYKColor": CMYKColor,
 *         "Hue": Hue,
 *         "GrayLevel": GrayLevel,             # <<<<<<<<<<<<<<
 *         "Thickness": Thickness,
 *         "AbsoluteThickness": AbsoluteThickness,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_GrayLevel); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3850, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_GrayLevel, __pyx_t_3) < 0) __PYX_ERR(0, 3843, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":3851
 *         "Hue": Hue,
 *         "GrayLevel": GrayLevel,
 *         "Thickness": Thickness,             # <<<<<<<<<<<<<<
 *         "AbsoluteThickness": AbsoluteThickness,
 *         "Thick": Thick,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Thickness_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3851, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_Thickness_2, __pyx_t_3) < 0) __PYX_ERR(0, 3843, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":3852
 *         "GrayLevel": GrayLevel,
 *         "Thickness": Thickness,
 *         "AbsoluteThickness": AbsoluteThickness,             # <<<<<<<<<<<<<<
 *         "Thick": Thick,
 *         "Thin": Thin,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_AbsoluteThickness); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3852, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_AbsoluteThickness, __pyx_t_3) < 0) __PYX_ERR(0, 3843, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":3853
 *         "Thickness": Thickness,
 *         "AbsoluteThickness": AbsoluteThickness,
 *         "Thick": Thick,             # <<<<<<<<<<<<<<
 *         "Thin": Thin,
 *         "PointSize": PointSize,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Thick); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3853, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_Thick, __pyx_t_3) < 0) __PYX_ERR(0, 3843, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":3854
 *         "AbsoluteThickness": AbsoluteThickness,
 *         "Thick": Thick,
 *         "Thin": Thin,             # <<<<<<<<<<<<<<
 *         "PointSize": PointSize,
 *         "Arrowheads": Arrowheads,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Thin); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3854, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_Thin, __pyx_t_3) < 0) __PYX_ERR(0, 3843, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":3855
 *         "Thick": Thick,
 *         "Thin": Thin,
 *         "PointSize": PointSize,             # <<<<<<<<<<<<<<
 *         "Arrowheads": Arrowheads,
 *     }
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PointSize); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3855, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_PointSize, __pyx_t_3) < 0) __PYX_ERR(0, 3843, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":3856
 *         "Thin": Thin,
 *         "PointSize": PointSize,
 *         "Arrowheads": Arrowheads,             # <<<<<<<<<<<<<<
 *     }
 * )
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Arrowheads); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3856, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_Arrowheads, __pyx_t_3) < 0) __PYX_ERR(0, 3843, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":3841
 * )
 * 
 * styles = system_symbols_dict(             # <<<<<<<<<<<<<<
 *     {
 *         "RGBColor": RGBColor,
 */
  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3841, __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 (PyDict_SetItem(__pyx_d, __pyx_n_s_styles, __pyx_t_3) < 0) __PYX_ERR(0, 3841, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":3860
 * )
 * 
 * style_options = system_symbols_dict(             # <<<<<<<<<<<<<<
 *     {
 *         "FontColor": _style,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_system_symbols_dict); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3860, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "mathics/builtin/graphics.py":3862
 * style_options = system_symbols_dict(
 *     {
 *         "FontColor": _style,             # <<<<<<<<<<<<<<
 *     }
 * )
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3862, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_style_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3862, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_FontColor, __pyx_t_1) < 0) __PYX_ERR(0, 3862, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":3860
 * )
 * 
 * style_options = system_symbols_dict(             # <<<<<<<<<<<<<<
 *     {
 *         "FontColor": _style,
 */
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3860, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_style_options, __pyx_t_1) < 0) __PYX_ERR(0, 3860, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":3866
 * )
 * 
 * style_heads = frozenset(styles.keys())             # <<<<<<<<<<<<<<
 * 
 * style_and_form_heads = frozenset(
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_styles); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3866, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_keys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3866, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3866, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyFrozenSet_New(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3866, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_style_heads, __pyx_t_2) < 0) __PYX_ERR(0, 3866, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":3869
 * 
 * style_and_form_heads = frozenset(
 *     style_heads.union(set(["System`EdgeForm", "System`FaceForm"]))             # <<<<<<<<<<<<<<
 * )
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_style_heads); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3869, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_union); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3869, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PySet_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3869, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PySet_Add(__pyx_t_2, __pyx_kp_u_System_EdgeForm) < 0) __PYX_ERR(0, 3869, __pyx_L1_error)
  if (PySet_Add(__pyx_t_2, __pyx_kp_u_System_FaceForm) < 0) __PYX_ERR(0, 3869, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3869, __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;

  /* "mathics/builtin/graphics.py":3868
 * style_heads = frozenset(styles.keys())
 * 
 * style_and_form_heads = frozenset(             # <<<<<<<<<<<<<<
 *     style_heads.union(set(["System`EdgeForm", "System`FaceForm"]))
 * )
 */
  __pyx_t_2 = __Pyx_PyFrozenSet_New(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3868, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_style_and_form_heads, __pyx_t_2) < 0) __PYX_ERR(0, 3868, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":3872
 * )
 * 
 * GLOBALS = system_symbols_dict(             # <<<<<<<<<<<<<<
 *     {
 *         "Rectangle": Rectangle,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_system_symbols_dict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3872, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "mathics/builtin/graphics.py":3874
 * GLOBALS = system_symbols_dict(
 *     {
 *         "Rectangle": Rectangle,             # <<<<<<<<<<<<<<
 *         "Disk": Disk,
 *         "Circle": Circle,
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(18); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3874, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Rectangle); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3874, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_Rectangle, __pyx_t_1) < 0) __PYX_ERR(0, 3874, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":3875
 *     {
 *         "Rectangle": Rectangle,
 *         "Disk": Disk,             # <<<<<<<<<<<<<<
 *         "Circle": Circle,
 *         "Polygon": Polygon,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Disk); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3875, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_Disk, __pyx_t_1) < 0) __PYX_ERR(0, 3874, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":3876
 *         "Rectangle": Rectangle,
 *         "Disk": Disk,
 *         "Circle": Circle,             # <<<<<<<<<<<<<<
 *         "Polygon": Polygon,
 *         "RegularPolygon": RegularPolygon,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Circle); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3876, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_Circle, __pyx_t_1) < 0) __PYX_ERR(0, 3874, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":3877
 *         "Disk": Disk,
 *         "Circle": Circle,
 *         "Polygon": Polygon,             # <<<<<<<<<<<<<<
 *         "RegularPolygon": RegularPolygon,
 *         "Inset": Inset,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Polygon); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3877, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_Polygon, __pyx_t_1) < 0) __PYX_ERR(0, 3874, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":3878
 *         "Circle": Circle,
 *         "Polygon": Polygon,
 *         "RegularPolygon": RegularPolygon,             # <<<<<<<<<<<<<<
 *         "Inset": Inset,
 *         "Text": Text,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_RegularPolygon); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3878, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_RegularPolygon, __pyx_t_1) < 0) __PYX_ERR(0, 3874, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":3879
 *         "Polygon": Polygon,
 *         "RegularPolygon": RegularPolygon,
 *         "Inset": Inset,             # <<<<<<<<<<<<<<
 *         "Text": Text,
 *         "RectangleBox": RectangleBox,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Inset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3879, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_Inset, __pyx_t_1) < 0) __PYX_ERR(0, 3874, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":3880
 *         "RegularPolygon": RegularPolygon,
 *         "Inset": Inset,
 *         "Text": Text,             # <<<<<<<<<<<<<<
 *         "RectangleBox": RectangleBox,
 *         "DiskBox": DiskBox,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Text); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3880, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_Text, __pyx_t_1) < 0) __PYX_ERR(0, 3874, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":3881
 *         "Inset": Inset,
 *         "Text": Text,
 *         "RectangleBox": RectangleBox,             # <<<<<<<<<<<<<<
 *         "DiskBox": DiskBox,
 *         "LineBox": LineBox,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_RectangleBox); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3881, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_RectangleBox, __pyx_t_1) < 0) __PYX_ERR(0, 3874, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":3882
 *         "Text": Text,
 *         "RectangleBox": RectangleBox,
 *         "DiskBox": DiskBox,             # <<<<<<<<<<<<<<
 *         "LineBox": LineBox,
 *         "BezierCurveBox": BezierCurveBox,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_DiskBox); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3882, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_DiskBox, __pyx_t_1) < 0) __PYX_ERR(0, 3874, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":3883
 *         "RectangleBox": RectangleBox,
 *         "DiskBox": DiskBox,
 *         "LineBox": LineBox,             # <<<<<<<<<<<<<<
 *         "BezierCurveBox": BezierCurveBox,
 *         "FilledCurveBox": FilledCurveBox,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_LineBox); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3883, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_LineBox, __pyx_t_1) < 0) __PYX_ERR(0, 3874, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":3884
 *         "DiskBox": DiskBox,
 *         "LineBox": LineBox,
 *         "BezierCurveBox": BezierCurveBox,             # <<<<<<<<<<<<<<
 *         "FilledCurveBox": FilledCurveBox,
 *         "ArrowBox": ArrowBox,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_BezierCurveBox); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3884, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_BezierCurveBox, __pyx_t_1) < 0) __PYX_ERR(0, 3874, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":3885
 *         "LineBox": LineBox,
 *         "BezierCurveBox": BezierCurveBox,
 *         "FilledCurveBox": FilledCurveBox,             # <<<<<<<<<<<<<<
 *         "ArrowBox": ArrowBox,
 *         "CircleBox": CircleBox,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_FilledCurveBox); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3885, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_FilledCurveBox, __pyx_t_1) < 0) __PYX_ERR(0, 3874, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":3886
 *         "BezierCurveBox": BezierCurveBox,
 *         "FilledCurveBox": FilledCurveBox,
 *         "ArrowBox": ArrowBox,             # <<<<<<<<<<<<<<
 *         "CircleBox": CircleBox,
 *         "PolygonBox": PolygonBox,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ArrowBox); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3886, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_ArrowBox, __pyx_t_1) < 0) __PYX_ERR(0, 3874, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":3887
 *         "FilledCurveBox": FilledCurveBox,
 *         "ArrowBox": ArrowBox,
 *         "CircleBox": CircleBox,             # <<<<<<<<<<<<<<
 *         "PolygonBox": PolygonBox,
 *         "RegularPolygonBox": RegularPolygonBox,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_CircleBox); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3887, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_CircleBox, __pyx_t_1) < 0) __PYX_ERR(0, 3874, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":3888
 *         "ArrowBox": ArrowBox,
 *         "CircleBox": CircleBox,
 *         "PolygonBox": PolygonBox,             # <<<<<<<<<<<<<<
 *         "RegularPolygonBox": RegularPolygonBox,
 *         "PointBox": PointBox,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_PolygonBox); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3888, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_PolygonBox, __pyx_t_1) < 0) __PYX_ERR(0, 3874, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":3889
 *         "CircleBox": CircleBox,
 *         "PolygonBox": PolygonBox,
 *         "RegularPolygonBox": RegularPolygonBox,             # <<<<<<<<<<<<<<
 *         "PointBox": PointBox,
 *         "InsetBox": InsetBox,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_RegularPolygonBox); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3889, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_RegularPolygonBox, __pyx_t_1) < 0) __PYX_ERR(0, 3874, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":3890
 *         "PolygonBox": PolygonBox,
 *         "RegularPolygonBox": RegularPolygonBox,
 *         "PointBox": PointBox,             # <<<<<<<<<<<<<<
 *         "InsetBox": InsetBox,
 *     }
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_PointBox); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3890, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_PointBox, __pyx_t_1) < 0) __PYX_ERR(0, 3874, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":3891
 *         "RegularPolygonBox": RegularPolygonBox,
 *         "PointBox": PointBox,
 *         "InsetBox": InsetBox,             # <<<<<<<<<<<<<<
 *     }
 * )
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_InsetBox); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3891, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_InsetBox, __pyx_t_1) < 0) __PYX_ERR(0, 3874, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":3872
 * )
 * 
 * GLOBALS = system_symbols_dict(             # <<<<<<<<<<<<<<
 *     {
 *         "Rectangle": Rectangle,
 */
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3872, __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;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_GLOBALS, __pyx_t_1) < 0) __PYX_ERR(0, 3872, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":3895
 * )
 * 
 * GLOBALS.update(styles)             # <<<<<<<<<<<<<<
 * 
 * GRAPHICS_SYMBOLS = frozenset(
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_GLOBALS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3895, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_update); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3895, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_styles); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3895, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3895, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mathics/builtin/graphics.py":3898
 * 
 * GRAPHICS_SYMBOLS = frozenset(
 *     ["System`List", "System`Rule", "System`VertexColors"]             # <<<<<<<<<<<<<<
 *     + list(element_heads)
 *     + [element + "Box" for element in element_heads]
 */
  __pyx_t_2 = PyList_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3898, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_kp_u_System_List);
  __Pyx_GIVEREF(__pyx_kp_u_System_List);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u_System_List);
  __Pyx_INCREF(__pyx_kp_u_System_Rule);
  __Pyx_GIVEREF(__pyx_kp_u_System_Rule);
  PyList_SET_ITEM(__pyx_t_2, 1, __pyx_kp_u_System_Rule);
  __Pyx_INCREF(__pyx_kp_u_System_VertexColors);
  __Pyx_GIVEREF(__pyx_kp_u_System_VertexColors);
  PyList_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u_System_VertexColors);

  /* "mathics/builtin/graphics.py":3899
 * GRAPHICS_SYMBOLS = frozenset(
 *     ["System`List", "System`Rule", "System`VertexColors"]
 *     + list(element_heads)             # <<<<<<<<<<<<<<
 *     + [element + "Box" for element in element_heads]
 *     + list(style_heads)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_element_heads); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3899, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PySequence_List(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3899, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3899, __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;
  { /* enter inner scope */

    /* "mathics/builtin/graphics.py":3900
 *     ["System`List", "System`Rule", "System`VertexColors"]
 *     + list(element_heads)
 *     + [element + "Box" for element in element_heads]             # <<<<<<<<<<<<<<
 *     + list(style_heads)
 * )
 */
    __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3900, __pyx_L4_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_element_heads); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3900, __pyx_L4_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
      __pyx_t_4 = __pyx_t_2; __Pyx_INCREF(__pyx_t_4); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3900, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_7 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3900, __pyx_L4_error)
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    for (;;) {
      if (likely(!__pyx_t_7)) {
        if (likely(PyList_CheckExact(__pyx_t_4))) {
          if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_4)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 3900, __pyx_L4_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3900, __pyx_L4_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        } else {
          if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 3900, __pyx_L4_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3900, __pyx_L4_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        }
      } else {
        __pyx_t_2 = __pyx_t_7(__pyx_t_4);
        if (unlikely(!__pyx_t_2)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 3900, __pyx_L4_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_XGOTREF(__pyx_9genexpr71__pyx_v_7mathics_7builtin_8graphics_element);
      __Pyx_DECREF_SET(__pyx_9genexpr71__pyx_v_7mathics_7builtin_8graphics_element, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyNumber_Add(__pyx_9genexpr71__pyx_v_7mathics_7builtin_8graphics_element, __pyx_n_u_Box); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3900, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 3900, __pyx_L4_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_9genexpr71__pyx_v_7mathics_7builtin_8graphics_element);
    __Pyx_DECREF_SET(__pyx_9genexpr71__pyx_v_7mathics_7builtin_8graphics_element, Py_None);
    goto __pyx_L7_exit_scope;
    __pyx_L4_error:;
    __Pyx_GOTREF(__pyx_9genexpr71__pyx_v_7mathics_7builtin_8graphics_element);
    __Pyx_DECREF_SET(__pyx_9genexpr71__pyx_v_7mathics_7builtin_8graphics_element, Py_None);
    goto __pyx_L1_error;
    __pyx_L7_exit_scope:;
  } /* exit inner scope */
  __pyx_t_4 = PyNumber_Add(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3900, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "mathics/builtin/graphics.py":3901
 *     + list(element_heads)
 *     + [element + "Box" for element in element_heads]
 *     + list(style_heads)             # <<<<<<<<<<<<<<
 * )
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_style_heads); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3901, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PySequence_List(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3901, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Add(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3901, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":3897
 * GLOBALS.update(styles)
 * 
 * GRAPHICS_SYMBOLS = frozenset(             # <<<<<<<<<<<<<<
 *     ["System`List", "System`Rule", "System`VertexColors"]
 *     + list(element_heads)
 */
  __pyx_t_1 = __Pyx_PyFrozenSet_New(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3897, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_GRAPHICS_SYMBOLS, __pyx_t_1) < 0) __PYX_ERR(0, 3897, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mathics/builtin/graphics.py":1
 * #!/usr/bin/env python3             # <<<<<<<<<<<<<<
 * # -*- coding: utf-8 -*-
 * # cython: language_level=3
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /*--- Wrapped vars code ---*/

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  if (__pyx_m) {
    if (__pyx_d) {
      __Pyx_AddTraceback("init mathics.builtin.graphics", __pyx_clineno, __pyx_lineno, __pyx_filename);
    }
    Py_CLEAR(__pyx_m);
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init mathics.builtin.graphics");
  }
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  return (__pyx_m != NULL) ? 0 : -1;
  #elif PY_MAJOR_VERSION >= 3
  return __pyx_m;
  #else
  return;
  #endif
}

/* --- Runtime support code --- */
/* Refnanny */
#if CYTHON_REFNANNY
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
    PyObject *m = NULL, *p = NULL;
    void *r = NULL;
    m = PyImport_ImportModule(modname);
    if (!m) goto end;
    p = PyObject_GetAttrString(m, "RefNannyAPI");
    if (!p) goto end;
    r = PyLong_AsVoidPtr(p);
end:
    Py_XDECREF(p);
    Py_XDECREF(m);
    return (__Pyx_RefNannyAPIStruct *)r;
}
#endif

/* PyObjectGetAttrStr */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_getattro))
        return tp->tp_getattro(obj, attr_name);
#if PY_MAJOR_VERSION < 3
    if (likely(tp->tp_getattr))
        return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
#endif
    return PyObject_GetAttr(obj, attr_name);
}
#endif

/* GetBuiltinName */
static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
    PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
    if (unlikely(!result)) {
        PyErr_Format(PyExc_NameError,
#if PY_MAJOR_VERSION >= 3
            "name '%U' is not defined", name);
#else
            "name '%.200s' is not defined", PyString_AS_STRING(name));
#endif
    }
    return result;
}

/* Import */
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
    PyObject *empty_list = 0;
    PyObject *module = 0;
    PyObject *global_dict = 0;
    PyObject *empty_dict = 0;
    PyObject *list;
    #if PY_MAJOR_VERSION < 3
    PyObject *py_import;
    py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
    if (!py_import)
        goto bad;
    #endif
    if (from_list)
        list = from_list;
    else {
        empty_list = PyList_New(0);
        if (!empty_list)
            goto bad;
        list = empty_list;
    }
    global_dict = PyModule_GetDict(__pyx_m);
    if (!global_dict)
        goto bad;
    empty_dict = PyDict_New();
    if (!empty_dict)
        goto bad;
    {
        #if PY_MAJOR_VERSION >= 3
        if (level == -1) {
            if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) {
                module = PyImport_ImportModuleLevelObject(
                    name, global_dict, empty_dict, list, 1);
                if (!module) {
                    if (!PyErr_ExceptionMatches(PyExc_ImportError))
                        goto bad;
                    PyErr_Clear();
                }
            }
            level = 0;
        }
        #endif
        if (!module) {
            #if PY_MAJOR_VERSION < 3
            PyObject *py_level = PyInt_FromLong(level);
            if (!py_level)
                goto bad;
            module = PyObject_CallFunctionObjArgs(py_import,
                name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
            Py_DECREF(py_level);
            #else
            module = PyImport_ImportModuleLevelObject(
                name, global_dict, empty_dict, list, level);
            #endif
        }
    }
bad:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(py_import);
    #endif
    Py_XDECREF(empty_list);
    Py_XDECREF(empty_dict);
    return module;
}

/* ImportFrom */
static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
    PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
    if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
        PyErr_Format(PyExc_ImportError,
        #if PY_MAJOR_VERSION < 3
            "cannot import name %.230s", PyString_AS_STRING(name));
        #else
            "cannot import name %S", name);
        #endif
    }
    return value;
}

/* PyDictVersioning */
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
    PyObject *dict = Py_TYPE(obj)->tp_dict;
    return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
}
static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
    PyObject **dictptr = NULL;
    Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
    if (offset) {
#if CYTHON_COMPILING_IN_CPYTHON
        dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
#else
        dictptr = _PyObject_GetDictPtr(obj);
#endif
    }
    return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
}
static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
    PyObject *dict = Py_TYPE(obj)->tp_dict;
    if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
        return 0;
    return obj_dict_version == __Pyx_get_object_dict_version(obj);
}
#endif

/* GetModuleGlobalName */
#if CYTHON_USE_DICT_VERSIONS
static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
#else
static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
#endif
{
    PyObject *result;
#if !CYTHON_AVOID_BORROWED_REFS
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
    result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
    __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return __Pyx_NewRef(result);
    } else if (unlikely(PyErr_Occurred())) {
        return NULL;
    }
#else
    result = PyDict_GetItem(__pyx_d, name);
    __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return __Pyx_NewRef(result);
    }
#endif
#else
    result = PyObject_GetItem(__pyx_d, name);
    __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return __Pyx_NewRef(result);
    }
    PyErr_Clear();
#endif
    return __Pyx_GetBuiltinName(name);
}

/* PyCFunctionFastCall */
#if CYTHON_FAST_PYCCALL
static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
    PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
    PyCFunction meth = PyCFunction_GET_FUNCTION(func);
    PyObject *self = PyCFunction_GET_SELF(func);
    int flags = PyCFunction_GET_FLAGS(func);
    assert(PyCFunction_Check(func));
    assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
    assert(nargs >= 0);
    assert(nargs == 0 || args != NULL);
    /* _PyCFunction_FastCallDict() must not be called with an exception set,
       because it may clear it (directly or indirectly) and so the
       caller loses its exception */
    assert(!PyErr_Occurred());
    if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
        return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
    } else {
        return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
    }
}
#endif

/* PyFunctionFastCall */
#if CYTHON_FAST_PYCALL
static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
                                               PyObject *globals) {
    PyFrameObject *f;
    PyThreadState *tstate = __Pyx_PyThreadState_Current;
    PyObject **fastlocals;
    Py_ssize_t i;
    PyObject *result;
    assert(globals != NULL);
    /* XXX Perhaps we should create a specialized
       PyFrame_New() that doesn't take locals, but does
       take builtins without sanity checking them.
       */
    assert(tstate != NULL);
    f = PyFrame_New(tstate, co, globals, NULL);
    if (f == NULL) {
        return NULL;
    }
    fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
    for (i = 0; i < na; i++) {
        Py_INCREF(*args);
        fastlocals[i] = *args++;
    }
    result = PyEval_EvalFrameEx(f,0);
    ++tstate->recursion_depth;
    Py_DECREF(f);
    --tstate->recursion_depth;
    return result;
}
#if 1 || PY_VERSION_HEX < 0x030600B1
static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
    PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
    PyObject *globals = PyFunction_GET_GLOBALS(func);
    PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
    PyObject *closure;
#if PY_MAJOR_VERSION >= 3
    PyObject *kwdefs;
#endif
    PyObject *kwtuple, **k;
    PyObject **d;
    Py_ssize_t nd;
    Py_ssize_t nk;
    PyObject *result;
    assert(kwargs == NULL || PyDict_Check(kwargs));
    nk = kwargs ? PyDict_Size(kwargs) : 0;
    if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
        return NULL;
    }
    if (
#if PY_MAJOR_VERSION >= 3
            co->co_kwonlyargcount == 0 &&
#endif
            likely(kwargs == NULL || nk == 0) &&
            co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
        if (argdefs == NULL && co->co_argcount == nargs) {
            result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
            goto done;
        }
        else if (nargs == 0 && argdefs != NULL
                 && co->co_argcount == Py_SIZE(argdefs)) {
            /* function called with no arguments, but all parameters have
               a default value: use default values as arguments .*/
            args = &PyTuple_GET_ITEM(argdefs, 0);
            result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
            goto done;
        }
    }
    if (kwargs != NULL) {
        Py_ssize_t pos, i;
        kwtuple = PyTuple_New(2 * nk);
        if (kwtuple == NULL) {
            result = NULL;
            goto done;
        }
        k = &PyTuple_GET_ITEM(kwtuple, 0);
        pos = i = 0;
        while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
            Py_INCREF(k[i]);
            Py_INCREF(k[i+1]);
            i += 2;
        }
        nk = i / 2;
    }
    else {
        kwtuple = NULL;
        k = NULL;
    }
    closure = PyFunction_GET_CLOSURE(func);
#if PY_MAJOR_VERSION >= 3
    kwdefs = PyFunction_GET_KW_DEFAULTS(func);
#endif
    if (argdefs != NULL) {
        d = &PyTuple_GET_ITEM(argdefs, 0);
        nd = Py_SIZE(argdefs);
    }
    else {
        d = NULL;
        nd = 0;
    }
#if PY_MAJOR_VERSION >= 3
    result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
                               args, (int)nargs,
                               k, (int)nk,
                               d, (int)nd, kwdefs, closure);
#else
    result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
                               args, (int)nargs,
                               k, (int)nk,
                               d, (int)nd, closure);
#endif
    Py_XDECREF(kwtuple);
done:
    Py_LeaveRecursiveCall();
    return result;
}
#endif
#endif

/* PyObjectCall */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyObject *result;
    ternaryfunc call = func->ob_type->tp_call;
    if (unlikely(!call))
        return PyObject_Call(func, arg, kw);
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    result = (*call)(func, arg, kw);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

/* PyObjectCall2Args */
static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
    PyObject *args, *result = NULL;
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(function)) {
        PyObject *args[2] = {arg1, arg2};
        return __Pyx_PyFunction_FastCall(function, args, 2);
    }
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(function)) {
        PyObject *args[2] = {arg1, arg2};
        return __Pyx_PyCFunction_FastCall(function, args, 2);
    }
    #endif
    args = PyTuple_New(2);
    if (unlikely(!args)) goto done;
    Py_INCREF(arg1);
    PyTuple_SET_ITEM(args, 0, arg1);
    Py_INCREF(arg2);
    PyTuple_SET_ITEM(args, 1, arg2);
    Py_INCREF(function);
    result = __Pyx_PyObject_Call(function, args, NULL);
    Py_DECREF(args);
    Py_DECREF(function);
done:
    return result;
}

/* PyObjectCallMethO */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
    PyObject *self, *result;
    PyCFunction cfunc;
    cfunc = PyCFunction_GET_FUNCTION(func);
    self = PyCFunction_GET_SELF(func);
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    result = cfunc(self, arg);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

/* PyObjectCallOneArg */
#if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *result;
    PyObject *args = PyTuple_New(1);
    if (unlikely(!args)) return NULL;
    Py_INCREF(arg);
    PyTuple_SET_ITEM(args, 0, arg);
    result = __Pyx_PyObject_Call(func, args, NULL);
    Py_DECREF(args);
    return result;
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
#if CYTHON_FAST_PYCALL
    if (PyFunction_Check(func)) {
        return __Pyx_PyFunction_FastCall(func, &arg, 1);
    }
#endif
    if (likely(PyCFunction_Check(func))) {
        if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
            return __Pyx_PyObject_CallMethO(func, arg);
#if CYTHON_FAST_PYCCALL
        } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
            return __Pyx_PyCFunction_FastCall(func, &arg, 1);
#endif
        }
    }
    return __Pyx__PyObject_CallOneArg(func, arg);
}
#else
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *result;
    PyObject *args = PyTuple_Pack(1, arg);
    if (unlikely(!args)) return NULL;
    result = __Pyx_PyObject_Call(func, args, NULL);
    Py_DECREF(args);
    return result;
}
#endif

/* GetItemInt */
static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
    PyObject *r;
    if (!j) return NULL;
    r = PyObject_GetItem(o, j);
    Py_DECREF(j);
    return r;
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
                                                              CYTHON_NCP_UNUSED int wraparound,
                                                              CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    Py_ssize_t wrapped_i = i;
    if (wraparound & unlikely(i < 0)) {
        wrapped_i += PyList_GET_SIZE(o);
    }
    if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
        PyObject *r = PyList_GET_ITEM(o, wrapped_i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                              CYTHON_NCP_UNUSED int wraparound,
                                                              CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    Py_ssize_t wrapped_i = i;
    if (wraparound & unlikely(i < 0)) {
        wrapped_i += PyTuple_GET_SIZE(o);
    }
    if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
        PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
                                                     CYTHON_NCP_UNUSED int wraparound,
                                                     CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
    if (is_list || PyList_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
        if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
            PyObject *r = PyList_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    }
    else if (PyTuple_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
        if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
            PyObject *r = PyTuple_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    } else {
        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
        if (likely(m && m->sq_item)) {
            if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
                Py_ssize_t l = m->sq_length(o);
                if (likely(l >= 0)) {
                    i += l;
                } else {
                    if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                        return NULL;
                    PyErr_Clear();
                }
            }
            return m->sq_item(o, i);
        }
    }
#else
    if (is_list || PySequence_Check(o)) {
        return PySequence_GetItem(o, i);
    }
#endif
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}

/* PyObjectCallNoArg */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
#if CYTHON_FAST_PYCALL
    if (PyFunction_Check(func)) {
        return __Pyx_PyFunction_FastCall(func, NULL, 0);
    }
#endif
#ifdef __Pyx_CyFunction_USED
    if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
#else
    if (likely(PyCFunction_Check(func)))
#endif
    {
        if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
            return __Pyx_PyObject_CallMethO(func, NULL);
        }
    }
    return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
}
#endif

/* PyErrFetchRestore */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    tmp_type = tstate->curexc_type;
    tmp_value = tstate->curexc_value;
    tmp_tb = tstate->curexc_traceback;
    tstate->curexc_type = type;
    tstate->curexc_value = value;
    tstate->curexc_traceback = tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
}
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    *type = tstate->curexc_type;
    *value = tstate->curexc_value;
    *tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
}
#endif

/* RaiseException */
#if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
                        CYTHON_UNUSED PyObject *cause) {
    __Pyx_PyThreadState_declare
    Py_XINCREF(type);
    if (!value || value == Py_None)
        value = NULL;
    else
        Py_INCREF(value);
    if (!tb || tb == Py_None)
        tb = NULL;
    else {
        Py_INCREF(tb);
        if (!PyTraceBack_Check(tb)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: arg 3 must be a traceback or None");
            goto raise_error;
        }
    }
    if (PyType_Check(type)) {
#if CYTHON_COMPILING_IN_PYPY
        if (!value) {
            Py_INCREF(Py_None);
            value = Py_None;
        }
#endif
        PyErr_NormalizeException(&type, &value, &tb);
    } else {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto raise_error;
        }
        value = type;
        type = (PyObject*) Py_TYPE(type);
        Py_INCREF(type);
        if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: exception class must be a subclass of BaseException");
            goto raise_error;
        }
    }
    __Pyx_PyThreadState_assign
    __Pyx_ErrRestore(type, value, tb);
    return;
raise_error:
    Py_XDECREF(value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
    return;
}
#else
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
    PyObject* owned_instance = NULL;
    if (tb == Py_None) {
        tb = 0;
    } else if (tb && !PyTraceBack_Check(tb)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: arg 3 must be a traceback or None");
        goto bad;
    }
    if (value == Py_None)
        value = 0;
    if (PyExceptionInstance_Check(type)) {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto bad;
        }
        value = type;
        type = (PyObject*) Py_TYPE(value);
    } else if (PyExceptionClass_Check(type)) {
        PyObject *instance_class = NULL;
        if (value && PyExceptionInstance_Check(value)) {
            instance_class = (PyObject*) Py_TYPE(value);
            if (instance_class != type) {
                int is_subclass = PyObject_IsSubclass(instance_class, type);
                if (!is_subclass) {
                    instance_class = NULL;
                } else if (unlikely(is_subclass == -1)) {
                    goto bad;
                } else {
                    type = instance_class;
                }
            }
        }
        if (!instance_class) {
            PyObject *args;
            if (!value)
                args = PyTuple_New(0);
            else if (PyTuple_Check(value)) {
                Py_INCREF(value);
                args = value;
            } else
                args = PyTuple_Pack(1, value);
            if (!args)
                goto bad;
            owned_instance = PyObject_Call(type, args, NULL);
            Py_DECREF(args);
            if (!owned_instance)
                goto bad;
            value = owned_instance;
            if (!PyExceptionInstance_Check(value)) {
                PyErr_Format(PyExc_TypeError,
                             "calling %R should have returned an instance of "
                             "BaseException, not %R",
                             type, Py_TYPE(value));
                goto bad;
            }
        }
    } else {
        PyErr_SetString(PyExc_TypeError,
            "raise: exception class must be a subclass of BaseException");
        goto bad;
    }
    if (cause) {
        PyObject *fixed_cause;
        if (cause == Py_None) {
            fixed_cause = NULL;
        } else if (PyExceptionClass_Check(cause)) {
            fixed_cause = PyObject_CallObject(cause, NULL);
            if (fixed_cause == NULL)
                goto bad;
        } else if (PyExceptionInstance_Check(cause)) {
            fixed_cause = cause;
            Py_INCREF(fixed_cause);
        } else {
            PyErr_SetString(PyExc_TypeError,
                            "exception causes must derive from "
                            "BaseException");
            goto bad;
        }
        PyException_SetCause(value, fixed_cause);
    }
    PyErr_SetObject(type, value);
    if (tb) {
#if CYTHON_COMPILING_IN_PYPY
        PyObject *tmp_type, *tmp_value, *tmp_tb;
        PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
        Py_INCREF(tb);
        PyErr_Restore(tmp_type, tmp_value, tb);
        Py_XDECREF(tmp_tb);
#else
        PyThreadState *tstate = __Pyx_PyThreadState_Current;
        PyObject* tmp_tb = tstate->curexc_traceback;
        if (tb != tmp_tb) {
            Py_INCREF(tb);
            tstate->curexc_traceback = tb;
            Py_XDECREF(tmp_tb);
        }
#endif
    }
bad:
    Py_XDECREF(owned_instance);
    return;
}
#endif

/* RaiseArgTupleInvalid */
static void __Pyx_RaiseArgtupleInvalid(
    const char* func_name,
    int exact,
    Py_ssize_t num_min,
    Py_ssize_t num_max,
    Py_ssize_t num_found)
{
    Py_ssize_t num_expected;
    const char *more_or_less;
    if (num_found < num_min) {
        num_expected = num_min;
        more_or_less = "at least";
    } else {
        num_expected = num_max;
        more_or_less = "at most";
    }
    if (exact) {
        more_or_less = "exactly";
    }
    PyErr_Format(PyExc_TypeError,
                 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
                 func_name, more_or_less, num_expected,
                 (num_expected == 1) ? "" : "s", num_found);
}

/* RaiseDoubleKeywords */
static void __Pyx_RaiseDoubleKeywordsError(
    const char* func_name,
    PyObject* kw_name)
{
    PyErr_Format(PyExc_TypeError,
        #if PY_MAJOR_VERSION >= 3
        "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
        #else
        "%s() got multiple values for keyword argument '%s'", func_name,
        PyString_AsString(kw_name));
        #endif
}

/* ParseKeywords */
static int __Pyx_ParseOptionalKeywords(
    PyObject *kwds,
    PyObject **argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    const char* function_name)
{
    PyObject *key = 0, *value = 0;
    Py_ssize_t pos = 0;
    PyObject*** name;
    PyObject*** first_kw_arg = argnames + num_pos_args;
    while (PyDict_Next(kwds, &pos, &key, &value)) {
        name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (*name) {
            values[name-argnames] = value;
            continue;
        }
        name = first_kw_arg;
        #if PY_MAJOR_VERSION < 3
        if (likely(PyString_Check(key))) {
            while (*name) {
                if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
                        && _PyString_Eq(**name, key)) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    if ((**argname == key) || (
                            (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
                             && _PyString_Eq(**argname, key))) {
                        goto arg_passed_twice;
                    }
                    argname++;
                }
            }
        } else
        #endif
        if (likely(PyUnicode_Check(key))) {
            while (*name) {
                int cmp = (**name == key) ? 0 :
                #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                    (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
                #endif
                    PyUnicode_Compare(**name, key);
                if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                if (cmp == 0) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    int cmp = (**argname == key) ? 0 :
                    #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                        (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
                    #endif
                        PyUnicode_Compare(**argname, key);
                    if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                    if (cmp == 0) goto arg_passed_twice;
                    argname++;
                }
            }
        } else
            goto invalid_keyword_type;
        if (kwds2) {
            if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
        } else {
            goto invalid_keyword;
        }
    }
    return 0;
arg_passed_twice:
    __Pyx_RaiseDoubleKeywordsError(function_name, key);
    goto bad;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%.200s() keywords must be strings", function_name);
    goto bad;
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%.200s() got an unexpected keyword argument '%.200s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
bad:
    return -1;
}

/* PyObjectSetAttrStr */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_setattro))
        return tp->tp_setattro(obj, attr_name, value);
#if PY_MAJOR_VERSION < 3
    if (likely(tp->tp_setattr))
        return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
#endif
    return PyObject_SetAttr(obj, attr_name, value);
}
#endif

/* RaiseTooManyValuesToUnpack */
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
    PyErr_Format(PyExc_ValueError,
                 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
}

/* RaiseNeedMoreValuesToUnpack */
static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
    PyErr_Format(PyExc_ValueError,
                 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
                 index, (index == 1) ? "" : "s");
}

/* IterFinish */
static CYTHON_INLINE int __Pyx_IterFinish(void) {
#if CYTHON_FAST_THREAD_STATE
    PyThreadState *tstate = __Pyx_PyThreadState_Current;
    PyObject* exc_type = tstate->curexc_type;
    if (unlikely(exc_type)) {
        if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) {
            PyObject *exc_value, *exc_tb;
            exc_value = tstate->curexc_value;
            exc_tb = tstate->curexc_traceback;
            tstate->curexc_type = 0;
            tstate->curexc_value = 0;
            tstate->curexc_traceback = 0;
            Py_DECREF(exc_type);
            Py_XDECREF(exc_value);
            Py_XDECREF(exc_tb);
            return 0;
        } else {
            return -1;
        }
    }
    return 0;
#else
    if (unlikely(PyErr_Occurred())) {
        if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
            PyErr_Clear();
            return 0;
        } else {
            return -1;
        }
    }
    return 0;
#endif
}

/* UnpackItemEndCheck */
static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
    if (unlikely(retval)) {
        Py_DECREF(retval);
        __Pyx_RaiseTooManyValuesError(expected);
        return -1;
    } else {
        return __Pyx_IterFinish();
    }
    return 0;
}

/* PyIntCompare */
static CYTHON_INLINE PyObject* __Pyx_PyInt_NeObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED long inplace) {
    if (op1 == op2) {
        Py_RETURN_FALSE;
    }
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long a = PyInt_AS_LONG(op1);
        if (a != b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        int unequal;
        unsigned long uintval;
        Py_ssize_t size = Py_SIZE(op1);
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        if (intval == 0) {
            if (size != 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
        } else if (intval < 0) {
            if (size >= 0)
                Py_RETURN_TRUE;
            intval = -intval;
            size = -size;
        } else {
            if (size <= 0)
                Py_RETURN_TRUE;
        }
        uintval = (unsigned long) intval;
#if PyLong_SHIFT * 4 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 4)) {
            unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 3 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 3)) {
            unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 2 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 2)) {
            unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 1 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 1)) {
            unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
            unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK));
        if (unequal != 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
        double a = PyFloat_AS_DOUBLE(op1);
        if ((double)a != (double)b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
    }
    return (
        PyObject_RichCompare(op1, op2, Py_NE));
}

/* BytesEquals */
static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY
    return PyObject_RichCompareBool(s1, s2, equals);
#else
    if (s1 == s2) {
        return (equals == Py_EQ);
    } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
        const char *ps1, *ps2;
        Py_ssize_t length = PyBytes_GET_SIZE(s1);
        if (length != PyBytes_GET_SIZE(s2))
            return (equals == Py_NE);
        ps1 = PyBytes_AS_STRING(s1);
        ps2 = PyBytes_AS_STRING(s2);
        if (ps1[0] != ps2[0]) {
            return (equals == Py_NE);
        } else if (length == 1) {
            return (equals == Py_EQ);
        } else {
            int result;
#if CYTHON_USE_UNICODE_INTERNALS
            Py_hash_t hash1, hash2;
            hash1 = ((PyBytesObject*)s1)->ob_shash;
            hash2 = ((PyBytesObject*)s2)->ob_shash;
            if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
                return (equals == Py_NE);
            }
#endif
            result = memcmp(ps1, ps2, (size_t)length);
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
        return (equals == Py_NE);
    } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
        return (equals == Py_NE);
    } else {
        int result;
        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
        if (!py_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
#endif
}

/* UnicodeEquals */
static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY
    return PyObject_RichCompareBool(s1, s2, equals);
#else
#if PY_MAJOR_VERSION < 3
    PyObject* owned_ref = NULL;
#endif
    int s1_is_unicode, s2_is_unicode;
    if (s1 == s2) {
        goto return_eq;
    }
    s1_is_unicode = PyUnicode_CheckExact(s1);
    s2_is_unicode = PyUnicode_CheckExact(s2);
#if PY_MAJOR_VERSION < 3
    if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
        owned_ref = PyUnicode_FromObject(s2);
        if (unlikely(!owned_ref))
            return -1;
        s2 = owned_ref;
        s2_is_unicode = 1;
    } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
        owned_ref = PyUnicode_FromObject(s1);
        if (unlikely(!owned_ref))
            return -1;
        s1 = owned_ref;
        s1_is_unicode = 1;
    } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
        return __Pyx_PyBytes_Equals(s1, s2, equals);
    }
#endif
    if (s1_is_unicode & s2_is_unicode) {
        Py_ssize_t length;
        int kind;
        void *data1, *data2;
        if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
            return -1;
        length = __Pyx_PyUnicode_GET_LENGTH(s1);
        if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
            goto return_ne;
        }
#if CYTHON_USE_UNICODE_INTERNALS
        {
            Py_hash_t hash1, hash2;
        #if CYTHON_PEP393_ENABLED
            hash1 = ((PyASCIIObject*)s1)->hash;
            hash2 = ((PyASCIIObject*)s2)->hash;
        #else
            hash1 = ((PyUnicodeObject*)s1)->hash;
            hash2 = ((PyUnicodeObject*)s2)->hash;
        #endif
            if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
                goto return_ne;
            }
        }
#endif
        kind = __Pyx_PyUnicode_KIND(s1);
        if (kind != __Pyx_PyUnicode_KIND(s2)) {
            goto return_ne;
        }
        data1 = __Pyx_PyUnicode_DATA(s1);
        data2 = __Pyx_PyUnicode_DATA(s2);
        if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
            goto return_ne;
        } else if (length == 1) {
            goto return_eq;
        } else {
            int result = memcmp(data1, data2, (size_t)(length * kind));
            #if PY_MAJOR_VERSION < 3
            Py_XDECREF(owned_ref);
            #endif
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & s2_is_unicode) {
        goto return_ne;
    } else if ((s2 == Py_None) & s1_is_unicode) {
        goto return_ne;
    } else {
        int result;
        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
        #if PY_MAJOR_VERSION < 3
        Py_XDECREF(owned_ref);
        #endif
        if (!py_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
return_eq:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(owned_ref);
    #endif
    return (equals == Py_EQ);
return_ne:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(owned_ref);
    #endif
    return (equals == Py_NE);
#endif
}

/* None */
static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) {
    PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname);
}

/* py_abs */
#if CYTHON_USE_PYLONG_INTERNALS
static PyObject *__Pyx_PyLong_AbsNeg(PyObject *n) {
    if (likely(Py_SIZE(n) == -1)) {
        return PyLong_FromLong(((PyLongObject*)n)->ob_digit[0]);
    }
#if CYTHON_COMPILING_IN_CPYTHON
    {
        PyObject *copy = _PyLong_Copy((PyLongObject*)n);
        if (likely(copy)) {
            __Pyx_SET_SIZE(copy, -Py_SIZE(copy));
        }
        return copy;
    }
#else
    return PyNumber_Negative(n);
#endif
}
#endif

/* ObjectGetItem */
#if CYTHON_USE_TYPE_SLOTS
static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
    PyObject *runerr;
    Py_ssize_t key_value;
    PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
    if (unlikely(!(m && m->sq_item))) {
        PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
        return NULL;
    }
    key_value = __Pyx_PyIndex_AsSsize_t(index);
    if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
        return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
    }
    if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
        PyErr_Clear();
        PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
    }
    return NULL;
}
static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
    PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
    if (likely(m && m->mp_subscript)) {
        return m->mp_subscript(obj, key);
    }
    return __Pyx_PyObject_GetIndex(obj, key);
}
#endif

/* PyIntBinop */
#if !CYTHON_COMPILING_IN_PYPY
#if PY_MAJOR_VERSION < 3 || CYTHON_USE_PYLONG_INTERNALS
#define __Pyx_PyInt_TrueDivideObjC_ZeroDivisionError(operand)\
    if (unlikely(zerodivision_check && ((operand) == 0))) {\
        PyErr_SetString(PyExc_ZeroDivisionError, "integer division by zero");\
        return NULL;\
    }
#endif
static PyObject* __Pyx_PyInt_TrueDivideObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
    (void)inplace;
    (void)zerodivision_check;
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long a = PyInt_AS_LONG(op1);
            __Pyx_PyInt_TrueDivideObjC_ZeroDivisionError(b)
            if (8 * sizeof(long) <= 53 || likely(labs(a) <= ((PY_LONG_LONG)1 << 53))) {
                return PyFloat_FromDouble((double)a / (double)b);
            }
            return PyInt_Type.tp_as_number->nb_true_divide(op1, op2);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a, x;
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op1);
        if (likely(__Pyx_sst_abs(size) <= 1)) {
            a = likely(size) ? digits[0] : 0;
            if (size == -1) a = -a;
        } else {
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT && 1 * PyLong_SHIFT < 53) {
                        a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                    CYTHON_FALLTHROUGH;
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT && 1 * PyLong_SHIFT < 53) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                    CYTHON_FALLTHROUGH;
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT && 2 * PyLong_SHIFT < 53) {
                        a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                    CYTHON_FALLTHROUGH;
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT && 2 * PyLong_SHIFT < 53) {
                        a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                    CYTHON_FALLTHROUGH;
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT && 3 * PyLong_SHIFT < 53) {
                        a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                    CYTHON_FALLTHROUGH;
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT && 3 * PyLong_SHIFT < 53) {
                        a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                    CYTHON_FALLTHROUGH;
                default: return PyLong_Type.tp_as_number->nb_true_divide(op1, op2);
            }
        }
                __Pyx_PyInt_TrueDivideObjC_ZeroDivisionError(b)
                if ((8 * sizeof(long) <= 53 || likely(labs(a) <= ((PY_LONG_LONG)1 << 53)))
                        || __Pyx_sst_abs(size) <= 52 / PyLong_SHIFT) {
                    return PyFloat_FromDouble((double)a / (double)b);
                }
                return PyLong_Type.tp_as_number->nb_true_divide(op1, op2);
            return PyLong_FromLong(x);
        
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
        double a = PyFloat_AS_DOUBLE(op1);
            double result;
            if (unlikely(zerodivision_check && b == 0)) {
                PyErr_SetString(PyExc_ZeroDivisionError, "float division by zero");
                return NULL;
            }
            PyFPE_START_PROTECT("divide", return NULL)
            result = ((double)a) / (double)b;
            PyFPE_END_PROTECT(result)
            return PyFloat_FromDouble(result);
    }
    return (inplace ? PyNumber_InPlaceTrueDivide : PyNumber_TrueDivide)(op1, op2);
}
#endif

/* PyIntBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_AddCObj(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
    (void)inplace;
    (void)zerodivision_check;
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op2))) {
        const long a = intval;
        long x;
        long b = PyInt_AS_LONG(op2);
            x = (long)((unsigned long)a + b);
            if (likely((x^a) >= 0 || (x^b) >= 0))
                return PyInt_FromLong(x);
            return PyLong_Type.tp_as_number->nb_add(op1, op2);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op2))) {
        const long a = intval;
        long b, x;
#ifdef HAVE_LONG_LONG
        const PY_LONG_LONG lla = intval;
        PY_LONG_LONG llb, llx;
#endif
        const digit* digits = ((PyLongObject*)op2)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op2);
        if (likely(__Pyx_sst_abs(size) <= 1)) {
            b = likely(size) ? digits[0] : 0;
            if (size == -1) b = -b;
        } else {
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        b = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        llb = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        b = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        llb = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        b = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        llb = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        b = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        llb = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        b = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        llb = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        b = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        llb = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
            }
        }
                x = a + b;
            return PyLong_FromLong(x);
#ifdef HAVE_LONG_LONG
        long_long:
                llx = lla + llb;
            return PyLong_FromLongLong(llx);
#endif
        
        
    }
    #endif
    if (PyFloat_CheckExact(op2)) {
        const long a = intval;
        double b = PyFloat_AS_DOUBLE(op2);
            double result;
            PyFPE_START_PROTECT("add", return NULL)
            result = ((double)a) + (double)b;
            PyFPE_END_PROTECT(result)
            return PyFloat_FromDouble(result);
    }
    return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
}
#endif

/* PyIntBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_SubtractCObj(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
    (void)inplace;
    (void)zerodivision_check;
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op2))) {
        const long a = intval;
        long x;
        long b = PyInt_AS_LONG(op2);
            x = (long)((unsigned long)a - b);
            if (likely((x^a) >= 0 || (x^~b) >= 0))
                return PyInt_FromLong(x);
            return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op2))) {
        const long a = intval;
        long b, x;
#ifdef HAVE_LONG_LONG
        const PY_LONG_LONG lla = intval;
        PY_LONG_LONG llb, llx;
#endif
        const digit* digits = ((PyLongObject*)op2)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op2);
        if (likely(__Pyx_sst_abs(size) <= 1)) {
            b = likely(size) ? digits[0] : 0;
            if (size == -1) b = -b;
        } else {
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        b = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        llb = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        b = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        llb = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        b = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        llb = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        b = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        llb = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        b = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        llb = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        b = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        llb = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                default: return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
            }
        }
                x = a - b;
            return PyLong_FromLong(x);
#ifdef HAVE_LONG_LONG
        long_long:
                llx = lla - llb;
            return PyLong_FromLongLong(llx);
#endif
        
        
    }
    #endif
    if (PyFloat_CheckExact(op2)) {
        const long a = intval;
        double b = PyFloat_AS_DOUBLE(op2);
            double result;
            PyFPE_START_PROTECT("subtract", return NULL)
            result = ((double)a) - (double)b;
            PyFPE_END_PROTECT(result)
            return PyFloat_FromDouble(result);
    }
    return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2);
}
#endif

/* PyIntBinop */
#if !CYTHON_COMPILING_IN_PYPY
#if PY_MAJOR_VERSION < 3 || CYTHON_USE_PYLONG_INTERNALS
#define __Pyx_PyInt_RemainderObjC_ZeroDivisionError(operand)\
    if (unlikely(zerodivision_check && ((operand) == 0))) {\
        PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");\
        return NULL;\
    }
#endif
static PyObject* __Pyx_PyInt_RemainderObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
    (void)inplace;
    (void)zerodivision_check;
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long x;
        long a = PyInt_AS_LONG(op1);
            __Pyx_PyInt_RemainderObjC_ZeroDivisionError(b)
            x = a % b;
            x += ((x != 0) & ((x ^ b) < 0)) * b;
            return PyInt_FromLong(x);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a, x;
#ifdef HAVE_LONG_LONG
        const PY_LONG_LONG llb = intval;
        PY_LONG_LONG lla, llx;
#endif
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op1);
        if (likely(__Pyx_sst_abs(size) <= 1)) {
            a = likely(size) ? digits[0] : 0;
            if (size == -1) a = -a;
        } else {
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                default: return PyLong_Type.tp_as_number->nb_remainder(op1, op2);
            }
        }
                __Pyx_PyInt_RemainderObjC_ZeroDivisionError(b)
                x = a % b;
                x += ((x != 0) & ((x ^ b) < 0)) * b;
            return PyLong_FromLong(x);
#ifdef HAVE_LONG_LONG
        long_long:
                llx = lla % llb;
                llx += ((llx != 0) & ((llx ^ llb) < 0)) * llb;
            return PyLong_FromLongLong(llx);
#endif
        
        
    }
    #endif
    return (inplace ? PyNumber_InPlaceRemainder : PyNumber_Remainder)(op1, op2);
}
#endif

/* PyIntBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
    (void)inplace;
    (void)zerodivision_check;
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long x;
        long a = PyInt_AS_LONG(op1);
            x = (long)((unsigned long)a + b);
            if (likely((x^a) >= 0 || (x^b) >= 0))
                return PyInt_FromLong(x);
            return PyLong_Type.tp_as_number->nb_add(op1, op2);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a, x;
#ifdef HAVE_LONG_LONG
        const PY_LONG_LONG llb = intval;
        PY_LONG_LONG lla, llx;
#endif
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op1);
        if (likely(__Pyx_sst_abs(size) <= 1)) {
            a = likely(size) ? digits[0] : 0;
            if (size == -1) a = -a;
        } else {
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
            }
        }
                x = a + b;
            return PyLong_FromLong(x);
#ifdef HAVE_LONG_LONG
        long_long:
                llx = lla + llb;
            return PyLong_FromLongLong(llx);
#endif
        
        
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
        double a = PyFloat_AS_DOUBLE(op1);
            double result;
            PyFPE_START_PROTECT("add", return NULL)
            result = ((double)a) + (double)b;
            PyFPE_END_PROTECT(result)
            return PyFloat_FromDouble(result);
    }
    return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
}
#endif

/* PyIntBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
    (void)inplace;
    (void)zerodivision_check;
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long x;
        long a = PyInt_AS_LONG(op1);
            x = (long)((unsigned long)a - b);
            if (likely((x^a) >= 0 || (x^~b) >= 0))
                return PyInt_FromLong(x);
            return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a, x;
#ifdef HAVE_LONG_LONG
        const PY_LONG_LONG llb = intval;
        PY_LONG_LONG lla, llx;
#endif
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op1);
        if (likely(__Pyx_sst_abs(size) <= 1)) {
            a = likely(size) ? digits[0] : 0;
            if (size == -1) a = -a;
        } else {
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                default: return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
            }
        }
                x = a - b;
            return PyLong_FromLong(x);
#ifdef HAVE_LONG_LONG
        long_long:
                llx = lla - llb;
            return PyLong_FromLongLong(llx);
#endif
        
        
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
        double a = PyFloat_AS_DOUBLE(op1);
            double result;
            PyFPE_START_PROTECT("subtract", return NULL)
            result = ((double)a) - (double)b;
            PyFPE_END_PROTECT(result)
            return PyFloat_FromDouble(result);
    }
    return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2);
}
#endif

/* None */
static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
    PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
}

/* PyFloatBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyFloat_AddCObj(PyObject *op1, PyObject *op2, double floatval, int inplace, int zerodivision_check) {
    const double a = floatval;
    double b, result;
    (void)inplace;
    (void)zerodivision_check;
    if (likely(PyFloat_CheckExact(op2))) {
        b = PyFloat_AS_DOUBLE(op2);
        
    } else
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op2))) {
        b = (double) PyInt_AS_LONG(op2);
        
    } else
    #endif
    if (likely(PyLong_CheckExact(op2))) {
        #if CYTHON_USE_PYLONG_INTERNALS
        const digit* digits = ((PyLongObject*)op2)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op2);
        switch (size) {
            case  0: b = 0.0; break;
            case -1: b = -(double) digits[0]; break;
            case  1: b = (double) digits[0]; break;
            case -2:
            case 2:
                if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (1 * PyLong_SHIFT < 53))) {
                    b = (double) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    if ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (b < (double) ((PY_LONG_LONG)1 << 53))) {
                        if (size == -2)
                            b = -b;
                        break;
                    }
                }
                CYTHON_FALLTHROUGH;
            case -3:
            case 3:
                if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53))) {
                    b = (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) || (b < (double) ((PY_LONG_LONG)1 << 53))) {
                        if (size == -3)
                            b = -b;
                        break;
                    }
                }
                CYTHON_FALLTHROUGH;
            case -4:
            case 4:
                if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53))) {
                    b = (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) || (b < (double) ((PY_LONG_LONG)1 << 53))) {
                        if (size == -4)
                            b = -b;
                        break;
                    }
                }
                CYTHON_FALLTHROUGH;
            default:
        #else
        {
        #endif
            b = PyLong_AsDouble(op2);
            if (unlikely(b == -1.0 && PyErr_Occurred())) return NULL;
            
        }
    } else {
        return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
    }
        
        PyFPE_START_PROTECT("add", return NULL)
        result = a + b;
        PyFPE_END_PROTECT(result)
        return PyFloat_FromDouble(result);
}
#endif

/* 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;
    (void)inplace;
    (void)zerodivision_check;
    if (likely(PyFloat_CheckExact(op1))) {
        a = PyFloat_AS_DOUBLE(op1);
        
    } else
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        a = (double) PyInt_AS_LONG(op1);
        
    } else
    #endif
    if (likely(PyLong_CheckExact(op1))) {
        #if CYTHON_USE_PYLONG_INTERNALS
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op1);
        switch (size) {
            case  0: a = 0.0; break;
            case -1: a = -(double) digits[0]; break;
            case  1: a = (double) digits[0]; break;
            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:
        #else
        {
        #endif
            a = PyLong_AsDouble(op1);
            if (unlikely(a == -1.0 && PyErr_Occurred())) return NULL;
            
        }
    } else {
        return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
    }
        
        PyFPE_START_PROTECT("add", return NULL)
        result = a + b;
        PyFPE_END_PROTECT(result)
        return PyFloat_FromDouble(result);
}
#endif

/* PyObjectGetMethod */
    static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) {
    PyObject *attr;
#if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP
    PyTypeObject *tp = Py_TYPE(obj);
    PyObject *descr;
    descrgetfunc f = NULL;
    PyObject **dictptr, *dict;
    int meth_found = 0;
    assert (*method == NULL);
    if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) {
        attr = __Pyx_PyObject_GetAttrStr(obj, name);
        goto try_unpack;
    }
    if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) {
        return 0;
    }
    descr = _PyType_Lookup(tp, name);
    if (likely(descr != NULL)) {
        Py_INCREF(descr);
#if PY_MAJOR_VERSION >= 3
        #ifdef __Pyx_CyFunction_USED
        if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr)))
        #else
        if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type)))
        #endif
#else
        #ifdef __Pyx_CyFunction_USED
        if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr)))
        #else
        if (likely(PyFunction_Check(descr)))
        #endif
#endif
        {
            meth_found = 1;
        } else {
            f = Py_TYPE(descr)->tp_descr_get;
            if (f != NULL && PyDescr_IsData(descr)) {
                attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
                Py_DECREF(descr);
                goto try_unpack;
            }
        }
    }
    dictptr = _PyObject_GetDictPtr(obj);
    if (dictptr != NULL && (dict = *dictptr) != NULL) {
        Py_INCREF(dict);
        attr = __Pyx_PyDict_GetItemStr(dict, name);
        if (attr != NULL) {
            Py_INCREF(attr);
            Py_DECREF(dict);
            Py_XDECREF(descr);
            goto try_unpack;
        }
        Py_DECREF(dict);
    }
    if (meth_found) {
        *method = descr;
        return 1;
    }
    if (f != NULL) {
        attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
        Py_DECREF(descr);
        goto try_unpack;
    }
    if (descr != NULL) {
        *method = descr;
        return 0;
    }
    PyErr_Format(PyExc_AttributeError,
#if PY_MAJOR_VERSION >= 3
                 "'%.50s' object has no attribute '%U'",
                 tp->tp_name, name);
#else
                 "'%.50s' object has no attribute '%.400s'",
                 tp->tp_name, PyString_AS_STRING(name));
#endif
    return 0;
#else
    attr = __Pyx_PyObject_GetAttrStr(obj, name);
    goto try_unpack;
#endif
try_unpack:
#if CYTHON_UNPACK_METHODS
    if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) {
        PyObject *function = PyMethod_GET_FUNCTION(attr);
        Py_INCREF(function);
        Py_DECREF(attr);
        *method = function;
        return 1;
    }
#endif
    *method = attr;
    return 0;
}

/* PyObjectCallMethod1 */
    static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) {
    PyObject *result = __Pyx_PyObject_CallOneArg(method, arg);
    Py_DECREF(method);
    return result;
}
static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
    PyObject *method = NULL, *result;
    int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
    if (likely(is_method)) {
        result = __Pyx_PyObject_Call2Args(method, obj, arg);
        Py_DECREF(method);
        return result;
    }
    if (unlikely(!method)) return NULL;
    return __Pyx__PyObject_CallMethod1(method, arg);
}

/* append */
    static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
    if (likely(PyList_CheckExact(L))) {
        if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1;
    } else {
        PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_n_s_append, x);
        if (unlikely(!retval))
            return -1;
        Py_DECREF(retval);
    }
    return 0;
}

/* 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))) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x03040000
        _PyUnicodeWriter_Init(&writer, 0);
#else
        _PyUnicodeWriter_Init(&writer);
#endif
        ret = _PyFloat_FormatAdvancedWriter(
            &writer,
            obj,
            format_spec, 0, PyUnicode_GET_LENGTH(format_spec));
    } else if (likely(PyLong_CheckExact(obj))) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x03040000
        _PyUnicodeWriter_Init(&writer, 0);
#else
        _PyUnicodeWriter_Init(&writer);
#endif
        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

/* JoinPyUnicode */
    static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength,
                                      CYTHON_UNUSED Py_UCS4 max_char) {
#if CYTHON_USE_UNICODE_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    PyObject *result_uval;
    int result_ukind;
    Py_ssize_t i, char_pos;
    void *result_udata;
#if CYTHON_PEP393_ENABLED
    result_uval = PyUnicode_New(result_ulength, max_char);
    if (unlikely(!result_uval)) return NULL;
    result_ukind = (max_char <= 255) ? PyUnicode_1BYTE_KIND : (max_char <= 65535) ? PyUnicode_2BYTE_KIND : PyUnicode_4BYTE_KIND;
    result_udata = PyUnicode_DATA(result_uval);
#else
    result_uval = PyUnicode_FromUnicode(NULL, result_ulength);
    if (unlikely(!result_uval)) return NULL;
    result_ukind = sizeof(Py_UNICODE);
    result_udata = PyUnicode_AS_UNICODE(result_uval);
#endif
    char_pos = 0;
    for (i=0; i < value_count; i++) {
        int ukind;
        Py_ssize_t ulength;
        void *udata;
        PyObject *uval = PyTuple_GET_ITEM(value_tuple, i);
        if (unlikely(__Pyx_PyUnicode_READY(uval)))
            goto bad;
        ulength = __Pyx_PyUnicode_GET_LENGTH(uval);
        if (unlikely(!ulength))
            continue;
        if (unlikely(char_pos + ulength < 0))
            goto overflow;
        ukind = __Pyx_PyUnicode_KIND(uval);
        udata = __Pyx_PyUnicode_DATA(uval);
        if (!CYTHON_PEP393_ENABLED || ukind == result_ukind) {
            memcpy((char *)result_udata + char_pos * result_ukind, udata, (size_t) (ulength * result_ukind));
        } else {
            #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030300F0 || defined(_PyUnicode_FastCopyCharacters)
            _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength);
            #else
            Py_ssize_t j;
            for (j=0; j < ulength; j++) {
                Py_UCS4 uchar = __Pyx_PyUnicode_READ(ukind, udata, j);
                __Pyx_PyUnicode_WRITE(result_ukind, result_udata, char_pos+j, uchar);
            }
            #endif
        }
        char_pos += ulength;
    }
    return result_uval;
overflow:
    PyErr_SetString(PyExc_OverflowError, "join() result is too long for a Python string");
bad:
    Py_DECREF(result_uval);
    return NULL;
#else
    result_ulength++;
    value_count++;
    return PyUnicode_Join(__pyx_empty_unicode, value_tuple);
#endif
}

/* PyObjectFormatAndDecref */
    static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f) {
    if (unlikely(!s)) return NULL;
    if (likely(PyUnicode_CheckExact(s))) return s;
    #if PY_MAJOR_VERSION < 3
    if (likely(PyString_CheckExact(s))) {
        PyObject *result = PyUnicode_FromEncodedObject(s, NULL, "strict");
        Py_DECREF(s);
        return result;
    }
    #endif
    return __Pyx_PyObject_FormatAndDecref(s, f);
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f) {
    PyObject *result = PyObject_Format(s, f);
    Py_DECREF(s);
    return result;
}

/* pyfrozenset_new */
    static CYTHON_INLINE PyObject* __Pyx_PyFrozenSet_New(PyObject* it) {
    if (it) {
        PyObject* result;
#if CYTHON_COMPILING_IN_PYPY
        PyObject* args;
        args = PyTuple_Pack(1, it);
        if (unlikely(!args))
            return NULL;
        result = PyObject_Call((PyObject*)&PyFrozenSet_Type, args, NULL);
        Py_DECREF(args);
        return result;
#else
        if (PyFrozenSet_CheckExact(it)) {
            Py_INCREF(it);
            return it;
        }
        result = PyFrozenSet_New(it);
        if (unlikely(!result))
            return NULL;
        if (likely(PySet_GET_SIZE(result)))
            return result;
        Py_DECREF(result);
#endif
    }
#if CYTHON_USE_TYPE_SLOTS
    return PyFrozenSet_Type.tp_new(&PyFrozenSet_Type, __pyx_empty_tuple, NULL);
#else
    return PyObject_Call((PyObject*)&PyFrozenSet_Type, __pyx_empty_tuple, NULL);
#endif
}

/* PySetContains */
    static int __Pyx_PySet_ContainsUnhashable(PyObject *set, PyObject *key) {
    int result = -1;
    if (PySet_Check(key) && PyErr_ExceptionMatches(PyExc_TypeError)) {
        PyObject *tmpkey;
        PyErr_Clear();
        tmpkey = __Pyx_PyFrozenSet_New(key);
        if (tmpkey != NULL) {
            result = PySet_Contains(set, tmpkey);
            Py_DECREF(tmpkey);
        }
    }
    return result;
}
static CYTHON_INLINE int __Pyx_PySet_ContainsTF(PyObject* key, PyObject* set, int eq) {
    int result = PySet_Contains(set, key);
    if (unlikely(result < 0)) {
        result = __Pyx_PySet_ContainsUnhashable(set, key);
    }
    return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
}

/* SliceObject */
    static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj,
        Py_ssize_t cstart, Py_ssize_t cstop,
        PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
        int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
#if CYTHON_USE_TYPE_SLOTS
    PyMappingMethods* mp;
#if PY_MAJOR_VERSION < 3
    PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
    if (likely(ms && ms->sq_slice)) {
        if (!has_cstart) {
            if (_py_start && (*_py_start != Py_None)) {
                cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
                if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
            } else
                cstart = 0;
        }
        if (!has_cstop) {
            if (_py_stop && (*_py_stop != Py_None)) {
                cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
                if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
            } else
                cstop = PY_SSIZE_T_MAX;
        }
        if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
            Py_ssize_t l = ms->sq_length(obj);
            if (likely(l >= 0)) {
                if (cstop < 0) {
                    cstop += l;
                    if (cstop < 0) cstop = 0;
                }
                if (cstart < 0) {
                    cstart += l;
                    if (cstart < 0) cstart = 0;
                }
            } else {
                if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                    goto bad;
                PyErr_Clear();
            }
        }
        return ms->sq_slice(obj, cstart, cstop);
    }
#endif
    mp = Py_TYPE(obj)->tp_as_mapping;
    if (likely(mp && mp->mp_subscript))
#endif
    {
        PyObject* result;
        PyObject *py_slice, *py_start, *py_stop;
        if (_py_slice) {
            py_slice = *_py_slice;
        } else {
            PyObject* owned_start = NULL;
            PyObject* owned_stop = NULL;
            if (_py_start) {
                py_start = *_py_start;
            } else {
                if (has_cstart) {
                    owned_start = py_start = PyInt_FromSsize_t(cstart);
                    if (unlikely(!py_start)) goto bad;
                } else
                    py_start = Py_None;
            }
            if (_py_stop) {
                py_stop = *_py_stop;
            } else {
                if (has_cstop) {
                    owned_stop = py_stop = PyInt_FromSsize_t(cstop);
                    if (unlikely(!py_stop)) {
                        Py_XDECREF(owned_start);
                        goto bad;
                    }
                } else
                    py_stop = Py_None;
            }
            py_slice = PySlice_New(py_start, py_stop, Py_None);
            Py_XDECREF(owned_start);
            Py_XDECREF(owned_stop);
            if (unlikely(!py_slice)) goto bad;
        }
#if CYTHON_USE_TYPE_SLOTS
        result = mp->mp_subscript(obj, py_slice);
#else
        result = PyObject_GetItem(obj, py_slice);
#endif
        if (!_py_slice) {
            Py_DECREF(py_slice);
        }
        return result;
    }
    PyErr_Format(PyExc_TypeError,
        "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name);
bad:
    return NULL;
}

/* FetchCommonType */
    static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
    PyObject* fake_module;
    PyTypeObject* cached_type = NULL;
    fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
    if (!fake_module) return NULL;
    Py_INCREF(fake_module);
    cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
    if (cached_type) {
        if (!PyType_Check((PyObject*)cached_type)) {
            PyErr_Format(PyExc_TypeError,
                "Shared Cython type %.200s is not a type object",
                type->tp_name);
            goto bad;
        }
        if (cached_type->tp_basicsize != type->tp_basicsize) {
            PyErr_Format(PyExc_TypeError,
                "Shared Cython type %.200s has the wrong size, try recompiling",
                type->tp_name);
            goto bad;
        }
    } else {
        if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
        PyErr_Clear();
        if (PyType_Ready(type) < 0) goto bad;
        if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
            goto bad;
        Py_INCREF(type);
        cached_type = type;
    }
done:
    Py_DECREF(fake_module);
    return cached_type;
bad:
    Py_XDECREF(cached_type);
    cached_type = NULL;
    goto done;
}

/* CythonFunctionShared */
    #include <structmember.h>
static PyObject *
__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
{
    if (unlikely(op->func_doc == NULL)) {
        if (op->func.m_ml->ml_doc) {
#if PY_MAJOR_VERSION >= 3
            op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
#else
            op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
#endif
            if (unlikely(op->func_doc == NULL))
                return NULL;
        } else {
            Py_INCREF(Py_None);
            return Py_None;
        }
    }
    Py_INCREF(op->func_doc);
    return op->func_doc;
}
static int
__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
{
    PyObject *tmp = op->func_doc;
    if (value == NULL) {
        value = Py_None;
    }
    Py_INCREF(value);
    op->func_doc = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    if (unlikely(op->func_name == NULL)) {
#if PY_MAJOR_VERSION >= 3
        op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
#else
        op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
#endif
        if (unlikely(op->func_name == NULL))
            return NULL;
    }
    Py_INCREF(op->func_name);
    return op->func_name;
}
static int
__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value)))
#else
    if (unlikely(value == NULL || !PyString_Check(value)))
#endif
    {
        PyErr_SetString(PyExc_TypeError,
                        "__name__ must be set to a string object");
        return -1;
    }
    tmp = op->func_name;
    Py_INCREF(value);
    op->func_name = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    Py_INCREF(op->func_qualname);
    return op->func_qualname;
}
static int
__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value)))
#else
    if (unlikely(value == NULL || !PyString_Check(value)))
#endif
    {
        PyErr_SetString(PyExc_TypeError,
                        "__qualname__ must be set to a string object");
        return -1;
    }
    tmp = op->func_qualname;
    Py_INCREF(value);
    op->func_qualname = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure)
{
    PyObject *self;
    self = m->func_closure;
    if (self == NULL)
        self = Py_None;
    Py_INCREF(self);
    return self;
}
static PyObject *
__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    if (unlikely(op->func_dict == NULL)) {
        op->func_dict = PyDict_New();
        if (unlikely(op->func_dict == NULL))
            return NULL;
    }
    Py_INCREF(op->func_dict);
    return op->func_dict;
}
static int
__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
{
    PyObject *tmp;
    if (unlikely(value == NULL)) {
        PyErr_SetString(PyExc_TypeError,
               "function's dictionary may not be deleted");
        return -1;
    }
    if (unlikely(!PyDict_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
               "setting function's dictionary to a non-dict");
        return -1;
    }
    tmp = op->func_dict;
    Py_INCREF(value);
    op->func_dict = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    Py_INCREF(op->func_globals);
    return op->func_globals;
}
static PyObject *
__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    Py_INCREF(Py_None);
    return Py_None;
}
static PyObject *
__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    PyObject* result = (op->func_code) ? op->func_code : Py_None;
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
    int result = 0;
    PyObject *res = op->defaults_getter((PyObject *) op);
    if (unlikely(!res))
        return -1;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
    Py_INCREF(op->defaults_tuple);
    op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
    Py_INCREF(op->defaults_kwdict);
    #else
    op->defaults_tuple = PySequence_ITEM(res, 0);
    if (unlikely(!op->defaults_tuple)) result = -1;
    else {
        op->defaults_kwdict = PySequence_ITEM(res, 1);
        if (unlikely(!op->defaults_kwdict)) result = -1;
    }
    #endif
    Py_DECREF(res);
    return result;
}
static int
__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
    PyObject* tmp;
    if (!value) {
        value = Py_None;
    } else if (value != Py_None && !PyTuple_Check(value)) {
        PyErr_SetString(PyExc_TypeError,
                        "__defaults__ must be set to a tuple object");
        return -1;
    }
    Py_INCREF(value);
    tmp = op->defaults_tuple;
    op->defaults_tuple = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
    PyObject* result = op->defaults_tuple;
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
            result = op->defaults_tuple;
        } else {
            result = Py_None;
        }
    }
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
    PyObject* tmp;
    if (!value) {
        value = Py_None;
    } else if (value != Py_None && !PyDict_Check(value)) {
        PyErr_SetString(PyExc_TypeError,
                        "__kwdefaults__ must be set to a dict object");
        return -1;
    }
    Py_INCREF(value);
    tmp = op->defaults_kwdict;
    op->defaults_kwdict = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
    PyObject* result = op->defaults_kwdict;
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
            result = op->defaults_kwdict;
        } else {
            result = Py_None;
        }
    }
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
    PyObject* tmp;
    if (!value || value == Py_None) {
        value = NULL;
    } else if (!PyDict_Check(value)) {
        PyErr_SetString(PyExc_TypeError,
                        "__annotations__ must be set to a dict object");
        return -1;
    }
    Py_XINCREF(value);
    tmp = op->func_annotations;
    op->func_annotations = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
    PyObject* result = op->func_annotations;
    if (unlikely(!result)) {
        result = PyDict_New();
        if (unlikely(!result)) return NULL;
        op->func_annotations = result;
    }
    Py_INCREF(result);
    return result;
}
static PyGetSetDef __pyx_CyFunction_getsets[] = {
    {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {(char *) "__doc__",  (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
    {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
    {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
    {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
    {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
    {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
    {0, 0, 0, 0, 0}
};
static PyMemberDef __pyx_CyFunction_members[] = {
    {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
    {0, 0, 0,  0, 0}
};
static PyObject *
__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
{
#if PY_MAJOR_VERSION >= 3
    return PyUnicode_FromString(m->func.m_ml->ml_name);
#else
    return PyString_FromString(m->func.m_ml->ml_name);
#endif
}
static PyMethodDef __pyx_CyFunction_methods[] = {
    {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
    {0, 0, 0, 0}
};
#if PY_VERSION_HEX < 0x030500A0
#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
#else
#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
#endif
static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname,
                                       PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
    if (unlikely(op == NULL))
        return NULL;
    op->flags = flags;
    __Pyx_CyFunction_weakreflist(op) = NULL;
    op->func.m_ml = ml;
    op->func.m_self = (PyObject *) op;
    Py_XINCREF(closure);
    op->func_closure = closure;
    Py_XINCREF(module);
    op->func.m_module = module;
    op->func_dict = NULL;
    op->func_name = NULL;
    Py_INCREF(qualname);
    op->func_qualname = qualname;
    op->func_doc = NULL;
    op->func_classobj = NULL;
    op->func_globals = globals;
    Py_INCREF(op->func_globals);
    Py_XINCREF(code);
    op->func_code = code;
    op->defaults_pyobjects = 0;
    op->defaults_size = 0;
    op->defaults = NULL;
    op->defaults_tuple = NULL;
    op->defaults_kwdict = NULL;
    op->defaults_getter = NULL;
    op->func_annotations = NULL;
    return (PyObject *) op;
}
static int
__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
{
    Py_CLEAR(m->func_closure);
    Py_CLEAR(m->func.m_module);
    Py_CLEAR(m->func_dict);
    Py_CLEAR(m->func_name);
    Py_CLEAR(m->func_qualname);
    Py_CLEAR(m->func_doc);
    Py_CLEAR(m->func_globals);
    Py_CLEAR(m->func_code);
    Py_CLEAR(m->func_classobj);
    Py_CLEAR(m->defaults_tuple);
    Py_CLEAR(m->defaults_kwdict);
    Py_CLEAR(m->func_annotations);
    if (m->defaults) {
        PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
        int i;
        for (i = 0; i < m->defaults_pyobjects; i++)
            Py_XDECREF(pydefaults[i]);
        PyObject_Free(m->defaults);
        m->defaults = NULL;
    }
    return 0;
}
static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
{
    if (__Pyx_CyFunction_weakreflist(m) != NULL)
        PyObject_ClearWeakRefs((PyObject *) m);
    __Pyx_CyFunction_clear(m);
    PyObject_GC_Del(m);
}
static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
{
    PyObject_GC_UnTrack(m);
    __Pyx__CyFunction_dealloc(m);
}
static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
{
    Py_VISIT(m->func_closure);
    Py_VISIT(m->func.m_module);
    Py_VISIT(m->func_dict);
    Py_VISIT(m->func_name);
    Py_VISIT(m->func_qualname);
    Py_VISIT(m->func_doc);
    Py_VISIT(m->func_globals);
    Py_VISIT(m->func_code);
    Py_VISIT(m->func_classobj);
    Py_VISIT(m->defaults_tuple);
    Py_VISIT(m->defaults_kwdict);
    if (m->defaults) {
        PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
        int i;
        for (i = 0; i < m->defaults_pyobjects; i++)
            Py_VISIT(pydefaults[i]);
    }
    return 0;
}
static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
{
#if PY_MAJOR_VERSION < 3
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
        Py_INCREF(func);
        return func;
    }
    if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
        if (type == NULL)
            type = (PyObject *)(Py_TYPE(obj));
        return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
    }
    if (obj == Py_None)
        obj = NULL;
#endif
    return __Pyx_PyMethod_New(func, obj, type);
}
static PyObject*
__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
{
#if PY_MAJOR_VERSION >= 3
    return PyUnicode_FromFormat("<cyfunction %U at %p>",
                                op->func_qualname, (void *)op);
#else
    return PyString_FromFormat("<cyfunction %s at %p>",
                               PyString_AsString(op->func_qualname), (void *)op);
#endif
}
static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
    PyCFunctionObject* f = (PyCFunctionObject*)func;
    PyCFunction meth = f->m_ml->ml_meth;
    Py_ssize_t size;
    switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
    case METH_VARARGS:
        if (likely(kw == NULL || PyDict_Size(kw) == 0))
            return (*meth)(self, arg);
        break;
    case METH_VARARGS | METH_KEYWORDS:
        return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw);
    case METH_NOARGS:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
            size = PyTuple_GET_SIZE(arg);
            if (likely(size == 0))
                return (*meth)(self, NULL);
            PyErr_Format(PyExc_TypeError,
                "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
                f->m_ml->ml_name, size);
            return NULL;
        }
        break;
    case METH_O:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
            size = PyTuple_GET_SIZE(arg);
            if (likely(size == 1)) {
                PyObject *result, *arg0;
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                arg0 = PyTuple_GET_ITEM(arg, 0);
                #else
                arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
                #endif
                result = (*meth)(self, arg0);
                #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
                Py_DECREF(arg0);
                #endif
                return result;
            }
            PyErr_Format(PyExc_TypeError,
                "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
                f->m_ml->ml_name, size);
            return NULL;
        }
        break;
    default:
        PyErr_SetString(PyExc_SystemError, "Bad call flags in "
                        "__Pyx_CyFunction_Call. METH_OLDARGS is no "
                        "longer supported!");
        return NULL;
    }
    PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
                 f->m_ml->ml_name);
    return NULL;
}
static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
}
static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
    PyObject *result;
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
    if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
        Py_ssize_t argc;
        PyObject *new_args;
        PyObject *self;
        argc = PyTuple_GET_SIZE(args);
        new_args = PyTuple_GetSlice(args, 1, argc);
        if (unlikely(!new_args))
            return NULL;
        self = PyTuple_GetItem(args, 0);
        if (unlikely(!self)) {
            Py_DECREF(new_args);
            return NULL;
        }
        result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
        Py_DECREF(new_args);
    } else {
        result = __Pyx_CyFunction_Call(func, args, kw);
    }
    return result;
}
static PyTypeObject __pyx_CyFunctionType_type = {
    PyVarObject_HEAD_INIT(0, 0)
    "cython_function_or_method",
    sizeof(__pyx_CyFunctionObject),
    0,
    (destructor) __Pyx_CyFunction_dealloc,
    0,
    0,
    0,
#if PY_MAJOR_VERSION < 3
    0,
#else
    0,
#endif
    (reprfunc) __Pyx_CyFunction_repr,
    0,
    0,
    0,
    0,
    __Pyx_CyFunction_CallAsMethod,
    0,
    0,
    0,
    0,
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
    0,
    (traverseproc) __Pyx_CyFunction_traverse,
    (inquiry) __Pyx_CyFunction_clear,
    0,
#if PY_VERSION_HEX < 0x030500A0
    offsetof(__pyx_CyFunctionObject, func_weakreflist),
#else
    offsetof(PyCFunctionObject, m_weakreflist),
#endif
    0,
    0,
    __pyx_CyFunction_methods,
    __pyx_CyFunction_members,
    __pyx_CyFunction_getsets,
    0,
    0,
    __Pyx_CyFunction_descr_get,
    0,
    offsetof(__pyx_CyFunctionObject, func_dict),
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
#if PY_VERSION_HEX >= 0x030400a1
    0,
#endif
#if PY_VERSION_HEX >= 0x030800b1
    0,
#endif
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
    0,
#endif
};
static int __pyx_CyFunction_init(void) {
    __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
    if (unlikely(__pyx_CyFunctionType == NULL)) {
        return -1;
    }
    return 0;
}
static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults = PyObject_Malloc(size);
    if (unlikely(!m->defaults))
        return PyErr_NoMemory();
    memset(m->defaults, 0, size);
    m->defaults_pyobjects = pyobjects;
    m->defaults_size = size;
    return m->defaults;
}
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults_tuple = tuple;
    Py_INCREF(tuple);
}
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults_kwdict = dict;
    Py_INCREF(dict);
}
static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->func_annotations = dict;
    Py_INCREF(dict);
}

/* CythonFunction */
    static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname,
                                      PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
    PyObject *op = __Pyx_CyFunction_Init(
        PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType),
        ml, flags, qualname, closure, module, globals, code
    );
    if (likely(op)) {
        PyObject_GC_Track(op);
    }
    return op;
}

/* GetTopmostException */
    #if CYTHON_USE_EXC_INFO_STACK
static _PyErr_StackItem *
__Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
{
    _PyErr_StackItem *exc_info = tstate->exc_info;
    while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
           exc_info->previous_item != NULL)
    {
        exc_info = exc_info->previous_item;
    }
    return exc_info;
}
#endif

/* SaveResetException */
    #if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    #if CYTHON_USE_EXC_INFO_STACK
    _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
    *type = exc_info->exc_type;
    *value = exc_info->exc_value;
    *tb = exc_info->exc_traceback;
    #else
    *type = tstate->exc_type;
    *value = tstate->exc_value;
    *tb = tstate->exc_traceback;
    #endif
    Py_XINCREF(*type);
    Py_XINCREF(*value);
    Py_XINCREF(*tb);
}
static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    #if CYTHON_USE_EXC_INFO_STACK
    _PyErr_StackItem *exc_info = tstate->exc_info;
    tmp_type = exc_info->exc_type;
    tmp_value = exc_info->exc_value;
    tmp_tb = exc_info->exc_traceback;
    exc_info->exc_type = type;
    exc_info->exc_value = value;
    exc_info->exc_traceback = tb;
    #else
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = type;
    tstate->exc_value = value;
    tstate->exc_traceback = tb;
    #endif
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
}
#endif

/* FastTypeChecks */
    #if CYTHON_COMPILING_IN_CPYTHON
static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
    while (a) {
        a = a->tp_base;
        if (a == b)
            return 1;
    }
    return b == &PyBaseObject_Type;
}
static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
    PyObject *mro;
    if (a == b) return 1;
    mro = a->tp_mro;
    if (likely(mro)) {
        Py_ssize_t i, n;
        n = PyTuple_GET_SIZE(mro);
        for (i = 0; i < n; i++) {
            if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
                return 1;
        }
        return 0;
    }
    return __Pyx_InBases(a, b);
}
#if PY_MAJOR_VERSION == 2
static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
    PyObject *exception, *value, *tb;
    int res;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&exception, &value, &tb);
    res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
    if (unlikely(res == -1)) {
        PyErr_WriteUnraisable(err);
        res = 0;
    }
    if (!res) {
        res = PyObject_IsSubclass(err, exc_type2);
        if (unlikely(res == -1)) {
            PyErr_WriteUnraisable(err);
            res = 0;
        }
    }
    __Pyx_ErrRestore(exception, value, tb);
    return res;
}
#else
static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
    int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
    if (!res) {
        res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
    }
    return res;
}
#endif
static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
    Py_ssize_t i, n;
    assert(PyExceptionClass_Check(exc_type));
    n = PyTuple_GET_SIZE(tuple);
#if PY_MAJOR_VERSION >= 3
    for (i=0; i<n; i++) {
        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
    }
#endif
    for (i=0; i<n; i++) {
        PyObject *t = PyTuple_GET_ITEM(tuple, i);
        #if PY_MAJOR_VERSION < 3
        if (likely(exc_type == t)) return 1;
        #endif
        if (likely(PyExceptionClass_Check(t))) {
            if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
        } else {
        }
    }
    return 0;
}
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
    if (likely(err == exc_type)) return 1;
    if (likely(PyExceptionClass_Check(err))) {
        if (likely(PyExceptionClass_Check(exc_type))) {
            return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
        } else if (likely(PyTuple_Check(exc_type))) {
            return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
        } else {
        }
    }
    return PyErr_GivenExceptionMatches(err, exc_type);
}
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
    assert(PyExceptionClass_Check(exc_type1));
    assert(PyExceptionClass_Check(exc_type2));
    if (likely(err == exc_type1 || err == exc_type2)) return 1;
    if (likely(PyExceptionClass_Check(err))) {
        return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
    }
    return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
}
#endif

/* GetException */
    #if CYTHON_FAST_THREAD_STATE
static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
#else
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
#endif
{
    PyObject *local_type, *local_value, *local_tb;
#if CYTHON_FAST_THREAD_STATE
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    local_type = tstate->curexc_type;
    local_value = tstate->curexc_value;
    local_tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
#else
    PyErr_Fetch(&local_type, &local_value, &local_tb);
#endif
    PyErr_NormalizeException(&local_type, &local_value, &local_tb);
#if CYTHON_FAST_THREAD_STATE
    if (unlikely(tstate->curexc_type))
#else
    if (unlikely(PyErr_Occurred()))
#endif
        goto bad;
    #if PY_MAJOR_VERSION >= 3
    if (local_tb) {
        if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
            goto bad;
    }
    #endif
    Py_XINCREF(local_tb);
    Py_XINCREF(local_type);
    Py_XINCREF(local_value);
    *type = local_type;
    *value = local_value;
    *tb = local_tb;
#if CYTHON_FAST_THREAD_STATE
    #if CYTHON_USE_EXC_INFO_STACK
    {
        _PyErr_StackItem *exc_info = tstate->exc_info;
        tmp_type = exc_info->exc_type;
        tmp_value = exc_info->exc_value;
        tmp_tb = exc_info->exc_traceback;
        exc_info->exc_type = local_type;
        exc_info->exc_value = local_value;
        exc_info->exc_traceback = local_tb;
    }
    #else
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = local_type;
    tstate->exc_value = local_value;
    tstate->exc_traceback = local_tb;
    #endif
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#else
    PyErr_SetExcInfo(local_type, local_value, local_tb);
#endif
    return 0;
bad:
    *type = 0;
    *value = 0;
    *tb = 0;
    Py_XDECREF(local_type);
    Py_XDECREF(local_value);
    Py_XDECREF(local_tb);
    return -1;
}

/* PyErrExceptionMatches */
    #if CYTHON_FAST_THREAD_STATE
static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
    Py_ssize_t i, n;
    n = PyTuple_GET_SIZE(tuple);
#if PY_MAJOR_VERSION >= 3
    for (i=0; i<n; i++) {
        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
    }
#endif
    for (i=0; i<n; i++) {
        if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
    }
    return 0;
}
static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
    PyObject *exc_type = tstate->curexc_type;
    if (exc_type == err) return 1;
    if (unlikely(!exc_type)) return 0;
    if (unlikely(PyTuple_Check(err)))
        return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
    return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
}
#endif

/* PyUnicode_Unicode */
    static CYTHON_INLINE PyObject* __Pyx_PyUnicode_Unicode(PyObject *obj) {
    if (unlikely(obj == Py_None))
        obj = __pyx_kp_u_None;
    return __Pyx_NewRef(obj);
}

/* KeywordStringCheck */
    static int __Pyx_CheckKeywordStrings(
    PyObject *kwdict,
    const char* function_name,
    int kw_allowed)
{
    PyObject* key = 0;
    Py_ssize_t pos = 0;
#if CYTHON_COMPILING_IN_PYPY
    if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0))
        goto invalid_keyword;
    return 1;
#else
    while (PyDict_Next(kwdict, &pos, &key, 0)) {
        #if PY_MAJOR_VERSION < 3
        if (unlikely(!PyString_Check(key)))
        #endif
            if (unlikely(!PyUnicode_Check(key)))
                goto invalid_keyword_type;
    }
    if ((!kw_allowed) && unlikely(key))
        goto invalid_keyword;
    return 1;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%.200s() keywords must be strings", function_name);
    return 0;
#endif
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%.200s() got an unexpected keyword argument '%.200s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
    return 0;
}

/* SliceTupleAndList */
    #if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE void __Pyx_crop_slice(Py_ssize_t* _start, Py_ssize_t* _stop, Py_ssize_t* _length) {
    Py_ssize_t start = *_start, stop = *_stop, length = *_length;
    if (start < 0) {
        start += length;
        if (start < 0)
            start = 0;
    }
    if (stop < 0)
        stop += length;
    else if (stop > length)
        stop = length;
    *_length = stop - start;
    *_start = start;
    *_stop = stop;
}
static CYTHON_INLINE void __Pyx_copy_object_array(PyObject** CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) {
    PyObject *v;
    Py_ssize_t i;
    for (i = 0; i < length; i++) {
        v = dest[i] = src[i];
        Py_INCREF(v);
    }
}
static CYTHON_INLINE PyObject* __Pyx_PyList_GetSlice(
            PyObject* src, Py_ssize_t start, Py_ssize_t stop) {
    PyObject* dest;
    Py_ssize_t length = PyList_GET_SIZE(src);
    __Pyx_crop_slice(&start, &stop, &length);
    if (unlikely(length <= 0))
        return PyList_New(0);
    dest = PyList_New(length);
    if (unlikely(!dest))
        return NULL;
    __Pyx_copy_object_array(
        ((PyListObject*)src)->ob_item + start,
        ((PyListObject*)dest)->ob_item,
        length);
    return dest;
}
static CYTHON_INLINE PyObject* __Pyx_PyTuple_GetSlice(
            PyObject* src, Py_ssize_t start, Py_ssize_t stop) {
    PyObject* dest;
    Py_ssize_t length = PyTuple_GET_SIZE(src);
    __Pyx_crop_slice(&start, &stop, &length);
    if (unlikely(length <= 0))
        return PyTuple_New(0);
    dest = PyTuple_New(length);
    if (unlikely(!dest))
        return NULL;
    __Pyx_copy_object_array(
        ((PyTupleObject*)src)->ob_item + start,
        ((PyTupleObject*)dest)->ob_item,
        length);
    return dest;
}
#endif

/* 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;
    (void)inplace;
    (void)zerodivision_check;
    if (likely(PyFloat_CheckExact(op1))) {
        a = PyFloat_AS_DOUBLE(op1);
        
    } else
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        a = (double) PyInt_AS_LONG(op1);
        
    } else
    #endif
    if (likely(PyLong_CheckExact(op1))) {
        #if CYTHON_USE_PYLONG_INTERNALS
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op1);
        switch (size) {
            case  0: a = 0.0; break;
            case -1: a = -(double) digits[0]; break;
            case  1: a = (double) digits[0]; break;
            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:
        #else
        {
        #endif
            a = PyLong_AsDouble(op1);
            if (unlikely(a == -1.0 && PyErr_Occurred())) return NULL;
            
        }
    } else {
        return (inplace ? PyNumber_InPlaceTrueDivide : PyNumber_TrueDivide)(op1, op2);
    }
        
        PyFPE_START_PROTECT("divide", return NULL)
        result = a / b;
        PyFPE_END_PROTECT(result)
        return PyFloat_FromDouble(result);
}
#endif

/* PyIntCompare */
      static CYTHON_INLINE PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED long inplace) {
    if (op1 == op2) {
        Py_RETURN_TRUE;
    }
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long a = PyInt_AS_LONG(op1);
        if (a == b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        int unequal;
        unsigned long uintval;
        Py_ssize_t size = Py_SIZE(op1);
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        if (intval == 0) {
            if (size == 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
        } else if (intval < 0) {
            if (size >= 0)
                Py_RETURN_FALSE;
            intval = -intval;
            size = -size;
        } else {
            if (size <= 0)
                Py_RETURN_FALSE;
        }
        uintval = (unsigned long) intval;
#if PyLong_SHIFT * 4 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 4)) {
            unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 3 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 3)) {
            unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 2 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 2)) {
            unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 1 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 1)) {
            unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
            unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK));
        if (unequal == 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
        double a = PyFloat_AS_DOUBLE(op1);
        if ((double)a == (double)b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
    }
    return (
        PyObject_RichCompare(op1, op2, Py_EQ));
}

/* PyFloatBinop */
      #if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyFloat_EqObjC(PyObject *op1, PyObject *op2, double floatval, int inplace, int zerodivision_check) {
    const double b = floatval;
    double a;
    (void)inplace;
    (void)zerodivision_check;
    if (op1 == op2) {
        Py_RETURN_TRUE;
    }
    if (likely(PyFloat_CheckExact(op1))) {
        a = PyFloat_AS_DOUBLE(op1);
        
    } else
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        a = (double) PyInt_AS_LONG(op1);
        
    } else
    #endif
    if (likely(PyLong_CheckExact(op1))) {
        #if CYTHON_USE_PYLONG_INTERNALS
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op1);
        switch (size) {
            case  0: a = 0.0; break;
            case -1: a = -(double) digits[0]; break;
            case  1: a = (double) digits[0]; break;
            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:
        #else
        {
        #endif
            return (
                PyFloat_Type.tp_richcompare(op2, op1, Py_EQ));
        }
    } else {
        return (
            PyObject_RichCompare(op1, op2, Py_EQ));
    }
        if (a == b) {
            Py_RETURN_TRUE;
        } else {
            Py_RETURN_FALSE;
        }
}
#endif

/* SetItemInt */
        static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
    int r;
    if (!j) return -1;
    r = PyObject_SetItem(o, j, v);
    Py_DECREF(j);
    return r;
}
static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int is_list,
                                               CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
    if (is_list || PyList_CheckExact(o)) {
        Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o));
        if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o)))) {
            PyObject* old = PyList_GET_ITEM(o, n);
            Py_INCREF(v);
            PyList_SET_ITEM(o, n, v);
            Py_DECREF(old);
            return 1;
        }
    } else {
        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
        if (likely(m && m->sq_ass_item)) {
            if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
                Py_ssize_t l = m->sq_length(o);
                if (likely(l >= 0)) {
                    i += l;
                } else {
                    if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                        return -1;
                    PyErr_Clear();
                }
            }
            return m->sq_ass_item(o, i, v);
        }
    }
#else
#if CYTHON_COMPILING_IN_PYPY
    if (is_list || (PySequence_Check(o) && !PyDict_Check(o)))
#else
    if (is_list || PySequence_Check(o))
#endif
    {
        return PySequence_SetItem(o, i, v);
    }
#endif
    return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v);
}

/* DictGetItem */
        #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
    PyObject *value;
    value = PyDict_GetItemWithError(d, key);
    if (unlikely(!value)) {
        if (!PyErr_Occurred()) {
            if (unlikely(PyTuple_Check(key))) {
                PyObject* args = PyTuple_Pack(1, key);
                if (likely(args)) {
                    PyErr_SetObject(PyExc_KeyError, args);
                    Py_DECREF(args);
                }
            } else {
                PyErr_SetObject(PyExc_KeyError, key);
            }
        }
        return NULL;
    }
    Py_INCREF(value);
    return value;
}
#endif

/* UnpackUnboundCMethod */
        static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) {
    PyObject *method;
    method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name);
    if (unlikely(!method))
        return -1;
    target->method = method;
#if CYTHON_COMPILING_IN_CPYTHON
    #if PY_MAJOR_VERSION >= 3
    if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type)))
    #endif
    {
        PyMethodDescrObject *descr = (PyMethodDescrObject*) method;
        target->func = descr->d_method->ml_meth;
        target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_STACKLESS);
    }
#endif
    return 0;
}

/* CallUnboundCMethod1 */
        #if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg) {
    if (likely(cfunc->func)) {
        int flag = cfunc->flag;
        if (flag == METH_O) {
            return (*(cfunc->func))(self, arg);
        } else if (PY_VERSION_HEX >= 0x030600B1 && flag == METH_FASTCALL) {
            if (PY_VERSION_HEX >= 0x030700A0) {
                return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, &arg, 1);
            } else {
                return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL);
            }
        } else if (PY_VERSION_HEX >= 0x030700A0 && flag == (METH_FASTCALL | METH_KEYWORDS)) {
            return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL);
        }
    }
    return __Pyx__CallUnboundCMethod1(cfunc, self, arg);
}
#endif
static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg){
    PyObject *args, *result = NULL;
    if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
#if CYTHON_COMPILING_IN_CPYTHON
    if (cfunc->func && (cfunc->flag & METH_VARARGS)) {
        args = PyTuple_New(1);
        if (unlikely(!args)) goto bad;
        Py_INCREF(arg);
        PyTuple_SET_ITEM(args, 0, arg);
        if (cfunc->flag & METH_KEYWORDS)
            result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL);
        else
            result = (*cfunc->func)(self, args);
    } else {
        args = PyTuple_New(2);
        if (unlikely(!args)) goto bad;
        Py_INCREF(self);
        PyTuple_SET_ITEM(args, 0, self);
        Py_INCREF(arg);
        PyTuple_SET_ITEM(args, 1, arg);
        result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
    }
#else
    args = PyTuple_Pack(2, self, arg);
    if (unlikely(!args)) goto bad;
    result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
#endif
bad:
    Py_XDECREF(args);
    return result;
}

/* CallUnboundCMethod2 */
        #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030600B1
static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) {
    if (likely(cfunc->func)) {
        PyObject *args[2] = {arg1, arg2};
        if (cfunc->flag == METH_FASTCALL) {
            #if PY_VERSION_HEX >= 0x030700A0
            return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, args, 2);
            #else
            return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, 2, NULL);
            #endif
        }
        #if PY_VERSION_HEX >= 0x030700A0
        if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS))
            return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, 2, NULL);
        #endif
    }
    return __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2);
}
#endif
static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2){
    PyObject *args, *result = NULL;
    if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
#if CYTHON_COMPILING_IN_CPYTHON
    if (cfunc->func && (cfunc->flag & METH_VARARGS)) {
        args = PyTuple_New(2);
        if (unlikely(!args)) goto bad;
        Py_INCREF(arg1);
        PyTuple_SET_ITEM(args, 0, arg1);
        Py_INCREF(arg2);
        PyTuple_SET_ITEM(args, 1, arg2);
        if (cfunc->flag & METH_KEYWORDS)
            result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL);
        else
            result = (*cfunc->func)(self, args);
    } else {
        args = PyTuple_New(3);
        if (unlikely(!args)) goto bad;
        Py_INCREF(self);
        PyTuple_SET_ITEM(args, 0, self);
        Py_INCREF(arg1);
        PyTuple_SET_ITEM(args, 1, arg1);
        Py_INCREF(arg2);
        PyTuple_SET_ITEM(args, 2, arg2);
        result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
    }
#else
    args = PyTuple_Pack(3, self, arg1, arg2);
    if (unlikely(!args)) goto bad;
    result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
#endif
bad:
    Py_XDECREF(args);
    return result;
}

/* dict_getitem_default */
        static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value) {
    PyObject* value;
#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
    value = PyDict_GetItemWithError(d, key);
    if (unlikely(!value)) {
        if (unlikely(PyErr_Occurred()))
            return NULL;
        value = default_value;
    }
    Py_INCREF(value);
    if ((1));
#else
    if (PyString_CheckExact(key) || PyUnicode_CheckExact(key) || PyInt_CheckExact(key)) {
        value = PyDict_GetItem(d, key);
        if (unlikely(!value)) {
            value = default_value;
        }
        Py_INCREF(value);
    }
#endif
    else {
        if (default_value == Py_None)
            value = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyDict_Type_get, d, key);
        else
            value = __Pyx_CallUnboundCMethod2(&__pyx_umethod_PyDict_Type_get, d, key, default_value);
    }
    return value;
}

/* PyObject_GenericGetAttrNoDict */
        #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
    PyErr_Format(PyExc_AttributeError,
#if PY_MAJOR_VERSION >= 3
                 "'%.50s' object has no attribute '%U'",
                 tp->tp_name, attr_name);
#else
                 "'%.50s' object has no attribute '%.400s'",
                 tp->tp_name, PyString_AS_STRING(attr_name));
#endif
    return NULL;
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
    PyObject *descr;
    PyTypeObject *tp = Py_TYPE(obj);
    if (unlikely(!PyString_Check(attr_name))) {
        return PyObject_GenericGetAttr(obj, attr_name);
    }
    assert(!tp->tp_dictoffset);
    descr = _PyType_Lookup(tp, attr_name);
    if (unlikely(!descr)) {
        return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
    }
    Py_INCREF(descr);
    #if PY_MAJOR_VERSION < 3
    if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
    #endif
    {
        descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
        if (unlikely(f)) {
            PyObject *res = f(descr, obj, (PyObject *)tp);
            Py_DECREF(descr);
            return res;
        }
    }
    return descr;
}
#endif

/* CalculateMetaclass */
        static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
    Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases);
    for (i=0; i < nbases; i++) {
        PyTypeObject *tmptype;
        PyObject *tmp = PyTuple_GET_ITEM(bases, i);
        tmptype = Py_TYPE(tmp);
#if PY_MAJOR_VERSION < 3
        if (tmptype == &PyClass_Type)
            continue;
#endif
        if (!metaclass) {
            metaclass = tmptype;
            continue;
        }
        if (PyType_IsSubtype(metaclass, tmptype))
            continue;
        if (PyType_IsSubtype(tmptype, metaclass)) {
            metaclass = tmptype;
            continue;
        }
        PyErr_SetString(PyExc_TypeError,
                        "metaclass conflict: "
                        "the metaclass of a derived class "
                        "must be a (non-strict) subclass "
                        "of the metaclasses of all its bases");
        return NULL;
    }
    if (!metaclass) {
#if PY_MAJOR_VERSION < 3
        metaclass = &PyClass_Type;
#else
        metaclass = &PyType_Type;
#endif
    }
    Py_INCREF((PyObject*) metaclass);
    return (PyObject*) metaclass;
}

/* Py3ClassCreate */
        static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
                                           PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
    PyObject *ns;
    if (metaclass) {
        PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare);
        if (prep) {
            PyObject *pargs = PyTuple_Pack(2, name, bases);
            if (unlikely(!pargs)) {
                Py_DECREF(prep);
                return NULL;
            }
            ns = PyObject_Call(prep, pargs, mkw);
            Py_DECREF(prep);
            Py_DECREF(pargs);
        } else {
            if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError)))
                return NULL;
            PyErr_Clear();
            ns = PyDict_New();
        }
    } else {
        ns = PyDict_New();
    }
    if (unlikely(!ns))
        return NULL;
    if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad;
    if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad;
    if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad;
    return ns;
bad:
    Py_DECREF(ns);
    return NULL;
}
static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
                                      PyObject *dict, PyObject *mkw,
                                      int calculate_metaclass, int allow_py2_metaclass) {
    PyObject *result, *margs;
    PyObject *owned_metaclass = NULL;
    if (allow_py2_metaclass) {
        owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass);
        if (owned_metaclass) {
            metaclass = owned_metaclass;
        } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
            PyErr_Clear();
        } else {
            return NULL;
        }
    }
    if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
        metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
        Py_XDECREF(owned_metaclass);
        if (unlikely(!metaclass))
            return NULL;
        owned_metaclass = metaclass;
    }
    margs = PyTuple_Pack(3, name, bases, dict);
    if (unlikely(!margs)) {
        result = NULL;
    } else {
        result = PyObject_Call(metaclass, margs, mkw);
        Py_DECREF(margs);
    }
    Py_XDECREF(owned_metaclass);
    return result;
}

/* CLineInTraceback */
        #ifndef CYTHON_CLINE_IN_TRACEBACK
static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) {
    PyObject *use_cline;
    PyObject *ptype, *pvalue, *ptraceback;
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject **cython_runtime_dict;
#endif
    if (unlikely(!__pyx_cython_runtime)) {
        return c_line;
    }
    __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
#if CYTHON_COMPILING_IN_CPYTHON
    cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
    if (likely(cython_runtime_dict)) {
        __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
            use_cline, *cython_runtime_dict,
            __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
    } else
#endif
    {
      PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
      if (use_cline_obj) {
        use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
        Py_DECREF(use_cline_obj);
      } else {
        PyErr_Clear();
        use_cline = NULL;
      }
    }
    if (!use_cline) {
        c_line = 0;
        PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
    }
    else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
        c_line = 0;
    }
    __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
    return c_line;
}
#endif

/* CodeObjectCache */
        static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
    int start = 0, mid = 0, end = count - 1;
    if (end >= 0 && code_line > entries[end].code_line) {
        return count;
    }
    while (start < end) {
        mid = start + (end - start) / 2;
        if (code_line < entries[mid].code_line) {
            end = mid;
        } else if (code_line > entries[mid].code_line) {
             start = mid + 1;
        } else {
            return mid;
        }
    }
    if (code_line <= entries[mid].code_line) {
        return mid;
    } else {
        return mid + 1;
    }
}
static PyCodeObject *__pyx_find_code_object(int code_line) {
    PyCodeObject* code_object;
    int pos;
    if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
        return NULL;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
        return NULL;
    }
    code_object = __pyx_code_cache.entries[pos].code_object;
    Py_INCREF(code_object);
    return code_object;
}
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
    int pos, i;
    __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
    if (unlikely(!code_line)) {
        return;
    }
    if (unlikely(!entries)) {
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
        if (likely(entries)) {
            __pyx_code_cache.entries = entries;
            __pyx_code_cache.max_count = 64;
            __pyx_code_cache.count = 1;
            entries[0].code_line = code_line;
            entries[0].code_object = code_object;
            Py_INCREF(code_object);
        }
        return;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
        PyCodeObject* tmp = entries[pos].code_object;
        entries[pos].code_object = code_object;
        Py_DECREF(tmp);
        return;
    }
    if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
        int new_max = __pyx_code_cache.max_count + 64;
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
            __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
        if (unlikely(!entries)) {
            return;
        }
        __pyx_code_cache.entries = entries;
        __pyx_code_cache.max_count = new_max;
    }
    for (i=__pyx_code_cache.count; i>pos; i--) {
        entries[i] = entries[i-1];
    }
    entries[pos].code_line = code_line;
    entries[pos].code_object = code_object;
    __pyx_code_cache.count++;
    Py_INCREF(code_object);
}

/* AddTraceback */
        #include "compile.h"
#include "frameobject.h"
#include "traceback.h"
static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
            const char *funcname, int c_line,
            int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyObject *py_srcfile = 0;
    PyObject *py_funcname = 0;
    #if PY_MAJOR_VERSION < 3
    py_srcfile = PyString_FromString(filename);
    #else
    py_srcfile = PyUnicode_FromString(filename);
    #endif
    if (!py_srcfile) goto bad;
    if (c_line) {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #else
        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #endif
    }
    else {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromString(funcname);
        #else
        py_funcname = PyUnicode_FromString(funcname);
        #endif
    }
    if (!py_funcname) goto bad;
    py_code = __Pyx_PyCode_New(
        0,
        0,
        0,
        0,
        0,
        __pyx_empty_bytes, /*PyObject *code,*/
        __pyx_empty_tuple, /*PyObject *consts,*/
        __pyx_empty_tuple, /*PyObject *names,*/
        __pyx_empty_tuple, /*PyObject *varnames,*/
        __pyx_empty_tuple, /*PyObject *freevars,*/
        __pyx_empty_tuple, /*PyObject *cellvars,*/
        py_srcfile,   /*PyObject *filename,*/
        py_funcname,  /*PyObject *name,*/
        py_line,
        __pyx_empty_bytes  /*PyObject *lnotab*/
    );
    Py_DECREF(py_srcfile);
    Py_DECREF(py_funcname);
    return py_code;
bad:
    Py_XDECREF(py_srcfile);
    Py_XDECREF(py_funcname);
    return NULL;
}
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyFrameObject *py_frame = 0;
    PyThreadState *tstate = __Pyx_PyThreadState_Current;
    if (c_line) {
        c_line = __Pyx_CLineForTraceback(tstate, c_line);
    }
    py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
    if (!py_code) {
        py_code = __Pyx_CreateCodeObjectForTraceback(
            funcname, c_line, py_line, filename);
        if (!py_code) goto bad;
        __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
    }
    py_frame = PyFrame_New(
        tstate,            /*PyThreadState *tstate,*/
        py_code,           /*PyCodeObject *code,*/
        __pyx_d,    /*PyObject *globals,*/
        0                  /*PyObject *locals*/
    );
    if (!py_frame) goto bad;
    __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
    PyTraceBack_Here(py_frame);
bad:
    Py_XDECREF(py_code);
    Py_XDECREF(py_frame);
}

/* CIntToPy */
        static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
    const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(long) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(long) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(long),
                                     little, !is_unsigned);
    }
}

/* CIntFromPyVerify */
        #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
    {\
        func_type value = func_value;\
        if (sizeof(target_type) < sizeof(func_type)) {\
            if (unlikely(value != (func_type) (target_type) value)) {\
                func_type zero = 0;\
                if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
                    return (target_type) -1;\
                if (is_unsigned && unlikely(value < zero))\
                    goto raise_neg_overflow;\
                else\
                    goto raise_overflow;\
            }\
        }\
        return (target_type) value;\
    }

/* CIntFromPy */
        static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
    const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(long) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (long) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (long) 0;
                case  1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
                case 2:
                    if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
                            return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
                            return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
                            return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (long) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(long) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (long) 0;
                case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(long,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                            return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                            return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                            return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(long) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            long val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (long) -1;
        }
    } else {
        long val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (long) -1;
        val = __Pyx_PyInt_As_long(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to long");
    return (long) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to long");
    return (long) -1;
}

/* CIntFromPy */
        static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
    const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(int) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (int) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int) 0;
                case  1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
                case 2:
                    if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
                            return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
                            return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
                            return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (int) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(int) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int) 0;
                case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(int,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                            return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                            return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
                            return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(int) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            int val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (int) -1;
        }
    } else {
        int val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (int) -1;
        val = __Pyx_PyInt_As_int(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to int");
    return (int) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to int");
    return (int) -1;
}

/* SwapException */
        #if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    #if CYTHON_USE_EXC_INFO_STACK
    _PyErr_StackItem *exc_info = tstate->exc_info;
    tmp_type = exc_info->exc_type;
    tmp_value = exc_info->exc_value;
    tmp_tb = exc_info->exc_traceback;
    exc_info->exc_type = *type;
    exc_info->exc_value = *value;
    exc_info->exc_traceback = *tb;
    #else
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = *type;
    tstate->exc_value = *value;
    tstate->exc_traceback = *tb;
    #endif
    *type = tmp_type;
    *value = tmp_value;
    *tb = tmp_tb;
}
#else
static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
    PyErr_SetExcInfo(*type, *value, *tb);
    *type = tmp_type;
    *value = tmp_value;
    *tb = tmp_tb;
}
#endif

/* CoroutineBase */
        #include <structmember.h>
#include <frameobject.h>
#define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom)
static int __Pyx_PyGen__FetchStopIterationValue(CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject **pvalue) {
    PyObject *et, *ev, *tb;
    PyObject *value = NULL;
    __Pyx_ErrFetch(&et, &ev, &tb);
    if (!et) {
        Py_XDECREF(tb);
        Py_XDECREF(ev);
        Py_INCREF(Py_None);
        *pvalue = Py_None;
        return 0;
    }
    if (likely(et == PyExc_StopIteration)) {
        if (!ev) {
            Py_INCREF(Py_None);
            value = Py_None;
        }
#if PY_VERSION_HEX >= 0x030300A0
        else if (Py_TYPE(ev) == (PyTypeObject*)PyExc_StopIteration) {
            value = ((PyStopIterationObject *)ev)->value;
            Py_INCREF(value);
            Py_DECREF(ev);
        }
#endif
        else if (unlikely(PyTuple_Check(ev))) {
            if (PyTuple_GET_SIZE(ev) >= 1) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                value = PyTuple_GET_ITEM(ev, 0);
                Py_INCREF(value);
#else
                value = PySequence_ITEM(ev, 0);
#endif
            } else {
                Py_INCREF(Py_None);
                value = Py_None;
            }
            Py_DECREF(ev);
        }
        else if (!__Pyx_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) {
            value = ev;
        }
        if (likely(value)) {
            Py_XDECREF(tb);
            Py_DECREF(et);
            *pvalue = value;
            return 0;
        }
    } else if (!__Pyx_PyErr_GivenExceptionMatches(et, PyExc_StopIteration)) {
        __Pyx_ErrRestore(et, ev, tb);
        return -1;
    }
    PyErr_NormalizeException(&et, &ev, &tb);
    if (unlikely(!PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration))) {
        __Pyx_ErrRestore(et, ev, tb);
        return -1;
    }
    Py_XDECREF(tb);
    Py_DECREF(et);
#if PY_VERSION_HEX >= 0x030300A0
    value = ((PyStopIterationObject *)ev)->value;
    Py_INCREF(value);
    Py_DECREF(ev);
#else
    {
        PyObject* args = __Pyx_PyObject_GetAttrStr(ev, __pyx_n_s_args);
        Py_DECREF(ev);
        if (likely(args)) {
            value = PySequence_GetItem(args, 0);
            Py_DECREF(args);
        }
        if (unlikely(!value)) {
            __Pyx_ErrRestore(NULL, NULL, NULL);
            Py_INCREF(Py_None);
            value = Py_None;
        }
    }
#endif
    *pvalue = value;
    return 0;
}
static CYTHON_INLINE
void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *exc_state) {
    PyObject *t, *v, *tb;
    t = exc_state->exc_type;
    v = exc_state->exc_value;
    tb = exc_state->exc_traceback;
    exc_state->exc_type = NULL;
    exc_state->exc_value = NULL;
    exc_state->exc_traceback = NULL;
    Py_XDECREF(t);
    Py_XDECREF(v);
    Py_XDECREF(tb);
}
#define __Pyx_Coroutine_AlreadyRunningError(gen)  (__Pyx__Coroutine_AlreadyRunningError(gen), (PyObject*)NULL)
static void __Pyx__Coroutine_AlreadyRunningError(CYTHON_UNUSED __pyx_CoroutineObject *gen) {
    const char *msg;
    if ((0)) {
    #ifdef __Pyx_Coroutine_USED
    } else if (__Pyx_Coroutine_Check((PyObject*)gen)) {
        msg = "coroutine already executing";
    #endif
    #ifdef __Pyx_AsyncGen_USED
    } else if (__Pyx_AsyncGen_CheckExact((PyObject*)gen)) {
        msg = "async generator already executing";
    #endif
    } else {
        msg = "generator already executing";
    }
    PyErr_SetString(PyExc_ValueError, msg);
}
#define __Pyx_Coroutine_NotStartedError(gen)  (__Pyx__Coroutine_NotStartedError(gen), (PyObject*)NULL)
static void __Pyx__Coroutine_NotStartedError(CYTHON_UNUSED PyObject *gen) {
    const char *msg;
    if ((0)) {
    #ifdef __Pyx_Coroutine_USED
    } else if (__Pyx_Coroutine_Check(gen)) {
        msg = "can't send non-None value to a just-started coroutine";
    #endif
    #ifdef __Pyx_AsyncGen_USED
    } else if (__Pyx_AsyncGen_CheckExact(gen)) {
        msg = "can't send non-None value to a just-started async generator";
    #endif
    } else {
        msg = "can't send non-None value to a just-started generator";
    }
    PyErr_SetString(PyExc_TypeError, msg);
}
#define __Pyx_Coroutine_AlreadyTerminatedError(gen, value, closing)  (__Pyx__Coroutine_AlreadyTerminatedError(gen, value, closing), (PyObject*)NULL)
static void __Pyx__Coroutine_AlreadyTerminatedError(CYTHON_UNUSED PyObject *gen, PyObject *value, CYTHON_UNUSED int closing) {
    #ifdef __Pyx_Coroutine_USED
    if (!closing && __Pyx_Coroutine_Check(gen)) {
        PyErr_SetString(PyExc_RuntimeError, "cannot reuse already awaited coroutine");
    } else
    #endif
    if (value) {
        #ifdef __Pyx_AsyncGen_USED
        if (__Pyx_AsyncGen_CheckExact(gen))
            PyErr_SetNone(__Pyx_PyExc_StopAsyncIteration);
        else
        #endif
        PyErr_SetNone(PyExc_StopIteration);
    }
}
static
PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, int closing) {
    __Pyx_PyThreadState_declare
    PyThreadState *tstate;
    __Pyx_ExcInfoStruct *exc_state;
    PyObject *retval;
    assert(!self->is_running);
    if (unlikely(self->resume_label == 0)) {
        if (unlikely(value && value != Py_None)) {
            return __Pyx_Coroutine_NotStartedError((PyObject*)self);
        }
    }
    if (unlikely(self->resume_label == -1)) {
        return __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)self, value, closing);
    }
#if CYTHON_FAST_THREAD_STATE
    __Pyx_PyThreadState_assign
    tstate = __pyx_tstate;
#else
    tstate = __Pyx_PyThreadState_Current;
#endif
    exc_state = &self->gi_exc_state;
    if (exc_state->exc_type) {
        #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
        #else
        if (exc_state->exc_traceback) {
            PyTracebackObject *tb = (PyTracebackObject *) exc_state->exc_traceback;
            PyFrameObject *f = tb->tb_frame;
            Py_XINCREF(tstate->frame);
            assert(f->f_back == NULL);
            f->f_back = tstate->frame;
        }
        #endif
    }
#if CYTHON_USE_EXC_INFO_STACK
    exc_state->previous_item = tstate->exc_info;
    tstate->exc_info = exc_state;
#else
    if (exc_state->exc_type) {
        __Pyx_ExceptionSwap(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback);
    } else {
        __Pyx_Coroutine_ExceptionClear(exc_state);
        __Pyx_ExceptionSave(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback);
    }
#endif
    self->is_running = 1;
    retval = self->body((PyObject *) self, tstate, value);
    self->is_running = 0;
#if CYTHON_USE_EXC_INFO_STACK
    exc_state = &self->gi_exc_state;
    tstate->exc_info = exc_state->previous_item;
    exc_state->previous_item = NULL;
    __Pyx_Coroutine_ResetFrameBackpointer(exc_state);
#endif
    return retval;
}
static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state) {
    PyObject *exc_tb = exc_state->exc_traceback;
    if (likely(exc_tb)) {
#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
#else
        PyTracebackObject *tb = (PyTracebackObject *) exc_tb;
        PyFrameObject *f = tb->tb_frame;
        Py_CLEAR(f->f_back);
#endif
    }
}
static CYTHON_INLINE
PyObject *__Pyx_Coroutine_MethodReturn(CYTHON_UNUSED PyObject* gen, PyObject *retval) {
    if (unlikely(!retval)) {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        if (!__Pyx_PyErr_Occurred()) {
            PyObject *exc = PyExc_StopIteration;
            #ifdef __Pyx_AsyncGen_USED
            if (__Pyx_AsyncGen_CheckExact(gen))
                exc = __Pyx_PyExc_StopAsyncIteration;
            #endif
            __Pyx_PyErr_SetNone(exc);
        }
    }
    return retval;
}
static CYTHON_INLINE
PyObject *__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen) {
    PyObject *ret;
    PyObject *val = NULL;
    __Pyx_Coroutine_Undelegate(gen);
    __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, &val);
    ret = __Pyx_Coroutine_SendEx(gen, val, 0);
    Py_XDECREF(val);
    return ret;
}
static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) {
    PyObject *retval;
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
    PyObject *yf = gen->yieldfrom;
    if (unlikely(gen->is_running))
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    if (yf) {
        PyObject *ret;
        gen->is_running = 1;
        #ifdef __Pyx_Generator_USED
        if (__Pyx_Generator_CheckExact(yf)) {
            ret = __Pyx_Coroutine_Send(yf, value);
        } else
        #endif
        #ifdef __Pyx_Coroutine_USED
        if (__Pyx_Coroutine_Check(yf)) {
            ret = __Pyx_Coroutine_Send(yf, value);
        } else
        #endif
        #ifdef __Pyx_AsyncGen_USED
        if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
            ret = __Pyx_async_gen_asend_send(yf, value);
        } else
        #endif
        #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
        if (PyGen_CheckExact(yf)) {
            ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
        } else
        #endif
        #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03050000 && defined(PyCoro_CheckExact) && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
        if (PyCoro_CheckExact(yf)) {
            ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
        } else
        #endif
        {
            if (value == Py_None)
                ret = Py_TYPE(yf)->tp_iternext(yf);
            else
                ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s_send, value);
        }
        gen->is_running = 0;
        if (likely(ret)) {
            return ret;
        }
        retval = __Pyx_Coroutine_FinishDelegation(gen);
    } else {
        retval = __Pyx_Coroutine_SendEx(gen, value, 0);
    }
    return __Pyx_Coroutine_MethodReturn(self, retval);
}
static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) {
    PyObject *retval = NULL;
    int err = 0;
    #ifdef __Pyx_Generator_USED
    if (__Pyx_Generator_CheckExact(yf)) {
        retval = __Pyx_Coroutine_Close(yf);
        if (!retval)
            return -1;
    } else
    #endif
    #ifdef __Pyx_Coroutine_USED
    if (__Pyx_Coroutine_Check(yf)) {
        retval = __Pyx_Coroutine_Close(yf);
        if (!retval)
            return -1;
    } else
    if (__Pyx_CoroutineAwait_CheckExact(yf)) {
        retval = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf, NULL);
        if (!retval)
            return -1;
    } else
    #endif
    #ifdef __Pyx_AsyncGen_USED
    if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
        retval = __Pyx_async_gen_asend_close(yf, NULL);
    } else
    if (__pyx_PyAsyncGenAThrow_CheckExact(yf)) {
        retval = __Pyx_async_gen_athrow_close(yf, NULL);
    } else
    #endif
    {
        PyObject *meth;
        gen->is_running = 1;
        meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_close);
        if (unlikely(!meth)) {
            if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
                PyErr_WriteUnraisable(yf);
            }
            PyErr_Clear();
        } else {
            retval = PyObject_CallFunction(meth, NULL);
            Py_DECREF(meth);
            if (!retval)
                err = -1;
        }
        gen->is_running = 0;
    }
    Py_XDECREF(retval);
    return err;
}
static PyObject *__Pyx_Generator_Next(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
    PyObject *yf = gen->yieldfrom;
    if (unlikely(gen->is_running))
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    if (yf) {
        PyObject *ret;
        gen->is_running = 1;
        #ifdef __Pyx_Generator_USED
        if (__Pyx_Generator_CheckExact(yf)) {
            ret = __Pyx_Generator_Next(yf);
        } else
        #endif
        #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
        if (PyGen_CheckExact(yf)) {
            ret = _PyGen_Send((PyGenObject*)yf, NULL);
        } else
        #endif
        #ifdef __Pyx_Coroutine_USED
        if (__Pyx_Coroutine_Check(yf)) {
            ret = __Pyx_Coroutine_Send(yf, Py_None);
        } else
        #endif
            ret = Py_TYPE(yf)->tp_iternext(yf);
        gen->is_running = 0;
        if (likely(ret)) {
            return ret;
        }
        return __Pyx_Coroutine_FinishDelegation(gen);
    }
    return __Pyx_Coroutine_SendEx(gen, Py_None, 0);
}
static PyObject *__Pyx_Coroutine_Close_Method(PyObject *self, CYTHON_UNUSED PyObject *arg) {
    return __Pyx_Coroutine_Close(self);
}
static PyObject *__Pyx_Coroutine_Close(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    PyObject *retval, *raised_exception;
    PyObject *yf = gen->yieldfrom;
    int err = 0;
    if (unlikely(gen->is_running))
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    if (yf) {
        Py_INCREF(yf);
        err = __Pyx_Coroutine_CloseIter(gen, yf);
        __Pyx_Coroutine_Undelegate(gen);
        Py_DECREF(yf);
    }
    if (err == 0)
        PyErr_SetNone(PyExc_GeneratorExit);
    retval = __Pyx_Coroutine_SendEx(gen, NULL, 1);
    if (unlikely(retval)) {
        const char *msg;
        Py_DECREF(retval);
        if ((0)) {
        #ifdef __Pyx_Coroutine_USED
        } else if (__Pyx_Coroutine_Check(self)) {
            msg = "coroutine ignored GeneratorExit";
        #endif
        #ifdef __Pyx_AsyncGen_USED
        } else if (__Pyx_AsyncGen_CheckExact(self)) {
#if PY_VERSION_HEX < 0x03060000
            msg = "async generator ignored GeneratorExit - might require Python 3.6+ finalisation (PEP 525)";
#else
            msg = "async generator ignored GeneratorExit";
#endif
        #endif
        } else {
            msg = "generator ignored GeneratorExit";
        }
        PyErr_SetString(PyExc_RuntimeError, msg);
        return NULL;
    }
    raised_exception = PyErr_Occurred();
    if (likely(!raised_exception || __Pyx_PyErr_GivenExceptionMatches2(raised_exception, PyExc_GeneratorExit, PyExc_StopIteration))) {
        if (raised_exception) PyErr_Clear();
        Py_INCREF(Py_None);
        return Py_None;
    }
    return NULL;
}
static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject *val, PyObject *tb,
                                        PyObject *args, int close_on_genexit) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    PyObject *yf = gen->yieldfrom;
    if (unlikely(gen->is_running))
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    if (yf) {
        PyObject *ret;
        Py_INCREF(yf);
        if (__Pyx_PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit) && close_on_genexit) {
            int err = __Pyx_Coroutine_CloseIter(gen, yf);
            Py_DECREF(yf);
            __Pyx_Coroutine_Undelegate(gen);
            if (err < 0)
                return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
            goto throw_here;
        }
        gen->is_running = 1;
        if (0
        #ifdef __Pyx_Generator_USED
            || __Pyx_Generator_CheckExact(yf)
        #endif
        #ifdef __Pyx_Coroutine_USED
            || __Pyx_Coroutine_Check(yf)
        #endif
            ) {
            ret = __Pyx__Coroutine_Throw(yf, typ, val, tb, args, close_on_genexit);
        #ifdef __Pyx_Coroutine_USED
        } else if (__Pyx_CoroutineAwait_CheckExact(yf)) {
            ret = __Pyx__Coroutine_Throw(((__pyx_CoroutineAwaitObject*)yf)->coroutine, typ, val, tb, args, close_on_genexit);
        #endif
        } else {
            PyObject *meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_throw);
            if (unlikely(!meth)) {
                Py_DECREF(yf);
                if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
                    gen->is_running = 0;
                    return NULL;
                }
                PyErr_Clear();
                __Pyx_Coroutine_Undelegate(gen);
                gen->is_running = 0;
                goto throw_here;
            }
            if (likely(args)) {
                ret = PyObject_CallObject(meth, args);
            } else {
                ret = PyObject_CallFunctionObjArgs(meth, typ, val, tb, NULL);
            }
            Py_DECREF(meth);
        }
        gen->is_running = 0;
        Py_DECREF(yf);
        if (!ret) {
            ret = __Pyx_Coroutine_FinishDelegation(gen);
        }
        return __Pyx_Coroutine_MethodReturn(self, ret);
    }
throw_here:
    __Pyx_Raise(typ, val, tb, NULL);
    return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
}
static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) {
    PyObject *typ;
    PyObject *val = NULL;
    PyObject *tb = NULL;
    if (!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb))
        return NULL;
    return __Pyx__Coroutine_Throw(self, typ, val, tb, args, 1);
}
static CYTHON_INLINE int __Pyx_Coroutine_traverse_excstate(__Pyx_ExcInfoStruct *exc_state, visitproc visit, void *arg) {
    Py_VISIT(exc_state->exc_type);
    Py_VISIT(exc_state->exc_value);
    Py_VISIT(exc_state->exc_traceback);
    return 0;
}
static int __Pyx_Coroutine_traverse(__pyx_CoroutineObject *gen, visitproc visit, void *arg) {
    Py_VISIT(gen->closure);
    Py_VISIT(gen->classobj);
    Py_VISIT(gen->yieldfrom);
    return __Pyx_Coroutine_traverse_excstate(&gen->gi_exc_state, visit, arg);
}
static int __Pyx_Coroutine_clear(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    Py_CLEAR(gen->closure);
    Py_CLEAR(gen->classobj);
    Py_CLEAR(gen->yieldfrom);
    __Pyx_Coroutine_ExceptionClear(&gen->gi_exc_state);
#ifdef __Pyx_AsyncGen_USED
    if (__Pyx_AsyncGen_CheckExact(self)) {
        Py_CLEAR(((__pyx_PyAsyncGenObject*)gen)->ag_finalizer);
    }
#endif
    Py_CLEAR(gen->gi_code);
    Py_CLEAR(gen->gi_name);
    Py_CLEAR(gen->gi_qualname);
    Py_CLEAR(gen->gi_modulename);
    return 0;
}
static void __Pyx_Coroutine_dealloc(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    PyObject_GC_UnTrack(gen);
    if (gen->gi_weakreflist != NULL)
        PyObject_ClearWeakRefs(self);
    if (gen->resume_label >= 0) {
        PyObject_GC_Track(self);
#if PY_VERSION_HEX >= 0x030400a1 && CYTHON_USE_TP_FINALIZE
        if (PyObject_CallFinalizerFromDealloc(self))
#else
        Py_TYPE(gen)->tp_del(self);
        if (self->ob_refcnt > 0)
#endif
        {
            return;
        }
        PyObject_GC_UnTrack(self);
    }
#ifdef __Pyx_AsyncGen_USED
    if (__Pyx_AsyncGen_CheckExact(self)) {
        /* We have to handle this case for asynchronous generators
           right here, because this code has to be between UNTRACK
           and GC_Del. */
        Py_CLEAR(((__pyx_PyAsyncGenObject*)self)->ag_finalizer);
    }
#endif
    __Pyx_Coroutine_clear(self);
    PyObject_GC_Del(gen);
}
static void __Pyx_Coroutine_del(PyObject *self) {
    PyObject *error_type, *error_value, *error_traceback;
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    __Pyx_PyThreadState_declare
    if (gen->resume_label < 0) {
        return;
    }
#if !CYTHON_USE_TP_FINALIZE
    assert(self->ob_refcnt == 0);
    self->ob_refcnt = 1;
#endif
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&error_type, &error_value, &error_traceback);
#ifdef __Pyx_AsyncGen_USED
    if (__Pyx_AsyncGen_CheckExact(self)) {
        __pyx_PyAsyncGenObject *agen = (__pyx_PyAsyncGenObject*)self;
        PyObject *finalizer = agen->ag_finalizer;
        if (finalizer && !agen->ag_closed) {
            PyObject *res = __Pyx_PyObject_CallOneArg(finalizer, self);
            if (unlikely(!res)) {
                PyErr_WriteUnraisable(self);
            } else {
                Py_DECREF(res);
            }
            __Pyx_ErrRestore(error_type, error_value, error_traceback);
            return;
        }
    }
#endif
    if (unlikely(gen->resume_label == 0 && !error_value)) {
#ifdef __Pyx_Coroutine_USED
#ifdef __Pyx_Generator_USED
    if (!__Pyx_Generator_CheckExact(self))
#endif
        {
        PyObject_GC_UnTrack(self);
#if PY_MAJOR_VERSION >= 3  || defined(PyErr_WarnFormat)
        if (unlikely(PyErr_WarnFormat(PyExc_RuntimeWarning, 1, "coroutine '%.50S' was never awaited", gen->gi_qualname) < 0))
            PyErr_WriteUnraisable(self);
#else
        {PyObject *msg;
        char *cmsg;
        #if CYTHON_COMPILING_IN_PYPY
        msg = NULL;
        cmsg = (char*) "coroutine was never awaited";
        #else
        char *cname;
        PyObject *qualname;
        qualname = gen->gi_qualname;
        cname = PyString_AS_STRING(qualname);
        msg = PyString_FromFormat("coroutine '%.50s' was never awaited", cname);
        if (unlikely(!msg)) {
            PyErr_Clear();
            cmsg = (char*) "coroutine was never awaited";
        } else {
            cmsg = PyString_AS_STRING(msg);
        }
        #endif
        if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, cmsg, 1) < 0))
            PyErr_WriteUnraisable(self);
        Py_XDECREF(msg);}
#endif
        PyObject_GC_Track(self);
        }
#endif
    } else {
        PyObject *res = __Pyx_Coroutine_Close(self);
        if (unlikely(!res)) {
            if (PyErr_Occurred())
                PyErr_WriteUnraisable(self);
        } else {
            Py_DECREF(res);
        }
    }
    __Pyx_ErrRestore(error_type, error_value, error_traceback);
#if !CYTHON_USE_TP_FINALIZE
    assert(self->ob_refcnt > 0);
    if (--self->ob_refcnt == 0) {
        return;
    }
    {
        Py_ssize_t refcnt = self->ob_refcnt;
        _Py_NewReference(self);
        self->ob_refcnt = refcnt;
    }
#if CYTHON_COMPILING_IN_CPYTHON
    assert(PyType_IS_GC(self->ob_type) &&
           _Py_AS_GC(self)->gc.gc_refs != _PyGC_REFS_UNTRACKED);
    _Py_DEC_REFTOTAL;
#endif
#ifdef COUNT_ALLOCS
    --Py_TYPE(self)->tp_frees;
    --Py_TYPE(self)->tp_allocs;
#endif
#endif
}
static PyObject *
__Pyx_Coroutine_get_name(__pyx_CoroutineObject *self, CYTHON_UNUSED void *context)
{
    PyObject *name = self->gi_name;
    if (unlikely(!name)) name = Py_None;
    Py_INCREF(name);
    return name;
}
static int
__Pyx_Coroutine_set_name(__pyx_CoroutineObject *self, PyObject *value, CYTHON_UNUSED void *context)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value)))
#else
    if (unlikely(value == NULL || !PyString_Check(value)))
#endif
    {
        PyErr_SetString(PyExc_TypeError,
                        "__name__ must be set to a string object");
        return -1;
    }
    tmp = self->gi_name;
    Py_INCREF(value);
    self->gi_name = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_Coroutine_get_qualname(__pyx_CoroutineObject *self, CYTHON_UNUSED void *context)
{
    PyObject *name = self->gi_qualname;
    if (unlikely(!name)) name = Py_None;
    Py_INCREF(name);
    return name;
}
static int
__Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value, CYTHON_UNUSED void *context)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value)))
#else
    if (unlikely(value == NULL || !PyString_Check(value)))
#endif
    {
        PyErr_SetString(PyExc_TypeError,
                        "__qualname__ must be set to a string object");
        return -1;
    }
    tmp = self->gi_qualname;
    Py_INCREF(value);
    self->gi_qualname = value;
    Py_XDECREF(tmp);
    return 0;
}
static __pyx_CoroutineObject *__Pyx__Coroutine_New(
            PyTypeObject* type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
            PyObject *name, PyObject *qualname, PyObject *module_name) {
    __pyx_CoroutineObject *gen = PyObject_GC_New(__pyx_CoroutineObject, type);
    if (unlikely(!gen))
        return NULL;
    return __Pyx__Coroutine_NewInit(gen, body, code, closure, name, qualname, module_name);
}
static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
            __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
            PyObject *name, PyObject *qualname, PyObject *module_name) {
    gen->body = body;
    gen->closure = closure;
    Py_XINCREF(closure);
    gen->is_running = 0;
    gen->resume_label = 0;
    gen->classobj = NULL;
    gen->yieldfrom = NULL;
    gen->gi_exc_state.exc_type = NULL;
    gen->gi_exc_state.exc_value = NULL;
    gen->gi_exc_state.exc_traceback = NULL;
#if CYTHON_USE_EXC_INFO_STACK
    gen->gi_exc_state.previous_item = NULL;
#endif
    gen->gi_weakreflist = NULL;
    Py_XINCREF(qualname);
    gen->gi_qualname = qualname;
    Py_XINCREF(name);
    gen->gi_name = name;
    Py_XINCREF(module_name);
    gen->gi_modulename = module_name;
    Py_XINCREF(code);
    gen->gi_code = code;
    PyObject_GC_Track(gen);
    return gen;
}

/* PatchModuleWithCoroutine */
        static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code) {
#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
    int result;
    PyObject *globals, *result_obj;
    globals = PyDict_New();  if (unlikely(!globals)) goto ignore;
    result = PyDict_SetItemString(globals, "_cython_coroutine_type",
    #ifdef __Pyx_Coroutine_USED
        (PyObject*)__pyx_CoroutineType);
    #else
        Py_None);
    #endif
    if (unlikely(result < 0)) goto ignore;
    result = PyDict_SetItemString(globals, "_cython_generator_type",
    #ifdef __Pyx_Generator_USED
        (PyObject*)__pyx_GeneratorType);
    #else
        Py_None);
    #endif
    if (unlikely(result < 0)) goto ignore;
    if (unlikely(PyDict_SetItemString(globals, "_module", module) < 0)) goto ignore;
    if (unlikely(PyDict_SetItemString(globals, "__builtins__", __pyx_b) < 0)) goto ignore;
    result_obj = PyRun_String(py_code, Py_file_input, globals, globals);
    if (unlikely(!result_obj)) goto ignore;
    Py_DECREF(result_obj);
    Py_DECREF(globals);
    return module;
ignore:
    Py_XDECREF(globals);
    PyErr_WriteUnraisable(module);
    if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, "Cython module failed to patch module with custom type", 1) < 0)) {
        Py_DECREF(module);
        module = NULL;
    }
#else
    py_code++;
#endif
    return module;
}

/* PatchGeneratorABC */
        #ifndef CYTHON_REGISTER_ABCS
#define CYTHON_REGISTER_ABCS 1
#endif
#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
static PyObject* __Pyx_patch_abc_module(PyObject *module);
static PyObject* __Pyx_patch_abc_module(PyObject *module) {
    module = __Pyx_Coroutine_patch_module(
        module, ""
"if _cython_generator_type is not None:\n"
"    try: Generator = _module.Generator\n"
"    except AttributeError: pass\n"
"    else: Generator.register(_cython_generator_type)\n"
"if _cython_coroutine_type is not None:\n"
"    try: Coroutine = _module.Coroutine\n"
"    except AttributeError: pass\n"
"    else: Coroutine.register(_cython_coroutine_type)\n"
    );
    return module;
}
#endif
static int __Pyx_patch_abc(void) {
#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
    static int abc_patched = 0;
    if (CYTHON_REGISTER_ABCS && !abc_patched) {
        PyObject *module;
        module = PyImport_ImportModule((PY_MAJOR_VERSION >= 3) ? "collections.abc" : "collections");
        if (!module) {
            PyErr_WriteUnraisable(NULL);
            if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning,
                    ((PY_MAJOR_VERSION >= 3) ?
                        "Cython module failed to register with collections.abc module" :
                        "Cython module failed to register with collections module"), 1) < 0)) {
                return -1;
            }
        } else {
            module = __Pyx_patch_abc_module(module);
            abc_patched = 1;
            if (unlikely(!module))
                return -1;
            Py_DECREF(module);
        }
        module = PyImport_ImportModule("backports_abc");
        if (module) {
            module = __Pyx_patch_abc_module(module);
            Py_XDECREF(module);
        }
        if (!module) {
            PyErr_Clear();
        }
    }
#else
    if ((0)) __Pyx_Coroutine_patch_module(NULL, NULL);
#endif
    return 0;
}

/* Generator */
        static PyMethodDef __pyx_Generator_methods[] = {
    {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O,
     (char*) PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")},
    {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS,
     (char*) PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")},
    {"close", (PyCFunction) __Pyx_Coroutine_Close_Method, METH_NOARGS,
     (char*) PyDoc_STR("close() -> raise GeneratorExit inside generator.")},
    {0, 0, 0, 0}
};
static PyMemberDef __pyx_Generator_memberlist[] = {
    {(char *) "gi_running", T_BOOL, offsetof(__pyx_CoroutineObject, is_running), READONLY, NULL},
    {(char*) "gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY,
     (char*) PyDoc_STR("object being iterated by 'yield from', or None")},
    {(char*) "gi_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL},
    {0, 0, 0, 0, 0}
};
static PyGetSetDef __pyx_Generator_getsets[] = {
    {(char *) "__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name,
     (char*) PyDoc_STR("name of the generator"), 0},
    {(char *) "__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname,
     (char*) PyDoc_STR("qualified name of the generator"), 0},
    {0, 0, 0, 0, 0}
};
static PyTypeObject __pyx_GeneratorType_type = {
    PyVarObject_HEAD_INIT(0, 0)
    "generator",
    sizeof(__pyx_CoroutineObject),
    0,
    (destructor) __Pyx_Coroutine_dealloc,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE,
    0,
    (traverseproc) __Pyx_Coroutine_traverse,
    0,
    0,
    offsetof(__pyx_CoroutineObject, gi_weakreflist),
    0,
    (iternextfunc) __Pyx_Generator_Next,
    __pyx_Generator_methods,
    __pyx_Generator_memberlist,
    __pyx_Generator_getsets,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
#if CYTHON_USE_TP_FINALIZE
    0,
#else
    __Pyx_Coroutine_del,
#endif
    0,
#if CYTHON_USE_TP_FINALIZE
    __Pyx_Coroutine_del,
#elif PY_VERSION_HEX >= 0x030400a1
    0,
#endif
#if PY_VERSION_HEX >= 0x030800b1
    0,
#endif
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
    0,
#endif
};
static int __pyx_Generator_init(void) {
    __pyx_GeneratorType_type.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
    __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter;
    __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type);
    if (unlikely(!__pyx_GeneratorType)) {
        return -1;
    }
    return 0;
}

/* CheckBinaryVersion */
        static int __Pyx_check_binary_version(void) {
    char ctversion[4], rtversion[4];
    PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
    PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
    if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
        char message[200];
        PyOS_snprintf(message, sizeof(message),
                      "compiletime version %s of module '%.100s' "
                      "does not match runtime version %s",
                      ctversion, __Pyx_MODULE_NAME, rtversion);
        return PyErr_WarnEx(NULL, message, 1);
    }
    return 0;
}

/* InitStrings */
        static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
    while (t->p) {
        #if PY_MAJOR_VERSION < 3
        if (t->is_unicode) {
            *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
        } else if (t->intern) {
            *t->p = PyString_InternFromString(t->s);
        } else {
            *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
        }
        #else
        if (t->is_unicode | t->is_str) {
            if (t->intern) {
                *t->p = PyUnicode_InternFromString(t->s);
            } else if (t->encoding) {
                *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
            } else {
                *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
            }
        } else {
            *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
        }
        #endif
        if (!*t->p)
            return -1;
        if (PyObject_Hash(*t->p) == -1)
            return -1;
        ++t;
    }
    return 0;
}

static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
    return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
}
static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
    Py_ssize_t ignore;
    return __Pyx_PyObject_AsStringAndSize(o, &ignore);
}
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
#if !CYTHON_PEP393_ENABLED
static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
    char* defenc_c;
    PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
    if (!defenc) return NULL;
    defenc_c = PyBytes_AS_STRING(defenc);
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
    {
        char* end = defenc_c + PyBytes_GET_SIZE(defenc);
        char* c;
        for (c = defenc_c; c < end; c++) {
            if ((unsigned char) (*c) >= 128) {
                PyUnicode_AsASCIIString(o);
                return NULL;
            }
        }
    }
#endif
    *length = PyBytes_GET_SIZE(defenc);
    return defenc_c;
}
#else
static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
    if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
    if (likely(PyUnicode_IS_ASCII(o))) {
        *length = PyUnicode_GET_LENGTH(o);
        return PyUnicode_AsUTF8(o);
    } else {
        PyUnicode_AsASCIIString(o);
        return NULL;
    }
#else
    return PyUnicode_AsUTF8AndSize(o, length);
#endif
}
#endif
#endif
static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
    if (
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
            __Pyx_sys_getdefaultencoding_not_ascii &&
#endif
            PyUnicode_Check(o)) {
        return __Pyx_PyUnicode_AsStringAndSize(o, length);
    } else
#endif
#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
    if (PyByteArray_Check(o)) {
        *length = PyByteArray_GET_SIZE(o);
        return PyByteArray_AS_STRING(o);
    } else
#endif
    {
        char* result;
        int r = PyBytes_AsStringAndSize(o, &result, length);
        if (unlikely(r < 0)) {
            return NULL;
        } else {
            return result;
        }
    }
}
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
   int is_true = x == Py_True;
   if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
   else return PyObject_IsTrue(x);
}
static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
    int retval;
    if (unlikely(!x)) return -1;
    retval = __Pyx_PyObject_IsTrue(x);
    Py_DECREF(x);
    return retval;
}
static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
#if PY_MAJOR_VERSION >= 3
    if (PyLong_Check(result)) {
        if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
                "__int__ returned non-int (type %.200s).  "
                "The ability to return an instance of a strict subclass of int "
                "is deprecated, and may be removed in a future version of Python.",
                Py_TYPE(result)->tp_name)) {
            Py_DECREF(result);
            return NULL;
        }
        return result;
    }
#endif
    PyErr_Format(PyExc_TypeError,
                 "__%.4s__ returned non-%.4s (type %.200s)",
                 type_name, type_name, Py_TYPE(result)->tp_name);
    Py_DECREF(result);
    return NULL;
}
static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
#if CYTHON_USE_TYPE_SLOTS
  PyNumberMethods *m;
#endif
  const char *name = NULL;
  PyObject *res = NULL;
#if PY_MAJOR_VERSION < 3
  if (likely(PyInt_Check(x) || PyLong_Check(x)))
#else
  if (likely(PyLong_Check(x)))
#endif
    return __Pyx_NewRef(x);
#if CYTHON_USE_TYPE_SLOTS
  m = Py_TYPE(x)->tp_as_number;
  #if PY_MAJOR_VERSION < 3
  if (m && m->nb_int) {
    name = "int";
    res = m->nb_int(x);
  }
  else if (m && m->nb_long) {
    name = "long";
    res = m->nb_long(x);
  }
  #else
  if (likely(m && m->nb_int)) {
    name = "int";
    res = m->nb_int(x);
  }
  #endif
#else
  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
    res = PyNumber_Int(x);
  }
#endif
  if (likely(res)) {
#if PY_MAJOR_VERSION < 3
    if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
#else
    if (unlikely(!PyLong_CheckExact(res))) {
#endif
        return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
    }
  }
  else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_TypeError,
                    "an integer is required");
  }
  return res;
}
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  Py_ssize_t ival;
  PyObject *x;
#if PY_MAJOR_VERSION < 3
  if (likely(PyInt_CheckExact(b))) {
    if (sizeof(Py_ssize_t) >= sizeof(long))
        return PyInt_AS_LONG(b);
    else
        return PyInt_AsSsize_t(b);
  }
#endif
  if (likely(PyLong_CheckExact(b))) {
    #if CYTHON_USE_PYLONG_INTERNALS
    const digit* digits = ((PyLongObject*)b)->ob_digit;
    const Py_ssize_t size = Py_SIZE(b);
    if (likely(__Pyx_sst_abs(size) <= 1)) {
        ival = likely(size) ? digits[0] : 0;
        if (size == -1) ival = -ival;
        return ival;
    } else {
      switch (size) {
         case 2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
      }
    }
    #endif
    return PyLong_AsSsize_t(b);
  }
  x = PyNumber_Index(b);
  if (!x) return -1;
  ival = PyInt_AsSsize_t(x);
  Py_DECREF(x);
  return ival;
}
static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
  return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
}
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
    return PyInt_FromSize_t(ival);
}


#endif /* Py_PYTHON_H */
